anonyma 1.0.0 → 1.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +235 -144
  2. package/README.md +147 -89
  3. package/dist/ai/index.cjs +522 -0
  4. package/dist/ai/index.cjs.map +1 -0
  5. package/dist/ai/index.d.cts +322 -0
  6. package/dist/ai/index.d.ts +322 -0
  7. package/dist/ai/index.js +505 -0
  8. package/dist/ai/index.js.map +1 -0
  9. package/dist/audit/index.cjs +359 -0
  10. package/dist/audit/index.cjs.map +1 -0
  11. package/dist/audit/index.d.cts +287 -0
  12. package/dist/audit/index.d.ts +287 -0
  13. package/dist/audit/index.js +340 -0
  14. package/dist/audit/index.js.map +1 -0
  15. package/dist/chunk-2F2GWGTB.js +174 -0
  16. package/dist/chunk-2F2GWGTB.js.map +1 -0
  17. package/dist/chunk-2NNMJ55L.cjs +45 -0
  18. package/dist/chunk-2NNMJ55L.cjs.map +1 -0
  19. package/dist/chunk-2NTQ2455.js +294 -0
  20. package/dist/chunk-2NTQ2455.js.map +1 -0
  21. package/dist/chunk-2YG7R4KJ.cjs +114 -0
  22. package/dist/chunk-2YG7R4KJ.cjs.map +1 -0
  23. package/dist/chunk-2ZZHLCEJ.js +237 -0
  24. package/dist/chunk-2ZZHLCEJ.js.map +1 -0
  25. package/dist/chunk-3CY6ATKS.cjs +308 -0
  26. package/dist/chunk-3CY6ATKS.cjs.map +1 -0
  27. package/dist/chunk-3D5ZCJ7R.js +268 -0
  28. package/dist/chunk-3D5ZCJ7R.js.map +1 -0
  29. package/dist/chunk-6LDAIJBL.js +103 -0
  30. package/dist/chunk-6LDAIJBL.js.map +1 -0
  31. package/dist/chunk-7GPLMGZ3.js +651 -0
  32. package/dist/chunk-7GPLMGZ3.js.map +1 -0
  33. package/dist/chunk-7HK2V5Q4.js +111 -0
  34. package/dist/chunk-7HK2V5Q4.js.map +1 -0
  35. package/dist/chunk-7Y4X3Z3T.js +1063 -0
  36. package/dist/chunk-7Y4X3Z3T.js.map +1 -0
  37. package/dist/chunk-AAP472NG.js +177 -0
  38. package/dist/chunk-AAP472NG.js.map +1 -0
  39. package/dist/chunk-AP4JIUNW.js +42 -0
  40. package/dist/chunk-AP4JIUNW.js.map +1 -0
  41. package/dist/chunk-BBJPQPGP.js +457 -0
  42. package/dist/chunk-BBJPQPGP.js.map +1 -0
  43. package/dist/chunk-CRXRJZEV.cjs +82 -0
  44. package/dist/chunk-CRXRJZEV.cjs.map +1 -0
  45. package/dist/chunk-E3PICZYI.js +20 -0
  46. package/dist/chunk-E3PICZYI.js.map +1 -0
  47. package/dist/chunk-F7O2FA3F.cjs +1255 -0
  48. package/dist/chunk-F7O2FA3F.cjs.map +1 -0
  49. package/dist/chunk-FB56NAAH.cjs +243 -0
  50. package/dist/chunk-FB56NAAH.cjs.map +1 -0
  51. package/dist/chunk-GYMG5OI3.cjs +186 -0
  52. package/dist/chunk-GYMG5OI3.cjs.map +1 -0
  53. package/dist/chunk-IFMYNZQN.cjs +181 -0
  54. package/dist/chunk-IFMYNZQN.cjs.map +1 -0
  55. package/dist/chunk-KOCQBDI4.cjs +179 -0
  56. package/dist/chunk-KOCQBDI4.cjs.map +1 -0
  57. package/dist/chunk-NTG222XM.cjs +662 -0
  58. package/dist/chunk-NTG222XM.cjs.map +1 -0
  59. package/dist/chunk-O5LRGWLY.js +179 -0
  60. package/dist/chunk-O5LRGWLY.js.map +1 -0
  61. package/dist/chunk-OGNLB2KA.js +79 -0
  62. package/dist/chunk-OGNLB2KA.js.map +1 -0
  63. package/dist/chunk-PKHZ7CVI.js +28 -0
  64. package/dist/chunk-PKHZ7CVI.js.map +1 -0
  65. package/dist/chunk-QYD4F6T7.cjs +114 -0
  66. package/dist/chunk-QYD4F6T7.cjs.map +1 -0
  67. package/dist/chunk-RCW5IPPR.js +1288 -0
  68. package/dist/chunk-RCW5IPPR.js.map +1 -0
  69. package/dist/chunk-RMMKYHUN.cjs +35 -0
  70. package/dist/chunk-RMMKYHUN.cjs.map +1 -0
  71. package/dist/chunk-S4BJ2ADB.cjs +22 -0
  72. package/dist/chunk-S4BJ2ADB.cjs.map +1 -0
  73. package/dist/chunk-S7NH6CHY.cjs +462 -0
  74. package/dist/chunk-S7NH6CHY.cjs.map +1 -0
  75. package/dist/chunk-SCWWWJJZ.cjs +301 -0
  76. package/dist/chunk-SCWWWJJZ.cjs.map +1 -0
  77. package/dist/chunk-SIHPDZXA.js +176 -0
  78. package/dist/chunk-SIHPDZXA.js.map +1 -0
  79. package/dist/chunk-TW7PM3UJ.cjs +30 -0
  80. package/dist/chunk-TW7PM3UJ.cjs.map +1 -0
  81. package/dist/chunk-UA3EOFBS.cjs +1322 -0
  82. package/dist/chunk-UA3EOFBS.cjs.map +1 -0
  83. package/dist/chunk-UHNALA3S.cjs +1087 -0
  84. package/dist/chunk-UHNALA3S.cjs.map +1 -0
  85. package/dist/chunk-VE4CCW7W.js +32 -0
  86. package/dist/chunk-VE4CCW7W.js.map +1 -0
  87. package/dist/chunk-WLJN7GIS.cjs +189 -0
  88. package/dist/chunk-WLJN7GIS.cjs.map +1 -0
  89. package/dist/chunk-YMLR375Z.js +1244 -0
  90. package/dist/chunk-YMLR375Z.js.map +1 -0
  91. package/dist/compliance/index.cjs +88 -0
  92. package/dist/compliance/index.cjs.map +1 -0
  93. package/dist/compliance/index.d.cts +470 -0
  94. package/dist/compliance/index.d.ts +470 -0
  95. package/dist/compliance/index.js +47 -0
  96. package/dist/compliance/index.js.map +1 -0
  97. package/dist/crypto.cjs +12 -136
  98. package/dist/crypto.cjs.map +1 -1
  99. package/dist/crypto.d.cts +4 -3
  100. package/dist/crypto.d.ts +4 -3
  101. package/dist/crypto.js +3 -137
  102. package/dist/crypto.js.map +1 -1
  103. package/dist/detectors/index.cjs +146 -1483
  104. package/dist/detectors/index.cjs.map +1 -1
  105. package/dist/detectors/index.d.cts +1 -1
  106. package/dist/detectors/index.d.ts +1 -1
  107. package/dist/detectors/index.js +3 -1449
  108. package/dist/detectors/index.js.map +1 -1
  109. package/dist/engine/index.cjs +441 -0
  110. package/dist/engine/index.cjs.map +1 -0
  111. package/dist/engine/index.d.cts +728 -0
  112. package/dist/engine/index.d.ts +728 -0
  113. package/dist/engine/index.js +189 -0
  114. package/dist/engine/index.js.map +1 -0
  115. package/dist/hash-2PSYNDMM.cjs +14 -0
  116. package/dist/hash-2PSYNDMM.cjs.map +1 -0
  117. package/dist/hash-CELLDNKN.js +5 -0
  118. package/dist/hash-CELLDNKN.js.map +1 -0
  119. package/dist/index.cjs +133 -2816
  120. package/dist/index.cjs.map +1 -1
  121. package/dist/index.d.cts +15 -8
  122. package/dist/index.d.ts +15 -8
  123. package/dist/index.js +13 -2791
  124. package/dist/index.js.map +1 -1
  125. package/dist/json-CBncvuY_.d.ts +147 -0
  126. package/dist/json-CkGYK7l4.d.cts +147 -0
  127. package/dist/mcp/index.cjs +751 -0
  128. package/dist/mcp/index.cjs.map +1 -0
  129. package/dist/mcp/index.d.cts +226 -0
  130. package/dist/mcp/index.d.ts +226 -0
  131. package/dist/mcp/index.js +744 -0
  132. package/dist/mcp/index.js.map +1 -0
  133. package/dist/middleware/express.cjs +93 -0
  134. package/dist/middleware/express.cjs.map +1 -0
  135. package/dist/middleware/express.d.cts +90 -0
  136. package/dist/middleware/express.d.ts +90 -0
  137. package/dist/middleware/express.js +91 -0
  138. package/dist/middleware/express.js.map +1 -0
  139. package/dist/middleware/hono.cjs +58 -0
  140. package/dist/middleware/hono.cjs.map +1 -0
  141. package/dist/middleware/hono.d.cts +75 -0
  142. package/dist/middleware/hono.d.ts +75 -0
  143. package/dist/middleware/hono.js +56 -0
  144. package/dist/middleware/hono.js.map +1 -0
  145. package/dist/middleware/index.cjs +24 -0
  146. package/dist/middleware/index.cjs.map +1 -0
  147. package/dist/middleware/index.d.cts +106 -0
  148. package/dist/middleware/index.d.ts +106 -0
  149. package/dist/middleware/index.js +15 -0
  150. package/dist/middleware/index.js.map +1 -0
  151. package/dist/schemas.cjs +5 -5
  152. package/dist/schemas.cjs.map +1 -1
  153. package/dist/schemas.d.cts +5 -5
  154. package/dist/schemas.d.ts +5 -5
  155. package/dist/schemas.js +5 -5
  156. package/dist/schemas.js.map +1 -1
  157. package/dist/session-B4lJTMrN.d.ts +102 -0
  158. package/dist/session-DP66OFAB.d.cts +102 -0
  159. package/dist/stream.cjs +13 -2262
  160. package/dist/stream.cjs.map +1 -1
  161. package/dist/stream.d.cts +1 -1
  162. package/dist/stream.d.ts +1 -1
  163. package/dist/stream.js +6 -2255
  164. package/dist/stream.js.map +1 -1
  165. package/dist/types-Bf8AbYPJ.d.ts +629 -0
  166. package/dist/types-Zt_bZvwS.d.cts +182 -0
  167. package/dist/types-Zt_bZvwS.d.ts +182 -0
  168. package/dist/types-_QrW2-Iq.d.cts +629 -0
  169. package/dist/{types-D-9HzVuy.d.cts → types-ipG-_Imf.d.cts} +2 -2
  170. package/dist/{types-D-9HzVuy.d.ts → types-ipG-_Imf.d.ts} +2 -2
  171. package/dist/validators.cjs +39 -181
  172. package/dist/validators.cjs.map +1 -1
  173. package/dist/validators.js +1 -174
  174. package/dist/validators.js.map +1 -1
  175. package/dist/vault/index.cjs +688 -0
  176. package/dist/vault/index.cjs.map +1 -0
  177. package/dist/vault/index.d.cts +385 -0
  178. package/dist/vault/index.d.ts +385 -0
  179. package/dist/vault/index.js +669 -0
  180. package/dist/vault/index.js.map +1 -0
  181. package/package.json +123 -10
package/CHANGELOG.md CHANGED
@@ -7,6 +7,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [Unreleased]
11
+
12
+ ---
13
+
14
+ ## [1.1.0-beta.0] — 2026-10-04
15
+
16
+ Pre-release, published under the `next` dist-tag: `npm install anonyma@next`.
17
+
18
+ Additive modernization. The 1.x functions (`anonymize`, `tokenize`, `anonymizeObject`,
19
+ the 1.x streams, `sanitizeForLLM`, …) keep their behaviour, apart from the fixes listed
20
+ under "Fixed".
21
+
22
+ The new subpath exports (`anonyma/engine`, `/vault`, `/audit`, `/compliance`, `/ai`,
23
+ `/mcp`, `/middleware`) are **experimental** until 1.1.0 is released: their APIs may
24
+ still change between pre-releases.
25
+
26
+ ### Added
27
+
28
+ - **`"anonyma/engine"`** — span-based engine. `createPipeline()` and `compilePipeline()`
29
+ build a reusable pipeline with `scan`, `test`, `transform` and `transformAsync`.
30
+ Overlapping detections are resolved so that no detected character is left in the
31
+ output, the confidence filter runs before overlap resolution, output is assembled in
32
+ one pass, and a synchronous transform throws `AsyncStrategyError` instead of
33
+ substituting another strategy. `createChunkTransformer()` and `createPipelineStream()`
34
+ detect values that are split across chunks.
35
+ - **Validating detectors** for email, US SSN, IBAN, IPv4, IPv6 and payment cards
36
+ (`emailDetector`, `ssnDetector`, `ibanDetector`, `ipv4Detector`, `ipv6Detector`,
37
+ `creditCardDetector`), plus `defineDetector()`, `defineRegexDetector()` and
38
+ `fromLegacyDetector()`. The 1.x detectors are available to the engine as
39
+ `LEGACY_DETECTORS`.
40
+ - **`"anonyma/vault"`** — `createSessionTokenizer()`, `createKeyedTokenizer()`,
41
+ `createSealedTokenizer()`, `createKeyRing()` (versioned keys, HKDF per purpose,
42
+ rotation, destruction), `createMemoryVault()`, `rewrapVault()`, `shredKey()`,
43
+ `restoreTokens()`, `tokenizeWith()`.
44
+ - **`"anonyma/audit"`** — `createAuditLogger()` (hash-chained records without personal
45
+ data), `verifyAuditChain()`, `memorySink()`, `lineSink()`, `summarizeSpans()`,
46
+ `inputChecksum()`.
47
+ - **`"anonyma/compliance"`** — `REGULATIONS` (GDPR, LGPD, PIPEDA, CCPA/CPRA, HIPAA,
48
+ PCI DSS with citations and coverage gaps), `parsePolicy()` / `checkPolicy()`,
49
+ `policyToSpec()`, `describeStrategy()`, `planErasure()`.
50
+ - **`"anonyma/ai"`** — `sanitizeJson()` / `sanitizeJsonAsync()`, `createLlmGuard()`,
51
+ `createRestoreStream()`, `restoreChunks()` with lenses, `restoreJsonText()`,
52
+ `toLanguageModelMiddleware()`.
53
+ - **`"anonyma/mcp"`** — MCP tool and resource declarations (`MCP_TOOLS`, `MCP_RESOURCES`,
54
+ `MCP_RESOURCE_TEMPLATES`) and a dependency-free server (`createMcpServer()`,
55
+ `serveStdio()`).
56
+ - **`"anonyma/middleware"`**, **`"anonyma/middleware/express"`**,
57
+ **`"anonyma/middleware/hono"`** — `createScrubber()`, `anonymaExpress()`, `anonymaHono()`.
58
+ - **Presets `lgpd` and `pipeda`.**
59
+ - **Error classes** `AsyncStrategyError`, `KeyManagementError`, `TokenVaultError`,
60
+ `PolicyError`, `AuditIntegrityError`.
61
+ - **`./package.json`** in the export map.
62
+ - **Benchmark** (`npm run bench`, `bench/`) and labelled detector corpora
63
+ (`tests/fixtures/corpus/`).
64
+ - Development dependencies `fast-check`, `express` and `hono` for property-based and
65
+ integration tests.
66
+
67
+ ### Changed
68
+
69
+ - **Preset `hipaa`** also detects `credit-card`, `iban`, `passport`, `license-plate` and
70
+ `social-media`; its description no longer claims to cover all 18 Safe Harbor
71
+ identifiers. **Preset `ccpa`** also detects `medical-record`, `health-insurance` and
72
+ `api-key`. Text processed with these presets may have more values replaced than
73
+ before.
74
+ - **Build:** entry points share code chunks (`splitting: true`). Every entry point now
75
+ uses the same class instances, so `instanceof AnonymaError` holds for errors thrown
76
+ by any subpath. The `dist/` layout gains `chunk-*.js` files.
77
+ - `PresetNotFoundError` lists the eight presets.
78
+ - **Releases** are built and published by GitHub Actions from a version tag, with an npm
79
+ provenance attestation, a GitHub build attestation and a CycloneDX SBOM attached to the
80
+ GitHub release.
81
+ - **Development** needs Node.js 22.22 or newer. The package still supports Node.js 18:
82
+ every release is installed and exercised on Node.js 18, 20, 22, 24 and 26.
83
+
84
+ ### Fixed
85
+
86
+ - **`hash()`, `encrypt()` and `decrypt()` on Node.js 18** threw because they read
87
+ `globalThis.crypto`, which that runtime does not define. They now fall back to the Web
88
+ Crypto implementation in `node:crypto`.
89
+ - **`detectDateOfBirth()`** dropped every date that preceded a date of a more confident
90
+ format (`"born 12/05/1987. Admitted on March 3, 2021."` lost the first date): its
91
+ overlap check compared positions instead of testing for intersection.
92
+ - **`mask()` with `preserveFormat`** and the generic **`synthesize()`** copied letters and
93
+ digits outside ASCII into their output. Letters and digits of every script are now
94
+ replaced.
95
+ - **`synthesize()`** no longer crashes, or returns `[object Undefined]`, for a category
96
+ named like an `Object.prototype` member (`constructor`, `toString`, …).
97
+
98
+ ---
99
+
10
100
  ## [1.0.0] — 2026-03-06
11
101
 
12
102
  ### Added
@@ -107,14 +197,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
107
197
  Six presets are available out of the box, each pre-configuring `enabledCategories` and
108
198
  `defaultStrategy`:
109
199
 
110
- | Preset | Default Strategy | Coverage |
111
- |---|---|---|
112
- | `"gdpr"` | `pseudonymize` | All personal data categories defined by the EU GDPR. |
113
- | `"hipaa"` | `redact` | All 18 HIPAA Safe Harbor identifiers for PHI de-identification. |
114
- | `"ccpa"` | `redact` | Consumer data categories defined by the California Consumer Privacy Act. |
115
- | `"pci-dss"` | `redact` (card numbers: `mask` keepTrailing 4) | Cardholder and sensitive authentication data per PCI-DSS. |
116
- | `"sox"` | `redact` | Financial records and corporate officer identifiers for SOX audit trails. |
117
- | `"ferpa"` | `redact` | Student education records as defined by FERPA. |
200
+ | Preset | Default Strategy | Coverage |
201
+ | ----------- | ---------------------------------------------- | ------------------------------------------------------------------------- |
202
+ | `"gdpr"` | `pseudonymize` | All personal data categories defined by the EU GDPR. |
203
+ | `"hipaa"` | `redact` | All 18 HIPAA Safe Harbor identifiers for PHI de-identification. |
204
+ | `"ccpa"` | `redact` | Consumer data categories defined by the California Consumer Privacy Act. |
205
+ | `"pci-dss"` | `redact` (card numbers: `mask` keepTrailing 4) | Cardholder and sensitive authentication data per PCI-DSS. |
206
+ | `"sox"` | `redact` | Financial records and corporate officer identifiers for SOX audit trails. |
207
+ | `"ferpa"` | `redact` | Student education records as defined by FERPA. |
118
208
 
119
209
  ---
120
210
 
@@ -174,71 +264,71 @@ individually for maximum tree-shaking. Twenty-seven categories are supported.
174
264
 
175
265
  **Email, Network & Identity**
176
266
 
177
- | Function | Confidence | Notes |
178
- |---|---|---|
179
- | `detectEmail` | 0.99 | RFC 5321 email addresses. |
180
- | `detectEmailAggressive` | 0.75 | Obfuscated formats, e.g. `user [at] example [dot] com`. |
181
- | `detectIpv4` | 0.98 | Dotted-decimal IPv4 with optional CIDR notation. |
182
- | `detectIpv6` | 0.98 | Full and compressed IPv6 addresses. |
183
- | `detectUrl` | 0.95 | http and https URLs with paths, query strings, and fragments. |
184
- | `detectApiKey` | — | Common API key patterns (hex strings, Bearer tokens, `sk-`/`pk-`/`ghp_`-prefixed keys, etc.). |
185
- | `detectSocialMedia` | — | Social media handles (`@username`) and profile URL patterns. |
267
+ | Function | Confidence | Notes |
268
+ | ----------------------- | ---------- | --------------------------------------------------------------------------------------------- |
269
+ | `detectEmail` | 0.99 | RFC 5321 email addresses. |
270
+ | `detectEmailAggressive` | 0.75 | Obfuscated formats, e.g. `user [at] example [dot] com`. |
271
+ | `detectIpv4` | 0.98 | Dotted-decimal IPv4 with optional CIDR notation. |
272
+ | `detectIpv6` | 0.98 | Full and compressed IPv6 addresses. |
273
+ | `detectUrl` | 0.95 | http and https URLs with paths, query strings, and fragments. |
274
+ | `detectApiKey` | — | Common API key patterns (hex strings, Bearer tokens, `sk-`/`pk-`/`ghp_`-prefixed keys, etc.). |
275
+ | `detectSocialMedia` | — | Social media handles (`@username`) and profile URL patterns. |
186
276
 
187
277
  **Phone & Identity Numbers**
188
278
 
189
- | Function | Confidence | Notes |
190
- |---|---|---|
191
- | `detectPhone` | 0.90 | North American + E.164 international formats. |
192
- | `detectPhoneAggressive` | 0.70 | 7-digit local formats (e.g. `555-1234`). |
193
- | `detectSsn` | 0.95 | US Social Security Numbers with format and known-invalid range exclusions. |
194
- | `detectSsnAggressive` | 0.80 | Expanded SSN pattern set. |
279
+ | Function | Confidence | Notes |
280
+ | ----------------------- | ---------- | -------------------------------------------------------------------------- |
281
+ | `detectPhone` | 0.90 | North American + E.164 international formats. |
282
+ | `detectPhoneAggressive` | 0.70 | 7-digit local formats (e.g. `555-1234`). |
283
+ | `detectSsn` | 0.95 | US Social Security Numbers with format and known-invalid range exclusions. |
284
+ | `detectSsnAggressive` | 0.80 | Expanded SSN pattern set. |
195
285
 
196
286
  **Financial**
197
287
 
198
- | Function | Confidence | Notes |
199
- |---|---|---|
200
- | `detectCreditCard` | 0.97 | 13–19 digit card numbers validated with the Luhn algorithm. |
201
- | `detectCreditCardAggressive` | 0.80 | Also catches masked formats `****-****-****-1234`. |
202
- | `detectIban` | 0.99 | IBAN strings validated with the ISO 13616 MOD-97 algorithm. |
203
- | `detectBankAccount` | — | Common bank account number formats. |
204
- | `detectCryptocurrency` | — | Bitcoin, Ethereum, and other common cryptocurrency wallet addresses. |
205
- | `detectTaxId` | — | US EIN and common international tax identification number formats. |
288
+ | Function | Confidence | Notes |
289
+ | ---------------------------- | ---------- | -------------------------------------------------------------------- |
290
+ | `detectCreditCard` | 0.97 | 13–19 digit card numbers validated with the Luhn algorithm. |
291
+ | `detectCreditCardAggressive` | 0.80 | Also catches masked formats `****-****-****-1234`. |
292
+ | `detectIban` | 0.99 | IBAN strings validated with the ISO 13616 MOD-97 algorithm. |
293
+ | `detectBankAccount` | — | Common bank account number formats. |
294
+ | `detectCryptocurrency` | — | Bitcoin, Ethereum, and other common cryptocurrency wallet addresses. |
295
+ | `detectTaxId` | — | US EIN and common international tax identification number formats. |
206
296
 
207
297
  **Personal Information**
208
298
 
209
- | Function | Confidence | Notes |
210
- |---|---|---|
211
- | `detectName` | 0.75 | Heuristic: catches names preceded by greeting/salutation keywords (`Dear`, `Hi`, `Hello`, `To`, `From`, `Patient`, `Client`, `Defendant`, etc.). Not an NLP-based named-entity recogniser. |
212
- | `detectNameAggressive` | 0.65 | Extends `detectName` with title-prefix patterns (`Mr.`, `Mrs.`, `Ms.`, `Dr.`, `Prof.`). |
213
- | `detectDateOfBirth` | 0.78–0.88 | ISO 8601, US (`MM/DD/YYYY`), European (`DD/MM/YYYY`), and long-form date patterns. |
214
- | `detectAddress` | — | Multi-line postal address patterns (street number, city, state/zip). |
215
- | `detectPassport` | — | Passport number formats for major issuing countries. |
216
- | `detectDriversLicense` | — | US and international driver's licence number patterns. |
217
- | `detectNationalId` | — | National identity document numbers (SSN-adjacent, Aadhaar, NINO, etc.). |
299
+ | Function | Confidence | Notes |
300
+ | ---------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
301
+ | `detectName` | 0.75 | Heuristic: catches names preceded by greeting/salutation keywords (`Dear`, `Hi`, `Hello`, `To`, `From`, `Patient`, `Client`, `Defendant`, etc.). Not an NLP-based named-entity recogniser. |
302
+ | `detectNameAggressive` | 0.65 | Extends `detectName` with title-prefix patterns (`Mr.`, `Mrs.`, `Ms.`, `Dr.`, `Prof.`). |
303
+ | `detectDateOfBirth` | 0.78–0.88 | ISO 8601, US (`MM/DD/YYYY`), European (`DD/MM/YYYY`), and long-form date patterns. |
304
+ | `detectAddress` | — | Multi-line postal address patterns (street number, city, state/zip). |
305
+ | `detectPassport` | — | Passport number formats for major issuing countries. |
306
+ | `detectDriversLicense` | — | US and international driver's licence number patterns. |
307
+ | `detectNationalId` | — | National identity document numbers (SSN-adjacent, Aadhaar, NINO, etc.). |
218
308
 
219
309
  **Healthcare**
220
310
 
221
- | Function | Notes |
222
- |---|---|
223
- | `detectMedicalRecord` | Medical record number (MRN) patterns. |
311
+ | Function | Notes |
312
+ | ----------------------- | ------------------------------------------------------ |
313
+ | `detectMedicalRecord` | Medical record number (MRN) patterns. |
224
314
  | `detectHealthInsurance` | Health insurance member ID and policy number patterns. |
225
- | `detectPrescription` | Prescription and DEA registration number patterns. |
315
+ | `detectPrescription` | Prescription and DEA registration number patterns. |
226
316
 
227
317
  **Vehicles & Transportation**
228
318
 
229
- | Function | Notes |
230
- |---|---|
231
- | `detectVin` | 17-character Vehicle Identification Numbers validated with the ISO 3779 mod-11 checksum. |
232
- | `detectVinAggressive` | Expanded VIN pattern set for partial or obfuscated VINs. |
233
- | `detectLicensePlate` | Common licence plate formats across multiple countries. |
234
- | `detectTrackingNumber` | Shipping tracking numbers (UPS, FedEx, USPS, DHL formats). |
319
+ | Function | Notes |
320
+ | ---------------------- | ---------------------------------------------------------------------------------------- |
321
+ | `detectVin` | 17-character Vehicle Identification Numbers validated with the ISO 3779 mod-11 checksum. |
322
+ | `detectVinAggressive` | Expanded VIN pattern set for partial or obfuscated VINs. |
323
+ | `detectLicensePlate` | Common licence plate formats across multiple countries. |
324
+ | `detectTrackingNumber` | Shipping tracking numbers (UPS, FedEx, USPS, DHL formats). |
235
325
 
236
326
  **Government & Legal**
237
327
 
238
- | Function | Notes |
239
- |---|---|
240
- | `detectCaseNumber` | Court case number formats (`YYYY-CV-NNNNN` and variants). |
241
- | `detectCompanyRegistration` | Company registration and incorporation number formats. |
328
+ | Function | Notes |
329
+ | --------------------------- | --------------------------------------------------------- |
330
+ | `detectCaseNumber` | Court case number formats (`YYYY-CV-NNNNN` and variants). |
331
+ | `detectCompanyRegistration` | Company registration and incorporation number formats. |
242
332
 
243
333
  **Registries**
244
334
 
@@ -253,23 +343,23 @@ individually for maximum tree-shaking. Twenty-seven categories are supported.
253
343
 
254
344
  #### `AnonymizeOptions` Reference
255
345
 
256
- | Option | Type | Default | Description |
257
- |---|---|---|---|
258
- | `rules` | `AnonymizationRule[]` | `[]` | Per-category strategy overrides. When non-empty, only listed categories are scanned. |
259
- | `defaultStrategy` | `StrategyOptions` | `{ strategy: "redact" }` | Strategy applied to any category not covered by `rules`. |
260
- | `includeMatches` | `boolean` | `false` | Include the `PiiMatch` array in the result. |
261
- | `customDetectors` | `Partial<Record<PiiCategory, Detector>>` | — | Replace built-in detectors on a per-category basis. |
262
- | `customPatterns` | `CustomPattern[]` | — | Ad-hoc `RegExp` patterns merged into the detection pipeline. Matches participate in standard overlap deduplication. |
263
- | `globalReplacement` | `string` | — | Replace every detected entity with this exact string, overriding all strategy settings. |
264
- | `consistentTokens` | `boolean` | `false` | Map repeated identical PII values to the same token within a single call (e.g. `EMAIL_1`, `EMAIL_1` for the same address appearing twice). Different values get different counters. |
265
- | `aggressive` | `boolean` | `false` | Switch to `AGGRESSIVE_DETECTOR_REGISTRY` for all built-in categories. |
266
- | `enabledCategories` | `Partial<Record<PiiCategory, boolean>>` | — | Convenience boolean map. Only categories set to `true` are active; `rules` takes precedence for categories it covers. |
267
- | `allowlist` | `string[]` | `[]` | Exact values to never anonymize (case-insensitive by default). |
268
- | `allowlistPatterns` | `RegExp[]` | `[]` | Regular expressions matched against detected values; matches are skipped. |
269
- | `allowlistCaseSensitive` | `boolean` | `false` | Make `allowlist` string matching case-sensitive. |
270
- | `confidenceThreshold` | `number` | `0` | Minimum confidence score `[0, 1]` for a match to be anonymized. |
271
- | `preset` | `CompliancePreset` | — | Apply a compliance preset as the base configuration. Explicit `rules` and `defaultStrategy` take precedence. |
272
- | `locales` | `Locale[]` | `["global"]` | Activate locale-specific detector patterns. Values: `"global"`, `"us"`, `"uk"`, `"eu"`, `"ca"`, `"au"`, `"br"`, `"in"`, `"cn"`, `"jp"`, `"kr"`, `"za"`. |
346
+ | Option | Type | Default | Description |
347
+ | ------------------------ | ---------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
348
+ | `rules` | `AnonymizationRule[]` | `[]` | Per-category strategy overrides. When non-empty, only listed categories are scanned. |
349
+ | `defaultStrategy` | `StrategyOptions` | `{ strategy: "redact" }` | Strategy applied to any category not covered by `rules`. |
350
+ | `includeMatches` | `boolean` | `false` | Include the `PiiMatch` array in the result. |
351
+ | `customDetectors` | `Partial<Record<PiiCategory, Detector>>` | — | Replace built-in detectors on a per-category basis. |
352
+ | `customPatterns` | `CustomPattern[]` | — | Ad-hoc `RegExp` patterns merged into the detection pipeline. Matches participate in standard overlap deduplication. |
353
+ | `globalReplacement` | `string` | — | Replace every detected entity with this exact string, overriding all strategy settings. |
354
+ | `consistentTokens` | `boolean` | `false` | Map repeated identical PII values to the same token within a single call (e.g. `EMAIL_1`, `EMAIL_1` for the same address appearing twice). Different values get different counters. |
355
+ | `aggressive` | `boolean` | `false` | Switch to `AGGRESSIVE_DETECTOR_REGISTRY` for all built-in categories. |
356
+ | `enabledCategories` | `Partial<Record<PiiCategory, boolean>>` | — | Convenience boolean map. Only categories set to `true` are active; `rules` takes precedence for categories it covers. |
357
+ | `allowlist` | `string[]` | `[]` | Exact values to never anonymize (case-insensitive by default). |
358
+ | `allowlistPatterns` | `RegExp[]` | `[]` | Regular expressions matched against detected values; matches are skipped. |
359
+ | `allowlistCaseSensitive` | `boolean` | `false` | Make `allowlist` string matching case-sensitive. |
360
+ | `confidenceThreshold` | `number` | `0` | Minimum confidence score `[0, 1]` for a match to be anonymized. |
361
+ | `preset` | `CompliancePreset` | — | Apply a compliance preset as the base configuration. Explicit `rules` and `defaultStrategy` take precedence. |
362
+ | `locales` | `Locale[]` | `["global"]` | Activate locale-specific detector patterns. Values: `"global"`, `"us"`, `"uk"`, `"eu"`, `"ca"`, `"au"`, `"br"`, `"in"`, `"cn"`, `"jp"`, `"kr"`, `"za"`. |
273
363
 
274
364
  ---
275
365
 
@@ -278,17 +368,17 @@ individually for maximum tree-shaking. Twenty-seven categories are supported.
278
368
  All errors extend `AnonymaError` and carry a machine-readable `code` string, enabling
279
369
  precise `switch`/`instanceof` error handling.
280
370
 
281
- | Class | Code | Extra Properties | When Thrown |
282
- |---|---|---|---|
283
- | `AnonymaError` | — | `code: string` | Base class; never thrown directly. |
284
- | `ValidationError` | `VALIDATION_ERROR` | `field: string` | A function argument fails validation (wrong type, out-of-range value, etc.). |
285
- | `UnsupportedStrategyError` | `UNSUPPORTED_STRATEGY` | `strategy: string` | An unrecognised strategy name is passed. |
286
- | `UnknownCategoryError` | `UNKNOWN_CATEGORY` | `category: string` | A rule or config references an unknown PII category. |
287
- | `CryptoNotAvailableError` | `CRYPTO_NOT_AVAILABLE` | — | `globalThis.crypto.subtle` is absent (Node < 18 or no polyfill). |
288
- | `EncryptionError` | `ENCRYPTION_ERROR` | `operation: "encrypt" \| "decrypt"` | The underlying AES-GCM operation fails (wrong key, corrupt ciphertext, etc.). |
289
- | `PresetNotFoundError` | `PRESET_NOT_FOUND` | `preset: string` | `getPreset()` is called with an unknown preset name. |
290
- | `AllowlistMatchError` | `ALLOWLIST_MATCH_ERROR` | `field: string` | An allowlist configuration entry is malformed. |
291
- | `BatchProcessingError` | `BATCH_PROCESSING_ERROR` | `succeeded`, `failed`, `total: number` | One or more items in a batch fail; carries partial result counts. |
371
+ | Class | Code | Extra Properties | When Thrown |
372
+ | -------------------------- | ------------------------ | -------------------------------------- | ----------------------------------------------------------------------------- |
373
+ | `AnonymaError` | — | `code: string` | Base class; never thrown directly. |
374
+ | `ValidationError` | `VALIDATION_ERROR` | `field: string` | A function argument fails validation (wrong type, out-of-range value, etc.). |
375
+ | `UnsupportedStrategyError` | `UNSUPPORTED_STRATEGY` | `strategy: string` | An unrecognised strategy name is passed. |
376
+ | `UnknownCategoryError` | `UNKNOWN_CATEGORY` | `category: string` | A rule or config references an unknown PII category. |
377
+ | `CryptoNotAvailableError` | `CRYPTO_NOT_AVAILABLE` | — | `globalThis.crypto.subtle` is absent (Node < 18 or no polyfill). |
378
+ | `EncryptionError` | `ENCRYPTION_ERROR` | `operation: "encrypt" \| "decrypt"` | The underlying AES-GCM operation fails (wrong key, corrupt ciphertext, etc.). |
379
+ | `PresetNotFoundError` | `PRESET_NOT_FOUND` | `preset: string` | `getPreset()` is called with an unknown preset name. |
380
+ | `AllowlistMatchError` | `ALLOWLIST_MATCH_ERROR` | `field: string` | An allowlist configuration entry is malformed. |
381
+ | `BatchProcessingError` | `BATCH_PROCESSING_ERROR` | `succeeded`, `failed`, `total: number` | One or more items in a batch fail; carries partial result counts. |
292
382
 
293
383
  ---
294
384
 
@@ -317,17 +407,17 @@ unavailable.
317
407
  Pure validation functions for PII checksum and format algorithms. All accept a string and
318
408
  return `boolean`.
319
409
 
320
- | Function | Algorithm / Standard | Notes |
321
- |---|---|---|
322
- | `luhn(digits)` | Luhn (ISO/IEC 7812) | Credit/debit card numbers and some national IDs. |
323
- | `verhoeff(digits)` | Verhoeff | Indian Aadhaar numbers and some other national IDs. |
324
- | `nhsMod11(value)` | NHS mod-11 | UK NHS 10-digit numbers (with or without spaces/hyphens). |
325
- | `cpfChecksum(value)` | Brazilian CPF | 11-digit CPF with two check digits; rejects all-same-digit sequences. |
326
- | `vinChecksum(vin)` | ISO 3779 mod-11 | 17-character Vehicle Identification Numbers. |
327
- | `deaChecksum(value)` | DEA mod-10 | US Drug Enforcement Administration registration numbers. |
328
- | `ibanMod97(value)` | ISO 13616 mod-97 | IBAN strings (15–34 characters, with or without spaces). |
329
- | `ninoValid(value)` | UK NINO format | UK National Insurance Numbers; rejects invalid letter prefixes. |
330
- | `aadhaarFormat(value)` | Aadhaar format | 12-digit Indian Aadhaar; does not start with `0` or `1`. |
410
+ | Function | Algorithm / Standard | Notes |
411
+ | ---------------------- | -------------------- | --------------------------------------------------------------------- |
412
+ | `luhn(digits)` | Luhn (ISO/IEC 7812) | Credit/debit card numbers and some national IDs. |
413
+ | `verhoeff(digits)` | Verhoeff | Indian Aadhaar numbers and some other national IDs. |
414
+ | `nhsMod11(value)` | NHS mod-11 | UK NHS 10-digit numbers (with or without spaces/hyphens). |
415
+ | `cpfChecksum(value)` | Brazilian CPF | 11-digit CPF with two check digits; rejects all-same-digit sequences. |
416
+ | `vinChecksum(vin)` | ISO 3779 mod-11 | 17-character Vehicle Identification Numbers. |
417
+ | `deaChecksum(value)` | DEA mod-10 | US Drug Enforcement Administration registration numbers. |
418
+ | `ibanMod97(value)` | ISO 13616 mod-97 | IBAN strings (15–34 characters, with or without spaces). |
419
+ | `ninoValid(value)` | UK NINO format | UK National Insurance Numbers; rejects invalid letter prefixes. |
420
+ | `aadhaarFormat(value)` | Aadhaar format | 12-digit Indian Aadhaar; does not start with `0` or `1`. |
331
421
 
332
422
  ---
333
423
 
@@ -351,22 +441,22 @@ Requires `zod` as a peer dependency. Import from `"anonyma/schemas"`.
351
441
 
352
442
  **Zod Schemas**
353
443
 
354
- | Export | Validates |
355
- |---|---|
356
- | `PiiCategorySchema` | All 27 `PiiCategory` string literals. |
357
- | `MaskOptionsSchema` | `MaskOptions` including `maskChar`, `keepLeading`, `keepTrailing`. |
358
- | `RedactOptionsSchema` | `RedactOptions` with `label`. |
359
- | `PseudonymizeOptionsSchema` | `PseudonymizeOptions` with `seed` and `prefix`. |
360
- | `HashOptionsSchema` | `HashOptions` with `truncate` and `pepper`. |
361
- | `GeneralizeOptionsSchema` | `GeneralizeOptions` with `bucketSize`. |
362
- | `StrategyOptionsSchema` | Discriminated union of all strategy option shapes. |
363
- | `PiiMatchSchema` | `PiiMatch` output object. |
364
- | `AnonymizeResultSchema` | `AnonymizeResult` with `text` and `matches`. |
365
- | `AnonymizationRuleSchema` | Single `{ category, strategy }` rule. |
366
- | `CustomPatternSchema` | `CustomPattern` with `pattern` (RegExp instance), `category`, `confidence`, `label`. |
367
- | `AnonymizeOptionsSchema` | Full `AnonymizeOptions` input object. |
368
- | `FieldRuleSchema` | Single field-level `{ strategy }` rule. |
369
- | `FieldRuleMapSchema` | `Record<string, FieldRule>` for `anonymizeRecord()`. |
444
+ | Export | Validates |
445
+ | --------------------------- | ------------------------------------------------------------------------------------ |
446
+ | `PiiCategorySchema` | All 27 `PiiCategory` string literals. |
447
+ | `MaskOptionsSchema` | `MaskOptions` including `maskChar`, `keepLeading`, `keepTrailing`. |
448
+ | `RedactOptionsSchema` | `RedactOptions` with `label`. |
449
+ | `PseudonymizeOptionsSchema` | `PseudonymizeOptions` with `seed` and `prefix`. |
450
+ | `HashOptionsSchema` | `HashOptions` with `truncate` and `pepper`. |
451
+ | `GeneralizeOptionsSchema` | `GeneralizeOptions` with `bucketSize`. |
452
+ | `StrategyOptionsSchema` | Discriminated union of all strategy option shapes. |
453
+ | `PiiMatchSchema` | `PiiMatch` output object. |
454
+ | `AnonymizeResultSchema` | `AnonymizeResult` with `text` and `matches`. |
455
+ | `AnonymizationRuleSchema` | Single `{ category, strategy }` rule. |
456
+ | `CustomPatternSchema` | `CustomPattern` with `pattern` (RegExp instance), `category`, `confidence`, `label`. |
457
+ | `AnonymizeOptionsSchema` | Full `AnonymizeOptions` input object. |
458
+ | `FieldRuleSchema` | Single field-level `{ strategy }` rule. |
459
+ | `FieldRuleMapSchema` | `Record<string, FieldRule>` for `anonymizeRecord()`. |
370
460
 
371
461
  **OpenAI / MCP Tool Definitions**
372
462
 
@@ -397,41 +487,41 @@ All Zod schema input/output types are re-exported as TypeScript types:
397
487
 
398
488
  All types are zero-cost, type-only exports (stripped by `tsc`; no runtime overhead).
399
489
 
400
- | Type | Description |
401
- |---|---|
402
- | `PiiCategory` | Union of all 27 supported category string literals. |
403
- | `PiiMatch` | `{ category, value, start, end, confidence }` — a single detected PII entity. |
404
- | `CustomPattern` | `{ pattern: RegExp; category?; confidence?; label? }` — ad-hoc detection pattern. |
405
- | `Locale` | `"global" \| "us" \| "uk" \| "eu" \| "ca" \| "au" \| "br" \| "in" \| "cn" \| "jp" \| "kr" \| "za"` |
406
- | `CompliancePreset` | `"gdpr" \| "hipaa" \| "ccpa" \| "pci-dss" \| "sox" \| "ferpa"` |
407
- | `StrategyName` | `"mask" \| "redact" \| "pseudonymize" \| "hash" \| "generalize" \| "tokenize" \| "encrypt" \| "synthesize"` |
408
- | `StrategyOptions` | Discriminated union of all per-strategy option shapes. |
409
- | `MaskOptions` | `{ maskChar?, keepLeading?, keepTrailing?, preserveFormat? }` |
410
- | `RedactOptions` | `{ label? }` |
411
- | `PseudonymizeOptions` | `{ seed?, prefix? }` |
412
- | `HashOptions` | `{ truncate?, pepper? }` |
413
- | `GeneralizeOptions` | `{ bucketSize? }` |
414
- | `EncryptOptions` | `{ passphrase?, keyBytes?, encoding? }` |
415
- | `SynthesizeOptions` | `{ seed?, locale? }` |
416
- | `AnonymizationRule` | `{ category: PiiCategory, strategy: StrategyOptions }` |
417
- | `AnonymizeOptions` | Full options accepted by `anonymize()` and `anonymizeAsync()`. |
418
- | `AnonymizeResult` | `{ text: string, matches: ReadonlyArray<PiiMatch> }` |
419
- | `TokenFormat` | `"angle" \| "bracket" \| "custom"` |
420
- | `TokenizeOptions` | Options for `tokenize()` including `categories`, `format`, `tokenTemplate`, `deterministic`, `aggressive`, `locales`, `confidenceThreshold`, `allowlist`. |
421
- | `TokenizeResult` | `{ text, mapping: ReadonlyMap<string, string>, tokens: TokenMatch[] }` |
422
- | `DetokenizeResult` | `{ text, replacedCount, unresolved: string[] }` |
423
- | `TokenMatch` | `{ token, original, category, start, end }` |
424
- | `BatchResult<T>` | Discriminated union: `{ index, ok: true, value: T } \| { index, ok: false, error: Error }` |
425
- | `FieldRule` | `{ strategy: StrategyOptions }` |
426
- | `FieldRuleMap` | `Record<string, FieldRule>` — dot-notation paths for `anonymizeRecord()`. |
427
- | `Detector` | `(text: string) => PiiMatch[]` — detector function signature. |
428
- | `DetectorRegistry` | `Record<PiiCategory, Detector>` |
429
- | `Anonymizer` | Interface returned by `createAnonymizer()`. |
430
- | `AnonymizerConfig` | Config accepted by `createAnonymizer()`. |
431
- | `AnonymaPlugin` | `{ name, detectors?, strategies?, validators? }` — plugin extension point. |
432
- | `ValidatorFunction` | `(value: string) => boolean` |
433
- | `StrategyFunction` | `(value: string, options?) => string` |
434
- | `PresetConfig` | Full configuration shape for a compliance preset. |
490
+ | Type | Description |
491
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
492
+ | `PiiCategory` | Union of all 27 supported category string literals. |
493
+ | `PiiMatch` | `{ category, value, start, end, confidence }` — a single detected PII entity. |
494
+ | `CustomPattern` | `{ pattern: RegExp; category?; confidence?; label? }` — ad-hoc detection pattern. |
495
+ | `Locale` | `"global" \| "us" \| "uk" \| "eu" \| "ca" \| "au" \| "br" \| "in" \| "cn" \| "jp" \| "kr" \| "za"` |
496
+ | `CompliancePreset` | `"gdpr" \| "hipaa" \| "ccpa" \| "pci-dss" \| "sox" \| "ferpa"` |
497
+ | `StrategyName` | `"mask" \| "redact" \| "pseudonymize" \| "hash" \| "generalize" \| "tokenize" \| "encrypt" \| "synthesize"` |
498
+ | `StrategyOptions` | Discriminated union of all per-strategy option shapes. |
499
+ | `MaskOptions` | `{ maskChar?, keepLeading?, keepTrailing?, preserveFormat? }` |
500
+ | `RedactOptions` | `{ label? }` |
501
+ | `PseudonymizeOptions` | `{ seed?, prefix? }` |
502
+ | `HashOptions` | `{ truncate?, pepper? }` |
503
+ | `GeneralizeOptions` | `{ bucketSize? }` |
504
+ | `EncryptOptions` | `{ passphrase?, keyBytes?, encoding? }` |
505
+ | `SynthesizeOptions` | `{ seed?, locale? }` |
506
+ | `AnonymizationRule` | `{ category: PiiCategory, strategy: StrategyOptions }` |
507
+ | `AnonymizeOptions` | Full options accepted by `anonymize()` and `anonymizeAsync()`. |
508
+ | `AnonymizeResult` | `{ text: string, matches: ReadonlyArray<PiiMatch> }` |
509
+ | `TokenFormat` | `"angle" \| "bracket" \| "custom"` |
510
+ | `TokenizeOptions` | Options for `tokenize()` including `categories`, `format`, `tokenTemplate`, `deterministic`, `aggressive`, `locales`, `confidenceThreshold`, `allowlist`. |
511
+ | `TokenizeResult` | `{ text, mapping: ReadonlyMap<string, string>, tokens: TokenMatch[] }` |
512
+ | `DetokenizeResult` | `{ text, replacedCount, unresolved: string[] }` |
513
+ | `TokenMatch` | `{ token, original, category, start, end }` |
514
+ | `BatchResult<T>` | Discriminated union: `{ index, ok: true, value: T } \| { index, ok: false, error: Error }` |
515
+ | `FieldRule` | `{ strategy: StrategyOptions }` |
516
+ | `FieldRuleMap` | `Record<string, FieldRule>` — dot-notation paths for `anonymizeRecord()`. |
517
+ | `Detector` | `(text: string) => PiiMatch[]` — detector function signature. |
518
+ | `DetectorRegistry` | `Record<PiiCategory, Detector>` |
519
+ | `Anonymizer` | Interface returned by `createAnonymizer()`. |
520
+ | `AnonymizerConfig` | Config accepted by `createAnonymizer()`. |
521
+ | `AnonymaPlugin` | `{ name, detectors?, strategies?, validators? }` — plugin extension point. |
522
+ | `ValidatorFunction` | `(value: string) => boolean` |
523
+ | `StrategyFunction` | `(value: string, options?) => string` |
524
+ | `PresetConfig` | Full configuration shape for a compliance preset. |
435
525
 
436
526
  ---
437
527
 
@@ -454,4 +544,5 @@ All types are zero-cost, type-only exports (stripped by `tsc`; no runtime overhe
454
544
  - **Prettier** code formatting.
455
545
  - **MIT License**.
456
546
 
547
+ [1.1.0-beta.0]: https://github.com/izaccavalheiro/anonyma/releases/tag/v1.1.0-beta.0
457
548
  [1.0.0]: https://github.com/izaccavalheiro/anonyma/releases/tag/v1.0.0