@plasoft/boletos 1.0.6 → 1.0.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.
package/build/index.d.mts CHANGED
@@ -1,4 +1,19 @@
1
- interface IParcelaGerarBoleto {
1
+ import { PDFOptions } from 'puppeteer-core';
2
+
3
+ interface IGerarBoletoAilos {
4
+ banco: Banco.AILOS;
5
+ dados: {
6
+ bancario: IDadosBancario$1;
7
+ parcela: IParcela$1;
8
+ };
9
+ }
10
+ interface IDadosBancario$1 {
11
+ numero: string;
12
+ numero_dv: string;
13
+ convenio: string;
14
+ carteira: string;
15
+ }
16
+ interface IParcela$1 {
2
17
  id_boleto: number;
3
18
  parcela: number;
4
19
  vencimento: string | Date;
@@ -6,41 +21,14 @@ interface IParcelaGerarBoleto {
6
21
  pago: number | string;
7
22
  data_emissao: string | Date;
8
23
  }
9
-
10
- type IParcela = IParcelaGerarBoleto;
11
- interface ICedente {
12
- numero: string;
13
- numero_dv: string;
14
- convenio: string;
15
- msg_local: string;
16
- msg_1: string;
17
- msg_2: string;
18
- msg_3: string;
19
- nome: string;
20
- cnpj: string;
21
- carteira: string;
24
+ interface IGerarPDFAilos {
25
+ banco: Banco.AILOS;
26
+ dados: {
27
+ dadosPDF: IDadosPDF$1;
28
+ generatePDF?: (content: string, config: PDFOptions) => Promise<string>;
29
+ };
22
30
  }
23
- declare function gerarDadosBoleto(cedente: ICedente, parcela: IParcela): Promise<{
24
- fatorVencimento: string;
25
- valor: string;
26
- convenio: string;
27
- nossoNumero: string;
28
- campoLivre: string;
29
- digitoGeral: string;
30
- codigoBarra: string;
31
- numeroDocumento: string;
32
- campo1: string;
33
- campo2: string;
34
- campo3: string;
35
- campo4: string;
36
- campo5: string;
37
- digito1: string;
38
- digito2: string;
39
- digito3: string;
40
- digito4: string;
41
- } | null>;
42
-
43
- interface IDadosBoleto {
31
+ interface IDadosPDF$1 {
44
32
  pagador: {
45
33
  nome: string;
46
34
  endereco: {
@@ -98,19 +86,108 @@ interface IDadosBoleto {
98
86
  instrucao3?: string;
99
87
  };
100
88
  }
101
- declare function gerarPDF(dados: IDadosBoleto): Promise<{
102
- erro: boolean;
103
- dados?: undefined;
104
- } | {
105
- erro: boolean;
106
- dados: null;
107
- }>;
89
+ interface IGerarRemessaAilos {
90
+ banco: Banco.AILOS;
91
+ dados: {
92
+ remessa: IDadosRemessa$1;
93
+ };
94
+ }
95
+ interface IDadosRemessa$1 {
96
+ beneficiario: {
97
+ nome: string;
98
+ cnpj: string;
99
+ endereco: {
100
+ logradouro: string;
101
+ numero: string;
102
+ bairro: string;
103
+ cep: string;
104
+ municipio: string;
105
+ uf: string;
106
+ };
107
+ };
108
+ dadosBancario: {
109
+ carteira: string;
110
+ convenio: string;
111
+ agencia: string;
112
+ agenciaDigito: string;
113
+ conta: string;
114
+ contaDigito: string;
115
+ numeroRemessa: string;
116
+ jurosMes: number;
117
+ multaAtraso: number;
118
+ descontoPagamento: number;
119
+ diasProtesto: number;
120
+ };
121
+ boletos: {
122
+ identificacaoTitulo: string;
123
+ vencimento: string | Date;
124
+ valor: number | string;
125
+ nossoNumero: string;
126
+ numeroDocumento: string;
127
+ parcela: number | string;
128
+ pagador: {
129
+ nome: string;
130
+ pessoa: 'F' | 'J';
131
+ cpfCnpj: string;
132
+ endereco: {
133
+ logradouro: string;
134
+ numero: string;
135
+ bairro: string;
136
+ cep: string;
137
+ municipio: string;
138
+ uf: string;
139
+ };
140
+ };
141
+ }[];
142
+ }
143
+ interface IGerarRetornoAilos {
144
+ banco: Banco.AILOS;
145
+ dados: {
146
+ arquivo: string[];
147
+ };
148
+ }
149
+ interface IDocumentoRetornoAilos {
150
+ id_documento: string;
151
+ especie: string;
152
+ valor: number;
153
+ valor_multa: number;
154
+ valor_juros: number;
155
+ valor_desconto: number;
156
+ valor_total: number;
157
+ }
108
158
 
109
- interface IDadosRemessa {
159
+ interface IGerarBoletoBradesco {
160
+ banco: Banco.BRADESCO;
161
+ dados: {
162
+ bancario: IDadosBancario;
163
+ parcela: IParcela;
164
+ bradesco?: boolean;
165
+ };
166
+ }
167
+ interface IDadosBancario {
168
+ numero: string;
169
+ numero_dv: string;
170
+ convenio: string;
171
+ carteira: string;
172
+ }
173
+ interface IParcela {
174
+ id_boleto: number;
175
+ parcela: number;
176
+ vencimento: string | Date;
177
+ valor: number | string;
178
+ pago: number | string;
179
+ data_emissao: string | Date;
180
+ }
181
+ interface IGerarPDFBradesco {
182
+ banco: Banco.BRADESCO;
183
+ dados: {
184
+ dadosPDF: IDadosPDF;
185
+ generatePDF?: (content: string, config: PDFOptions) => Promise<string>;
186
+ };
187
+ }
188
+ interface IDadosPDF {
110
189
  pagador: {
111
190
  nome: string;
112
- pessoa: 'F' | 'J';
113
- cpfCnpj: string;
114
191
  endereco: {
115
192
  logradouro: string;
116
193
  numero: string;
@@ -120,6 +197,60 @@ interface IDadosRemessa {
120
197
  uf: string;
121
198
  };
122
199
  };
200
+ beneficiario: {
201
+ nome: string;
202
+ cnpj: string;
203
+ dadosBancarios: {
204
+ carteira: string;
205
+ convenio: string;
206
+ agencia: string;
207
+ agenciaDigito: string;
208
+ conta: string;
209
+ contaDigito: string;
210
+ };
211
+ endereco: {
212
+ logradouro: string;
213
+ numero: string;
214
+ bairro: string;
215
+ cep: string;
216
+ municipio: string;
217
+ uf: string;
218
+ };
219
+ };
220
+ boleto: {
221
+ dataVencimento: string;
222
+ dataProcessamento: string;
223
+ dataDocumento: string;
224
+ valorCobrado: number | string;
225
+ valorDocumento: number | string;
226
+ valorDescontoAbatimento: number | string;
227
+ valorOutrasDeducoes: number | string;
228
+ valorMulta: number | string;
229
+ valorAcrescimo: number | string;
230
+ quantidade?: number | string;
231
+ valor?: number | string;
232
+ numeroDocumento: string;
233
+ nossoNumero: string;
234
+ especieDocumento: string;
235
+ aceite: 'S' | 'N';
236
+ moeda: string;
237
+ usoDoBanco?: string;
238
+ cip?: string;
239
+ codigoBarra: string;
240
+ codigoBarraImage?: string;
241
+ instrucao1?: string;
242
+ instrucao2?: string;
243
+ instrucao3?: string;
244
+ };
245
+ }
246
+ interface IGerarRemessaBradesco {
247
+ banco: Banco.BRADESCO;
248
+ dados: {
249
+ remessa: IDadosRemessa;
250
+ bradesco?: boolean;
251
+ };
252
+ }
253
+ interface IDadosRemessa {
123
254
  beneficiario: {
124
255
  nome: string;
125
256
  cnpj: string;
@@ -152,19 +283,89 @@ interface IDadosRemessa {
152
283
  nossoNumero: string;
153
284
  numeroDocumento: string;
154
285
  parcela: number | string;
286
+ pagador: {
287
+ nome: string;
288
+ pessoa: 'F' | 'J';
289
+ cpfCnpj: string;
290
+ endereco: {
291
+ logradouro: string;
292
+ numero: string;
293
+ bairro: string;
294
+ cep: string;
295
+ municipio: string;
296
+ uf: string;
297
+ };
298
+ };
155
299
  }[];
156
300
  }
157
- declare function gerarRemessa(dados: IDadosRemessa): Promise<{
301
+ interface IGerarRetornoBradesco {
302
+ banco: Banco.BRADESCO;
303
+ dados: {
304
+ arquivo: string[];
305
+ };
306
+ }
307
+
308
+ type IGerarBoleto = IGerarBoletoAilos | IGerarBoletoBradesco;
309
+ type IGerarPDF = IGerarPDFAilos | IGerarPDFBradesco;
310
+ type IGerarRemessa = IGerarRemessaAilos | IGerarRemessaBradesco;
311
+ type IGerarRetorno = IGerarRetornoAilos | IGerarRetornoBradesco;
312
+ declare enum Banco {
313
+ AILOS = "085",
314
+ BRADESCO = "005"
315
+ }
316
+
317
+ declare function gerar({ banco, dados }: IGerarBoleto): {
318
+ fatorVencimento: string;
319
+ valor: string;
320
+ convenio: string;
321
+ nossoNumero: string;
322
+ campoLivre: string;
323
+ digitoGeral: string;
324
+ codigoBarra: string;
325
+ numeroDocumento: string;
326
+ campo1: string;
327
+ campo2: string;
328
+ campo3: string;
329
+ campo4: string;
330
+ campo5: string;
331
+ digito1: string;
332
+ digito2: string;
333
+ digito3: string;
334
+ digito4: string;
335
+ } | null | undefined;
336
+
337
+ declare function pdf({ banco, dados }: IGerarPDF): Promise<{
338
+ erro: boolean;
339
+ dados: string | null;
340
+ } | {
341
+ erro: boolean;
342
+ dados: Error;
343
+ }> | undefined;
344
+
345
+ declare function remessa({ banco, dados }: IGerarRemessa): {
346
+ download: string;
347
+ arquivo: string;
348
+ } | Promise<{
158
349
  download: string;
159
350
  arquivo: string;
160
- } | null>;
351
+ } | null> | null | undefined;
161
352
 
162
- declare const ailos: {
163
- gerarDadosBoleto: typeof gerarDadosBoleto;
164
- gerarPDF: typeof gerarPDF;
165
- gerarRemessa: typeof gerarRemessa;
166
- };
353
+ declare function retorno({ banco, dados }: IGerarRetorno): IDocumentoRetornoAilos[] | null | undefined;
167
354
 
168
- declare function bradesco(): void;
355
+ interface IConfig {
356
+ apiClient?: {
357
+ url?: string;
358
+ authorization?: string;
359
+ };
360
+ printer?: boolean;
361
+ }
362
+ declare function defineConfig({ apiClient }: IConfig): void;
363
+
364
+ declare const _default: {
365
+ gerar: typeof gerar;
366
+ pdf: typeof pdf;
367
+ remessa: typeof remessa;
368
+ retorno: typeof retorno;
369
+ };
169
370
 
170
- export { ailos, bradesco };
371
+ export { Banco, _default as default, defineConfig };
package/build/index.d.ts CHANGED
@@ -1,4 +1,19 @@
1
- interface IParcelaGerarBoleto {
1
+ import { PDFOptions } from 'puppeteer-core';
2
+
3
+ interface IGerarBoletoAilos {
4
+ banco: Banco.AILOS;
5
+ dados: {
6
+ bancario: IDadosBancario$1;
7
+ parcela: IParcela$1;
8
+ };
9
+ }
10
+ interface IDadosBancario$1 {
11
+ numero: string;
12
+ numero_dv: string;
13
+ convenio: string;
14
+ carteira: string;
15
+ }
16
+ interface IParcela$1 {
2
17
  id_boleto: number;
3
18
  parcela: number;
4
19
  vencimento: string | Date;
@@ -6,41 +21,14 @@ interface IParcelaGerarBoleto {
6
21
  pago: number | string;
7
22
  data_emissao: string | Date;
8
23
  }
9
-
10
- type IParcela = IParcelaGerarBoleto;
11
- interface ICedente {
12
- numero: string;
13
- numero_dv: string;
14
- convenio: string;
15
- msg_local: string;
16
- msg_1: string;
17
- msg_2: string;
18
- msg_3: string;
19
- nome: string;
20
- cnpj: string;
21
- carteira: string;
24
+ interface IGerarPDFAilos {
25
+ banco: Banco.AILOS;
26
+ dados: {
27
+ dadosPDF: IDadosPDF$1;
28
+ generatePDF?: (content: string, config: PDFOptions) => Promise<string>;
29
+ };
22
30
  }
23
- declare function gerarDadosBoleto(cedente: ICedente, parcela: IParcela): Promise<{
24
- fatorVencimento: string;
25
- valor: string;
26
- convenio: string;
27
- nossoNumero: string;
28
- campoLivre: string;
29
- digitoGeral: string;
30
- codigoBarra: string;
31
- numeroDocumento: string;
32
- campo1: string;
33
- campo2: string;
34
- campo3: string;
35
- campo4: string;
36
- campo5: string;
37
- digito1: string;
38
- digito2: string;
39
- digito3: string;
40
- digito4: string;
41
- } | null>;
42
-
43
- interface IDadosBoleto {
31
+ interface IDadosPDF$1 {
44
32
  pagador: {
45
33
  nome: string;
46
34
  endereco: {
@@ -98,19 +86,108 @@ interface IDadosBoleto {
98
86
  instrucao3?: string;
99
87
  };
100
88
  }
101
- declare function gerarPDF(dados: IDadosBoleto): Promise<{
102
- erro: boolean;
103
- dados?: undefined;
104
- } | {
105
- erro: boolean;
106
- dados: null;
107
- }>;
89
+ interface IGerarRemessaAilos {
90
+ banco: Banco.AILOS;
91
+ dados: {
92
+ remessa: IDadosRemessa$1;
93
+ };
94
+ }
95
+ interface IDadosRemessa$1 {
96
+ beneficiario: {
97
+ nome: string;
98
+ cnpj: string;
99
+ endereco: {
100
+ logradouro: string;
101
+ numero: string;
102
+ bairro: string;
103
+ cep: string;
104
+ municipio: string;
105
+ uf: string;
106
+ };
107
+ };
108
+ dadosBancario: {
109
+ carteira: string;
110
+ convenio: string;
111
+ agencia: string;
112
+ agenciaDigito: string;
113
+ conta: string;
114
+ contaDigito: string;
115
+ numeroRemessa: string;
116
+ jurosMes: number;
117
+ multaAtraso: number;
118
+ descontoPagamento: number;
119
+ diasProtesto: number;
120
+ };
121
+ boletos: {
122
+ identificacaoTitulo: string;
123
+ vencimento: string | Date;
124
+ valor: number | string;
125
+ nossoNumero: string;
126
+ numeroDocumento: string;
127
+ parcela: number | string;
128
+ pagador: {
129
+ nome: string;
130
+ pessoa: 'F' | 'J';
131
+ cpfCnpj: string;
132
+ endereco: {
133
+ logradouro: string;
134
+ numero: string;
135
+ bairro: string;
136
+ cep: string;
137
+ municipio: string;
138
+ uf: string;
139
+ };
140
+ };
141
+ }[];
142
+ }
143
+ interface IGerarRetornoAilos {
144
+ banco: Banco.AILOS;
145
+ dados: {
146
+ arquivo: string[];
147
+ };
148
+ }
149
+ interface IDocumentoRetornoAilos {
150
+ id_documento: string;
151
+ especie: string;
152
+ valor: number;
153
+ valor_multa: number;
154
+ valor_juros: number;
155
+ valor_desconto: number;
156
+ valor_total: number;
157
+ }
108
158
 
109
- interface IDadosRemessa {
159
+ interface IGerarBoletoBradesco {
160
+ banco: Banco.BRADESCO;
161
+ dados: {
162
+ bancario: IDadosBancario;
163
+ parcela: IParcela;
164
+ bradesco?: boolean;
165
+ };
166
+ }
167
+ interface IDadosBancario {
168
+ numero: string;
169
+ numero_dv: string;
170
+ convenio: string;
171
+ carteira: string;
172
+ }
173
+ interface IParcela {
174
+ id_boleto: number;
175
+ parcela: number;
176
+ vencimento: string | Date;
177
+ valor: number | string;
178
+ pago: number | string;
179
+ data_emissao: string | Date;
180
+ }
181
+ interface IGerarPDFBradesco {
182
+ banco: Banco.BRADESCO;
183
+ dados: {
184
+ dadosPDF: IDadosPDF;
185
+ generatePDF?: (content: string, config: PDFOptions) => Promise<string>;
186
+ };
187
+ }
188
+ interface IDadosPDF {
110
189
  pagador: {
111
190
  nome: string;
112
- pessoa: 'F' | 'J';
113
- cpfCnpj: string;
114
191
  endereco: {
115
192
  logradouro: string;
116
193
  numero: string;
@@ -120,6 +197,60 @@ interface IDadosRemessa {
120
197
  uf: string;
121
198
  };
122
199
  };
200
+ beneficiario: {
201
+ nome: string;
202
+ cnpj: string;
203
+ dadosBancarios: {
204
+ carteira: string;
205
+ convenio: string;
206
+ agencia: string;
207
+ agenciaDigito: string;
208
+ conta: string;
209
+ contaDigito: string;
210
+ };
211
+ endereco: {
212
+ logradouro: string;
213
+ numero: string;
214
+ bairro: string;
215
+ cep: string;
216
+ municipio: string;
217
+ uf: string;
218
+ };
219
+ };
220
+ boleto: {
221
+ dataVencimento: string;
222
+ dataProcessamento: string;
223
+ dataDocumento: string;
224
+ valorCobrado: number | string;
225
+ valorDocumento: number | string;
226
+ valorDescontoAbatimento: number | string;
227
+ valorOutrasDeducoes: number | string;
228
+ valorMulta: number | string;
229
+ valorAcrescimo: number | string;
230
+ quantidade?: number | string;
231
+ valor?: number | string;
232
+ numeroDocumento: string;
233
+ nossoNumero: string;
234
+ especieDocumento: string;
235
+ aceite: 'S' | 'N';
236
+ moeda: string;
237
+ usoDoBanco?: string;
238
+ cip?: string;
239
+ codigoBarra: string;
240
+ codigoBarraImage?: string;
241
+ instrucao1?: string;
242
+ instrucao2?: string;
243
+ instrucao3?: string;
244
+ };
245
+ }
246
+ interface IGerarRemessaBradesco {
247
+ banco: Banco.BRADESCO;
248
+ dados: {
249
+ remessa: IDadosRemessa;
250
+ bradesco?: boolean;
251
+ };
252
+ }
253
+ interface IDadosRemessa {
123
254
  beneficiario: {
124
255
  nome: string;
125
256
  cnpj: string;
@@ -152,19 +283,89 @@ interface IDadosRemessa {
152
283
  nossoNumero: string;
153
284
  numeroDocumento: string;
154
285
  parcela: number | string;
286
+ pagador: {
287
+ nome: string;
288
+ pessoa: 'F' | 'J';
289
+ cpfCnpj: string;
290
+ endereco: {
291
+ logradouro: string;
292
+ numero: string;
293
+ bairro: string;
294
+ cep: string;
295
+ municipio: string;
296
+ uf: string;
297
+ };
298
+ };
155
299
  }[];
156
300
  }
157
- declare function gerarRemessa(dados: IDadosRemessa): Promise<{
301
+ interface IGerarRetornoBradesco {
302
+ banco: Banco.BRADESCO;
303
+ dados: {
304
+ arquivo: string[];
305
+ };
306
+ }
307
+
308
+ type IGerarBoleto = IGerarBoletoAilos | IGerarBoletoBradesco;
309
+ type IGerarPDF = IGerarPDFAilos | IGerarPDFBradesco;
310
+ type IGerarRemessa = IGerarRemessaAilos | IGerarRemessaBradesco;
311
+ type IGerarRetorno = IGerarRetornoAilos | IGerarRetornoBradesco;
312
+ declare enum Banco {
313
+ AILOS = "085",
314
+ BRADESCO = "005"
315
+ }
316
+
317
+ declare function gerar({ banco, dados }: IGerarBoleto): {
318
+ fatorVencimento: string;
319
+ valor: string;
320
+ convenio: string;
321
+ nossoNumero: string;
322
+ campoLivre: string;
323
+ digitoGeral: string;
324
+ codigoBarra: string;
325
+ numeroDocumento: string;
326
+ campo1: string;
327
+ campo2: string;
328
+ campo3: string;
329
+ campo4: string;
330
+ campo5: string;
331
+ digito1: string;
332
+ digito2: string;
333
+ digito3: string;
334
+ digito4: string;
335
+ } | null | undefined;
336
+
337
+ declare function pdf({ banco, dados }: IGerarPDF): Promise<{
338
+ erro: boolean;
339
+ dados: string | null;
340
+ } | {
341
+ erro: boolean;
342
+ dados: Error;
343
+ }> | undefined;
344
+
345
+ declare function remessa({ banco, dados }: IGerarRemessa): {
346
+ download: string;
347
+ arquivo: string;
348
+ } | Promise<{
158
349
  download: string;
159
350
  arquivo: string;
160
- } | null>;
351
+ } | null> | null | undefined;
161
352
 
162
- declare const ailos: {
163
- gerarDadosBoleto: typeof gerarDadosBoleto;
164
- gerarPDF: typeof gerarPDF;
165
- gerarRemessa: typeof gerarRemessa;
166
- };
353
+ declare function retorno({ banco, dados }: IGerarRetorno): IDocumentoRetornoAilos[] | null | undefined;
167
354
 
168
- declare function bradesco(): void;
355
+ interface IConfig {
356
+ apiClient?: {
357
+ url?: string;
358
+ authorization?: string;
359
+ };
360
+ printer?: boolean;
361
+ }
362
+ declare function defineConfig({ apiClient }: IConfig): void;
363
+
364
+ declare const _default: {
365
+ gerar: typeof gerar;
366
+ pdf: typeof pdf;
367
+ remessa: typeof remessa;
368
+ retorno: typeof retorno;
369
+ };
169
370
 
170
- export { ailos, bradesco };
371
+ export { Banco, _default as default, defineConfig };