nfewizard-io 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,7 @@
1
1
  export type NFeWizardProps = {
2
+ /**
3
+ * @param {obj} dfe - Configurações relacionadas aos processos de DFe
4
+ */
2
5
  dfe: {
3
6
  /**
4
7
  * @param {boolean} baixarXMLDistribuicao - Define se os XMLs retornados pelo método NFeDistribuicaoDFe serão salvos
@@ -70,6 +73,9 @@ export type NFeWizardProps = {
70
73
  */
71
74
  CPFCNPJ: string;
72
75
  };
76
+ /**
77
+ * @param {obj} nfe - Configurações relacionadas aos processos de NFe e NFCe
78
+ */
73
79
  nfe: {
74
80
  /**
75
81
  * @param {number} ambiente - Define o ambiente que receberá os XML da NF-e:
@@ -91,8 +97,8 @@ export type NFeWizardProps = {
91
97
  idCSC?: number;
92
98
  };
93
99
  /**
94
- * @param email -Preencher para casos onde for necessário utilizar envio de e-mail;
95
- */
100
+ * @param email -Preencher para casos onde for necessário utilizar envio de e-mail;
101
+ */
96
102
  email?: {
97
103
  /**
98
104
  * @param {string} host - Host SMTP do seu provedor de e-mail
@@ -133,13 +139,34 @@ export type NFeWizardProps = {
133
139
  to: string;
134
140
  };
135
141
  };
142
+ /**
143
+ * @param {obj} lib - Permite customização de alguns parametros de execução da lib
144
+ */
136
145
  lib?: {
146
+ /**
147
+ * @param {obj} connection - Define opções de conexão aos webservices da SEFAZ
148
+ */
137
149
  connection?: {
150
+ /**
151
+ * @param {obj} timeout - Define o tempo de espera por um retorno da SEFAZ
152
+ */
138
153
  timeout?: number;
139
154
  };
155
+ /**
156
+ * @param {obj} log - Define opções de log
157
+ */
140
158
  log?: {
141
159
  exibirLogNoConsole?: boolean;
142
160
  };
161
+ /**
162
+ * @param {boolean} useOpenSSL - Define se a lib deve utilizar métodos que fazem uso do OpenSSL ou não
163
+ */
143
164
  useOpenSSL?: boolean;
165
+ /**
166
+ * @param {validateSchemaJavaBased | validateSchemaJsBased} useForSchemaValidation - Define se a lib deve utilizar um método de validação de schema
167
+ * baseado em JAVA ou em JS puro.
168
+ * Útil para utilização em ambientes sem JAVA (Ex: Lambda)
169
+ */
170
+ useForSchemaValidation?: 'validateSchemaJavaBased' | 'validateSchemaJsBased';
144
171
  };
145
172
  };
@@ -9,9 +9,7 @@
9
9
  <xs:sequence>
10
10
  <xs:element name="tpAmb" type="TAmb">
11
11
  <xs:annotation>
12
- <xs:documentation>Identificação do Ambiente:
13
- 1 - Produção
14
- 2 - Homologação</xs:documentation>
12
+ <xs:documentation>Identificação do Ambiente: 1 - Produção 2 - Homologação</xs:documentation>
15
13
  </xs:annotation>
16
14
  </xs:element>
17
15
  <xs:element name="cUF" type="TCodUfIBGE">
@@ -39,9 +37,7 @@
39
37
  <xs:sequence>
40
38
  <xs:element name="tpAmb" type="TAmb">
41
39
  <xs:annotation>
42
- <xs:documentation>Identificação do Ambiente:
43
- 1 - Produção
44
- 2 - Homologação</xs:documentation>
40
+ <xs:documentation>Identificação do Ambiente: 1 - Produção 2 - Homologação</xs:documentation>
45
41
  </xs:annotation>
46
42
  </xs:element>
47
43
  <xs:element name="verAplic" type="TVerAplic">
@@ -15,7 +15,9 @@
15
15
  <!-- PL_009-v5a implementado alterações da NT -->
16
16
  <!-- PL_009k_NT2023_001_v100 implementado alterações da NT 2023.001 -->
17
17
  <xs:schema xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:editix="http://www.portalfiscal.inf.br/nfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
18
+
18
19
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v1.01.xsd"/>
20
+
19
21
  <xs:include schemaLocation="tiposBasico_v4.00.xsd"/>
20
22
  <xs:complexType name="TNFe">
21
23
  <xs:annotation>
@@ -4,6 +4,7 @@ import { Json } from './xml2json';
4
4
  declare class Utility {
5
5
  environment: Environment;
6
6
  json: Json;
7
+ private schemaAttributes;
7
8
  constructor(environment: Environment);
8
9
  /**
9
10
  * Método utilitário para criar diretórios
@@ -50,7 +51,8 @@ declare class Utility {
50
51
  * Função para validar XML com Schema
51
52
  */
52
53
  formatErrorMessage(message: string): string;
53
- validateSchema(xml: any, metodo: string): Promise<unknown>;
54
+ validateSchemaJsBased(xml: any, metodo: string): Promise<unknown>;
55
+ validateSchemaJavaBased(xml: any, metodo: string): Promise<unknown>;
54
56
  verificaRejeicao(data: string, metodo: string, name?: string): GenericObject;
55
57
  getProtNFe(xmlRetorno: string): {
56
58
  protNFe: ProtNFe[] | undefined;
@@ -1 +1,4 @@
1
- export declare const getSchema: (metodo: string) => string;
1
+ export declare const getSchema: (metodo: string) => {
2
+ basePath: string;
3
+ schemaPath: string;
4
+ };
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.1.8",
7
+ "version": "0.2.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
  "main": "dist/cjs/index.js",
10
10
  "types": "dist/cjs/index.d.ts",
@@ -54,6 +54,7 @@
54
54
  "ini": "^4.1.1",
55
55
  "jspdf": "^2.5.1",
56
56
  "jspdf-autotable": "^3.8.2",
57
+ "libxmljs": "^1.0.11",
57
58
  "node-fetch": "^3.3.2",
58
59
  "node-forge": "^1.3.1",
59
60
  "nodemailer": "^6.9.14",
@@ -69,6 +70,7 @@
69
70
  "xml-crypto": "^6.0.0",
70
71
  "xml-js": "^1.6.11",
71
72
  "xml2js": "^0.6.2",
73
+ "xsd-assembler": "^0.0.1",
72
74
  "xsd-schema-validator": "^0.7.0"
73
75
  },
74
76
  "devDependencies": {
@@ -95,4 +97,4 @@
95
97
  "tsx": "^4.7.2",
96
98
  "typescript": "^5.4.5"
97
99
  }
98
- }
100
+ }