parser-de-notas-de-corretagem 0.11.13 โ†’ 0.12.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
@@ -1,12 +1,49 @@
1
- # Parse Brazilian brokerage notes PDFs (Rico, Clear, and Inter holders available)
1
+ # ๐Ÿฆœ Brazilian brokerage notes PDFs parser
2
+
3
+ > 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)
2
4
 
3
5
  ![npm](https://img.shields.io/npm/v/parser-de-notas-de-corretagem) [![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) [![Assets auto update](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/assets-auto-update.yml/badge.svg)](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/assets-auto-update.yml)
4
6
 
5
- Easing the PITA of making IRPF. **Inter support only v0.8.0 onwards โ—**
7
+ Easing the PITA of making IRPF.
6
8
 
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)
9
+ > [!WARNING]
10
+ > โ— *Inter* is only supported from v0.8.0 onwards.
11
+ >
12
+ > โ— *Nubank* in only supported from v0.12.0 onwards.
13
+
14
+ ## ๐Ÿ“ฐ Contents
15
+
16
+ - [๐Ÿฆœ Brazilian brokerage notes PDFs parser](#-brazilian-brokerage-notes-pdfs-parser)
17
+ - [๐Ÿ“ฐ Contents](#-contents)
18
+ - [๐Ÿšง Support](#-support)
19
+ - [๐Ÿ’ก Example result](#-example-result)
20
+ - [๐Ÿ› ๏ธ Install](#๏ธ-install)
21
+ - [๐Ÿ“š Usage](#-usage)
22
+ - [๐Ÿš€ Full NodeJS example](#-full-nodejs-example)
23
+ - [๐ŸŒ Browser](#-browser)
24
+ - [๐ŸŽจ Add a custom stock](#-add-a-custom-stock)
25
+ - [๐ŸŽญ Behavior](#-behavior)
26
+ - [โค๏ธ Contributors](#๏ธ-contributors)
27
+ - [๐Ÿ™๐Ÿป Thanks? You're welcome](#-thanks-youre-welcome)
28
+ - [๐Ÿฆ License](#-license)
29
+
30
+ ## ๐Ÿšง Support
31
+
32
+ > [!TIP]
33
+ > ๐Ÿงช Under test
34
+ > โœ… Good support
35
+
36
+ - [x] Rico โœ…
37
+ - [x] Clear โœ…
38
+ - [x] Inter โœ…
39
+ - [ ] Nubank ๐Ÿงช
40
+ - [x] Default ๐Ÿงช
41
+ - [ ] Sinacor โ“
42
+
43
+ > [!TIP]
44
+ > As of 2025, [Nubank provides non-Sinacor versions of brokerage notes by default](https://blog.nubank.com.br/nota-de-corretagem-nubank-nuinvest/). This parser is focused on parsing those non-Sinacor ones (for now).
8
45
 
9
- ## Example result
46
+ ## ๐Ÿ’ก Example result
10
47
 
11
48
  > The `price` and `average` fields already include the fees paid
12
49
 
@@ -77,13 +114,13 @@ Easing the PITA of making IRPF. **Inter support only v0.8.0 onwards โ—**
77
114
  ]
78
115
  ```
79
116
 
80
- ## Install
117
+ ## ๐Ÿ› ๏ธ Install
81
118
 
82
119
  > npm i parser-de-notas-de-corretagem
83
120
 
84
- ## Usage
121
+ ## ๐Ÿ“š Usage
85
122
 
86
- ### Full NodeJS example
123
+ ### ๐Ÿš€ Full NodeJS example
87
124
 
88
125
  ```typescript
89
126
  import fs from 'fs';
@@ -146,7 +183,7 @@ async function main() {
146
183
  main();
147
184
  ```
148
185
 
149
- ### Browser
186
+ ### ๐ŸŒ Browser
150
187
 
151
188
  Since only `Uint8Array` is accepted, use the following code to convert a string using the browser
152
189
 
@@ -155,7 +192,7 @@ if (typeof fileContent === 'string') fileContent = Uint8Array.from(fileContent,
155
192
  await assetsParser.parseNote(filePath, fileContent, filePasswords);
156
193
  ```
157
194
 
158
- ### Add a custom stock
195
+ ### ๐ŸŽจ Add a custom stock
159
196
 
160
197
  There are many assets out there and some of them (like funds) are kind of hard to keep track. If some asset is not recognized, `parseNote` will throw the error `UnknownAsset`
161
198
 
@@ -192,24 +229,24 @@ assets.defineStock('KDIF11', 'FDC KINEAINF FIDC', '26.324.298/0001-89');
192
229
  assets.defineStock('KDIF11_2', 'FDC KINEAINF FIDC', '26.324.298/0001-89');
193
230
  ```
194
231
 
195
- ## P.S
232
+ ## ๐ŸŽญ Behavior
196
233
 
197
- * Total values include fees
198
- * 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)
199
- * Inter broker has only a few tests, so please open [Issues](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/issues) if you find something wrong
200
- * Local auto-update isn't persistent. New releases are done everyday with persistent updates
201
- * Other brokers may work with the internal PDF architecture is the same as the supported brokers
234
+ - Total values include fees
235
+ - 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)
236
+ - Inter broker has only a few tests, so please open [Issues](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/issues) if you find something wrong
237
+ - Local auto-update isn't persistent. New releases are done everyday with persistent updates
238
+ - Other brokers may work with the internal PDF architecture is the same as the supported brokers
202
239
 
203
- ## Contributors
240
+ ## โค๏ธ Contributors
204
241
 
205
242
  Thanks to whom sent the notes for the tests โค๏ธ. Personal data is not stored neither used on tests, only the notes' content.
206
243
 
207
- ## Thanks? U welcome
244
+ ## ๐Ÿ™๐Ÿป Thanks? You're welcome
208
245
 
209
246
  Consider thanking me: send a "Thanks!" ๐Ÿ‘‹ by [PIX](https://www.bcb.gov.br/en/financialstability/pix_en) ๐Ÿ˜Š
210
247
  > a09e5878-2355-45f7-9f36-6df4ccf383cf
211
248
 
212
- ## License
249
+ ## ๐Ÿฆ License
213
250
 
214
251
  As license, this software is provided as is, free of charge, **without any warranty whatsoever**. Its author is not responsible for its usage. Use it by your own risk.
215
252
 
package/notes-parser.d.ts CHANGED
@@ -70,6 +70,9 @@ export declare class WrongPassword extends BaseError {
70
70
  /** Empty document error */
71
71
  export declare class EmptyDocument extends BaseError {
72
72
  }
73
+ /** Document that cannot be recognized */
74
+ export declare class UnknownDocumentFormat extends BaseError {
75
+ }
73
76
  /** Document without note number error */
74
77
  export declare class MissingNoteNumber extends BaseError {
75
78
  }