@blindfold/sdk 1.0.2

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.
@@ -0,0 +1,177 @@
1
+ //#region src/regex/entities.d.ts
2
+ /**
3
+ * PII entity types detected by the regex scanner.
4
+ * Names match the Blindfold API entity types for transparent switching.
5
+ */
6
+ declare enum EntityType {
7
+ EMAIL_ADDRESS = "Email Address",
8
+ CREDIT_CARD = "Credit Card Number",
9
+ PHONE_NUMBER = "Phone Number",
10
+ IP_ADDRESS = "IP Address",
11
+ URL = "URL",
12
+ MAC_ADDRESS = "MAC Address",
13
+ DATE_OF_BIRTH = "Date of Birth",
14
+ CVV = "CVV",
15
+ SSN = "Social Security Number",
16
+ DRIVERS_LICENSE = "Driver's License",
17
+ US_PASSPORT = "US Passport",
18
+ TAX_ID = "Tax ID",
19
+ ZIP_CODE = "ZIP Code",
20
+ IBAN = "IBAN",
21
+ EU_POSTAL_CODE = "Postal Code",
22
+ VAT_ID = "VAT ID",
23
+ NI_NUMBER = "NI Number",
24
+ NHS_NUMBER = "NHS Number",
25
+ UK_POSTCODE = "UK Postcode",
26
+ UK_PASSPORT = "UK Passport",
27
+ DE_PERSONAL_ID = "German Personal ID",
28
+ DE_TAX_ID = "German Tax ID",
29
+ FR_NATIONAL_ID = "French National ID",
30
+ ES_DNI = "Spanish DNI",
31
+ ES_NIE = "Spanish NIE",
32
+ IT_CODICE_FISCALE = "Italian Codice Fiscale",
33
+ PT_NIF = "Portuguese NIF",
34
+ PL_PESEL = "Polish PESEL",
35
+ PL_NIP = "Polish NIP",
36
+ CZ_BIRTH_NUMBER = "Czech Birth Number",
37
+ CZ_ICO = "Czech ICO",
38
+ CZ_DIC = "Czech DIC",
39
+ CZ_BANK_ACCOUNT = "Czech Bank Account",
40
+ RU_INN = "Russian INN",
41
+ RU_SNILS = "Russian SNILS",
42
+ NL_BSN = "Dutch BSN",
43
+ RO_CNP = "Romanian CNP",
44
+ SK_BIRTH_NUMBER = "Slovak Birth Number",
45
+ DK_CPR = "Danish CPR",
46
+ SE_PERSONNUMMER = "Swedish Personnummer",
47
+ NO_BIRTH_NUMBER = "Norwegian Birth Number",
48
+ BR_CPF = "Brazilian CPF",
49
+ BR_CNPJ = "Brazilian CNPJ",
50
+ US_ITIN = "US ITIN",
51
+ UK_UTR = "UK UTR",
52
+ FR_SIREN = "French SIREN",
53
+ ES_NSS = "Spanish NSS",
54
+ ES_CIF = "Spanish CIF",
55
+ IT_PARTITA_IVA = "Italian Partita IVA",
56
+ PL_REGON = "Polish REGON",
57
+ SK_ICO = "Slovak ICO",
58
+ SK_DIC = "Slovak DIC",
59
+ RO_CUI = "Romanian CUI",
60
+ DK_CVR = "Danish CVR",
61
+ SE_ORGNR = "Swedish Organisationsnummer",
62
+ NO_ORGNR = "Norwegian Organisasjonsnummer",
63
+ BE_NATIONAL_NUMBER = "Belgian National Number",
64
+ BE_ENTERPRISE_NUMBER = "Belgian Enterprise Number",
65
+ AT_SVNR = "Austrian SVNR",
66
+ IE_PPS = "Irish PPS Number",
67
+ FI_HETU = "Finnish HETU",
68
+ FI_YTUNNUS = "Finnish Y-tunnus",
69
+ HU_TAX_ID = "Hungarian Tax ID",
70
+ HU_TAJ = "Hungarian TAJ",
71
+ BG_EGN = "Bulgarian EGN",
72
+ HR_OIB = "Croatian OIB",
73
+ SI_EMSO = "Slovenian EMSO",
74
+ SI_TAX_NUMBER = "Slovenian Tax Number",
75
+ LT_PERSONAL_CODE = "Lithuanian Personal Code",
76
+ LV_PERSONAL_CODE = "Latvian Personal Code",
77
+ EE_PERSONAL_CODE = "Estonian Personal Code",
78
+ CA_SIN = "Canadian SIN",
79
+ CH_AHV = "Swiss AHV",
80
+ AU_TFN = "Australian TFN",
81
+ AU_MEDICARE = "Australian Medicare",
82
+ NZ_IRD = "New Zealand IRD",
83
+ IN_AADHAAR = "Indian Aadhaar",
84
+ IN_PAN = "Indian PAN",
85
+ JP_MY_NUMBER = "Japanese My Number",
86
+ KR_RRN = "Korean RRN",
87
+ ZA_ID = "South African ID",
88
+ TR_KIMLIK = "Turkish Kimlik",
89
+ IL_ID = "Israeli ID",
90
+ AR_CUIT = "Argentine CUIT",
91
+ CL_RUT = "Chilean RUT",
92
+ CO_NIT = "Colombian NIT",
93
+ }
94
+ /** A single PII match found by a detector. */
95
+ interface PIIMatch {
96
+ entityType: string;
97
+ text: string;
98
+ start: number;
99
+ end: number;
100
+ score: number;
101
+ } //#endregion
102
+ //#region src/regex/scanner.d.ts
103
+
104
+ //# sourceMappingURL=entities.d.ts.map
105
+ interface PIIScannerOptions {
106
+ /** List of locale codes to enable (default: ["us"]). */
107
+ locales?: string[];
108
+ }
109
+ interface TokenizeResult {
110
+ text: string;
111
+ mapping: Record<string, string>;
112
+ matches: PIIMatch[];
113
+ }
114
+ interface MaskResult {
115
+ text: string;
116
+ matches: PIIMatch[];
117
+ }
118
+ interface HashResult {
119
+ text: string;
120
+ matches: PIIMatch[];
121
+ }
122
+ interface EncryptResult {
123
+ text: string;
124
+ matches: PIIMatch[];
125
+ }
126
+ interface SynthesizeResult {
127
+ text: string;
128
+ matches: PIIMatch[];
129
+ }
130
+ /**
131
+ * Local regex-based PII scanner.
132
+ *
133
+ * Usage:
134
+ * const scanner = new PIIScanner({ locales: ['us', 'eu'] })
135
+ * const matches = scanner.detect('Email john@acme.com, SSN 123-45-6789')
136
+ * const [redacted, matches] = scanner.redact('Email john@acme.com')
137
+ */
138
+ declare class PIIScanner {
139
+ private registry;
140
+ constructor(options?: PIIScannerOptions);
141
+ /** Detect PII entities in text and return deduplicated matches. */
142
+ detect(text: string, entities?: string[]): PIIMatch[];
143
+ /**
144
+ * Detect and remove PII from text.
145
+ * Returns a tuple of [redactedText, detectedMatches].
146
+ */
147
+ redact(text: string, entities?: string[]): [string, PIIMatch[]];
148
+ /**
149
+ * Detect PII and replace with numbered tokens like `<Email Address_1>`.
150
+ * Returns tokenized text, a mapping from tokens to original values, and matches.
151
+ */
152
+ tokenize(text: string, entities?: string[]): TokenizeResult;
153
+ /**
154
+ * Detect PII and partially mask each match.
155
+ */
156
+ mask(text: string, charsToShow?: number, fromEnd?: boolean, maskingChar?: string, entities?: string[]): MaskResult;
157
+ /**
158
+ * Detect PII and replace each match with a deterministic hash.
159
+ */
160
+ hash(text: string, hashType?: string, hashPrefix?: string, hashLength?: number, entities?: string[]): HashResult;
161
+ /**
162
+ * Detect PII and encrypt each match with AES-256-CBC.
163
+ * @param encryptionKey - Required, minimum 16 characters.
164
+ */
165
+ encrypt(text: string, encryptionKey: string, entities?: string[]): EncryptResult;
166
+ /**
167
+ * Detect PII and replace each match with format-preserving synthetic data.
168
+ * @param _language - Accepted for API compatibility but ignored locally.
169
+ */
170
+ synthesize(text: string, _language?: string, entities?: string[]): SynthesizeResult;
171
+ /** Remove overlapping matches, preferring higher score then longer span. */
172
+ private deduplicate;
173
+ } //#endregion
174
+
175
+ //# sourceMappingURL=scanner.d.ts.map
176
+ export { EntityType, PIIMatch, PIIScanner, PIIScannerOptions };
177
+ //# sourceMappingURL=index-Dfv8zV_d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-Dfv8zV_d.d.ts","names":[],"sources":["../src/regex/entities.ts","../src/regex/scanner.ts"],"sourcesContent":null,"mappings":";;;;;aAMY,UAAA;EAAA,aAAU,GAAA,eAAA;;EAqML,YAAQ,GAAA,cAAA;;;;ECjMR,aAAA,GAAA,eAAiB;EAKjB,GAAA,GAAA,KAAA;EAAc,GAAA,GAAA,wBAAA;EAAA,eAEpB,GAAA,kBAAA;EAAM,WACN,GAAA,aAAA;EAAQ,MAAA,GAAA,QAAA;EAGF,QAAA,GAAA,UAAU;EAKV,IAAA,GAAA,MAAU;EAKV,cAAA,GAAa,aAEnB;EAGM,MAAA,GAAA,QAAA;;;;;;;;;EAaJ,MAAA,GAAA,aAAU;EAAA,iBAAA,GAAA,wBAAA;EAAA,MAGC,GAAA,gBAAA;EAAiB,QAKI,GAAA,cAAA;EAAQ,MAwBC,GAAA,YAAA;EAAQ,eAsBf,GAAA,oBAAA;EAAc,MAwCxD,GAAA,WAAA;EAAU,MAiCV,GAAA,WAAA;EAAU,eAsBsD,GAAA,oBAAA;EAAa,MA+Bb,GAAA,aAAA;EAAgB,QAAA,GAAA,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UD1BpE,QAAA;;;;;;;;;;UCjMA,iBAAA;;;ADJjB;UCSiB,cAAA;ED4LA,IAAA,EAAA,MAAQ;WC1Ld;WACA;;AARM,UAWA,UAAA,CAXiB;EAKjB,IAAA,EAAA,MAAA;EAAc,OAAA,EAQpB,QARoB,EAAA;;AAGpB,UAQM,UAAA,CARN;EAAQ,IAAA,EAAA,MAAA;EAGF,OAAA,EAON,QAPgB,EAAA;AAK3B;AAKiB,UAAA,aAAA,CAEN;EAGM,IAAA,EAAA,MAAA;WAHN;;UAGM,gBAAA;;WAEN;;;;AAWX;;;;;;AA8FK,cA9FQ,UAAA,CA8FR;EAAU,QAiCV,QAAA;EAAU,WAsBsD,CAAA,OAAA,CAAA,EAlJ7C,iBAkJ6C;EAAa;EA+BG,MAAA,CAAA,IAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EA5KxC,QA4KwC,EAAA;;;;;sDApJ/B;;;;;+CAsBP;;;;0GAwC1C;;;;wGAiCA;;;;;qEAsBgE;;;;;qEA+BA"}
@@ -0,0 +1,450 @@
1
+ import { EntityType$1 as EntityType, PIIMatch, PIIScanner$1 as PIIScanner } from "./index-CsE6Vhax.mjs";
2
+
3
+ //#region src/types.d.ts
4
+ /**
5
+ * Configuration for Blindfold client
6
+ */
7
+ /**
8
+ * Configuration for Blindfold client
9
+ */
10
+ interface BlindfoldConfig {
11
+ /** API key for authentication. When omitted, detect() and redact() use the local regex scanner. */
12
+ apiKey?: string;
13
+ /** Base URL for the API (default: https://api.blindfold.dev/api/public/v1) */
14
+ baseUrl?: string;
15
+ /** Region for data residency ("eu" or "us"). Overrides baseUrl if baseUrl is not set. */
16
+ region?: 'eu' | 'us';
17
+ /** Optional user ID to track who is making the request */
18
+ userId?: string;
19
+ /** Maximum number of retries on transient errors (default: 2, 0 to disable) */
20
+ maxRetries?: number;
21
+ /** Initial delay in seconds before first retry (default: 0.5) */
22
+ retryDelay?: number;
23
+ /** Set to "local" to force local regex detection even when an API key is present. */
24
+ mode?: 'local' | 'api';
25
+ /** Locale codes for the local regex scanner (default: ["us"]). Example: ["us", "eu", "cz"]. Only used in local mode. */
26
+ locales?: string[];
27
+ /** Path to a JSON file with custom policy definitions. Merged over the bundled policies. */
28
+ policiesFile?: string;
29
+ }
30
+ /**
31
+ * Configuration options for tokenization
32
+ */
33
+ interface TokenizeConfig {
34
+ /** List of entities to detect */
35
+ entities?: string[];
36
+ /** Minimum confidence score for entity detection (0.0-1.0) */
37
+ score_threshold?: number;
38
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
39
+ policy?: string;
40
+ }
41
+ /**
42
+ * Configuration options for detection (no text transformation)
43
+ */
44
+ interface DetectConfig {
45
+ /** List of entities to detect */
46
+ entities?: string[];
47
+ /** Minimum confidence score for entity detection (0.0-1.0) */
48
+ score_threshold?: number;
49
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
50
+ policy?: string;
51
+ }
52
+ /**
53
+ * Response from detect endpoint
54
+ */
55
+ interface DetectResponse {
56
+ /** List of detected entities */
57
+ detected_entities: DetectedEntity[];
58
+ /** Count of detected entities */
59
+ entities_count: number;
60
+ }
61
+ /**
62
+ * Detected entity information
63
+ */
64
+ interface DetectedEntity {
65
+ /** Entity type (e.g., "person", "email address", "phone number") */
66
+ type: string;
67
+ /** Original text of the entity */
68
+ text: string;
69
+ /** Start index in text */
70
+ start: number;
71
+ /** End index in text */
72
+ end: number;
73
+ /** Confidence score (0-1) */
74
+ score: number;
75
+ }
76
+ /**
77
+ * Response from tokenize endpoint
78
+ */
79
+ interface TokenizeResponse {
80
+ /** Anonymized text with placeholders */
81
+ text: string;
82
+ /** Mapping of tokens to original values */
83
+ mapping: Record<string, string>;
84
+ /** List of detected entities */
85
+ detected_entities: DetectedEntity[];
86
+ /** Count of detected entities */
87
+ entities_count: number;
88
+ }
89
+ /**
90
+ * Response from detokenize endpoint
91
+ */
92
+ interface DetokenizeResponse {
93
+ /** Original text with restored values */
94
+ text: string;
95
+ /** Number of replacements made */
96
+ replacements_made: number;
97
+ }
98
+ /**
99
+ * Configuration options for redaction
100
+ */
101
+ interface RedactConfig {
102
+ /** Character(s) to use for masking (default: "*") */
103
+ masking_char?: string;
104
+ /** List of entities to detect */
105
+ entities?: string[];
106
+ /** Minimum confidence score for entity detection (0.0-1.0) */
107
+ score_threshold?: number;
108
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
109
+ policy?: string;
110
+ }
111
+ /**
112
+ * Response from redact endpoint
113
+ */
114
+ interface RedactResponse {
115
+ /** Text with PII permanently removed */
116
+ text: string;
117
+ /** List of detected and redacted entities */
118
+ detected_entities: DetectedEntity[];
119
+ /** Number of entities redacted */
120
+ entities_count: number;
121
+ }
122
+ /**
123
+ * Configuration options for masking
124
+ */
125
+ interface MaskConfig {
126
+ /** Number of characters to show (default: 3) */
127
+ chars_to_show?: number;
128
+ /** Whether to show characters from the end (default: false) */
129
+ from_end?: boolean;
130
+ /** Character to use for masking (default: "*") */
131
+ masking_char?: string;
132
+ /** List of entities to detect */
133
+ entities?: string[];
134
+ /** Minimum confidence score for entity detection (0.0-1.0) */
135
+ score_threshold?: number;
136
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
137
+ policy?: string;
138
+ }
139
+ /**
140
+ * Response from mask endpoint
141
+ */
142
+ interface MaskResponse {
143
+ /** Text with PII partially masked */
144
+ text: string;
145
+ /** List of detected and masked entities */
146
+ detected_entities: DetectedEntity[];
147
+ /** Number of entities masked */
148
+ entities_count: number;
149
+ }
150
+ /**
151
+ * Configuration options for synthesis
152
+ */
153
+ interface SynthesizeConfig {
154
+ /** Language code for synthetic data generation (e.g., 'en', 'cs', 'de') */
155
+ language?: string;
156
+ /** List of entities to detect */
157
+ entities?: string[];
158
+ /** Minimum confidence score for entity detection (0.0-1.0) */
159
+ score_threshold?: number;
160
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
161
+ policy?: string;
162
+ }
163
+ /**
164
+ * Response from synthesis endpoint
165
+ */
166
+ interface SynthesizeResponse {
167
+ /** Text with synthetic fake data */
168
+ text: string;
169
+ /** List of detected and synthesized entities */
170
+ detected_entities: DetectedEntity[];
171
+ /** Number of entities synthesized */
172
+ entities_count: number;
173
+ }
174
+ /**
175
+ * Configuration options for hashing
176
+ */
177
+ interface HashConfig {
178
+ /** Hash algorithm to use (e.g., 'md5', 'sha1', 'sha256', 'sha512') */
179
+ hash_type?: string;
180
+ /** Prefix to add before hash value (default: 'HASH_') */
181
+ hash_prefix?: string;
182
+ /** Length of hash to display (default: 16) */
183
+ hash_length?: number;
184
+ /** List of entities to detect */
185
+ entities?: string[];
186
+ /** Minimum confidence score for entity detection (0.0-1.0) */
187
+ score_threshold?: number;
188
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
189
+ policy?: string;
190
+ }
191
+ /**
192
+ * Response from hash endpoint
193
+ */
194
+ interface HashResponse {
195
+ /** Text with PII replaced by hash values */
196
+ text: string;
197
+ /** List of detected and hashed entities */
198
+ detected_entities: DetectedEntity[];
199
+ /** Number of entities hashed */
200
+ entities_count: number;
201
+ }
202
+ /**
203
+ * Configuration options for encryption
204
+ */
205
+ interface EncryptConfig {
206
+ /** Optional encryption key (if not provided, tenant key will be used) */
207
+ encryption_key?: string;
208
+ /** List of entities to detect */
209
+ entities?: string[];
210
+ /** Minimum confidence score for entity detection (0.0-1.0) */
211
+ score_threshold?: number;
212
+ /** Policy name to use for detection configuration (e.g., 'gdpr_eu', 'hipaa_us', 'basic') */
213
+ policy?: string;
214
+ }
215
+ /**
216
+ * Response from encrypt endpoint
217
+ */
218
+ interface EncryptResponse {
219
+ /** Text with PII encrypted */
220
+ text: string;
221
+ /** List of detected and encrypted entities */
222
+ detected_entities: DetectedEntity[];
223
+ /** Number of entities encrypted */
224
+ entities_count: number;
225
+ }
226
+ /**
227
+ * Response wrapper for batch processing
228
+ */
229
+ interface BatchResponse {
230
+ /** Array of individual results (or { error: string } for failed items) */
231
+ results: Record<string, unknown>[];
232
+ /** Total number of texts submitted */
233
+ total: number;
234
+ /** Number of texts processed successfully */
235
+ succeeded: number;
236
+ /** Number of texts that failed processing */
237
+ failed: number;
238
+ }
239
+ /**
240
+ * Error response from API
241
+ */
242
+ interface APIErrorResponse {
243
+ detail?: string;
244
+ message?: string;
245
+ } //#endregion
246
+ //#region src/client.d.ts
247
+
248
+ //# sourceMappingURL=types.d.ts.map
249
+ /**
250
+ * Blindfold client for tokenization and detokenization.
251
+ *
252
+ * When no `apiKey` is provided, all methods run locally using the
253
+ * built-in regex PII scanner. Set `mode: "local"` to force local
254
+ * mode even when an API key is present.
255
+ */
256
+ declare class Blindfold {
257
+ private apiKey?;
258
+ private baseUrl;
259
+ private userId?;
260
+ private maxRetries;
261
+ private retryDelay;
262
+ private mode?;
263
+ private locales?;
264
+ private policies;
265
+ private _scanner?;
266
+ /**
267
+ * Create a new Blindfold client
268
+ * @param config - Configuration options. Can be omitted entirely for local-only mode.
269
+ */
270
+ constructor(config?: BlindfoldConfig);
271
+ private get useLocal();
272
+ private getScanner;
273
+ private resolvePolicy;
274
+ private retryWait;
275
+ /**
276
+ * Make an authenticated request to the API
277
+ */
278
+ private request;
279
+ /**
280
+ * Tokenize text by replacing sensitive information with tokens
281
+ * @param text - Text to tokenize
282
+ * @param config - Optional configuration
283
+ * @returns Promise with tokenized text and mapping
284
+ */
285
+ tokenize(text: string, config?: TokenizeConfig): Promise<TokenizeResponse>;
286
+ private tokenizeLocal;
287
+ /**
288
+ * Detect PII in text without modifying it
289
+ *
290
+ * Returns only the detected entities with their types, positions,
291
+ * and confidence scores. The original text is not transformed.
292
+ *
293
+ * When no API key is set (or `mode: "local"`), detection runs locally
294
+ * using the built-in regex scanner.
295
+ *
296
+ * @param text - Text to analyze for PII
297
+ * @param config - Optional configuration (entities, score_threshold, policy)
298
+ * @returns Promise with detected entities
299
+ */
300
+ detect(text: string, config?: DetectConfig): Promise<DetectResponse>;
301
+ private detectLocal;
302
+ /**
303
+ * Detokenize text by replacing tokens with original values
304
+ *
305
+ * This method performs detokenization CLIENT-SIDE for better performance,
306
+ * security, and to work offline. No API call is made.
307
+ *
308
+ * @param text - Tokenized text
309
+ * @param mapping - Token mapping from tokenize response
310
+ * @returns DetokenizeResponse with original text
311
+ */
312
+ detokenize(text: string, mapping: Record<string, string>): DetokenizeResponse;
313
+ /**
314
+ * Redact (permanently remove) sensitive information from text
315
+ *
316
+ * WARNING: Redaction is irreversible - original data cannot be restored!
317
+ *
318
+ * When no API key is set (or `mode: "local"`), redaction runs locally
319
+ * using the built-in regex scanner, replacing PII with `<Entity Name>` placeholders.
320
+ *
321
+ * @param text - Text to redact
322
+ * @param config - Optional configuration (masking_char, entities)
323
+ * @returns Promise with redacted text and detected entities
324
+ */
325
+ redact(text: string, config?: RedactConfig): Promise<RedactResponse>;
326
+ private redactLocal;
327
+ /**
328
+ * Mask (partially hide) sensitive information from text
329
+ *
330
+ * @param text - Text to mask
331
+ * @param config - Optional configuration (chars_to_show, from_end, masking_char, entities)
332
+ * @returns Promise with masked text and detected entities
333
+ */
334
+ mask(text: string, config?: MaskConfig): Promise<MaskResponse>;
335
+ private maskLocal;
336
+ /**
337
+ * Synthesize (replace real data with synthetic fake data)
338
+ *
339
+ * When no API key is set (or `mode: "local"`), synthesis runs locally
340
+ * using format-preserving random generation.
341
+ *
342
+ * @param text - Text to synthesize
343
+ * @param config - Optional configuration (language, entities)
344
+ * @returns Promise with synthetic text and detected entities
345
+ */
346
+ synthesize(text: string, config?: SynthesizeConfig): Promise<SynthesizeResponse>;
347
+ private synthesizeLocal;
348
+ /**
349
+ * Hash (replace with deterministic hash values)
350
+ *
351
+ * @param text - Text to hash
352
+ * @param config - Optional configuration (hash_type, hash_prefix, hash_length, entities)
353
+ * @returns Promise with hashed text and detected entities
354
+ */
355
+ hash(text: string, config?: HashConfig): Promise<HashResponse>;
356
+ private hashLocal;
357
+ /**
358
+ * Encrypt (reversibly protect) sensitive data in text using AES encryption
359
+ *
360
+ * @param text - Text to encrypt
361
+ * @param config - Optional configuration (encryption_key, entities)
362
+ * @returns Promise with encrypted text and detected entities
363
+ */
364
+ encrypt(text: string, config?: EncryptConfig): Promise<EncryptResponse>;
365
+ private encryptLocal;
366
+ /**
367
+ * Tokenize multiple texts in a single request
368
+ * @param texts - Array of texts to tokenize (max 100)
369
+ * @param config - Optional configuration
370
+ * @returns Promise with batch results
371
+ */
372
+ tokenizeBatch(texts: string[], config?: TokenizeConfig): Promise<BatchResponse>;
373
+ /**
374
+ * Detect PII in multiple texts in a single request
375
+ * @param texts - Array of texts to analyze (max 100)
376
+ * @param config - Optional configuration
377
+ * @returns Promise with batch results
378
+ */
379
+ detectBatch(texts: string[], config?: DetectConfig): Promise<BatchResponse>;
380
+ /**
381
+ * Redact PII from multiple texts in a single request
382
+ * @param texts - Array of texts to redact (max 100)
383
+ * @param config - Optional configuration
384
+ * @returns Promise with batch results
385
+ */
386
+ redactBatch(texts: string[], config?: RedactConfig): Promise<BatchResponse>;
387
+ /**
388
+ * Mask PII in multiple texts in a single request
389
+ * @param texts - Array of texts to mask (max 100)
390
+ * @param config - Optional configuration
391
+ * @returns Promise with batch results
392
+ */
393
+ maskBatch(texts: string[], config?: MaskConfig): Promise<BatchResponse>;
394
+ /**
395
+ * Synthesize multiple texts in a single request
396
+ * @param texts - Array of texts to synthesize (max 100)
397
+ * @param config - Optional configuration
398
+ * @returns Promise with batch results
399
+ */
400
+ synthesizeBatch(texts: string[], config?: SynthesizeConfig): Promise<BatchResponse>;
401
+ /**
402
+ * Hash PII in multiple texts in a single request
403
+ * @param texts - Array of texts to hash (max 100)
404
+ * @param config - Optional configuration
405
+ * @returns Promise with batch results
406
+ */
407
+ hashBatch(texts: string[], config?: HashConfig): Promise<BatchResponse>;
408
+ /**
409
+ * Encrypt PII in multiple texts in a single request
410
+ * @param texts - Array of texts to encrypt (max 100)
411
+ * @param config - Optional configuration
412
+ * @returns Promise with batch results
413
+ */
414
+ encryptBatch(texts: string[], config?: EncryptConfig): Promise<BatchResponse>;
415
+ } //#endregion
416
+ //#region src/errors.d.ts
417
+
418
+ //# sourceMappingURL=client.d.ts.map
419
+ /**
420
+ * Base error class for Blindfold SDK
421
+ */
422
+ declare class BlindfoldError extends Error {
423
+ constructor(message: string);
424
+ }
425
+ /**
426
+ * Error thrown when authentication fails
427
+ */
428
+ declare class AuthenticationError extends BlindfoldError {
429
+ constructor(message?: string);
430
+ }
431
+ /**
432
+ * Error thrown when API request fails
433
+ */
434
+ declare class APIError extends BlindfoldError {
435
+ statusCode: number;
436
+ responseBody?: unknown;
437
+ constructor(message: string, statusCode: number, responseBody?: unknown);
438
+ }
439
+ /**
440
+ * Error thrown when network request fails
441
+ */
442
+ declare class NetworkError extends BlindfoldError {
443
+ constructor(message?: string);
444
+ }
445
+
446
+ //#endregion
447
+ //# sourceMappingURL=errors.d.ts.map
448
+
449
+ export { APIError, APIErrorResponse, AuthenticationError, BatchResponse, Blindfold, BlindfoldConfig, BlindfoldError, DetectConfig, DetectResponse, DetectedEntity, DetokenizeResponse, EntityType, NetworkError, PIIMatch, PIIScanner, TokenizeConfig, TokenizeResponse };
450
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/client.ts","../src/errors.ts"],"sourcesContent":null,"mappings":";;;;;;;;;UAGiB,eAAA;;;EAAA;;;;EAwBA;;;;EAYA;;;;EAYA;;;;AAUjB;;;;AAgBiB,U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