@quba/sensitive-data-protection 0.0.8 → 0.0.12

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/dist/index.mjs CHANGED
@@ -1,16 +1,16 @@
1
1
  //#region src/runtime.ts
2
2
  /**
3
3
  * Sensitive Data Protection API
4
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
5
5
  *
6
- * The version of the OpenAPI document: 0.0.8
6
+ * The version of the OpenAPI document: 0.1.0
7
7
  *
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
10
  * https://openapi-generator.tech
11
11
  * Do not edit the class manually.
12
12
  */
13
- const BASE_PATH = "https://app.quba.ae/api/sdp".replace(/\/+$/, "");
13
+ const BASE_PATH = "https://www.quba.co/api/sdp".replace(/\/+$/, "");
14
14
  var Configuration = class {
15
15
  constructor(configuration = {}) {
16
16
  this.configuration = configuration;
@@ -263,514 +263,805 @@ var TextApiResponse = class {
263
263
  };
264
264
 
265
265
  //#endregion
266
- //#region src/models/Entities.ts
266
+ //#region src/models/DetectRuleEntitiesInner.ts
267
267
  /**
268
- * Check if a given object implements the Entities interface.
268
+ * @export
269
+ */
270
+ const DetectRuleEntitiesInnerTypeEnum = {
271
+ model: "model",
272
+ regex: "regex"
273
+ };
274
+ /**
275
+ * Check if a given object implements the DetectRuleEntitiesInner interface.
269
276
  */
270
- function instanceOfEntities(value) {
277
+ function instanceOfDetectRuleEntitiesInner(value) {
278
+ if (!("value" in value) || value["value"] === void 0) return false;
271
279
  return true;
272
280
  }
273
- function EntitiesFromJSON(json) {
274
- return EntitiesFromJSONTyped(json, false);
281
+ function DetectRuleEntitiesInnerFromJSON(json) {
282
+ return DetectRuleEntitiesInnerFromJSONTyped(json, false);
275
283
  }
276
- function EntitiesFromJSONTyped(json, ignoreDiscriminator) {
277
- return json;
284
+ function DetectRuleEntitiesInnerFromJSONTyped(json, ignoreDiscriminator) {
285
+ if (json == null) return json;
286
+ return {
287
+ "type": json["type"] == null ? void 0 : json["type"],
288
+ "value": json["value"]
289
+ };
278
290
  }
279
- function EntitiesToJSON(json) {
280
- return EntitiesToJSONTyped(json, false);
291
+ function DetectRuleEntitiesInnerToJSON(json) {
292
+ return DetectRuleEntitiesInnerToJSONTyped(json, false);
281
293
  }
282
- function EntitiesToJSONTyped(value, ignoreDiscriminator = false) {
283
- return value;
294
+ function DetectRuleEntitiesInnerToJSONTyped(value, ignoreDiscriminator = false) {
295
+ if (value == null) return value;
296
+ return {
297
+ "type": value["type"],
298
+ "value": value["value"]
299
+ };
284
300
  }
285
301
 
286
302
  //#endregion
287
- //#region src/models/EncryptRule.ts
303
+ //#region src/models/AnonymizeRequestBodyRulesInner.ts
288
304
  /**
289
305
  * @export
290
306
  */
291
- const EncryptRuleTypeEnum = { encrypt: "encrypt" };
307
+ const AnonymizeRequestBodyRulesInnerTypeEnum = {
308
+ replace: "replace",
309
+ redact: "redact",
310
+ sha256: "sha256",
311
+ sha512: "sha512",
312
+ encrypt: "encrypt",
313
+ mask: "mask",
314
+ detect: "detect"
315
+ };
292
316
  /**
293
- * Check if a given object implements the EncryptRule interface.
317
+ * Check if a given object implements the AnonymizeRequestBodyRulesInner interface.
294
318
  */
295
- function instanceOfEncryptRule(value) {
319
+ function instanceOfAnonymizeRequestBodyRulesInner(value) {
296
320
  if (!("entities" in value) || value["entities"] === void 0) return false;
297
321
  return true;
298
322
  }
299
- function EncryptRuleFromJSON(json) {
300
- return EncryptRuleFromJSONTyped(json, false);
323
+ function AnonymizeRequestBodyRulesInnerFromJSON(json) {
324
+ return AnonymizeRequestBodyRulesInnerFromJSONTyped(json, false);
301
325
  }
302
- function EncryptRuleFromJSONTyped(json, ignoreDiscriminator) {
326
+ function AnonymizeRequestBodyRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
303
327
  if (json == null) return json;
304
328
  return {
305
329
  "type": json["type"] == null ? void 0 : json["type"],
306
- "entities": EntitiesFromJSON(json["entities"]),
307
- "key": json["key"] == null ? void 0 : json["key"]
330
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
331
+ "replacement": json["replacement"] == null ? void 0 : json["replacement"],
332
+ "key": json["key"] == null ? void 0 : json["key"],
333
+ "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
334
+ "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
335
+ "from_end": json["from_end"] == null ? void 0 : json["from_end"]
308
336
  };
309
337
  }
310
- function EncryptRuleToJSON(json) {
311
- return EncryptRuleToJSONTyped(json, false);
338
+ function AnonymizeRequestBodyRulesInnerToJSON(json) {
339
+ return AnonymizeRequestBodyRulesInnerToJSONTyped(json, false);
312
340
  }
313
- function EncryptRuleToJSONTyped(value, ignoreDiscriminator = false) {
341
+ function AnonymizeRequestBodyRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
314
342
  if (value == null) return value;
315
343
  return {
316
344
  "type": value["type"],
317
- "entities": EntitiesToJSON(value["entities"]),
318
- "key": value["key"]
345
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
346
+ "replacement": value["replacement"],
347
+ "key": value["key"],
348
+ "masking_char": value["masking_char"],
349
+ "chars_to_mask": value["chars_to_mask"],
350
+ "from_end": value["from_end"]
319
351
  };
320
352
  }
321
353
 
322
354
  //#endregion
323
- //#region src/models/MaskRule.ts
355
+ //#region src/models/AnonymizeRequestBody.ts
356
+ /**
357
+ * Check if a given object implements the AnonymizeRequestBody interface.
358
+ */
359
+ function instanceOfAnonymizeRequestBody(value) {
360
+ if (!("text" in value) || value["text"] === void 0) return false;
361
+ return true;
362
+ }
363
+ function AnonymizeRequestBodyFromJSON(json) {
364
+ return AnonymizeRequestBodyFromJSONTyped(json, false);
365
+ }
366
+ function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
367
+ if (json == null) return json;
368
+ return {
369
+ "text": json["text"],
370
+ "rules": json["rules"] == null ? void 0 : json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON),
371
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
372
+ "policy": json["policy"] == null ? void 0 : json["policy"]
373
+ };
374
+ }
375
+ function AnonymizeRequestBodyToJSON(json) {
376
+ return AnonymizeRequestBodyToJSONTyped(json, false);
377
+ }
378
+ function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
379
+ if (value == null) return value;
380
+ return {
381
+ "text": value["text"],
382
+ "rules": value["rules"] == null ? void 0 : value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON),
383
+ "confidence_threshold": value["confidence_threshold"],
384
+ "policy": value["policy"]
385
+ };
386
+ }
387
+
388
+ //#endregion
389
+ //#region src/models/Usage.ts
390
+ /**
391
+ * Check if a given object implements the Usage interface.
392
+ */
393
+ function instanceOfUsage(value) {
394
+ if (!("input_tokens" in value) || value["input_tokens"] === void 0) return false;
395
+ if (!("inference_ms" in value) || value["inference_ms"] === void 0) return false;
396
+ return true;
397
+ }
398
+ function UsageFromJSON(json) {
399
+ return UsageFromJSONTyped(json, false);
400
+ }
401
+ function UsageFromJSONTyped(json, ignoreDiscriminator) {
402
+ if (json == null) return json;
403
+ return {
404
+ "input_tokens": json["input_tokens"],
405
+ "inference_ms": json["inference_ms"]
406
+ };
407
+ }
408
+ function UsageToJSON(json) {
409
+ return UsageToJSONTyped(json, false);
410
+ }
411
+ function UsageToJSONTyped(value, ignoreDiscriminator = false) {
412
+ if (value == null) return value;
413
+ return {
414
+ "input_tokens": value["input_tokens"],
415
+ "inference_ms": value["inference_ms"]
416
+ };
417
+ }
418
+
419
+ //#endregion
420
+ //#region src/models/TextRange.ts
421
+ /**
422
+ * Check if a given object implements the TextRange interface.
423
+ */
424
+ function instanceOfTextRange(value) {
425
+ if (!("start" in value) || value["start"] === void 0) return false;
426
+ if (!("end" in value) || value["end"] === void 0) return false;
427
+ if (!("value" in value) || value["value"] === void 0) return false;
428
+ return true;
429
+ }
430
+ function TextRangeFromJSON(json) {
431
+ return TextRangeFromJSONTyped(json, false);
432
+ }
433
+ function TextRangeFromJSONTyped(json, ignoreDiscriminator) {
434
+ if (json == null) return json;
435
+ return {
436
+ "start": json["start"],
437
+ "end": json["end"],
438
+ "value": json["value"]
439
+ };
440
+ }
441
+ function TextRangeToJSON(json) {
442
+ return TextRangeToJSONTyped(json, false);
443
+ }
444
+ function TextRangeToJSONTyped(value, ignoreDiscriminator = false) {
445
+ if (value == null) return value;
446
+ return {
447
+ "start": value["start"],
448
+ "end": value["end"],
449
+ "value": value["value"]
450
+ };
451
+ }
452
+
453
+ //#endregion
454
+ //#region src/models/AnonymizeResponseBodyResultsInner.ts
324
455
  /**
325
456
  * @export
326
457
  */
327
- const MaskRuleTypeEnum = { mask: "mask" };
458
+ const AnonymizeResponseBodyResultsInnerTypeEnum = {
459
+ model: "model",
460
+ regex: "regex"
461
+ };
328
462
  /**
329
- * Check if a given object implements the MaskRule interface.
463
+ * Check if a given object implements the AnonymizeResponseBodyResultsInner interface.
330
464
  */
331
- function instanceOfMaskRule(value) {
465
+ function instanceOfAnonymizeResponseBodyResultsInner(value) {
466
+ if (!("rule" in value) || value["rule"] === void 0) return false;
467
+ if (!("value" in value) || value["value"] === void 0) return false;
468
+ if (!("input" in value) || value["input"] === void 0) return false;
469
+ if (!("output" in value) || value["output"] === void 0) return false;
470
+ return true;
471
+ }
472
+ function AnonymizeResponseBodyResultsInnerFromJSON(json) {
473
+ return AnonymizeResponseBodyResultsInnerFromJSONTyped(json, false);
474
+ }
475
+ function AnonymizeResponseBodyResultsInnerFromJSONTyped(json, ignoreDiscriminator) {
476
+ if (json == null) return json;
477
+ return {
478
+ "type": json["type"] == null ? void 0 : json["type"],
479
+ "rule": json["rule"],
480
+ "value": json["value"],
481
+ "input": TextRangeFromJSON(json["input"]),
482
+ "output": TextRangeFromJSON(json["output"]),
483
+ "score": json["score"] == null ? void 0 : json["score"]
484
+ };
485
+ }
486
+ function AnonymizeResponseBodyResultsInnerToJSON(json) {
487
+ return AnonymizeResponseBodyResultsInnerToJSONTyped(json, false);
488
+ }
489
+ function AnonymizeResponseBodyResultsInnerToJSONTyped(value, ignoreDiscriminator = false) {
490
+ if (value == null) return value;
491
+ return {
492
+ "type": value["type"],
493
+ "rule": value["rule"],
494
+ "value": value["value"],
495
+ "input": TextRangeToJSON(value["input"]),
496
+ "output": TextRangeToJSON(value["output"]),
497
+ "score": value["score"]
498
+ };
499
+ }
500
+
501
+ //#endregion
502
+ //#region src/models/AnonymizeResponseBody.ts
503
+ /**
504
+ * Check if a given object implements the AnonymizeResponseBody interface.
505
+ */
506
+ function instanceOfAnonymizeResponseBody(value) {
507
+ if (!("text" in value) || value["text"] === void 0) return false;
508
+ if (!("usage" in value) || value["usage"] === void 0) return false;
509
+ return true;
510
+ }
511
+ function AnonymizeResponseBodyFromJSON(json) {
512
+ return AnonymizeResponseBodyFromJSONTyped(json, false);
513
+ }
514
+ function AnonymizeResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
515
+ if (json == null) return json;
516
+ return {
517
+ "text": json["text"],
518
+ "results": json["results"] == null ? void 0 : json["results"].map(AnonymizeResponseBodyResultsInnerFromJSON),
519
+ "usage": UsageFromJSON(json["usage"])
520
+ };
521
+ }
522
+ function AnonymizeResponseBodyToJSON(json) {
523
+ return AnonymizeResponseBodyToJSONTyped(json, false);
524
+ }
525
+ function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
526
+ if (value == null) return value;
527
+ return {
528
+ "text": value["text"],
529
+ "results": value["results"] == null ? void 0 : value["results"].map(AnonymizeResponseBodyResultsInnerToJSON),
530
+ "usage": UsageToJSON(value["usage"])
531
+ };
532
+ }
533
+
534
+ //#endregion
535
+ //#region src/models/PolicyDocumentRulesInner.ts
536
+ /**
537
+ * @export
538
+ */
539
+ const PolicyDocumentRulesInnerTypeEnum = {
540
+ detect: "detect",
541
+ redact: "redact",
542
+ replace: "replace",
543
+ mask: "mask",
544
+ sha256: "sha256",
545
+ sha512: "sha512",
546
+ encrypt: "encrypt"
547
+ };
548
+ /**
549
+ * Check if a given object implements the PolicyDocumentRulesInner interface.
550
+ */
551
+ function instanceOfPolicyDocumentRulesInner(value) {
332
552
  if (!("entities" in value) || value["entities"] === void 0) return false;
333
553
  return true;
334
554
  }
335
- function MaskRuleFromJSON(json) {
336
- return MaskRuleFromJSONTyped(json, false);
555
+ function PolicyDocumentRulesInnerFromJSON(json) {
556
+ return PolicyDocumentRulesInnerFromJSONTyped(json, false);
337
557
  }
338
- function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
558
+ function PolicyDocumentRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
339
559
  if (json == null) return json;
340
560
  return {
341
561
  "type": json["type"] == null ? void 0 : json["type"],
342
- "entities": EntitiesFromJSON(json["entities"]),
562
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
563
+ "replacement": json["replacement"] == null ? void 0 : json["replacement"],
343
564
  "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
344
565
  "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
345
- "from_end": json["from_end"] == null ? void 0 : json["from_end"]
566
+ "from_end": json["from_end"] == null ? void 0 : json["from_end"],
567
+ "key": json["key"] == null ? void 0 : json["key"]
346
568
  };
347
569
  }
348
- function MaskRuleToJSON(json) {
349
- return MaskRuleToJSONTyped(json, false);
570
+ function PolicyDocumentRulesInnerToJSON(json) {
571
+ return PolicyDocumentRulesInnerToJSONTyped(json, false);
350
572
  }
351
- function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
573
+ function PolicyDocumentRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
352
574
  if (value == null) return value;
353
575
  return {
354
576
  "type": value["type"],
355
- "entities": EntitiesToJSON(value["entities"]),
577
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
578
+ "replacement": value["replacement"],
356
579
  "masking_char": value["masking_char"],
357
580
  "chars_to_mask": value["chars_to_mask"],
358
- "from_end": value["from_end"]
581
+ "from_end": value["from_end"],
582
+ "key": value["key"]
359
583
  };
360
584
  }
361
585
 
362
586
  //#endregion
363
- //#region src/models/RedactRule.ts
587
+ //#region src/models/PolicyDocument.ts
364
588
  /**
365
589
  * @export
366
590
  */
367
- const RedactRuleTypeEnum = { redact: "redact" };
591
+ const PolicyDocumentSchemaVersionEnum = { NUMBER_1: 1 };
368
592
  /**
369
- * Check if a given object implements the RedactRule interface.
593
+ * Check if a given object implements the PolicyDocument interface.
370
594
  */
371
- function instanceOfRedactRule(value) {
372
- if (!("entities" in value) || value["entities"] === void 0) return false;
595
+ function instanceOfPolicyDocument(value) {
596
+ if (!("schema_version" in value) || value["schema_version"] === void 0) return false;
597
+ if (!("rules" in value) || value["rules"] === void 0) return false;
373
598
  return true;
374
599
  }
375
- function RedactRuleFromJSON(json) {
376
- return RedactRuleFromJSONTyped(json, false);
600
+ function PolicyDocumentFromJSON(json) {
601
+ return PolicyDocumentFromJSONTyped(json, false);
377
602
  }
378
- function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
603
+ function PolicyDocumentFromJSONTyped(json, ignoreDiscriminator) {
379
604
  if (json == null) return json;
380
605
  return {
381
- "type": json["type"] == null ? void 0 : json["type"],
382
- "entities": EntitiesFromJSON(json["entities"])
606
+ "schema_version": json["schema_version"],
607
+ "name": json["name"] == null ? void 0 : json["name"],
608
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"],
609
+ "rules": json["rules"].map(PolicyDocumentRulesInnerFromJSON)
383
610
  };
384
611
  }
385
- function RedactRuleToJSON(json) {
386
- return RedactRuleToJSONTyped(json, false);
612
+ function PolicyDocumentToJSON(json) {
613
+ return PolicyDocumentToJSONTyped(json, false);
387
614
  }
388
- function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
615
+ function PolicyDocumentToJSONTyped(value, ignoreDiscriminator = false) {
389
616
  if (value == null) return value;
390
617
  return {
391
- "type": value["type"],
392
- "entities": EntitiesToJSON(value["entities"])
618
+ "schema_version": value["schema_version"],
619
+ "name": value["name"],
620
+ "confidence_threshold": value["confidence_threshold"],
621
+ "rules": value["rules"].map(PolicyDocumentRulesInnerToJSON)
393
622
  };
394
623
  }
395
624
 
396
625
  //#endregion
397
- //#region src/models/ReplaceRule.ts
626
+ //#region src/models/CreatePolicyRequest.ts
627
+ /**
628
+ * Check if a given object implements the CreatePolicyRequest interface.
629
+ */
630
+ function instanceOfCreatePolicyRequest(value) {
631
+ if (!("name" in value) || value["name"] === void 0) return false;
632
+ if (!("document" in value) || value["document"] === void 0) return false;
633
+ return true;
634
+ }
635
+ function CreatePolicyRequestFromJSON(json) {
636
+ return CreatePolicyRequestFromJSONTyped(json, false);
637
+ }
638
+ function CreatePolicyRequestFromJSONTyped(json, ignoreDiscriminator) {
639
+ if (json == null) return json;
640
+ return {
641
+ "name": json["name"],
642
+ "document": PolicyDocumentFromJSON(json["document"])
643
+ };
644
+ }
645
+ function CreatePolicyRequestToJSON(json) {
646
+ return CreatePolicyRequestToJSONTyped(json, false);
647
+ }
648
+ function CreatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
649
+ if (value == null) return value;
650
+ return {
651
+ "name": value["name"],
652
+ "document": PolicyDocumentToJSON(value["document"])
653
+ };
654
+ }
655
+
656
+ //#endregion
657
+ //#region src/models/DetectRule.ts
398
658
  /**
399
659
  * @export
400
660
  */
401
- const ReplaceRuleTypeEnum = { replace: "replace" };
661
+ const DetectRuleTypeEnum = { detect: "detect" };
402
662
  /**
403
- * Check if a given object implements the ReplaceRule interface.
663
+ * Check if a given object implements the DetectRule interface.
404
664
  */
405
- function instanceOfReplaceRule(value) {
665
+ function instanceOfDetectRule(value) {
406
666
  if (!("entities" in value) || value["entities"] === void 0) return false;
407
667
  return true;
408
668
  }
409
- function ReplaceRuleFromJSON(json) {
410
- return ReplaceRuleFromJSONTyped(json, false);
669
+ function DetectRuleFromJSON(json) {
670
+ return DetectRuleFromJSONTyped(json, false);
411
671
  }
412
- function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
672
+ function DetectRuleFromJSONTyped(json, ignoreDiscriminator) {
413
673
  if (json == null) return json;
414
674
  return {
415
675
  "type": json["type"] == null ? void 0 : json["type"],
416
- "entities": EntitiesFromJSON(json["entities"]),
417
- "replacement": json["replacement"] == null ? void 0 : json["replacement"]
676
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
418
677
  };
419
678
  }
420
- function ReplaceRuleToJSON(json) {
421
- return ReplaceRuleToJSONTyped(json, false);
679
+ function DetectRuleToJSON(json) {
680
+ return DetectRuleToJSONTyped(json, false);
422
681
  }
423
- function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
682
+ function DetectRuleToJSONTyped(value, ignoreDiscriminator = false) {
424
683
  if (value == null) return value;
425
684
  return {
426
685
  "type": value["type"],
427
- "entities": EntitiesToJSON(value["entities"]),
428
- "replacement": value["replacement"]
686
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
429
687
  };
430
688
  }
431
689
 
432
690
  //#endregion
433
- //#region src/models/SHA256Rule.ts
691
+ //#region src/models/EncryptRule.ts
434
692
  /**
435
693
  * @export
436
694
  */
437
- const SHA256RuleTypeEnum = { sha256: "sha256" };
695
+ const EncryptRuleTypeEnum = { encrypt: "encrypt" };
438
696
  /**
439
- * Check if a given object implements the SHA256Rule interface.
697
+ * Check if a given object implements the EncryptRule interface.
440
698
  */
441
- function instanceOfSHA256Rule(value) {
699
+ function instanceOfEncryptRule(value) {
442
700
  if (!("entities" in value) || value["entities"] === void 0) return false;
443
701
  return true;
444
702
  }
445
- function SHA256RuleFromJSON(json) {
446
- return SHA256RuleFromJSONTyped(json, false);
703
+ function EncryptRuleFromJSON(json) {
704
+ return EncryptRuleFromJSONTyped(json, false);
447
705
  }
448
- function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
706
+ function EncryptRuleFromJSONTyped(json, ignoreDiscriminator) {
449
707
  if (json == null) return json;
450
708
  return {
451
709
  "type": json["type"] == null ? void 0 : json["type"],
452
- "entities": EntitiesFromJSON(json["entities"])
710
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
711
+ "key": json["key"] == null ? void 0 : json["key"]
453
712
  };
454
713
  }
455
- function SHA256RuleToJSON(json) {
456
- return SHA256RuleToJSONTyped(json, false);
714
+ function EncryptRuleToJSON(json) {
715
+ return EncryptRuleToJSONTyped(json, false);
457
716
  }
458
- function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
717
+ function EncryptRuleToJSONTyped(value, ignoreDiscriminator = false) {
459
718
  if (value == null) return value;
460
719
  return {
461
720
  "type": value["type"],
462
- "entities": EntitiesToJSON(value["entities"])
721
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
722
+ "key": value["key"]
463
723
  };
464
724
  }
465
725
 
466
726
  //#endregion
467
- //#region src/models/SHA512Rule.ts
727
+ //#region src/models/ValidationErrorLocInner.ts
468
728
  /**
469
- * @export
729
+ * Check if a given object implements the ValidationErrorLocInner interface.
470
730
  */
471
- const SHA512RuleTypeEnum = { sha512: "sha512" };
731
+ function instanceOfValidationErrorLocInner(value) {
732
+ return true;
733
+ }
734
+ function ValidationErrorLocInnerFromJSON(json) {
735
+ return ValidationErrorLocInnerFromJSONTyped(json, false);
736
+ }
737
+ function ValidationErrorLocInnerFromJSONTyped(json, ignoreDiscriminator) {
738
+ return json;
739
+ }
740
+ function ValidationErrorLocInnerToJSON(json) {
741
+ return ValidationErrorLocInnerToJSONTyped(json, false);
742
+ }
743
+ function ValidationErrorLocInnerToJSONTyped(value, ignoreDiscriminator = false) {
744
+ return value;
745
+ }
746
+
747
+ //#endregion
748
+ //#region src/models/ValidationError.ts
472
749
  /**
473
- * Check if a given object implements the SHA512Rule interface.
750
+ * Check if a given object implements the ValidationError interface.
474
751
  */
475
- function instanceOfSHA512Rule(value) {
476
- if (!("entities" in value) || value["entities"] === void 0) return false;
752
+ function instanceOfValidationError(value) {
753
+ if (!("loc" in value) || value["loc"] === void 0) return false;
754
+ if (!("msg" in value) || value["msg"] === void 0) return false;
755
+ if (!("type" in value) || value["type"] === void 0) return false;
477
756
  return true;
478
757
  }
479
- function SHA512RuleFromJSON(json) {
480
- return SHA512RuleFromJSONTyped(json, false);
758
+ function ValidationErrorFromJSON(json) {
759
+ return ValidationErrorFromJSONTyped(json, false);
481
760
  }
482
- function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
761
+ function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
483
762
  if (json == null) return json;
484
763
  return {
485
- "type": json["type"] == null ? void 0 : json["type"],
486
- "entities": EntitiesFromJSON(json["entities"])
764
+ "loc": json["loc"].map(ValidationErrorLocInnerFromJSON),
765
+ "msg": json["msg"],
766
+ "type": json["type"],
767
+ "input": json["input"] == null ? void 0 : json["input"],
768
+ "ctx": json["ctx"] == null ? void 0 : json["ctx"]
487
769
  };
488
770
  }
489
- function SHA512RuleToJSON(json) {
490
- return SHA512RuleToJSONTyped(json, false);
771
+ function ValidationErrorToJSON(json) {
772
+ return ValidationErrorToJSONTyped(json, false);
491
773
  }
492
- function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
774
+ function ValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
493
775
  if (value == null) return value;
494
776
  return {
777
+ "loc": value["loc"].map(ValidationErrorLocInnerToJSON),
778
+ "msg": value["msg"],
495
779
  "type": value["type"],
496
- "entities": EntitiesToJSON(value["entities"])
780
+ "input": value["input"],
781
+ "ctx": value["ctx"]
497
782
  };
498
783
  }
499
784
 
500
785
  //#endregion
501
- //#region src/models/AnonymizeRequestBodyRulesInner.ts
502
- function AnonymizeRequestBodyRulesInnerFromJSON(json) {
503
- return AnonymizeRequestBodyRulesInnerFromJSONTyped(json, false);
786
+ //#region src/models/HTTPValidationError.ts
787
+ /**
788
+ * Check if a given object implements the HTTPValidationError interface.
789
+ */
790
+ function instanceOfHTTPValidationError(value) {
791
+ return true;
504
792
  }
505
- function AnonymizeRequestBodyRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
793
+ function HTTPValidationErrorFromJSON(json) {
794
+ return HTTPValidationErrorFromJSONTyped(json, false);
795
+ }
796
+ function HTTPValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
506
797
  if (json == null) return json;
507
- switch (json["type"]) {
508
- case "encrypt": return Object.assign({}, EncryptRuleFromJSONTyped(json, true), { type: "encrypt" });
509
- case "mask": return Object.assign({}, MaskRuleFromJSONTyped(json, true), { type: "mask" });
510
- case "redact": return Object.assign({}, RedactRuleFromJSONTyped(json, true), { type: "redact" });
511
- case "replace": return Object.assign({}, ReplaceRuleFromJSONTyped(json, true), { type: "replace" });
512
- case "sha256": return Object.assign({}, SHA256RuleFromJSONTyped(json, true), { type: "sha256" });
513
- case "sha512": return Object.assign({}, SHA512RuleFromJSONTyped(json, true), { type: "sha512" });
514
- default: return json;
515
- }
798
+ return { "detail": json["detail"] == null ? void 0 : json["detail"].map(ValidationErrorFromJSON) };
516
799
  }
517
- function AnonymizeRequestBodyRulesInnerToJSON(json) {
518
- return AnonymizeRequestBodyRulesInnerToJSONTyped(json, false);
800
+ function HTTPValidationErrorToJSON(json) {
801
+ return HTTPValidationErrorToJSONTyped(json, false);
519
802
  }
520
- function AnonymizeRequestBodyRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
803
+ function HTTPValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
521
804
  if (value == null) return value;
522
- switch (value["type"]) {
523
- case "encrypt": return Object.assign({}, EncryptRuleToJSON(value), { type: "encrypt" });
524
- case "mask": return Object.assign({}, MaskRuleToJSON(value), { type: "mask" });
525
- case "redact": return Object.assign({}, RedactRuleToJSON(value), { type: "redact" });
526
- case "replace": return Object.assign({}, ReplaceRuleToJSON(value), { type: "replace" });
527
- case "sha256": return Object.assign({}, SHA256RuleToJSON(value), { type: "sha256" });
528
- case "sha512": return Object.assign({}, SHA512RuleToJSON(value), { type: "sha512" });
529
- default: return value;
530
- }
805
+ return { "detail": value["detail"] == null ? void 0 : value["detail"].map(ValidationErrorToJSON) };
531
806
  }
532
807
 
533
808
  //#endregion
534
- //#region src/models/AnonymizeRequestBody.ts
809
+ //#region src/models/PolicySummary.ts
535
810
  /**
536
- * Check if a given object implements the AnonymizeRequestBody interface.
811
+ * Check if a given object implements the PolicySummary interface.
537
812
  */
538
- function instanceOfAnonymizeRequestBody(value) {
539
- if (!("text" in value) || value["text"] === void 0) return false;
540
- if (!("rules" in value) || value["rules"] === void 0) return false;
813
+ function instanceOfPolicySummary(value) {
814
+ if (!("id" in value) || value["id"] === void 0) return false;
815
+ if (!("name" in value) || value["name"] === void 0) return false;
816
+ if (!("versionId" in value) || value["versionId"] === void 0) return false;
817
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
818
+ if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
541
819
  return true;
542
820
  }
543
- function AnonymizeRequestBodyFromJSON(json) {
544
- return AnonymizeRequestBodyFromJSONTyped(json, false);
821
+ function PolicySummaryFromJSON(json) {
822
+ return PolicySummaryFromJSONTyped(json, false);
545
823
  }
546
- function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
824
+ function PolicySummaryFromJSONTyped(json, ignoreDiscriminator) {
547
825
  if (json == null) return json;
548
826
  return {
549
- "text": json["text"],
550
- "rules": json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON),
551
- "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"]
827
+ "id": json["id"],
828
+ "name": json["name"],
829
+ "versionId": json["versionId"],
830
+ "createdAt": json["createdAt"],
831
+ "updatedAt": json["updatedAt"]
552
832
  };
553
833
  }
554
- function AnonymizeRequestBodyToJSON(json) {
555
- return AnonymizeRequestBodyToJSONTyped(json, false);
834
+ function PolicySummaryToJSON(json) {
835
+ return PolicySummaryToJSONTyped(json, false);
556
836
  }
557
- function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
837
+ function PolicySummaryToJSONTyped(value, ignoreDiscriminator = false) {
558
838
  if (value == null) return value;
559
839
  return {
560
- "text": value["text"],
561
- "rules": value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON),
562
- "confidence_threshold": value["confidence_threshold"]
840
+ "id": value["id"],
841
+ "name": value["name"],
842
+ "versionId": value["versionId"],
843
+ "createdAt": value["createdAt"],
844
+ "updatedAt": value["updatedAt"]
563
845
  };
564
846
  }
565
847
 
566
848
  //#endregion
567
- //#region src/models/TextRange.ts
849
+ //#region src/models/ListPolicies200Response.ts
568
850
  /**
569
- * Check if a given object implements the TextRange interface.
851
+ * Check if a given object implements the ListPolicies200Response interface.
570
852
  */
571
- function instanceOfTextRange(value) {
572
- if (!("start" in value) || value["start"] === void 0) return false;
573
- if (!("end" in value) || value["end"] === void 0) return false;
574
- if (!("value" in value) || value["value"] === void 0) return false;
853
+ function instanceOfListPolicies200Response(value) {
854
+ if (!("policies" in value) || value["policies"] === void 0) return false;
575
855
  return true;
576
856
  }
577
- function TextRangeFromJSON(json) {
578
- return TextRangeFromJSONTyped(json, false);
857
+ function ListPolicies200ResponseFromJSON(json) {
858
+ return ListPolicies200ResponseFromJSONTyped(json, false);
579
859
  }
580
- function TextRangeFromJSONTyped(json, ignoreDiscriminator) {
860
+ function ListPolicies200ResponseFromJSONTyped(json, ignoreDiscriminator) {
861
+ if (json == null) return json;
862
+ return { "policies": json["policies"].map(PolicySummaryFromJSON) };
863
+ }
864
+ function ListPolicies200ResponseToJSON(json) {
865
+ return ListPolicies200ResponseToJSONTyped(json, false);
866
+ }
867
+ function ListPolicies200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
868
+ if (value == null) return value;
869
+ return { "policies": value["policies"].map(PolicySummaryToJSON) };
870
+ }
871
+
872
+ //#endregion
873
+ //#region src/models/MaskRule.ts
874
+ /**
875
+ * @export
876
+ */
877
+ const MaskRuleTypeEnum = { mask: "mask" };
878
+ /**
879
+ * Check if a given object implements the MaskRule interface.
880
+ */
881
+ function instanceOfMaskRule(value) {
882
+ if (!("entities" in value) || value["entities"] === void 0) return false;
883
+ return true;
884
+ }
885
+ function MaskRuleFromJSON(json) {
886
+ return MaskRuleFromJSONTyped(json, false);
887
+ }
888
+ function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
581
889
  if (json == null) return json;
582
890
  return {
583
- "start": json["start"],
584
- "end": json["end"],
585
- "value": json["value"]
891
+ "type": json["type"] == null ? void 0 : json["type"],
892
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
893
+ "masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
894
+ "chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
895
+ "from_end": json["from_end"] == null ? void 0 : json["from_end"]
586
896
  };
587
897
  }
588
- function TextRangeToJSON(json) {
589
- return TextRangeToJSONTyped(json, false);
898
+ function MaskRuleToJSON(json) {
899
+ return MaskRuleToJSONTyped(json, false);
590
900
  }
591
- function TextRangeToJSONTyped(value, ignoreDiscriminator = false) {
901
+ function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
592
902
  if (value == null) return value;
593
903
  return {
594
- "start": value["start"],
595
- "end": value["end"],
596
- "value": value["value"]
904
+ "type": value["type"],
905
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
906
+ "masking_char": value["masking_char"],
907
+ "chars_to_mask": value["chars_to_mask"],
908
+ "from_end": value["from_end"]
597
909
  };
598
910
  }
599
911
 
600
912
  //#endregion
601
- //#region src/models/ModelResult.ts
913
+ //#region src/models/ModelEntity.ts
602
914
  /**
603
915
  * @export
604
916
  */
605
- const ModelResultTypeEnum = { model: "model" };
917
+ const ModelEntityTypeEnum = { model: "model" };
606
918
  /**
607
- * Check if a given object implements the ModelResult interface.
919
+ * Check if a given object implements the ModelEntity interface.
608
920
  */
609
- function instanceOfModelResult(value) {
610
- if (!("rule" in value) || value["rule"] === void 0) return false;
921
+ function instanceOfModelEntity(value) {
611
922
  if (!("value" in value) || value["value"] === void 0) return false;
612
- if (!("input" in value) || value["input"] === void 0) return false;
613
- if (!("output" in value) || value["output"] === void 0) return false;
614
923
  return true;
615
924
  }
616
- function ModelResultFromJSON(json) {
617
- return ModelResultFromJSONTyped(json, false);
925
+ function ModelEntityFromJSON(json) {
926
+ return ModelEntityFromJSONTyped(json, false);
618
927
  }
619
- function ModelResultFromJSONTyped(json, ignoreDiscriminator) {
928
+ function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
620
929
  if (json == null) return json;
621
930
  return {
622
931
  "type": json["type"] == null ? void 0 : json["type"],
623
- "rule": json["rule"],
624
- "value": json["value"],
625
- "input": TextRangeFromJSON(json["input"]),
626
- "output": TextRangeFromJSON(json["output"]),
627
- "score": json["score"] == null ? void 0 : json["score"]
932
+ "value": json["value"]
628
933
  };
629
934
  }
630
- function ModelResultToJSON(json) {
631
- return ModelResultToJSONTyped(json, false);
935
+ function ModelEntityToJSON(json) {
936
+ return ModelEntityToJSONTyped(json, false);
632
937
  }
633
- function ModelResultToJSONTyped(value, ignoreDiscriminator = false) {
938
+ function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
634
939
  if (value == null) return value;
635
940
  return {
636
941
  "type": value["type"],
637
- "rule": value["rule"],
638
- "value": value["value"],
639
- "input": TextRangeToJSON(value["input"]),
640
- "output": TextRangeToJSON(value["output"]),
641
- "score": value["score"]
942
+ "value": value["value"]
642
943
  };
643
944
  }
644
945
 
645
946
  //#endregion
646
- //#region src/models/RegexResult.ts
947
+ //#region src/models/ModelResult.ts
647
948
  /**
648
949
  * @export
649
950
  */
650
- const RegexResultTypeEnum = { regex: "regex" };
951
+ const ModelResultTypeEnum = { model: "model" };
651
952
  /**
652
- * Check if a given object implements the RegexResult interface.
953
+ * Check if a given object implements the ModelResult interface.
653
954
  */
654
- function instanceOfRegexResult(value) {
955
+ function instanceOfModelResult(value) {
655
956
  if (!("rule" in value) || value["rule"] === void 0) return false;
656
957
  if (!("value" in value) || value["value"] === void 0) return false;
657
958
  if (!("input" in value) || value["input"] === void 0) return false;
658
959
  if (!("output" in value) || value["output"] === void 0) return false;
659
960
  return true;
660
961
  }
661
- function RegexResultFromJSON(json) {
662
- return RegexResultFromJSONTyped(json, false);
962
+ function ModelResultFromJSON(json) {
963
+ return ModelResultFromJSONTyped(json, false);
663
964
  }
664
- function RegexResultFromJSONTyped(json, ignoreDiscriminator) {
965
+ function ModelResultFromJSONTyped(json, ignoreDiscriminator) {
665
966
  if (json == null) return json;
666
967
  return {
667
968
  "type": json["type"] == null ? void 0 : json["type"],
668
969
  "rule": json["rule"],
669
970
  "value": json["value"],
670
971
  "input": TextRangeFromJSON(json["input"]),
671
- "output": TextRangeFromJSON(json["output"])
972
+ "output": TextRangeFromJSON(json["output"]),
973
+ "score": json["score"] == null ? void 0 : json["score"]
672
974
  };
673
975
  }
674
- function RegexResultToJSON(json) {
675
- return RegexResultToJSONTyped(json, false);
976
+ function ModelResultToJSON(json) {
977
+ return ModelResultToJSONTyped(json, false);
676
978
  }
677
- function RegexResultToJSONTyped(value, ignoreDiscriminator = false) {
979
+ function ModelResultToJSONTyped(value, ignoreDiscriminator = false) {
678
980
  if (value == null) return value;
679
981
  return {
680
982
  "type": value["type"],
681
983
  "rule": value["rule"],
682
984
  "value": value["value"],
683
985
  "input": TextRangeToJSON(value["input"]),
684
- "output": TextRangeToJSON(value["output"])
986
+ "output": TextRangeToJSON(value["output"]),
987
+ "score": value["score"]
685
988
  };
686
989
  }
687
990
 
688
991
  //#endregion
689
- //#region src/models/AnonymizeResponseBodyResultsInner.ts
690
- function AnonymizeResponseBodyResultsInnerFromJSON(json) {
691
- return AnonymizeResponseBodyResultsInnerFromJSONTyped(json, false);
692
- }
693
- function AnonymizeResponseBodyResultsInnerFromJSONTyped(json, ignoreDiscriminator) {
694
- if (json == null) return json;
695
- switch (json["type"]) {
696
- case "model": return Object.assign({}, ModelResultFromJSONTyped(json, true), { type: "model" });
697
- case "regex": return Object.assign({}, RegexResultFromJSONTyped(json, true), { type: "regex" });
698
- default: return json;
699
- }
700
- }
701
- function AnonymizeResponseBodyResultsInnerToJSON(json) {
702
- return AnonymizeResponseBodyResultsInnerToJSONTyped(json, false);
703
- }
704
- function AnonymizeResponseBodyResultsInnerToJSONTyped(value, ignoreDiscriminator = false) {
705
- if (value == null) return value;
706
- switch (value["type"]) {
707
- case "model": return Object.assign({}, ModelResultToJSON(value), { type: "model" });
708
- case "regex": return Object.assign({}, RegexResultToJSON(value), { type: "regex" });
709
- default: return value;
710
- }
711
- }
712
-
713
- //#endregion
714
- //#region src/models/AnonymizeResponseBody.ts
992
+ //#region src/models/Policy.ts
715
993
  /**
716
- * Check if a given object implements the AnonymizeResponseBody interface.
994
+ * Check if a given object implements the Policy interface.
717
995
  */
718
- function instanceOfAnonymizeResponseBody(value) {
719
- if (!("text" in value) || value["text"] === void 0) return false;
996
+ function instanceOfPolicy(value) {
997
+ if (!("id" in value) || value["id"] === void 0) return false;
998
+ if (!("name" in value) || value["name"] === void 0) return false;
999
+ if (!("versionId" in value) || value["versionId"] === void 0) return false;
1000
+ if (!("document" in value) || value["document"] === void 0) return false;
1001
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1002
+ if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
720
1003
  return true;
721
1004
  }
722
- function AnonymizeResponseBodyFromJSON(json) {
723
- return AnonymizeResponseBodyFromJSONTyped(json, false);
1005
+ function PolicyFromJSON(json) {
1006
+ return PolicyFromJSONTyped(json, false);
724
1007
  }
725
- function AnonymizeResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
1008
+ function PolicyFromJSONTyped(json, ignoreDiscriminator) {
726
1009
  if (json == null) return json;
727
1010
  return {
728
- "text": json["text"],
729
- "results": json["results"] == null ? void 0 : json["results"].map(AnonymizeResponseBodyResultsInnerFromJSON)
1011
+ "id": json["id"],
1012
+ "name": json["name"],
1013
+ "versionId": json["versionId"],
1014
+ "document": PolicyDocumentFromJSON(json["document"]),
1015
+ "createdAt": json["createdAt"],
1016
+ "updatedAt": json["updatedAt"]
730
1017
  };
731
1018
  }
732
- function AnonymizeResponseBodyToJSON(json) {
733
- return AnonymizeResponseBodyToJSONTyped(json, false);
1019
+ function PolicyToJSON(json) {
1020
+ return PolicyToJSONTyped(json, false);
734
1021
  }
735
- function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
1022
+ function PolicyToJSONTyped(value, ignoreDiscriminator = false) {
736
1023
  if (value == null) return value;
737
1024
  return {
738
- "text": value["text"],
739
- "results": value["results"] == null ? void 0 : value["results"].map(AnonymizeResponseBodyResultsInnerToJSON)
1025
+ "id": value["id"],
1026
+ "name": value["name"],
1027
+ "versionId": value["versionId"],
1028
+ "document": PolicyDocumentToJSON(value["document"]),
1029
+ "createdAt": value["createdAt"],
1030
+ "updatedAt": value["updatedAt"]
740
1031
  };
741
1032
  }
742
1033
 
743
1034
  //#endregion
744
- //#region src/models/ModelEntity.ts
1035
+ //#region src/models/RedactRule.ts
745
1036
  /**
746
1037
  * @export
747
1038
  */
748
- const ModelEntityTypeEnum = { model: "model" };
1039
+ const RedactRuleTypeEnum = { redact: "redact" };
749
1040
  /**
750
- * Check if a given object implements the ModelEntity interface.
1041
+ * Check if a given object implements the RedactRule interface.
751
1042
  */
752
- function instanceOfModelEntity(value) {
753
- if (!("value" in value) || value["value"] === void 0) return false;
1043
+ function instanceOfRedactRule(value) {
1044
+ if (!("entities" in value) || value["entities"] === void 0) return false;
754
1045
  return true;
755
1046
  }
756
- function ModelEntityFromJSON(json) {
757
- return ModelEntityFromJSONTyped(json, false);
1047
+ function RedactRuleFromJSON(json) {
1048
+ return RedactRuleFromJSONTyped(json, false);
758
1049
  }
759
- function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
1050
+ function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
760
1051
  if (json == null) return json;
761
1052
  return {
762
1053
  "type": json["type"] == null ? void 0 : json["type"],
763
- "value": json["value"]
1054
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
764
1055
  };
765
1056
  }
766
- function ModelEntityToJSON(json) {
767
- return ModelEntityToJSONTyped(json, false);
1057
+ function RedactRuleToJSON(json) {
1058
+ return RedactRuleToJSONTyped(json, false);
768
1059
  }
769
- function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
1060
+ function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
770
1061
  if (value == null) return value;
771
1062
  return {
772
1063
  "type": value["type"],
773
- "value": value["value"]
1064
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
774
1065
  };
775
1066
  }
776
1067
 
@@ -809,106 +1100,150 @@ function RegexEntityToJSONTyped(value, ignoreDiscriminator = false) {
809
1100
  }
810
1101
 
811
1102
  //#endregion
812
- //#region src/models/EntitiesAnyOfInner.ts
813
- function EntitiesAnyOfInnerFromJSON(json) {
814
- return EntitiesAnyOfInnerFromJSONTyped(json, false);
1103
+ //#region src/models/RegexResult.ts
1104
+ /**
1105
+ * @export
1106
+ */
1107
+ const RegexResultTypeEnum = { regex: "regex" };
1108
+ /**
1109
+ * Check if a given object implements the RegexResult interface.
1110
+ */
1111
+ function instanceOfRegexResult(value) {
1112
+ if (!("rule" in value) || value["rule"] === void 0) return false;
1113
+ if (!("value" in value) || value["value"] === void 0) return false;
1114
+ if (!("input" in value) || value["input"] === void 0) return false;
1115
+ if (!("output" in value) || value["output"] === void 0) return false;
1116
+ return true;
1117
+ }
1118
+ function RegexResultFromJSON(json) {
1119
+ return RegexResultFromJSONTyped(json, false);
815
1120
  }
816
- function EntitiesAnyOfInnerFromJSONTyped(json, ignoreDiscriminator) {
1121
+ function RegexResultFromJSONTyped(json, ignoreDiscriminator) {
817
1122
  if (json == null) return json;
818
- switch (json["type"]) {
819
- case "model": return Object.assign({}, ModelEntityFromJSONTyped(json, true), { type: "model" });
820
- case "regex": return Object.assign({}, RegexEntityFromJSONTyped(json, true), { type: "regex" });
821
- default: return json;
822
- }
1123
+ return {
1124
+ "type": json["type"] == null ? void 0 : json["type"],
1125
+ "rule": json["rule"],
1126
+ "value": json["value"],
1127
+ "input": TextRangeFromJSON(json["input"]),
1128
+ "output": TextRangeFromJSON(json["output"])
1129
+ };
823
1130
  }
824
- function EntitiesAnyOfInnerToJSON(json) {
825
- return EntitiesAnyOfInnerToJSONTyped(json, false);
1131
+ function RegexResultToJSON(json) {
1132
+ return RegexResultToJSONTyped(json, false);
826
1133
  }
827
- function EntitiesAnyOfInnerToJSONTyped(value, ignoreDiscriminator = false) {
1134
+ function RegexResultToJSONTyped(value, ignoreDiscriminator = false) {
828
1135
  if (value == null) return value;
829
- switch (value["type"]) {
830
- case "model": return Object.assign({}, ModelEntityToJSON(value), { type: "model" });
831
- case "regex": return Object.assign({}, RegexEntityToJSON(value), { type: "regex" });
832
- default: return value;
833
- }
1136
+ return {
1137
+ "type": value["type"],
1138
+ "rule": value["rule"],
1139
+ "value": value["value"],
1140
+ "input": TextRangeToJSON(value["input"]),
1141
+ "output": TextRangeToJSON(value["output"])
1142
+ };
834
1143
  }
835
1144
 
836
1145
  //#endregion
837
- //#region src/models/ValidationErrorLocInner.ts
1146
+ //#region src/models/ReplaceRule.ts
838
1147
  /**
839
- * Check if a given object implements the ValidationErrorLocInner interface.
1148
+ * @export
840
1149
  */
841
- function instanceOfValidationErrorLocInner(value) {
1150
+ const ReplaceRuleTypeEnum = { replace: "replace" };
1151
+ /**
1152
+ * Check if a given object implements the ReplaceRule interface.
1153
+ */
1154
+ function instanceOfReplaceRule(value) {
1155
+ if (!("entities" in value) || value["entities"] === void 0) return false;
842
1156
  return true;
843
1157
  }
844
- function ValidationErrorLocInnerFromJSON(json) {
845
- return ValidationErrorLocInnerFromJSONTyped(json, false);
1158
+ function ReplaceRuleFromJSON(json) {
1159
+ return ReplaceRuleFromJSONTyped(json, false);
846
1160
  }
847
- function ValidationErrorLocInnerFromJSONTyped(json, ignoreDiscriminator) {
848
- return json;
1161
+ function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
1162
+ if (json == null) return json;
1163
+ return {
1164
+ "type": json["type"] == null ? void 0 : json["type"],
1165
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON),
1166
+ "replacement": json["replacement"] == null ? void 0 : json["replacement"]
1167
+ };
849
1168
  }
850
- function ValidationErrorLocInnerToJSON(json) {
851
- return ValidationErrorLocInnerToJSONTyped(json, false);
1169
+ function ReplaceRuleToJSON(json) {
1170
+ return ReplaceRuleToJSONTyped(json, false);
852
1171
  }
853
- function ValidationErrorLocInnerToJSONTyped(value, ignoreDiscriminator = false) {
854
- return value;
1172
+ function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
1173
+ if (value == null) return value;
1174
+ return {
1175
+ "type": value["type"],
1176
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON),
1177
+ "replacement": value["replacement"]
1178
+ };
855
1179
  }
856
1180
 
857
1181
  //#endregion
858
- //#region src/models/ValidationError.ts
1182
+ //#region src/models/SHA256Rule.ts
859
1183
  /**
860
- * Check if a given object implements the ValidationError interface.
1184
+ * @export
861
1185
  */
862
- function instanceOfValidationError(value) {
863
- if (!("loc" in value) || value["loc"] === void 0) return false;
864
- if (!("msg" in value) || value["msg"] === void 0) return false;
865
- if (!("type" in value) || value["type"] === void 0) return false;
1186
+ const SHA256RuleTypeEnum = { sha256: "sha256" };
1187
+ /**
1188
+ * Check if a given object implements the SHA256Rule interface.
1189
+ */
1190
+ function instanceOfSHA256Rule(value) {
1191
+ if (!("entities" in value) || value["entities"] === void 0) return false;
866
1192
  return true;
867
1193
  }
868
- function ValidationErrorFromJSON(json) {
869
- return ValidationErrorFromJSONTyped(json, false);
1194
+ function SHA256RuleFromJSON(json) {
1195
+ return SHA256RuleFromJSONTyped(json, false);
870
1196
  }
871
- function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
1197
+ function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
872
1198
  if (json == null) return json;
873
1199
  return {
874
- "loc": json["loc"].map(ValidationErrorLocInnerFromJSON),
875
- "msg": json["msg"],
876
- "type": json["type"]
1200
+ "type": json["type"] == null ? void 0 : json["type"],
1201
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
877
1202
  };
878
1203
  }
879
- function ValidationErrorToJSON(json) {
880
- return ValidationErrorToJSONTyped(json, false);
1204
+ function SHA256RuleToJSON(json) {
1205
+ return SHA256RuleToJSONTyped(json, false);
881
1206
  }
882
- function ValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
1207
+ function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
883
1208
  if (value == null) return value;
884
1209
  return {
885
- "loc": value["loc"].map(ValidationErrorLocInnerToJSON),
886
- "msg": value["msg"],
887
- "type": value["type"]
1210
+ "type": value["type"],
1211
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
888
1212
  };
889
1213
  }
890
1214
 
891
1215
  //#endregion
892
- //#region src/models/HTTPValidationError.ts
1216
+ //#region src/models/SHA512Rule.ts
893
1217
  /**
894
- * Check if a given object implements the HTTPValidationError interface.
1218
+ * @export
895
1219
  */
896
- function instanceOfHTTPValidationError(value) {
1220
+ const SHA512RuleTypeEnum = { sha512: "sha512" };
1221
+ /**
1222
+ * Check if a given object implements the SHA512Rule interface.
1223
+ */
1224
+ function instanceOfSHA512Rule(value) {
1225
+ if (!("entities" in value) || value["entities"] === void 0) return false;
897
1226
  return true;
898
1227
  }
899
- function HTTPValidationErrorFromJSON(json) {
900
- return HTTPValidationErrorFromJSONTyped(json, false);
1228
+ function SHA512RuleFromJSON(json) {
1229
+ return SHA512RuleFromJSONTyped(json, false);
901
1230
  }
902
- function HTTPValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
1231
+ function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
903
1232
  if (json == null) return json;
904
- return { "detail": json["detail"] == null ? void 0 : json["detail"].map(ValidationErrorFromJSON) };
1233
+ return {
1234
+ "type": json["type"] == null ? void 0 : json["type"],
1235
+ "entities": json["entities"].map(DetectRuleEntitiesInnerFromJSON)
1236
+ };
905
1237
  }
906
- function HTTPValidationErrorToJSON(json) {
907
- return HTTPValidationErrorToJSONTyped(json, false);
1238
+ function SHA512RuleToJSON(json) {
1239
+ return SHA512RuleToJSONTyped(json, false);
908
1240
  }
909
- function HTTPValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
1241
+ function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
910
1242
  if (value == null) return value;
911
- return { "detail": value["detail"] == null ? void 0 : value["detail"].map(ValidationErrorToJSON) };
1243
+ return {
1244
+ "type": value["type"],
1245
+ "entities": value["entities"].map(DetectRuleEntitiesInnerToJSON)
1246
+ };
912
1247
  }
913
1248
 
914
1249
  //#endregion
@@ -989,6 +1324,7 @@ function ScanResultToJSONTyped(value, ignoreDiscriminator = false) {
989
1324
  */
990
1325
  function instanceOfScanResponseBody(value) {
991
1326
  if (!("results" in value) || value["results"] === void 0) return false;
1327
+ if (!("usage" in value) || value["usage"] === void 0) return false;
992
1328
  return true;
993
1329
  }
994
1330
  function ScanResponseBodyFromJSON(json) {
@@ -996,23 +1332,200 @@ function ScanResponseBodyFromJSON(json) {
996
1332
  }
997
1333
  function ScanResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
998
1334
  if (json == null) return json;
999
- return { "results": json["results"].map(ScanResultFromJSON) };
1335
+ return {
1336
+ "results": json["results"].map(ScanResultFromJSON),
1337
+ "usage": UsageFromJSON(json["usage"])
1338
+ };
1000
1339
  }
1001
1340
  function ScanResponseBodyToJSON(json) {
1002
1341
  return ScanResponseBodyToJSONTyped(json, false);
1003
1342
  }
1004
1343
  function ScanResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
1005
1344
  if (value == null) return value;
1006
- return { "results": value["results"].map(ScanResultToJSON) };
1345
+ return {
1346
+ "results": value["results"].map(ScanResultToJSON),
1347
+ "usage": UsageToJSON(value["usage"])
1348
+ };
1349
+ }
1350
+
1351
+ //#endregion
1352
+ //#region src/models/UpdatePolicyRequest.ts
1353
+ /**
1354
+ * Check if a given object implements the UpdatePolicyRequest interface.
1355
+ */
1356
+ function instanceOfUpdatePolicyRequest(value) {
1357
+ return true;
1358
+ }
1359
+ function UpdatePolicyRequestFromJSON(json) {
1360
+ return UpdatePolicyRequestFromJSONTyped(json, false);
1361
+ }
1362
+ function UpdatePolicyRequestFromJSONTyped(json, ignoreDiscriminator) {
1363
+ if (json == null) return json;
1364
+ return {
1365
+ "name": json["name"] == null ? void 0 : json["name"],
1366
+ "document": json["document"] == null ? void 0 : PolicyDocumentFromJSON(json["document"])
1367
+ };
1368
+ }
1369
+ function UpdatePolicyRequestToJSON(json) {
1370
+ return UpdatePolicyRequestToJSONTyped(json, false);
1371
+ }
1372
+ function UpdatePolicyRequestToJSONTyped(value, ignoreDiscriminator = false) {
1373
+ if (value == null) return value;
1374
+ return {
1375
+ "name": value["name"],
1376
+ "document": PolicyDocumentToJSON(value["document"])
1377
+ };
1007
1378
  }
1008
1379
 
1380
+ //#endregion
1381
+ //#region src/apis/PoliciesApi.ts
1382
+ /**
1383
+ * Sensitive Data Protection API
1384
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
1385
+ *
1386
+ * The version of the OpenAPI document: 0.1.0
1387
+ *
1388
+ *
1389
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1390
+ * https://openapi-generator.tech
1391
+ * Do not edit the class manually.
1392
+ */
1393
+ /**
1394
+ *
1395
+ */
1396
+ var PoliciesApi = class extends BaseAPI {
1397
+ /**
1398
+ * Create a policy
1399
+ */
1400
+ async createPolicyRaw(requestParameters, initOverrides) {
1401
+ if (requestParameters["CreatePolicyRequest"] == null) throw new RequiredError("CreatePolicyRequest", "Required parameter \"CreatePolicyRequest\" was null or undefined when calling createPolicy().");
1402
+ const queryParameters = {};
1403
+ const headerParameters = {};
1404
+ headerParameters["Content-Type"] = "application/json";
1405
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1406
+ const response = await this.request({
1407
+ path: `/policies`,
1408
+ method: "POST",
1409
+ headers: headerParameters,
1410
+ query: queryParameters,
1411
+ body: CreatePolicyRequestToJSON(requestParameters["CreatePolicyRequest"])
1412
+ }, initOverrides);
1413
+ return new JSONApiResponse(response, (jsonValue) => PolicyFromJSON(jsonValue));
1414
+ }
1415
+ /**
1416
+ * Create a policy
1417
+ */
1418
+ async createPolicy(CreatePolicyRequest, initOverrides) {
1419
+ return await (await this.createPolicyRaw({ CreatePolicyRequest }, initOverrides)).value();
1420
+ }
1421
+ /**
1422
+ * Delete a policy
1423
+ */
1424
+ async deletePolicyRaw(requestParameters, initOverrides) {
1425
+ if (requestParameters["id"] == null) throw new RequiredError("id", "Required parameter \"id\" was null or undefined when calling deletePolicy().");
1426
+ const queryParameters = {};
1427
+ const headerParameters = {};
1428
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1429
+ let urlPath = `/policies/{id}`;
1430
+ urlPath = urlPath.replace(`{id}`, encodeURIComponent(String(requestParameters["id"])));
1431
+ const response = await this.request({
1432
+ path: urlPath,
1433
+ method: "DELETE",
1434
+ headers: headerParameters,
1435
+ query: queryParameters
1436
+ }, initOverrides);
1437
+ return new VoidApiResponse(response);
1438
+ }
1439
+ /**
1440
+ * Delete a policy
1441
+ */
1442
+ async deletePolicy(id, initOverrides) {
1443
+ await this.deletePolicyRaw({ id }, initOverrides);
1444
+ }
1445
+ /**
1446
+ * Read a policy
1447
+ */
1448
+ async getPolicyRaw(requestParameters, initOverrides) {
1449
+ if (requestParameters["id"] == null) throw new RequiredError("id", "Required parameter \"id\" was null or undefined when calling getPolicy().");
1450
+ const queryParameters = {};
1451
+ const headerParameters = {};
1452
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1453
+ let urlPath = `/policies/{id}`;
1454
+ urlPath = urlPath.replace(`{id}`, encodeURIComponent(String(requestParameters["id"])));
1455
+ const response = await this.request({
1456
+ path: urlPath,
1457
+ method: "GET",
1458
+ headers: headerParameters,
1459
+ query: queryParameters
1460
+ }, initOverrides);
1461
+ return new JSONApiResponse(response, (jsonValue) => PolicyFromJSON(jsonValue));
1462
+ }
1463
+ /**
1464
+ * Read a policy
1465
+ */
1466
+ async getPolicy(id, initOverrides) {
1467
+ return await (await this.getPolicyRaw({ id }, initOverrides)).value();
1468
+ }
1469
+ /**
1470
+ * List policies
1471
+ */
1472
+ async listPoliciesRaw(initOverrides) {
1473
+ const queryParameters = {};
1474
+ const headerParameters = {};
1475
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1476
+ const response = await this.request({
1477
+ path: `/policies`,
1478
+ method: "GET",
1479
+ headers: headerParameters,
1480
+ query: queryParameters
1481
+ }, initOverrides);
1482
+ return new JSONApiResponse(response, (jsonValue) => ListPolicies200ResponseFromJSON(jsonValue));
1483
+ }
1484
+ /**
1485
+ * List policies
1486
+ */
1487
+ async listPolicies(initOverrides) {
1488
+ return await (await this.listPoliciesRaw(initOverrides)).value();
1489
+ }
1490
+ /**
1491
+ * Update a policy
1492
+ */
1493
+ async updatePolicyRaw(requestParameters, initOverrides) {
1494
+ if (requestParameters["id"] == null) throw new RequiredError("id", "Required parameter \"id\" was null or undefined when calling updatePolicy().");
1495
+ if (requestParameters["UpdatePolicyRequest"] == null) throw new RequiredError("UpdatePolicyRequest", "Required parameter \"UpdatePolicyRequest\" was null or undefined when calling updatePolicy().");
1496
+ const queryParameters = {};
1497
+ const headerParameters = {};
1498
+ headerParameters["Content-Type"] = "application/json";
1499
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1500
+ let urlPath = `/policies/{id}`;
1501
+ urlPath = urlPath.replace(`{id}`, encodeURIComponent(String(requestParameters["id"])));
1502
+ const response = await this.request({
1503
+ path: urlPath,
1504
+ method: "PUT",
1505
+ headers: headerParameters,
1506
+ query: queryParameters,
1507
+ body: UpdatePolicyRequestToJSON(requestParameters["UpdatePolicyRequest"])
1508
+ }, initOverrides);
1509
+ return new JSONApiResponse(response, (jsonValue) => PolicyFromJSON(jsonValue));
1510
+ }
1511
+ /**
1512
+ * Update a policy
1513
+ */
1514
+ async updatePolicy(id, UpdatePolicyRequest, initOverrides) {
1515
+ return await (await this.updatePolicyRaw({
1516
+ id,
1517
+ UpdatePolicyRequest
1518
+ }, initOverrides)).value();
1519
+ }
1520
+ };
1521
+
1009
1522
  //#endregion
1010
1523
  //#region src/apis/SensitiveDataProtectionApi.ts
1011
1524
  /**
1012
1525
  * Sensitive Data Protection API
1013
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
1526
+ * Detect and de-identify sensitive data (PII) in text. Use `scan` to locate sensitive entities such as emails, phone numbers, and names, and `anonymize` to transform them using configurable rules (redact, mask, replace, hash, or encrypt).
1014
1527
  *
1015
- * The version of the OpenAPI document: 0.0.8
1528
+ * The version of the OpenAPI document: 0.1.0
1016
1529
  *
1017
1530
  *
1018
1531
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1024,7 +1537,7 @@ function ScanResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
1024
1537
  */
1025
1538
  var SensitiveDataProtectionApi = class extends BaseAPI {
1026
1539
  /**
1027
- * Anonymize the provided text.
1540
+ * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
1028
1541
  * Anonymize Text
1029
1542
  */
1030
1543
  async anonymizeTextRaw(requestParameters, initOverrides) {
@@ -1032,6 +1545,7 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1032
1545
  const queryParameters = {};
1033
1546
  const headerParameters = {};
1034
1547
  headerParameters["Content-Type"] = "application/json";
1548
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1035
1549
  const response = await this.request({
1036
1550
  path: `/anonymize`,
1037
1551
  method: "POST",
@@ -1042,35 +1556,38 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1042
1556
  return new JSONApiResponse(response, (jsonValue) => AnonymizeResponseBodyFromJSON(jsonValue));
1043
1557
  }
1044
1558
  /**
1045
- * Anonymize the provided text.
1559
+ * Anonymize sensitive data in text. Scans the request text for the entities targeted by each supplied rule and applies that rule\'s operation (replace, redact, mask, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
1046
1560
  * Anonymize Text
1047
1561
  */
1048
1562
  async anonymizeText(AnonymizeRequestBody, initOverrides) {
1049
1563
  return await (await this.anonymizeTextRaw({ AnonymizeRequestBody }, initOverrides)).value();
1050
1564
  }
1051
1565
  /**
1052
- * Return basic health probe result.
1566
+ * Health check. Returns a plain-text message confirming the service is running. Use this as a liveness/readiness probe.
1053
1567
  * Health
1054
1568
  */
1055
1569
  async healthCheckRaw(initOverrides) {
1570
+ const queryParameters = {};
1571
+ const headerParameters = {};
1572
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1056
1573
  const response = await this.request({
1057
1574
  path: `/health`,
1058
1575
  method: "GET",
1059
- headers: {},
1060
- query: {}
1576
+ headers: headerParameters,
1577
+ query: queryParameters
1061
1578
  }, initOverrides);
1062
1579
  if (this.isJsonMime(response.headers.get("content-type"))) return new JSONApiResponse(response);
1063
1580
  else return new TextApiResponse(response);
1064
1581
  }
1065
1582
  /**
1066
- * Return basic health probe result.
1583
+ * Health check. Returns a plain-text message confirming the service is running. Use this as a liveness/readiness probe.
1067
1584
  * Health
1068
1585
  */
1069
1586
  async healthCheck(initOverrides) {
1070
1587
  return await (await this.healthCheckRaw(initOverrides)).value();
1071
1588
  }
1072
1589
  /**
1073
- * Scan the provided text for sensitive data.
1590
+ * Scan text for sensitive data. Runs the configured detection entities over the request text and returns every match as a character range with its entity type and confidence score. Detections below the confidence threshold are omitted.
1074
1591
  * Scan Text
1075
1592
  */
1076
1593
  async scanTextRaw(requestParameters, initOverrides) {
@@ -1078,6 +1595,7 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1078
1595
  const queryParameters = {};
1079
1596
  const headerParameters = {};
1080
1597
  headerParameters["Content-Type"] = "application/json";
1598
+ if (this.configuration && this.configuration.apiKey) headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key");
1081
1599
  const response = await this.request({
1082
1600
  path: `/scan`,
1083
1601
  method: "POST",
@@ -1088,7 +1606,7 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1088
1606
  return new JSONApiResponse(response, (jsonValue) => ScanResponseBodyFromJSON(jsonValue));
1089
1607
  }
1090
1608
  /**
1091
- * Scan the provided text for sensitive data.
1609
+ * Scan text for sensitive data. Runs the configured detection entities over the request text and returns every match as a character range with its entity type and confidence score. Detections below the confidence threshold are omitted.
1092
1610
  * Scan Text
1093
1611
  */
1094
1612
  async scanText(ScanRequestBody, initOverrides) {
@@ -1097,4 +1615,4 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1097
1615
  };
1098
1616
 
1099
1617
  //#endregion
1100
- export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyResultsInnerFromJSON, AnonymizeResponseBodyResultsInnerFromJSONTyped, AnonymizeResponseBodyResultsInnerToJSON, AnonymizeResponseBodyResultsInnerToJSONTyped, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, DefaultConfig, EncryptRuleFromJSON, EncryptRuleFromJSONTyped, EncryptRuleToJSON, EncryptRuleToJSONTyped, EncryptRuleTypeEnum, EntitiesAnyOfInnerFromJSON, EntitiesAnyOfInnerFromJSONTyped, EntitiesAnyOfInnerToJSON, EntitiesAnyOfInnerToJSONTyped, EntitiesFromJSON, EntitiesFromJSONTyped, EntitiesToJSON, EntitiesToJSONTyped, FetchError, HTTPValidationErrorFromJSON, HTTPValidationErrorFromJSONTyped, HTTPValidationErrorToJSON, HTTPValidationErrorToJSONTyped, JSONApiResponse, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelResultFromJSON, ModelResultFromJSONTyped, ModelResultToJSON, ModelResultToJSONTyped, ModelResultTypeEnum, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexResultFromJSON, RegexResultFromJSONTyped, RegexResultToJSON, RegexResultToJSONTyped, RegexResultTypeEnum, ReplaceRuleFromJSON, ReplaceRuleFromJSONTyped, ReplaceRuleToJSON, ReplaceRuleToJSONTyped, ReplaceRuleTypeEnum, RequiredError, ResponseError, SHA256RuleFromJSON, SHA256RuleFromJSONTyped, SHA256RuleToJSON, SHA256RuleToJSONTyped, SHA256RuleTypeEnum, SHA512RuleFromJSON, SHA512RuleFromJSONTyped, SHA512RuleToJSON, SHA512RuleToJSONTyped, SHA512RuleTypeEnum, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SensitiveDataProtectionApi, TextApiResponse, TextRangeFromJSON, TextRangeFromJSONTyped, TextRangeToJSON, TextRangeToJSONTyped, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeResponseBody, instanceOfEncryptRule, instanceOfEntities, instanceOfHTTPValidationError, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelResult, instanceOfRedactRule, instanceOfRegexEntity, instanceOfRegexResult, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfTextRange, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };
1618
+ export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyRulesInnerTypeEnum, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyResultsInnerFromJSON, AnonymizeResponseBodyResultsInnerFromJSONTyped, AnonymizeResponseBodyResultsInnerToJSON, AnonymizeResponseBodyResultsInnerToJSONTyped, AnonymizeResponseBodyResultsInnerTypeEnum, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, CreatePolicyRequestFromJSON, CreatePolicyRequestFromJSONTyped, CreatePolicyRequestToJSON, CreatePolicyRequestToJSONTyped, DefaultConfig, DetectRuleEntitiesInnerFromJSON, DetectRuleEntitiesInnerFromJSONTyped, DetectRuleEntitiesInnerToJSON, DetectRuleEntitiesInnerToJSONTyped, DetectRuleEntitiesInnerTypeEnum, DetectRuleFromJSON, DetectRuleFromJSONTyped, DetectRuleToJSON, DetectRuleToJSONTyped, DetectRuleTypeEnum, EncryptRuleFromJSON, EncryptRuleFromJSONTyped, EncryptRuleToJSON, EncryptRuleToJSONTyped, EncryptRuleTypeEnum, FetchError, HTTPValidationErrorFromJSON, HTTPValidationErrorFromJSONTyped, HTTPValidationErrorToJSON, HTTPValidationErrorToJSONTyped, JSONApiResponse, ListPolicies200ResponseFromJSON, ListPolicies200ResponseFromJSONTyped, ListPolicies200ResponseToJSON, ListPolicies200ResponseToJSONTyped, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelResultFromJSON, ModelResultFromJSONTyped, ModelResultToJSON, ModelResultToJSONTyped, ModelResultTypeEnum, PoliciesApi, PolicyDocumentFromJSON, PolicyDocumentFromJSONTyped, PolicyDocumentRulesInnerFromJSON, PolicyDocumentRulesInnerFromJSONTyped, PolicyDocumentRulesInnerToJSON, PolicyDocumentRulesInnerToJSONTyped, PolicyDocumentRulesInnerTypeEnum, PolicyDocumentSchemaVersionEnum, PolicyDocumentToJSON, PolicyDocumentToJSONTyped, PolicyFromJSON, PolicyFromJSONTyped, PolicySummaryFromJSON, PolicySummaryFromJSONTyped, PolicySummaryToJSON, PolicySummaryToJSONTyped, PolicyToJSON, PolicyToJSONTyped, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexResultFromJSON, RegexResultFromJSONTyped, RegexResultToJSON, RegexResultToJSONTyped, RegexResultTypeEnum, ReplaceRuleFromJSON, ReplaceRuleFromJSONTyped, ReplaceRuleToJSON, ReplaceRuleToJSONTyped, ReplaceRuleTypeEnum, RequiredError, ResponseError, SHA256RuleFromJSON, SHA256RuleFromJSONTyped, SHA256RuleToJSON, SHA256RuleToJSONTyped, SHA256RuleTypeEnum, SHA512RuleFromJSON, SHA512RuleFromJSONTyped, SHA512RuleToJSON, SHA512RuleToJSONTyped, SHA512RuleTypeEnum, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SensitiveDataProtectionApi, TextApiResponse, TextRangeFromJSON, TextRangeFromJSONTyped, TextRangeToJSON, TextRangeToJSONTyped, UpdatePolicyRequestFromJSON, UpdatePolicyRequestFromJSONTyped, UpdatePolicyRequestToJSON, UpdatePolicyRequestToJSONTyped, UsageFromJSON, UsageFromJSONTyped, UsageToJSON, UsageToJSONTyped, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeRequestBodyRulesInner, instanceOfAnonymizeResponseBody, instanceOfAnonymizeResponseBodyResultsInner, instanceOfCreatePolicyRequest, instanceOfDetectRule, instanceOfDetectRuleEntitiesInner, instanceOfEncryptRule, instanceOfHTTPValidationError, instanceOfListPolicies200Response, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelResult, instanceOfPolicy, instanceOfPolicyDocument, instanceOfPolicyDocumentRulesInner, instanceOfPolicySummary, instanceOfRedactRule, instanceOfRegexEntity, instanceOfRegexResult, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfTextRange, instanceOfUpdatePolicyRequest, instanceOfUsage, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };