anonyma 1.1.1 → 1.2.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.
- package/CHANGELOG.md +109 -1
- package/README.md +125 -7
- package/dist/ai/index.cjs +31 -20
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +5 -5
- package/dist/ai/index.d.ts +5 -5
- package/dist/ai/index.js +24 -13
- package/dist/ai/index.js.map +1 -1
- package/dist/audit/index.cjs +14 -14
- package/dist/audit/index.d.cts +2 -2
- package/dist/audit/index.d.ts +2 -2
- package/dist/audit/index.js +9 -9
- package/dist/{chunk-YMLR375Z.js → chunk-264R3VFP.js} +4 -3
- package/dist/chunk-264R3VFP.js.map +1 -0
- package/dist/{chunk-ISL5B4LU.cjs → chunk-32U3DM7M.cjs} +11 -11
- package/dist/{chunk-ISL5B4LU.cjs.map → chunk-32U3DM7M.cjs.map} +1 -1
- package/dist/{chunk-ZXPZ7W37.cjs → chunk-42ZZZUMO.cjs} +231 -60
- package/dist/chunk-42ZZZUMO.cjs.map +1 -0
- package/dist/chunk-4BYN6GVK.js +213 -0
- package/dist/chunk-4BYN6GVK.js.map +1 -0
- package/dist/{chunk-JKW36IPT.js → chunk-A2OMTO3L.js} +4 -4
- package/dist/{chunk-JKW36IPT.js.map → chunk-A2OMTO3L.js.map} +1 -1
- package/dist/{chunk-TW7PM3UJ.cjs → chunk-AITKBKQX.cjs} +2 -2
- package/dist/{chunk-TW7PM3UJ.cjs.map → chunk-AITKBKQX.cjs.map} +1 -1
- package/dist/{chunk-G4AN7FND.js → chunk-BWE4O2ES.js} +23 -9
- package/dist/chunk-BWE4O2ES.js.map +1 -0
- package/dist/{chunk-GS3FRH4K.js → chunk-CMJXIEBA.js} +2 -2
- package/dist/chunk-CMJXIEBA.js.map +1 -0
- package/dist/{chunk-GYMG5OI3.cjs → chunk-ESVFPMG4.cjs} +2 -2
- package/dist/{chunk-GYMG5OI3.cjs.map → chunk-ESVFPMG4.cjs.map} +1 -1
- package/dist/{chunk-2YG7R4KJ.cjs → chunk-EUNLKSYP.cjs} +5 -5
- package/dist/{chunk-2YG7R4KJ.cjs.map → chunk-EUNLKSYP.cjs.map} +1 -1
- package/dist/{chunk-S7NH6CHY.cjs → chunk-F3BYJFUM.cjs} +5 -3
- package/dist/chunk-F3BYJFUM.cjs.map +1 -0
- package/dist/{chunk-IJAMLYOT.cjs → chunk-HDHQXVUM.cjs} +50 -36
- package/dist/chunk-HDHQXVUM.cjs.map +1 -0
- package/dist/{chunk-OGNLB2KA.js → chunk-HFAIBE3T.js} +3 -3
- package/dist/{chunk-OGNLB2KA.js.map → chunk-HFAIBE3T.js.map} +1 -1
- package/dist/{chunk-PKHZ7CVI.js → chunk-IBDFBUFZ.js} +2 -2
- package/dist/chunk-IBDFBUFZ.js.map +1 -0
- package/dist/{chunk-3CY6ATKS.cjs → chunk-JBH2EFFF.cjs} +36 -36
- package/dist/{chunk-3CY6ATKS.cjs.map → chunk-JBH2EFFF.cjs.map} +1 -1
- package/dist/chunk-JPU7KQZX.cjs +82 -0
- package/dist/{chunk-CRXRJZEV.cjs.map → chunk-JPU7KQZX.cjs.map} +1 -1
- package/dist/{chunk-E3PICZYI.js → chunk-KHT23UVV.js} +3 -3
- package/dist/{chunk-E3PICZYI.js.map → chunk-KHT23UVV.js.map} +1 -1
- package/dist/{chunk-2ZZHLCEJ.js → chunk-LAZIR73I.js} +18 -87
- package/dist/chunk-LAZIR73I.js.map +1 -0
- package/dist/{chunk-FB56NAAH.cjs → chunk-NO4ZCIM6.cjs} +19 -92
- package/dist/chunk-NO4ZCIM6.cjs.map +1 -0
- package/dist/{chunk-S4BJ2ADB.cjs → chunk-PCU6AG7H.cjs} +4 -4
- package/dist/{chunk-S4BJ2ADB.cjs.map → chunk-PCU6AG7H.cjs.map} +1 -1
- package/dist/{chunk-GBYHQQUY.js → chunk-PSZHBY5V.js} +221 -50
- package/dist/chunk-PSZHBY5V.js.map +1 -0
- package/dist/{chunk-6LDAIJBL.js → chunk-QBBJR7DZ.js} +2 -2
- package/dist/{chunk-6LDAIJBL.js.map → chunk-QBBJR7DZ.js.map} +1 -1
- package/dist/{chunk-3D5ZCJ7R.js → chunk-QHQ2AU45.js} +3 -3
- package/dist/{chunk-3D5ZCJ7R.js.map → chunk-QHQ2AU45.js.map} +1 -1
- package/dist/{chunk-IHEIYZPL.cjs → chunk-RJX27YEX.cjs} +2 -2
- package/dist/chunk-RJX27YEX.cjs.map +1 -0
- package/dist/{chunk-QYD4F6T7.cjs → chunk-ROXNQKOA.cjs} +2 -2
- package/dist/{chunk-QYD4F6T7.cjs.map → chunk-ROXNQKOA.cjs.map} +1 -1
- package/dist/chunk-SHEXFU6T.js +107 -0
- package/dist/chunk-SHEXFU6T.js.map +1 -0
- package/dist/chunk-T2KIN6VL.cjs +218 -0
- package/dist/chunk-T2KIN6VL.cjs.map +1 -0
- package/dist/{chunk-RCW5IPPR.js → chunk-UCT6HDUD.js} +3 -3
- package/dist/{chunk-RCW5IPPR.js.map → chunk-UCT6HDUD.js.map} +1 -1
- package/dist/chunk-UN74SYHV.cjs +115 -0
- package/dist/chunk-UN74SYHV.cjs.map +1 -0
- package/dist/{chunk-F7O2FA3F.cjs → chunk-VAO3Y3HZ.cjs} +7 -6
- package/dist/chunk-VAO3Y3HZ.cjs.map +1 -0
- package/dist/{chunk-BBJPQPGP.js → chunk-VE3OSDM7.js} +5 -3
- package/dist/chunk-VE3OSDM7.js.map +1 -0
- package/dist/{chunk-7HK2V5Q4.js → chunk-X7IVXKDE.js} +3 -3
- package/dist/{chunk-7HK2V5Q4.js.map → chunk-X7IVXKDE.js.map} +1 -1
- package/dist/{chunk-UA3EOFBS.cjs → chunk-XVCVIUZS.cjs} +8 -8
- package/dist/{chunk-UA3EOFBS.cjs.map → chunk-XVCVIUZS.cjs.map} +1 -1
- package/dist/{chunk-SIHPDZXA.js → chunk-YSTC7WRF.js} +2 -2
- package/dist/{chunk-SIHPDZXA.js.map → chunk-YSTC7WRF.js.map} +1 -1
- package/dist/compliance/index.cjs +15 -15
- package/dist/compliance/index.d.cts +4 -4
- package/dist/compliance/index.d.ts +4 -4
- package/dist/compliance/index.js +5 -5
- package/dist/crypto.cjs +4 -4
- package/dist/crypto.d.cts +1 -1
- package/dist/crypto.d.ts +1 -1
- package/dist/crypto.js +2 -2
- package/dist/detectors/index.cjs +38 -38
- package/dist/detectors/index.d.cts +1 -1
- package/dist/detectors/index.d.ts +1 -1
- package/dist/detectors/index.js +3 -3
- package/dist/engine/index.cjs +70 -70
- package/dist/engine/index.d.cts +3 -3
- package/dist/engine/index.d.ts +3 -3
- package/dist/engine/index.js +8 -8
- package/dist/hash-P2VGKVFP.cjs +14 -0
- package/dist/{hash-2PSYNDMM.cjs.map → hash-P2VGKVFP.cjs.map} +1 -1
- package/dist/hash-T6YJG3DU.js +5 -0
- package/dist/{hash-CELLDNKN.js.map → hash-T6YJG3DU.js.map} +1 -1
- package/dist/index.cjs +44 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -5
- package/dist/index.d.ts +23 -5
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/{json-CvKtPL8l.d.cts → json-BXN577tt.d.cts} +3 -2
- package/dist/{json-BruY_-tV.d.ts → json-BudrzkOQ.d.ts} +3 -2
- package/dist/mcp/index.cjs +29 -28
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +14 -13
- package/dist/mcp/index.js.map +1 -1
- package/dist/middleware/express.cjs +11 -11
- package/dist/middleware/express.d.cts +3 -3
- package/dist/middleware/express.d.ts +3 -3
- package/dist/middleware/express.js +10 -10
- package/dist/middleware/hono.cjs +11 -11
- package/dist/middleware/hono.d.cts +3 -3
- package/dist/middleware/hono.d.ts +3 -3
- package/dist/middleware/hono.js +10 -10
- package/dist/middleware/index.cjs +11 -11
- package/dist/middleware/index.d.cts +3 -3
- package/dist/middleware/index.d.ts +3 -3
- package/dist/middleware/index.js +10 -10
- package/dist/schemas.cjs +47 -47
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +2 -2
- package/dist/schemas.d.ts +2 -2
- package/dist/schemas.js +2 -2
- package/dist/schemas.js.map +1 -1
- package/dist/{session-CEFGgjFV.d.ts → session-CPXEQ2uC.d.cts} +18 -5
- package/dist/{session-DEQrPea7.d.cts → session-D3WMN6fE.d.ts} +18 -5
- package/dist/stream.cjs +10 -8
- package/dist/stream.cjs.map +1 -1
- package/dist/stream.d.cts +1 -1
- package/dist/stream.d.ts +1 -1
- package/dist/stream.js +7 -5
- package/dist/stream.js.map +1 -1
- package/dist/{types-oxllMFYF.d.ts → types-B3VjDuP8.d.cts} +2 -282
- package/dist/{types-D5BeXwnX.d.ts → types-DHAVKfzT.d.ts} +2 -2
- package/dist/types-LZHFEgx5.d.cts +1083 -0
- package/dist/types-LZHFEgx5.d.ts +1083 -0
- package/dist/{types-BtvX8QTd.d.cts → types-vmONSbz4.d.cts} +2 -2
- package/dist/{types-BL5UWH0y.d.cts → types-yZHnS7yv.d.ts} +2 -282
- package/dist/validators.cjs +10 -10
- package/dist/validators.js +1 -1
- package/dist/vault/index.cjs +65 -46
- package/dist/vault/index.cjs.map +1 -1
- package/dist/vault/index.d.cts +98 -5
- package/dist/vault/index.d.ts +98 -5
- package/dist/vault/index.js +11 -5
- package/dist/vault/index.js.map +1 -1
- package/package.json +16 -7
- package/dist/chunk-2ZZHLCEJ.js.map +0 -1
- package/dist/chunk-BBJPQPGP.js.map +0 -1
- package/dist/chunk-CRXRJZEV.cjs +0 -82
- package/dist/chunk-F7O2FA3F.cjs.map +0 -1
- package/dist/chunk-FB56NAAH.cjs.map +0 -1
- package/dist/chunk-G4AN7FND.js.map +0 -1
- package/dist/chunk-GBYHQQUY.js.map +0 -1
- package/dist/chunk-GS3FRH4K.js.map +0 -1
- package/dist/chunk-IHEIYZPL.cjs.map +0 -1
- package/dist/chunk-IJAMLYOT.cjs.map +0 -1
- package/dist/chunk-PKHZ7CVI.js.map +0 -1
- package/dist/chunk-S7NH6CHY.cjs.map +0 -1
- package/dist/chunk-YMLR375Z.js.map +0 -1
- package/dist/chunk-ZXPZ7W37.cjs.map +0 -1
- package/dist/hash-2PSYNDMM.cjs +0 -14
- package/dist/hash-CELLDNKN.js +0 -5
- package/dist/types-cbGVW8cD.d.cts +0 -592
- package/dist/types-cbGVW8cD.d.ts +0 -592
package/dist/stream.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stream.ts"],"names":["ValidationError","anonymize","anonymizeAsync","tokenize"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/stream.ts"],"names":["ValidationError","anonymize","anonymizeAsync","tokenize"],"mappings":";;;;;;;;;;;;AAiCA,SAAS,sBAAA,GAAiD;AACxD,EAAA,IAAI,OAAO,oBAAoB,WAAA,EAAa;AAC1C,IAAA,MAAM,IAAIA,iCAAA;AAAA,MACR,iBAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,eAAA;AACT;AAwBO,SAAS,qBAAA,CACd,OAAA,GAA4B,EAAC,EACa;AAC1C,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA4B;AAAA,IACrC,SAAA,CAAU,OAAO,UAAA,EAAkB;AACjC,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAIA,iCAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,UAAA,CAAW,OAAA,CAAQC,2BAAA,CAAU,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,IAC9C;AAAA,GACD,CAAA;AACH;AAaO,SAAS,0BAAA,CACd,OAAA,GAA4B,EAAC,EACa;AAC1C,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA4B;AAAA,IACrC,MAAM,SAAA,CAAU,KAAA,EAAO,UAAA,EAA2B;AAChD,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAID,iCAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,IAAI;AACF,QAAA,MAAM,MAAA,GAAS,MAAME,gCAAA,CAAe,KAAA,EAAO,OAAO,CAAA;AAClD,QAAA,UAAA,CAAW,QAAQ,MAAM,CAAA;AAAA,MAC3B,SAAS,GAAA,EAAK;AACZ,QAAA,UAAA,CAAW,MAAM,GAAG,CAAA;AAAA,MACtB;AAAA,IACF;AAAA,GACD,CAAA;AACH;AA4BO,SAAS,oBAAA,CACd,OAAA,GAA2B,EAAC,EACa;AACzC,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA2B;AAAA,IACpC,SAAA,CAAU,OAAO,UAAA,EAAkB;AACjC,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAIF,iCAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,UAAA,CAAW,OAAA,CAAQG,0BAAA,CAAS,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,IAC7C;AAAA,GACD,CAAA;AACH","file":"stream.cjs","sourcesContent":["/**\n * @module stream\n * @description Streaming support for anonyma via the WHATWG Streams API.\n *\n * Provides `TransformStream`-based wrappers so anonyma can be used in\n * Node.js stream pipelines and browser fetch-response chains.\n *\n * Requires Node ≥ 18 (global `TransformStream`) or a browser with Streams API.\n *\n * @example\n * ```ts\n * import { createAnonymizeStream } from \"anonyma/stream\";\n * import { createReadStream, createWriteStream } from \"node:fs\";\n *\n * const readable = ReadableStream.from(lines);\n * const anonymized = readable.pipeThrough(createAnonymizeStream());\n * for await (const chunk of anonymized) {\n * process.stdout.write(chunk);\n * }\n * ```\n */\n\nimport { anonymize, anonymizeAsync } from \"./anonymize.js\";\nimport { tokenize } from \"./tokenize.js\";\nimport { ValidationError } from \"./errors.js\";\nimport type {\n AnonymizeOptions,\n AnonymizeResult,\n TokenizeResult,\n TokenizeOptions,\n} from \"./types.js\";\n\n/** Require the global `TransformStream` (Node ≥ 18 / browsers). */\nfunction requireTransformStream(): typeof TransformStream {\n if (typeof TransformStream === \"undefined\") {\n throw new ValidationError(\n \"TransformStream\",\n \"is not available in this environment. Use Node.js ≥ 18 or a polyfill.\",\n );\n }\n return TransformStream;\n}\n\n// ---------------------------------------------------------------------------\n// Public: createAnonymizeStream()\n// ---------------------------------------------------------------------------\n\n/**\n * Create a `TransformStream` that anonymizes each string chunk it receives.\n *\n * Input chunks are expected to be complete text strings (e.g. lines or\n * paragraphs). For true streaming over arbitrary byte chunks, split on\n * line boundaries before piping.\n *\n * @param options - Anonymization options forwarded to {@link anonymize}.\n * @returns A `TransformStream<string, AnonymizeResult>`.\n *\n * @example\n * ```ts\n * const stream = createAnonymizeStream({ defaultStrategy: { strategy: \"mask\" } });\n * const reader = readable.pipeThrough(stream).getReader();\n * const { value } = await reader.read();\n * // value: { text: \"****\", matches: [] }\n * ```\n */\nexport function createAnonymizeStream(\n options: AnonymizeOptions = {},\n): TransformStream<string, AnonymizeResult> {\n const TS = requireTransformStream();\n return new TS<string, AnonymizeResult>({\n transform(chunk, controller): void {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n controller.enqueue(anonymize(chunk, options));\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public: createAnonymizeStreamAsync() — uses async strategies (hash/encrypt)\n// ---------------------------------------------------------------------------\n\n/**\n * Create an async-capable `TransformStream` that anonymizes each string chunk.\n * Supports `hash`, `encrypt`, and other async strategies.\n *\n * @param options - Anonymization options forwarded to {@link anonymizeAsync}.\n * @returns A `TransformStream<string, AnonymizeResult>`.\n */\nexport function createAnonymizeStreamAsync(\n options: AnonymizeOptions = {},\n): TransformStream<string, AnonymizeResult> {\n const TS = requireTransformStream();\n return new TS<string, AnonymizeResult>({\n async transform(chunk, controller): Promise<void> {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n try {\n const result = await anonymizeAsync(chunk, options);\n controller.enqueue(result);\n } catch (err) {\n controller.error(err);\n }\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public: createTokenizeStream()\n// ---------------------------------------------------------------------------\n\n/**\n * Create a `TransformStream` that tokenizes each string chunk it receives.\n *\n * Note: each chunk gets its **own** token map. If you need a shared map across\n * all chunks, manage the tokenization externally and feed results manually.\n *\n * @param options - Tokenization options forwarded to {@link tokenize}.\n * @returns A `TransformStream<string, TokenizeResult>`.\n *\n * @example\n * ```ts\n * const stream = createTokenizeStream({ categories: [\"email\"] });\n * const writer = stream.writable.getWriter();\n * const reader = stream.readable.getReader();\n *\n * writer.write(\"Contact alice@example.com\");\n * writer.close();\n *\n * const { value } = await reader.read();\n * // value: { text: \"Contact [EMAIL_0001]\", mapping: Map { ... } }\n * ```\n */\nexport function createTokenizeStream(\n options: TokenizeOptions = {},\n): TransformStream<string, TokenizeResult> {\n const TS = requireTransformStream();\n return new TS<string, TokenizeResult>({\n transform(chunk, controller): void {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n controller.enqueue(tokenize(chunk, options));\n },\n });\n}\n"]}
|
package/dist/stream.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnonymizeOptions, a as AnonymizeResult, T as TokenizeOptions, b as TokenizeResult } from './types-
|
|
1
|
+
import { A as AnonymizeOptions, a as AnonymizeResult, T as TokenizeOptions, b as TokenizeResult } from './types-LZHFEgx5.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @module stream
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnonymizeOptions, a as AnonymizeResult, T as TokenizeOptions, b as TokenizeResult } from './types-
|
|
1
|
+
import { A as AnonymizeOptions, a as AnonymizeResult, T as TokenizeOptions, b as TokenizeResult } from './types-LZHFEgx5.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @module stream
|
package/dist/stream.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { anonymize, anonymizeAsync, tokenize } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { anonymize, anonymizeAsync, tokenize } from './chunk-PSZHBY5V.js';
|
|
2
|
+
import './chunk-HFAIBE3T.js';
|
|
3
|
+
import './chunk-CMJXIEBA.js';
|
|
4
|
+
import './chunk-UCT6HDUD.js';
|
|
5
|
+
import './chunk-YSTC7WRF.js';
|
|
6
|
+
import './chunk-4BYN6GVK.js';
|
|
7
|
+
import './chunk-SHEXFU6T.js';
|
|
6
8
|
import { ValidationError } from './chunk-2F2GWGTB.js';
|
|
7
9
|
|
|
8
10
|
// src/stream.ts
|
package/dist/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/stream.ts"],"names":[],"mappings":";;;;;;;;;;AAiCA,SAAS,sBAAA,GAAiD;AACxD,EAAA,IAAI,OAAO,oBAAoB,WAAA,EAAa;AAC1C,IAAA,MAAM,IAAI,eAAA;AAAA,MACR,iBAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,eAAA;AACT;AAwBO,SAAS,qBAAA,CACd,OAAA,GAA4B,EAAC,EACa;AAC1C,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA4B;AAAA,IACrC,SAAA,CAAU,OAAO,UAAA,EAAkB;AACjC,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAI,eAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,UAAA,CAAW,OAAA,CAAQ,SAAA,CAAU,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,IAC9C;AAAA,GACD,CAAA;AACH;AAaO,SAAS,0BAAA,CACd,OAAA,GAA4B,EAAC,EACa;AAC1C,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA4B;AAAA,IACrC,MAAM,SAAA,CAAU,KAAA,EAAO,UAAA,EAA2B;AAChD,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAI,eAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,IAAI;AACF,QAAA,MAAM,MAAA,GAAS,MAAM,cAAA,CAAe,KAAA,EAAO,OAAO,CAAA;AAClD,QAAA,UAAA,CAAW,QAAQ,MAAM,CAAA;AAAA,MAC3B,SAAS,GAAA,EAAK;AACZ,QAAA,UAAA,CAAW,MAAM,GAAG,CAAA;AAAA,MACtB;AAAA,IACF;AAAA,GACD,CAAA;AACH;AA4BO,SAAS,oBAAA,CACd,OAAA,GAA2B,EAAC,EACa;AACzC,EAAA,MAAM,KAAK,sBAAA,EAAuB;AAClC,EAAA,OAAO,IAAI,EAAA,CAA2B;AAAA,IACpC,SAAA,CAAU,OAAO,UAAA,EAAkB;AACjC,MAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,QAAA,UAAA,CAAW,KAAA,CAAM,IAAI,eAAA,CAAgB,OAAA,EAAS,kBAAkB,CAAC,CAAA;AACjE,QAAA;AAAA,MACF;AACA,MAAA,UAAA,CAAW,OAAA,CAAQ,QAAA,CAAS,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,IAC7C;AAAA,GACD,CAAA;AACH","file":"stream.js","sourcesContent":["/**\n * @module stream\n * @description Streaming support for anonyma via the WHATWG Streams API.\n *\n * Provides `TransformStream`-based wrappers so anonyma can be used in\n * Node.js stream pipelines and browser fetch-response chains.\n *\n * Requires Node ≥ 18 (global `TransformStream`) or a browser with Streams API.\n *\n * @example\n * ```ts\n * import { createAnonymizeStream } from \"anonyma/stream\";\n * import { createReadStream, createWriteStream } from \"node:fs\";\n *\n * const readable = ReadableStream.from(lines);\n * const anonymized = readable.pipeThrough(createAnonymizeStream());\n * for await (const chunk of anonymized) {\n * process.stdout.write(chunk);\n * }\n * ```\n */\n\nimport { anonymize, anonymizeAsync } from \"./anonymize.js\";\nimport { tokenize } from \"./tokenize.js\";\nimport { ValidationError } from \"./errors.js\";\nimport type {\n AnonymizeOptions,\n AnonymizeResult,\n TokenizeResult,\n TokenizeOptions,\n} from \"./types.js\";\n\n/** Require the global `TransformStream` (Node ≥ 18 / browsers). */\nfunction requireTransformStream(): typeof TransformStream {\n if (typeof TransformStream === \"undefined\") {\n throw new ValidationError(\n \"TransformStream\",\n \"is not available in this environment. Use Node.js ≥ 18 or a polyfill.\",\n );\n }\n return TransformStream;\n}\n\n// ---------------------------------------------------------------------------\n// Public: createAnonymizeStream()\n// ---------------------------------------------------------------------------\n\n/**\n * Create a `TransformStream` that anonymizes each string chunk it receives.\n *\n * Input chunks are expected to be complete text strings (e.g. lines or\n * paragraphs). For true streaming over arbitrary byte chunks, split on\n * line boundaries before piping.\n *\n * @param options - Anonymization options forwarded to {@link anonymize}.\n * @returns A `TransformStream<string, AnonymizeResult>`.\n *\n * @example\n * ```ts\n * const stream = createAnonymizeStream({ defaultStrategy: { strategy: \"mask\" } });\n * const reader = readable.pipeThrough(stream).getReader();\n * const { value } = await reader.read();\n * // value: { text: \"****\", matches: [] }\n * ```\n */\nexport function createAnonymizeStream(\n options: AnonymizeOptions = {},\n): TransformStream<string, AnonymizeResult> {\n const TS = requireTransformStream();\n return new TS<string, AnonymizeResult>({\n transform(chunk, controller): void {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n controller.enqueue(anonymize(chunk, options));\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public: createAnonymizeStreamAsync() — uses async strategies (hash/encrypt)\n// ---------------------------------------------------------------------------\n\n/**\n * Create an async-capable `TransformStream` that anonymizes each string chunk.\n * Supports `hash`, `encrypt`, and other async strategies.\n *\n * @param options - Anonymization options forwarded to {@link anonymizeAsync}.\n * @returns A `TransformStream<string, AnonymizeResult>`.\n */\nexport function createAnonymizeStreamAsync(\n options: AnonymizeOptions = {},\n): TransformStream<string, AnonymizeResult> {\n const TS = requireTransformStream();\n return new TS<string, AnonymizeResult>({\n async transform(chunk, controller): Promise<void> {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n try {\n const result = await anonymizeAsync(chunk, options);\n controller.enqueue(result);\n } catch (err) {\n controller.error(err);\n }\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public: createTokenizeStream()\n// ---------------------------------------------------------------------------\n\n/**\n * Create a `TransformStream` that tokenizes each string chunk it receives.\n *\n * Note: each chunk gets its **own** token map. If you need a shared map across\n * all chunks, manage the tokenization externally and feed results manually.\n *\n * @param options - Tokenization options forwarded to {@link tokenize}.\n * @returns A `TransformStream<string, TokenizeResult>`.\n *\n * @example\n * ```ts\n * const stream = createTokenizeStream({ categories: [\"email\"] });\n * const writer = stream.writable.getWriter();\n * const reader = stream.readable.getReader();\n *\n * writer.write(\"Contact alice@example.com\");\n * writer.close();\n *\n * const { value } = await reader.read();\n * // value: { text: \"Contact [EMAIL_0001]\", mapping: Map { ... } }\n * ```\n */\nexport function createTokenizeStream(\n options: TokenizeOptions = {},\n): TransformStream<string, TokenizeResult> {\n const TS = requireTransformStream();\n return new TS<string, TokenizeResult>({\n transform(chunk, controller): void {\n if (typeof chunk !== \"string\") {\n controller.error(new ValidationError(\"chunk\", \"must be a string\"));\n return;\n }\n controller.enqueue(tokenize(chunk, options));\n },\n });\n}\n"]}
|
|
@@ -1,284 +1,4 @@
|
|
|
1
|
-
import { P as PiiCategory, E as EncryptOptions, C as CompliancePreset, S as StrategyOptions } from './types-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @module vault/types
|
|
5
|
-
* @description Contracts for deterministic tokenization, key management and
|
|
6
|
-
* token vaults exposed as `"anonyma/vault"`. This module contains types only —
|
|
7
|
-
* it has no runtime code.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* A value that may be returned directly or through a promise. Implementations
|
|
11
|
-
* backed by the Web Crypto API or by remote storage return promises; purely
|
|
12
|
-
* in-memory implementations may return plain values.
|
|
13
|
-
*/
|
|
14
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Context of the value being tokenized.
|
|
17
|
-
*/
|
|
18
|
-
interface TokenContext {
|
|
19
|
-
/** Category label of the value (e.g. `"email"`). */
|
|
20
|
-
readonly category: string;
|
|
21
|
-
/**
|
|
22
|
-
* Optional reference to the data subject the value belongs to. It is never
|
|
23
|
-
* stored in clear: vault-backed providers keep only a keyed digest of it, so
|
|
24
|
-
* that all tokens of one subject can later be erased.
|
|
25
|
-
*/
|
|
26
|
-
readonly subject?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Outcome of restoring the tokens found in a text.
|
|
30
|
-
*/
|
|
31
|
-
interface RestoreResult {
|
|
32
|
-
/** The text with every resolvable token replaced by its original value. */
|
|
33
|
-
readonly text: string;
|
|
34
|
-
/** Number of token occurrences that were restored. */
|
|
35
|
-
readonly restored: number;
|
|
36
|
-
/** Token occurrences that could not be resolved, in document order. */
|
|
37
|
-
readonly unresolved: readonly string[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Replaces values with tokens and, when the scheme is reversible, resolves
|
|
41
|
-
* tokens back to values.
|
|
42
|
-
*
|
|
43
|
-
* A provider is deterministic within its scope: the same category and value
|
|
44
|
-
* always yield the same token for the lifetime of a session provider, and for
|
|
45
|
-
* the lifetime of a key version for keyed providers.
|
|
46
|
-
*/
|
|
47
|
-
interface TokenizationProvider {
|
|
48
|
-
/** Identifier of the scheme, recorded in audit events (e.g. `"session"`, `"keyed"`, `"sealed"`). */
|
|
49
|
-
readonly scheme: string;
|
|
50
|
-
/** Whether {@link TokenizationProvider.detokenize} can recover original values. */
|
|
51
|
-
readonly reversible: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* A global regular expression that matches every token this provider can
|
|
54
|
-
* emit and nothing shorter than a whole token.
|
|
55
|
-
*/
|
|
56
|
-
readonly tokenPattern: RegExp;
|
|
57
|
-
/**
|
|
58
|
-
* A regular expression that matches, anchored at the end of a string, any
|
|
59
|
-
* proper prefix of a token (for example `[EMAIL_00`). Stream restoration
|
|
60
|
-
* uses it to hold back an incomplete token until the rest arrives. When it
|
|
61
|
-
* is absent, streams hold back the last `maxTokenLength - 1` characters.
|
|
62
|
-
*/
|
|
63
|
-
readonly partialTokenPattern?: RegExp;
|
|
64
|
-
/**
|
|
65
|
-
* Replace every token found in `text`. A provider implements it when it
|
|
66
|
-
* accepts more spellings of a token than `tokenPattern` matches (a session
|
|
67
|
-
* in lenient mode, for example); whole-text and stream restoration then go
|
|
68
|
-
* through it, so both accept the same spellings.
|
|
69
|
-
*/
|
|
70
|
-
readonly restore?: (text: string) => MaybePromise<RestoreResult>;
|
|
71
|
-
/** Upper bound on the length of a token, used for stream hold-back. */
|
|
72
|
-
readonly maxTokenLength: number;
|
|
73
|
-
/** Return the token for `value`, creating it if necessary. */
|
|
74
|
-
readonly tokenize: (value: string, context: TokenContext) => MaybePromise<string>;
|
|
75
|
-
/**
|
|
76
|
-
* Resolve one token. Returns `undefined` when the token is unknown, erased,
|
|
77
|
-
* expired, fails authentication, or the scheme is irreversible.
|
|
78
|
-
*/
|
|
79
|
-
readonly detokenize: (token: string) => MaybePromise<string | undefined>;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* What a derived key is used for. Every purpose gets an independent key, so a
|
|
83
|
-
* key is never used for two different algorithms.
|
|
84
|
-
*
|
|
85
|
-
* - `"token-id"`: HMAC-SHA-256 key that derives deterministic token identifiers.
|
|
86
|
-
* - `"token-seal"`: AES-256-GCM key that encrypts original values.
|
|
87
|
-
* - `"subject-tag"`: HMAC-SHA-256 key that derives data-subject tags.
|
|
88
|
-
* - `"audit-mac"`: HMAC-SHA-256 key that authenticates audit records.
|
|
89
|
-
*
|
|
90
|
-
* Every key of a version is gone once the version is destroyed. An audit log
|
|
91
|
-
* must stay verifiable after data keys are shredded, so take its `audit-mac`
|
|
92
|
-
* key from a key ring of its own, whose versions are retired but not destroyed.
|
|
93
|
-
*/
|
|
94
|
-
type KeyPurpose = "token-id" | "token-seal" | "subject-tag" | "audit-mac";
|
|
95
|
-
/**
|
|
96
|
-
* Lifecycle state of a key version.
|
|
97
|
-
*
|
|
98
|
-
* - `"active"`: used for new tokens and for decryption. Exactly one version is active.
|
|
99
|
-
* - `"retired"`: no longer used for new tokens; still available for decryption and verification.
|
|
100
|
-
* - `"destroyed"`: the key material has been discarded. Everything sealed under
|
|
101
|
-
* this version is permanently unrecoverable (crypto-shredding).
|
|
102
|
-
*/
|
|
103
|
-
type KeyState = "active" | "retired" | "destroyed";
|
|
104
|
-
/**
|
|
105
|
-
* Secret input from which the keys of one version are derived.
|
|
106
|
-
*/
|
|
107
|
-
type KeyMaterial = {
|
|
108
|
-
/** High-entropy secret bytes (at least 32). Used as HKDF input keying material. */
|
|
109
|
-
readonly kind: "raw";
|
|
110
|
-
readonly bytes: Uint8Array;
|
|
111
|
-
} | {
|
|
112
|
-
/** A passphrase, stretched with PBKDF2-HMAC-SHA-256 before HKDF. */
|
|
113
|
-
readonly kind: "passphrase";
|
|
114
|
-
readonly passphrase: string;
|
|
115
|
-
/** PBKDF2 iteration count. Defaults to 600,000 and may not be lower than 100,000. */
|
|
116
|
-
readonly iterations?: number;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Non-secret description of one key version. Safe to store next to the data.
|
|
120
|
-
*/
|
|
121
|
-
interface KeyVersionInfo {
|
|
122
|
-
/** Version identifier: 1–16 characters from `[A-Za-z0-9]`. Embedded in tokens. */
|
|
123
|
-
readonly id: string;
|
|
124
|
-
/** Lifecycle state. */
|
|
125
|
-
readonly state: KeyState;
|
|
126
|
-
/** Creation time, milliseconds since the Unix epoch. */
|
|
127
|
-
readonly createdAt: number;
|
|
128
|
-
/** Key-derivation function applied to the material before HKDF. */
|
|
129
|
-
readonly kdf: "hkdf" | "pbkdf2-hkdf";
|
|
130
|
-
/** Salt for this version, base64url. Random, at least 16 bytes, not secret. */
|
|
131
|
-
readonly salt: string;
|
|
132
|
-
/** PBKDF2 iteration count, present when `kdf` is `"pbkdf2-hkdf"`. */
|
|
133
|
-
readonly iterations?: number;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Non-secret description of a key ring. Together with the secret material of
|
|
137
|
-
* each live version it is sufficient to reconstruct the ring.
|
|
138
|
-
*/
|
|
139
|
-
interface KeyRingManifest {
|
|
140
|
-
/** Manifest format version. */
|
|
141
|
-
readonly v: 1;
|
|
142
|
-
/**
|
|
143
|
-
* Domain-separation label mixed into every derived key (tenant, dataset or
|
|
144
|
-
* environment). Two rings with different namespaces never produce the same
|
|
145
|
-
* token for the same value, even from identical material.
|
|
146
|
-
*/
|
|
147
|
-
readonly namespace: string;
|
|
148
|
-
/** Identifier of the active version. */
|
|
149
|
-
readonly activeKeyId: string;
|
|
150
|
-
/** All versions, oldest first. */
|
|
151
|
-
readonly versions: readonly KeyVersionInfo[];
|
|
152
|
-
/**
|
|
153
|
-
* HMAC-SHA-256 (base64url) under a key of the active version. It covers the
|
|
154
|
-
* namespace, the active version, and every version's identifier, creation
|
|
155
|
-
* time, derivation parameters and salt. A manifest whose MAC does not verify
|
|
156
|
-
* is refused.
|
|
157
|
-
*/
|
|
158
|
-
readonly mac: string;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* A set of versioned secrets with independent, purpose-bound derived keys.
|
|
162
|
-
*
|
|
163
|
-
* A key ring is a stateful object: {@link KeyRing.rotate} and
|
|
164
|
-
* {@link KeyRing.destroy} change it in place.
|
|
165
|
-
*/
|
|
166
|
-
interface KeyRing {
|
|
167
|
-
/** Identifier of the version used for new tokens. */
|
|
168
|
-
readonly activeKeyId: () => string;
|
|
169
|
-
/** The current non-secret manifest. */
|
|
170
|
-
readonly manifest: () => KeyRingManifest;
|
|
171
|
-
/**
|
|
172
|
-
* Derive the key of a version for a purpose. Derived keys are cached and
|
|
173
|
-
* non-extractable.
|
|
174
|
-
*
|
|
175
|
-
* @throws KeyManagementError When the version is unknown or destroyed.
|
|
176
|
-
*/
|
|
177
|
-
readonly deriveKey: (keyId: string, purpose: KeyPurpose) => Promise<CryptoKey>;
|
|
178
|
-
/**
|
|
179
|
-
* Add a new version and make it active. The previously active version
|
|
180
|
-
* becomes `"retired"`.
|
|
181
|
-
*
|
|
182
|
-
* @throws KeyManagementError When `id` is already in use or malformed.
|
|
183
|
-
*/
|
|
184
|
-
readonly rotate: (version: {
|
|
185
|
-
readonly id: string;
|
|
186
|
-
readonly material: KeyMaterial;
|
|
187
|
-
}) => Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* Discard the material of a retired version.
|
|
190
|
-
*
|
|
191
|
-
* @throws KeyManagementError When the version is unknown or is the active version.
|
|
192
|
-
*/
|
|
193
|
-
readonly destroy: (keyId: string) => void;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* One vault entry. It holds no plaintext: the original value is sealed with
|
|
197
|
-
* AES-256-GCM under the `token-seal` key of `keyId`.
|
|
198
|
-
*/
|
|
199
|
-
interface VaultRecord {
|
|
200
|
-
/** The token this record resolves. Primary key. */
|
|
201
|
-
readonly token: string;
|
|
202
|
-
/** Category label of the original value. */
|
|
203
|
-
readonly category: string;
|
|
204
|
-
/** Key version whose `token-seal` key sealed `sealed`. */
|
|
205
|
-
readonly keyId: string;
|
|
206
|
-
/** base64url of `iv (12 bytes) ‖ ciphertext ‖ tag (16 bytes)`. The token is bound as additional authenticated data. */
|
|
207
|
-
readonly sealed: string;
|
|
208
|
-
/**
|
|
209
|
-
* Keyed digest of the category and original value. It lets a provider tell
|
|
210
|
-
* a repeated value from an identifier collision without unsealing the record.
|
|
211
|
-
*/
|
|
212
|
-
readonly check?: string;
|
|
213
|
-
/**
|
|
214
|
-
* The data subjects this value was tokenized for. A value shared by several
|
|
215
|
-
* subjects has one record and one entry per subject; erasing any of them
|
|
216
|
-
* deletes the record.
|
|
217
|
-
*/
|
|
218
|
-
readonly subjects?: readonly SubjectReference[];
|
|
219
|
-
/** Creation time, milliseconds since the Unix epoch. Bound to `sealed`. */
|
|
220
|
-
readonly createdAt: number;
|
|
221
|
-
/**
|
|
222
|
-
* Expiry time, milliseconds since the Unix epoch. Expired records do not
|
|
223
|
-
* resolve. Bound to `sealed`: a record whose expiry was changed or removed
|
|
224
|
-
* no longer resolves.
|
|
225
|
-
*/
|
|
226
|
-
readonly expiresAt?: number;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* One data subject of a vault record. It holds no plaintext.
|
|
230
|
-
*/
|
|
231
|
-
interface SubjectReference {
|
|
232
|
-
/** Keyed digest of the data-subject reference under the `subject-tag` key of the record's `keyId`. */
|
|
233
|
-
readonly tag: string;
|
|
234
|
-
/**
|
|
235
|
-
* The data-subject reference sealed under the `token-seal` key of the
|
|
236
|
-
* record's `keyId`. Key rotation unseals it to recompute `tag` under the new
|
|
237
|
-
* version, so erasure by subject keeps working after old versions are destroyed.
|
|
238
|
-
*/
|
|
239
|
-
readonly sealed: string;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Storage for {@link VaultRecord}s. Implement this interface to keep the
|
|
243
|
-
* vault in Redis, a SQL table, a KV store, and so on.
|
|
244
|
-
*/
|
|
245
|
-
interface TokenVault {
|
|
246
|
-
/** Fetch the record of a token. */
|
|
247
|
-
readonly get: (token: string) => MaybePromise<VaultRecord | undefined>;
|
|
248
|
-
/**
|
|
249
|
-
* Store `record` unless a record with the same token already exists.
|
|
250
|
-
* Returns the record that is stored after the call (the existing one or the new one).
|
|
251
|
-
*/
|
|
252
|
-
readonly putIfAbsent: (record: VaultRecord) => MaybePromise<VaultRecord>;
|
|
253
|
-
/**
|
|
254
|
-
* Overwrite the record of `record.token`, but only while the stored record
|
|
255
|
-
* still is `expected` (same `keyId`, `sealed` and `subjects`). Returns
|
|
256
|
-
* `false`, and stores nothing, when the record was deleted or changed in the
|
|
257
|
-
* meantime. It never creates a record: an erasure that runs at the same time
|
|
258
|
-
* as a key rotation must win.
|
|
259
|
-
*/
|
|
260
|
-
readonly replace: (record: VaultRecord, expected: VaultRecord) => MaybePromise<boolean>;
|
|
261
|
-
/** Delete the record of a token. Returns `true` when a record was deleted. */
|
|
262
|
-
readonly delete: (token: string) => MaybePromise<boolean>;
|
|
263
|
-
/** Enumerate all records. Required for key rotation and erasure by subject. */
|
|
264
|
-
readonly list: () => AsyncIterable<VaultRecord> | Iterable<VaultRecord>;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Proof that an erasure request was executed. It contains no personal data and
|
|
268
|
-
* is meant to be written to the audit log.
|
|
269
|
-
*/
|
|
270
|
-
interface ErasureReceipt {
|
|
271
|
-
/** How the erasure was carried out. */
|
|
272
|
-
readonly method: "vault-delete" | "crypto-shred";
|
|
273
|
-
/** Number of vault records removed (`vault-delete`) or rendered unrecoverable (`crypto-shred`). */
|
|
274
|
-
readonly erased: number;
|
|
275
|
-
/** Key versions involved. */
|
|
276
|
-
readonly keyIds: readonly string[];
|
|
277
|
-
/** Keyed digest of the data-subject reference, for `vault-delete` by subject. */
|
|
278
|
-
readonly subjectTag?: string;
|
|
279
|
-
/** Completion time, milliseconds since the Unix epoch. */
|
|
280
|
-
readonly completedAt: number;
|
|
281
|
-
}
|
|
1
|
+
import { P as PiiCategory, c as TokenizationProvider, E as EncryptOptions, C as CompliancePreset, S as StrategyOptions } from './types-LZHFEgx5.cjs';
|
|
282
2
|
|
|
283
3
|
/**
|
|
284
4
|
* @module engine/types
|
|
@@ -626,4 +346,4 @@ interface CompileDependencies {
|
|
|
626
346
|
};
|
|
627
347
|
}
|
|
628
348
|
|
|
629
|
-
export type { AsyncChunkTransformer as A, Category as C, DetectedSpan as D,
|
|
349
|
+
export type { AsyncChunkTransformer as A, Category as C, DetectedSpan as D, EmitSpan as E, OverlapPolicy as O, PatternSpec as P, Replacer as R, StrategySpec as S, TransformResult as T, Pipeline as a, PipelineSpec as b, AppliedSpan as c, SpanDetector as d, PipelineOptions as e, CompileDependencies as f, ChunkOptions as g, ChunkTransformer as h, AllowRule as i, ReplaceContext as j, ReplacementPlan as k };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PiiCategory } from './types-
|
|
2
|
-
import { S as StrategySpec, P as PatternSpec, O as OverlapPolicy } from './types-
|
|
1
|
+
import { P as PiiCategory } from './types-LZHFEgx5.js';
|
|
2
|
+
import { S as StrategySpec, P as PatternSpec, O as OverlapPolicy } from './types-yZHnS7yv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @module compliance/types
|