@sachfolio/cas-reader 0.0.0-stage → 0.2.0-beta.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/CHANGELOG.md +19 -0
- package/LICENSE +71 -0
- package/NOTICE +41 -0
- package/README.md +198 -2
- package/dist/analytics/contract.d.ts +110 -0
- package/dist/analytics/contract.js +79 -0
- package/dist/analytics/eligibility.d.ts +66 -0
- package/dist/analytics/eligibility.js +93 -0
- package/dist/analytics/gains-schema.d.ts +898 -0
- package/dist/analytics/gains-schema.js +170 -0
- package/dist/analytics/gains.d.ts +319 -0
- package/dist/analytics/gains.js +649 -0
- package/dist/analytics/modules.d.ts +33 -0
- package/dist/analytics/modules.js +74 -0
- package/dist/analytics/returns-schema.d.ts +931 -0
- package/dist/analytics/returns-schema.js +152 -0
- package/dist/analytics/returns.d.ts +126 -0
- package/dist/analytics/returns.js +453 -0
- package/dist/analytics/schedule112a.d.ts +77 -0
- package/dist/analytics/schedule112a.js +134 -0
- package/dist/analytics/xirr.d.ts +75 -0
- package/dist/analytics/xirr.js +314 -0
- package/dist/bin/cas.d.ts +2 -0
- package/dist/bin/cas.js +137 -0
- package/dist/checks.d.ts +49 -0
- package/dist/checks.js +227 -0
- package/dist/compat/casparser.d.ts +121 -0
- package/dist/compat/casparser.js +193 -0
- package/dist/detect.d.ts +10 -0
- package/dist/detect.js +69 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.js +95 -0
- package/dist/export/csv.d.ts +21 -0
- package/dist/export/csv.js +49 -0
- package/dist/extract/browser.d.ts +17 -0
- package/dist/extract/browser.js +34 -0
- package/dist/extract/budget.d.ts +46 -0
- package/dist/extract/budget.js +88 -0
- package/dist/extract/node.d.ts +11 -0
- package/dist/extract/node.js +31 -0
- package/dist/extract/pdfjs.d.ts +71 -0
- package/dist/extract/pdfjs.js +244 -0
- package/dist/extract/types.d.ts +106 -0
- package/dist/extract/types.js +11 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +26 -0
- package/dist/layout/lines.d.ts +51 -0
- package/dist/layout/lines.js +115 -0
- package/dist/licence/app-licence.d.ts +53 -0
- package/dist/licence/app-licence.js +139 -0
- package/dist/licence/ed25519.d.ts +2 -0
- package/dist/licence/ed25519.js +103 -0
- package/dist/model.d.ts +148 -0
- package/dist/model.js +1 -0
- package/dist/num.d.ts +19 -0
- package/dist/num.js +27 -0
- package/dist/parse.d.ts +4 -0
- package/dist/parse.js +13 -0
- package/dist/parsers/cams/classify.d.ts +25 -0
- package/dist/parsers/cams/classify.js +103 -0
- package/dist/parsers/cams/detailed.d.ts +15 -0
- package/dist/parsers/cams/detailed.js +343 -0
- package/dist/parsers/cams/header.d.ts +47 -0
- package/dist/parsers/cams/header.js +170 -0
- package/dist/parsers/cams/investor.d.ts +28 -0
- package/dist/parsers/cams/investor.js +139 -0
- package/dist/parsers/cams/summary.d.ts +29 -0
- package/dist/parsers/cams/summary.js +413 -0
- package/dist/parsers/cams/table.d.ts +55 -0
- package/dist/parsers/cams/table.js +144 -0
- package/dist/parsers/cams/total.d.ts +17 -0
- package/dist/parsers/cams/total.js +105 -0
- package/dist/parsers/depository/mf.d.ts +22 -0
- package/dist/parsers/depository/mf.js +438 -0
- package/dist/privacy.d.ts +243 -0
- package/dist/privacy.js +256 -0
- package/dist/schema.d.ts +779 -0
- package/dist/schema.js +214 -0
- package/examples/nextjs/app/page.jsx +34 -0
- package/examples/node/server.mjs +45 -0
- package/examples/python/read_cas.py +67 -0
- package/examples/vite/index.html +14 -0
- package/examples/vite/main.js +22 -0
- package/package.json +54 -4
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NSDL / CDSL consolidated account statements: the MUTUAL FUND sections only
|
|
3
|
+
* (PLAN.md stage F, first half). Equity shares, bonds, government securities,
|
|
4
|
+
* NPS and every other section are named in the warnings and left unread.
|
|
5
|
+
*
|
|
6
|
+
* Section and marker names follow casparser `parsers/nsdl.py` and
|
|
7
|
+
* `parsers/cdsl.py` (MIT, commit bca0f44). Mutual fund units appear in:
|
|
8
|
+
* - NSDL "Mutual Fund Folios (F)": units held as account statements (SoA)
|
|
9
|
+
* with the registrar, one row per folio with units, average cost, total
|
|
10
|
+
* cost, NAV, value, profit and return;
|
|
11
|
+
* - CDSL "MUTUAL FUND UNITS HELD AS ON <date>": the same, with an ARN/DIRECT
|
|
12
|
+
* column and the amount invested;
|
|
13
|
+
* - a demat account's "Mutual Funds (M)" table (NSDL) or holding statement
|
|
14
|
+
* (CDSL): units and ETFs held in demat, with units, NAV/price and value.
|
|
15
|
+
*
|
|
16
|
+
* Differences from casparser, on purpose:
|
|
17
|
+
* - columns are placed by arithmetic, not x-position: a holding is read only
|
|
18
|
+
* when three printed numbers satisfy units × NAV = value within the printed
|
|
19
|
+
* precision (checks.ts `productBound`). A row where no three numbers do is
|
|
20
|
+
* recorded in coverage and skipped, never inferred (casparser falls back to
|
|
21
|
+
* "the largest number is the value");
|
|
22
|
+
* - only INF ISINs (mutual fund units and ETFs) are read; every other ISIN row
|
|
23
|
+
* in a holdings section is counted and named as unread;
|
|
24
|
+
* - transaction rows (anything printing a date) are never read as holdings;
|
|
25
|
+
* - the roster's printed "Mutual Fund Folios" value is checked against the
|
|
26
|
+
* sum of the folio holdings read (check `total.mf_folios`).
|
|
27
|
+
*/
|
|
28
|
+
import Big from "big.js";
|
|
29
|
+
import { isinCheck, productBound } from "../../checks.js";
|
|
30
|
+
import { CasError } from "../../errors.js";
|
|
31
|
+
import { cleanPage, lineText, rotatedTextChars } from "../../layout/lines.js";
|
|
32
|
+
import { big, halfUlp, parseNum } from "../../num.js";
|
|
33
|
+
import { cleanSchemeName } from "../cams/classify.js";
|
|
34
|
+
import { ENGINE_VERSION } from "../cams/detailed.js";
|
|
35
|
+
import { optionOf, planOf } from "../cams/header.js";
|
|
36
|
+
import { isNumeric } from "../cams/table.js";
|
|
37
|
+
const ISIN_RE = /^IN[A-Z0-9]{9}\d$/;
|
|
38
|
+
const MF_ISIN_RE = /^INF[A-Z0-9]{8}\d$/;
|
|
39
|
+
// A folio: digits with an optional "/n" suffix, no thousands commas, no decimals.
|
|
40
|
+
const FOLIO_RE = /^\d{5,}(?:\s*\/\s*\d+)?$/;
|
|
41
|
+
const FOLIO_TAIL_RE = /^\d+\/\d+$/;
|
|
42
|
+
const ADVISOR_RE = /^(?:ARN-?\d+|INA\d+|DIRECT)$/i;
|
|
43
|
+
// "ABC12 - Scheme name": CDSL prefixes the scheme code (casparser cdsl.py).
|
|
44
|
+
const SCHEME_CODE_RE = /^\s*([A-Z0-9]{2,12})\s*-\s*(.+)$/;
|
|
45
|
+
const DATE_RE = /\b(\d{1,2})[-/ ]([A-Za-z]{3}|\d{1,2})[-/ ](\d{4})\b/;
|
|
46
|
+
const PERIOD_RE = /period\s+from\s+(\d{1,2}[-/][A-Za-z0-9]{2,3}[-/]\d{4})\s+to\s+(\d{1,2}[-/][A-Za-z0-9]{2,3}[-/]\d{4})/i;
|
|
47
|
+
const AS_ON_RE = /\bas\s+on\s+(\d{1,2}[-/][A-Za-z0-9]{2,3}[-/]\d{4})/i;
|
|
48
|
+
const DP_CLIENT_RE = /DP\s*ID\s*:?\s*(\S+?)\s+Client\s*ID\s*:?\s*([A-Z0-9]+)/i;
|
|
49
|
+
const BO_ID_RE = /(?:BO\s*ID|DPID)\s*:\s*([A-Z0-9]{16})\b/i;
|
|
50
|
+
const DP_NAME_RE = /DP\s*Name\s*:\s*(.+?)\s+(?:BO\s*ID|DPID|DP\s*ID)\b/i;
|
|
51
|
+
const AMC_NAME_RE = /AMC\s*Name\s*:\s*(.+?)\s*$/i;
|
|
52
|
+
const FOLIO_LABEL_RE = /Folio\s*No\.?\s*:\s*(\d+(?:\s*\/\s*\d+)?)/i;
|
|
53
|
+
const AMC_LINE_RE = /^(.+?\s+(?:MF|Mutual\s*Fund|Fund\s*House))$/i;
|
|
54
|
+
const TOTAL_RE = /^\s*(?:sub\s+|grand\s+)?total\b/i;
|
|
55
|
+
const ROSTER_MF_RE = /^Mutual\s+Fund\s+Folios\b/i;
|
|
56
|
+
const PAGE_FOOTER_RE = /^Page\s*\d+\s*(?:of|\/)\s*\d+$/i;
|
|
57
|
+
// Section headings, from casparser's section markers (MIT). Lower-cased line text.
|
|
58
|
+
const MF_FOLIO_HEADINGS = [/^mutual\s+fund\s+folios\s*\(f\)/, /mutual\s+fund\s+units\s+held\s+as\s+on/, /^mutual\s+fund\s+folios$/];
|
|
59
|
+
const DEMAT_MF_HEADINGS = [/^mutual\s+funds\s*\(m\)/, /^mutual\s+funds\s+units\s+held\s+with\s+the\s+amc/, /holding\s+statement\s+as\s+on/];
|
|
60
|
+
const OTHER_HEADINGS = [
|
|
61
|
+
[/^equity\s+shares\b|^equities\s*\(e\)/, "equity shares"],
|
|
62
|
+
[/^corporate\s+bonds\b/, "corporate bonds"],
|
|
63
|
+
[/^government\s+securities\b/, "government securities"],
|
|
64
|
+
[/^preference\s+shares\b/, "preference shares"],
|
|
65
|
+
[/^alternate\s+investment\s+fund\b/, "alternate investment funds"],
|
|
66
|
+
[/^money\s+market\s+instruments\b/, "money market instruments"],
|
|
67
|
+
[/^securiti[sz]ed\s+instruments\b/, "securitised instruments"],
|
|
68
|
+
[/^postal\s+saving\s+scheme\b/, "postal savings schemes"],
|
|
69
|
+
[/^national\s+pension\s+system\b|\bnps\s+(?:transaction|holding|investment)/, "NPS"],
|
|
70
|
+
[/^zero\s+coupon\b/, "zero coupon instruments"],
|
|
71
|
+
];
|
|
72
|
+
const TRANSACTION_HEADINGS = /statement\s+of\s+transactions|transactions?\s+for\s+the\s+period|transaction\s+details/;
|
|
73
|
+
// A row's lines: below its ISIN line, within this gap, until the next row or heading.
|
|
74
|
+
const ROW_MAX_GAP = 14;
|
|
75
|
+
// Up to this many numbers are searched for units × NAV = value (C(12,3) = 220 triples).
|
|
76
|
+
const MAX_ROW_NUMBERS = 12;
|
|
77
|
+
const MONTHS = { jan: "01", feb: "02", mar: "03", apr: "04", may: "05", jun: "06", jul: "07", aug: "08", sep: "09", oct: "10", nov: "11", dec: "12" };
|
|
78
|
+
/** "31-Oct-2026", "31-10-2026" or "31/10/2026" → ISO date, or null unless a real calendar date. */
|
|
79
|
+
export function depositoryDate(s) {
|
|
80
|
+
const m = DATE_RE.exec(s);
|
|
81
|
+
if (!m)
|
|
82
|
+
return null;
|
|
83
|
+
const mm = /^\d+$/.test(m[2]) ? m[2].padStart(2, "0") : MONTHS[m[2].toLowerCase()];
|
|
84
|
+
if (!mm || Number(mm) < 1 || Number(mm) > 12)
|
|
85
|
+
return null;
|
|
86
|
+
const day = Number(m[1]);
|
|
87
|
+
if (day < 1 || day > new Date(Date.UTC(Number(m[3]), Number(mm), 0)).getUTCDate())
|
|
88
|
+
return null;
|
|
89
|
+
return `${m[3]}-${mm}-${m[1].padStart(2, "0")}`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The three numbers that close units × NAV = value within printed precision.
|
|
93
|
+
* Of several, the rightmost value wins (a cost pair, units × average cost =
|
|
94
|
+
* total cost, sits to its left), then the rightmost NAV, then the leftmost
|
|
95
|
+
* units. The cost is the closing pair's total to the left of the NAV, or the
|
|
96
|
+
* one column printed between NAV and value (CDSL's "amount invested").
|
|
97
|
+
*/
|
|
98
|
+
export function placeByArithmetic(nums) {
|
|
99
|
+
const n = nums.slice(0, MAX_ROW_NUMBERS);
|
|
100
|
+
const pos = n.map((x) => big(x).gt(0));
|
|
101
|
+
const closes = (i, j, k) => big(n[i]).times(big(n[j])).minus(big(n[k])).abs().lte(productBound(n[i], n[j], n[k]));
|
|
102
|
+
let best = null;
|
|
103
|
+
for (let k = n.length - 1; k >= 2 && !best; k--) {
|
|
104
|
+
if (!pos[k])
|
|
105
|
+
continue;
|
|
106
|
+
for (let j = k - 1; j >= 1 && !best; j--) {
|
|
107
|
+
if (!pos[j])
|
|
108
|
+
continue;
|
|
109
|
+
for (let i = 0; i < j; i++) {
|
|
110
|
+
if (pos[i] && closes(i, j, k)) {
|
|
111
|
+
best = [i, j, k];
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (!best)
|
|
118
|
+
return null;
|
|
119
|
+
const [i, j, k] = best;
|
|
120
|
+
// Numbers right of the value that nearly close with these units (within 5%) are a
|
|
121
|
+
// NAV and value that don't quite agree: the closing triple found is then the cost
|
|
122
|
+
// pair (units × average cost = total cost), not the holding's value. Abstain.
|
|
123
|
+
for (let p = k + 1; p < n.length; p++) {
|
|
124
|
+
for (let q = p + 1; q < n.length; q++) {
|
|
125
|
+
if (!pos[p] || !pos[q])
|
|
126
|
+
continue;
|
|
127
|
+
const v = big(n[q]);
|
|
128
|
+
if (big(n[i]).times(big(n[p])).minus(v).abs().lte(v.times("0.05")))
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
let cost = null;
|
|
133
|
+
for (let a = i + 1; a < j && !cost; a++)
|
|
134
|
+
for (let t = a + 1; t < j && !cost; t++)
|
|
135
|
+
if (pos[a] && pos[t] && closes(i, a, t))
|
|
136
|
+
cost = n[t];
|
|
137
|
+
if (!cost && k === j + 2 && pos[j + 1])
|
|
138
|
+
cost = n[j + 1];
|
|
139
|
+
return { units: n[i], nav: n[j], value: n[k], cost };
|
|
140
|
+
}
|
|
141
|
+
function sectionOf(text) {
|
|
142
|
+
const t = text.trim().toLowerCase().replace(/\s+/g, " ");
|
|
143
|
+
if (TRANSACTION_HEADINGS.test(t))
|
|
144
|
+
return { section: "transactions" };
|
|
145
|
+
if (MF_FOLIO_HEADINGS.some((r) => r.test(t)))
|
|
146
|
+
return { section: "mf_folios" };
|
|
147
|
+
if (DEMAT_MF_HEADINGS.some((r) => r.test(t)))
|
|
148
|
+
return { section: "demat" };
|
|
149
|
+
for (const [re, label] of OTHER_HEADINGS)
|
|
150
|
+
if (re.test(t))
|
|
151
|
+
return { section: "other", label };
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
/** A heading line prints no numbers other than a date or a section letter. */
|
|
155
|
+
const headingLike = (line) => !line.items.some((i) => isNumeric(i.str) && !DATE_RE.test(i.str));
|
|
156
|
+
function accountOf(text) {
|
|
157
|
+
const dpc = DP_CLIENT_RE.exec(text);
|
|
158
|
+
if (dpc) {
|
|
159
|
+
const broker = DP_NAME_RE.exec(text)?.[1]?.trim() ?? null;
|
|
160
|
+
return { dpId: dpc[1].toUpperCase(), clientId: dpc[2], broker };
|
|
161
|
+
}
|
|
162
|
+
const bo = BO_ID_RE.exec(text)?.[1];
|
|
163
|
+
if (bo) {
|
|
164
|
+
// 16 characters: an 8-character DP ID (NSDL's start "IN") + an 8-digit client ID (casparser cdsl.py).
|
|
165
|
+
const broker = DP_NAME_RE.exec(text)?.[1]?.trim() ?? null;
|
|
166
|
+
return { dpId: bo.slice(0, 8).toUpperCase(), clientId: bo.slice(8), broker };
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Splits a row (its ISIN line and continuation lines) into parts. The ISIN
|
|
172
|
+
* cell may carry a UCC on the line below: a short token under the ISIN.
|
|
173
|
+
*/
|
|
174
|
+
function rowParts(lines, isinItem, withFolio) {
|
|
175
|
+
const items = lines.flatMap((l) => l.items);
|
|
176
|
+
const first = lines[0];
|
|
177
|
+
let folio = null;
|
|
178
|
+
let folioItems = [];
|
|
179
|
+
if (withFolio) {
|
|
180
|
+
const after = first.items.filter((i) => i.x0 > isinItem.x0 && i !== isinItem);
|
|
181
|
+
const k = after.findIndex((i) => FOLIO_RE.test(i.str.trim()));
|
|
182
|
+
if (k >= 0) {
|
|
183
|
+
folio = after[k].str.replace(/\s+/g, "").trim();
|
|
184
|
+
folioItems = [after[k]];
|
|
185
|
+
const tail = after[k + 1];
|
|
186
|
+
if (tail && FOLIO_TAIL_RE.test(tail.str.trim()) && !folio.includes("/")) {
|
|
187
|
+
folio += tail.str.trim();
|
|
188
|
+
folioItems.push(tail);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const isUcc = (i) => i !== isinItem && Math.abs(i.x0 - isinItem.x0) <= 3 && i.y > isinItem.y && /^\S{1,15}$/.test(i.str.trim()) && !isNumeric(i.str);
|
|
193
|
+
let advisor = null;
|
|
194
|
+
const numbers = [];
|
|
195
|
+
const nameParts = [];
|
|
196
|
+
let date = null;
|
|
197
|
+
for (const it of items) {
|
|
198
|
+
const s = it.str.trim();
|
|
199
|
+
if (!s || it === isinItem || folioItems.includes(it) || isUcc(it) || PAGE_FOOTER_RE.test(s))
|
|
200
|
+
continue;
|
|
201
|
+
const d = DATE_RE.test(s) ? depositoryDate(s) : null;
|
|
202
|
+
if (d) {
|
|
203
|
+
date ??= d;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (ADVISOR_RE.test(s)) {
|
|
207
|
+
advisor ??= s.toUpperCase();
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
// pdf.js joins closely set columns into one item ("0.20 114.18"). When every
|
|
211
|
+
// word is a number, each is a cell; x is estimated pro rata by character.
|
|
212
|
+
const words = s.split(/\s+/);
|
|
213
|
+
if (words.length > 1 && words.every((w) => isNumeric(w) || /^-+$/.test(w))) {
|
|
214
|
+
const per = (it.x1 - it.x0) / Math.max(it.str.length, 1);
|
|
215
|
+
let at = 0;
|
|
216
|
+
for (const w of words) {
|
|
217
|
+
at = it.str.indexOf(w, at);
|
|
218
|
+
const n = parseNum(w);
|
|
219
|
+
if (n)
|
|
220
|
+
numbers.push({ x: it.x0 + (at + w.length) * per, y: it.y, n });
|
|
221
|
+
at += w.length;
|
|
222
|
+
}
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (isNumeric(s) || /^-+$/.test(s)) {
|
|
226
|
+
const n = parseNum(s);
|
|
227
|
+
if (n)
|
|
228
|
+
numbers.push({ x: it.x1, y: it.y, n });
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
nameParts.push(it);
|
|
232
|
+
}
|
|
233
|
+
numbers.sort((a, b) => a.x - b.x || a.y - b.y);
|
|
234
|
+
nameParts.sort((a, b) => a.y - b.y || a.x0 - b.x0);
|
|
235
|
+
return {
|
|
236
|
+
isin: isinItem.str.trim(),
|
|
237
|
+
folio,
|
|
238
|
+
advisor,
|
|
239
|
+
name: nameParts.map((i) => i.str.trim()).join(" "),
|
|
240
|
+
numbers: numbers.map((x) => x.n),
|
|
241
|
+
date,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const HISTORY_UNAVAILABLE = "Depository statements list holdings without your purchase history, so it can't be checked. Returns and gains need a detailed CAMS or KFintech statement from the first purchase.";
|
|
245
|
+
function valuationCheck(s) {
|
|
246
|
+
if (!s.close || !s.nav || !s.valuation)
|
|
247
|
+
return { id: "valuation.units_x_nav", status: "unavailable", detail: "Units, NAV or value not found" };
|
|
248
|
+
const product = big(s.close).times(big(s.nav.value));
|
|
249
|
+
const bound = productBound(s.close, s.nav.value, s.valuation.value);
|
|
250
|
+
const ok = product.minus(big(s.valuation.value)).abs().lte(bound);
|
|
251
|
+
return {
|
|
252
|
+
id: "valuation.units_x_nav", status: ok ? "pass" : "fail",
|
|
253
|
+
expected: s.valuation.value.value, observed: product.toFixed(2), tolerance: bound.toFixed(4), source: s.footerSource ?? s.source,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/** The roster's printed value of all mutual fund folios against the folio holdings read. */
|
|
257
|
+
function folioTotalCheck(printed, schemes) {
|
|
258
|
+
const id = "total.mf_folios";
|
|
259
|
+
if (!printed)
|
|
260
|
+
return { id, status: "unavailable", detail: "The statement's summary prints no total for mutual fund folios" };
|
|
261
|
+
const valued = schemes.filter((s) => s.valuation);
|
|
262
|
+
if (valued.length !== schemes.length) {
|
|
263
|
+
return { id, status: "unavailable", detail: `${schemes.length - valued.length} folio holding(s) have no value, so the values can't be added up`, source: printed.source };
|
|
264
|
+
}
|
|
265
|
+
const sum = valued.reduce((acc, s) => acc.plus(big(s.valuation.value)), new Big(0));
|
|
266
|
+
const bound = valued.reduce((acc, s) => acc.plus(halfUlp(s.valuation.value)), halfUlp(printed.value));
|
|
267
|
+
const ok = sum.minus(big(printed.value)).abs().lte(bound);
|
|
268
|
+
return { id, status: ok ? "pass" : "fail", expected: printed.value.value, observed: sum.toFixed(2), tolerance: bound.toFixed(4), source: printed.source };
|
|
269
|
+
}
|
|
270
|
+
export function parseDepository(doc, detection) {
|
|
271
|
+
const cleaned = doc.pages.map((p) => cleanPage(p));
|
|
272
|
+
const coverage = { pages: doc.pages.length, datedRowsSeen: 0, transactionsParsed: 0, datedRowsSkipped: [], ambiguousCells: [], schemeRegionsUnbuilt: [] };
|
|
273
|
+
const warnings = [];
|
|
274
|
+
for (const c of cleaned) {
|
|
275
|
+
const rotated = rotatedTextChars(c);
|
|
276
|
+
if (rotated)
|
|
277
|
+
warnings.push(`Page ${c.number}: ${rotated} characters of rotated text were set aside; anything printed there is missing.`);
|
|
278
|
+
}
|
|
279
|
+
const lines = cleaned.flatMap((c) => c.lines);
|
|
280
|
+
const texts = lines.map((l) => lineText(l).replace(/\s+/g, " ").trim());
|
|
281
|
+
let period = null;
|
|
282
|
+
for (const t of texts) {
|
|
283
|
+
const m = PERIOD_RE.exec(t);
|
|
284
|
+
const from = m && depositoryDate(m[1]);
|
|
285
|
+
const to = m && depositoryDate(m[2]);
|
|
286
|
+
if (from && to) {
|
|
287
|
+
period = { from, to };
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// AMC names CDSL prints per folio ("AMC Name : …" then "Folio No : …").
|
|
292
|
+
const amcByFolio = new Map();
|
|
293
|
+
let pendingAmc = null;
|
|
294
|
+
for (const t of texts) {
|
|
295
|
+
const a = AMC_NAME_RE.exec(t)?.[1];
|
|
296
|
+
if (a)
|
|
297
|
+
pendingAmc = a.replace(/\s+Scheme\s*Name\s*:.*$/i, "").trim();
|
|
298
|
+
const f = FOLIO_LABEL_RE.exec(t)?.[1];
|
|
299
|
+
if (f && pendingAmc)
|
|
300
|
+
amcByFolio.set(f.replace(/\s+/g, ""), pendingAmc);
|
|
301
|
+
}
|
|
302
|
+
const folios = new Map();
|
|
303
|
+
const folioSchemes = [];
|
|
304
|
+
const unread = new Map();
|
|
305
|
+
let rosterMf = null;
|
|
306
|
+
let section = "none";
|
|
307
|
+
let otherLabel = "other securities";
|
|
308
|
+
let asOn = null;
|
|
309
|
+
let account = null;
|
|
310
|
+
let amcHeading = null;
|
|
311
|
+
const addHolding = (row, placed, src, demat) => {
|
|
312
|
+
const date = row.date ?? asOn ?? period?.to ?? null;
|
|
313
|
+
const folioNo = demat ? (account ? `${account.dpId}-${account.clientId}` : "Demat account") : row.folio ?? "Not printed";
|
|
314
|
+
const amc = demat ? "UNKNOWN" : (row.folio && amcByFolio.get(row.folio)) || amcHeading || "UNKNOWN";
|
|
315
|
+
const key = `${demat ? "demat" : "folio"}|${amc}|${folioNo}`;
|
|
316
|
+
let folio = folios.get(key);
|
|
317
|
+
if (!folio) {
|
|
318
|
+
folio = { folio: folioNo, amc, pan: null, kyc: null, panKyc: null, holderName: null, schemes: [] };
|
|
319
|
+
folios.set(key, folio);
|
|
320
|
+
}
|
|
321
|
+
const code = SCHEME_CODE_RE.exec(row.name);
|
|
322
|
+
const name = cleanSchemeName(code ? code[2] : row.name) || row.isin;
|
|
323
|
+
const scheme = {
|
|
324
|
+
name, rtaCode: code ? code[1] : "", rta: demat ? detection.issuer : "UNKNOWN", isin: row.isin, advisor: row.advisor,
|
|
325
|
+
plan: planOf(name), option: optionOf(name), nominees: [],
|
|
326
|
+
open: null, close: placed.units, closeCalculated: null,
|
|
327
|
+
nav: date ? { date, value: placed.nav } : null,
|
|
328
|
+
valuation: date ? { date, value: placed.value } : null,
|
|
329
|
+
cost: placed.cost, transactions: [], checks: [], source: src, footerSource: src,
|
|
330
|
+
};
|
|
331
|
+
scheme.checks = [valuationCheck(scheme), isinCheck(scheme), { id: "history.complete", status: "unavailable", detail: HISTORY_UNAVAILABLE }];
|
|
332
|
+
folio.schemes.push(scheme);
|
|
333
|
+
if (!demat)
|
|
334
|
+
folioSchemes.push(scheme);
|
|
335
|
+
};
|
|
336
|
+
for (let i = 0; i < lines.length; i++) {
|
|
337
|
+
const line = lines[i];
|
|
338
|
+
const text = texts[i];
|
|
339
|
+
const src = { page: line.page, y: line.y };
|
|
340
|
+
const acc = accountOf(text);
|
|
341
|
+
if (acc) {
|
|
342
|
+
account = acc;
|
|
343
|
+
// A new account's page starts with its own sections.
|
|
344
|
+
section = "none";
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
// The roster row "Mutual Fund Folios | n Folios | n | value" prints the folios' total.
|
|
348
|
+
if (ROSTER_MF_RE.test(text) && !rosterMf) {
|
|
349
|
+
const nums = line.items.map((it) => parseNum(it.str.trim())).filter((n) => n !== null);
|
|
350
|
+
const value = nums[nums.length - 1];
|
|
351
|
+
if (nums.length >= 2 && value && value.scale === 2) {
|
|
352
|
+
rosterMf = { value, source: src };
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (headingLike(line)) {
|
|
357
|
+
const sec = sectionOf(text);
|
|
358
|
+
if (sec) {
|
|
359
|
+
section = sec.section;
|
|
360
|
+
if (sec.section === "other")
|
|
361
|
+
otherLabel = sec.label ?? otherLabel;
|
|
362
|
+
if (sec.section === "mf_folios") {
|
|
363
|
+
account = null;
|
|
364
|
+
amcHeading = null;
|
|
365
|
+
}
|
|
366
|
+
const d = AS_ON_RE.exec(text)?.[1];
|
|
367
|
+
if (d)
|
|
368
|
+
asOn = depositoryDate(d) ?? asOn;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (section === "mf_folios" && AMC_LINE_RE.test(text) && !text.includes(":")) {
|
|
372
|
+
amcHeading = AMC_LINE_RE.exec(text)[1].trim();
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const isinItem = line.items.find((it) => ISIN_RE.test(it.str.trim()));
|
|
377
|
+
if (!isinItem || section === "none" || section === "transactions")
|
|
378
|
+
continue;
|
|
379
|
+
if (TOTAL_RE.test(text))
|
|
380
|
+
continue;
|
|
381
|
+
// The row: this line and the lines below it up to the next ISIN, heading or total.
|
|
382
|
+
const rowLines = [line];
|
|
383
|
+
for (let j = i + 1; j < lines.length; j++) {
|
|
384
|
+
const next = lines[j];
|
|
385
|
+
const prev = rowLines[rowLines.length - 1];
|
|
386
|
+
if (next.page !== line.page || next.y - prev.y > ROW_MAX_GAP)
|
|
387
|
+
break;
|
|
388
|
+
if (next.items.some((it) => ISIN_RE.test(it.str.trim())) || TOTAL_RE.test(texts[j]) || accountOf(texts[j]))
|
|
389
|
+
break;
|
|
390
|
+
if (headingLike(next) && sectionOf(texts[j]))
|
|
391
|
+
break;
|
|
392
|
+
rowLines.push(next);
|
|
393
|
+
}
|
|
394
|
+
i += rowLines.length - 1;
|
|
395
|
+
const isMf = MF_ISIN_RE.test(isinItem.str.trim());
|
|
396
|
+
const kind = section === "other" ? "other" : section;
|
|
397
|
+
if (!isMf || kind === "other") {
|
|
398
|
+
const label = kind === "other" ? otherLabel : "securities other than mutual funds";
|
|
399
|
+
unread.set(label, (unread.get(label) ?? 0) + 1);
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
// Transaction sections are skipped above; a dated row here is a holding with its NAV date,
|
|
403
|
+
// and is read only when its numbers close like one.
|
|
404
|
+
const row = rowParts(rowLines, isinItem, kind === "mf_folios");
|
|
405
|
+
const placed = placeByArithmetic(row.numbers);
|
|
406
|
+
if (!placed) {
|
|
407
|
+
if (row.numbers.length >= 2) {
|
|
408
|
+
coverage.schemeRegionsUnbuilt.push({ source: src, reason: "no three printed numbers satisfy units × NAV = value, so the holding was skipped rather than guessed" });
|
|
409
|
+
}
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
addHolding(row, placed, src, kind === "demat");
|
|
413
|
+
}
|
|
414
|
+
const allSchemes = [...folios.values()].flatMap((f) => f.schemes);
|
|
415
|
+
if (allSchemes.length === 0 && coverage.schemeRegionsUnbuilt.length === 0) {
|
|
416
|
+
const others = [...unread.values()].reduce((a, b) => a + b, 0);
|
|
417
|
+
if (others === 0)
|
|
418
|
+
throw new CasError("UNKNOWN_TEMPLATE", `Found ${detection.issuer} markers but couldn't find a mutual fund holdings table.`);
|
|
419
|
+
}
|
|
420
|
+
if (coverage.schemeRegionsUnbuilt.length)
|
|
421
|
+
warnings.push(`${coverage.schemeRegionsUnbuilt.length} mutual fund row(s) could not be read; those holdings are missing.`);
|
|
422
|
+
for (const [label, n] of unread)
|
|
423
|
+
warnings.push(`Not read: ${n} holding(s) under ${label}. Only mutual fund units and ETFs are read from ${detection.issuer} statements.`);
|
|
424
|
+
return {
|
|
425
|
+
schemaVersion: "1",
|
|
426
|
+
source: { issuer: detection.issuer, variant: "DEMAT", engineVersion: ENGINE_VERSION },
|
|
427
|
+
provenance: { sha256: doc.meta.sha256, pageCount: doc.meta.pageCount, producer: doc.meta.producer, creator: doc.meta.creator, pdfVersion: doc.meta.pdfVersion, encrypted: doc.meta.encrypted, extractor: doc.meta.extractor },
|
|
428
|
+
statementPeriod: period,
|
|
429
|
+
// Depository statements print the holder block differently; nothing is guessed from it.
|
|
430
|
+
addressee: { name: null, email: null, mobile: null, address: null },
|
|
431
|
+
folios: [...folios.values()],
|
|
432
|
+
// The roster's grand total includes shares and bonds this reader leaves out, so it is not a total to compare with.
|
|
433
|
+
printedTotal: null,
|
|
434
|
+
checks: [folioTotalCheck(rosterMf, folioSchemes)],
|
|
435
|
+
coverage,
|
|
436
|
+
warnings,
|
|
437
|
+
};
|
|
438
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Privacy classes for every CasDocument v1 field (ADR-0008 §6; architecture
|
|
3
|
+
* ROADMAP "Now" item 4). The class says who may see a field:
|
|
4
|
+
*
|
|
5
|
+
* P0 public or refdata, or structure (page numbers, check ids) anywhere
|
|
6
|
+
* P1 financial values kept in the distributor profile; never telemetry
|
|
7
|
+
* P2 identifiers: PAN, folio, file hash, ARN printed on the folio self only
|
|
8
|
+
* P3 names, contact details, addresses, nominees self only
|
|
9
|
+
* PX untrusted free text that may contain anything: descriptions,
|
|
10
|
+
* check details, parser reasons, PDF metadata strings self only; never in
|
|
11
|
+
* telemetry, URLs, filenames or metadata
|
|
12
|
+
*
|
|
13
|
+
* The map below is typed against model.ts, so a field added to the model
|
|
14
|
+
* without a class (or a class left for a removed field) fails the typecheck.
|
|
15
|
+
* `annotatePrivacy` writes the classes into the JSON Schema as "x-privacy"
|
|
16
|
+
* and throws on any property it cannot class, so `npm run schema` fails too.
|
|
17
|
+
*
|
|
18
|
+
* `redactCas` is the distributor projection: P0 and P1 only. It picks fields
|
|
19
|
+
* by name, so a field added later is dropped until someone classes it and
|
|
20
|
+
* opts it in here (fail closed).
|
|
21
|
+
*/
|
|
22
|
+
import type { Check, CasDocument, Scheme, Source, Transaction } from "./model.js";
|
|
23
|
+
export type PrivacyClass = "P0" | "P1" | "P2" | "P3" | "PX";
|
|
24
|
+
/** A field whose value is an object (or array of objects) with its own class map. */
|
|
25
|
+
export interface Nested {
|
|
26
|
+
readonly nested: PrivacyMapName;
|
|
27
|
+
}
|
|
28
|
+
export type FieldPrivacy = PrivacyClass | Nested;
|
|
29
|
+
/** Every model.ts interface, by name, with a class for each field. */
|
|
30
|
+
export declare const PRIVACY: {
|
|
31
|
+
readonly CasDocument: {
|
|
32
|
+
readonly schemaVersion: "P0";
|
|
33
|
+
readonly source: Nested;
|
|
34
|
+
readonly provenance: Nested;
|
|
35
|
+
readonly statementPeriod: "P1";
|
|
36
|
+
readonly addressee: Nested;
|
|
37
|
+
readonly folios: Nested;
|
|
38
|
+
readonly coverage: Nested;
|
|
39
|
+
readonly printedTotal: Nested;
|
|
40
|
+
readonly checks: Nested;
|
|
41
|
+
readonly warnings: "PX";
|
|
42
|
+
};
|
|
43
|
+
readonly CasSource: {
|
|
44
|
+
readonly issuer: "P0";
|
|
45
|
+
readonly variant: "P0";
|
|
46
|
+
readonly engineVersion: "P0";
|
|
47
|
+
};
|
|
48
|
+
readonly Provenance: {
|
|
49
|
+
readonly sha256: "P2";
|
|
50
|
+
readonly pageCount: "P0";
|
|
51
|
+
readonly producer: "PX";
|
|
52
|
+
readonly creator: "PX";
|
|
53
|
+
readonly pdfVersion: "P0";
|
|
54
|
+
readonly encrypted: "P0";
|
|
55
|
+
readonly extractor: "P0";
|
|
56
|
+
};
|
|
57
|
+
readonly Addressee: {
|
|
58
|
+
readonly name: "P3";
|
|
59
|
+
readonly email: "P3";
|
|
60
|
+
readonly mobile: "P3";
|
|
61
|
+
readonly address: "P3";
|
|
62
|
+
};
|
|
63
|
+
readonly Folio: {
|
|
64
|
+
readonly folio: "P2";
|
|
65
|
+
readonly amc: "P0";
|
|
66
|
+
readonly pan: "P2";
|
|
67
|
+
readonly kyc: "PX";
|
|
68
|
+
readonly panKyc: "PX";
|
|
69
|
+
readonly holderName: "P3";
|
|
70
|
+
readonly schemes: Nested;
|
|
71
|
+
};
|
|
72
|
+
readonly Scheme: {
|
|
73
|
+
readonly name: "P0";
|
|
74
|
+
readonly rtaCode: "P0";
|
|
75
|
+
readonly rta: "P0";
|
|
76
|
+
readonly isin: "P0";
|
|
77
|
+
readonly advisor: "P2";
|
|
78
|
+
readonly plan: "P0";
|
|
79
|
+
readonly option: "P0";
|
|
80
|
+
readonly nominees: "P3";
|
|
81
|
+
readonly open: "P1";
|
|
82
|
+
readonly close: "P1";
|
|
83
|
+
readonly closeCalculated: "P1";
|
|
84
|
+
readonly nav: "P1";
|
|
85
|
+
readonly valuation: "P1";
|
|
86
|
+
readonly cost: "P1";
|
|
87
|
+
readonly transactions: Nested;
|
|
88
|
+
readonly checks: Nested;
|
|
89
|
+
readonly source: Nested;
|
|
90
|
+
readonly footerSource: Nested;
|
|
91
|
+
};
|
|
92
|
+
readonly Transaction: {
|
|
93
|
+
readonly order: "P0";
|
|
94
|
+
readonly date: "P1";
|
|
95
|
+
readonly description: "PX";
|
|
96
|
+
readonly amount: "P1";
|
|
97
|
+
readonly units: "P1";
|
|
98
|
+
readonly price: "P1";
|
|
99
|
+
readonly balance: "P1";
|
|
100
|
+
readonly type: "P1";
|
|
101
|
+
readonly dividendRate: "P1";
|
|
102
|
+
readonly giftFolio: "P2";
|
|
103
|
+
readonly signCorrected: "P1";
|
|
104
|
+
readonly source: Nested;
|
|
105
|
+
};
|
|
106
|
+
readonly Check: {
|
|
107
|
+
readonly id: "P0";
|
|
108
|
+
readonly status: "P1";
|
|
109
|
+
readonly expected: "PX";
|
|
110
|
+
readonly observed: "PX";
|
|
111
|
+
readonly tolerance: "P1";
|
|
112
|
+
readonly detail: "PX";
|
|
113
|
+
readonly source: Nested;
|
|
114
|
+
};
|
|
115
|
+
readonly Source: {
|
|
116
|
+
readonly page: "P0";
|
|
117
|
+
readonly y: "P0";
|
|
118
|
+
};
|
|
119
|
+
readonly PrintedTotal: {
|
|
120
|
+
readonly label: "PX";
|
|
121
|
+
readonly cost: "P1";
|
|
122
|
+
readonly marketValue: "P1";
|
|
123
|
+
readonly source: Nested;
|
|
124
|
+
};
|
|
125
|
+
readonly Coverage: {
|
|
126
|
+
readonly pages: "P0";
|
|
127
|
+
readonly datedRowsSeen: "P0";
|
|
128
|
+
readonly transactionsParsed: "P0";
|
|
129
|
+
readonly datedRowsSkipped: Nested;
|
|
130
|
+
readonly ambiguousCells: Nested;
|
|
131
|
+
readonly schemeRegionsUnbuilt: Nested;
|
|
132
|
+
};
|
|
133
|
+
readonly CoverageEntry: {
|
|
134
|
+
readonly source: Nested;
|
|
135
|
+
readonly reason: "PX";
|
|
136
|
+
};
|
|
137
|
+
readonly AmbiguousCell: {
|
|
138
|
+
readonly source: Nested;
|
|
139
|
+
readonly text: "PX";
|
|
140
|
+
readonly reason: "PX";
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
export type PrivacyMapName = "CasDocument" | "CasSource" | "Provenance" | "Addressee" | "Folio" | "Scheme" | "Transaction" | "Check" | "Source" | "PrintedTotal" | "Coverage" | "CoverageEntry" | "AmbiguousCell";
|
|
144
|
+
export declare const isNested: (f: FieldPrivacy) => f is Nested;
|
|
145
|
+
/** Every leaf field and its class, as "Map.field" (for inventories and tests). */
|
|
146
|
+
export declare function privacyInventory(): Array<{
|
|
147
|
+
map: PrivacyMapName;
|
|
148
|
+
field: string;
|
|
149
|
+
class: PrivacyClass;
|
|
150
|
+
}>;
|
|
151
|
+
type JsonObject = Record<string, unknown>;
|
|
152
|
+
/**
|
|
153
|
+
* Writes `"x-privacy": "<class>"` on every leaf property of the CasDocument
|
|
154
|
+
* JSON Schema (generated from schema.ts) and returns the same object.
|
|
155
|
+
* Throws when a property has no class, when a class names a property the
|
|
156
|
+
* schema doesn't have, or when an object schema can't be matched to a map.
|
|
157
|
+
*/
|
|
158
|
+
export declare function annotatePrivacy(schema: JsonObject): JsonObject;
|
|
159
|
+
/** A number without its printed text: the canonical value and its scale. */
|
|
160
|
+
export interface RedactedNum {
|
|
161
|
+
value: string;
|
|
162
|
+
scale: number;
|
|
163
|
+
}
|
|
164
|
+
export interface RedactedTransaction {
|
|
165
|
+
order: number;
|
|
166
|
+
date: string;
|
|
167
|
+
amount: RedactedNum | null;
|
|
168
|
+
units: RedactedNum | null;
|
|
169
|
+
price: RedactedNum | null;
|
|
170
|
+
balance: RedactedNum | null;
|
|
171
|
+
type: Transaction["type"];
|
|
172
|
+
dividendRate: string | null;
|
|
173
|
+
signCorrected: boolean;
|
|
174
|
+
source: Source;
|
|
175
|
+
}
|
|
176
|
+
export interface RedactedCheck {
|
|
177
|
+
id: string;
|
|
178
|
+
status: Check["status"];
|
|
179
|
+
tolerance?: string;
|
|
180
|
+
source?: Source;
|
|
181
|
+
}
|
|
182
|
+
export interface RedactedScheme {
|
|
183
|
+
name: string;
|
|
184
|
+
rtaCode: string;
|
|
185
|
+
rta: string;
|
|
186
|
+
isin: string | null;
|
|
187
|
+
plan: Scheme["plan"];
|
|
188
|
+
option: Scheme["option"];
|
|
189
|
+
open: RedactedNum | null;
|
|
190
|
+
close: RedactedNum | null;
|
|
191
|
+
closeCalculated: string | null;
|
|
192
|
+
nav: {
|
|
193
|
+
date: string;
|
|
194
|
+
value: RedactedNum;
|
|
195
|
+
} | null;
|
|
196
|
+
valuation: {
|
|
197
|
+
date: string;
|
|
198
|
+
value: RedactedNum;
|
|
199
|
+
} | null;
|
|
200
|
+
cost: RedactedNum | null;
|
|
201
|
+
transactions: RedactedTransaction[];
|
|
202
|
+
checks: RedactedCheck[];
|
|
203
|
+
source: Source;
|
|
204
|
+
footerSource: Source | null;
|
|
205
|
+
}
|
|
206
|
+
export interface RedactedFolio {
|
|
207
|
+
amc: string;
|
|
208
|
+
schemes: RedactedScheme[];
|
|
209
|
+
}
|
|
210
|
+
export interface RedactedCasDocument {
|
|
211
|
+
schemaVersion: "1";
|
|
212
|
+
source: CasDocument["source"];
|
|
213
|
+
provenance: {
|
|
214
|
+
pageCount: number;
|
|
215
|
+
pdfVersion: string | null;
|
|
216
|
+
encrypted: boolean;
|
|
217
|
+
extractor: string;
|
|
218
|
+
};
|
|
219
|
+
statementPeriod: {
|
|
220
|
+
from: string;
|
|
221
|
+
to: string;
|
|
222
|
+
} | null;
|
|
223
|
+
folios: RedactedFolio[];
|
|
224
|
+
coverage: {
|
|
225
|
+
pages: number;
|
|
226
|
+
datedRowsSeen: number;
|
|
227
|
+
transactionsParsed: number;
|
|
228
|
+
datedRowsSkipped: Array<{
|
|
229
|
+
source: Source;
|
|
230
|
+
}>;
|
|
231
|
+
ambiguousCells: Array<{
|
|
232
|
+
source: Source;
|
|
233
|
+
}>;
|
|
234
|
+
schemeRegionsUnbuilt: Array<{
|
|
235
|
+
source: Source;
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
/** How many parser notes there were (their text is PX and stays behind). */
|
|
239
|
+
warningCount: number;
|
|
240
|
+
}
|
|
241
|
+
/** The P0/P1 projection of a CasDocument. Builds new objects; never shares references with the input. */
|
|
242
|
+
export declare function redactCas(cas: CasDocument): RedactedCasDocument;
|
|
243
|
+
export {};
|