@stll/anonymize 2.8.2 → 2.9.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/README.md +35 -20
- package/dist/build-native-package.d.mts +14 -0
- package/dist/build-native-package.mjs +2 -0
- package/dist/build-native-package2.mjs +211 -0
- package/dist/build-native-package2.mjs.map +1 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +3 -3
- package/dist/native-node.d.mts +14 -2
- package/dist/native-node.mjs +3 -3
- package/dist/native-node2.d.mts +3 -3
- package/dist/native-node2.mjs +114 -141
- package/dist/native-node2.mjs.map +1 -1
- package/dist/native-runtime.d.mts +2 -2
- package/dist/native-runtime.mjs +1 -1
- package/dist/native.d.mts +8 -428
- package/dist/native.mjs +187 -18
- package/dist/native.mjs.map +1 -1
- package/dist/native2.d.mts +2 -2
- package/dist/types.d.mts +429 -0
- package/native-pipeline.cs.stlanonpkg +0 -0
- package/native-pipeline.de.stlanonpkg +0 -0
- package/native-pipeline.en.stlanonpkg +0 -0
- package/native-pipeline.stlanonpkg +0 -0
- package/package.json +7 -13
- package/scripts/build-native-pipeline-package.mjs +22 -10
package/dist/native.mjs
CHANGED
|
@@ -67,6 +67,11 @@ const isNativeAnonymizeBinding = (candidate) => {
|
|
|
67
67
|
return isBindingPropertyBag(preparedSearch) && NATIVE_BINDING_PARITY_MEMBERS.factories.every((name) => typeof preparedSearch[name] === "function");
|
|
68
68
|
};
|
|
69
69
|
const CALLER_DETECTION_CONTRACT_VERSION = 2;
|
|
70
|
+
const CALLER_DETECTION_MAX_COUNT = 1e6;
|
|
71
|
+
const CALLER_DETECTION_TEXT_MAX_BYTES = 64 * 1024 * 1024;
|
|
72
|
+
const CALLER_DETECTION_REQUEST_JSON_MAX_BYTES = 16 * 1024 * 1024;
|
|
73
|
+
const SESSION_CALLER_MAX_INPUTS = 1e5;
|
|
74
|
+
const SESSION_CALLER_INPUTS_JSON_MAX_BYTES = 64 * 1024 * 1024;
|
|
70
75
|
const EXTERNAL_DETECTION_BATCH_VERSION = 1;
|
|
71
76
|
const EXTERNAL_DETECTION_BATCH_MAX_BYTES = 16 * 1024 * 1024;
|
|
72
77
|
const EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES = 64 * 1024 * 1024;
|
|
@@ -82,17 +87,184 @@ const EXTERNAL_DETECTION_OFFSET_UNITS = {
|
|
|
82
87
|
const convert_external_detection_batch = ({ binding, document, batch }) => {
|
|
83
88
|
return binding.convertExternalDetectionBatch(document, typeof batch === "string" ? batch : JSON.stringify(batch));
|
|
84
89
|
};
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
const utf8ByteLengthWithin = (text, maximum) => {
|
|
91
|
+
let bytes = 0;
|
|
92
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
93
|
+
const unit = text.charCodeAt(index);
|
|
94
|
+
if (unit <= 127) bytes += 1;
|
|
95
|
+
else if (unit <= 2047) bytes += 2;
|
|
96
|
+
else if (unit >= 55296 && unit <= 56319 && index + 1 < text.length && text.charCodeAt(index + 1) >= 56320 && text.charCodeAt(index + 1) <= 57343) {
|
|
97
|
+
bytes += 4;
|
|
98
|
+
index += 1;
|
|
99
|
+
} else bytes += 3;
|
|
100
|
+
if (bytes > maximum) return;
|
|
101
|
+
}
|
|
102
|
+
return bytes;
|
|
103
|
+
};
|
|
104
|
+
const validateCallerDetectionInput = (fullText, detections) => {
|
|
105
|
+
if (!Array.isArray(detections)) throw new TypeError("Caller detections must be an array");
|
|
106
|
+
if (detections.length > 1e6) throw new RangeError(`Caller detections contains ${detections.length} items; the maximum is ${CALLER_DETECTION_MAX_COUNT}`);
|
|
107
|
+
const textBytes = utf8ByteLengthWithin(fullText, CALLER_DETECTION_TEXT_MAX_BYTES);
|
|
108
|
+
if (textBytes === void 0) throw new RangeError(`Caller detection text exceeds the ${CALLER_DETECTION_TEXT_MAX_BYTES}-byte maximum`);
|
|
109
|
+
return textBytes;
|
|
110
|
+
};
|
|
111
|
+
var BoundedJsonSink = class {
|
|
112
|
+
#maximumBytes;
|
|
113
|
+
#label;
|
|
114
|
+
#reportedMaximumBytes;
|
|
115
|
+
#bytes = 0;
|
|
116
|
+
constructor(maximumBytes, label, suffix) {
|
|
117
|
+
this.#maximumBytes = maximumBytes - suffix.length;
|
|
118
|
+
this.#label = label;
|
|
119
|
+
this.#reportedMaximumBytes = maximumBytes;
|
|
120
|
+
}
|
|
121
|
+
appendAscii(value) {
|
|
122
|
+
this.#reserve(value.length);
|
|
123
|
+
this.capture(value);
|
|
124
|
+
}
|
|
125
|
+
appendOffset(value, field) {
|
|
126
|
+
this.#requireNumber(value, field);
|
|
127
|
+
if (!Number.isInteger(value) || value < 0 || value > 4294967295) throw new RangeError(`${field} must be an integer between 0 and 4294967295`);
|
|
128
|
+
this.#appendNumber(value);
|
|
129
|
+
}
|
|
130
|
+
appendScore(value, field) {
|
|
131
|
+
this.#requireNumber(value, field);
|
|
132
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) throw new RangeError(`${field} must be finite and between 0 and 1`);
|
|
133
|
+
this.#appendNumber(value);
|
|
134
|
+
}
|
|
135
|
+
appendString(value, field) {
|
|
136
|
+
if (typeof value !== "string") throw new TypeError(`${field} must be a string`);
|
|
137
|
+
this.appendAscii("\"");
|
|
138
|
+
let runStart = 0;
|
|
139
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
140
|
+
const unit = value.charCodeAt(index);
|
|
141
|
+
const escape = jsonEscape(unit);
|
|
142
|
+
if (escape !== void 0) {
|
|
143
|
+
this.#appendReservedRun(value, runStart, index);
|
|
144
|
+
this.appendAscii(escape);
|
|
145
|
+
runStart = index + 1;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (unit >= 55296 && unit <= 56319 && index + 1 < value.length && value.charCodeAt(index + 1) >= 56320 && value.charCodeAt(index + 1) <= 57343) {
|
|
149
|
+
this.#reserve(4);
|
|
150
|
+
index += 1;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (unit >= 55296 && unit <= 57343) {
|
|
154
|
+
this.#appendReservedRun(value, runStart, index);
|
|
155
|
+
this.appendAscii(`\\u${unit.toString(16).padStart(4, "0")}`);
|
|
156
|
+
runStart = index + 1;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
let unitBytes = 3;
|
|
160
|
+
if (unit <= 127) unitBytes = 1;
|
|
161
|
+
else if (unit <= 2047) unitBytes = 2;
|
|
162
|
+
this.#reserve(unitBytes);
|
|
163
|
+
}
|
|
164
|
+
this.#appendReservedRun(value, runStart, value.length);
|
|
165
|
+
this.appendAscii("\"");
|
|
166
|
+
}
|
|
167
|
+
#appendReservedRun(value, start, end) {
|
|
168
|
+
if (end > start) this.capture(value.slice(start, end));
|
|
169
|
+
}
|
|
170
|
+
#appendNumber(value) {
|
|
171
|
+
this.appendAscii(JSON.stringify(value));
|
|
172
|
+
}
|
|
173
|
+
#requireNumber(value, field) {
|
|
174
|
+
if (typeof value !== "number") throw new TypeError(`${field} must be a number`);
|
|
175
|
+
}
|
|
176
|
+
#reserve(bytes) {
|
|
177
|
+
if (bytes > this.#maximumBytes - this.#bytes) throw new RangeError(`${this.#label} exceeds the ${this.#reportedMaximumBytes}-byte maximum`);
|
|
178
|
+
this.#bytes += bytes;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var CountingJsonBudget = class extends BoundedJsonSink {
|
|
182
|
+
capture(value) {}
|
|
183
|
+
};
|
|
184
|
+
var BoundedJsonWriter = class extends BoundedJsonSink {
|
|
185
|
+
#chunks = [];
|
|
186
|
+
#suffix;
|
|
187
|
+
constructor(maximumBytes, label, suffix) {
|
|
188
|
+
super(maximumBytes, label, suffix);
|
|
189
|
+
this.#suffix = suffix;
|
|
190
|
+
}
|
|
191
|
+
finish() {
|
|
192
|
+
return this.#chunks.join("") + this.#suffix;
|
|
193
|
+
}
|
|
194
|
+
capture(value) {
|
|
195
|
+
this.#chunks.push(value);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const jsonEscape = (unit) => {
|
|
199
|
+
switch (unit) {
|
|
200
|
+
case 8: return "\\b";
|
|
201
|
+
case 9: return "\\t";
|
|
202
|
+
case 10: return "\\n";
|
|
203
|
+
case 12: return "\\f";
|
|
204
|
+
case 13: return "\\r";
|
|
205
|
+
case 34: return "\\\"";
|
|
206
|
+
case 92: return "\\\\";
|
|
207
|
+
default: return unit < 32 ? `\\u${unit.toString(16).padStart(4, "0")}` : void 0;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const callerDetectionRequestJson = (fullText, detections) => {
|
|
211
|
+
validateCallerDetectionInput(fullText, detections);
|
|
212
|
+
return serializeCallerDetectionRequest(detections);
|
|
213
|
+
};
|
|
214
|
+
const serializeCallerDetectionRequest = (detections) => {
|
|
215
|
+
const writer = new BoundedJsonWriter(CALLER_DETECTION_REQUEST_JSON_MAX_BYTES, "Caller detection request JSON", "]}");
|
|
216
|
+
writer.appendAscii(`{"version":2,"detections":[`);
|
|
217
|
+
for (let index = 0; index < detections.length; index += 1) {
|
|
218
|
+
const detection = detections[index];
|
|
219
|
+
if (detection === void 0) throw new TypeError("Caller detections must not be sparse");
|
|
220
|
+
if (index > 0) writer.appendAscii(",");
|
|
221
|
+
writer.appendAscii("{\"start\":");
|
|
222
|
+
writer.appendOffset(detection.start, "Caller detection start");
|
|
223
|
+
writer.appendAscii(",\"end\":");
|
|
224
|
+
writer.appendOffset(detection.end, "Caller detection end");
|
|
225
|
+
writer.appendAscii(",\"label\":");
|
|
226
|
+
writer.appendString(detection.label, "Caller detection label");
|
|
227
|
+
writer.appendAscii(",\"score\":");
|
|
228
|
+
writer.appendScore(detection.score, "Caller detection score");
|
|
229
|
+
writer.appendAscii(",\"provider_id\":");
|
|
230
|
+
writer.appendString(detection.providerId, "Caller detection providerId");
|
|
231
|
+
writer.appendAscii(",\"detection_id\":");
|
|
232
|
+
writer.appendString(detection.detectionId, "Caller detection detectionId");
|
|
233
|
+
writer.appendAscii("}");
|
|
234
|
+
}
|
|
235
|
+
return writer.finish();
|
|
236
|
+
};
|
|
237
|
+
const toBindingSessionCallerInputs = (inputs) => {
|
|
238
|
+
if (!Array.isArray(inputs)) throw new TypeError("Session caller inputs must be an array");
|
|
239
|
+
if (inputs.length > 1e5) throw new RangeError(`Session caller inputs contains ${inputs.length} items; the maximum is ${SESSION_CALLER_MAX_INPUTS}`);
|
|
240
|
+
let detectionCount = 0;
|
|
241
|
+
let textBytes = 0;
|
|
242
|
+
const bindingInputs = [];
|
|
243
|
+
const budget = new CountingJsonBudget(SESSION_CALLER_INPUTS_JSON_MAX_BYTES, "Session caller inputs JSON", "]");
|
|
244
|
+
budget.appendAscii("[");
|
|
245
|
+
for (let index = 0; index < inputs.length; index += 1) {
|
|
246
|
+
const input = inputs[index];
|
|
247
|
+
if (input === void 0) throw new TypeError("Session caller inputs must not be sparse");
|
|
248
|
+
const { detections, fullText } = input;
|
|
249
|
+
const inputTextBytes = validateCallerDetectionInput(fullText, detections);
|
|
250
|
+
detectionCount += detections.length;
|
|
251
|
+
if (detectionCount > 1e6) throw new RangeError(`Session caller detections contains ${detectionCount} items; the maximum is ${CALLER_DETECTION_MAX_COUNT}`);
|
|
252
|
+
textBytes += inputTextBytes;
|
|
253
|
+
if (textBytes > 67108864) throw new RangeError(`Session caller text contains ${textBytes} bytes; the maximum is ${CALLER_DETECTION_TEXT_MAX_BYTES}`);
|
|
254
|
+
const requestJson = serializeCallerDetectionRequest(detections);
|
|
255
|
+
if (index > 0) budget.appendAscii(",");
|
|
256
|
+
budget.appendAscii("{\"full_text\":");
|
|
257
|
+
budget.appendString(fullText, "Session caller fullText");
|
|
258
|
+
budget.appendAscii(",\"request_json\":");
|
|
259
|
+
budget.appendString(requestJson, "Session caller requestJson");
|
|
260
|
+
budget.appendAscii("}");
|
|
261
|
+
bindingInputs.push({
|
|
262
|
+
fullText,
|
|
263
|
+
requestJson
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return bindingInputs;
|
|
267
|
+
};
|
|
96
268
|
var PreparedNativeRedactionSession = class {
|
|
97
269
|
#session;
|
|
98
270
|
constructor(session) {
|
|
@@ -196,10 +368,7 @@ var PreparedNativeRedactionSession = class {
|
|
|
196
368
|
planTextBatchWithCallerDetections({ inputs, operators, observedAtEpochSeconds }) {
|
|
197
369
|
const bindingOperators = toBindingOperatorConfig(operators);
|
|
198
370
|
return new PreparedNativeSessionRedactionPlan(this.#session.planStaticEntitiesWithCallerDetections({
|
|
199
|
-
inputs: inputs
|
|
200
|
-
fullText,
|
|
201
|
-
requestJson: callerDetectionRequestJson(detections)
|
|
202
|
-
})),
|
|
371
|
+
inputs: toBindingSessionCallerInputs(inputs),
|
|
203
372
|
...bindingOperators === void 0 ? {} : { operators: bindingOperators },
|
|
204
373
|
...observedAtEpochSeconds === void 0 ? {} : { observedAtEpochSeconds }
|
|
205
374
|
}));
|
|
@@ -284,7 +453,7 @@ var PreparedNativeAnonymizer = class {
|
|
|
284
453
|
return this.#prepared.redactStaticEntitiesJson(fullText, bindingOperators);
|
|
285
454
|
}
|
|
286
455
|
redactStaticEntitiesWithCallerDetections(fullText, options) {
|
|
287
|
-
const requestJson = callerDetectionRequestJson(options.detections);
|
|
456
|
+
const requestJson = callerDetectionRequestJson(fullText, options.detections);
|
|
288
457
|
const operators = toBindingOperatorConfig(options.operators);
|
|
289
458
|
const result = JSON.parse(this.#prepared.redactStaticEntitiesWithCallerDetectionsJson(fullText, {
|
|
290
459
|
requestJson,
|
|
@@ -296,7 +465,7 @@ var PreparedNativeAnonymizer = class {
|
|
|
296
465
|
return this.redactStaticEntitiesWithCallerDetections(fullText, options);
|
|
297
466
|
}
|
|
298
467
|
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(fullText, options) {
|
|
299
|
-
const requestJson = callerDetectionRequestJson(options.detections);
|
|
468
|
+
const requestJson = callerDetectionRequestJson(fullText, options.detections);
|
|
300
469
|
const operators = toBindingOperatorConfig(options.operators);
|
|
301
470
|
return this.#prepared.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(fullText, {
|
|
302
471
|
requestJson,
|
|
@@ -522,6 +691,6 @@ const toOperatorMap = (entries) => {
|
|
|
522
691
|
return map;
|
|
523
692
|
};
|
|
524
693
|
//#endregion
|
|
525
|
-
export { CALLER_DETECTION_CONTRACT_VERSION, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, NATIVE_BINDING_PARITY_MEMBERS, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedSearch, assertNativeBindingVersion, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, isNativeAnonymizeBinding, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
694
|
+
export { CALLER_DETECTION_CONTRACT_VERSION, CALLER_DETECTION_MAX_COUNT, CALLER_DETECTION_REQUEST_JSON_MAX_BYTES, CALLER_DETECTION_TEXT_MAX_BYTES, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, NATIVE_BINDING_PARITY_MEMBERS, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedSearch, SESSION_CALLER_INPUTS_JSON_MAX_BYTES, SESSION_CALLER_MAX_INPUTS, assertNativeBindingVersion, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, isNativeAnonymizeBinding, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
526
695
|
|
|
527
696
|
//# sourceMappingURL=native.mjs.map
|
package/dist/native.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.mjs","names":["#session","#plan","#prepared","#anonymizer"],"sources":["../src/native.ts"],"sourcesContent":["import type { NativePreparedSearchConfig } from \"./native-search-config\";\nimport type { OperatorSelection, OperatorType } from \"./types\";\n\nexport type { NativePreparedSearchConfig } from \"./native-search-config\";\n\ntype NativeBindingOperatorConfig = {\n operators?: Record<string, OperatorSelection>;\n redactString?: string;\n};\n\ntype NativeBindingCallerRedactionOptions = {\n requestJson: string;\n operators?: NativeBindingOperatorConfig;\n};\n\ntype NativeBindingSessionCallerRedactionInput = {\n fullText: string;\n requestJson: string;\n};\n\ntype NativeBindingSessionCallerRedactionPlanOptions = {\n inputs: NativeBindingSessionCallerRedactionInput[];\n operators?: NativeBindingOperatorConfig;\n observedAtEpochSeconds?: number;\n};\n\ntype NativeBindingOpenSessionArchiveOptions = {\n archive: Uint8Array;\n key: Uint8Array;\n expectedSessionId: string;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativeDiagnosticsBatchCallback = (diagnosticsJson: string) => void;\nexport type NativeResultEventCallback = (eventJson: string) => void;\n\ntype NativeBindingRedactionEntry = {\n placeholder: string;\n original: string;\n};\n\ntype NativeBindingOperatorEntry = {\n placeholder: string;\n operator: OperatorType;\n};\n\ntype NativeBindingPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string | null;\n providerId?: string | null;\n detectionId?: string | null;\n};\n\ntype NativeBindingRedactionResult = {\n redactedText: string;\n redactionMap: NativeBindingRedactionEntry[];\n operatorMap: NativeBindingOperatorEntry[];\n entityCount: number;\n};\n\ntype NativeBindingStaticRedactionResult = {\n resolvedEntities: NativeBindingPipelineEntity[];\n redaction: NativeBindingRedactionResult;\n};\n\ntype CanonicalPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n source_detail?: string | null;\n provider_id?: string | null;\n detection_id?: string | null;\n};\n\ntype CanonicalStaticRedactionResult = {\n resolved_entities: CanonicalPipelineEntity[];\n redaction: {\n redacted_text: string;\n redaction_map: NativeBindingRedactionEntry[];\n operator_map: NativeBindingOperatorEntry[];\n entity_count: number;\n };\n};\n\ntype CanonicalSessionMetadata = {\n session_id: string;\n created_at_epoch_seconds: number | null;\n expires_at_epoch_seconds: number | null;\n mapping_count: number;\n status: NativeSessionStatus;\n};\n\ntype CanonicalSessionDeletionSummary = {\n session_id: string;\n deleted_mapping_count: number;\n};\n\ntype CanonicalSessionRedactionPlanResult = {\n replacements: Array<{\n start: number;\n end: number;\n replacement: string;\n }>;\n entity_count: number;\n caller_entity_count: number;\n};\n\nexport type NativeSessionStatus =\n | \"active\"\n | \"not_yet_active\"\n | \"expired\"\n | \"deleted\";\n\nexport type NativeSessionLifecycle = {\n createdAtEpochSeconds: number;\n expiresAtEpochSeconds?: number;\n};\n\nexport type NativeSessionMetadata = {\n sessionId: string;\n createdAtEpochSeconds: number | null;\n expiresAtEpochSeconds: number | null;\n mappingCount: number;\n status: NativeSessionStatus;\n};\n\nexport type NativeSessionDeletionSummary = {\n sessionId: string;\n deletedMappingCount: number;\n};\n\nexport type NativeSessionRedactionAtOptions = {\n fullText: string;\n observedAtEpochSeconds: number;\n operators?: NativeOperatorConfig;\n};\n\nexport type NativeCreateSessionWithLifecycleOptions = NativeSessionLifecycle & {\n sessionId: string;\n};\n\nexport type NativeOpenSessionArchiveOptions = {\n archive: Uint8Array;\n key: Uint8Array;\n expectedSessionId: string;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativePreparedRedactionSessionBinding = {\n sessionId: () => string;\n mappingCount: () => number;\n restoreText: (fullText: string) => string;\n restoreTextAt: (fullText: string, observedAtEpochSeconds: number) => string;\n toPlaintextJson: () => string;\n toPlaintextJsonAt: (observedAtEpochSeconds: number) => string;\n toEncryptedArchive: (key: Uint8Array) => Uint8Array;\n toEncryptedArchiveAt: (\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ) => Uint8Array;\n inspectJson: (observedAtEpochSeconds?: number) => string;\n deleteJson: () => string;\n redactStaticEntitiesJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesJsonAt: (\n fullText: string,\n observedAtEpochSeconds: number,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n planStaticEntitiesWithCallerDetections: (\n options: NativeBindingSessionCallerRedactionPlanOptions,\n ) => NativePreparedSessionRedactionPlanBinding;\n};\n\nexport type NativePreparedSessionRedactionPlanBinding = {\n resultJson: () => string;\n commit: () => void;\n};\n\nexport type NativePreparedSearchBinding = {\n prepareDiagnosticsJson: () => string;\n warmLazyRegex: () => void;\n warmLazyRegexDiagnosticsJson: () => string;\n createRedactionSession: (\n sessionId: string,\n ) => NativePreparedRedactionSessionBinding;\n createRedactionSessionWithLifecycle: (\n sessionId: string,\n createdAtEpochSeconds: number,\n expiresAtEpochSeconds?: number,\n ) => NativePreparedRedactionSessionBinding;\n restoreRedactionSession: (\n plaintextJson: string,\n ) => NativePreparedRedactionSessionBinding;\n restoreEncryptedRedactionSession: (\n options: NativeBindingOpenSessionArchiveOptions,\n ) => NativePreparedRedactionSessionBinding;\n redactStaticEntities: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => NativeBindingStaticRedactionResult;\n redactStaticEntitiesJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesWithCallerDetectionsJson: (\n fullText: string,\n options: NativeBindingCallerRedactionOptions,\n ) => string;\n redactStaticEntitiesWithCallerDetectionsDiagnosticsJson: (\n fullText: string,\n options: NativeBindingCallerRedactionOptions,\n ) => string;\n redactStaticEntitiesResultStreamJson: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onEvent: NativeResultEventCallback,\n ) => string;\n redactStaticEntitiesDiagnosticsJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesDiagnosticsStreamJson: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onBatch: NativeDiagnosticsBatchCallback,\n ) => string;\n redactStaticEntitiesSummaryDiagnosticsJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n};\n\nexport type NativeAnonymizeBinding = {\n convertExternalDetectionBatch: (\n document: Uint8Array,\n batchJson: string,\n ) => NativeCallerDetection[];\n externalDetectionLimitsJson: () => string;\n extractDocxTextJson: (document: Uint8Array) => string;\n inspectPdfJson: (document: Uint8Array, observationsJson?: string) => string;\n rewritePdfRasterFromDetectionsJson: (\n document: Uint8Array,\n requestJson: string,\n pagePixels: readonly Uint8Array[],\n ) => { document: Uint8Array; certificateJson: string };\n rewriteDocxTextNative: (\n document: Uint8Array,\n rewritesJson: string,\n ) => {\n document: Uint8Array;\n rewrittenBlockCount: number;\n appliedReplacementCount: number;\n };\n planDocxRestorationJson: (document: Uint8Array, sessionId: string) => string;\n normalizeForSearch: (text: string) => string;\n nativePackageVersion: () => string;\n NativePreparedSearch: {\n fromConfigJsonBytes: (\n configJson: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytes: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytesWithoutCache: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytes: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytesWithoutCache: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n };\n prepareStaticSearchPackageBytes: (configJson: Uint8Array) => Uint8Array;\n prepareStaticSearchCompressedPackageBytes: (\n configJson: Uint8Array,\n ) => Uint8Array;\n // Rust config assembler (replaces the retired TypeScript config-assembly\n // layer). Takes the pipeline config plus out-of-band dictionaries and\n // gazetteer JSON and returns either the assembled config JSON or ready\n // package bytes. Every parity runtime must expose these required members.\n assembleStaticSearchConfigJson: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n assembleStaticSearchPackageBytes: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n assembleStaticSearchCompressedPackageBytes: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n};\n\ntype FunctionMemberNames<T> = {\n [Key in keyof T]-?: T[Key] extends (...args: never[]) => unknown\n ? Key\n : never;\n}[keyof T];\n\n/** Exhaustive runtime-member contract shared by loaders and parity gates. */\nexport const NATIVE_BINDING_PARITY_MEMBERS = {\n root: [\n \"convertExternalDetectionBatch\",\n \"externalDetectionLimitsJson\",\n \"extractDocxTextJson\",\n \"inspectPdfJson\",\n \"rewritePdfRasterFromDetectionsJson\",\n \"rewriteDocxTextNative\",\n \"planDocxRestorationJson\",\n \"normalizeForSearch\",\n \"nativePackageVersion\",\n \"prepareStaticSearchPackageBytes\",\n \"prepareStaticSearchCompressedPackageBytes\",\n \"assembleStaticSearchConfigJson\",\n \"assembleStaticSearchPackageBytes\",\n \"assembleStaticSearchCompressedPackageBytes\",\n ],\n factories: [\n \"fromConfigJsonBytes\",\n \"fromPreparedPackageBytes\",\n \"fromPreparedPackageBytesWithoutCache\",\n \"fromTrustedPreparedPackageBytes\",\n \"fromTrustedPreparedPackageBytesWithoutCache\",\n ],\n prepared: [\n \"prepareDiagnosticsJson\",\n \"warmLazyRegex\",\n \"warmLazyRegexDiagnosticsJson\",\n \"createRedactionSession\",\n \"createRedactionSessionWithLifecycle\",\n \"restoreRedactionSession\",\n \"restoreEncryptedRedactionSession\",\n \"redactStaticEntities\",\n \"redactStaticEntitiesJson\",\n \"redactStaticEntitiesWithCallerDetectionsJson\",\n \"redactStaticEntitiesWithCallerDetectionsDiagnosticsJson\",\n \"redactStaticEntitiesResultStreamJson\",\n \"redactStaticEntitiesDiagnosticsJson\",\n \"redactStaticEntitiesDiagnosticsStreamJson\",\n \"redactStaticEntitiesSummaryDiagnosticsJson\",\n ],\n session: [\n \"sessionId\",\n \"mappingCount\",\n \"restoreText\",\n \"restoreTextAt\",\n \"toPlaintextJson\",\n \"toPlaintextJsonAt\",\n \"toEncryptedArchive\",\n \"toEncryptedArchiveAt\",\n \"inspectJson\",\n \"deleteJson\",\n \"redactStaticEntitiesJson\",\n \"redactStaticEntitiesJsonAt\",\n \"planStaticEntitiesWithCallerDetections\",\n ],\n plan: [\"resultJson\", \"commit\"],\n} as const satisfies {\n root: readonly FunctionMemberNames<NativeAnonymizeBinding>[];\n factories: readonly FunctionMemberNames<\n NativeAnonymizeBinding[\"NativePreparedSearch\"]\n >[];\n prepared: readonly FunctionMemberNames<NativePreparedSearchBinding>[];\n session: readonly FunctionMemberNames<NativePreparedRedactionSessionBinding>[];\n plan: readonly FunctionMemberNames<NativePreparedSessionRedactionPlanBinding>[];\n};\n\nconst ROOT_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativeAnonymizeBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.root)[number]\n> extends never\n ? true\n : never = true;\nconst FACTORY_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativeAnonymizeBinding[\"NativePreparedSearch\"]>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.factories)[number]\n> extends never\n ? true\n : never = true;\nconst PREPARED_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedSearchBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.prepared)[number]\n> extends never\n ? true\n : never = true;\nconst SESSION_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedRedactionSessionBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.session)[number]\n> extends never\n ? true\n : never = true;\nconst PLAN_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedSessionRedactionPlanBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.plan)[number]\n> extends never\n ? true\n : never = true;\nvoid [\n ROOT_PARITY_IS_EXHAUSTIVE,\n FACTORY_PARITY_IS_EXHAUSTIVE,\n PREPARED_PARITY_IS_EXHAUSTIVE,\n SESSION_PARITY_IS_EXHAUSTIVE,\n PLAN_PARITY_IS_EXHAUSTIVE,\n];\n\nconst isBindingPropertyBag = (\n value: unknown,\n): value is Record<string, unknown> =>\n (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n\n/** Validate the complete runtime-neutral root and factory binding shape. */\nexport const isNativeAnonymizeBinding = (\n candidate: unknown,\n): candidate is NativeAnonymizeBinding => {\n if (!isBindingPropertyBag(candidate)) {\n return false;\n }\n if (\n !NATIVE_BINDING_PARITY_MEMBERS.root.every(\n (name) => typeof candidate[name] === \"function\",\n )\n ) {\n return false;\n }\n const preparedSearch = candidate[\"NativePreparedSearch\"];\n return (\n isBindingPropertyBag(preparedSearch) &&\n NATIVE_BINDING_PARITY_MEMBERS.factories.every(\n (name) => typeof preparedSearch[name] === \"function\",\n )\n );\n};\n\nexport type NativeOperatorConfig = {\n operators?: Record<string, OperatorSelection>;\n redactString?: string;\n};\n\nexport const CALLER_DETECTION_CONTRACT_VERSION = 2;\n\nexport const EXTERNAL_DETECTION_BATCH_VERSION = 1 as const;\nexport const EXTERNAL_DETECTION_BATCH_MAX_BYTES = 16 * 1024 * 1024;\nexport const EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES = 64 * 1024 * 1024;\nexport const EXTERNAL_DETECTION_MAX_DETECTIONS = 100_000;\nexport const EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS = 4_096;\nexport const EXTERNAL_DETECTION_MAX_METADATA_BYTES = 256;\nexport const EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES = 128;\n\nexport const EXTERNAL_DETECTION_OFFSET_UNITS = {\n unicodeCodePoint: \"unicode-code-point\",\n utf16CodeUnit: \"utf16-code-unit\",\n utf8Byte: \"utf8-byte\",\n} as const;\n\nexport type ExternalDetectionOffsetUnit =\n (typeof EXTERNAL_DETECTION_OFFSET_UNITS)[keyof typeof EXTERNAL_DETECTION_OFFSET_UNITS];\n\nexport type ExternalDetectionBatch = {\n version: typeof EXTERNAL_DETECTION_BATCH_VERSION;\n document: { sha256: string };\n offsetUnit: ExternalDetectionOffsetUnit;\n provider: { id: string; name: string; version: string };\n labelMap: readonly {\n providerLabel: string;\n entityLabel: string;\n }[];\n detections: readonly {\n id: string;\n start: number;\n end: number;\n label: string;\n score: number;\n }[];\n};\n\nexport type NativeCallerDetection = {\n start: number;\n end: number;\n label: string;\n score: number;\n providerId: string;\n detectionId: string;\n};\n\nexport type ConvertExternalDetectionBatchOptions = {\n binding: NativeAnonymizeBinding;\n document: Uint8Array;\n batch: ExternalDetectionBatch | string;\n};\n\nexport const convert_external_detection_batch = ({\n binding,\n document,\n batch,\n}: ConvertExternalDetectionBatchOptions): NativeCallerDetection[] => {\n return binding.convertExternalDetectionBatch(\n document,\n typeof batch === \"string\" ? batch : JSON.stringify(batch),\n );\n};\n\nexport type NativeCallerRedactionOptions = {\n detections: readonly NativeCallerDetection[];\n operators?: NativeOperatorConfig;\n};\n\nexport type NativeSessionCallerRedactionInput = {\n fullText: string;\n detections: readonly NativeCallerDetection[];\n};\n\nexport type NativeSessionCallerRedactionPlanOptions = {\n inputs: readonly NativeSessionCallerRedactionInput[];\n operators?: NativeOperatorConfig;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativeTextReplacement = {\n start: number;\n end: number;\n replacement: string;\n};\n\nexport type NativeSessionBlockRedactionPlan = {\n replacements: readonly NativeTextReplacement[];\n entityCount: number;\n callerEntityCount: number;\n};\n\nconst callerDetectionRequestJson = (\n detections: readonly NativeCallerDetection[],\n): string =>\n JSON.stringify({\n version: CALLER_DETECTION_CONTRACT_VERSION,\n detections: detections.map((detection) => ({\n start: detection.start,\n end: detection.end,\n label: detection.label,\n score: detection.score,\n provider_id: detection.providerId,\n detection_id: detection.detectionId,\n })),\n });\n\nexport type NativePipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string;\n providerId?: string;\n detectionId?: string;\n};\n\nexport type NativeRedactionResult = {\n redactedText: string;\n redactionMap: Map<string, string>;\n operatorMap: Map<string, OperatorType>;\n entityCount: number;\n};\n\nexport type NativeStaticRedactionResult = {\n resolvedEntities: NativePipelineEntity[];\n redaction: NativeRedactionResult;\n};\n\nexport type NativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n compressed?: boolean;\n};\n\nexport type NativeSearchPackageInput =\n | NativePreparedSearchConfig\n | string\n | Uint8Array;\n\nexport type SharedNativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n compressed?: boolean;\n};\n\nexport type SharedNativePreparedPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type SharedNativeRedactTextJsonOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n fullText: string;\n operators?: NativeOperatorConfig;\n};\n\nexport type SharedNativeRedactTextOptions = SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsJsonOptions =\n SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onBatch: NativeDiagnosticsBatchCallback;\n };\n\nexport type SharedNativeRedactTextStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onEvent: NativeResultEventCallback;\n };\n\nexport type NativeNormalizeOptions = {\n binding: NativeAnonymizeBinding;\n text: string;\n};\n\nexport type NativeAnonymizerFromConfigOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n};\n\nexport type NativeAnonymizerFromPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type NativePipelineFromPackageOptions =\n NativeAnonymizerFromPackageOptions;\n\nexport type NativeBindingVersionOptions = {\n binding: NativeAnonymizeBinding;\n expectedVersion: string;\n};\n\nexport class PreparedNativeRedactionSession {\n readonly #session: NativePreparedRedactionSessionBinding;\n\n constructor(session: NativePreparedRedactionSessionBinding) {\n this.#session = session;\n }\n\n sessionId(): string {\n return this.#session.sessionId();\n }\n\n session_id(): string {\n return this.sessionId();\n }\n\n mappingCount(): number {\n return this.#session.mappingCount();\n }\n\n mapping_count(): number {\n return this.mappingCount();\n }\n\n restoreText(fullText: string, observedAtEpochSeconds?: number): string {\n if (observedAtEpochSeconds === undefined) {\n return this.#session.restoreText(fullText);\n }\n return this.#session.restoreTextAt(fullText, observedAtEpochSeconds);\n }\n\n restore_text(fullText: string, observedAtEpochSeconds?: number): string {\n return this.restoreText(fullText, observedAtEpochSeconds);\n }\n\n toPlaintextJson(): string {\n return this.#session.toPlaintextJson();\n }\n\n to_plaintext_json(): string {\n return this.toPlaintextJson();\n }\n\n toPlaintextJsonAt(observedAtEpochSeconds: number): string {\n return this.#session.toPlaintextJsonAt(observedAtEpochSeconds);\n }\n\n to_plaintext_json_at(observedAtEpochSeconds: number): string {\n return this.toPlaintextJsonAt(observedAtEpochSeconds);\n }\n\n toEncryptedArchive(key: Uint8Array): Uint8Array {\n return this.#session.toEncryptedArchive(key);\n }\n\n to_encrypted_archive(key: Uint8Array): Uint8Array {\n return this.toEncryptedArchive(key);\n }\n\n toEncryptedArchiveAt(\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ): Uint8Array {\n return this.#session.toEncryptedArchiveAt(key, observedAtEpochSeconds);\n }\n\n to_encrypted_archive_at(\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ): Uint8Array {\n return this.toEncryptedArchiveAt(key, observedAtEpochSeconds);\n }\n\n inspect(observedAtEpochSeconds?: number): NativeSessionMetadata {\n const metadata: CanonicalSessionMetadata = JSON.parse(\n this.#session.inspectJson(observedAtEpochSeconds),\n );\n return {\n sessionId: metadata.session_id,\n createdAtEpochSeconds: metadata.created_at_epoch_seconds,\n expiresAtEpochSeconds: metadata.expires_at_epoch_seconds,\n mappingCount: metadata.mapping_count,\n status: metadata.status,\n };\n }\n\n delete(): NativeSessionDeletionSummary {\n const summary: CanonicalSessionDeletionSummary = JSON.parse(\n this.#session.deleteJson(),\n );\n return {\n sessionId: summary.session_id,\n deletedMappingCount: summary.deleted_mapping_count,\n };\n }\n\n redactStaticEntities(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.redact_text_json(fullText, operators),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redactText(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntities(fullText, operators);\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactText(fullText, operators);\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.#session.redactStaticEntitiesJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n redactStaticEntitiesAt(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.redactTextJsonAt(options),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redactTextAt(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesAt(options);\n }\n\n redact_text_at(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactTextAt(options);\n }\n\n redact_static_entities_at(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesAt(options);\n }\n\n redactTextJsonAt({\n fullText,\n observedAtEpochSeconds,\n operators,\n }: NativeSessionRedactionAtOptions): string {\n return this.#session.redactStaticEntitiesJsonAt(\n fullText,\n observedAtEpochSeconds,\n toBindingOperatorConfig(operators),\n );\n }\n\n redact_text_json_at(options: NativeSessionRedactionAtOptions): string {\n return this.redactTextJsonAt(options);\n }\n\n planTextBatchWithCallerDetections({\n inputs,\n operators,\n observedAtEpochSeconds,\n }: NativeSessionCallerRedactionPlanOptions): PreparedNativeSessionRedactionPlan {\n const bindingOperators = toBindingOperatorConfig(operators);\n const bindingPlan = this.#session.planStaticEntitiesWithCallerDetections({\n inputs: inputs.map(({ detections, fullText }) => ({\n fullText,\n requestJson: callerDetectionRequestJson(detections),\n })),\n ...(bindingOperators === undefined\n ? {}\n : { operators: bindingOperators }),\n ...(observedAtEpochSeconds === undefined\n ? {}\n : { observedAtEpochSeconds }),\n });\n return new PreparedNativeSessionRedactionPlan(bindingPlan);\n }\n}\n\nexport class PreparedNativeSessionRedactionPlan {\n readonly blocks: readonly NativeSessionBlockRedactionPlan[];\n readonly #plan: NativePreparedSessionRedactionPlanBinding;\n\n constructor(plan: NativePreparedSessionRedactionPlanBinding) {\n this.#plan = plan;\n const blocks: CanonicalSessionRedactionPlanResult[] = JSON.parse(\n plan.resultJson(),\n );\n this.blocks = blocks.map(\n ({ caller_entity_count, entity_count, replacements }) => ({\n replacements,\n entityCount: entity_count,\n callerEntityCount: caller_entity_count,\n }),\n );\n }\n\n commit(): void {\n this.#plan.commit();\n }\n}\n\nexport class PreparedNativeAnonymizer {\n readonly #prepared: NativePreparedSearchBinding;\n\n constructor(prepared: NativePreparedSearchBinding) {\n this.#prepared = prepared;\n }\n\n prepareDiagnosticsJson(): string {\n return this.#prepared.prepareDiagnosticsJson();\n }\n\n prepare_diagnostics_json(): string {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n this.#prepared.warmLazyRegex();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string {\n return this.#prepared.warmLazyRegexDiagnosticsJson();\n }\n\n warm_lazy_regex_diagnostics_json(): string {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n createRedactionSession(sessionId: string): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.createRedactionSession(sessionId),\n );\n }\n\n create_redaction_session(sessionId: string): PreparedNativeRedactionSession {\n return this.createRedactionSession(sessionId);\n }\n\n createRedactionSessionWithLifecycle({\n sessionId,\n createdAtEpochSeconds,\n expiresAtEpochSeconds,\n }: NativeCreateSessionWithLifecycleOptions): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.createRedactionSessionWithLifecycle(\n sessionId,\n createdAtEpochSeconds,\n expiresAtEpochSeconds,\n ),\n );\n }\n\n create_redaction_session_with_lifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.createRedactionSessionWithLifecycle(options);\n }\n\n restoreRedactionSession(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.restoreRedactionSession(plaintextJson),\n );\n }\n\n restore_redaction_session(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.restoreRedactionSession(plaintextJson);\n }\n\n restoreEncryptedRedactionSession({\n archive,\n key,\n expectedSessionId,\n observedAtEpochSeconds,\n }: NativeOpenSessionArchiveOptions): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.restoreEncryptedRedactionSession({\n archive,\n key,\n expectedSessionId,\n ...(observedAtEpochSeconds === undefined\n ? {}\n : { observedAtEpochSeconds }),\n }),\n );\n }\n\n restore_encrypted_redaction_session(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.restoreEncryptedRedactionSession(options);\n }\n\n redactStaticEntities(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return toNativeStaticRedactionResult(\n this.#prepared.redactStaticEntities(\n fullText,\n toBindingOperatorConfig(operators),\n ),\n );\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntities(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n const bindingOperators = toBindingOperatorConfig(operators);\n return this.#prepared.redactStaticEntitiesJson(fullText, bindingOperators);\n }\n\n redactStaticEntitiesWithCallerDetections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n const requestJson = callerDetectionRequestJson(options.detections);\n const operators = toBindingOperatorConfig(options.operators);\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.#prepared.redactStaticEntitiesWithCallerDetectionsJson(fullText, {\n requestJson,\n ...(operators ? { operators } : {}),\n }),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redact_text_with_caller_detections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesWithCallerDetections(fullText, options);\n }\n\n redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n const requestJson = callerDetectionRequestJson(options.detections);\n const operators = toBindingOperatorConfig(options.operators);\n return this.#prepared.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n {\n requestJson,\n ...(operators ? { operators } : {}),\n },\n );\n }\n\n redact_static_entities_with_caller_detections_diagnostics_json(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesResultStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onEvent,\n );\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactStaticEntitiesDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redactStaticEntitiesDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesDiagnosticsStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onBatch,\n );\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactStaticEntitiesSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport class PreparedNativePipeline {\n readonly #anonymizer: PreparedNativeAnonymizer;\n\n constructor(anonymizer: PreparedNativeAnonymizer) {\n this.#anonymizer = anonymizer;\n }\n\n prepareDiagnosticsJson(): string {\n return this.#anonymizer.prepareDiagnosticsJson();\n }\n\n prepare_diagnostics_json(): string {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n this.#anonymizer.warmLazyRegex();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string {\n return this.#anonymizer.warmLazyRegexDiagnosticsJson();\n }\n\n warm_lazy_regex_diagnostics_json(): string {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n createRedactionSession(sessionId: string): PreparedNativeRedactionSession {\n return this.#anonymizer.createRedactionSession(sessionId);\n }\n\n create_redaction_session(sessionId: string): PreparedNativeRedactionSession {\n return this.createRedactionSession(sessionId);\n }\n\n createRedactionSessionWithLifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.createRedactionSessionWithLifecycle(options);\n }\n\n create_redaction_session_with_lifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.createRedactionSessionWithLifecycle(options);\n }\n\n restoreRedactionSession(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.restoreRedactionSession(plaintextJson);\n }\n\n restore_redaction_session(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.restoreRedactionSession(plaintextJson);\n }\n\n restoreEncryptedRedactionSession(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.restoreEncryptedRedactionSession(options);\n }\n\n restore_encrypted_redaction_session(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.restoreEncryptedRedactionSession(options);\n }\n\n redactText(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.#anonymizer.redactStaticEntities(fullText, operators);\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactText(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.#anonymizer.redact_text_json(fullText, operators);\n }\n\n redactTextWithCallerDetections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.#anonymizer.redactStaticEntitiesWithCallerDetections(\n fullText,\n options,\n );\n }\n\n redact_text_with_caller_detections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.redactTextWithCallerDetections(fullText, options);\n }\n\n redactTextWithCallerDetectionsDiagnosticsJson(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.#anonymizer.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redact_text_with_caller_detections_diagnostics_json(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.redactTextWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactTextDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactStaticEntitiesDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redactTextDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactTextSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport const encodeNativeSearchConfig = (\n config: NativePreparedSearchConfig,\n): Uint8Array => new TextEncoder().encode(JSON.stringify(config));\n\nexport const encodeNativeSearchConfigInput = (\n config: NativeSearchPackageInput,\n): Uint8Array => {\n if (typeof config === \"string\") {\n return new TextEncoder().encode(config);\n }\n if (config instanceof Uint8Array) {\n return config;\n }\n return encodeNativeSearchConfig(config);\n};\n\nexport const getNativeBindingVersion = (\n binding: NativeAnonymizeBinding,\n): string => binding.nativePackageVersion();\n\nexport const native_package_version = getNativeBindingVersion;\n\nexport const normalize_for_search = ({\n binding,\n text,\n}: NativeNormalizeOptions): string => binding.normalizeForSearch(text);\n\nexport const assertNativeBindingVersion = ({\n binding,\n expectedVersion,\n}: NativeBindingVersionOptions): void => {\n const actualVersion = getNativeBindingVersion(binding);\n if (actualVersion !== expectedVersion) {\n throw new Error(\n `Native anonymize binding version ${actualVersion} does not match ${expectedVersion}`,\n );\n }\n};\n\nexport const prepareNativeSearchPackage = ({\n binding,\n config,\n compressed = false,\n}: NativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfig(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const prepare_search_package = ({\n binding,\n config,\n compressed = false,\n}: SharedNativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfigInput(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const createNativeAnonymizerFromConfig = ({\n binding,\n config,\n}: NativeAnonymizerFromConfigOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfig(config),\n ),\n );\n\nexport const createNativeAnonymizerFromPackage = ({\n binding,\n packageBytes,\n}: NativeAnonymizerFromPackageOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromPreparedPackageBytes(packageBytes),\n );\n\nexport const load_prepared_package = ({\n binding,\n packageBytes,\n}: SharedNativePreparedPackageOptions): PreparedNativeAnonymizer =>\n createNativeAnonymizerFromPackage({ binding, packageBytes });\n\nexport const redact_text_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_json(fullText, operators);\n\nexport const redact_text = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextOptions): NativeStaticRedactionResult =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text(fullText, operators);\n\nexport const redact_text_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onEvent,\n}: SharedNativeRedactTextStreamJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_stream_json(fullText, onEvent, operators);\n\nexport const diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_json(fullText, operators);\n\nexport const diagnostics_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onBatch,\n}: SharedNativeDiagnosticsStreamJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_stream_json(fullText, onBatch, operators);\n\nexport const summary_diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).summary_diagnostics_json(fullText, operators);\n\nexport const createNativePipelineFromPackage = ({\n binding,\n packageBytes,\n}: NativePipelineFromPackageOptions): PreparedNativePipeline =>\n new PreparedNativePipeline(\n createNativeAnonymizerFromPackage({ binding, packageBytes }),\n );\n\nexport const PreparedSearch = PreparedNativeAnonymizer;\nexport type PreparedSearch = PreparedNativeAnonymizer;\nexport const PreparedAnonymizer = PreparedNativeAnonymizer;\nexport type PreparedAnonymizer = PreparedNativeAnonymizer;\n\nconst toBindingOperatorConfig = (\n config: NativeOperatorConfig | undefined,\n): NativeBindingOperatorConfig | undefined => {\n if (!config) {\n return undefined;\n }\n const bindingConfig: NativeBindingOperatorConfig = {};\n if (config.operators !== undefined) {\n bindingConfig.operators = config.operators;\n }\n if (config.redactString !== undefined) {\n bindingConfig.redactString = config.redactString;\n }\n return bindingConfig;\n};\n\nconst toNativeStaticRedactionResult = (\n result: NativeBindingStaticRedactionResult,\n): NativeStaticRedactionResult => ({\n resolvedEntities: result.resolvedEntities.map(toNativePipelineEntity),\n redaction: toNativeRedactionResult(result.redaction),\n});\n\nconst fromCanonicalStaticRedactionResult = (\n result: CanonicalStaticRedactionResult,\n): NativeStaticRedactionResult => ({\n resolvedEntities: result.resolved_entities.map(\n ({ source_detail, provider_id, detection_id, ...entity }) => ({\n ...entity,\n ...(source_detail ? { sourceDetail: source_detail } : {}),\n ...(provider_id ? { providerId: provider_id } : {}),\n ...(detection_id ? { detectionId: detection_id } : {}),\n }),\n ),\n redaction: {\n redactedText: result.redaction.redacted_text,\n redactionMap: toRedactionMap(result.redaction.redaction_map),\n operatorMap: toOperatorMap(result.redaction.operator_map),\n entityCount: result.redaction.entity_count,\n },\n});\n\nconst toNativePipelineEntity = (\n entity: NativeBindingPipelineEntity,\n): NativePipelineEntity => ({\n start: entity.start,\n end: entity.end,\n label: entity.label,\n text: entity.text,\n score: entity.score,\n source: entity.source,\n ...(entity.sourceDetail ? { sourceDetail: entity.sourceDetail } : {}),\n ...(entity.providerId ? { providerId: entity.providerId } : {}),\n ...(entity.detectionId ? { detectionId: entity.detectionId } : {}),\n});\n\nconst toNativeRedactionResult = (\n result: NativeBindingRedactionResult,\n): NativeRedactionResult => ({\n redactedText: result.redactedText,\n redactionMap: toRedactionMap(result.redactionMap),\n operatorMap: toOperatorMap(result.operatorMap),\n entityCount: result.entityCount,\n});\n\nconst toRedactionMap = (\n entries: readonly NativeBindingRedactionEntry[],\n): Map<string, string> => {\n const map = new Map<string, string>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.original);\n }\n return map;\n};\n\nconst toOperatorMap = (\n entries: readonly NativeBindingOperatorEntry[],\n): Map<string, OperatorType> => {\n const map = new Map<string, OperatorType>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.operator);\n }\n return map;\n};\n"],"mappings":";;AA4TA,MAAa,gCAAgC;CAC3C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAC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}
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["#maximumBytes","#label","#reportedMaximumBytes","#reserve","#requireNumber","#appendNumber","#appendReservedRun","#bytes","#chunks","#suffix","#session","#plan","#prepared","#anonymizer"],"sources":["../src/native.ts"],"sourcesContent":["import type { NativePreparedSearchConfig } from \"./native-search-config\";\nimport type { OperatorSelection, OperatorType } from \"./types\";\n\nexport type { NativePreparedSearchConfig } from \"./native-search-config\";\n\ntype NativeBindingOperatorConfig = {\n operators?: Record<string, OperatorSelection>;\n redactString?: string;\n};\n\ntype NativeBindingCallerRedactionOptions = {\n requestJson: string;\n operators?: NativeBindingOperatorConfig;\n};\n\ntype NativeBindingSessionCallerRedactionInput = {\n fullText: string;\n requestJson: string;\n};\n\ntype NativeBindingSessionCallerRedactionPlanOptions = {\n inputs: NativeBindingSessionCallerRedactionInput[];\n operators?: NativeBindingOperatorConfig;\n observedAtEpochSeconds?: number;\n};\n\ntype NativeBindingOpenSessionArchiveOptions = {\n archive: Uint8Array;\n key: Uint8Array;\n expectedSessionId: string;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativeDiagnosticsBatchCallback = (diagnosticsJson: string) => void;\nexport type NativeResultEventCallback = (eventJson: string) => void;\n\ntype NativeBindingRedactionEntry = {\n placeholder: string;\n original: string;\n};\n\ntype NativeBindingOperatorEntry = {\n placeholder: string;\n operator: OperatorType;\n};\n\ntype NativeBindingPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string | null;\n providerId?: string | null;\n detectionId?: string | null;\n};\n\ntype NativeBindingRedactionResult = {\n redactedText: string;\n redactionMap: NativeBindingRedactionEntry[];\n operatorMap: NativeBindingOperatorEntry[];\n entityCount: number;\n};\n\ntype NativeBindingStaticRedactionResult = {\n resolvedEntities: NativeBindingPipelineEntity[];\n redaction: NativeBindingRedactionResult;\n};\n\ntype CanonicalPipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n source_detail?: string | null;\n provider_id?: string | null;\n detection_id?: string | null;\n};\n\ntype CanonicalStaticRedactionResult = {\n resolved_entities: CanonicalPipelineEntity[];\n redaction: {\n redacted_text: string;\n redaction_map: NativeBindingRedactionEntry[];\n operator_map: NativeBindingOperatorEntry[];\n entity_count: number;\n };\n};\n\ntype CanonicalSessionMetadata = {\n session_id: string;\n created_at_epoch_seconds: number | null;\n expires_at_epoch_seconds: number | null;\n mapping_count: number;\n status: NativeSessionStatus;\n};\n\ntype CanonicalSessionDeletionSummary = {\n session_id: string;\n deleted_mapping_count: number;\n};\n\ntype CanonicalSessionRedactionPlanResult = {\n replacements: Array<{ start: number; end: number; replacement: string }>;\n entity_count: number;\n caller_entity_count: number;\n};\n\nexport type NativeSessionStatus =\n | \"active\"\n | \"not_yet_active\"\n | \"expired\"\n | \"deleted\";\n\nexport type NativeSessionLifecycle = {\n createdAtEpochSeconds: number;\n expiresAtEpochSeconds?: number;\n};\n\nexport type NativeSessionMetadata = {\n sessionId: string;\n createdAtEpochSeconds: number | null;\n expiresAtEpochSeconds: number | null;\n mappingCount: number;\n status: NativeSessionStatus;\n};\n\nexport type NativeSessionDeletionSummary = {\n sessionId: string;\n deletedMappingCount: number;\n};\n\nexport type NativeSessionRedactionAtOptions = {\n fullText: string;\n observedAtEpochSeconds: number;\n operators?: NativeOperatorConfig;\n};\n\nexport type NativeCreateSessionWithLifecycleOptions = NativeSessionLifecycle & {\n sessionId: string;\n};\n\nexport type NativeOpenSessionArchiveOptions = {\n archive: Uint8Array;\n key: Uint8Array;\n expectedSessionId: string;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativePreparedRedactionSessionBinding = {\n sessionId: () => string;\n mappingCount: () => number;\n restoreText: (fullText: string) => string;\n restoreTextAt: (fullText: string, observedAtEpochSeconds: number) => string;\n toPlaintextJson: () => string;\n toPlaintextJsonAt: (observedAtEpochSeconds: number) => string;\n toEncryptedArchive: (key: Uint8Array) => Uint8Array;\n toEncryptedArchiveAt: (\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ) => Uint8Array;\n inspectJson: (observedAtEpochSeconds?: number) => string;\n deleteJson: () => string;\n redactStaticEntitiesJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesJsonAt: (\n fullText: string,\n observedAtEpochSeconds: number,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n planStaticEntitiesWithCallerDetections: (\n options: NativeBindingSessionCallerRedactionPlanOptions,\n ) => NativePreparedSessionRedactionPlanBinding;\n};\n\nexport type NativePreparedSessionRedactionPlanBinding = {\n resultJson: () => string;\n commit: () => void;\n};\n\nexport type NativePreparedSearchBinding = {\n prepareDiagnosticsJson: () => string;\n warmLazyRegex: () => void;\n warmLazyRegexDiagnosticsJson: () => string;\n createRedactionSession: (\n sessionId: string,\n ) => NativePreparedRedactionSessionBinding;\n createRedactionSessionWithLifecycle: (\n sessionId: string,\n createdAtEpochSeconds: number,\n expiresAtEpochSeconds?: number,\n ) => NativePreparedRedactionSessionBinding;\n restoreRedactionSession: (\n plaintextJson: string,\n ) => NativePreparedRedactionSessionBinding;\n restoreEncryptedRedactionSession: (\n options: NativeBindingOpenSessionArchiveOptions,\n ) => NativePreparedRedactionSessionBinding;\n redactStaticEntities: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => NativeBindingStaticRedactionResult;\n redactStaticEntitiesJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesWithCallerDetectionsJson: (\n fullText: string,\n options: NativeBindingCallerRedactionOptions,\n ) => string;\n redactStaticEntitiesWithCallerDetectionsDiagnosticsJson: (\n fullText: string,\n options: NativeBindingCallerRedactionOptions,\n ) => string;\n redactStaticEntitiesResultStreamJson: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onEvent: NativeResultEventCallback,\n ) => string;\n redactStaticEntitiesDiagnosticsJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n redactStaticEntitiesDiagnosticsStreamJson: (\n fullText: string,\n operators: NativeBindingOperatorConfig | undefined,\n onBatch: NativeDiagnosticsBatchCallback,\n ) => string;\n redactStaticEntitiesSummaryDiagnosticsJson: (\n fullText: string,\n operators?: NativeBindingOperatorConfig,\n ) => string;\n};\n\nexport type NativeAnonymizeBinding = {\n convertExternalDetectionBatch: (\n document: Uint8Array,\n batchJson: string,\n ) => NativeCallerDetection[];\n externalDetectionLimitsJson: () => string;\n extractDocxTextJson: (document: Uint8Array) => string;\n inspectPdfJson: (document: Uint8Array, observationsJson?: string) => string;\n rewritePdfRasterFromDetectionsJson: (\n document: Uint8Array,\n requestJson: string,\n pagePixels: readonly Uint8Array[],\n ) => { document: Uint8Array; certificateJson: string };\n rewriteDocxTextNative: (\n document: Uint8Array,\n rewritesJson: string,\n ) => {\n document: Uint8Array;\n rewrittenBlockCount: number;\n appliedReplacementCount: number;\n };\n planDocxRestorationJson: (document: Uint8Array, sessionId: string) => string;\n normalizeForSearch: (text: string) => string;\n nativePackageVersion: () => string;\n NativePreparedSearch: {\n fromConfigJsonBytes: (\n configJson: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytes: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromPreparedPackageBytesWithoutCache: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytes: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n fromTrustedPreparedPackageBytesWithoutCache: (\n packageBytes: Uint8Array,\n ) => NativePreparedSearchBinding;\n };\n prepareStaticSearchPackageBytes: (configJson: Uint8Array) => Uint8Array;\n prepareStaticSearchCompressedPackageBytes: (\n configJson: Uint8Array,\n ) => Uint8Array;\n // Rust config assembler (replaces the retired TypeScript config-assembly\n // layer). Takes the pipeline config plus out-of-band dictionaries and\n // gazetteer JSON and returns either the assembled config JSON or ready\n // package bytes. Every parity runtime must expose these required members.\n assembleStaticSearchConfigJson: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n assembleStaticSearchPackageBytes: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n assembleStaticSearchCompressedPackageBytes: (\n pipelineConfigJson: Uint8Array,\n dictionariesJson?: Uint8Array,\n gazetteerJson?: Uint8Array,\n ) => Uint8Array;\n};\n\ntype FunctionMemberNames<T> = {\n [Key in keyof T]-?: T[Key] extends (...args: never[]) => unknown\n ? Key\n : never;\n}[keyof T];\n\n/** Exhaustive runtime-member contract shared by loaders and parity gates. */\nexport const NATIVE_BINDING_PARITY_MEMBERS = {\n root: [\n \"convertExternalDetectionBatch\",\n \"externalDetectionLimitsJson\",\n \"extractDocxTextJson\",\n \"inspectPdfJson\",\n \"rewritePdfRasterFromDetectionsJson\",\n \"rewriteDocxTextNative\",\n \"planDocxRestorationJson\",\n \"normalizeForSearch\",\n \"nativePackageVersion\",\n \"prepareStaticSearchPackageBytes\",\n \"prepareStaticSearchCompressedPackageBytes\",\n \"assembleStaticSearchConfigJson\",\n \"assembleStaticSearchPackageBytes\",\n \"assembleStaticSearchCompressedPackageBytes\",\n ],\n factories: [\n \"fromConfigJsonBytes\",\n \"fromPreparedPackageBytes\",\n \"fromPreparedPackageBytesWithoutCache\",\n \"fromTrustedPreparedPackageBytes\",\n \"fromTrustedPreparedPackageBytesWithoutCache\",\n ],\n prepared: [\n \"prepareDiagnosticsJson\",\n \"warmLazyRegex\",\n \"warmLazyRegexDiagnosticsJson\",\n \"createRedactionSession\",\n \"createRedactionSessionWithLifecycle\",\n \"restoreRedactionSession\",\n \"restoreEncryptedRedactionSession\",\n \"redactStaticEntities\",\n \"redactStaticEntitiesJson\",\n \"redactStaticEntitiesWithCallerDetectionsJson\",\n \"redactStaticEntitiesWithCallerDetectionsDiagnosticsJson\",\n \"redactStaticEntitiesResultStreamJson\",\n \"redactStaticEntitiesDiagnosticsJson\",\n \"redactStaticEntitiesDiagnosticsStreamJson\",\n \"redactStaticEntitiesSummaryDiagnosticsJson\",\n ],\n session: [\n \"sessionId\",\n \"mappingCount\",\n \"restoreText\",\n \"restoreTextAt\",\n \"toPlaintextJson\",\n \"toPlaintextJsonAt\",\n \"toEncryptedArchive\",\n \"toEncryptedArchiveAt\",\n \"inspectJson\",\n \"deleteJson\",\n \"redactStaticEntitiesJson\",\n \"redactStaticEntitiesJsonAt\",\n \"planStaticEntitiesWithCallerDetections\",\n ],\n plan: [\"resultJson\", \"commit\"],\n} as const satisfies {\n root: readonly FunctionMemberNames<NativeAnonymizeBinding>[];\n factories: readonly FunctionMemberNames<\n NativeAnonymizeBinding[\"NativePreparedSearch\"]\n >[];\n prepared: readonly FunctionMemberNames<NativePreparedSearchBinding>[];\n session: readonly FunctionMemberNames<NativePreparedRedactionSessionBinding>[];\n plan: readonly FunctionMemberNames<NativePreparedSessionRedactionPlanBinding>[];\n};\n\nconst ROOT_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativeAnonymizeBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.root)[number]\n> extends never\n ? true\n : never = true;\nconst FACTORY_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativeAnonymizeBinding[\"NativePreparedSearch\"]>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.factories)[number]\n> extends never\n ? true\n : never = true;\nconst PREPARED_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedSearchBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.prepared)[number]\n> extends never\n ? true\n : never = true;\nconst SESSION_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedRedactionSessionBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.session)[number]\n> extends never\n ? true\n : never = true;\nconst PLAN_PARITY_IS_EXHAUSTIVE: Exclude<\n FunctionMemberNames<NativePreparedSessionRedactionPlanBinding>,\n (typeof NATIVE_BINDING_PARITY_MEMBERS.plan)[number]\n> extends never\n ? true\n : never = true;\nvoid [\n ROOT_PARITY_IS_EXHAUSTIVE,\n FACTORY_PARITY_IS_EXHAUSTIVE,\n PREPARED_PARITY_IS_EXHAUSTIVE,\n SESSION_PARITY_IS_EXHAUSTIVE,\n PLAN_PARITY_IS_EXHAUSTIVE,\n];\n\nconst isBindingPropertyBag = (\n value: unknown,\n): value is Record<string, unknown> =>\n (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n\n/** Validate the complete runtime-neutral root and factory binding shape. */\nexport const isNativeAnonymizeBinding = (\n candidate: unknown,\n): candidate is NativeAnonymizeBinding => {\n if (!isBindingPropertyBag(candidate)) {\n return false;\n }\n if (\n !NATIVE_BINDING_PARITY_MEMBERS.root.every(\n (name) => typeof candidate[name] === \"function\",\n )\n ) {\n return false;\n }\n const preparedSearch = candidate[\"NativePreparedSearch\"];\n return (\n isBindingPropertyBag(preparedSearch) &&\n NATIVE_BINDING_PARITY_MEMBERS.factories.every(\n (name) => typeof preparedSearch[name] === \"function\",\n )\n );\n};\n\nexport type NativeOperatorConfig = {\n operators?: Record<string, OperatorSelection>;\n redactString?: string;\n};\n\nexport const CALLER_DETECTION_CONTRACT_VERSION = 2;\nexport const CALLER_DETECTION_MAX_COUNT = 1_000_000;\nexport const CALLER_DETECTION_TEXT_MAX_BYTES = 64 * 1024 * 1024;\nexport const CALLER_DETECTION_REQUEST_JSON_MAX_BYTES = 16 * 1024 * 1024;\nexport const SESSION_CALLER_MAX_INPUTS = 100_000;\nexport const SESSION_CALLER_INPUTS_JSON_MAX_BYTES = 64 * 1024 * 1024;\n\nexport const EXTERNAL_DETECTION_BATCH_VERSION = 1 as const;\nexport const EXTERNAL_DETECTION_BATCH_MAX_BYTES = 16 * 1024 * 1024;\nexport const EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES = 64 * 1024 * 1024;\nexport const EXTERNAL_DETECTION_MAX_DETECTIONS = 100_000;\nexport const EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS = 4_096;\nexport const EXTERNAL_DETECTION_MAX_METADATA_BYTES = 256;\nexport const EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES = 128;\n\nexport const EXTERNAL_DETECTION_OFFSET_UNITS = {\n unicodeCodePoint: \"unicode-code-point\",\n utf16CodeUnit: \"utf16-code-unit\",\n utf8Byte: \"utf8-byte\",\n} as const;\n\nexport type ExternalDetectionOffsetUnit =\n (typeof EXTERNAL_DETECTION_OFFSET_UNITS)[keyof typeof EXTERNAL_DETECTION_OFFSET_UNITS];\n\nexport type ExternalDetectionBatch = {\n version: typeof EXTERNAL_DETECTION_BATCH_VERSION;\n document: { sha256: string };\n offsetUnit: ExternalDetectionOffsetUnit;\n provider: { id: string; name: string; version: string };\n labelMap: readonly {\n providerLabel: string;\n entityLabel: string;\n }[];\n detections: readonly {\n id: string;\n start: number;\n end: number;\n label: string;\n score: number;\n }[];\n};\n\nexport type NativeCallerDetection = {\n start: number;\n end: number;\n label: string;\n score: number;\n providerId: string;\n detectionId: string;\n};\n\nexport type ConvertExternalDetectionBatchOptions = {\n binding: NativeAnonymizeBinding;\n document: Uint8Array;\n batch: ExternalDetectionBatch | string;\n};\n\nexport const convert_external_detection_batch = ({\n binding,\n document,\n batch,\n}: ConvertExternalDetectionBatchOptions): NativeCallerDetection[] => {\n return binding.convertExternalDetectionBatch(\n document,\n typeof batch === \"string\" ? batch : JSON.stringify(batch),\n );\n};\n\nexport type NativeCallerRedactionOptions = {\n detections: readonly NativeCallerDetection[];\n operators?: NativeOperatorConfig;\n};\n\nexport type NativeSessionCallerRedactionInput = {\n fullText: string;\n detections: readonly NativeCallerDetection[];\n};\n\nexport type NativeSessionCallerRedactionPlanOptions = {\n inputs: readonly NativeSessionCallerRedactionInput[];\n operators?: NativeOperatorConfig;\n observedAtEpochSeconds?: number;\n};\n\nexport type NativeTextReplacement = {\n start: number;\n end: number;\n replacement: string;\n};\n\nexport type NativeSessionBlockRedactionPlan = {\n replacements: readonly NativeTextReplacement[];\n entityCount: number;\n callerEntityCount: number;\n};\n\nconst utf8ByteLengthWithin = (\n text: string,\n maximum: number,\n): number | undefined => {\n let bytes = 0;\n for (let index = 0; index < text.length; index += 1) {\n const unit = text.charCodeAt(index);\n if (unit <= 0x7f) {\n bytes += 1;\n } else if (unit <= 0x7ff) {\n bytes += 2;\n } else if (\n unit >= 0xd800 &&\n unit <= 0xdbff &&\n index + 1 < text.length &&\n text.charCodeAt(index + 1) >= 0xdc00 &&\n text.charCodeAt(index + 1) <= 0xdfff\n ) {\n bytes += 4;\n index += 1;\n } else {\n bytes += 3;\n }\n if (bytes > maximum) {\n return undefined;\n }\n }\n return bytes;\n};\n\nconst validateCallerDetectionInput = (\n fullText: string,\n detections: readonly NativeCallerDetection[],\n): number => {\n if (!Array.isArray(detections)) {\n throw new TypeError(\"Caller detections must be an array\");\n }\n if (detections.length > CALLER_DETECTION_MAX_COUNT) {\n throw new RangeError(\n `Caller detections contains ${detections.length} items; the maximum is ${CALLER_DETECTION_MAX_COUNT}`,\n );\n }\n const textBytes = utf8ByteLengthWithin(\n fullText,\n CALLER_DETECTION_TEXT_MAX_BYTES,\n );\n if (textBytes === undefined) {\n throw new RangeError(\n `Caller detection text exceeds the ${CALLER_DETECTION_TEXT_MAX_BYTES}-byte maximum`,\n );\n }\n return textBytes;\n};\n\nabstract class BoundedJsonSink {\n readonly #maximumBytes: number;\n readonly #label: string;\n readonly #reportedMaximumBytes: number;\n #bytes = 0;\n\n constructor(maximumBytes: number, label: string, suffix: string) {\n this.#maximumBytes = maximumBytes - suffix.length;\n this.#label = label;\n this.#reportedMaximumBytes = maximumBytes;\n }\n\n appendAscii(value: string): void {\n this.#reserve(value.length);\n this.capture(value);\n }\n\n appendOffset(value: number, field: string): void {\n this.#requireNumber(value, field);\n if (!Number.isInteger(value) || value < 0 || value > 0xff_ff_ff_ff) {\n throw new RangeError(\n `${field} must be an integer between 0 and 4294967295`,\n );\n }\n this.#appendNumber(value);\n }\n\n appendScore(value: number, field: string): void {\n this.#requireNumber(value, field);\n if (!Number.isFinite(value) || value < 0 || value > 1) {\n throw new RangeError(`${field} must be finite and between 0 and 1`);\n }\n this.#appendNumber(value);\n }\n\n appendString(value: string, field: string): void {\n if (typeof value !== \"string\") {\n throw new TypeError(`${field} must be a string`);\n }\n this.appendAscii('\"');\n let runStart = 0;\n for (let index = 0; index < value.length; index += 1) {\n const unit = value.charCodeAt(index);\n const escape = jsonEscape(unit);\n if (escape !== undefined) {\n this.#appendReservedRun(value, runStart, index);\n this.appendAscii(escape);\n runStart = index + 1;\n continue;\n }\n if (\n unit >= 0xd800 &&\n unit <= 0xdbff &&\n index + 1 < value.length &&\n value.charCodeAt(index + 1) >= 0xdc00 &&\n value.charCodeAt(index + 1) <= 0xdfff\n ) {\n this.#reserve(4);\n index += 1;\n continue;\n }\n if (unit >= 0xd800 && unit <= 0xdfff) {\n this.#appendReservedRun(value, runStart, index);\n this.appendAscii(`\\\\u${unit.toString(16).padStart(4, \"0\")}`);\n runStart = index + 1;\n continue;\n }\n let unitBytes = 3;\n if (unit <= 0x7f) {\n unitBytes = 1;\n } else if (unit <= 0x7ff) {\n unitBytes = 2;\n }\n this.#reserve(unitBytes);\n }\n this.#appendReservedRun(value, runStart, value.length);\n this.appendAscii('\"');\n }\n\n #appendReservedRun(value: string, start: number, end: number): void {\n if (end > start) {\n this.capture(value.slice(start, end));\n }\n }\n\n #appendNumber(value: number): void {\n this.appendAscii(JSON.stringify(value));\n }\n\n #requireNumber(value: number, field: string): void {\n if (typeof value !== \"number\") {\n throw new TypeError(`${field} must be a number`);\n }\n }\n\n #reserve(bytes: number): void {\n if (bytes > this.#maximumBytes - this.#bytes) {\n throw new RangeError(\n `${this.#label} exceeds the ${this.#reportedMaximumBytes}-byte maximum`,\n );\n }\n this.#bytes += bytes;\n }\n\n protected abstract capture(value: string): void;\n}\n\nclass CountingJsonBudget extends BoundedJsonSink {\n protected capture(value: string): void {\n void value;\n }\n}\n\nclass BoundedJsonWriter extends BoundedJsonSink {\n readonly #chunks: string[] = [];\n readonly #suffix: string;\n\n constructor(maximumBytes: number, label: string, suffix: string) {\n super(maximumBytes, label, suffix);\n this.#suffix = suffix;\n }\n\n finish(): string {\n return this.#chunks.join(\"\") + this.#suffix;\n }\n\n protected capture(value: string): void {\n this.#chunks.push(value);\n }\n}\n\nconst jsonEscape = (unit: number): string | undefined => {\n switch (unit) {\n case 0x08:\n return \"\\\\b\";\n case 0x09:\n return \"\\\\t\";\n case 0x0a:\n return \"\\\\n\";\n case 0x0c:\n return \"\\\\f\";\n case 0x0d:\n return \"\\\\r\";\n case 0x22:\n return '\\\\\"';\n case 0x5c:\n return \"\\\\\\\\\";\n default:\n return unit < 0x20\n ? `\\\\u${unit.toString(16).padStart(4, \"0\")}`\n : undefined;\n }\n};\n\nconst callerDetectionRequestJson = (\n fullText: string,\n detections: readonly NativeCallerDetection[],\n): string => {\n validateCallerDetectionInput(fullText, detections);\n return serializeCallerDetectionRequest(detections);\n};\n\nconst serializeCallerDetectionRequest = (\n detections: readonly NativeCallerDetection[],\n): string => {\n const writer = new BoundedJsonWriter(\n CALLER_DETECTION_REQUEST_JSON_MAX_BYTES,\n \"Caller detection request JSON\",\n \"]}\",\n );\n writer.appendAscii(\n `{\"version\":${CALLER_DETECTION_CONTRACT_VERSION},\"detections\":[`,\n );\n for (let index = 0; index < detections.length; index += 1) {\n const detection = detections[index];\n if (detection === undefined) {\n throw new TypeError(\"Caller detections must not be sparse\");\n }\n if (index > 0) {\n writer.appendAscii(\",\");\n }\n writer.appendAscii('{\"start\":');\n writer.appendOffset(detection.start, \"Caller detection start\");\n writer.appendAscii(',\"end\":');\n writer.appendOffset(detection.end, \"Caller detection end\");\n writer.appendAscii(',\"label\":');\n writer.appendString(detection.label, \"Caller detection label\");\n writer.appendAscii(',\"score\":');\n writer.appendScore(detection.score, \"Caller detection score\");\n writer.appendAscii(',\"provider_id\":');\n writer.appendString(detection.providerId, \"Caller detection providerId\");\n writer.appendAscii(',\"detection_id\":');\n writer.appendString(detection.detectionId, \"Caller detection detectionId\");\n writer.appendAscii(\"}\");\n }\n return writer.finish();\n};\n\nconst toBindingSessionCallerInputs = (\n inputs: readonly NativeSessionCallerRedactionInput[],\n) => {\n if (!Array.isArray(inputs)) {\n throw new TypeError(\"Session caller inputs must be an array\");\n }\n if (inputs.length > SESSION_CALLER_MAX_INPUTS) {\n throw new RangeError(\n `Session caller inputs contains ${inputs.length} items; the maximum is ${SESSION_CALLER_MAX_INPUTS}`,\n );\n }\n let detectionCount = 0;\n let textBytes = 0;\n const bindingInputs: NativeBindingSessionCallerRedactionInput[] = [];\n const budget = new CountingJsonBudget(\n SESSION_CALLER_INPUTS_JSON_MAX_BYTES,\n \"Session caller inputs JSON\",\n \"]\",\n );\n budget.appendAscii(\"[\");\n for (let index = 0; index < inputs.length; index += 1) {\n const input = inputs[index];\n if (input === undefined) {\n throw new TypeError(\"Session caller inputs must not be sparse\");\n }\n const { detections, fullText } = input;\n const inputTextBytes = validateCallerDetectionInput(fullText, detections);\n detectionCount += detections.length;\n if (detectionCount > CALLER_DETECTION_MAX_COUNT) {\n throw new RangeError(\n `Session caller detections contains ${detectionCount} items; the maximum is ${CALLER_DETECTION_MAX_COUNT}`,\n );\n }\n textBytes += inputTextBytes;\n if (textBytes > CALLER_DETECTION_TEXT_MAX_BYTES) {\n throw new RangeError(\n `Session caller text contains ${textBytes} bytes; the maximum is ${CALLER_DETECTION_TEXT_MAX_BYTES}`,\n );\n }\n const requestJson = serializeCallerDetectionRequest(detections);\n if (index > 0) {\n budget.appendAscii(\",\");\n }\n budget.appendAscii('{\"full_text\":');\n budget.appendString(fullText, \"Session caller fullText\");\n budget.appendAscii(',\"request_json\":');\n budget.appendString(requestJson, \"Session caller requestJson\");\n budget.appendAscii(\"}\");\n bindingInputs.push({ fullText, requestJson });\n }\n return bindingInputs;\n};\n\nexport type NativePipelineEntity = {\n start: number;\n end: number;\n label: string;\n text: string;\n score: number;\n source: string;\n sourceDetail?: string;\n providerId?: string;\n detectionId?: string;\n};\n\nexport type NativeRedactionResult = {\n redactedText: string;\n redactionMap: Map<string, string>;\n operatorMap: Map<string, OperatorType>;\n entityCount: number;\n};\n\nexport type NativeStaticRedactionResult = {\n resolvedEntities: NativePipelineEntity[];\n redaction: NativeRedactionResult;\n};\n\nexport type NativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n compressed?: boolean;\n};\n\nexport type NativeSearchPackageInput =\n | NativePreparedSearchConfig\n | string\n | Uint8Array;\n\nexport type SharedNativeSearchPackageOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n compressed?: boolean;\n};\n\nexport type SharedNativePreparedPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type SharedNativeRedactTextJsonOptions = {\n binding: NativeAnonymizeBinding;\n config: NativeSearchPackageInput;\n fullText: string;\n operators?: NativeOperatorConfig;\n};\n\nexport type SharedNativeRedactTextOptions = SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsJsonOptions =\n SharedNativeRedactTextJsonOptions;\n\nexport type SharedNativeDiagnosticsStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onBatch: NativeDiagnosticsBatchCallback;\n };\n\nexport type SharedNativeRedactTextStreamJsonOptions =\n SharedNativeRedactTextJsonOptions & {\n onEvent: NativeResultEventCallback;\n };\n\nexport type NativeNormalizeOptions = {\n binding: NativeAnonymizeBinding;\n text: string;\n};\n\nexport type NativeAnonymizerFromConfigOptions = {\n binding: NativeAnonymizeBinding;\n config: NativePreparedSearchConfig;\n};\n\nexport type NativeAnonymizerFromPackageOptions = {\n binding: NativeAnonymizeBinding;\n packageBytes: Uint8Array;\n};\n\nexport type NativePipelineFromPackageOptions =\n NativeAnonymizerFromPackageOptions;\n\nexport type NativeBindingVersionOptions = {\n binding: NativeAnonymizeBinding;\n expectedVersion: string;\n};\n\nexport class PreparedNativeRedactionSession {\n readonly #session: NativePreparedRedactionSessionBinding;\n\n constructor(session: NativePreparedRedactionSessionBinding) {\n this.#session = session;\n }\n\n sessionId(): string {\n return this.#session.sessionId();\n }\n\n session_id(): string {\n return this.sessionId();\n }\n\n mappingCount(): number {\n return this.#session.mappingCount();\n }\n\n mapping_count(): number {\n return this.mappingCount();\n }\n\n restoreText(fullText: string, observedAtEpochSeconds?: number): string {\n if (observedAtEpochSeconds === undefined) {\n return this.#session.restoreText(fullText);\n }\n return this.#session.restoreTextAt(fullText, observedAtEpochSeconds);\n }\n\n restore_text(fullText: string, observedAtEpochSeconds?: number): string {\n return this.restoreText(fullText, observedAtEpochSeconds);\n }\n\n toPlaintextJson(): string {\n return this.#session.toPlaintextJson();\n }\n\n to_plaintext_json(): string {\n return this.toPlaintextJson();\n }\n\n toPlaintextJsonAt(observedAtEpochSeconds: number): string {\n return this.#session.toPlaintextJsonAt(observedAtEpochSeconds);\n }\n\n to_plaintext_json_at(observedAtEpochSeconds: number): string {\n return this.toPlaintextJsonAt(observedAtEpochSeconds);\n }\n\n toEncryptedArchive(key: Uint8Array): Uint8Array {\n return this.#session.toEncryptedArchive(key);\n }\n\n to_encrypted_archive(key: Uint8Array): Uint8Array {\n return this.toEncryptedArchive(key);\n }\n\n toEncryptedArchiveAt(\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ): Uint8Array {\n return this.#session.toEncryptedArchiveAt(key, observedAtEpochSeconds);\n }\n\n to_encrypted_archive_at(\n key: Uint8Array,\n observedAtEpochSeconds: number,\n ): Uint8Array {\n return this.toEncryptedArchiveAt(key, observedAtEpochSeconds);\n }\n\n inspect(observedAtEpochSeconds?: number): NativeSessionMetadata {\n const metadata: CanonicalSessionMetadata = JSON.parse(\n this.#session.inspectJson(observedAtEpochSeconds),\n );\n return {\n sessionId: metadata.session_id,\n createdAtEpochSeconds: metadata.created_at_epoch_seconds,\n expiresAtEpochSeconds: metadata.expires_at_epoch_seconds,\n mappingCount: metadata.mapping_count,\n status: metadata.status,\n };\n }\n\n delete(): NativeSessionDeletionSummary {\n const summary: CanonicalSessionDeletionSummary = JSON.parse(\n this.#session.deleteJson(),\n );\n return {\n sessionId: summary.session_id,\n deletedMappingCount: summary.deleted_mapping_count,\n };\n }\n\n redactStaticEntities(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.redact_text_json(fullText, operators),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redactText(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntities(fullText, operators);\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactText(fullText, operators);\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.#session.redactStaticEntitiesJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n redactStaticEntitiesAt(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.redactTextJsonAt(options),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redactTextAt(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesAt(options);\n }\n\n redact_text_at(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactTextAt(options);\n }\n\n redact_static_entities_at(\n options: NativeSessionRedactionAtOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesAt(options);\n }\n\n redactTextJsonAt({\n fullText,\n observedAtEpochSeconds,\n operators,\n }: NativeSessionRedactionAtOptions): string {\n return this.#session.redactStaticEntitiesJsonAt(\n fullText,\n observedAtEpochSeconds,\n toBindingOperatorConfig(operators),\n );\n }\n\n redact_text_json_at(options: NativeSessionRedactionAtOptions): string {\n return this.redactTextJsonAt(options);\n }\n\n planTextBatchWithCallerDetections({\n inputs,\n operators,\n observedAtEpochSeconds,\n }: NativeSessionCallerRedactionPlanOptions): PreparedNativeSessionRedactionPlan {\n const bindingOperators = toBindingOperatorConfig(operators);\n const bindingPlan = this.#session.planStaticEntitiesWithCallerDetections({\n inputs: toBindingSessionCallerInputs(inputs),\n ...(bindingOperators === undefined\n ? {}\n : { operators: bindingOperators }),\n ...(observedAtEpochSeconds === undefined\n ? {}\n : { observedAtEpochSeconds }),\n });\n return new PreparedNativeSessionRedactionPlan(bindingPlan);\n }\n}\n\nexport class PreparedNativeSessionRedactionPlan {\n readonly blocks: readonly NativeSessionBlockRedactionPlan[];\n readonly #plan: NativePreparedSessionRedactionPlanBinding;\n\n constructor(plan: NativePreparedSessionRedactionPlanBinding) {\n this.#plan = plan;\n const blocks: CanonicalSessionRedactionPlanResult[] = JSON.parse(\n plan.resultJson(),\n );\n this.blocks = blocks.map(\n ({ caller_entity_count, entity_count, replacements }) => ({\n replacements,\n entityCount: entity_count,\n callerEntityCount: caller_entity_count,\n }),\n );\n }\n\n commit(): void {\n this.#plan.commit();\n }\n}\n\nexport class PreparedNativeAnonymizer {\n readonly #prepared: NativePreparedSearchBinding;\n\n constructor(prepared: NativePreparedSearchBinding) {\n this.#prepared = prepared;\n }\n\n prepareDiagnosticsJson(): string {\n return this.#prepared.prepareDiagnosticsJson();\n }\n\n prepare_diagnostics_json(): string {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n this.#prepared.warmLazyRegex();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string {\n return this.#prepared.warmLazyRegexDiagnosticsJson();\n }\n\n warm_lazy_regex_diagnostics_json(): string {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n createRedactionSession(sessionId: string): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.createRedactionSession(sessionId),\n );\n }\n\n create_redaction_session(sessionId: string): PreparedNativeRedactionSession {\n return this.createRedactionSession(sessionId);\n }\n\n createRedactionSessionWithLifecycle({\n sessionId,\n createdAtEpochSeconds,\n expiresAtEpochSeconds,\n }: NativeCreateSessionWithLifecycleOptions): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.createRedactionSessionWithLifecycle(\n sessionId,\n createdAtEpochSeconds,\n expiresAtEpochSeconds,\n ),\n );\n }\n\n create_redaction_session_with_lifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.createRedactionSessionWithLifecycle(options);\n }\n\n restoreRedactionSession(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.restoreRedactionSession(plaintextJson),\n );\n }\n\n restore_redaction_session(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.restoreRedactionSession(plaintextJson);\n }\n\n restoreEncryptedRedactionSession({\n archive,\n key,\n expectedSessionId,\n observedAtEpochSeconds,\n }: NativeOpenSessionArchiveOptions): PreparedNativeRedactionSession {\n return new PreparedNativeRedactionSession(\n this.#prepared.restoreEncryptedRedactionSession({\n archive,\n key,\n expectedSessionId,\n ...(observedAtEpochSeconds === undefined\n ? {}\n : { observedAtEpochSeconds }),\n }),\n );\n }\n\n restore_encrypted_redaction_session(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.restoreEncryptedRedactionSession(options);\n }\n\n redactStaticEntities(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return toNativeStaticRedactionResult(\n this.#prepared.redactStaticEntities(\n fullText,\n toBindingOperatorConfig(operators),\n ),\n );\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntities(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n const bindingOperators = toBindingOperatorConfig(operators);\n return this.#prepared.redactStaticEntitiesJson(fullText, bindingOperators);\n }\n\n redactStaticEntitiesWithCallerDetections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n const requestJson = callerDetectionRequestJson(\n fullText,\n options.detections,\n );\n const operators = toBindingOperatorConfig(options.operators);\n const result: CanonicalStaticRedactionResult = JSON.parse(\n this.#prepared.redactStaticEntitiesWithCallerDetectionsJson(fullText, {\n requestJson,\n ...(operators ? { operators } : {}),\n }),\n );\n return fromCanonicalStaticRedactionResult(result);\n }\n\n redact_text_with_caller_detections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.redactStaticEntitiesWithCallerDetections(fullText, options);\n }\n\n redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n const requestJson = callerDetectionRequestJson(\n fullText,\n options.detections,\n );\n const operators = toBindingOperatorConfig(options.operators);\n return this.#prepared.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n {\n requestJson,\n ...(operators ? { operators } : {}),\n },\n );\n }\n\n redact_static_entities_with_caller_detections_diagnostics_json(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesResultStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onEvent,\n );\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactStaticEntitiesDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redactStaticEntitiesDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesDiagnosticsStreamJson(\n fullText,\n toBindingOperatorConfig(operators),\n onBatch,\n );\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactStaticEntitiesSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#prepared.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n toBindingOperatorConfig(operators),\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactStaticEntitiesSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport class PreparedNativePipeline {\n readonly #anonymizer: PreparedNativeAnonymizer;\n\n constructor(anonymizer: PreparedNativeAnonymizer) {\n this.#anonymizer = anonymizer;\n }\n\n prepareDiagnosticsJson(): string {\n return this.#anonymizer.prepareDiagnosticsJson();\n }\n\n prepare_diagnostics_json(): string {\n return this.prepareDiagnosticsJson();\n }\n\n warmLazyRegex(): void {\n this.#anonymizer.warmLazyRegex();\n }\n\n warm_lazy_regex(): void {\n this.warmLazyRegex();\n }\n\n warmLazyRegexDiagnosticsJson(): string {\n return this.#anonymizer.warmLazyRegexDiagnosticsJson();\n }\n\n warm_lazy_regex_diagnostics_json(): string {\n return this.warmLazyRegexDiagnosticsJson();\n }\n\n createRedactionSession(sessionId: string): PreparedNativeRedactionSession {\n return this.#anonymizer.createRedactionSession(sessionId);\n }\n\n create_redaction_session(sessionId: string): PreparedNativeRedactionSession {\n return this.createRedactionSession(sessionId);\n }\n\n createRedactionSessionWithLifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.createRedactionSessionWithLifecycle(options);\n }\n\n create_redaction_session_with_lifecycle(\n options: NativeCreateSessionWithLifecycleOptions,\n ): PreparedNativeRedactionSession {\n return this.createRedactionSessionWithLifecycle(options);\n }\n\n restoreRedactionSession(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.restoreRedactionSession(plaintextJson);\n }\n\n restore_redaction_session(\n plaintextJson: string,\n ): PreparedNativeRedactionSession {\n return this.restoreRedactionSession(plaintextJson);\n }\n\n restoreEncryptedRedactionSession(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.#anonymizer.restoreEncryptedRedactionSession(options);\n }\n\n restore_encrypted_redaction_session(\n options: NativeOpenSessionArchiveOptions,\n ): PreparedNativeRedactionSession {\n return this.restoreEncryptedRedactionSession(options);\n }\n\n redactText(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.#anonymizer.redactStaticEntities(fullText, operators);\n }\n\n redact_text(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): NativeStaticRedactionResult {\n return this.redactText(fullText, operators);\n }\n\n redact_text_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.#anonymizer.redact_text_json(fullText, operators);\n }\n\n redactTextWithCallerDetections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.#anonymizer.redactStaticEntitiesWithCallerDetections(\n fullText,\n options,\n );\n }\n\n redact_text_with_caller_detections(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): NativeStaticRedactionResult {\n return this.redactTextWithCallerDetections(fullText, options);\n }\n\n redactTextWithCallerDetectionsDiagnosticsJson(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.#anonymizer.redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redact_text_with_caller_detections_diagnostics_json(\n fullText: string,\n options: NativeCallerRedactionOptions,\n ): string {\n return this.redactTextWithCallerDetectionsDiagnosticsJson(\n fullText,\n options,\n );\n }\n\n redactTextJson(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redact_text_json(fullText, operators);\n }\n\n redactTextStreamJson(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redact_text_stream_json(\n fullText: string,\n onEvent: NativeResultEventCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextStreamJson(fullText, onEvent, operators);\n }\n\n redactTextDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactStaticEntitiesDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n diagnostics_json(fullText: string, operators?: NativeOperatorConfig): string {\n return this.redactTextDiagnosticsJson(fullText, operators);\n }\n\n diagnosticsStreamJson(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n diagnostics_stream_json(\n fullText: string,\n onBatch: NativeDiagnosticsBatchCallback,\n operators?: NativeOperatorConfig,\n ): string {\n return this.diagnosticsStreamJson(fullText, onBatch, operators);\n }\n\n redactTextSummaryDiagnosticsJson(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.#anonymizer.redactStaticEntitiesSummaryDiagnosticsJson(\n fullText,\n operators,\n );\n }\n\n summary_diagnostics_json(\n fullText: string,\n operators?: NativeOperatorConfig,\n ): string {\n return this.redactTextSummaryDiagnosticsJson(fullText, operators);\n }\n}\n\nexport const encodeNativeSearchConfig = (\n config: NativePreparedSearchConfig,\n): Uint8Array => new TextEncoder().encode(JSON.stringify(config));\n\nexport const encodeNativeSearchConfigInput = (\n config: NativeSearchPackageInput,\n): Uint8Array => {\n if (typeof config === \"string\") {\n return new TextEncoder().encode(config);\n }\n if (config instanceof Uint8Array) {\n return config;\n }\n return encodeNativeSearchConfig(config);\n};\n\nexport const getNativeBindingVersion = (\n binding: NativeAnonymizeBinding,\n): string => binding.nativePackageVersion();\n\nexport const native_package_version = getNativeBindingVersion;\n\nexport const normalize_for_search = ({\n binding,\n text,\n}: NativeNormalizeOptions): string => binding.normalizeForSearch(text);\n\nexport const assertNativeBindingVersion = ({\n binding,\n expectedVersion,\n}: NativeBindingVersionOptions): void => {\n const actualVersion = getNativeBindingVersion(binding);\n if (actualVersion !== expectedVersion) {\n throw new Error(\n `Native anonymize binding version ${actualVersion} does not match ${expectedVersion}`,\n );\n }\n};\n\nexport const prepareNativeSearchPackage = ({\n binding,\n config,\n compressed = false,\n}: NativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfig(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const prepare_search_package = ({\n binding,\n config,\n compressed = false,\n}: SharedNativeSearchPackageOptions): Uint8Array => {\n const configBytes = encodeNativeSearchConfigInput(config);\n return compressed\n ? binding.prepareStaticSearchCompressedPackageBytes(configBytes)\n : binding.prepareStaticSearchPackageBytes(configBytes);\n};\n\nexport const createNativeAnonymizerFromConfig = ({\n binding,\n config,\n}: NativeAnonymizerFromConfigOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfig(config),\n ),\n );\n\nexport const createNativeAnonymizerFromPackage = ({\n binding,\n packageBytes,\n}: NativeAnonymizerFromPackageOptions): PreparedNativeAnonymizer =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromPreparedPackageBytes(packageBytes),\n );\n\nexport const load_prepared_package = ({\n binding,\n packageBytes,\n}: SharedNativePreparedPackageOptions): PreparedNativeAnonymizer =>\n createNativeAnonymizerFromPackage({ binding, packageBytes });\n\nexport const redact_text_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_json(fullText, operators);\n\nexport const redact_text = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeRedactTextOptions): NativeStaticRedactionResult =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text(fullText, operators);\n\nexport const redact_text_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onEvent,\n}: SharedNativeRedactTextStreamJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).redact_text_stream_json(fullText, onEvent, operators);\n\nexport const diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_json(fullText, operators);\n\nexport const diagnostics_stream_json = ({\n binding,\n config,\n fullText,\n operators,\n onBatch,\n}: SharedNativeDiagnosticsStreamJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).diagnostics_stream_json(fullText, onBatch, operators);\n\nexport const summary_diagnostics_json = ({\n binding,\n config,\n fullText,\n operators,\n}: SharedNativeDiagnosticsJsonOptions): string =>\n new PreparedNativeAnonymizer(\n binding.NativePreparedSearch.fromConfigJsonBytes(\n encodeNativeSearchConfigInput(config),\n ),\n ).summary_diagnostics_json(fullText, operators);\n\nexport const createNativePipelineFromPackage = ({\n binding,\n packageBytes,\n}: NativePipelineFromPackageOptions): PreparedNativePipeline =>\n new PreparedNativePipeline(\n createNativeAnonymizerFromPackage({ binding, packageBytes }),\n );\n\nexport const PreparedSearch = PreparedNativeAnonymizer;\nexport type PreparedSearch = PreparedNativeAnonymizer;\nexport const PreparedAnonymizer = PreparedNativeAnonymizer;\nexport type PreparedAnonymizer = PreparedNativeAnonymizer;\n\nconst toBindingOperatorConfig = (\n config: NativeOperatorConfig | undefined,\n): NativeBindingOperatorConfig | undefined => {\n if (!config) {\n return undefined;\n }\n const bindingConfig: NativeBindingOperatorConfig = {};\n if (config.operators !== undefined) {\n bindingConfig.operators = config.operators;\n }\n if (config.redactString !== undefined) {\n bindingConfig.redactString = config.redactString;\n }\n return bindingConfig;\n};\n\nconst toNativeStaticRedactionResult = (\n result: NativeBindingStaticRedactionResult,\n): NativeStaticRedactionResult => ({\n resolvedEntities: result.resolvedEntities.map(toNativePipelineEntity),\n redaction: toNativeRedactionResult(result.redaction),\n});\n\nconst fromCanonicalStaticRedactionResult = (\n result: CanonicalStaticRedactionResult,\n): NativeStaticRedactionResult => ({\n resolvedEntities: result.resolved_entities.map(\n ({ source_detail, provider_id, detection_id, ...entity }) => ({\n ...entity,\n ...(source_detail ? { sourceDetail: source_detail } : {}),\n ...(provider_id ? { providerId: provider_id } : {}),\n ...(detection_id ? { detectionId: detection_id } : {}),\n }),\n ),\n redaction: {\n redactedText: result.redaction.redacted_text,\n redactionMap: toRedactionMap(result.redaction.redaction_map),\n operatorMap: toOperatorMap(result.redaction.operator_map),\n entityCount: result.redaction.entity_count,\n },\n});\n\nconst toNativePipelineEntity = (\n entity: NativeBindingPipelineEntity,\n): NativePipelineEntity => ({\n start: entity.start,\n end: entity.end,\n label: entity.label,\n text: entity.text,\n score: entity.score,\n source: entity.source,\n ...(entity.sourceDetail ? { sourceDetail: entity.sourceDetail } : {}),\n ...(entity.providerId ? { providerId: entity.providerId } : {}),\n ...(entity.detectionId ? { detectionId: entity.detectionId } : {}),\n});\n\nconst toNativeRedactionResult = (\n result: NativeBindingRedactionResult,\n): NativeRedactionResult => ({\n redactedText: result.redactedText,\n redactionMap: toRedactionMap(result.redactionMap),\n operatorMap: toOperatorMap(result.operatorMap),\n entityCount: result.entityCount,\n});\n\nconst toRedactionMap = (\n entries: readonly NativeBindingRedactionEntry[],\n): Map<string, string> => {\n const map = new Map<string, string>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.original);\n }\n return map;\n};\n\nconst toOperatorMap = (\n entries: readonly NativeBindingOperatorEntry[],\n): Map<string, OperatorType> => {\n const map = new Map<string, OperatorType>();\n for (const entry of entries) {\n map.set(entry.placeholder, entry.operator);\n }\n return map;\n};\n"],"mappings":";;AAwTA,MAAa,gCAAgC;CAC3C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,cAAc,QAAQ;AAC/B;AAgDA,MAAM,wBACJ,UAEC,OAAO,UAAU,YAAY,UAAU,QAAS,OAAO,UAAU;;AAGpE,MAAa,4BACX,cACwC;CACxC,IAAI,CAAC,qBAAqB,SAAS,GACjC,OAAO;CAET,IACE,CAAC,8BAA8B,KAAK,OACjC,SAAS,OAAO,UAAU,UAAU,UACvC,GAEA,OAAO;CAET,MAAM,iBAAiB,UAAU;CACjC,OACE,qBAAqB,cAAc,KACnC,8BAA8B,UAAU,OACrC,SAAS,OAAO,eAAe,UAAU,UAC5C;AAEJ;AAOA,MAAa,oCAAoC;AACjD,MAAa,6BAA6B;AAC1C,MAAa,kCAAkC,KAAK,OAAO;AAC3D,MAAa,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C1B,OAAO,OAAO;CACd,KAAK,OAAO;CACZ,OAAO,OAAO;CACd,MAAM,OAAO;CACb,OAAO,OAAO;CACd,QAAQ,OAAO;CACf,GAAI,OAAO,eAAe,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;CACnE,GAAI,OAAO,aAAa,EAAE,YAAY,OAAO,WAAW,IAAI,CAAC;CAC7D,GAAI,OAAO,cAAc,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;AAClE;AAEA,MAAM,2BACJ,YAC2B;CAC3B,cAAc,OAAO;CACrB,cAAc,eAAe,OAAO,YAAY;CAChD,aAAa,cAAc,OAAO,WAAW;CAC7C,aAAa,OAAO;AACtB;AAEA,MAAM,kBACJ,YACwB;CACxB,MAAM,sBAAM,IAAI,IAAoB;CACpC,KAAK,MAAM,SAAS,SAClB,IAAI,IAAI,MAAM,aAAa,MAAM,QAAQ;CAE3C,OAAO;AACT;AAEA,MAAM,iBACJ,YAC8B;CAC9B,MAAM,sBAAM,IAAI,IAA0B;CAC1C,KAAK,MAAM,SAAS,SAClB,IAAI,IAAI,MAAM,aAAa,MAAM,QAAQ;CAE3C,OAAO;AACT"}
|
package/dist/native2.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { CALLER_DETECTION_CONTRACT_VERSION, ConvertExternalDetectionBatchOptions, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, ExternalDetectionBatch, ExternalDetectionOffsetUnit, NATIVE_BINDING_PARITY_MEMBERS, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, NativePipelineEntity, NativePipelineFromPackageOptions, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedSearch, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, assertNativeBindingVersion, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, isNativeAnonymizeBinding, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|
|
1
|
+
import { $ as SESSION_CALLER_INPUTS_JSON_MAX_BYTES, A as NativePreparedRedactionSessionBinding, B as NativeSessionDeletionSummary, C as NativeCreateSessionWithLifecycleOptions, Ct as prepare_search_package, D as NativeOperatorConfig, Dt as summary_diagnostics_json, E as NativeOpenSessionArchiveOptions, Et as redact_text_stream_json, F as NativeSearchPackageInput, G as NativeStaticRedactionResult, H as NativeSessionMetadata, I as NativeSearchPackageOptions, J as PreparedNativeAnonymizer, K as NativeTextReplacement, L as NativeSessionBlockRedactionPlan, M as NativePreparedSessionRedactionPlanBinding, N as NativeRedactionResult, O as NativePipelineEntity, Ot as NativePreparedSearchConfig, P as NativeResultEventCallback, Q as PreparedSearch, R as NativeSessionCallerRedactionInput, S as NativeCallerRedactionOptions, St as prepareNativeSearchPackage, T as NativeNormalizeOptions, Tt as redact_text_json, U as NativeSessionRedactionAtOptions, V as NativeSessionLifecycle, W as NativeSessionStatus, X as PreparedNativeRedactionSession, Y as PreparedNativePipeline, Z as PreparedNativeSessionRedactionPlan, _ as NativeAnonymizeBinding, _t as getNativeBindingVersion, a as ConvertExternalDetectionBatchOptions, at as SharedNativeRedactTextOptions, b as NativeBindingVersionOptions, bt as native_package_version, c as EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, ct as assertNativeBindingVersion, d as EXTERNAL_DETECTION_MAX_METADATA_BYTES, dt as createNativeAnonymizerFromPackage, et as SESSION_CALLER_MAX_INPUTS, f as EXTERNAL_DETECTION_OFFSET_UNITS, ft as createNativePipelineFromPackage, g as NATIVE_BINDING_PARITY_MEMBERS, gt as encodeNativeSearchConfigInput, h as ExternalDetectionOffsetUnit, ht as encodeNativeSearchConfig, i as CALLER_DETECTION_TEXT_MAX_BYTES, it as SharedNativeRedactTextJsonOptions, j as NativePreparedSearchBinding, k as NativePipelineFromPackageOptions, l as EXTERNAL_DETECTION_MAX_DETECTIONS, lt as convert_external_detection_batch, m as ExternalDetectionBatch, mt as diagnostics_stream_json, n as CALLER_DETECTION_MAX_COUNT, nt as SharedNativeDiagnosticsStreamJsonOptions, o as EXTERNAL_DETECTION_BATCH_MAX_BYTES, ot as SharedNativeRedactTextStreamJsonOptions, p as EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, pt as diagnostics_json, q as PreparedAnonymizer, r as CALLER_DETECTION_REQUEST_JSON_MAX_BYTES, rt as SharedNativePreparedPackageOptions, s as EXTERNAL_DETECTION_BATCH_VERSION, st as SharedNativeSearchPackageOptions, t as CALLER_DETECTION_CONTRACT_VERSION, tt as SharedNativeDiagnosticsJsonOptions, u as EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, ut as createNativeAnonymizerFromConfig, v as NativeAnonymizerFromConfigOptions, vt as isNativeAnonymizeBinding, w as NativeDiagnosticsBatchCallback, wt as redact_text, x as NativeCallerDetection, xt as normalize_for_search, y as NativeAnonymizerFromPackageOptions, yt as load_prepared_package, z as NativeSessionCallerRedactionPlanOptions } from "./native.mjs";
|
|
2
|
+
export { CALLER_DETECTION_CONTRACT_VERSION, CALLER_DETECTION_MAX_COUNT, CALLER_DETECTION_REQUEST_JSON_MAX_BYTES, CALLER_DETECTION_TEXT_MAX_BYTES, ConvertExternalDetectionBatchOptions, EXTERNAL_DETECTION_BATCH_MAX_BYTES, EXTERNAL_DETECTION_BATCH_VERSION, EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES, EXTERNAL_DETECTION_MAX_DETECTIONS, EXTERNAL_DETECTION_MAX_LABEL_MAPPINGS, EXTERNAL_DETECTION_MAX_METADATA_BYTES, EXTERNAL_DETECTION_OFFSET_UNITS, EXTERNAL_DETECTION_PROVIDER_ID_MAX_BYTES, ExternalDetectionBatch, ExternalDetectionOffsetUnit, NATIVE_BINDING_PARITY_MEMBERS, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, NativePipelineEntity, NativePipelineFromPackageOptions, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedSearch, SESSION_CALLER_INPUTS_JSON_MAX_BYTES, SESSION_CALLER_MAX_INPUTS, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, assertNativeBindingVersion, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromPackage, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, getNativeBindingVersion, isNativeAnonymizeBinding, load_prepared_package, native_package_version, normalize_for_search, prepareNativeSearchPackage, prepare_search_package, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
|