@quba/sensitive-data-protection 0.0.6 → 0.0.7

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
@@ -547,7 +547,8 @@ function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
547
547
  if (json == null) return json;
548
548
  return {
549
549
  "text": json["text"],
550
- "rules": json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON)
550
+ "rules": json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON),
551
+ "confidence_threshold": json["confidence_threshold"] == null ? void 0 : json["confidence_threshold"]
551
552
  };
552
553
  }
553
554
  function AnonymizeRequestBodyToJSON(json) {
@@ -557,10 +558,158 @@ function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
557
558
  if (value == null) return value;
558
559
  return {
559
560
  "text": value["text"],
560
- "rules": value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON)
561
+ "rules": value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON),
562
+ "confidence_threshold": value["confidence_threshold"]
563
+ };
564
+ }
565
+
566
+ //#endregion
567
+ //#region src/models/TextRange.ts
568
+ /**
569
+ * Check if a given object implements the TextRange interface.
570
+ */
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;
575
+ return true;
576
+ }
577
+ function TextRangeFromJSON(json) {
578
+ return TextRangeFromJSONTyped(json, false);
579
+ }
580
+ function TextRangeFromJSONTyped(json, ignoreDiscriminator) {
581
+ if (json == null) return json;
582
+ return {
583
+ "start": json["start"],
584
+ "end": json["end"],
585
+ "value": json["value"]
586
+ };
587
+ }
588
+ function TextRangeToJSON(json) {
589
+ return TextRangeToJSONTyped(json, false);
590
+ }
591
+ function TextRangeToJSONTyped(value, ignoreDiscriminator = false) {
592
+ if (value == null) return value;
593
+ return {
594
+ "start": value["start"],
595
+ "end": value["end"],
596
+ "value": value["value"]
597
+ };
598
+ }
599
+
600
+ //#endregion
601
+ //#region src/models/ModelResult.ts
602
+ /**
603
+ * @export
604
+ */
605
+ const ModelResultTypeEnum = { model: "model" };
606
+ /**
607
+ * Check if a given object implements the ModelResult interface.
608
+ */
609
+ function instanceOfModelResult(value) {
610
+ if (!("rule" in value) || value["rule"] === void 0) return false;
611
+ 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
+ return true;
615
+ }
616
+ function ModelResultFromJSON(json) {
617
+ return ModelResultFromJSONTyped(json, false);
618
+ }
619
+ function ModelResultFromJSONTyped(json, ignoreDiscriminator) {
620
+ if (json == null) return json;
621
+ return {
622
+ "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"]
628
+ };
629
+ }
630
+ function ModelResultToJSON(json) {
631
+ return ModelResultToJSONTyped(json, false);
632
+ }
633
+ function ModelResultToJSONTyped(value, ignoreDiscriminator = false) {
634
+ if (value == null) return value;
635
+ return {
636
+ "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"]
561
642
  };
562
643
  }
563
644
 
645
+ //#endregion
646
+ //#region src/models/RegexResult.ts
647
+ /**
648
+ * @export
649
+ */
650
+ const RegexResultTypeEnum = { regex: "regex" };
651
+ /**
652
+ * Check if a given object implements the RegexResult interface.
653
+ */
654
+ function instanceOfRegexResult(value) {
655
+ if (!("rule" in value) || value["rule"] === void 0) return false;
656
+ if (!("value" in value) || value["value"] === void 0) return false;
657
+ if (!("input" in value) || value["input"] === void 0) return false;
658
+ if (!("output" in value) || value["output"] === void 0) return false;
659
+ return true;
660
+ }
661
+ function RegexResultFromJSON(json) {
662
+ return RegexResultFromJSONTyped(json, false);
663
+ }
664
+ function RegexResultFromJSONTyped(json, ignoreDiscriminator) {
665
+ if (json == null) return json;
666
+ return {
667
+ "type": json["type"] == null ? void 0 : json["type"],
668
+ "rule": json["rule"],
669
+ "value": json["value"],
670
+ "input": TextRangeFromJSON(json["input"]),
671
+ "output": TextRangeFromJSON(json["output"])
672
+ };
673
+ }
674
+ function RegexResultToJSON(json) {
675
+ return RegexResultToJSONTyped(json, false);
676
+ }
677
+ function RegexResultToJSONTyped(value, ignoreDiscriminator = false) {
678
+ if (value == null) return value;
679
+ return {
680
+ "type": value["type"],
681
+ "rule": value["rule"],
682
+ "value": value["value"],
683
+ "input": TextRangeToJSON(value["input"]),
684
+ "output": TextRangeToJSON(value["output"])
685
+ };
686
+ }
687
+
688
+ //#endregion
689
+ //#region src/models/AnonymizeResponseBodySpansInner.ts
690
+ function AnonymizeResponseBodySpansInnerFromJSON(json) {
691
+ return AnonymizeResponseBodySpansInnerFromJSONTyped(json, false);
692
+ }
693
+ function AnonymizeResponseBodySpansInnerFromJSONTyped(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 AnonymizeResponseBodySpansInnerToJSON(json) {
702
+ return AnonymizeResponseBodySpansInnerToJSONTyped(json, false);
703
+ }
704
+ function AnonymizeResponseBodySpansInnerToJSONTyped(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
+
564
713
  //#endregion
565
714
  //#region src/models/AnonymizeResponseBody.ts
566
715
  /**
@@ -577,7 +726,7 @@ function AnonymizeResponseBodyFromJSONTyped(json, ignoreDiscriminator) {
577
726
  if (json == null) return json;
578
727
  return {
579
728
  "text": json["text"],
580
- "map": json["map"] == null ? void 0 : json["map"]
729
+ "spans": json["spans"] == null ? void 0 : json["spans"].map(AnonymizeResponseBodySpansInnerFromJSON)
581
730
  };
582
731
  }
583
732
  function AnonymizeResponseBodyToJSON(json) {
@@ -587,7 +736,7 @@ function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
587
736
  if (value == null) return value;
588
737
  return {
589
738
  "text": value["text"],
590
- "map": value["map"]
739
+ "spans": value["spans"] == null ? void 0 : value["spans"].map(AnonymizeResponseBodySpansInnerToJSON)
591
740
  };
592
741
  }
593
742
 
@@ -762,119 +911,6 @@ function HTTPValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
762
911
  return { "detail": value["detail"] == null ? void 0 : value["detail"].map(ValidationErrorToJSON) };
763
912
  }
764
913
 
765
- //#endregion
766
- //#region src/models/ModelSpan.ts
767
- /**
768
- * @export
769
- */
770
- const ModelSpanTypeEnum = { model: "model" };
771
- /**
772
- * Check if a given object implements the ModelSpan interface.
773
- */
774
- function instanceOfModelSpan(value) {
775
- if (!("start" in value) || value["start"] === void 0) return false;
776
- if (!("end" in value) || value["end"] === void 0) return false;
777
- if (!("value" in value) || value["value"] === void 0) return false;
778
- if (!("text" in value) || value["text"] === void 0) return false;
779
- return true;
780
- }
781
- function ModelSpanFromJSON(json) {
782
- return ModelSpanFromJSONTyped(json, false);
783
- }
784
- function ModelSpanFromJSONTyped(json, ignoreDiscriminator) {
785
- if (json == null) return json;
786
- return {
787
- "type": json["type"] == null ? void 0 : json["type"],
788
- "start": json["start"],
789
- "end": json["end"],
790
- "value": json["value"],
791
- "text": json["text"],
792
- "score": json["score"] == null ? void 0 : json["score"]
793
- };
794
- }
795
- function ModelSpanToJSON(json) {
796
- return ModelSpanToJSONTyped(json, false);
797
- }
798
- function ModelSpanToJSONTyped(value, ignoreDiscriminator = false) {
799
- if (value == null) return value;
800
- return {
801
- "type": value["type"],
802
- "start": value["start"],
803
- "end": value["end"],
804
- "value": value["value"],
805
- "text": value["text"],
806
- "score": value["score"]
807
- };
808
- }
809
-
810
- //#endregion
811
- //#region src/models/RegexSpan.ts
812
- /**
813
- * @export
814
- */
815
- const RegexSpanTypeEnum = { regex: "regex" };
816
- /**
817
- * Check if a given object implements the RegexSpan interface.
818
- */
819
- function instanceOfRegexSpan(value) {
820
- if (!("start" in value) || value["start"] === void 0) return false;
821
- if (!("end" in value) || value["end"] === void 0) return false;
822
- if (!("value" in value) || value["value"] === void 0) return false;
823
- if (!("text" in value) || value["text"] === void 0) return false;
824
- return true;
825
- }
826
- function RegexSpanFromJSON(json) {
827
- return RegexSpanFromJSONTyped(json, false);
828
- }
829
- function RegexSpanFromJSONTyped(json, ignoreDiscriminator) {
830
- if (json == null) return json;
831
- return {
832
- "type": json["type"] == null ? void 0 : json["type"],
833
- "start": json["start"],
834
- "end": json["end"],
835
- "value": json["value"],
836
- "text": json["text"]
837
- };
838
- }
839
- function RegexSpanToJSON(json) {
840
- return RegexSpanToJSONTyped(json, false);
841
- }
842
- function RegexSpanToJSONTyped(value, ignoreDiscriminator = false) {
843
- if (value == null) return value;
844
- return {
845
- "type": value["type"],
846
- "start": value["start"],
847
- "end": value["end"],
848
- "value": value["value"],
849
- "text": value["text"]
850
- };
851
- }
852
-
853
- //#endregion
854
- //#region src/models/MapValueInner.ts
855
- function MapValueInnerFromJSON(json) {
856
- return MapValueInnerFromJSONTyped(json, false);
857
- }
858
- function MapValueInnerFromJSONTyped(json, ignoreDiscriminator) {
859
- if (json == null) return json;
860
- switch (json["type"]) {
861
- case "model": return Object.assign({}, ModelSpanFromJSONTyped(json, true), { type: "model" });
862
- case "regex": return Object.assign({}, RegexSpanFromJSONTyped(json, true), { type: "regex" });
863
- default: return json;
864
- }
865
- }
866
- function MapValueInnerToJSON(json) {
867
- return MapValueInnerToJSONTyped(json, false);
868
- }
869
- function MapValueInnerToJSONTyped(value, ignoreDiscriminator = false) {
870
- if (value == null) return value;
871
- switch (value["type"]) {
872
- case "model": return Object.assign({}, ModelSpanToJSON(value), { type: "model" });
873
- case "regex": return Object.assign({}, RegexSpanToJSON(value), { type: "regex" });
874
- default: return value;
875
- }
876
- }
877
-
878
914
  //#endregion
879
915
  //#region src/models/ScanRequestBody.ts
880
916
  /**
@@ -1061,4 +1097,4 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
1061
1097
  };
1062
1098
 
1063
1099
  //#endregion
1064
- export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, 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, MapValueInnerFromJSON, MapValueInnerFromJSONTyped, MapValueInnerToJSON, MapValueInnerToJSONTyped, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelSpanFromJSON, ModelSpanFromJSONTyped, ModelSpanToJSON, ModelSpanToJSONTyped, ModelSpanTypeEnum, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexSpanFromJSON, RegexSpanFromJSONTyped, RegexSpanToJSON, RegexSpanToJSONTyped, RegexSpanTypeEnum, 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, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeResponseBody, instanceOfEncryptRule, instanceOfEntities, instanceOfHTTPValidationError, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelSpan, instanceOfRedactRule, instanceOfRegexEntity, instanceOfRegexSpan, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };
1100
+ export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodySpansInnerFromJSON, AnonymizeResponseBodySpansInnerFromJSONTyped, AnonymizeResponseBodySpansInnerToJSON, AnonymizeResponseBodySpansInnerToJSONTyped, 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 };
@@ -8,6 +8,7 @@ Name | Type
8
8
  ------------ | -------------
9
9
  `text` | string
10
10
  `rules` | [Array<AnonymizeRequestBodyRulesInner>](AnonymizeRequestBodyRulesInner.md)
11
+ `confidence_threshold` | number
11
12
 
12
13
  ## Example
13
14
 
@@ -18,6 +19,7 @@ import type { AnonymizeRequestBody } from '@quba/sensitive-data-protection'
18
19
  const example = {
19
20
  "text": null,
20
21
  "rules": null,
22
+ "confidence_threshold": null,
21
23
  } satisfies AnonymizeRequestBody
22
24
 
23
25
  console.log(example)
@@ -7,7 +7,7 @@
7
7
  Name | Type
8
8
  ------------ | -------------
9
9
  `text` | string
10
- `map` | { [key: string]: Array<MapValueInner>; }
10
+ `spans` | [Array<AnonymizeResponseBodySpansInner>](AnonymizeResponseBodySpansInner.md)
11
11
 
12
12
  ## Example
13
13
 
@@ -17,7 +17,7 @@ import type { AnonymizeResponseBody } from '@quba/sensitive-data-protection'
17
17
  // TODO: Update the object below with actual values
18
18
  const example = {
19
19
  "text": null,
20
- "map": null,
20
+ "spans": null,
21
21
  } satisfies AnonymizeResponseBody
22
22
 
23
23
  console.log(example)
@@ -1,5 +1,5 @@
1
1
 
2
- # MapValueInner
2
+ # AnonymizeResponseBodySpansInner
3
3
 
4
4
 
5
5
  ## Properties
@@ -7,26 +7,26 @@
7
7
  Name | Type
8
8
  ------------ | -------------
9
9
  `type` | string
10
- `start` | number
11
- `end` | number
10
+ `rule` | string
12
11
  `value` | string
13
- `text` | string
12
+ `input` | [TextRange](TextRange.md)
13
+ `output` | [TextRange](TextRange.md)
14
14
  `score` | number
15
15
 
16
16
  ## Example
17
17
 
18
18
  ```typescript
19
- import type { MapValueInner } from '@quba/sensitive-data-protection'
19
+ import type { AnonymizeResponseBodySpansInner } from '@quba/sensitive-data-protection'
20
20
 
21
21
  // TODO: Update the object below with actual values
22
22
  const example = {
23
23
  "type": null,
24
- "start": null,
25
- "end": null,
24
+ "rule": null,
26
25
  "value": null,
27
- "text": null,
26
+ "input": null,
27
+ "output": null,
28
28
  "score": null,
29
- } satisfies MapValueInner
29
+ } satisfies AnonymizeResponseBodySpansInner
30
30
 
31
31
  console.log(example)
32
32
 
@@ -35,7 +35,7 @@ const exampleJSON: string = JSON.stringify(example)
35
35
  console.log(exampleJSON)
36
36
 
37
37
  // Parse the JSON string back to an object
38
- const exampleParsed = JSON.parse(exampleJSON) as MapValueInner
38
+ const exampleParsed = JSON.parse(exampleJSON) as AnonymizeResponseBodySpansInner
39
39
  console.log(exampleParsed)
40
40
  ```
41
41
 
@@ -0,0 +1,45 @@
1
+
2
+ # ModelResult
3
+
4
+ Record of an AI model detection and its anonymization. Created when an AI model identifies an entity (e.g. PERSON, EMAIL) and a rule anonymizes the matched text.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `rule` | string
12
+ `value` | string
13
+ `input` | [TextRange](TextRange.md)
14
+ `output` | [TextRange](TextRange.md)
15
+ `score` | number
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { ModelResult } from '@quba/sensitive-data-protection'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "type": null,
25
+ "rule": null,
26
+ "value": null,
27
+ "input": null,
28
+ "output": null,
29
+ "score": null,
30
+ } satisfies ModelResult
31
+
32
+ console.log(example)
33
+
34
+ // Convert the instance to a JSON string
35
+ const exampleJSON: string = JSON.stringify(example)
36
+ console.log(exampleJSON)
37
+
38
+ // Parse the JSON string back to an object
39
+ const exampleParsed = JSON.parse(exampleJSON) as ModelResult
40
+ console.log(exampleParsed)
41
+ ```
42
+
43
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
44
+
45
+
@@ -1,33 +1,31 @@
1
1
 
2
- # ModelSpan
2
+ # RegexResult
3
3
 
4
- A detected model span.
4
+ Record of a regex detection and its anonymization. Created when a regex pattern matches text and a rule anonymizes the matched text.
5
5
 
6
6
  ## Properties
7
7
 
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `type` | string
11
- `start` | number
12
- `end` | number
11
+ `rule` | string
13
12
  `value` | string
14
- `text` | string
15
- `score` | number
13
+ `input` | [TextRange](TextRange.md)
14
+ `output` | [TextRange](TextRange.md)
16
15
 
17
16
  ## Example
18
17
 
19
18
  ```typescript
20
- import type { ModelSpan } from '@quba/sensitive-data-protection'
19
+ import type { RegexResult } from '@quba/sensitive-data-protection'
21
20
 
22
21
  // TODO: Update the object below with actual values
23
22
  const example = {
24
23
  "type": null,
25
- "start": null,
26
- "end": null,
24
+ "rule": null,
27
25
  "value": null,
28
- "text": null,
29
- "score": null,
30
- } satisfies ModelSpan
26
+ "input": null,
27
+ "output": null,
28
+ } satisfies RegexResult
31
29
 
32
30
  console.log(example)
33
31
 
@@ -36,7 +34,7 @@ const exampleJSON: string = JSON.stringify(example)
36
34
  console.log(exampleJSON)
37
35
 
38
36
  // Parse the JSON string back to an object
39
- const exampleParsed = JSON.parse(exampleJSON) as ModelSpan
37
+ const exampleParsed = JSON.parse(exampleJSON) as RegexResult
40
38
  console.log(exampleParsed)
41
39
  ```
42
40
 
@@ -1,31 +1,27 @@
1
1
 
2
- # RegexSpan
2
+ # TextRange
3
3
 
4
- A detected regex span.
4
+ A character range within a text, carrying the substring it covers.
5
5
 
6
6
  ## Properties
7
7
 
8
8
  Name | Type
9
9
  ------------ | -------------
10
- `type` | string
11
10
  `start` | number
12
11
  `end` | number
13
12
  `value` | string
14
- `text` | string
15
13
 
16
14
  ## Example
17
15
 
18
16
  ```typescript
19
- import type { RegexSpan } from '@quba/sensitive-data-protection'
17
+ import type { TextRange } from '@quba/sensitive-data-protection'
20
18
 
21
19
  // TODO: Update the object below with actual values
22
20
  const example = {
23
- "type": null,
24
21
  "start": null,
25
22
  "end": null,
26
23
  "value": null,
27
- "text": null,
28
- } satisfies RegexSpan
24
+ } satisfies TextRange
29
25
 
30
26
  console.log(example)
31
27
 
@@ -34,7 +30,7 @@ const exampleJSON: string = JSON.stringify(example)
34
30
  console.log(exampleJSON)
35
31
 
36
32
  // Parse the JSON string back to an object
37
- const exampleParsed = JSON.parse(exampleJSON) as RegexSpan
33
+ const exampleParsed = JSON.parse(exampleJSON) as TextRange
38
34
  console.log(exampleParsed)
39
35
  ```
40
36
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "homepage": "https://quba.ae",
8
- "version": "0.0.6",
8
+ "version": "0.0.7",
9
9
  "keywords": [
10
10
  "sensitive data protection",
11
11
  "sdp",