neotoma 0.18.0 → 0.18.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/dist/__fixtures__/helpers.d.ts +91 -0
- package/dist/__fixtures__/helpers.d.ts.map +1 -0
- package/dist/__fixtures__/helpers.js +384 -0
- package/dist/__fixtures__/helpers.js.map +1 -0
- package/dist/__fixtures__/types.d.ts +285 -0
- package/dist/__fixtures__/types.d.ts.map +1 -0
- package/dist/__fixtures__/types.js +7 -0
- package/dist/__fixtures__/types.js.map +1 -0
- package/dist/__fixtures__/validation.d.ts +45 -0
- package/dist/__fixtures__/validation.d.ts.map +1 -0
- package/dist/__fixtures__/validation.js +311 -0
- package/dist/__fixtures__/validation.js.map +1 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +28 -1
- package/dist/actions.js.map +1 -1
- package/dist/cli/bootstrap.js +0 -0
- package/dist/cli/digest.d.ts +53 -0
- package/dist/cli/digest.d.ts.map +1 -0
- package/dist/cli/digest.js +218 -0
- package/dist/cli/digest.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/parse_schema_fields.d.ts +26 -0
- package/dist/cli/parse_schema_fields.d.ts.map +1 -0
- package/dist/cli/parse_schema_fields.js +66 -0
- package/dist/cli/parse_schema_fields.js.map +1 -0
- package/dist/config/plaid.d.ts +21 -0
- package/dist/config/plaid.d.ts.map +1 -0
- package/dist/config/plaid.js +48 -0
- package/dist/config/plaid.js.map +1 -0
- package/dist/docs/developer/mirror_writeback.md +38 -0
- package/dist/docs/developer/source_storage_by_reference.md +48 -0
- package/dist/docs/testing/automated_test_catalog.md +5 -4
- package/dist/events/event_emitter.d.ts +24 -0
- package/dist/events/event_emitter.d.ts.map +1 -0
- package/dist/events/event_emitter.js +85 -0
- package/dist/events/event_emitter.js.map +1 -0
- package/dist/events/event_log.d.ts +23 -0
- package/dist/events/event_log.d.ts.map +1 -0
- package/dist/events/event_log.js +77 -0
- package/dist/events/event_log.js.map +1 -0
- package/dist/events/event_schema.d.ts +58 -0
- package/dist/events/event_schema.d.ts.map +1 -0
- package/dist/events/event_schema.js +43 -0
- package/dist/events/event_schema.js.map +1 -0
- package/dist/events/event_validator.d.ts +23 -0
- package/dist/events/event_validator.d.ts.map +1 -0
- package/dist/events/event_validator.js +90 -0
- package/dist/events/event_validator.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +9 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/replay.d.ts +27 -0
- package/dist/events/replay.d.ts.map +1 -0
- package/dist/events/replay.js +62 -0
- package/dist/events/replay.js.map +1 -0
- package/dist/hashing/hash_chain.d.ts +31 -0
- package/dist/hashing/hash_chain.d.ts.map +1 -0
- package/dist/hashing/hash_chain.js +45 -0
- package/dist/hashing/hash_chain.js.map +1 -0
- package/dist/integrations/plaid/client.d.ts +53 -0
- package/dist/integrations/plaid/client.d.ts.map +1 -0
- package/dist/integrations/plaid/client.js +224 -0
- package/dist/integrations/plaid/client.js.map +1 -0
- package/dist/integrations/plaid/normalizers.d.ts +26 -0
- package/dist/integrations/plaid/normalizers.d.ts.map +1 -0
- package/dist/integrations/plaid/normalizers.js +166 -0
- package/dist/integrations/plaid/normalizers.js.map +1 -0
- package/dist/integrations/providers/asana.d.ts +9 -0
- package/dist/integrations/providers/asana.d.ts.map +1 -0
- package/dist/integrations/providers/asana.js +62 -0
- package/dist/integrations/providers/asana.js.map +1 -0
- package/dist/integrations/providers/base.d.ts +17 -0
- package/dist/integrations/providers/base.d.ts.map +1 -0
- package/dist/integrations/providers/base.js +64 -0
- package/dist/integrations/providers/base.js.map +1 -0
- package/dist/integrations/providers/facebook.d.ts +9 -0
- package/dist/integrations/providers/facebook.d.ts.map +1 -0
- package/dist/integrations/providers/facebook.js +58 -0
- package/dist/integrations/providers/facebook.js.map +1 -0
- package/dist/integrations/providers/gmail.d.ts +10 -0
- package/dist/integrations/providers/gmail.d.ts.map +1 -0
- package/dist/integrations/providers/gmail.js +67 -0
- package/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/integrations/providers/index.d.ts +6 -0
- package/dist/integrations/providers/index.d.ts.map +1 -0
- package/dist/integrations/providers/index.js +25 -0
- package/dist/integrations/providers/index.js.map +1 -0
- package/dist/integrations/providers/instagram.d.ts +9 -0
- package/dist/integrations/providers/instagram.d.ts.map +1 -0
- package/dist/integrations/providers/instagram.js +47 -0
- package/dist/integrations/providers/instagram.js.map +1 -0
- package/dist/integrations/providers/metadata.d.ts +25 -0
- package/dist/integrations/providers/metadata.d.ts.map +1 -0
- package/dist/integrations/providers/metadata.js +407 -0
- package/dist/integrations/providers/metadata.js.map +1 -0
- package/dist/integrations/providers/types.d.ts +39 -0
- package/dist/integrations/providers/types.d.ts.map +1 -0
- package/dist/integrations/providers/types.js +2 -0
- package/dist/integrations/providers/types.js.map +1 -0
- package/dist/integrations/providers/x.d.ts +9 -0
- package/dist/integrations/providers/x.d.ts.map +1 -0
- package/dist/integrations/providers/x.js +78 -0
- package/dist/integrations/providers/x.js.map +1 -0
- package/dist/reducers/record_reducer.d.ts +25 -0
- package/dist/reducers/record_reducer.d.ts.map +1 -0
- package/dist/reducers/record_reducer.js +93 -0
- package/dist/reducers/record_reducer.js.map +1 -0
- package/dist/reducers/reducer_registry.d.ts +47 -0
- package/dist/reducers/reducer_registry.d.ts.map +1 -0
- package/dist/reducers/reducer_registry.js +82 -0
- package/dist/reducers/reducer_registry.js.map +1 -0
- package/dist/repositories/db/event_repo.d.ts +14 -0
- package/dist/repositories/db/event_repo.d.ts.map +1 -0
- package/dist/repositories/db/event_repo.js +67 -0
- package/dist/repositories/db/event_repo.js.map +1 -0
- package/dist/repositories/db/state_repo.d.ts +14 -0
- package/dist/repositories/db/state_repo.d.ts.map +1 -0
- package/dist/repositories/db/state_repo.js +61 -0
- package/dist/repositories/db/state_repo.js.map +1 -0
- package/dist/repositories/file/event_repo.d.ts +18 -0
- package/dist/repositories/file/event_repo.d.ts.map +1 -0
- package/dist/repositories/file/event_repo.js +148 -0
- package/dist/repositories/file/event_repo.js.map +1 -0
- package/dist/repositories/file/state_repo.d.ts +21 -0
- package/dist/repositories/file/state_repo.d.ts.map +1 -0
- package/dist/repositories/file/state_repo.js +89 -0
- package/dist/repositories/file/state_repo.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +19 -78
- package/dist/server.js.map +1 -1
- package/dist/services/connectors.d.ts +89 -0
- package/dist/services/connectors.d.ts.map +1 -0
- package/dist/services/connectors.js +251 -0
- package/dist/services/connectors.js.map +1 -0
- package/dist/services/entity_resolution.d.ts.map +1 -1
- package/dist/services/entity_resolution.js +8 -0
- package/dist/services/entity_resolution.js.map +1 -1
- package/dist/services/entity_snapshot_at_time.d.ts +48 -0
- package/dist/services/entity_snapshot_at_time.d.ts.map +1 -0
- package/dist/services/entity_snapshot_at_time.js +155 -0
- package/dist/services/entity_snapshot_at_time.js.map +1 -0
- package/dist/services/event_generation.d.ts +37 -0
- package/dist/services/event_generation.d.ts.map +1 -0
- package/dist/services/event_generation.js +236 -0
- package/dist/services/event_generation.js.map +1 -0
- package/dist/services/extraction/rules.d.ts +26 -0
- package/dist/services/extraction/rules.d.ts.map +1 -0
- package/dist/services/extraction/rules.js +679 -0
- package/dist/services/extraction/rules.js.map +1 -0
- package/dist/services/file_analysis.d.ts +32 -0
- package/dist/services/file_analysis.d.ts.map +1 -0
- package/dist/services/file_analysis.js +261 -0
- package/dist/services/file_analysis.js.map +1 -0
- package/dist/services/graph_builder.d.ts +47 -0
- package/dist/services/graph_builder.d.ts.map +1 -0
- package/dist/services/graph_builder.js +285 -0
- package/dist/services/graph_builder.js.map +1 -0
- package/dist/services/importers.d.ts +28 -0
- package/dist/services/importers.d.ts.map +1 -0
- package/dist/services/importers.js +174 -0
- package/dist/services/importers.js.map +1 -0
- package/dist/services/llm_extraction.d.ts +82 -0
- package/dist/services/llm_extraction.d.ts.map +1 -0
- package/dist/services/llm_extraction.js +435 -0
- package/dist/services/llm_extraction.js.map +1 -0
- package/dist/services/observation_ingestion.d.ts +26 -0
- package/dist/services/observation_ingestion.d.ts.map +1 -0
- package/dist/services/observation_ingestion.js +348 -0
- package/dist/services/observation_ingestion.js.map +1 -0
- package/dist/services/payload_compiler.d.ts +36 -0
- package/dist/services/payload_compiler.d.ts.map +1 -0
- package/dist/services/payload_compiler.js +121 -0
- package/dist/services/payload_compiler.js.map +1 -0
- package/dist/services/payload_identity.d.ts +35 -0
- package/dist/services/payload_identity.d.ts.map +1 -0
- package/dist/services/payload_identity.js +101 -0
- package/dist/services/payload_identity.js.map +1 -0
- package/dist/services/payload_schema.d.ts +104 -0
- package/dist/services/payload_schema.d.ts.map +1 -0
- package/dist/services/payload_schema.js +46 -0
- package/dist/services/payload_schema.js.map +1 -0
- package/dist/services/plaid_sync.d.ts +77 -0
- package/dist/services/plaid_sync.d.ts.map +1 -0
- package/dist/services/plaid_sync.js +273 -0
- package/dist/services/plaid_sync.js.map +1 -0
- package/dist/services/record_comparison.d.ts +29 -0
- package/dist/services/record_comparison.d.ts.map +1 -0
- package/dist/services/record_comparison.js +84 -0
- package/dist/services/record_comparison.js.map +1 -0
- package/dist/services/records.d.ts +31 -0
- package/dist/services/records.d.ts.map +1 -0
- package/dist/services/records.js +184 -0
- package/dist/services/records.js.map +1 -0
- package/dist/services/search.d.ts +15 -0
- package/dist/services/search.d.ts.map +1 -0
- package/dist/services/search.js +80 -0
- package/dist/services/search.js.map +1 -0
- package/dist/services/source_priority_warning.d.ts +18 -0
- package/dist/services/source_priority_warning.d.ts.map +1 -1
- package/dist/services/source_priority_warning.js +37 -4
- package/dist/services/source_priority_warning.js.map +1 -1
- package/dist/services/summary.d.ts +5 -0
- package/dist/services/summary.d.ts.map +1 -0
- package/dist/services/summary.js +118 -0
- package/dist/services/summary.js.map +1 -0
- package/dist/shared/openapi_types.d.ts +6 -0
- package/dist/shared/openapi_types.d.ts.map +1 -1
- package/openapi.yaml +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript Types for Fixtures
|
|
3
|
+
*
|
|
4
|
+
* Defines types for all fixture structures to ensure type safety.
|
|
5
|
+
*/
|
|
6
|
+
export interface HoldingFixture {
|
|
7
|
+
schema_version: string;
|
|
8
|
+
snapshot_date: string;
|
|
9
|
+
asset_symbol: string;
|
|
10
|
+
asset_name?: string;
|
|
11
|
+
asset_type?: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
cost_basis_usd?: number;
|
|
14
|
+
current_value_usd: number;
|
|
15
|
+
account_id?: string;
|
|
16
|
+
account_type?: string;
|
|
17
|
+
provider?: string;
|
|
18
|
+
import_date?: string;
|
|
19
|
+
import_source_file?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IncomeFixture {
|
|
22
|
+
schema_version: string;
|
|
23
|
+
income_date: string;
|
|
24
|
+
income_type?: string;
|
|
25
|
+
source: string;
|
|
26
|
+
amount_usd: number;
|
|
27
|
+
amount_original?: number;
|
|
28
|
+
currency_original?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
entity?: string;
|
|
31
|
+
tax_year: number;
|
|
32
|
+
import_date?: string;
|
|
33
|
+
import_source_file?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TaxEventFixture {
|
|
36
|
+
schema_version: string;
|
|
37
|
+
event_date: string;
|
|
38
|
+
event_type?: string;
|
|
39
|
+
asset_symbol: string;
|
|
40
|
+
quantity?: number;
|
|
41
|
+
cost_basis_usd?: number;
|
|
42
|
+
proceeds_usd?: number;
|
|
43
|
+
gain_loss_usd: number;
|
|
44
|
+
tax_year: number;
|
|
45
|
+
jurisdiction?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
import_date?: string;
|
|
48
|
+
import_source_file?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface CryptoTransactionFixture {
|
|
51
|
+
schema_version: string;
|
|
52
|
+
transaction_date: string;
|
|
53
|
+
transaction_type?: string;
|
|
54
|
+
blockchain?: string;
|
|
55
|
+
from_address?: string;
|
|
56
|
+
to_address?: string;
|
|
57
|
+
asset_symbol: string;
|
|
58
|
+
quantity?: number;
|
|
59
|
+
value_usd: number;
|
|
60
|
+
fee_usd?: number;
|
|
61
|
+
tx_hash: string;
|
|
62
|
+
wallet_id?: string;
|
|
63
|
+
import_date?: string;
|
|
64
|
+
import_source_file?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface LiabilityFixture {
|
|
67
|
+
schema_version: string;
|
|
68
|
+
name: string;
|
|
69
|
+
liability_type?: string;
|
|
70
|
+
amount_usd: number;
|
|
71
|
+
amount_original?: number;
|
|
72
|
+
currency_original?: string;
|
|
73
|
+
snapshot_date: string;
|
|
74
|
+
notes?: string;
|
|
75
|
+
import_date?: string;
|
|
76
|
+
import_source_file?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface FlowFixture {
|
|
79
|
+
schema_version: string;
|
|
80
|
+
flow_name: string;
|
|
81
|
+
flow_date: string;
|
|
82
|
+
year?: number;
|
|
83
|
+
timeline?: string;
|
|
84
|
+
amount_usd: number;
|
|
85
|
+
amount_original?: number;
|
|
86
|
+
currency_original?: string;
|
|
87
|
+
for_cash_flow?: boolean;
|
|
88
|
+
party?: string;
|
|
89
|
+
flow_type?: string;
|
|
90
|
+
location?: string;
|
|
91
|
+
category?: string;
|
|
92
|
+
notes?: string;
|
|
93
|
+
import_date?: string;
|
|
94
|
+
import_source_file?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PurchaseFixture {
|
|
97
|
+
schema_version: string;
|
|
98
|
+
item_name: string;
|
|
99
|
+
status: string;
|
|
100
|
+
location?: string;
|
|
101
|
+
priority?: string;
|
|
102
|
+
estimated_cost_usd?: number;
|
|
103
|
+
actual_cost_usd?: number;
|
|
104
|
+
currency?: string;
|
|
105
|
+
category?: string;
|
|
106
|
+
vendor?: string;
|
|
107
|
+
created_date: string;
|
|
108
|
+
completed_date?: string | null;
|
|
109
|
+
notes?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface TransferFixture {
|
|
112
|
+
schema_version: string;
|
|
113
|
+
name: string;
|
|
114
|
+
status?: string;
|
|
115
|
+
amount?: number;
|
|
116
|
+
origin_account: string;
|
|
117
|
+
destination_account: string;
|
|
118
|
+
created_time: string;
|
|
119
|
+
deposit_address?: string;
|
|
120
|
+
fees?: number;
|
|
121
|
+
transaction?: string;
|
|
122
|
+
transactions?: string;
|
|
123
|
+
notes?: string;
|
|
124
|
+
import_date?: string;
|
|
125
|
+
import_source_file?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface WalletFixture {
|
|
128
|
+
schema_version: string;
|
|
129
|
+
name: string;
|
|
130
|
+
number?: number;
|
|
131
|
+
accounts?: string;
|
|
132
|
+
categories?: string;
|
|
133
|
+
url?: string;
|
|
134
|
+
urls?: string;
|
|
135
|
+
investments?: string;
|
|
136
|
+
status: string;
|
|
137
|
+
notes?: string;
|
|
138
|
+
import_date?: string;
|
|
139
|
+
import_source_file?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface TaxFilingFixture {
|
|
142
|
+
schema_version: string;
|
|
143
|
+
name: string;
|
|
144
|
+
jurisdiction: string;
|
|
145
|
+
year: number;
|
|
146
|
+
filings?: string;
|
|
147
|
+
status: string;
|
|
148
|
+
companies?: string;
|
|
149
|
+
due_date?: string;
|
|
150
|
+
filed_date?: string | null;
|
|
151
|
+
amount_owed?: number;
|
|
152
|
+
amount_paid?: number;
|
|
153
|
+
currency?: string;
|
|
154
|
+
notes?: string;
|
|
155
|
+
import_date?: string;
|
|
156
|
+
import_source_file?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface OrderFixture {
|
|
159
|
+
schema_version: string;
|
|
160
|
+
name: string;
|
|
161
|
+
status?: string;
|
|
162
|
+
accounts?: string;
|
|
163
|
+
amount?: number;
|
|
164
|
+
asset_type?: string;
|
|
165
|
+
order_type: string;
|
|
166
|
+
price?: number;
|
|
167
|
+
url?: string;
|
|
168
|
+
date: string;
|
|
169
|
+
notes?: string;
|
|
170
|
+
import_date?: string;
|
|
171
|
+
import_source_file?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface FixedCostFixture {
|
|
174
|
+
schema_version: string;
|
|
175
|
+
merchant: string;
|
|
176
|
+
expense_name: string;
|
|
177
|
+
expense_type?: string;
|
|
178
|
+
location?: string;
|
|
179
|
+
frequency_per_year: number;
|
|
180
|
+
payment_amount_eur?: number;
|
|
181
|
+
payment_amount_usd?: number;
|
|
182
|
+
yearly_amount_eur?: number;
|
|
183
|
+
yearly_amount_usd?: number;
|
|
184
|
+
monthly_amount_eur?: number;
|
|
185
|
+
monthly_amount_usd?: number;
|
|
186
|
+
percent_fixed_expenses?: number;
|
|
187
|
+
percent_net_income?: number;
|
|
188
|
+
inflates?: boolean;
|
|
189
|
+
status: string;
|
|
190
|
+
notes?: string;
|
|
191
|
+
renews?: string;
|
|
192
|
+
started?: string;
|
|
193
|
+
ended?: string;
|
|
194
|
+
payment_method?: string;
|
|
195
|
+
import_date?: string;
|
|
196
|
+
import_source_file?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface PropertyFixture {
|
|
199
|
+
schema_version: string;
|
|
200
|
+
name: string;
|
|
201
|
+
address: string;
|
|
202
|
+
type?: string;
|
|
203
|
+
purchase_date: string;
|
|
204
|
+
purchase_price?: number;
|
|
205
|
+
current_value?: number;
|
|
206
|
+
currency?: string;
|
|
207
|
+
notes?: string;
|
|
208
|
+
import_date?: string;
|
|
209
|
+
import_source_file?: string;
|
|
210
|
+
}
|
|
211
|
+
export interface BalanceFixture {
|
|
212
|
+
schema_version: string;
|
|
213
|
+
snapshot_date: string;
|
|
214
|
+
account_id: string;
|
|
215
|
+
account_type?: string;
|
|
216
|
+
account_name?: string;
|
|
217
|
+
balance_usd: number;
|
|
218
|
+
balance_original?: number;
|
|
219
|
+
currency_original?: string;
|
|
220
|
+
provider?: string;
|
|
221
|
+
import_date?: string;
|
|
222
|
+
import_source_file?: string;
|
|
223
|
+
}
|
|
224
|
+
export interface TransactionFixture {
|
|
225
|
+
schema_version: string;
|
|
226
|
+
amount: number;
|
|
227
|
+
amount_original?: number;
|
|
228
|
+
currency: string;
|
|
229
|
+
date: string;
|
|
230
|
+
posting_date?: string;
|
|
231
|
+
merchant_name: string;
|
|
232
|
+
status: string;
|
|
233
|
+
account_id: string;
|
|
234
|
+
category?: string;
|
|
235
|
+
bank_provider?: string;
|
|
236
|
+
}
|
|
237
|
+
export interface ContactFixture {
|
|
238
|
+
schema_version: string;
|
|
239
|
+
name: string;
|
|
240
|
+
email?: string;
|
|
241
|
+
phone?: string;
|
|
242
|
+
organization?: string;
|
|
243
|
+
role?: string;
|
|
244
|
+
contact_type?: string;
|
|
245
|
+
category?: string;
|
|
246
|
+
platform?: string;
|
|
247
|
+
address?: string;
|
|
248
|
+
country?: string;
|
|
249
|
+
website?: string;
|
|
250
|
+
notes?: string;
|
|
251
|
+
first_contact_date?: string;
|
|
252
|
+
last_contact_date?: string;
|
|
253
|
+
created_date?: string;
|
|
254
|
+
updated_date?: string;
|
|
255
|
+
}
|
|
256
|
+
export interface ContractFixture {
|
|
257
|
+
schema_version: string;
|
|
258
|
+
contract_number?: string;
|
|
259
|
+
parties?: string;
|
|
260
|
+
effective_date?: string;
|
|
261
|
+
expiration_date?: string;
|
|
262
|
+
status?: string;
|
|
263
|
+
name?: string;
|
|
264
|
+
signed_date?: string;
|
|
265
|
+
companies?: string;
|
|
266
|
+
files?: string;
|
|
267
|
+
type?: string;
|
|
268
|
+
notes?: string;
|
|
269
|
+
}
|
|
270
|
+
export interface AccountFixture {
|
|
271
|
+
schema_version: string;
|
|
272
|
+
external_id: string;
|
|
273
|
+
institution: string;
|
|
274
|
+
balance?: number;
|
|
275
|
+
currency: string;
|
|
276
|
+
status: string;
|
|
277
|
+
wallet?: string;
|
|
278
|
+
wallet_name?: string;
|
|
279
|
+
number?: string;
|
|
280
|
+
categories?: string;
|
|
281
|
+
denomination?: string;
|
|
282
|
+
notes?: string;
|
|
283
|
+
}
|
|
284
|
+
export type FixtureType = HoldingFixture | IncomeFixture | TaxEventFixture | CryptoTransactionFixture | LiabilityFixture | FlowFixture | PurchaseFixture | TransferFixture | WalletFixture | TaxFilingFixture | OrderFixture | FixedCostFixture | PropertyFixture | BalanceFixture | TransactionFixture | ContactFixture | ContractFixture | AccountFixture;
|
|
285
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE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AAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,aAAa,GACb,eAAe,GACf,wBAAwB,GACxB,gBAAgB,GAChB,WAAW,GACX,eAAe,GACf,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/__fixtures__/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixture Validation
|
|
3
|
+
*
|
|
4
|
+
* Validates fixtures against schema definitions and privacy requirements.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Check if fixture contains real PII (privacy validation)
|
|
8
|
+
*/
|
|
9
|
+
export declare function containsRealPII(fixture: Record<string, unknown>): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Validate fixture has required schema_version field
|
|
12
|
+
*/
|
|
13
|
+
export declare function hasSchemaVersion(fixture: Record<string, unknown>): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Validate fixture structure matches expected type
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateFixtureStructure(fixture: Record<string, unknown>, recordType: string): {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
errors: string[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Validate update variant maintains referential integrity
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateUpdateVariant(baseRecord: Record<string, unknown>, variant: Record<string, unknown>, idField?: string): {
|
|
25
|
+
valid: boolean;
|
|
26
|
+
errors: string[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Validate state transition is valid
|
|
30
|
+
*/
|
|
31
|
+
export declare function validateStateTransition(fromStatus: string, toStatus: string, recordType: string): {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
errors: string[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Validate all fixtures in a file
|
|
37
|
+
*/
|
|
38
|
+
export declare function validateFixtureFile(fixtures: Record<string, unknown>[], recordType: string): {
|
|
39
|
+
valid: boolean;
|
|
40
|
+
errors: Array<{
|
|
41
|
+
index: number;
|
|
42
|
+
errors: string[];
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/__fixtures__/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,O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+
* Check if fixture contains real PII (privacy validation)
|
|
8
|
+
*/
|
|
9
|
+
export function containsRealPII(fixture) {
|
|
10
|
+
const piiPatterns = [
|
|
11
|
+
/\b\d{3}-\d{2}-\d{4}\b/, // SSN
|
|
12
|
+
/\b\d{9}\b/, // 9-digit numbers (potential SSN)
|
|
13
|
+
/@gmail\.com|@yahoo\.com|@hotmail\.com/, // Common real email domains
|
|
14
|
+
/\b\d{4}\s\d{4}\s\d{4}\s\d{4}\b/, // Credit card pattern
|
|
15
|
+
];
|
|
16
|
+
const fixtureStr = JSON.stringify(fixture).toLowerCase();
|
|
17
|
+
// Check for obviously fake data markers
|
|
18
|
+
const fakeMarkers = [
|
|
19
|
+
"example.com",
|
|
20
|
+
"test",
|
|
21
|
+
"john doe",
|
|
22
|
+
"jane smith",
|
|
23
|
+
"123 main st",
|
|
24
|
+
"acme corp",
|
|
25
|
+
];
|
|
26
|
+
const hasFakeMarkers = fakeMarkers.some((marker) => fixtureStr.includes(marker));
|
|
27
|
+
// If has fake markers, likely safe
|
|
28
|
+
if (hasFakeMarkers) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
// Check for PII patterns
|
|
32
|
+
return piiPatterns.some((pattern) => pattern.test(fixtureStr));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Validate fixture has required schema_version field
|
|
36
|
+
*/
|
|
37
|
+
export function hasSchemaVersion(fixture) {
|
|
38
|
+
return fixture.schema_version === "1.0";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Validate fixture structure matches expected type
|
|
42
|
+
*/
|
|
43
|
+
export function validateFixtureStructure(fixture, recordType) {
|
|
44
|
+
const errors = [];
|
|
45
|
+
if (!hasSchemaVersion(fixture)) {
|
|
46
|
+
errors.push("Missing or invalid schema_version field");
|
|
47
|
+
}
|
|
48
|
+
// Type-specific validations
|
|
49
|
+
switch (recordType) {
|
|
50
|
+
case "holding":
|
|
51
|
+
if (!fixture.snapshot_date)
|
|
52
|
+
errors.push("Missing required field: snapshot_date");
|
|
53
|
+
if (!fixture.asset_symbol)
|
|
54
|
+
errors.push("Missing required field: asset_symbol");
|
|
55
|
+
if (!fixture.current_value_usd)
|
|
56
|
+
errors.push("Missing required field: current_value_usd");
|
|
57
|
+
break;
|
|
58
|
+
case "income":
|
|
59
|
+
if (!fixture.income_date)
|
|
60
|
+
errors.push("Missing required field: income_date");
|
|
61
|
+
if (!fixture.source)
|
|
62
|
+
errors.push("Missing required field: source");
|
|
63
|
+
if (!fixture.amount_usd)
|
|
64
|
+
errors.push("Missing required field: amount_usd");
|
|
65
|
+
if (!fixture.tax_year)
|
|
66
|
+
errors.push("Missing required field: tax_year");
|
|
67
|
+
break;
|
|
68
|
+
case "tax_event":
|
|
69
|
+
if (!fixture.event_date)
|
|
70
|
+
errors.push("Missing required field: event_date");
|
|
71
|
+
if (!fixture.asset_symbol)
|
|
72
|
+
errors.push("Missing required field: asset_symbol");
|
|
73
|
+
if (fixture.gain_loss_usd === undefined)
|
|
74
|
+
errors.push("Missing required field: gain_loss_usd");
|
|
75
|
+
if (!fixture.tax_year)
|
|
76
|
+
errors.push("Missing required field: tax_year");
|
|
77
|
+
break;
|
|
78
|
+
case "crypto_transaction":
|
|
79
|
+
if (!fixture.transaction_date)
|
|
80
|
+
errors.push("Missing required field: transaction_date");
|
|
81
|
+
if (!fixture.tx_hash)
|
|
82
|
+
errors.push("Missing required field: tx_hash");
|
|
83
|
+
if (!fixture.asset_symbol)
|
|
84
|
+
errors.push("Missing required field: asset_symbol");
|
|
85
|
+
if (!fixture.value_usd)
|
|
86
|
+
errors.push("Missing required field: value_usd");
|
|
87
|
+
break;
|
|
88
|
+
case "liability":
|
|
89
|
+
if (!fixture.name)
|
|
90
|
+
errors.push("Missing required field: name");
|
|
91
|
+
if (!fixture.amount_usd)
|
|
92
|
+
errors.push("Missing required field: amount_usd");
|
|
93
|
+
if (!fixture.snapshot_date)
|
|
94
|
+
errors.push("Missing required field: snapshot_date");
|
|
95
|
+
break;
|
|
96
|
+
case "flow":
|
|
97
|
+
if (!fixture.flow_name)
|
|
98
|
+
errors.push("Missing required field: flow_name");
|
|
99
|
+
if (!fixture.flow_date)
|
|
100
|
+
errors.push("Missing required field: flow_date");
|
|
101
|
+
if (!fixture.amount_usd)
|
|
102
|
+
errors.push("Missing required field: amount_usd");
|
|
103
|
+
break;
|
|
104
|
+
case "purchase":
|
|
105
|
+
if (!fixture.item_name)
|
|
106
|
+
errors.push("Missing required field: item_name");
|
|
107
|
+
if (!fixture.status)
|
|
108
|
+
errors.push("Missing required field: status");
|
|
109
|
+
if (!fixture.created_date)
|
|
110
|
+
errors.push("Missing required field: created_date");
|
|
111
|
+
break;
|
|
112
|
+
case "transfer":
|
|
113
|
+
if (!fixture.name)
|
|
114
|
+
errors.push("Missing required field: name");
|
|
115
|
+
if (!fixture.origin_account)
|
|
116
|
+
errors.push("Missing required field: origin_account");
|
|
117
|
+
if (!fixture.destination_account)
|
|
118
|
+
errors.push("Missing required field: destination_account");
|
|
119
|
+
if (!fixture.created_time)
|
|
120
|
+
errors.push("Missing required field: created_time");
|
|
121
|
+
break;
|
|
122
|
+
case "wallet":
|
|
123
|
+
if (!fixture.name)
|
|
124
|
+
errors.push("Missing required field: name");
|
|
125
|
+
if (!fixture.status)
|
|
126
|
+
errors.push("Missing required field: status");
|
|
127
|
+
break;
|
|
128
|
+
case "tax_filing":
|
|
129
|
+
if (!fixture.name)
|
|
130
|
+
errors.push("Missing required field: name");
|
|
131
|
+
if (!fixture.jurisdiction)
|
|
132
|
+
errors.push("Missing required field: jurisdiction");
|
|
133
|
+
if (!fixture.year)
|
|
134
|
+
errors.push("Missing required field: year");
|
|
135
|
+
if (!fixture.status)
|
|
136
|
+
errors.push("Missing required field: status");
|
|
137
|
+
break;
|
|
138
|
+
case "order":
|
|
139
|
+
if (!fixture.name)
|
|
140
|
+
errors.push("Missing required field: name");
|
|
141
|
+
if (!fixture.order_type)
|
|
142
|
+
errors.push("Missing required field: order_type");
|
|
143
|
+
if (!fixture.date)
|
|
144
|
+
errors.push("Missing required field: date");
|
|
145
|
+
break;
|
|
146
|
+
case "fixed_cost":
|
|
147
|
+
if (!fixture.merchant)
|
|
148
|
+
errors.push("Missing required field: merchant");
|
|
149
|
+
if (!fixture.expense_name)
|
|
150
|
+
errors.push("Missing required field: expense_name");
|
|
151
|
+
if (!fixture.frequency_per_year)
|
|
152
|
+
errors.push("Missing required field: frequency_per_year");
|
|
153
|
+
if (!fixture.status)
|
|
154
|
+
errors.push("Missing required field: status");
|
|
155
|
+
break;
|
|
156
|
+
case "property":
|
|
157
|
+
if (!fixture.name)
|
|
158
|
+
errors.push("Missing required field: name");
|
|
159
|
+
if (!fixture.address)
|
|
160
|
+
errors.push("Missing required field: address");
|
|
161
|
+
if (!fixture.purchase_date)
|
|
162
|
+
errors.push("Missing required field: purchase_date");
|
|
163
|
+
break;
|
|
164
|
+
case "balance":
|
|
165
|
+
if (!fixture.snapshot_date)
|
|
166
|
+
errors.push("Missing required field: snapshot_date");
|
|
167
|
+
if (!fixture.account_id)
|
|
168
|
+
errors.push("Missing required field: account_id");
|
|
169
|
+
if (!fixture.balance_usd)
|
|
170
|
+
errors.push("Missing required field: balance_usd");
|
|
171
|
+
break;
|
|
172
|
+
case "transaction":
|
|
173
|
+
if (!fixture.amount)
|
|
174
|
+
errors.push("Missing required field: amount");
|
|
175
|
+
if (!fixture.currency)
|
|
176
|
+
errors.push("Missing required field: currency");
|
|
177
|
+
if (!fixture.date)
|
|
178
|
+
errors.push("Missing required field: date");
|
|
179
|
+
if (!fixture.merchant_name)
|
|
180
|
+
errors.push("Missing required field: merchant_name");
|
|
181
|
+
if (!fixture.status)
|
|
182
|
+
errors.push("Missing required field: status");
|
|
183
|
+
if (!fixture.account_id)
|
|
184
|
+
errors.push("Missing required field: account_id");
|
|
185
|
+
break;
|
|
186
|
+
case "contact":
|
|
187
|
+
if (!fixture.name)
|
|
188
|
+
errors.push("Missing required field: name");
|
|
189
|
+
break;
|
|
190
|
+
case "contract":
|
|
191
|
+
// Contract has optional required fields
|
|
192
|
+
break;
|
|
193
|
+
case "account":
|
|
194
|
+
if (!fixture.external_id)
|
|
195
|
+
errors.push("Missing required field: external_id");
|
|
196
|
+
if (!fixture.institution)
|
|
197
|
+
errors.push("Missing required field: institution");
|
|
198
|
+
if (!fixture.currency)
|
|
199
|
+
errors.push("Missing required field: currency");
|
|
200
|
+
if (!fixture.status)
|
|
201
|
+
errors.push("Missing required field: status");
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
valid: errors.length === 0,
|
|
206
|
+
errors,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Validate update variant maintains referential integrity
|
|
211
|
+
*/
|
|
212
|
+
export function validateUpdateVariant(baseRecord, variant, idField = "external_id") {
|
|
213
|
+
const errors = [];
|
|
214
|
+
const baseId = baseRecord[idField];
|
|
215
|
+
const variantId = variant[idField];
|
|
216
|
+
if (baseId && variantId && baseId !== variantId) {
|
|
217
|
+
errors.push(`Update variant must maintain same ${idField}: ${baseId} !== ${variantId}`);
|
|
218
|
+
}
|
|
219
|
+
// Check that updated_at is later than base record's timestamp
|
|
220
|
+
const baseDate = baseRecord.updated_at || baseRecord.created_at;
|
|
221
|
+
const variantDate = variant.updated_at || variant.created_at;
|
|
222
|
+
if (baseDate &&
|
|
223
|
+
variantDate &&
|
|
224
|
+
typeof baseDate === "string" &&
|
|
225
|
+
typeof variantDate === "string") {
|
|
226
|
+
if (new Date(variantDate) <= new Date(baseDate)) {
|
|
227
|
+
errors.push(`Update variant timestamp must be later than base record: ${variantDate} <= ${baseDate}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
valid: errors.length === 0,
|
|
232
|
+
errors,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Validate state transition is valid
|
|
237
|
+
*/
|
|
238
|
+
export function validateStateTransition(fromStatus, toStatus, recordType) {
|
|
239
|
+
const errors = [];
|
|
240
|
+
// Define valid state transitions per record type
|
|
241
|
+
const validTransitions = {
|
|
242
|
+
purchase: {
|
|
243
|
+
pending: ["in_progress", "cancelled"],
|
|
244
|
+
in_progress: ["completed", "cancelled"],
|
|
245
|
+
completed: [], // Terminal state
|
|
246
|
+
cancelled: [], // Terminal state
|
|
247
|
+
},
|
|
248
|
+
transfer: {
|
|
249
|
+
pending: ["completed", "failed"],
|
|
250
|
+
completed: [], // Terminal state
|
|
251
|
+
failed: [], // Terminal state
|
|
252
|
+
},
|
|
253
|
+
tax_filing: {
|
|
254
|
+
pending: ["filed", "cancelled"],
|
|
255
|
+
filed: [], // Terminal state
|
|
256
|
+
cancelled: [], // Terminal state
|
|
257
|
+
},
|
|
258
|
+
order: {
|
|
259
|
+
pending: ["filled", "cancelled"],
|
|
260
|
+
filled: [], // Terminal state
|
|
261
|
+
cancelled: [], // Terminal state
|
|
262
|
+
},
|
|
263
|
+
fixed_cost: {
|
|
264
|
+
active: ["cancelled", "pending"],
|
|
265
|
+
cancelled: [], // Terminal state
|
|
266
|
+
pending: ["active", "cancelled"],
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
const transitions = validTransitions[recordType];
|
|
270
|
+
if (transitions) {
|
|
271
|
+
const allowedNextStates = transitions[fromStatus];
|
|
272
|
+
if (!allowedNextStates) {
|
|
273
|
+
errors.push(`Unknown fromStatus for ${recordType}: ${fromStatus}`);
|
|
274
|
+
}
|
|
275
|
+
else if (!allowedNextStates.includes(toStatus)) {
|
|
276
|
+
errors.push(`Invalid transition for ${recordType}: ${fromStatus} -> ${toStatus}. Allowed: ${allowedNextStates.join(", ")}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
valid: errors.length === 0,
|
|
281
|
+
errors,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Validate all fixtures in a file
|
|
286
|
+
*/
|
|
287
|
+
export function validateFixtureFile(fixtures, recordType) {
|
|
288
|
+
const allErrors = [];
|
|
289
|
+
fixtures.forEach((fixture, index) => {
|
|
290
|
+
// Privacy check
|
|
291
|
+
if (containsRealPII(fixture)) {
|
|
292
|
+
allErrors.push({
|
|
293
|
+
index,
|
|
294
|
+
errors: ["Fixture contains potential real PII"],
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
// Structure validation
|
|
298
|
+
const structureValidation = validateFixtureStructure(fixture, recordType);
|
|
299
|
+
if (!structureValidation.valid) {
|
|
300
|
+
allErrors.push({
|
|
301
|
+
index,
|
|
302
|
+
errors: structureValidation.errors,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
return {
|
|
307
|
+
valid: allErrors.length === 0,
|
|
308
|
+
errors: allErrors,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=validation.js.map
|