@stll/anonymize-wasm 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 CHANGED
@@ -18,14 +18,18 @@ and local document-provider tools remain Node-only. The binding is instantiated
18
18
  lazily on first use.
19
19
 
20
20
  ```ts
21
- import { loadDefaultPipeline } from "@stll/anonymize-wasm";
21
+ import { createPipeline } from "@stll/anonymize-wasm";
22
22
 
23
- // Loads the compressed default package bundled in the tarball.
24
- const pipeline = await loadDefaultPipeline();
23
+ const pipeline = await createPipeline({ language: "en" });
25
24
  const { redaction } = pipeline.redactText("A contract signed by Jan Novak.");
26
25
  console.log(redaction.redactedText);
27
26
  ```
28
27
 
28
+ `createPipeline()` accepts one supported language, an exact non-empty
29
+ combination such as `{ language: ["cs", "en"] }`, or `{ language: "all" }`.
30
+ Language-scoped pipelines are assembled and cached from lazy dictionary chunks;
31
+ `"all"` loads the bundled default prepared package.
32
+
29
33
  Bring your own prepared package (bytes, an `ArrayBuffer`, or a URL to fetch):
30
34
 
31
35
  ```ts
@@ -66,11 +70,16 @@ stllAnonymizeWasm({ packages: "none" });
66
70
  stllAnonymizeWasm({ packages: "all" });
67
71
  ```
68
72
 
69
- `"default"` selects the full-dictionary package that `loadDefaultPipeline()`
73
+ `"default"` selects the full-dictionary package that `createPipeline()` with
74
+ `language: "all"` or `loadDefaultPipeline()`
70
75
  (no argument) loads; a language code selects the scoped package that
71
76
  `loadDefaultPipeline("cs")` loads. Requesting a package that is not bundled
72
77
  fails the build.
73
78
 
79
+ The semantic factory supports `cs`, `de`, `en`, `es`, `fr`, `hu`, `it`, `lv`,
80
+ `pl`, `pt-br`, `ro`, `sk`, and `sv`. The lower-level artifact loader has
81
+ bundled scoped packages for `cs`, `de`, and `en` only.
82
+
74
83
  Interplay with the runtime loaders: the plugin only controls which assets ship,
75
84
  not which the code asks for. Calling `loadDefaultPipeline(language)` for a
76
85
  package you did not emit resolves to a missing asset URL and rejects with a
Binary file
package/dist/wasm.d.mts CHANGED
@@ -813,6 +813,11 @@ type NativeOperatorConfig = {
813
813
  redactString?: string;
814
814
  };
815
815
  declare const CALLER_DETECTION_CONTRACT_VERSION = 2;
816
+ declare const CALLER_DETECTION_MAX_COUNT = 1000000;
817
+ declare const CALLER_DETECTION_TEXT_MAX_BYTES: number;
818
+ declare const CALLER_DETECTION_REQUEST_JSON_MAX_BYTES: number;
819
+ declare const SESSION_CALLER_MAX_INPUTS = 100000;
820
+ declare const SESSION_CALLER_INPUTS_JSON_MAX_BYTES: number;
816
821
  declare const EXTERNAL_DETECTION_BATCH_VERSION: 1;
817
822
  declare const EXTERNAL_DETECTION_BATCH_MAX_BYTES: number;
818
823
  declare const EXTERNAL_DETECTION_DOCUMENT_MAX_BYTES: number;
@@ -1071,6 +1076,11 @@ type PreparedSearch = PreparedNativeAnonymizer;
1071
1076
  declare const PreparedAnonymizer: typeof PreparedNativeAnonymizer;
1072
1077
  type PreparedAnonymizer = PreparedNativeAnonymizer;
1073
1078
  //#endregion
1079
+ //#region src/pipeline-language.d.ts
1080
+ type SupportedLanguage = "cs" | "de" | "en" | "es" | "fr" | "hu" | "it" | "lv" | "pl" | "pt-br" | "ro" | "sk" | "sv";
1081
+ declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
1082
+ type PipelineLanguageSelection = SupportedLanguage | readonly [SupportedLanguage, ...SupportedLanguage[]] | "all";
1083
+ //#endregion
1074
1084
  //#region src/context.d.ts
1075
1085
  /**
1076
1086
  * Cached state for a single pipeline run (or a sequence of runs sharing the
@@ -1137,6 +1147,9 @@ type WasmBindingOptions = {
1137
1147
  * the underlying wasm module is instantiated a single time and cached. */
1138
1148
  declare const getBinding: () => Promise<NativeAnonymizeBinding>;
1139
1149
  type LoadPreparedPackageOptions = WasmBindingOptions;
1150
+ type CreatePipelineOptions = WasmBindingOptions & {
1151
+ language?: PipelineLanguageSelection;
1152
+ };
1140
1153
  /** Load a prepared package and return a pipeline ready to redact text. */
1141
1154
  declare const loadPipeline: (source: PreparedPackageSource, options?: LoadPreparedPackageOptions) => Promise<PreparedNativePipeline>;
1142
1155
  /** Load a prepared package and return the lower-level anonymizer. */
@@ -1160,6 +1173,8 @@ declare const loadDefaultPipeline: (language?: string, options?: LoadPreparedPac
1160
1173
  * folding the binding into the key would keep unbounded per-binding entries
1161
1174
  * alive. Injected-binding callers get a fresh pipeline each call. */
1162
1175
  declare const getDefaultPipeline: (language?: string, options?: LoadPreparedPackageOptions) => Promise<PreparedNativePipeline>;
1176
+ declare const createPipeline: ({ language, ...bindingOptions }?: CreatePipelineOptions) => Promise<PreparedNativePipeline>;
1177
+ declare const create_pipeline: typeof createPipeline;
1163
1178
  declare const redactDefaultText: (fullText: string, operators?: NativeOperatorConfig, language?: string) => Promise<NativeStaticRedactionResult>;
1164
1179
  declare const redactDefaultTextJson: (fullText: string, operators?: NativeOperatorConfig, language?: string) => Promise<string>;
1165
1180
  declare const native_package_version: (options?: WasmBindingOptions) => Promise<string>;
@@ -1179,5 +1194,5 @@ declare const summary_diagnostics_json: (config: NativeSearchPackageInput, fullT
1179
1194
  * fail-closed core used by Node and Python. This does not redact the PDF. */
1180
1195
  declare const inspect_pdf_json: (document: Uint8Array, observationsJson?: string, options?: WasmBindingOptions) => Promise<string>;
1181
1196
  //#endregion
1182
- export { type AnonymisationOperator, CALLER_DETECTION_CONTRACT_VERSION, CAPABILITY_MANIFEST, CAPABILITY_MANIFEST_SCHEMA_VERSION, CAPABILITY_PARITY_PROFILES, CAPABILITY_RUNTIMES, CAPABILITY_SURFACES, type CapabilityManifest, type CapabilityParityProfile, type CapabilityRuntime, type CapabilitySurface, type CapabilitySurfaceId, ConvertExternalDetectionBatchOptions, DEFAULT_ENTITY_LABELS, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefaultEntityLabel, type DetectionSource, type Dictionaries, ENTITY_CAPABILITIES, ENTITY_LABELS, ENTITY_SELECTIONS, 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, type Entity, type EntityCapability, type EntityLabel, type EntitySelection, ExternalDetectionBatch, ExternalDetectionOffsetUnit, type GazetteerEntry, LoadPreparedPackageOptions, NATIVE_BINDING_PARITY_MEMBERS, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, type NativePipelineBuildOptions, type NativePipelineCompatibility, NativePipelineEntity, NativePipelineFromPackageOptions, type NativePipelinePackageOptions, type NativePipelineUnsupportedFeature, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, PrepareSearchPackageOptions, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedPackageSource, PreparedSearch, type RedactionResult, type ReviewDecision, type ReviewedEntity, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, WasmBindingOptions, assertNativeBindingVersion, assertNativePipelineSupported, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromConfig, createNativePipelineFromPackage, createPipelineContext, deanonymise, defaultPackageUrl, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, exportRedactionKey, getBinding, getDefaultPipeline, getNativeBindingVersion, getNativePipelineCompatibility, inspect_pdf_json, isNativeAnonymizeBinding, loadDefaultPipeline, loadPipeline, load_prepared_package, native_package_version, normalize_for_search, prepareNativePipelineConfig, prepareNativePipelinePackage, prepareNativeSearchPackage, prepare_search_package, redactDefaultText, redactDefaultTextJson, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
1197
+ export { type AnonymisationOperator, CALLER_DETECTION_CONTRACT_VERSION, CALLER_DETECTION_MAX_COUNT, CALLER_DETECTION_REQUEST_JSON_MAX_BYTES, CALLER_DETECTION_TEXT_MAX_BYTES, CAPABILITY_MANIFEST, CAPABILITY_MANIFEST_SCHEMA_VERSION, CAPABILITY_PARITY_PROFILES, CAPABILITY_RUNTIMES, CAPABILITY_SURFACES, type CapabilityManifest, type CapabilityParityProfile, type CapabilityRuntime, type CapabilitySurface, type CapabilitySurfaceId, ConvertExternalDetectionBatchOptions, CreatePipelineOptions, DEFAULT_ENTITY_LABELS, DETECTION_SOURCES, DETECTOR_PRIORITY, type DefaultEntityLabel, type DetectionSource, type Dictionaries, ENTITY_CAPABILITIES, ENTITY_LABELS, ENTITY_SELECTIONS, 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, type Entity, type EntityCapability, type EntityLabel, type EntitySelection, ExternalDetectionBatch, ExternalDetectionOffsetUnit, type GazetteerEntry, LoadPreparedPackageOptions, NATIVE_BINDING_PARITY_MEMBERS, NativeAnonymizeBinding, NativeAnonymizerFromConfigOptions, NativeAnonymizerFromPackageOptions, NativeBindingVersionOptions, NativeCallerDetection, NativeCallerRedactionOptions, NativeCreateSessionWithLifecycleOptions, NativeDiagnosticsBatchCallback, NativeNormalizeOptions, NativeOpenSessionArchiveOptions, NativeOperatorConfig, type NativePipelineBuildOptions, type NativePipelineCompatibility, NativePipelineEntity, NativePipelineFromPackageOptions, type NativePipelinePackageOptions, type NativePipelineUnsupportedFeature, NativePreparedRedactionSessionBinding, NativePreparedSearchBinding, type NativePreparedSearchConfig, NativePreparedSessionRedactionPlanBinding, NativeRedactionResult, NativeResultEventCallback, NativeSearchPackageInput, NativeSearchPackageOptions, NativeSessionBlockRedactionPlan, NativeSessionCallerRedactionInput, NativeSessionCallerRedactionPlanOptions, NativeSessionDeletionSummary, NativeSessionLifecycle, NativeSessionMetadata, NativeSessionRedactionAtOptions, NativeSessionStatus, NativeStaticRedactionResult, NativeTextReplacement, OPERATOR_TYPES, type OperatorConfig, type OperatorType, type PipelineConfig, type PipelineContext, type PipelineLanguageSelection, PrepareSearchPackageOptions, PreparedAnonymizer, PreparedNativeAnonymizer, PreparedNativePipeline, PreparedNativeRedactionSession, PreparedNativeSessionRedactionPlan, PreparedPackageSource, PreparedSearch, type RedactionResult, type ReviewDecision, type ReviewedEntity, SESSION_CALLER_INPUTS_JSON_MAX_BYTES, SESSION_CALLER_MAX_INPUTS, SUPPORTED_LANGUAGES, SharedNativeDiagnosticsJsonOptions, SharedNativeDiagnosticsStreamJsonOptions, SharedNativePreparedPackageOptions, SharedNativeRedactTextJsonOptions, SharedNativeRedactTextOptions, SharedNativeRedactTextStreamJsonOptions, SharedNativeSearchPackageOptions, type SupportedLanguage, WasmBindingOptions, assertNativeBindingVersion, assertNativePipelineSupported, convert_external_detection_batch, createNativeAnonymizerFromConfig, createNativeAnonymizerFromPackage, createNativePipelineFromConfig, createNativePipelineFromPackage, createPipeline, createPipelineContext, create_pipeline, deanonymise, defaultPackageUrl, diagnostics_json, diagnostics_stream_json, encodeNativeSearchConfig, encodeNativeSearchConfigInput, exportRedactionKey, getBinding, getDefaultPipeline, getNativeBindingVersion, getNativePipelineCompatibility, inspect_pdf_json, isNativeAnonymizeBinding, loadDefaultPipeline, loadPipeline, load_prepared_package, native_package_version, normalize_for_search, prepareNativePipelineConfig, prepareNativePipelinePackage, prepareNativeSearchPackage, prepare_search_package, redactDefaultText, redactDefaultTextJson, redact_text, redact_text_json, redact_text_stream_json, summary_diagnostics_json };
1183
1198
  //# sourceMappingURL=wasm.d.mts.map