@f-o-t/ofx 2.4.1 → 2.4.2
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/LICENSE.md +17 -6
- package/package.json +33 -61
- package/dist/index.d.ts +0 -190
- package/dist/index.js +0 -1257
package/LICENSE.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
Copyright (c) 2026 FOT (F-O-T)
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
5
11
|
|
|
6
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,63 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"typescript": ">=4.5.0"
|
|
36
|
-
},
|
|
37
|
-
"peerDependenciesMeta": {
|
|
38
|
-
"typescript": {
|
|
39
|
-
"optional": true
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"private": false,
|
|
43
|
-
"publishConfig": {
|
|
44
|
-
"access": "public"
|
|
45
|
-
},
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "https://github.com/F-O-T/montte-nx.git"
|
|
49
|
-
},
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "bunup",
|
|
52
|
-
"check": "biome check --write .",
|
|
53
|
-
"dev": "bunup --watch",
|
|
54
|
-
"release": "bumpp --commit --push --tag",
|
|
55
|
-
"test": "bun test",
|
|
56
|
-
"test:coverage": "bun test --coverage",
|
|
57
|
-
"test:watch": "bun test --watch",
|
|
58
|
-
"typecheck": "tsc "
|
|
59
|
-
},
|
|
60
|
-
"type": "module",
|
|
61
|
-
"types": "./dist/index.d.ts",
|
|
62
|
-
"version": "2.4.1"
|
|
2
|
+
"name": "@f-o-t/ofx",
|
|
3
|
+
"version": "2.4.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "bun x --bun fot build",
|
|
18
|
+
"test": "bun x --bun fot test",
|
|
19
|
+
"lint": "bun x --bun fot lint",
|
|
20
|
+
"format": "bun x --bun fot format",
|
|
21
|
+
"typecheck": "bun x --bun fot typecheck"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"zod": "^4.3.6"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@f-o-t/cli": "^1.0.0",
|
|
28
|
+
"@f-o-t/config": "^1.0.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/F-O-T/libraries.git",
|
|
33
|
+
"directory": "libraries/ofx"
|
|
34
|
+
}
|
|
63
35
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
declare const ofxDateSchema: any;
|
|
3
|
-
type OFXDate = z.infer<typeof ofxDateSchema>;
|
|
4
|
-
declare const statusSchema: any;
|
|
5
|
-
type OFXStatus = z.infer<typeof statusSchema>;
|
|
6
|
-
declare const financialInstitutionSchema: any;
|
|
7
|
-
type OFXFinancialInstitution = z.infer<typeof financialInstitutionSchema>;
|
|
8
|
-
declare const transactionTypeSchema: any;
|
|
9
|
-
type OFXTransactionType = z.infer<typeof transactionTypeSchema>;
|
|
10
|
-
declare const transactionSchema: any;
|
|
11
|
-
type OFXTransaction = z.infer<typeof transactionSchema>;
|
|
12
|
-
declare const accountTypeSchema: any;
|
|
13
|
-
type OFXAccountType = z.infer<typeof accountTypeSchema>;
|
|
14
|
-
declare const bankAccountSchema: any;
|
|
15
|
-
type OFXBankAccount = z.infer<typeof bankAccountSchema>;
|
|
16
|
-
declare const creditCardAccountSchema: any;
|
|
17
|
-
type OFXCreditCardAccount = z.infer<typeof creditCardAccountSchema>;
|
|
18
|
-
declare const balanceSchema: any;
|
|
19
|
-
type OFXBalance = z.infer<typeof balanceSchema>;
|
|
20
|
-
declare const transactionListSchema: any;
|
|
21
|
-
type OFXTransactionList = z.infer<typeof transactionListSchema>;
|
|
22
|
-
declare const bankStatementResponseSchema: any;
|
|
23
|
-
type OFXBankStatementResponse = z.infer<typeof bankStatementResponseSchema>;
|
|
24
|
-
declare const creditCardStatementResponseSchema: any;
|
|
25
|
-
type OFXCreditCardStatementResponse = z.infer<typeof creditCardStatementResponseSchema>;
|
|
26
|
-
declare const signOnResponseSchema: any;
|
|
27
|
-
type OFXSignOnResponse = z.infer<typeof signOnResponseSchema>;
|
|
28
|
-
declare const bankStatementTransactionResponseSchema: any;
|
|
29
|
-
type OFXBankStatementTransactionResponse = z.infer<typeof bankStatementTransactionResponseSchema>;
|
|
30
|
-
declare const creditCardStatementTransactionResponseSchema: any;
|
|
31
|
-
type OFXCreditCardStatementTransactionResponse = z.infer<typeof creditCardStatementTransactionResponseSchema>;
|
|
32
|
-
declare const bankMessageSetResponseSchema: any;
|
|
33
|
-
type OFXBankMessageSetResponse = z.infer<typeof bankMessageSetResponseSchema>;
|
|
34
|
-
declare const creditCardMessageSetResponseSchema: any;
|
|
35
|
-
type OFXCreditCardMessageSetResponse = z.infer<typeof creditCardMessageSetResponseSchema>;
|
|
36
|
-
declare const signOnMessageSetResponseSchema: any;
|
|
37
|
-
type OFXSignOnMessageSetResponse = z.infer<typeof signOnMessageSetResponseSchema>;
|
|
38
|
-
declare const ofxResponseSchema: any;
|
|
39
|
-
type OFXResponse = z.infer<typeof ofxResponseSchema>;
|
|
40
|
-
declare const ofxHeaderSchema: any;
|
|
41
|
-
type OFXHeader = z.infer<typeof ofxHeaderSchema>;
|
|
42
|
-
declare const ofxDocumentSchema: any;
|
|
43
|
-
type OFXDocument = z.infer<typeof ofxDocumentSchema>;
|
|
44
|
-
interface BalanceInfo {
|
|
45
|
-
ledger?: OFXBalance;
|
|
46
|
-
available?: OFXBalance;
|
|
47
|
-
}
|
|
48
|
-
declare function getTransactions(document: OFXDocument): OFXTransaction[];
|
|
49
|
-
declare function getAccountInfo(document: OFXDocument): (OFXBankAccount | OFXCreditCardAccount)[];
|
|
50
|
-
declare function getBalance(document: OFXDocument): BalanceInfo[];
|
|
51
|
-
declare function getSignOnInfo(document: OFXDocument): OFXSignOnResponse;
|
|
52
|
-
import { z as z2 } from "zod";
|
|
53
|
-
declare const generateHeaderOptionsSchema: any;
|
|
54
|
-
type GenerateHeaderOptions = z2.infer<typeof generateHeaderOptionsSchema>;
|
|
55
|
-
declare function generateHeader(options?: GenerateHeaderOptions): string;
|
|
56
|
-
declare const generateTransactionInputSchema: any;
|
|
57
|
-
type GenerateTransactionInput = z2.infer<typeof generateTransactionInputSchema>;
|
|
58
|
-
declare const generateBankStatementOptionsSchema: any;
|
|
59
|
-
type GenerateBankStatementOptions = z2.infer<typeof generateBankStatementOptionsSchema>;
|
|
60
|
-
declare function generateBankStatement(options: GenerateBankStatementOptions): string;
|
|
61
|
-
declare const generateCreditCardStatementOptionsSchema: any;
|
|
62
|
-
type GenerateCreditCardStatementOptions = z2.infer<typeof generateCreditCardStatementOptionsSchema>;
|
|
63
|
-
declare function generateCreditCardStatement(options: GenerateCreditCardStatementOptions): string;
|
|
64
|
-
import { z as z3 } from "zod";
|
|
65
|
-
declare function getEncodingFromCharset(charset?: string): string;
|
|
66
|
-
type ParseResult<T> = {
|
|
67
|
-
success: true;
|
|
68
|
-
data: T;
|
|
69
|
-
} | {
|
|
70
|
-
success: false;
|
|
71
|
-
error: z3.ZodError;
|
|
72
|
-
};
|
|
73
|
-
declare function parse(content: string): ParseResult<OFXDocument>;
|
|
74
|
-
declare function parseOrThrow(content: string): OFXDocument;
|
|
75
|
-
/**
|
|
76
|
-
* Decodes an OFX buffer to a string with proper charset detection.
|
|
77
|
-
* Automatically detects encoding from OFX header (CHARSET field).
|
|
78
|
-
*/
|
|
79
|
-
declare function decodeOfxBuffer(buffer: Uint8Array): string;
|
|
80
|
-
declare function parseBuffer(buffer: Uint8Array): ParseResult<OFXDocument>;
|
|
81
|
-
declare function parseBufferOrThrow(buffer: Uint8Array): OFXDocument;
|
|
82
|
-
interface StreamOptions {
|
|
83
|
-
encoding?: string;
|
|
84
|
-
}
|
|
85
|
-
type StreamEvent = {
|
|
86
|
-
type: "header";
|
|
87
|
-
data: OFXHeader;
|
|
88
|
-
} | {
|
|
89
|
-
type: "transaction";
|
|
90
|
-
data: OFXTransaction;
|
|
91
|
-
} | {
|
|
92
|
-
type: "account";
|
|
93
|
-
data: OFXBankAccount | OFXCreditCardAccount;
|
|
94
|
-
} | {
|
|
95
|
-
type: "balance";
|
|
96
|
-
data: {
|
|
97
|
-
ledger?: OFXBalance;
|
|
98
|
-
available?: OFXBalance;
|
|
99
|
-
};
|
|
100
|
-
} | {
|
|
101
|
-
type: "complete";
|
|
102
|
-
transactionCount: number;
|
|
103
|
-
};
|
|
104
|
-
interface BatchFileInput {
|
|
105
|
-
filename: string;
|
|
106
|
-
buffer: Uint8Array;
|
|
107
|
-
}
|
|
108
|
-
type BatchStreamEvent = {
|
|
109
|
-
type: "file_start";
|
|
110
|
-
fileIndex: number;
|
|
111
|
-
filename: string;
|
|
112
|
-
} | {
|
|
113
|
-
type: "header";
|
|
114
|
-
fileIndex: number;
|
|
115
|
-
data: OFXHeader;
|
|
116
|
-
} | {
|
|
117
|
-
type: "transaction";
|
|
118
|
-
fileIndex: number;
|
|
119
|
-
data: OFXTransaction;
|
|
120
|
-
} | {
|
|
121
|
-
type: "account";
|
|
122
|
-
fileIndex: number;
|
|
123
|
-
data: OFXBankAccount | OFXCreditCardAccount;
|
|
124
|
-
} | {
|
|
125
|
-
type: "balance";
|
|
126
|
-
fileIndex: number;
|
|
127
|
-
data: {
|
|
128
|
-
ledger?: OFXBalance;
|
|
129
|
-
available?: OFXBalance;
|
|
130
|
-
};
|
|
131
|
-
} | {
|
|
132
|
-
type: "file_complete";
|
|
133
|
-
fileIndex: number;
|
|
134
|
-
filename: string;
|
|
135
|
-
transactionCount: number;
|
|
136
|
-
} | {
|
|
137
|
-
type: "file_error";
|
|
138
|
-
fileIndex: number;
|
|
139
|
-
filename: string;
|
|
140
|
-
error: string;
|
|
141
|
-
} | {
|
|
142
|
-
type: "batch_complete";
|
|
143
|
-
totalFiles: number;
|
|
144
|
-
totalTransactions: number;
|
|
145
|
-
errorCount: number;
|
|
146
|
-
};
|
|
147
|
-
interface BatchParsedFile {
|
|
148
|
-
fileIndex: number;
|
|
149
|
-
filename: string;
|
|
150
|
-
header?: OFXHeader;
|
|
151
|
-
transactions: OFXTransaction[];
|
|
152
|
-
accounts: (OFXBankAccount | OFXCreditCardAccount)[];
|
|
153
|
-
balances: {
|
|
154
|
-
ledger?: OFXBalance;
|
|
155
|
-
available?: OFXBalance;
|
|
156
|
-
}[];
|
|
157
|
-
error?: string;
|
|
158
|
-
}
|
|
159
|
-
declare function parseStream(input: ReadableStream<Uint8Array> | AsyncIterable<string>, options?: StreamOptions): AsyncGenerator<StreamEvent>;
|
|
160
|
-
declare function parseStreamToArray(input: ReadableStream<Uint8Array> | AsyncIterable<string>, options?: StreamOptions): Promise<{
|
|
161
|
-
header?: OFXHeader;
|
|
162
|
-
transactions: OFXTransaction[];
|
|
163
|
-
accounts: (OFXBankAccount | OFXCreditCardAccount)[];
|
|
164
|
-
balances: {
|
|
165
|
-
ledger?: OFXBalance;
|
|
166
|
-
available?: OFXBalance;
|
|
167
|
-
}[];
|
|
168
|
-
}>;
|
|
169
|
-
/**
|
|
170
|
-
* Streaming batch parser - processes files sequentially, yielding events.
|
|
171
|
-
* Yields control between files for UI responsiveness.
|
|
172
|
-
*
|
|
173
|
-
* @param files - Array of files with filename and buffer
|
|
174
|
-
* @param options - Stream options (encoding)
|
|
175
|
-
* @yields BatchStreamEvent for each file start, transaction, completion, or error
|
|
176
|
-
*/
|
|
177
|
-
declare function parseBatchStream(files: BatchFileInput[], options?: StreamOptions): AsyncGenerator<BatchStreamEvent>;
|
|
178
|
-
/**
|
|
179
|
-
* Convenience function that collects streaming batch results into arrays.
|
|
180
|
-
*
|
|
181
|
-
* @param files - Array of files with filename and buffer
|
|
182
|
-
* @param options - Stream options (encoding)
|
|
183
|
-
* @returns Array of parsed file results
|
|
184
|
-
*/
|
|
185
|
-
declare function parseBatchStreamToArray(files: BatchFileInput[], options?: StreamOptions): Promise<BatchParsedFile[]>;
|
|
186
|
-
declare function formatOfxDate(date: Date, timezone?: {
|
|
187
|
-
offset: number;
|
|
188
|
-
name: string;
|
|
189
|
-
}): string;
|
|
190
|
-
export { parseStreamToArray, parseStream, parseOrThrow, parseBufferOrThrow, parseBuffer, parseBatchStreamToArray, parseBatchStream, parse, getTransactions, getSignOnInfo, getEncodingFromCharset, getBalance, getAccountInfo, generateTransactionInputSchema, generateHeaderOptionsSchema, generateHeader, generateCreditCardStatementOptionsSchema, generateCreditCardStatement, generateBankStatementOptionsSchema, generateBankStatement, formatOfxDate, decodeOfxBuffer, StreamOptions, StreamEvent, ParseResult, OFXTransactionType, OFXTransactionList, OFXTransaction, OFXStatus, OFXSignOnResponse, OFXSignOnMessageSetResponse, OFXResponse, OFXHeader, OFXFinancialInstitution, OFXDocument, OFXDate, OFXCreditCardStatementTransactionResponse, OFXCreditCardStatementResponse, OFXCreditCardMessageSetResponse, OFXCreditCardAccount, OFXBankStatementTransactionResponse, OFXBankStatementResponse, OFXBankMessageSetResponse, OFXBankAccount, OFXBalance, OFXAccountType, GenerateTransactionInput, GenerateHeaderOptions, GenerateCreditCardStatementOptions, GenerateBankStatementOptions, BatchStreamEvent, BatchParsedFile, BatchFileInput, BalanceInfo };
|