nfewizard-io 0.3.28 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -54
- package/dist/cjs/adapters/XmlBuilder.d.ts +2 -2
- package/dist/cjs/core/exceptions/ErrorContext.d.ts +39 -0
- package/dist/cjs/core/exceptions/JsonArrayTransporter.d.ts +21 -0
- package/dist/cjs/core/exceptions/logger.d.ts +22 -2
- package/dist/cjs/core/types/NFeWizard.d.ts +1 -0
- package/dist/cjs/debug.d.ts +1 -0
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/modules/dfe/base/BaseNFe.d.ts +3 -1
- package/dist/cjs/modules/dfe/base/GerarConsulta.d.ts +1 -0
- package/dist/cjs/modules/dfe/nfce/services/NFCEAutorizacao/NFCEAutorizacaoService.d.ts +2 -0
- package/dist/cjs/modules/dfe/nfe/services/NFEAutorizacao/NFEAutorizacaoService.d.ts +2 -0
- package/dist/cjs/modules/dfe/nfe/services/NFEDistribuicaoDFe/NFEDistribuicaoDFeService.d.ts +3 -1
- package/dist/cjs/modules/dfe/nfe/services/NFERecepcaoEvento/NFERecepcaoEventoService.d.ts +3 -1
- package/dist/cjs/modules/environment/Environment.d.ts +1 -0
- package/dist/esm/adapters/XmlBuilder.d.ts +2 -2
- package/dist/esm/core/exceptions/ErrorContext.d.ts +39 -0
- package/dist/esm/core/exceptions/JsonArrayTransporter.d.ts +21 -0
- package/dist/esm/core/exceptions/logger.d.ts +22 -2
- package/dist/esm/core/types/NFeWizard.d.ts +1 -0
- package/dist/esm/debug.d.ts +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/dfe/base/BaseNFe.d.ts +3 -1
- package/dist/esm/modules/dfe/base/GerarConsulta.d.ts +1 -0
- package/dist/esm/modules/dfe/nfce/services/NFCEAutorizacao/NFCEAutorizacaoService.d.ts +2 -0
- package/dist/esm/modules/dfe/nfe/services/NFEAutorizacao/NFEAutorizacaoService.d.ts +2 -0
- package/dist/esm/modules/dfe/nfe/services/NFEDistribuicaoDFe/NFEDistribuicaoDFeService.d.ts +3 -1
- package/dist/esm/modules/dfe/nfe/services/NFERecepcaoEvento/NFERecepcaoEventoService.d.ts +3 -1
- package/dist/esm/modules/environment/Environment.d.ts +1 -0
- package/package.json +3 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Environment from '@Modules/environment/Environment.js';
|
|
2
2
|
import XmlBuilder from '@Adapters/XmlBuilder.js';
|
|
3
3
|
import Utility from '../../../core/utils/Utility.js';
|
|
4
|
-
import { AxiosInstance } from 'axios';
|
|
4
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
5
5
|
import { SaveFilesImpl, GerarConsultaImpl } from '@Interfaces';
|
|
6
|
+
import { Agent } from 'http';
|
|
6
7
|
declare abstract class BaseNFE {
|
|
7
8
|
environment: Environment;
|
|
8
9
|
utility: Utility;
|
|
@@ -18,6 +19,7 @@ declare abstract class BaseNFE {
|
|
|
18
19
|
*/
|
|
19
20
|
protected gerarXml(data?: any): string;
|
|
20
21
|
protected setContentType(): "application/soap+xml" | "text/xml; charset=utf-8";
|
|
22
|
+
protected callWebService(xmlConsulta: string, webServiceUrl: string, ContentType: string, action: string, agent: Agent): Promise<AxiosResponse<any, any>>;
|
|
21
23
|
/**
|
|
22
24
|
* Executa a requisição ao webservice SEFAZ
|
|
23
25
|
* @param {any} [data] - Dados opcionais usados para gerar o XML em algumas subclasses.
|
|
@@ -7,6 +7,7 @@ declare class GerarConsulta implements GerarConsultaImpl {
|
|
|
7
7
|
environment: Environment;
|
|
8
8
|
xmlBuilder: XmlBuilder;
|
|
9
9
|
constructor(environment: Environment, utility: Utility, xmlBuilder: XmlBuilder);
|
|
10
|
+
createSoapEnvelop(xmlConsulta: string, metodo: string, method: string, rootTag?: boolean, tag?: string): string;
|
|
10
11
|
gerarConsulta(xmlConsulta: string, metodo: string, ambienteNacional?: boolean, versao?: string, mod?: string, rootTag?: boolean, tag?: string): Promise<{
|
|
11
12
|
xmlFormated: string;
|
|
12
13
|
agent: import("https").Agent;
|
|
@@ -5,6 +5,7 @@ import XmlBuilder from '@Adapters/XmlBuilder.js';
|
|
|
5
5
|
import { GenericObject, LayoutNFe, NFe, ProtNFe } from '@Types';
|
|
6
6
|
import BaseNFE from '@Modules/dfe/base/BaseNFe.js';
|
|
7
7
|
import { GerarConsultaImpl, NFCEAutorizacaoServiceImpl, SaveFilesImpl } from '@Interfaces';
|
|
8
|
+
import { Agent } from 'http';
|
|
8
9
|
declare class NFCEAutorizacaoService extends BaseNFE implements NFCEAutorizacaoServiceImpl {
|
|
9
10
|
xmlNFe: string[];
|
|
10
11
|
constructor(environment: Environment, utility: Utility, xmlBuilder: XmlBuilder, axios: AxiosInstance, saveFiles: SaveFilesImpl, gerarConsulta: GerarConsultaImpl);
|
|
@@ -21,6 +22,7 @@ declare class NFCEAutorizacaoService extends BaseNFE implements NFCEAutorizacaoS
|
|
|
21
22
|
private validaDocumento;
|
|
22
23
|
private extrairDigestValue;
|
|
23
24
|
private gerarXmlNFCEAutorizacao;
|
|
25
|
+
protected callWebService(xmlConsulta: string, webServiceUrl: string, ContentType: string, action: string, agent: Agent): Promise<AxiosResponse<any, any>>;
|
|
24
26
|
Exec(data: NFe): Promise<{
|
|
25
27
|
success: boolean;
|
|
26
28
|
xMotivo: GenericObject;
|
|
@@ -5,6 +5,7 @@ import XmlBuilder from '@Adapters/XmlBuilder.js';
|
|
|
5
5
|
import { GenericObject, LayoutNFe, NFe, ProtNFe } from '@Types';
|
|
6
6
|
import BaseNFE from '@Modules/dfe/base/BaseNFe.js';
|
|
7
7
|
import { GerarConsultaImpl, NFEAutorizacaoServiceImpl, SaveFilesImpl } from '@Interfaces';
|
|
8
|
+
import { Agent } from 'http';
|
|
8
9
|
declare class NFEAutorizacaoService extends BaseNFE implements NFEAutorizacaoServiceImpl {
|
|
9
10
|
xmlNFe: string[];
|
|
10
11
|
constructor(environment: Environment, utility: Utility, xmlBuilder: XmlBuilder, axios: AxiosInstance, saveFiles: SaveFilesImpl, gerarConsulta: GerarConsultaImpl);
|
|
@@ -20,6 +21,7 @@ declare class NFEAutorizacaoService extends BaseNFE implements NFEAutorizacaoSer
|
|
|
20
21
|
private calcularDigitoVerificador;
|
|
21
22
|
private validaDocumento;
|
|
22
23
|
private gerarXmlNFeAutorizacao;
|
|
24
|
+
protected callWebService(xmlConsulta: string, webServiceUrl: string, ContentType: string, action: string, agent: Agent): Promise<AxiosResponse<any, any>>;
|
|
23
25
|
Exec(data: NFe): Promise<{
|
|
24
26
|
success: boolean;
|
|
25
27
|
xMotivo: GenericObject;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
2
|
import Environment from '@Modules/environment/Environment.js';
|
|
3
3
|
import Utility from '@Utils/Utility.js';
|
|
4
4
|
import XmlBuilder from '@Adapters/XmlBuilder.js';
|
|
5
5
|
import { ConsultaNFe, GenericObject } from '@Types';
|
|
6
6
|
import BaseNFE from '@Modules/dfe/base/BaseNFe.js';
|
|
7
7
|
import { GerarConsultaImpl, SaveFilesImpl } from '@Interfaces';
|
|
8
|
+
import { Agent } from 'http';
|
|
8
9
|
declare class NFEDistribuicaoDFeService extends BaseNFE {
|
|
9
10
|
constructor(environment: Environment, utility: Utility, xmlBuilder: XmlBuilder, axios: AxiosInstance, saveFiles: SaveFilesImpl, gerarConsulta: GerarConsultaImpl);
|
|
10
11
|
protected gerarXml(data: ConsultaNFe): string;
|
|
11
12
|
gerarXmlNFeDistribuicaoDFe(data: ConsultaNFe): string;
|
|
13
|
+
protected callWebService(xmlConsulta: string, webServiceUrl: string, ContentType: string, action: string, agent: Agent): Promise<AxiosResponse<any, any>>;
|
|
12
14
|
Exec(data: ConsultaNFe): Promise<{
|
|
13
15
|
data: GenericObject;
|
|
14
16
|
xMotivo: any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
2
|
import Environment from '@Modules/environment/Environment.js';
|
|
3
3
|
import Utility from '@Utils/Utility.js';
|
|
4
4
|
import XmlBuilder from '@Adapters/XmlBuilder.js';
|
|
5
5
|
import { EventoNFe, GenericObject, TipoEvento } from '@Types';
|
|
6
6
|
import BaseNFE from '@Modules/dfe/base/BaseNFe.js';
|
|
7
7
|
import { GerarConsultaImpl, NFERecepcaoEventoServiceImpl, SaveFilesImpl } from '@Interfaces';
|
|
8
|
+
import { Agent } from 'http';
|
|
8
9
|
declare class NFERecepcaoEventoService extends BaseNFE implements NFERecepcaoEventoServiceImpl {
|
|
9
10
|
tpEvento: string;
|
|
10
11
|
modelo?: string;
|
|
@@ -30,6 +31,7 @@ declare class NFERecepcaoEventoService extends BaseNFE implements NFERecepcaoEve
|
|
|
30
31
|
*/
|
|
31
32
|
private gerarXmlRecepcaoEvento;
|
|
32
33
|
private trataRetorno;
|
|
34
|
+
protected callWebService(xmlConsulta: string, webServiceUrl: string, ContentType: string, action: string, agent: Agent): Promise<AxiosResponse<any, any>>;
|
|
33
35
|
protected enviaEvento(evento: TipoEvento[], idLote: number, tipoAmbiente: number): Promise<any>;
|
|
34
36
|
Exec(data: EventoNFe): Promise<{
|
|
35
37
|
success: boolean;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/nfewizard-org/nfewizard-io"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.4.0",
|
|
8
8
|
"description": "NFeWizard-io é uma biblioteca Node.js projetada para simplificar a interação com os webservices da SEFAZ, proporcionando uma solução robusta para automação de processos relacionados à Nota Fiscal Eletrônica (NF-e).",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "tsx src/testes.ts",
|
|
25
|
+
"debug": "tsx src/debug.ts",
|
|
25
26
|
"test": "jest",
|
|
26
27
|
"clean": "rm -rf dist",
|
|
27
28
|
"build": "node build.mjs",
|
|
@@ -105,4 +106,4 @@
|
|
|
105
106
|
"tsx": "^4.7.2",
|
|
106
107
|
"typescript": "^5.4.5"
|
|
107
108
|
}
|
|
108
|
-
}
|
|
109
|
+
}
|