parser-de-notas-de-corretagem 0.3.1 → 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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/ci.yml/badge.svg)](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/ci.yml)
4
4
 
5
- Easing the PITA of making IRRF
5
+ Easing the PITA of making IRPF
6
6
 
7
7
  > Note: This is a JS/TS package. If you want the end-user solution, check the [Leitor de notas de corretagem](https://github.com/planetsLightningArrester/leitor-de-notas-de-corretagem)
8
8
 
@@ -27,7 +27,8 @@ Easing the PITA of making IRRF
27
27
  "average": "16.30",
28
28
  "price": "1010.91",
29
29
  "date": "02/02/2022",
30
- "cnpj": "60.840.055/0001-31"
30
+ "cnpj": "60.840.055/0001-31",
31
+ "isFII": false
31
32
  },
32
33
  {
33
34
  "type": "buy",
@@ -36,7 +37,8 @@ Easing the PITA of making IRRF
36
37
  "average": "112.80",
37
38
  "price": "564.02",
38
39
  "date": "02/02/2022",
39
- "cnpj": "28.737.771/0001-85"
40
+ "cnpj": "28.737.771/0001-85",
41
+ "isFII": true
40
42
  },
41
43
  {
42
44
  "type": "buy",
@@ -45,7 +47,8 @@ Easing the PITA of making IRRF
45
47
  "average": "112.03",
46
48
  "price": "560.17",
47
49
  "date": "02/02/2022",
48
- "cnpj": "29.641.226/0001-53"
50
+ "cnpj": "29.641.226/0001-53",
51
+ "isFII": true
49
52
  },
50
53
  {
51
54
  "type": "buy",
@@ -54,7 +57,8 @@ Easing the PITA of making IRRF
54
57
  "average": "97.38",
55
58
  "price": "1460.69",
56
59
  "date": "02/02/2022",
57
- "cnpj": "17.554.274/0001-25"
60
+ "cnpj": "17.554.274/0001-25",
61
+ "isFII": true
58
62
  },
59
63
  {
60
64
  "type": "buy",
@@ -63,7 +67,8 @@ Easing the PITA of making IRRF
63
67
  "average": "91.76",
64
68
  "price": "458.79",
65
69
  "date": "02/02/2022",
66
- "cnpj": "28.757.546/0001-00"
70
+ "cnpj": "28.757.546/0001-00",
71
+ "isFII": true
67
72
  }
68
73
  ]
69
74
  }
@@ -141,7 +146,7 @@ assets.defineStock('BIDI11', 'BANCO INTER UNT');
141
146
  * The values can deviate from cents. It's always a good call to double-check if the result is as expected. Check the [License](#license)
142
147
 
143
148
  ## Contributors
144
- Thanks to whom sent me notes for the tests ❤️. Personal data is not stored neither used on tests, only the notes content.
149
+ Thanks to whom sent me notes for the tests ❤️. Personal data is not stored neither used on tests, only the notes' content.
145
150
 
146
151
  ## Thanks? U welcome
147
152
  Consider thanking me: send a "Thanks!" 👋 by [PIX](https://www.bcb.gov.br/en/financialstability/pix_en) 😊
package/notes-parser.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /** Deal made in a `NegotiationNote` type */
2
3
  export interface Deal {
3
4
  /** Deal type */
@@ -14,6 +15,8 @@ export interface Deal {
14
15
  date: string;
15
16
  /** Asset's CNPJ */
16
17
  cnpj: string;
18
+ /** Whether the asset is a FII (real estate) */
19
+ isFII: boolean;
17
20
  }
18
21
  /** A parsed Negotiation Note type */
19
22
  export declare class NegotiationNote {
@@ -83,14 +86,14 @@ export declare class NoteParser {
83
86
  * @param content PDF content
84
87
  * @returns an `Array` of `NegotiationNote`
85
88
  */
86
- parseNote(noteName: string, content: string | Uint8Array, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
89
+ parseNote(noteName: string, content: Buffer | Uint8Array, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
87
90
  /**
88
91
  * Add stock definition
89
92
  * @param code stock code
90
93
  * @param name stock name
91
94
  * @param cnpj stock CNPJ
92
95
  */
93
- defineStock(code: string, name: string, cnpj?: string): void;
96
+ defineStock(code: string, name: string, cnpj?: string, isFII?: boolean): void;
94
97
  /**
95
98
  * Convert a date according to `dateFormat`
96
99
  * @param date the date to be formatted