@plasoft/boletos 1.0.6 → 1.0.8

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: {
@@ -55,13 +43,17 @@ interface IDadosBoleto {
55
43
  beneficiario: {
56
44
  nome: string;
57
45
  cnpj: string;
58
- dadosBancarios: {
46
+ dadosBancario: {
59
47
  carteira: string;
60
48
  convenio: string;
61
49
  agencia: string;
62
50
  agenciaDigito: string;
63
51
  conta: string;
64
52
  contaDigito: string;
53
+ juros?: number;
54
+ multa?: number;
55
+ desconto?: number;
56
+ protesto?: number;
65
57
  };
66
58
  endereco: {
67
59
  logradouro: string;
@@ -92,25 +84,116 @@ interface IDadosBoleto {
92
84
  usoDoBanco?: string;
93
85
  cip?: string;
94
86
  codigoBarra: string;
87
+ linhaDigitavel: string;
95
88
  codigoBarraImage?: string;
96
89
  instrucao1?: string;
97
90
  instrucao2?: string;
98
91
  instrucao3?: string;
92
+ instrucao4?: string;
99
93
  };
100
94
  }
101
- declare function gerarPDF(dados: IDadosBoleto): Promise<{
102
- erro: boolean;
103
- dados?: undefined;
104
- } | {
105
- erro: boolean;
106
- dados: null;
107
- }>;
95
+ interface IGerarRemessaAilos {
96
+ banco: Banco.AILOS;
97
+ dados: {
98
+ remessa: IDadosRemessa$1;
99
+ };
100
+ }
101
+ interface IDadosRemessa$1 {
102
+ beneficiario: {
103
+ nome: string;
104
+ cnpj: string;
105
+ endereco: {
106
+ logradouro: string;
107
+ numero: string;
108
+ bairro: string;
109
+ cep: string;
110
+ municipio: string;
111
+ uf: string;
112
+ };
113
+ };
114
+ dadosBancario: {
115
+ carteira: string;
116
+ convenio: string;
117
+ agencia: string;
118
+ agenciaDigito: string;
119
+ conta: string;
120
+ contaDigito: string;
121
+ numeroRemessa: string;
122
+ jurosMes: number;
123
+ multaAtraso: number;
124
+ descontoPagamento: number;
125
+ diasProtesto: number;
126
+ };
127
+ boletos: {
128
+ identificacaoTitulo: string;
129
+ vencimento: string | Date;
130
+ valor: number | string;
131
+ nossoNumero: string;
132
+ numeroDocumento: string;
133
+ parcela: number | string;
134
+ pagador: {
135
+ nome: string;
136
+ pessoa: 'F' | 'J';
137
+ cpfCnpj: string;
138
+ endereco: {
139
+ logradouro: string;
140
+ numero: string;
141
+ bairro: string;
142
+ cep: string;
143
+ municipio: string;
144
+ uf: string;
145
+ };
146
+ };
147
+ }[];
148
+ }
149
+ interface IGerarRetornoAilos {
150
+ banco: Banco.AILOS;
151
+ dados: {
152
+ arquivo: string[];
153
+ };
154
+ }
155
+ interface IDocumentoRetornoAilos {
156
+ id_documento: string;
157
+ especie: string;
158
+ valor: number;
159
+ valor_multa: number;
160
+ valor_juros: number;
161
+ valor_desconto: number;
162
+ valor_total: number;
163
+ }
108
164
 
109
- interface IDadosRemessa {
165
+ interface IGerarBoletoBradesco {
166
+ banco: Banco.BRADESCO;
167
+ dados: {
168
+ bancario: IDadosBancario;
169
+ parcela: IParcela;
170
+ bradesco?: boolean;
171
+ };
172
+ }
173
+ interface IDadosBancario {
174
+ numero: string;
175
+ numero_dv: string;
176
+ convenio: string;
177
+ carteira: string;
178
+ }
179
+ interface IParcela {
180
+ id_boleto: number;
181
+ parcela: number;
182
+ vencimento: string | Date;
183
+ valor: number | string;
184
+ pago: number | string;
185
+ data_emissao: string | Date;
186
+ }
187
+ interface IGerarPDFBradesco {
188
+ banco: Banco.BRADESCO;
189
+ dados: {
190
+ dadosPDF: IDadosPDF;
191
+ generatePDF?: (content: string, config: PDFOptions) => Promise<string>;
192
+ };
193
+ }
194
+ interface IDadosPDF {
110
195
  pagador: {
111
196
  nome: string;
112
- pessoa: 'F' | 'J';
113
- cpfCnpj: string;
114
197
  endereco: {
115
198
  logradouro: string;
116
199
  numero: string;
@@ -120,6 +203,60 @@ interface IDadosRemessa {
120
203
  uf: string;
121
204
  };
122
205
  };
206
+ beneficiario: {
207
+ nome: string;
208
+ cnpj: string;
209
+ dadosBancarios: {
210
+ carteira: string;
211
+ convenio: string;
212
+ agencia: string;
213
+ agenciaDigito: string;
214
+ conta: string;
215
+ contaDigito: string;
216
+ };
217
+ endereco: {
218
+ logradouro: string;
219
+ numero: string;
220
+ bairro: string;
221
+ cep: string;
222
+ municipio: string;
223
+ uf: string;
224
+ };
225
+ };
226
+ boleto: {
227
+ dataVencimento: string;
228
+ dataProcessamento: string;
229
+ dataDocumento: string;
230
+ valorCobrado: number | string;
231
+ valorDocumento: number | string;
232
+ valorDescontoAbatimento: number | string;
233
+ valorOutrasDeducoes: number | string;
234
+ valorMulta: number | string;
235
+ valorAcrescimo: number | string;
236
+ quantidade?: number | string;
237
+ valor?: number | string;
238
+ numeroDocumento: string;
239
+ nossoNumero: string;
240
+ especieDocumento: string;
241
+ aceite: 'S' | 'N';
242
+ moeda: string;
243
+ usoDoBanco?: string;
244
+ cip?: string;
245
+ codigoBarra: string;
246
+ codigoBarraImage?: string;
247
+ instrucao1?: string;
248
+ instrucao2?: string;
249
+ instrucao3?: string;
250
+ };
251
+ }
252
+ interface IGerarRemessaBradesco {
253
+ banco: Banco.BRADESCO;
254
+ dados: {
255
+ remessa: IDadosRemessa;
256
+ bradesco?: boolean;
257
+ };
258
+ }
259
+ interface IDadosRemessa {
123
260
  beneficiario: {
124
261
  nome: string;
125
262
  cnpj: string;
@@ -152,19 +289,80 @@ interface IDadosRemessa {
152
289
  nossoNumero: string;
153
290
  numeroDocumento: string;
154
291
  parcela: number | string;
292
+ pagador: {
293
+ nome: string;
294
+ pessoa: 'F' | 'J';
295
+ cpfCnpj: string;
296
+ endereco: {
297
+ logradouro: string;
298
+ numero: string;
299
+ bairro: string;
300
+ cep: string;
301
+ municipio: string;
302
+ uf: string;
303
+ };
304
+ };
155
305
  }[];
156
306
  }
157
- declare function gerarRemessa(dados: IDadosRemessa): Promise<{
307
+ interface IGerarRetornoBradesco {
308
+ banco: Banco.BRADESCO;
309
+ dados: {
310
+ arquivo: string[];
311
+ };
312
+ }
313
+
314
+ type IGerarBoleto = IGerarBoletoAilos | IGerarBoletoBradesco;
315
+ type IGerarPDF = IGerarPDFAilos | IGerarPDFBradesco;
316
+ type IGerarRemessa = IGerarRemessaAilos | IGerarRemessaBradesco;
317
+ type IGerarRetorno = IGerarRetornoAilos | IGerarRetornoBradesco;
318
+ declare enum Banco {
319
+ AILOS = "085",
320
+ BRADESCO = "005"
321
+ }
322
+
323
+ declare function gerar({ banco, dados }: IGerarBoleto): {
324
+ linhaDigitavel: string;
325
+ fatorVencimento: string;
326
+ valor: string;
327
+ convenio: string;
328
+ nossoNumero: string;
329
+ campoLivre: string;
330
+ digitoGeral: string;
331
+ codigoBarra: string;
332
+ numeroDocumento: string;
333
+ } | null | undefined;
334
+
335
+ declare function pdf({ banco, dados }: IGerarPDF): Promise<{
336
+ erro: boolean;
337
+ dados: string | null;
338
+ } | {
339
+ erro: boolean;
340
+ dados: Error;
341
+ }> | undefined;
342
+
343
+ declare function remessa({ banco, dados }: IGerarRemessa): {
158
344
  download: string;
159
345
  arquivo: string;
160
- } | null>;
346
+ } | Promise<{
347
+ download: string;
348
+ arquivo: string;
349
+ } | null> | null | undefined;
161
350
 
162
- declare const ailos: {
163
- gerarDadosBoleto: typeof gerarDadosBoleto;
164
- gerarPDF: typeof gerarPDF;
165
- gerarRemessa: typeof gerarRemessa;
166
- };
351
+ declare function retorno({ banco, dados }: IGerarRetorno): IDocumentoRetornoAilos[] | null | undefined;
167
352
 
168
- declare function bradesco(): void;
353
+ interface IConfig {
354
+ apiClient?: {
355
+ url?: string;
356
+ authorization?: string;
357
+ };
358
+ }
359
+ declare function defineConfig({ apiClient }: IConfig): void;
360
+
361
+ declare const _default: {
362
+ gerar: typeof gerar;
363
+ pdf: typeof pdf;
364
+ remessa: typeof remessa;
365
+ retorno: typeof retorno;
366
+ };
169
367
 
170
- export { ailos, bradesco };
368
+ export { Banco, _default as default, defineConfig };