parser-de-notas-de-corretagem 0.1.0 → 0.2.1
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/notes-parser.d.ts +44 -67
- package/notes-parser.js +1 -1
- package/notes-parser.js.map +1 -1
- package/package.json +1 -1
package/notes-parser.d.ts
CHANGED
|
@@ -1,92 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deal made in a `NegotiationNote` type
|
|
3
|
-
*/
|
|
1
|
+
/** Deal made in a `NegotiationNote` type */
|
|
4
2
|
export interface Deal {
|
|
5
|
-
/**
|
|
6
|
-
* Deal type
|
|
7
|
-
*/
|
|
3
|
+
/** Deal type */
|
|
8
4
|
type: 'buy' | 'sell';
|
|
9
|
-
/**
|
|
10
|
-
* Stock/FII code
|
|
11
|
-
*/
|
|
5
|
+
/** Stock/FII code */
|
|
12
6
|
code: string;
|
|
13
|
-
/**
|
|
14
|
-
* Amount bought/sold
|
|
15
|
-
*/
|
|
7
|
+
/** Amount bought/sold */
|
|
16
8
|
quantity: number;
|
|
17
|
-
/**
|
|
18
|
-
* Average value bought/sold with fees applied
|
|
19
|
-
*/
|
|
9
|
+
/** Average value bought/sold with fees applied */
|
|
20
10
|
average: string;
|
|
21
|
-
/**
|
|
22
|
-
* Total amount bought/sold with fees applied
|
|
23
|
-
*/
|
|
11
|
+
/** Total amount bought/sold with fees applied */
|
|
24
12
|
price: string;
|
|
25
|
-
/**
|
|
26
|
-
* Deal date in format yyyy-MM-dd
|
|
27
|
-
*/
|
|
13
|
+
/** Deal date in format yyyy-MM-dd */
|
|
28
14
|
date: string;
|
|
29
|
-
/**
|
|
30
|
-
* Asset's CNPJ
|
|
31
|
-
*/
|
|
15
|
+
/** Asset's CNPJ */
|
|
32
16
|
cnpj: string;
|
|
33
17
|
}
|
|
34
|
-
/**
|
|
35
|
-
* A parsed Negotiation Note type
|
|
36
|
-
*/
|
|
18
|
+
/** A parsed Negotiation Note type */
|
|
37
19
|
export declare class NegotiationNote {
|
|
38
|
-
/**
|
|
39
|
-
* Negotiation note number
|
|
40
|
-
*/
|
|
20
|
+
/** Negotiation note number */
|
|
41
21
|
number: string;
|
|
42
|
-
/**
|
|
43
|
-
* The total amount bought with fees applied
|
|
44
|
-
*/
|
|
22
|
+
/** The total amount bought with fees applied */
|
|
45
23
|
buyTotal: string;
|
|
46
|
-
/**
|
|
47
|
-
* The total amount sold with fees applied
|
|
48
|
-
*/
|
|
24
|
+
/** The total amount sold with fees applied */
|
|
49
25
|
sellTotal: string;
|
|
50
|
-
/**
|
|
51
|
-
* The total amount of buy fees
|
|
52
|
-
*/
|
|
26
|
+
/** The total amount of buy fees */
|
|
53
27
|
buyFees: string;
|
|
54
|
-
/**
|
|
55
|
-
* The total amount of sell fees
|
|
56
|
-
*/
|
|
28
|
+
/** The total amount of sell fees */
|
|
57
29
|
sellFees: string;
|
|
58
|
-
/**
|
|
59
|
-
* The total amount of fees
|
|
60
|
-
*/
|
|
30
|
+
/** The total amount of fees */
|
|
61
31
|
fees: string;
|
|
62
|
-
/**
|
|
63
|
-
* Negotiation note date in format yyyy-MM-dd
|
|
64
|
-
*/
|
|
32
|
+
/** Negotiation note date in format yyyy-MM-dd */
|
|
65
33
|
date: string;
|
|
66
|
-
/**
|
|
67
|
-
* Negotiation note holder
|
|
68
|
-
*/
|
|
34
|
+
/** Negotiation note holder */
|
|
69
35
|
holder: string;
|
|
70
|
-
/**
|
|
71
|
-
* Array of deals with buys and sells
|
|
72
|
-
*/
|
|
36
|
+
/** Array of deals with buys and sells */
|
|
73
37
|
deals: Deal[];
|
|
74
38
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Possible date formats to be used
|
|
77
|
-
*/
|
|
39
|
+
/** Possible date formats to be used */
|
|
78
40
|
export type DateFormat = "dd/MM/yyyy" | "yyyy-MM-dd";
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
41
|
+
/** Wrong password error */
|
|
42
|
+
export declare class WrongPassword extends Error {
|
|
43
|
+
}
|
|
44
|
+
/** Empty document error */
|
|
45
|
+
export declare class EmptyDocument extends Error {
|
|
46
|
+
}
|
|
47
|
+
/** Document without note number error */
|
|
48
|
+
export declare class MissingNoteNumber extends Error {
|
|
49
|
+
}
|
|
50
|
+
/** Document without holder error */
|
|
51
|
+
export declare class MissingHolder extends Error {
|
|
52
|
+
}
|
|
53
|
+
/** Document without date error */
|
|
54
|
+
export declare class MissingDate extends Error {
|
|
55
|
+
}
|
|
56
|
+
/** Missing Buy or Sell sums */
|
|
57
|
+
export declare class MissingBuyOrSellSums extends Error {
|
|
58
|
+
}
|
|
59
|
+
/** Unknown Asset error error */
|
|
60
|
+
export declare class UnknownAsset extends Error {
|
|
61
|
+
}
|
|
62
|
+
/** Brokerage notes parser */
|
|
82
63
|
export declare class NoteParser {
|
|
83
|
-
/**
|
|
84
|
-
* Path to the JSON data file
|
|
85
|
-
*/
|
|
64
|
+
/** Path to the JSON data file */
|
|
86
65
|
private stockParser;
|
|
87
|
-
/**
|
|
88
|
-
* The date format used. Default is "dd/MM/yyyy"
|
|
89
|
-
*/
|
|
66
|
+
/** The date format used. Default is `dd/MM/yyyy` */
|
|
90
67
|
private dateFormat;
|
|
91
68
|
/**
|
|
92
69
|
* Instantiate a new `NoteParser`
|
|
@@ -106,7 +83,7 @@ export declare class NoteParser {
|
|
|
106
83
|
* @param content PDF content
|
|
107
84
|
* @returns an `Array` of `NegotiationNote`
|
|
108
85
|
*/
|
|
109
|
-
parseNote(noteName: string, content: Uint8Array, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
|
|
86
|
+
parseNote(noteName: string, content: string | Uint8Array, possiblePasswords?: string[]): Promise<NegotiationNote[]>;
|
|
110
87
|
/**
|
|
111
88
|
* Add stock definition
|
|
112
89
|
* @param code stock code
|