node-sped-nfe 1.1.5 → 1.1.7

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.
Files changed (431) hide show
  1. package/README.md +16 -1
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +2 -2
  4. package/dist/utils/eventos.js +74 -76
  5. package/dist/utils/extras.d.ts +3 -1
  6. package/dist/utils/extras.js +49 -1
  7. package/dist/utils/tools.d.ts +13 -0
  8. package/dist/utils/tools.js +278 -61
  9. package/package.json +5 -3
  10. package/schemas/PL_009_V4/110150_v1.00.xsd +88 -0
  11. package/schemas/PL_009_V4/Averb_v1.00.xsd +11 -0
  12. package/schemas/PL_009_V4/CCe_v1.00.xsd +11 -0
  13. package/schemas/PL_009_V4/EPEC_v1.00.xsd +9 -0
  14. package/schemas/PL_009_V4/EPP1.xml +13 -0
  15. package/schemas/PL_009_V4/ERP1.xml +19 -0
  16. package/schemas/PL_009_V4/EventoCancEConf_v1.00.xsd +9 -0
  17. package/schemas/PL_009_V4/EventoCancInsucessoNFe_v1.00.xsd +9 -0
  18. package/schemas/PL_009_V4/EventoEConf_v1.00.xsd +9 -0
  19. package/schemas/PL_009_V4/EventoInsucessoNFe_v1.00.xsd +9 -0
  20. package/schemas/PL_009_V4/MT_inutNFe_v4.00.xsd +9 -0
  21. package/schemas/PL_009_V4/SuframaInternaliza_v1.00.xsd +9 -0
  22. package/schemas/PL_009_V4/SuframaVistoria_v1.00.xsd +9 -0
  23. package/schemas/PL_009_V4/confRecebto_v1.00.xsd +9 -0
  24. package/schemas/PL_009_V4/consCad_v2.00.xsd +9 -0
  25. package/schemas/PL_009_V4/consGTIN_v1.00.xsd +10 -0
  26. package/schemas/PL_009_V4/consNFeDest_v1.01.xsd +10 -0
  27. package/schemas/PL_009_V4/consReciNFe_v3.10.xsd +9 -0
  28. package/schemas/PL_009_V4/consReciNFe_v4.00.xsd +9 -0
  29. package/schemas/PL_009_V4/consSitNFe_v3.10.xsd +9 -0
  30. package/schemas/PL_009_V4/consSitNFe_v4.00.xsd +9 -0
  31. package/schemas/PL_009_V4/consStatServ_v3.10.xsd +9 -0
  32. package/schemas/PL_009_V4/consStatServ_v4.00.xsd +9 -0
  33. package/schemas/PL_009_V4/distDFeInt_v1.00.xsd +71 -0
  34. package/schemas/PL_009_V4/distDFeInt_v1.01.xsd +97 -0
  35. package/schemas/PL_009_V4/downloadNFe_v1.00.xsd +10 -0
  36. package/schemas/PL_009_V4/e110110_v1.00.xsd +58 -0
  37. package/schemas/PL_009_V4/e110111_v1.00.xsd +42 -0
  38. package/schemas/PL_009_V4/e110112_v1.00.xsd +69 -0
  39. package/schemas/PL_009_V4/e110130_v1.00.xsd +102 -0
  40. package/schemas/PL_009_V4/e110131_v1.00.xsd +51 -0
  41. package/schemas/PL_009_V4/e110140NFCe_v1.00.xsd +118 -0
  42. package/schemas/PL_009_V4/e110140NFe_v1.00.xsd +124 -0
  43. package/schemas/PL_009_V4/e110140_v1.00.xsd +124 -0
  44. package/schemas/PL_009_V4/e110150_v1.00.xsd +88 -0
  45. package/schemas/PL_009_V4/e110192_v1.00.xsd +106 -0
  46. package/schemas/PL_009_V4/e110193_v1.00.xsd +40 -0
  47. package/schemas/PL_009_V4/e110750_v1.00.xsd +138 -0
  48. package/schemas/PL_009_V4/e110751_v1.00.xsd +39 -0
  49. package/schemas/PL_009_V4/e111500_v1.00.xsd +69 -0
  50. package/schemas/PL_009_V4/e111501_v1.00.xsd +69 -0
  51. package/schemas/PL_009_V4/e111502_v1.00.xsd +50 -0
  52. package/schemas/PL_009_V4/e111503_v1.00.xsd +50 -0
  53. package/schemas/PL_009_V4/e210200_v1.00.xsd +31 -0
  54. package/schemas/PL_009_V4/e210210_v1.00.xsd +31 -0
  55. package/schemas/PL_009_V4/e210220_v1.00.xsd +44 -0
  56. package/schemas/PL_009_V4/e210240_v1.00.xsd +44 -0
  57. package/schemas/PL_009_V4/e411500_v1.00.xsd +134 -0
  58. package/schemas/PL_009_V4/e411501_v1.00.xsd +134 -0
  59. package/schemas/PL_009_V4/e411502_v1.00.xsd +95 -0
  60. package/schemas/PL_009_V4/e411503_v1.00.xsd +95 -0
  61. package/schemas/PL_009_V4/e610130_v1.00.xsd +128 -0
  62. package/schemas/PL_009_V4/e610131_v1.00.xsd +68 -0
  63. package/schemas/PL_009_V4/e790700_v1.00.xsd +125 -0
  64. package/schemas/PL_009_V4/e990900_v1.00.xsd +87 -0
  65. package/schemas/PL_009_V4/e990910_v1.00.xsd +81 -0
  66. package/schemas/PL_009_V4/envAverb_v1.00.xsd +9 -0
  67. package/schemas/PL_009_V4/envCCe_v1.00.xsd +10 -0
  68. package/schemas/PL_009_V4/envCancelPProrrogNFe_v1.0.xsd +50 -0
  69. package/schemas/PL_009_V4/envComprovanteEntregaNFe_v1.00.xsd +11 -0
  70. package/schemas/PL_009_V4/envConfRecebto_v1.00.xsd +9 -0
  71. package/schemas/PL_009_V4/envEPEC_v1.00.xsd +9 -0
  72. package/schemas/PL_009_V4/envEventoAtorInteressado_v1.00.xsd +9 -0
  73. package/schemas/PL_009_V4/envEventoCancEConf_v1.00.xsd +10 -0
  74. package/schemas/PL_009_V4/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  75. package/schemas/PL_009_V4/envEventoCancInsucessoNFe_v1.00.xsd +10 -0
  76. package/schemas/PL_009_V4/envEventoCancNFe_v1.00.xsd +9 -0
  77. package/schemas/PL_009_V4/envEventoCancSubst_v1.00.xsd +9 -0
  78. package/schemas/PL_009_V4/envEventoEConf_v1.00.xsd +10 -0
  79. package/schemas/PL_009_V4/envEventoEntregaNFe_v1.00.xsd +10 -0
  80. package/schemas/PL_009_V4/envEventoInsucessoNFe_v1.00.xsd +10 -0
  81. package/schemas/PL_009_V4/envEvento_v1.00.xsd +9 -0
  82. package/schemas/PL_009_V4/envFiscoNfe_v1.0.xsd +179 -0
  83. package/schemas/PL_009_V4/envPProrrogNFe_v1.0.xsd +65 -0
  84. package/schemas/PL_009_V4/envRemIndus_v1.00.xsd +9 -0
  85. package/schemas/PL_009_V4/envSuframaInternaliza_v1.00.xsd +10 -0
  86. package/schemas/PL_009_V4/envSuframaVistoria_v1.00.xsd +10 -0
  87. package/schemas/PL_009_V4/enviNFe_v3.10.xsd +9 -0
  88. package/schemas/PL_009_V4/enviNFe_v4.00.xsd +9 -0
  89. package/schemas/PL_009_V4/eventoAtorInteressado_v1.00.xsd +9 -0
  90. package/schemas/PL_009_V4/eventoCancEntregaNFe_v1.00.xsd +9 -0
  91. package/schemas/PL_009_V4/eventoCancNFe_v1.00.xsd +9 -0
  92. package/schemas/PL_009_V4/eventoCancSubst_v1.00.xsd +9 -0
  93. package/schemas/PL_009_V4/eventoEPEC_v0.01.xsd +267 -0
  94. package/schemas/PL_009_V4/eventoEPEC_v1.00.xsd +231 -0
  95. package/schemas/PL_009_V4/eventoEntregaNFe_v1.00.xsd +9 -0
  96. package/schemas/PL_009_V4/eventoRemIndus_v1.00.xsd +9 -0
  97. package/schemas/PL_009_V4/inutNFe_v3.10.xsd +9 -0
  98. package/schemas/PL_009_V4/inutNFe_v4.00.xsd +9 -0
  99. package/schemas/PL_009_V4/leiauteAverb_v1.00.xsd +482 -0
  100. package/schemas/PL_009_V4/leiauteCCe_v1.00.xsd +382 -0
  101. package/schemas/PL_009_V4/leiauteCcgConsGTIN_v1.00.xsd +94 -0
  102. package/schemas/PL_009_V4/leiauteComprovanteEntregaNFe_v1.00.xsd +487 -0
  103. package/schemas/PL_009_V4/leiauteConfRecebto_v1.00.xsd +369 -0
  104. package/schemas/PL_009_V4/leiauteConsNFeDest_v1.01.xsd +483 -0
  105. package/schemas/PL_009_V4/leiauteConsSitNFe_v3.10.xsd +502 -0
  106. package/schemas/PL_009_V4/leiauteConsSitNFe_v4.00.xsd +502 -0
  107. package/schemas/PL_009_V4/leiauteConsStatServ_v3.10.xsd +98 -0
  108. package/schemas/PL_009_V4/leiauteConsStatServ_v4.00.xsd +98 -0
  109. package/schemas/PL_009_V4/leiauteConsultaCadastro_v2.00.xsd +404 -0
  110. package/schemas/PL_009_V4/leiauteDownloadNFe_v1.00.xsd +149 -0
  111. package/schemas/PL_009_V4/leiauteEPEC_v1.00.xsd +423 -0
  112. package/schemas/PL_009_V4/leiauteEventoAtorInteressado_v1.00.xsd +384 -0
  113. package/schemas/PL_009_V4/leiauteEventoCancEConf_v1.00.xsd +296 -0
  114. package/schemas/PL_009_V4/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  115. package/schemas/PL_009_V4/leiauteEventoCancInsucessoNFe_v1.00.xsd +297 -0
  116. package/schemas/PL_009_V4/leiauteEventoCancNFe_v1.00.xsd +358 -0
  117. package/schemas/PL_009_V4/leiauteEventoCancSubst_v1.00.xsd +366 -0
  118. package/schemas/PL_009_V4/leiauteEventoEConf_v1.00.xsd +296 -0
  119. package/schemas/PL_009_V4/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  120. package/schemas/PL_009_V4/leiauteEventoInsucessoNFe_v1.00.xsd +297 -0
  121. package/schemas/PL_009_V4/leiauteEvento_v1.00.xsd +335 -0
  122. package/schemas/PL_009_V4/leiauteInutNFe_v3.10.xsd +193 -0
  123. package/schemas/PL_009_V4/leiauteInutNFe_v4.00.xsd +193 -0
  124. package/schemas/PL_009_V4/leiauteInutNFe_v4.00_MT.xsd +200 -0
  125. package/schemas/PL_009_V4/leiauteNFe_v3.10.xsd +6060 -0
  126. package/schemas/PL_009_V4/leiauteNFe_v4.00.xsd +7412 -0
  127. package/schemas/PL_009_V4/leiauteRemIndus_v1.00.xsd +344 -0
  128. package/schemas/PL_009_V4/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  129. package/schemas/PL_009_V4/leiauteSuframaVistoria_v1.00.xsd +648 -0
  130. package/schemas/PL_009_V4/nfe_v3.10.xsd +9 -0
  131. package/schemas/PL_009_V4/nfe_v4.00.xsd +9 -0
  132. package/schemas/PL_009_V4/procAverbNFe_v1.00.xsd +10 -0
  133. package/schemas/PL_009_V4/procCCeNFe_v1.00.xsd +10 -0
  134. package/schemas/PL_009_V4/procComprovanteEntregaNFe_v1.00.xsd +10 -0
  135. package/schemas/PL_009_V4/procConfRecebtoNFe_v1.00.xsd +9 -0
  136. package/schemas/PL_009_V4/procEPEC_v1.00.xsd +9 -0
  137. package/schemas/PL_009_V4/procEventoAtorInteressado_v1.00.xsd +9 -0
  138. package/schemas/PL_009_V4/procEventoCancEConf_v1.00.xsd +9 -0
  139. package/schemas/PL_009_V4/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  140. package/schemas/PL_009_V4/procEventoCancInsucessoNFe_v1.00.xsd +9 -0
  141. package/schemas/PL_009_V4/procEventoCancNFe_v1.00.xsd +9 -0
  142. package/schemas/PL_009_V4/procEventoCancSubst_v1.00.xsd +9 -0
  143. package/schemas/PL_009_V4/procEventoEConf_v1.00.xsd +9 -0
  144. package/schemas/PL_009_V4/procEventoEntregaNFe_v1.00.xsd +9 -0
  145. package/schemas/PL_009_V4/procEventoInsucessoNFe_v1.00.xsd +9 -0
  146. package/schemas/PL_009_V4/procEventoNFe_v1.00.xsd +9 -0
  147. package/schemas/PL_009_V4/procEventoNFe_v99.99.xsd +37 -0
  148. package/schemas/PL_009_V4/procInutNFe_v3.10.xsd +9 -0
  149. package/schemas/PL_009_V4/procInutNFe_v4.00.xsd +9 -0
  150. package/schemas/PL_009_V4/procNFe_v3.10.xsd +9 -0
  151. package/schemas/PL_009_V4/procNFe_v4.00.xsd +9 -0
  152. package/schemas/PL_009_V4/procRemIndus_v1.00.xsd +9 -0
  153. package/schemas/PL_009_V4/prod_leiauteNFe_v4.00.xsd +6736 -0
  154. package/schemas/PL_009_V4/resEvento_v1.00.xsd +94 -0
  155. package/schemas/PL_009_V4/resEvento_v1.01.xsd +108 -0
  156. package/schemas/PL_009_V4/resNFe_v1.00.xsd +110 -0
  157. package/schemas/PL_009_V4/resNFe_v1.01.xsd +122 -0
  158. package/schemas/PL_009_V4/retComprovanteEntregaNFe_v1.00.xsd +10 -0
  159. package/schemas/PL_009_V4/retConsCad_v2.00.xsd +9 -0
  160. package/schemas/PL_009_V4/retConsGTIN_v1.00.xsd +9 -0
  161. package/schemas/PL_009_V4/retConsReciNFe_v3.10.xsd +9 -0
  162. package/schemas/PL_009_V4/retConsReciNFe_v4.00.xsd +9 -0
  163. package/schemas/PL_009_V4/retConsSitNFe_v3.10.xsd +9 -0
  164. package/schemas/PL_009_V4/retConsSitNFe_v4.00.xsd +9 -0
  165. package/schemas/PL_009_V4/retConsStatServ_v3.10.xsd +9 -0
  166. package/schemas/PL_009_V4/retConsStatServ_v4.00.xsd +9 -0
  167. package/schemas/PL_009_V4/retDistDFeInt_v1.00.xsd +84 -0
  168. package/schemas/PL_009_V4/retDistDFeInt_v1.01.xsd +99 -0
  169. package/schemas/PL_009_V4/retDownloadNFe_v1.00.xsd +9 -0
  170. package/schemas/PL_009_V4/retEnvAverb_v1.00.xsd +9 -0
  171. package/schemas/PL_009_V4/retEnvAverb_v1.00_1.xsd +9 -0
  172. package/schemas/PL_009_V4/retEnvCCe_v1.00.xsd +10 -0
  173. package/schemas/PL_009_V4/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  174. package/schemas/PL_009_V4/retEnvConfRecebto_v1.00.xsd +9 -0
  175. package/schemas/PL_009_V4/retEnvEPEC_v1.00.xsd +9 -0
  176. package/schemas/PL_009_V4/retEnvEventoAtorInteressado_v1.00.xsd +9 -0
  177. package/schemas/PL_009_V4/retEnvEventoCancNFe_v1.00.xsd +9 -0
  178. package/schemas/PL_009_V4/retEnvEventoCancSubst_v1.00.xsd +9 -0
  179. package/schemas/PL_009_V4/retEnvEvento_v1.00.xsd +9 -0
  180. package/schemas/PL_009_V4/retEnvFiscoNFe_v1.0.xsd +234 -0
  181. package/schemas/PL_009_V4/retEnvRemIndus_v1.00.xsd +9 -0
  182. package/schemas/PL_009_V4/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  183. package/schemas/PL_009_V4/retEnvSuframaVistoria_v1.00.xsd +9 -0
  184. package/schemas/PL_009_V4/retEnviNFe_v3.10.xsd +9 -0
  185. package/schemas/PL_009_V4/retEnviNFe_v4.00.xsd +9 -0
  186. package/schemas/PL_009_V4/retEventoCancEConf_v1.00.xsd +9 -0
  187. package/schemas/PL_009_V4/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  188. package/schemas/PL_009_V4/retEventoCancInsucessoNFe_v1.00.xsd +9 -0
  189. package/schemas/PL_009_V4/retEventoEConf_v1.00.xsd +9 -0
  190. package/schemas/PL_009_V4/retEventoEPEC_v0.01.xsd +207 -0
  191. package/schemas/PL_009_V4/retEventoEntregaNFe_v1.00.xsd +9 -0
  192. package/schemas/PL_009_V4/retEventoInsucessoNFe_v1.00.xsd +9 -0
  193. package/schemas/PL_009_V4/retInutNFe_v3.10.xsd +9 -0
  194. package/schemas/PL_009_V4/retInutNFe_v4.00.xsd +9 -0
  195. package/schemas/PL_009_V4/retPProrrogNFe_v1.0.xsd +233 -0
  196. package/schemas/PL_009_V4/retconsNFeDest_v1.01.xsd +9 -0
  197. package/schemas/PL_009_V4/tiposBasico_v1.03.xsd +871 -0
  198. package/schemas/PL_009_V4/tiposBasico_v3.10.xsd +571 -0
  199. package/schemas/PL_009_V4/tiposBasico_v4.00.xsd +598 -0
  200. package/schemas/PL_009_V4/tiposBasicosCcgConsGTIN_v1.00.xsd +84 -0
  201. package/schemas/PL_009_V4/tiposDistDFe_v1.00.xsd +217 -0
  202. package/schemas/PL_009_V4/tiposDistDFe_v1.01.xsd +222 -0
  203. package/schemas/PL_009_V4/xmldsig-core-schema_v1.01.xsd +98 -0
  204. package/schemas/PL_009p_NT2024_003/consReciNFe_v4.00.xsd +9 -0
  205. package/schemas/PL_009p_NT2024_003/consSitNFe_v4.00.xsd +9 -0
  206. package/schemas/PL_009p_NT2024_003/consStatServ_v4.00.xsd +9 -0
  207. package/schemas/PL_009p_NT2024_003/enviNFe_v4.00.xsd +9 -0
  208. package/schemas/PL_009p_NT2024_003/inutNFe_v4.00.xsd +9 -0
  209. package/schemas/PL_009p_NT2024_003/leiauteConsSitNFe_v4.00.xsd +502 -0
  210. package/schemas/PL_009p_NT2024_003/leiauteConsStatServ_v4.00.xsd +98 -0
  211. package/schemas/PL_009p_NT2024_003/leiauteInutNFe_v4.00.xsd +193 -0
  212. package/schemas/PL_009p_NT2024_003/leiauteNFe_v4.00.xsd +7412 -0
  213. package/schemas/PL_009p_NT2024_003/nfe_v4.00.xsd +9 -0
  214. package/schemas/PL_009p_NT2024_003/procInutNFe_v4.00.xsd +9 -0
  215. package/schemas/PL_009p_NT2024_003/procNFe_v4.00.xsd +9 -0
  216. package/schemas/PL_009p_NT2024_003/retConsReciNFe_v4.00.xsd +9 -0
  217. package/schemas/PL_009p_NT2024_003/retConsSitNFe_v4.00.xsd +9 -0
  218. package/schemas/PL_009p_NT2024_003/retConsStatServ_v4.00.xsd +9 -0
  219. package/schemas/PL_009p_NT2024_003/retEnviNFe_v4.00.xsd +9 -0
  220. package/schemas/PL_009p_NT2024_003/retInutNFe_v4.00.xsd +9 -0
  221. package/schemas/PL_009p_NT2024_003/tiposBasico_v4.00.xsd +598 -0
  222. package/schemas/PL_009p_NT2024_003/xmldsig-core-schema_v1.01.xsd +98 -0
  223. package/schemas/PL_010_V1/110150_v1.00.xsd +88 -0
  224. package/schemas/PL_010_V1/Averb_v1.00.xsd +11 -0
  225. package/schemas/PL_010_V1/CCe_v1.00.xsd +11 -0
  226. package/schemas/PL_010_V1/DFeTiposBasicos_v1.00.xsd +938 -0
  227. package/schemas/PL_010_V1/EPEC_v1.00.xsd +9 -0
  228. package/schemas/PL_010_V1/EPP1.xml +13 -0
  229. package/schemas/PL_010_V1/ERP1.xml +19 -0
  230. package/schemas/PL_010_V1/EventoCancEConf_v1.00.xsd +9 -0
  231. package/schemas/PL_010_V1/EventoCancInsucessoNFe_v1.00.xsd +9 -0
  232. package/schemas/PL_010_V1/EventoEConf_v1.00.xsd +9 -0
  233. package/schemas/PL_010_V1/EventoInsucessoNFe_v1.00.xsd +9 -0
  234. package/schemas/PL_010_V1/MT_inutNFe_v4.00.xsd +9 -0
  235. package/schemas/PL_010_V1/SuframaInternaliza_v1.00.xsd +9 -0
  236. package/schemas/PL_010_V1/SuframaVistoria_v1.00.xsd +9 -0
  237. package/schemas/PL_010_V1/confRecebto_v1.00.xsd +9 -0
  238. package/schemas/PL_010_V1/consCad_v2.00.xsd +9 -0
  239. package/schemas/PL_010_V1/consGTIN_v1.00.xsd +10 -0
  240. package/schemas/PL_010_V1/consNFeDest_v1.01.xsd +10 -0
  241. package/schemas/PL_010_V1/consReciNFe_v3.10.xsd +9 -0
  242. package/schemas/PL_010_V1/consReciNFe_v4.00.xsd +9 -0
  243. package/schemas/PL_010_V1/consSitNFe_v3.10.xsd +9 -0
  244. package/schemas/PL_010_V1/consSitNFe_v4.00.xsd +9 -0
  245. package/schemas/PL_010_V1/consStatServ_v3.10.xsd +9 -0
  246. package/schemas/PL_010_V1/consStatServ_v4.00.xsd +9 -0
  247. package/schemas/PL_010_V1/distDFeInt_v1.00.xsd +71 -0
  248. package/schemas/PL_010_V1/distDFeInt_v1.01.xsd +97 -0
  249. package/schemas/PL_010_V1/downloadNFe_v1.00.xsd +10 -0
  250. package/schemas/PL_010_V1/e110110_v1.00.xsd +58 -0
  251. package/schemas/PL_010_V1/e110111_v1.00.xsd +42 -0
  252. package/schemas/PL_010_V1/e110112_v1.00.xsd +69 -0
  253. package/schemas/PL_010_V1/e110130_v1.00.xsd +102 -0
  254. package/schemas/PL_010_V1/e110131_v1.00.xsd +51 -0
  255. package/schemas/PL_010_V1/e110140NFCe_v1.00.xsd +118 -0
  256. package/schemas/PL_010_V1/e110140NFe_v1.00.xsd +124 -0
  257. package/schemas/PL_010_V1/e110140_v1.00.xsd +124 -0
  258. package/schemas/PL_010_V1/e110150_v1.00.xsd +88 -0
  259. package/schemas/PL_010_V1/e110192_v1.00.xsd +106 -0
  260. package/schemas/PL_010_V1/e110193_v1.00.xsd +40 -0
  261. package/schemas/PL_010_V1/e110750_v1.00.xsd +138 -0
  262. package/schemas/PL_010_V1/e110751_v1.00.xsd +39 -0
  263. package/schemas/PL_010_V1/e111500_v1.00.xsd +69 -0
  264. package/schemas/PL_010_V1/e111501_v1.00.xsd +69 -0
  265. package/schemas/PL_010_V1/e111502_v1.00.xsd +50 -0
  266. package/schemas/PL_010_V1/e111503_v1.00.xsd +50 -0
  267. package/schemas/PL_010_V1/e210200_v1.00.xsd +31 -0
  268. package/schemas/PL_010_V1/e210210_v1.00.xsd +31 -0
  269. package/schemas/PL_010_V1/e210220_v1.00.xsd +44 -0
  270. package/schemas/PL_010_V1/e210240_v1.00.xsd +44 -0
  271. package/schemas/PL_010_V1/e411500_v1.00.xsd +134 -0
  272. package/schemas/PL_010_V1/e411501_v1.00.xsd +134 -0
  273. package/schemas/PL_010_V1/e411502_v1.00.xsd +95 -0
  274. package/schemas/PL_010_V1/e411503_v1.00.xsd +95 -0
  275. package/schemas/PL_010_V1/e610130_v1.00.xsd +128 -0
  276. package/schemas/PL_010_V1/e610131_v1.00.xsd +68 -0
  277. package/schemas/PL_010_V1/e790700_v1.00.xsd +125 -0
  278. package/schemas/PL_010_V1/e990900_v1.00.xsd +87 -0
  279. package/schemas/PL_010_V1/e990910_v1.00.xsd +81 -0
  280. package/schemas/PL_010_V1/envAverb_v1.00.xsd +9 -0
  281. package/schemas/PL_010_V1/envCCe_v1.00.xsd +10 -0
  282. package/schemas/PL_010_V1/envCancelPProrrogNFe_v1.0.xsd +50 -0
  283. package/schemas/PL_010_V1/envComprovanteEntregaNFe_v1.00.xsd +11 -0
  284. package/schemas/PL_010_V1/envConfRecebto_v1.00.xsd +9 -0
  285. package/schemas/PL_010_V1/envEPEC_v1.00.xsd +9 -0
  286. package/schemas/PL_010_V1/envEventoAtorInteressado_v1.00.xsd +9 -0
  287. package/schemas/PL_010_V1/envEventoCancEConf_v1.00.xsd +10 -0
  288. package/schemas/PL_010_V1/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  289. package/schemas/PL_010_V1/envEventoCancInsucessoNFe_v1.00.xsd +10 -0
  290. package/schemas/PL_010_V1/envEventoCancNFe_v1.00.xsd +9 -0
  291. package/schemas/PL_010_V1/envEventoCancSubst_v1.00.xsd +9 -0
  292. package/schemas/PL_010_V1/envEventoEConf_v1.00.xsd +10 -0
  293. package/schemas/PL_010_V1/envEventoEntregaNFe_v1.00.xsd +10 -0
  294. package/schemas/PL_010_V1/envEventoInsucessoNFe_v1.00.xsd +10 -0
  295. package/schemas/PL_010_V1/envEvento_v1.00.xsd +9 -0
  296. package/schemas/PL_010_V1/envFiscoNfe_v1.0.xsd +179 -0
  297. package/schemas/PL_010_V1/envPProrrogNFe_v1.0.xsd +65 -0
  298. package/schemas/PL_010_V1/envRemIndus_v1.00.xsd +9 -0
  299. package/schemas/PL_010_V1/envSuframaInternaliza_v1.00.xsd +10 -0
  300. package/schemas/PL_010_V1/envSuframaVistoria_v1.00.xsd +10 -0
  301. package/schemas/PL_010_V1/enviNFe_v3.10.xsd +9 -0
  302. package/schemas/PL_010_V1/enviNFe_v4.00.xsd +9 -0
  303. package/schemas/PL_010_V1/eventoAtorInteressado_v1.00.xsd +9 -0
  304. package/schemas/PL_010_V1/eventoCancEntregaNFe_v1.00.xsd +9 -0
  305. package/schemas/PL_010_V1/eventoCancNFe_v1.00.xsd +9 -0
  306. package/schemas/PL_010_V1/eventoCancSubst_v1.00.xsd +9 -0
  307. package/schemas/PL_010_V1/eventoEPEC_v0.01.xsd +267 -0
  308. package/schemas/PL_010_V1/eventoEPEC_v1.00.xsd +231 -0
  309. package/schemas/PL_010_V1/eventoEntregaNFe_v1.00.xsd +9 -0
  310. package/schemas/PL_010_V1/eventoRemIndus_v1.00.xsd +9 -0
  311. package/schemas/PL_010_V1/inutNFe_v3.10.xsd +9 -0
  312. package/schemas/PL_010_V1/inutNFe_v4.00.xsd +9 -0
  313. package/schemas/PL_010_V1/leiauteAverb_v1.00.xsd +482 -0
  314. package/schemas/PL_010_V1/leiauteCCe_v1.00.xsd +382 -0
  315. package/schemas/PL_010_V1/leiauteCcgConsGTIN_v1.00.xsd +94 -0
  316. package/schemas/PL_010_V1/leiauteComprovanteEntregaNFe_v1.00.xsd +487 -0
  317. package/schemas/PL_010_V1/leiauteConfRecebto_v1.00.xsd +369 -0
  318. package/schemas/PL_010_V1/leiauteConsNFeDest_v1.01.xsd +483 -0
  319. package/schemas/PL_010_V1/leiauteConsSitNFe_v3.10.xsd +502 -0
  320. package/schemas/PL_010_V1/leiauteConsSitNFe_v4.00.xsd +502 -0
  321. package/schemas/PL_010_V1/leiauteConsStatServ_v3.10.xsd +98 -0
  322. package/schemas/PL_010_V1/leiauteConsStatServ_v4.00.xsd +98 -0
  323. package/schemas/PL_010_V1/leiauteConsultaCadastro_v2.00.xsd +404 -0
  324. package/schemas/PL_010_V1/leiauteDownloadNFe_v1.00.xsd +149 -0
  325. package/schemas/PL_010_V1/leiauteEPEC_v1.00.xsd +423 -0
  326. package/schemas/PL_010_V1/leiauteEventoAtorInteressado_v1.00.xsd +384 -0
  327. package/schemas/PL_010_V1/leiauteEventoCancEConf_v1.00.xsd +296 -0
  328. package/schemas/PL_010_V1/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  329. package/schemas/PL_010_V1/leiauteEventoCancInsucessoNFe_v1.00.xsd +297 -0
  330. package/schemas/PL_010_V1/leiauteEventoCancNFe_v1.00.xsd +358 -0
  331. package/schemas/PL_010_V1/leiauteEventoCancSubst_v1.00.xsd +366 -0
  332. package/schemas/PL_010_V1/leiauteEventoEConf_v1.00.xsd +296 -0
  333. package/schemas/PL_010_V1/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  334. package/schemas/PL_010_V1/leiauteEventoInsucessoNFe_v1.00.xsd +297 -0
  335. package/schemas/PL_010_V1/leiauteEvento_v1.00.xsd +335 -0
  336. package/schemas/PL_010_V1/leiauteInutNFe_v3.10.xsd +193 -0
  337. package/schemas/PL_010_V1/leiauteInutNFe_v4.00.xsd +193 -0
  338. package/schemas/PL_010_V1/leiauteInutNFe_v4.00_MT.xsd +200 -0
  339. package/schemas/PL_010_V1/leiauteNFe_v3.10.xsd +6060 -0
  340. package/schemas/PL_010_V1/leiauteNFe_v4.00.xsd +7438 -0
  341. package/schemas/PL_010_V1/leiauteRemIndus_v1.00.xsd +344 -0
  342. package/schemas/PL_010_V1/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  343. package/schemas/PL_010_V1/leiauteSuframaVistoria_v1.00.xsd +648 -0
  344. package/schemas/PL_010_V1/nfe_v3.10.xsd +9 -0
  345. package/schemas/PL_010_V1/nfe_v4.00.xsd +10 -0
  346. package/schemas/PL_010_V1/procAverbNFe_v1.00.xsd +10 -0
  347. package/schemas/PL_010_V1/procCCeNFe_v1.00.xsd +10 -0
  348. package/schemas/PL_010_V1/procComprovanteEntregaNFe_v1.00.xsd +10 -0
  349. package/schemas/PL_010_V1/procConfRecebtoNFe_v1.00.xsd +9 -0
  350. package/schemas/PL_010_V1/procEPEC_v1.00.xsd +9 -0
  351. package/schemas/PL_010_V1/procEventoAtorInteressado_v1.00.xsd +9 -0
  352. package/schemas/PL_010_V1/procEventoCancEConf_v1.00.xsd +9 -0
  353. package/schemas/PL_010_V1/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  354. package/schemas/PL_010_V1/procEventoCancInsucessoNFe_v1.00.xsd +9 -0
  355. package/schemas/PL_010_V1/procEventoCancNFe_v1.00.xsd +9 -0
  356. package/schemas/PL_010_V1/procEventoCancSubst_v1.00.xsd +9 -0
  357. package/schemas/PL_010_V1/procEventoEConf_v1.00.xsd +9 -0
  358. package/schemas/PL_010_V1/procEventoEntregaNFe_v1.00.xsd +9 -0
  359. package/schemas/PL_010_V1/procEventoInsucessoNFe_v1.00.xsd +9 -0
  360. package/schemas/PL_010_V1/procEventoNFe_v1.00.xsd +9 -0
  361. package/schemas/PL_010_V1/procEventoNFe_v99.99.xsd +37 -0
  362. package/schemas/PL_010_V1/procInutNFe_v3.10.xsd +9 -0
  363. package/schemas/PL_010_V1/procInutNFe_v4.00.xsd +9 -0
  364. package/schemas/PL_010_V1/procNFe_v3.10.xsd +9 -0
  365. package/schemas/PL_010_V1/procNFe_v4.00.xsd +9 -0
  366. package/schemas/PL_010_V1/procRemIndus_v1.00.xsd +9 -0
  367. package/schemas/PL_010_V1/prod_leiauteNFe_v4.00.xsd +6736 -0
  368. package/schemas/PL_010_V1/resEvento_v1.00.xsd +94 -0
  369. package/schemas/PL_010_V1/resEvento_v1.01.xsd +108 -0
  370. package/schemas/PL_010_V1/resNFe_v1.00.xsd +110 -0
  371. package/schemas/PL_010_V1/resNFe_v1.01.xsd +122 -0
  372. package/schemas/PL_010_V1/retComprovanteEntregaNFe_v1.00.xsd +10 -0
  373. package/schemas/PL_010_V1/retConsCad_v2.00.xsd +9 -0
  374. package/schemas/PL_010_V1/retConsGTIN_v1.00.xsd +9 -0
  375. package/schemas/PL_010_V1/retConsReciNFe_v3.10.xsd +9 -0
  376. package/schemas/PL_010_V1/retConsReciNFe_v4.00.xsd +9 -0
  377. package/schemas/PL_010_V1/retConsSitNFe_v3.10.xsd +9 -0
  378. package/schemas/PL_010_V1/retConsSitNFe_v4.00.xsd +9 -0
  379. package/schemas/PL_010_V1/retConsStatServ_v3.10.xsd +9 -0
  380. package/schemas/PL_010_V1/retConsStatServ_v4.00.xsd +9 -0
  381. package/schemas/PL_010_V1/retDistDFeInt_v1.00.xsd +84 -0
  382. package/schemas/PL_010_V1/retDistDFeInt_v1.01.xsd +99 -0
  383. package/schemas/PL_010_V1/retDownloadNFe_v1.00.xsd +9 -0
  384. package/schemas/PL_010_V1/retEnvAverb_v1.00.xsd +9 -0
  385. package/schemas/PL_010_V1/retEnvAverb_v1.00_1.xsd +9 -0
  386. package/schemas/PL_010_V1/retEnvCCe_v1.00.xsd +10 -0
  387. package/schemas/PL_010_V1/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  388. package/schemas/PL_010_V1/retEnvConfRecebto_v1.00.xsd +9 -0
  389. package/schemas/PL_010_V1/retEnvEPEC_v1.00.xsd +9 -0
  390. package/schemas/PL_010_V1/retEnvEventoAtorInteressado_v1.00.xsd +9 -0
  391. package/schemas/PL_010_V1/retEnvEventoCancNFe_v1.00.xsd +9 -0
  392. package/schemas/PL_010_V1/retEnvEventoCancSubst_v1.00.xsd +9 -0
  393. package/schemas/PL_010_V1/retEnvEvento_v1.00.xsd +9 -0
  394. package/schemas/PL_010_V1/retEnvFiscoNFe_v1.0.xsd +234 -0
  395. package/schemas/PL_010_V1/retEnvRemIndus_v1.00.xsd +9 -0
  396. package/schemas/PL_010_V1/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  397. package/schemas/PL_010_V1/retEnvSuframaVistoria_v1.00.xsd +9 -0
  398. package/schemas/PL_010_V1/retEnviNFe_v3.10.xsd +9 -0
  399. package/schemas/PL_010_V1/retEnviNFe_v4.00.xsd +9 -0
  400. package/schemas/PL_010_V1/retEventoCancEConf_v1.00.xsd +9 -0
  401. package/schemas/PL_010_V1/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  402. package/schemas/PL_010_V1/retEventoCancInsucessoNFe_v1.00.xsd +9 -0
  403. package/schemas/PL_010_V1/retEventoEConf_v1.00.xsd +9 -0
  404. package/schemas/PL_010_V1/retEventoEPEC_v0.01.xsd +207 -0
  405. package/schemas/PL_010_V1/retEventoEntregaNFe_v1.00.xsd +9 -0
  406. package/schemas/PL_010_V1/retEventoInsucessoNFe_v1.00.xsd +9 -0
  407. package/schemas/PL_010_V1/retInutNFe_v3.10.xsd +9 -0
  408. package/schemas/PL_010_V1/retInutNFe_v4.00.xsd +9 -0
  409. package/schemas/PL_010_V1/retPProrrogNFe_v1.0.xsd +233 -0
  410. package/schemas/PL_010_V1/retconsNFeDest_v1.01.xsd +9 -0
  411. package/schemas/PL_010_V1/tiposBasico_v1.03.xsd +871 -0
  412. package/schemas/PL_010_V1/tiposBasico_v3.10.xsd +571 -0
  413. package/schemas/PL_010_V1/tiposBasico_v4.00.xsd +598 -0
  414. package/schemas/PL_010_V1/tiposBasicosCcgConsGTIN_v1.00.xsd +84 -0
  415. package/schemas/PL_010_V1/tiposDistDFe_v1.00.xsd +217 -0
  416. package/schemas/PL_010_V1/tiposDistDFe_v1.01.xsd +222 -0
  417. package/schemas/PL_010_V1/xmldsig-core-schema_v1.01.xsd +98 -0
  418. package/schemas/Teste/EventoCancEntregaNFe_v1.00.xsd +9 -0
  419. package/schemas/Teste/EventoEntregaNFe_v1.00.xsd +9 -0
  420. package/schemas/Teste/e110130_v1.00.xsd +102 -0
  421. package/schemas/Teste/e110131_v1.00.xsd +51 -0
  422. package/schemas/Teste/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  423. package/schemas/Teste/envEventoEntregaNFe_v1.00.xsd +10 -0
  424. package/schemas/Teste/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  425. package/schemas/Teste/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  426. package/schemas/Teste/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  427. package/schemas/Teste/procEventoEntregaNFe_v1.00.xsd +9 -0
  428. package/schemas/Teste/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  429. package/schemas/Teste/retEventoEntregaNFe_v1.00.xsd +9 -0
  430. package/schemas/Teste/tiposBasico_v1.03.xsd +871 -0
  431. package/schemas/Teste/xmldsig-core-schema_v1.01.xsd +98 -0
@@ -1,4 +1,6 @@
1
1
  declare const cUF2UF: any, UF2cUF: any;
2
2
  declare const xml2json: (xml: string) => Promise<object>;
3
3
  declare const json2xml: (obj: object) => Promise<string>;
4
- export { cUF2UF, UF2cUF, json2xml, xml2json };
4
+ declare const formatData: (dataUsr?: Date) => string;
5
+ declare const docZip: (xml: string, retorno?: string) => Promise<unknown>;
6
+ export { cUF2UF, UF2cUF, json2xml, xml2json, formatData, docZip };
@@ -1,4 +1,6 @@
1
1
  import { XMLParser, XMLBuilder } from "fast-xml-parser";
2
+ import { gunzipSync } from 'zlib'; // ou zlibSync
3
+ import { Buffer } from 'buffer';
2
4
  const cUF2UF = {
3
5
  "11": "RO",
4
6
  "12": "AC",
@@ -292,4 +294,50 @@ const json2xml = (obj) => {
292
294
  resvol(XMLBuil.build(obj));
293
295
  });
294
296
  };
295
- export { cUF2UF, UF2cUF, json2xml, xml2json };
297
+ const formatData = (dataUsr = new Date()) => {
298
+ const ano = dataUsr.getFullYear();
299
+ const mes = String(dataUsr.getMonth() + 1).padStart(2, '0'); // Adiciona 1 porque os meses começam do 0
300
+ const dia = String(dataUsr.getDate()).padStart(2, '0');
301
+ const horas = String(dataUsr.getHours()).padStart(2, '0');
302
+ const minutos = String(dataUsr.getMinutes()).padStart(2, '0');
303
+ const segundos = String(dataUsr.getSeconds()).padStart(2, '0');
304
+ const fusoHorario = -dataUsr.getTimezoneOffset() / 60; // Obtém o fuso horário em horas
305
+ const formatoISO = `${ano}-${mes}-${dia}T${horas}:${minutos}:${segundos}${fusoHorario >= 0 ? '+' : '-'}${String(Math.abs(fusoHorario)).padStart(2, '0')}:00`;
306
+ return formatoISO;
307
+ };
308
+ const docZip = async (xml, retorno = "original") => {
309
+ return new Promise(async (resolve, reject) => {
310
+ if (typeof retorno == "undefined")
311
+ retorno = "original";
312
+ const decodeDocZipToXml = (docZipBase64) => {
313
+ // 1. Converte base64 para buffer
314
+ const zippedBuffer = Buffer.from(docZipBase64, 'base64');
315
+ // 2. Descomprime com gzip
316
+ const xmlBuffer = gunzipSync(zippedBuffer);
317
+ // 3. Converte para string UTF-8
318
+ return xmlBuffer.toString('utf8');
319
+ };
320
+ const jXml = await xml2json(xml);
321
+ try {
322
+ var docZips = jXml["soap:Envelope"]["soap:Body"]["nfeDistDFeInteresseResponse"]["nfeDistDFeInteresseResult"]["retDistDFeInt"];
323
+ if (typeof docZips['loteDistDFeInt'] == "undefined")
324
+ return resolve([]);
325
+ docZips = docZips["loteDistDFeInt"]['docZip'];
326
+ if (!Array.isArray(docZips))
327
+ docZips = [docZips];
328
+ for (const doc of docZips) {
329
+ doc['xml'] = decodeDocZipToXml(doc['#text']);
330
+ doc['NSU'] = doc['@NSU'];
331
+ doc['schema'] = doc['@schema'];
332
+ delete doc['#text'];
333
+ delete doc['@NSU'];
334
+ delete doc['@schema'];
335
+ }
336
+ resolve(docZips);
337
+ }
338
+ catch (error) {
339
+ reject(error);
340
+ }
341
+ });
342
+ };
343
+ export { cUF2UF, UF2cUF, json2xml, xml2json, formatData, docZip };
@@ -10,6 +10,8 @@ declare class Tools {
10
10
  versao: string;
11
11
  timeout: number;
12
12
  openssl: null;
13
+ CPF: string;
14
+ CNPJ: string;
13
15
  }, certificado?: {
14
16
  pfx: string;
15
17
  senha: string;
@@ -20,6 +22,17 @@ declare class Tools {
20
22
  json2xml(obj: object): Promise<string>;
21
23
  getCertificado(): Promise<object>;
22
24
  consultarNFe(chNFe: string): Promise<string>;
25
+ sefazEvento({ chNFe, tpEvento, nProt, justificativa, textoCorrecao, sequencial }: {
26
+ chNFe?: string | undefined;
27
+ tpEvento?: string | undefined;
28
+ nProt?: string | undefined;
29
+ justificativa?: string | undefined;
30
+ textoCorrecao?: string | undefined;
31
+ sequencial?: number | undefined;
32
+ }): Promise<string>;
33
+ sefazDistDFe({ ultNSU }: {
34
+ ultNSU?: string;
35
+ }): Promise<string>;
23
36
  sefazStatus(): Promise<string>;
24
37
  validarNFe(xml: string): Promise<any>;
25
38
  }
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _Tools_instances, _Tools_cert, _Tools_pem, _Tools_config, _Tools_gerarQRCodeNFCe, _Tools_xmlValido, _Tools_certTools;
12
+ var _Tools_instances, _Tools_cert, _Tools_pem, _Tools_config, _Tools_getSignature, _Tools_gerarQRCodeNFCe, _Tools_descEvento, _Tools_xmlValido, _Tools_certTools;
13
13
  import { XMLBuilder } from "fast-xml-parser";
14
14
  import https from "https";
15
15
  import { spawnSync } from "child_process";
@@ -20,11 +20,12 @@ import fs from "fs";
20
20
  import path from 'path';
21
21
  import { fileURLToPath } from 'url';
22
22
  import pem from 'pem';
23
- import { cUF2UF, json2xml, xml2json } from "./extras.js";
23
+ import { cUF2UF, json2xml, xml2json, UF2cUF } from "./extras.js";
24
+ import { SignedXml } from 'xml-crypto';
24
25
  const __filename = fileURLToPath(import.meta.url);
25
26
  const __dirname = path.dirname(__filename);
26
27
  class Tools {
27
- constructor(config = { mod: "", xmllint: 'xmllint', UF: '', tpAmb: 2, CSC: "", CSCid: "", versao: "4.00", timeout: 30, openssl: null }, certificado = { pfx: "", senha: "" }) {
28
+ constructor(config = { mod: "", xmllint: 'xmllint', UF: '', tpAmb: 2, CSC: "", CSCid: "", versao: "4.00", timeout: 30, openssl: null, CPF: "", CNPJ: "" }, certificado = { pfx: "", senha: "" }) {
28
29
  _Tools_instances.add(this);
29
30
  _Tools_cert.set(this, void 0);
30
31
  _Tools_pem.set(this, {
@@ -94,7 +95,7 @@ class Tools {
94
95
  },
95
96
  rejectUnauthorized: false
96
97
  },
97
- ...__classPrivateFieldGet(this, _Tools_pem, "f")
98
+ ...await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_certTools).call(this)
98
99
  }, (res) => {
99
100
  let data = '';
100
101
  res.on('data', (chunk) => {
@@ -126,62 +127,23 @@ class Tools {
126
127
  return new Promise(async (resvol, reject) => {
127
128
  if (data.tag === undefined)
128
129
  data.tag = "infNFe";
129
- //Obter a tag que ira ser assinada
130
- let xml = await this.xml2json(xmlJSON);
131
- let tempPem = await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_certTools).call(this);
132
- const sign = crypto.createSign('RSA-SHA1'); // Correção: Alterado para RSA-SHA1
133
- let signedInfo = {
134
- "SignedInfo": {
135
- "@xmlns": "http://www.w3.org/2000/09/xmldsig#",
136
- "CanonicalizationMethod": {
137
- "@Algorithm": "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
138
- },
139
- "SignatureMethod": {
140
- "@Algorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1" // Mantém SHA1
141
- },
142
- "Reference": {
143
- "@URI": `#${xml.NFe.infNFe['@Id']}`,
144
- "Transforms": {
145
- "Transform": [
146
- {
147
- "@Algorithm": "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
148
- },
149
- {
150
- "@Algorithm": "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
151
- },
152
- ]
153
- },
154
- "DigestMethod": {
155
- "@Algorithm": "http://www.w3.org/2000/09/xmldsig#sha1" // Mantém SHA1
156
- },
157
- "DigestValue": crypto.createHash('sha1').update(await this.json2xml({ infNFe: xml.NFe.infNFe }), 'utf8') // Mantém Hash SHA1
158
- .digest('base64')
159
- }
160
- }
161
- };
162
- sign.update(await this.json2xml(signedInfo), 'utf8');
163
- xml.NFe.Signature = {
164
- ...signedInfo,
165
- ...{
166
- "SignatureValue": sign.sign(tempPem.key, 'base64'),
167
- "KeyInfo": {
168
- "X509Data": {
169
- "X509Certificate": tempPem.cert.replace(/-----BEGIN CERTIFICATE-----/g, '').replace(/-----END CERTIFICATE-----/g, '').replace(/\r\n/g, '')
170
- }
171
- },
172
- "@xmlns": "http://www.w3.org/2000/09/xmldsig#"
130
+ var xml = await this.xml2json(xmlJSON);
131
+ if (data.tag == "infNFe") {
132
+ if (xml.NFe.infNFe.ide.mod == 65) {
133
+ xml.NFe.infNFeSupl.qrCode = __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_gerarQRCodeNFCe).call(this, xml.NFe, "2", __classPrivateFieldGet(this, _Tools_config, "f").CSCid, __classPrivateFieldGet(this, _Tools_config, "f").CSC);
173
134
  }
174
- };
175
- if (xml.NFe.infNFe.ide.mod == 65) {
176
- xml.NFe.infNFeSupl.qrCode = __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_gerarQRCodeNFCe).call(this, xml.NFe, "2", __classPrivateFieldGet(this, _Tools_config, "f").CSCid, __classPrivateFieldGet(this, _Tools_config, "f").CSC);
135
+ xml.NFe = {
136
+ ...xml.NFe,
137
+ ...await xml2json(await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_getSignature).call(this, xmlJSON, data.tag))
138
+ };
177
139
  }
178
- this.json2xml(xml).then(async (res) => {
179
- await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_xmlValido).call(this, res, `nfe_v${__classPrivateFieldGet(this, _Tools_config, "f").versao}`).catch(reject);
180
- ;
181
- resvol(res);
182
- }).catch(err => {
183
- reject(err);
184
- });
140
+ else if (data.tag == "infEvento") {
141
+ xml.envEvento.evento = {
142
+ ...xml.envEvento.evento,
143
+ ...(await xml2json(await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_getSignature).call(this, xmlJSON, data.tag)))
144
+ };
145
+ }
146
+ resvol(await json2xml(xml));
185
147
  });
186
148
  }
187
149
  async xml2json(xml) {
@@ -269,6 +231,214 @@ class Tools {
269
231
  }
270
232
  });
271
233
  }
234
+ async sefazEvento({ chNFe = "", tpEvento = "", nProt = "", justificativa = "", textoCorrecao = "", sequencial = 1 }) {
235
+ return new Promise(async (resolve, reject) => {
236
+ try {
237
+ if (!chNFe)
238
+ throw "sefazEvento({chNFe}) -> não definido!";
239
+ if (!tpEvento)
240
+ throw "sefazEvento({tpEvento}) -> não definido!";
241
+ if (!__classPrivateFieldGet(this, _Tools_config, "f").CNPJ && !__classPrivateFieldGet(this, _Tools_config, "f").CPF)
242
+ throw "new Tools({CNPJ|CPF}) -> não definido!";
243
+ const geradorLote = function () {
244
+ const agora = new Date();
245
+ const ano = agora.getFullYear().toString().slice(2); // Só os 2 últimos dígitos do ano
246
+ const mes = String(agora.getMonth() + 1).padStart(2, '0');
247
+ const dia = String(agora.getDate()).padStart(2, '0');
248
+ const hora = String(agora.getHours()).padStart(2, '0');
249
+ const minuto = String(agora.getMinutes()).padStart(2, '0');
250
+ const segundo = String(agora.getSeconds()).padStart(2, '0');
251
+ // Junta tudo
252
+ let idLote = `${ano}${mes}${dia}${hora}${minuto}${segundo}`;
253
+ // Se ainda tiver menos de 15 dígitos, adiciona um número aleatório no final
254
+ while (idLote.length < 15) {
255
+ idLote += Math.floor(Math.random() * 10); // Adiciona dígitos aleatórios
256
+ }
257
+ return idLote;
258
+ };
259
+ const tempUF = urlEventos(`AN`, __classPrivateFieldGet(this, _Tools_config, "f").versao);
260
+ let detEvento = {
261
+ "@versao": "1.00",
262
+ "descEvento": __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_descEvento).call(this, `${tpEvento}`)
263
+ };
264
+ // Adicionar campos específicos por tipo de evento
265
+ if (tpEvento === "110111") { // Cancelamento
266
+ if (!nProt)
267
+ throw "sefazEvento({nProt}) obrigatório para Cancelamento!";
268
+ if (!justificativa)
269
+ throw "sefazEvento({justificativa}) obrigatório para Cancelamento!";
270
+ detEvento["nProt"] = nProt;
271
+ detEvento["xJust"] = justificativa;
272
+ }
273
+ else if (tpEvento === "110110") { // Carta de Correção
274
+ if (!textoCorrecao)
275
+ throw "sefazEvento({textoCorrecao}) obrigatório para Carta de Correção!";
276
+ detEvento["xCorrecao"] = textoCorrecao;
277
+ detEvento["xCondUso"] = "A carta de correção é disciplinada pelo § 1º-A do art. 7º do Convênio S/N, de 15 de dezembro de 1970...";
278
+ }
279
+ else if (tpEvento === "210240") { // Operação não realizada
280
+ if (!justificativa)
281
+ throw "sefazEvento({justificativa}) obrigatório para Operação não realizada!";
282
+ detEvento["xJust"] = justificativa;
283
+ }
284
+ // Ciência (210210), Confirmação (210200), Desconhecimento (210220) não precisam de campos extras
285
+ const evento = {
286
+ "envEvento": {
287
+ "@xmlns": "http://www.portalfiscal.inf.br/nfe",
288
+ "@versao": "1.00",
289
+ "idLote": "250429141621528",
290
+ "evento": {
291
+ "@xmlns": "http://www.portalfiscal.inf.br/nfe",
292
+ "@versao": "1.00",
293
+ "infEvento": {
294
+ "@Id": `ID${tpEvento}${chNFe}${sequencial.toString().padStart(2, '0')}`,
295
+ "cOrgao": "91",
296
+ "tpAmb": __classPrivateFieldGet(this, _Tools_config, "f").tpAmb,
297
+ "CNPJ": __classPrivateFieldGet(this, _Tools_config, "f").CNPJ,
298
+ "chNFe": chNFe,
299
+ "dhEvento": "2025-04-29T14:16:21-03:00",
300
+ "tpEvento": tpEvento,
301
+ "nSeqEvento": sequencial,
302
+ "verEvento": "1.00",
303
+ "detEvento": detEvento
304
+ }
305
+ }
306
+ }
307
+ };
308
+ let xmlSing = await json2xml(evento);
309
+ xmlSing = await this.xmlSign(xmlSing, { tag: "infEvento" }); //Assinado
310
+ fs.writeFileSync("testes/xmlEvento.xml", xmlSing, "utf8");
311
+ await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_xmlValido).call(this, xmlSing, `envEvento_v1.00`).catch(reject); //Validar corpo
312
+ xmlSing = await json2xml({
313
+ "soap:Envelope": {
314
+ "@xmlns:soap": "http://www.w3.org/2003/05/soap-envelope",
315
+ "@xmlns:nfe": "http://www.portalfiscal.inf.br/nfe/wsdl/NFeRecepcaoEvento4",
316
+ "soap:Body": {
317
+ "nfe:nfeDadosMsg": await xml2json(xmlSing)
318
+ }
319
+ }
320
+ });
321
+ try {
322
+ const req = https.request(tempUF[`mod${__classPrivateFieldGet(this, _Tools_config, "f").mod}`][(__classPrivateFieldGet(this, _Tools_config, "f").tpAmb == 1 ? "producao" : "homologacao")].NFeRecepcaoEvento, {
323
+ ...{
324
+ method: 'POST',
325
+ headers: {
326
+ 'Content-Type': 'application/soap+xml; charset=utf-8',
327
+ 'Content-Length': xmlSing.length,
328
+ },
329
+ rejectUnauthorized: false,
330
+ },
331
+ ...await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_certTools).call(this)
332
+ }, (res) => {
333
+ let data = '';
334
+ res.on('data', (chunk) => {
335
+ data += chunk;
336
+ });
337
+ res.on('end', () => {
338
+ resolve(data);
339
+ });
340
+ });
341
+ req.setTimeout(__classPrivateFieldGet(this, _Tools_config, "f").timeout * 1000, () => {
342
+ reject({
343
+ name: 'TimeoutError',
344
+ message: 'The operation was aborted due to timeout'
345
+ });
346
+ req.destroy(); // cancela a requisição
347
+ });
348
+ req.on('error', (erro) => {
349
+ reject(erro);
350
+ });
351
+ req.write(xmlSing);
352
+ req.end();
353
+ }
354
+ catch (erro) {
355
+ reject(erro);
356
+ }
357
+ }
358
+ catch (erro) {
359
+ reject(erro);
360
+ }
361
+ });
362
+ }
363
+ async sefazDistDFe({ ultNSU = "000000000000000" }) {
364
+ return new Promise(async (resolve, reject) => {
365
+ try {
366
+ if (!__classPrivateFieldGet(this, _Tools_config, "f").CNPJ)
367
+ throw "CNPJ não definido!";
368
+ if (__classPrivateFieldGet(this, _Tools_config, "f").CNPJ.length !== 14)
369
+ throw "CNPJ inválido!";
370
+ // Gera o XML da consulta
371
+ // Prepara o SOAP
372
+ var xmlSing = await json2xml({
373
+ "distDFeInt": {
374
+ "@xmlns": "http://www.portalfiscal.inf.br/nfe",
375
+ "@versao": "1.01",
376
+ "tpAmb": 1, // 1 = produção, 2 = homologação
377
+ "cUFAutor": UF2cUF[__classPrivateFieldGet(this, _Tools_config, "f").UF], // "AN" - Ambiente Nacional
378
+ "CNPJ": __classPrivateFieldGet(this, _Tools_config, "f").CNPJ,
379
+ "distNSU": {
380
+ "ultNSU": `${ultNSU}`.padStart(15, '0')
381
+ }
382
+ }
383
+ });
384
+ await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_xmlValido).call(this, xmlSing, `distDFeInt_v1.01`).catch(reject); //Validar corpo
385
+ const tempUF = urlEventos(`AN`, __classPrivateFieldGet(this, _Tools_config, "f").versao);
386
+ xmlSing = await json2xml({
387
+ "soap:Envelope": {
388
+ "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
389
+ "@xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
390
+ "@xmlns:soap": "http://www.w3.org/2003/05/soap-envelope",
391
+ "soap:Body": {
392
+ "nfeDistDFeInteresse": {
393
+ "@xmlns": "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe",
394
+ "nfeDadosMsg": {
395
+ ...{ "@xmlns": "http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe" },
396
+ ...await xml2json(xmlSing)
397
+ }
398
+ }
399
+ }
400
+ }
401
+ });
402
+ // HTTPS Request
403
+ const req = https.request(tempUF[`mod${__classPrivateFieldGet(this, _Tools_config, "f").mod}`][(__classPrivateFieldGet(this, _Tools_config, "f").tpAmb == 1 ? "producao" : "homologacao")].NFeDistribuicaoDFe, {
404
+ ...{
405
+ method: 'POST',
406
+ headers: {
407
+ 'Content-Type': 'application/soap+xml; charset=utf-8',
408
+ 'Content-Length': xmlSing.length,
409
+ },
410
+ rejectUnauthorized: false
411
+ },
412
+ ...await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_certTools).call(this)
413
+ }, (res) => {
414
+ let data = '';
415
+ res.on('data', (chunk) => {
416
+ data += chunk;
417
+ });
418
+ res.on('end', () => {
419
+ resolve(data);
420
+ });
421
+ });
422
+ req.setTimeout(__classPrivateFieldGet(this, _Tools_config, "f").timeout * 1000, () => {
423
+ reject({
424
+ name: 'TimeoutError',
425
+ message: 'The operation was aborted due to timeout'
426
+ });
427
+ req.destroy(); // cancela a requisição
428
+ });
429
+ req.on('error', (erro) => {
430
+ reject(erro);
431
+ });
432
+ req.write(xmlSing);
433
+ req.end();
434
+ // Opcional: salvar a requisição para análise
435
+ fs.writeFileSync("testes/consultaDistribuicao.xml", xmlSing, "utf8");
436
+ }
437
+ catch (erro) {
438
+ reject(erro);
439
+ }
440
+ });
441
+ }
272
442
  //Consulta status sefaz
273
443
  async sefazStatus() {
274
444
  return new Promise(async (resvol, reject) => {
@@ -350,7 +520,42 @@ class Tools {
350
520
  });
351
521
  }
352
522
  }
353
- _Tools_cert = new WeakMap(), _Tools_pem = new WeakMap(), _Tools_config = new WeakMap(), _Tools_instances = new WeakSet(), _Tools_gerarQRCodeNFCe = function _Tools_gerarQRCodeNFCe(NFe, versaoQRCode = "2", idCSC, CSC) {
523
+ _Tools_cert = new WeakMap(), _Tools_pem = new WeakMap(), _Tools_config = new WeakMap(), _Tools_instances = new WeakSet(), _Tools_getSignature =
524
+ //Responsavel por gerar assinatura
525
+ async function _Tools_getSignature(xmlJSON, tag) {
526
+ return new Promise(async (resvol, reject) => {
527
+ let tempPem = await __classPrivateFieldGet(this, _Tools_instances, "m", _Tools_certTools).call(this);
528
+ const sig = new SignedXml({
529
+ privateKey: tempPem.key,
530
+ canonicalizationAlgorithm: 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315',
531
+ signatureAlgorithm: 'http://www.w3.org/2000/09/xmldsig#rsa-sha1',
532
+ publicCert: tempPem.pem,
533
+ getKeyInfoContent: (args) => {
534
+ const cert = tempPem.cert
535
+ .toString()
536
+ .replace('-----BEGIN CERTIFICATE-----', '')
537
+ .replace('-----END CERTIFICATE-----', '')
538
+ .replace(/\r?\n|\r/g, '');
539
+ return `<X509Data><X509Certificate>${cert}</X509Certificate></X509Data>`;
540
+ }
541
+ });
542
+ sig.addReference({
543
+ xpath: `//*[local-name(.)='${tag}']`,
544
+ transforms: [
545
+ 'http://www.w3.org/2000/09/xmldsig#enveloped-signature',
546
+ 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
547
+ ],
548
+ digestAlgorithm: 'http://www.w3.org/2000/09/xmldsig#sha1'
549
+ });
550
+ sig.computeSignature(xmlJSON, {
551
+ location: {
552
+ reference: `//*[local-name()='${tag}']`,
553
+ action: 'after' // <- insere DENTRO da tag <evento>
554
+ }
555
+ });
556
+ return resvol(sig.getSignatureXml());
557
+ });
558
+ }, _Tools_gerarQRCodeNFCe = function _Tools_gerarQRCodeNFCe(NFe, versaoQRCode = "2", idCSC, CSC) {
354
559
  let s = '|', concat, hash;
355
560
  if (NFe.infNFe.ide.tpEmis == 1) {
356
561
  concat = [NFe.infNFe['@Id'].replace("NFe", ""), versaoQRCode, NFe.infNFe.ide.tpAmb, Number(idCSC)].join(s);
@@ -361,13 +566,23 @@ _Tools_cert = new WeakMap(), _Tools_pem = new WeakMap(), _Tools_config = new Wea
361
566
  }
362
567
  hash = crypto.createHash('sha1').update(concat + CSC).digest('hex');
363
568
  return NFe.infNFeSupl.qrCode + '?p=' + concat + s + hash;
569
+ }, _Tools_descEvento = function _Tools_descEvento(tpEvento) {
570
+ const eventos = {
571
+ "110110": "Carta de Correcao",
572
+ "110111": "Cancelamento",
573
+ "210200": "Confirmacao da Operacao",
574
+ "210210": "Ciencia da Operacao",
575
+ "210220": "Desconhecimento da Operacao",
576
+ "210240": "Operacao nao Realizada"
577
+ };
578
+ return eventos[tpEvento] || "Evento";
364
579
  }, _Tools_xmlValido =
365
580
  //Validar XML da NFe, somente apos assinar
366
581
  async function _Tools_xmlValido(xml, xsd) {
367
582
  return new Promise((resolve, reject) => {
368
583
  const xmlFile = tmp.fileSync({ mode: 0o644, prefix: 'xml-', postfix: '.xml' });
369
584
  fs.writeFileSync(xmlFile.name, xml, { encoding: 'utf8' });
370
- const schemaPath = path.resolve(__dirname, `../../schemas/${xsd}.xsd`);
585
+ const schemaPath = path.resolve(__dirname, `../../schemas/PL_010_V1/${xsd}.xsd`);
371
586
  const verif = spawnSync(__classPrivateFieldGet(this, _Tools_config, "f").xmllint, ['--noout', '--schema', schemaPath, xmlFile.name], { encoding: 'utf8' });
372
587
  xmlFile.removeCallback();
373
588
  // Aqui, usamos o operador de encadeamento opcional (?.)
@@ -375,7 +590,9 @@ async function _Tools_xmlValido(xml, xsd) {
375
590
  return reject("Biblioteca xmllint não encontrada!");
376
591
  }
377
592
  else if (!verif.stderr.includes(".xml validates")) {
378
- return reject(verif.stderr);
593
+ return reject(verif.stderr.replace(/\/tmp\/[^:\s]+\.xml/g, '') // Remove os caminhos /tmp/*.xml
594
+ .replace(/\s{2,}/g, ' ') // Ajusta múltiplos espaços para um só
595
+ .trim()); // Remove espaços no começo e fim)
379
596
  }
380
597
  else {
381
598
  resolve(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sped-nfe",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "author": "Kalmon V. Tavares",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,7 +32,6 @@
32
32
  "teste": "node testes/teste.js"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/axios": "^0.9.36",
36
35
  "@types/node": "^22.14.0",
37
36
  "@types/node-forge": "^1.3.11",
38
37
  "@types/pem": "^1.14.4",
@@ -41,10 +40,13 @@
41
40
  "typescript": "^5.0.0"
42
41
  },
43
42
  "dependencies": {
43
+ "@xmldom/xmldom": "^0.9.8",
44
44
  "crypto": "^1.0.1",
45
45
  "fast-xml-parser": "^4.5.1",
46
46
  "pem": "^1.14.8",
47
- "tmp": "^0.2.3"
47
+ "tmp": "^0.2.3",
48
+ "xml-crypto": "^6.1.2",
49
+ "xmldom": "^0.6.0"
48
50
  },
49
51
  "repository": {
50
52
  "type": "git",
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSpy v2008 (http://www.altova.com) by sas-softwares@procergs.rs.gov.br (PROCERGS) -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
4
+ <xs:include schemaLocation="tiposBasico_v1.03.xsd"/>
5
+ <xs:element name="detEvento">
6
+ <xs:annotation>
7
+ <xs:documentation>Schema XML de validação do evento de Ator Interessado na NF-e - Transportador (110150)”</xs:documentation>
8
+ </xs:annotation>
9
+ <xs:complexType>
10
+ <xs:sequence>
11
+ <xs:element name="descEvento">
12
+ <xs:annotation>
13
+ <xs:documentation>Descrição do Evento - "Ator interessado na NF-e”"</xs:documentation>
14
+ </xs:annotation>
15
+ <xs:simpleType>
16
+ <xs:restriction base="TString">
17
+ <xs:whiteSpace value="preserve"/>
18
+ <xs:enumeration value="Ator interessado na NF-e"/>
19
+ </xs:restriction>
20
+ </xs:simpleType>
21
+ </xs:element>
22
+ <xs:element name="cOrgaoAutor" type="TCodUfIBGE"/>
23
+ <xs:element name="tpAutor">
24
+ <xs:annotation>
25
+ <xs:documentation>Tipo do Órgão Autor do Evento. Informar uma das opções 1=Geração do Evento pelo Emitente; 2=Geração do Evento pelo Destinatário; 3=Geração do Evento pelo Transportador
26
+ Outros valores: 1=Empresa Emitente, 2=Empresa destinatária; 3=Empresa; 5=Fisco; 6=RFB; 9=Outros Órgãos;</xs:documentation>
27
+ </xs:annotation>
28
+ <xs:simpleType>
29
+ <xs:restriction base="xs:string">
30
+ <xs:whiteSpace value="preserve"/>
31
+ <xs:enumeration value="1"/>
32
+ <xs:enumeration value="2"/>
33
+ <xs:enumeration value="3"/>
34
+ </xs:restriction>
35
+ </xs:simpleType>
36
+ </xs:element>
37
+ <xs:element name="verAplic" type="TVerAplic">
38
+ <xs:annotation>
39
+ <xs:documentation>Versão do aplicativo do Autor do Evento.</xs:documentation>
40
+ </xs:annotation>
41
+ </xs:element>
42
+ <xs:element name="autXML">
43
+ <xs:annotation>
44
+ <xs:documentation>Pessoas autorizadas a acessar o XML da NF-e</xs:documentation>
45
+ </xs:annotation>
46
+ <xs:complexType>
47
+ <xs:choice>
48
+ <xs:element name="CNPJ" type="TCnpj"/>
49
+ <xs:element name="CPF" type="TCpf"/>
50
+ </xs:choice>
51
+ </xs:complexType>
52
+ </xs:element>
53
+ <xs:element name="tpAutorizacao" minOccurs="0">
54
+ <xs:annotation>
55
+ <xs:documentation>0 – Não permite; 1 – Permite o transportador autorizado pelo emitente ou destinatário autorizar outros transportadores para ter acesso ao download da NF-e
56
+ </xs:documentation>
57
+ </xs:annotation>
58
+ <xs:simpleType>
59
+ <xs:restriction base="xs:string">
60
+ <xs:whiteSpace value="preserve"/>
61
+ <xs:enumeration value="0"/>
62
+ <xs:enumeration value="1"/>
63
+ </xs:restriction>
64
+ </xs:simpleType>
65
+ </xs:element>
66
+ <xs:element name="xCondUso" minOccurs="0">
67
+ <xs:annotation>
68
+ <xs:documentation>Texto Fixo com as Condição de uso do tipo de autorização para o transportador: </xs:documentation>
69
+ </xs:annotation>
70
+ <xs:simpleType>
71
+ <xs:restriction base="xs:string">
72
+ <xs:whiteSpace value="preserve"/>
73
+ <xs:enumeration value="O emitente ou destinatário da NF-e, declara que permite o transportador declarado no campo CNPJ/CPF deste evento a autorizar os transportadores subcontratados ou redespachados a terem acesso ao download da NF-e"/>
74
+ </xs:restriction>
75
+ </xs:simpleType>
76
+ </xs:element>
77
+ </xs:sequence>
78
+ <xs:attribute name="versao" use="required">
79
+ <xs:simpleType>
80
+ <xs:restriction base="xs:string">
81
+ <xs:whiteSpace value="preserve"/>
82
+ <xs:enumeration value="1.00"/>
83
+ </xs:restriction>
84
+ </xs:simpleType>
85
+ </xs:attribute>
86
+ </xs:complexType>
87
+ </xs:element>
88
+ </xs:schema>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- 03-03-2011 - correcao do nome da tag raiz -->
3
+ <!-- PL_006CC CCe 16/06/2010 -->
4
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
5
+ <xs:include schemaLocation="leiauteAverb_v1.00.xsd"/>
6
+ <xs:element name="evento" type="TEvento">
7
+ <xs:annotation>
8
+ <xs:documentation>Schema XML de validação do evento de Averbação da NFe</xs:documentation>
9
+ </xs:annotation>
10
+ </xs:element>
11
+ </xs:schema>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- 03-03-2011 - correcao do nome da tag raiz -->
3
+ <!-- PL_006CC CCe 16/06/2010 -->
4
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
5
+ <xs:include schemaLocation="leiauteCCe_v1.00.xsd"/>
6
+ <xs:element name="evento" type="TEvento">
7
+ <xs:annotation>
8
+ <xs:documentation>Schema XML de validação do evento Carta de Correção</xs:documentation>
9
+ </xs:annotation>
10
+ </xs:element>
11
+ </xs:schema>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
3
+ <xs:include schemaLocation="leiauteEPEC_v1.00.xsd"/>
4
+ <xs:element name="evento" type="TEvento">
5
+ <xs:annotation>
6
+ <xs:documentation>Schema XML de validação do Evento Prévio de Emissão em Contingência</xs:documentation>
7
+ </xs:annotation>
8
+ </xs:element>
9
+ </xs:schema>