@quba/sensitive-data-protection 0.0.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +59 -6
  2. package/dist/index.cjs +2908 -560
  3. package/dist/index.d.cts +3092 -764
  4. package/dist/index.d.mts +3092 -764
  5. package/dist/index.mjs +2593 -526
  6. package/docs/Action.md +33 -0
  7. package/docs/AnonymizeFileResponseBody.md +43 -0
  8. package/docs/AnonymizeRequestBody.md +4 -4
  9. package/docs/AnonymizeResponseBody.md +3 -1
  10. package/docs/{AnonymizeResponseBodySpansInner.md → Applied.md} +7 -4
  11. package/docs/At.md +37 -0
  12. package/docs/AttributeSegment.md +37 -0
  13. package/docs/{ValidationErrorLocInner.md → CellKind.md} +5 -4
  14. package/docs/CellNoteSegment.md +35 -0
  15. package/docs/CellSegment.md +43 -0
  16. package/docs/CommentKind.md +33 -0
  17. package/docs/CommentSegment.md +39 -0
  18. package/docs/ComponentSegment.md +39 -0
  19. package/docs/DetectRule.md +3 -1
  20. package/docs/ElementSegment.md +39 -0
  21. package/docs/EncryptRule.md +3 -1
  22. package/docs/{DetectRuleEntitiesInner.md → EndnoteSegment.md} +7 -6
  23. package/docs/{EntitiesAnyOfInner.md → EntityBody.md} +5 -4
  24. package/docs/ErrorCode.md +33 -0
  25. package/docs/ErrorInfo.md +39 -0
  26. package/docs/FieldError.md +51 -0
  27. package/docs/FieldErrorCode.md +33 -0
  28. package/docs/{HTTPValidationError.md → FieldErrorPathInner.md} +5 -6
  29. package/docs/FieldSegment.md +39 -0
  30. package/docs/FileAttributeResult.md +47 -0
  31. package/docs/FileEmbeddedResult.md +43 -0
  32. package/docs/FileModelResult.md +49 -0
  33. package/docs/{AnonymizeResponseBodyResultsInner.md → FileRegexResult.md} +11 -8
  34. package/docs/FileResult.md +51 -0
  35. package/docs/FootnoteSegment.md +37 -0
  36. package/docs/FrameSegment.md +37 -0
  37. package/docs/HMACRule.md +43 -0
  38. package/docs/HeaderFooterSegment.md +37 -0
  39. package/docs/IndexSegment.md +37 -0
  40. package/docs/ItemSegment.md +37 -0
  41. package/docs/KeySegment.md +37 -0
  42. package/docs/Kind.md +33 -0
  43. package/docs/LineSegment.md +39 -0
  44. package/docs/MaskRule.md +3 -1
  45. package/docs/ModelEntity.md +1 -1
  46. package/docs/ModelError.md +35 -0
  47. package/docs/ModelResult.md +3 -1
  48. package/docs/ModelStatus.md +45 -0
  49. package/docs/{Entities.md → ModelType.md} +5 -4
  50. package/docs/ParagraphKind.md +33 -0
  51. package/docs/ParagraphSegment.md +39 -0
  52. package/docs/PartSegment.md +39 -0
  53. package/docs/PathSegment.md +79 -0
  54. package/docs/PoliciesApi.md +10 -1
  55. package/docs/PolicyDocumentRulesInner.md +7 -1
  56. package/docs/{ValidationError.md → PropertySegment.md} +7 -12
  57. package/docs/PseudonymizeRule.md +41 -0
  58. package/docs/RangeKind.md +33 -0
  59. package/docs/RangeSegment.md +39 -0
  60. package/docs/RedactRule.md +3 -1
  61. package/docs/Refusal.md +36 -0
  62. package/docs/RegexResult.md +2 -0
  63. package/docs/RegionSegment.md +43 -0
  64. package/docs/ReplaceRule.md +3 -1
  65. package/docs/{AnonymizeRequestBodyRulesInner.md → RuleBody.md} +12 -5
  66. package/docs/SHA256Rule.md +3 -1
  67. package/docs/SHA512Rule.md +3 -1
  68. package/docs/ScanRequestBody.md +2 -0
  69. package/docs/ScanResponseBody.md +2 -0
  70. package/docs/SegmentSegment.md +39 -0
  71. package/docs/SensitiveDataProtectionApi.md +172 -4
  72. package/docs/ShapeKind.md +33 -0
  73. package/docs/ShapeSegment.md +41 -0
  74. package/docs/SheetSegment.md +39 -0
  75. package/docs/SlideSegment.md +41 -0
  76. package/docs/SpeakerNotesSegment.md +41 -0
  77. package/docs/TableSegment.md +37 -0
  78. package/docs/TagSegment.md +41 -0
  79. package/docs/TextSegment.md +39 -0
  80. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+
2
+ # RangeSegment
3
+
4
+ Cells, in A1 (`A2:A100`): a data validation\'s.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `ref` | string
12
+ `kind` | [RangeKind](RangeKind.md)
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { RangeSegment } from '@quba/sensitive-data-protection'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "type": null,
22
+ "ref": null,
23
+ "kind": null,
24
+ } satisfies RangeSegment
25
+
26
+ console.log(example)
27
+
28
+ // Convert the instance to a JSON string
29
+ const exampleJSON: string = JSON.stringify(example)
30
+ console.log(exampleJSON)
31
+
32
+ // Parse the JSON string back to an object
33
+ const exampleParsed = JSON.parse(exampleJSON) as RangeSegment
34
+ console.log(exampleParsed)
35
+ ```
36
+
37
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
38
+
39
+
@@ -8,7 +8,8 @@ Remove each matched value entirely (replace with an empty string).
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `type` | string
11
- `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `entities` | [Array<EntityBody>](EntityBody.md)
12
+ `action` | [Action](Action.md)
12
13
 
13
14
  ## Example
14
15
 
@@ -19,6 +20,7 @@ import type { RedactRule } from '@quba/sensitive-data-protection'
19
20
  const example = {
20
21
  "type": null,
21
22
  "entities": null,
23
+ "action": null,
22
24
  } satisfies RedactRule
23
25
 
24
26
  console.log(example)
@@ -0,0 +1,36 @@
1
+
2
+ # Refusal
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `error` | string
10
+ `signup` | boolean
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { Refusal } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "error": null,
20
+ "signup": null,
21
+ } satisfies Refusal
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as Refusal
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -12,6 +12,7 @@ Name | Type
12
12
  `value` | string
13
13
  `input` | [TextRange](TextRange.md)
14
14
  `output` | [TextRange](TextRange.md)
15
+ `action` | [Action](Action.md)
15
16
 
16
17
  ## Example
17
18
 
@@ -25,6 +26,7 @@ const example = {
25
26
  "value": null,
26
27
  "input": null,
27
28
  "output": null,
29
+ "action": null,
28
30
  } satisfies RegexResult
29
31
 
30
32
  console.log(example)
@@ -0,0 +1,43 @@
1
+
2
+ # RegionSegment
3
+
4
+ A box on an image, in its upright pixels, padded as painted: where a value found in it is. A value over several boxes has a path for each.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `x` | number
12
+ `y` | number
13
+ `w` | number
14
+ `h` | number
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { RegionSegment } from '@quba/sensitive-data-protection'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "type": null,
24
+ "x": null,
25
+ "y": null,
26
+ "w": null,
27
+ "h": null,
28
+ } satisfies RegionSegment
29
+
30
+ console.log(example)
31
+
32
+ // Convert the instance to a JSON string
33
+ const exampleJSON: string = JSON.stringify(example)
34
+ console.log(exampleJSON)
35
+
36
+ // Parse the JSON string back to an object
37
+ const exampleParsed = JSON.parse(exampleJSON) as RegionSegment
38
+ console.log(exampleParsed)
39
+ ```
40
+
41
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
42
+
43
+
@@ -8,7 +8,8 @@ Replace each matched value with a fixed string (default \'****\').
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `type` | string
11
- `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `entities` | [Array<EntityBody>](EntityBody.md)
12
+ `action` | [Action](Action.md)
12
13
  `replacement` | string
13
14
 
14
15
  ## Example
@@ -20,6 +21,7 @@ import type { ReplaceRule } from '@quba/sensitive-data-protection'
20
21
  const example = {
21
22
  "type": null,
22
23
  "entities": null,
24
+ "action": null,
23
25
  "replacement": null,
24
26
  } satisfies ReplaceRule
25
27
 
@@ -1,34 +1,41 @@
1
1
 
2
- # AnonymizeRequestBodyRulesInner
2
+ # RuleBody
3
3
 
4
+ One rule, chosen by its `type`.
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `type` | string
10
- `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `entities` | [Array<EntityBody>](EntityBody.md)
12
+ `action` | [Action](Action.md)
11
13
  `replacement` | string
12
14
  `key` | string
13
15
  `masking_char` | string
14
16
  `chars_to_mask` | number
15
17
  `from_end` | boolean
18
+ `tag` | string
19
+ `length` | number
16
20
 
17
21
  ## Example
18
22
 
19
23
  ```typescript
20
- import type { AnonymizeRequestBodyRulesInner } from '@quba/sensitive-data-protection'
24
+ import type { RuleBody } from '@quba/sensitive-data-protection'
21
25
 
22
26
  // TODO: Update the object below with actual values
23
27
  const example = {
24
28
  "type": null,
25
29
  "entities": null,
30
+ "action": null,
26
31
  "replacement": null,
27
32
  "key": null,
28
33
  "masking_char": null,
29
34
  "chars_to_mask": null,
30
35
  "from_end": null,
31
- } satisfies AnonymizeRequestBodyRulesInner
36
+ "tag": null,
37
+ "length": null,
38
+ } satisfies RuleBody
32
39
 
33
40
  console.log(example)
34
41
 
@@ -37,7 +44,7 @@ const exampleJSON: string = JSON.stringify(example)
37
44
  console.log(exampleJSON)
38
45
 
39
46
  // Parse the JSON string back to an object
40
- const exampleParsed = JSON.parse(exampleJSON) as AnonymizeRequestBodyRulesInner
47
+ const exampleParsed = JSON.parse(exampleJSON) as RuleBody
41
48
  console.log(exampleParsed)
42
49
  ```
43
50
 
@@ -8,7 +8,8 @@ Replace each matched value with its SHA-256 hex digest.
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `type` | string
11
- `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `entities` | [Array<EntityBody>](EntityBody.md)
12
+ `action` | [Action](Action.md)
12
13
 
13
14
  ## Example
14
15
 
@@ -19,6 +20,7 @@ import type { SHA256Rule } from '@quba/sensitive-data-protection'
19
20
  const example = {
20
21
  "type": null,
21
22
  "entities": null,
23
+ "action": null,
22
24
  } satisfies SHA256Rule
23
25
 
24
26
  console.log(example)
@@ -8,7 +8,8 @@ Replace each matched value with its SHA-512 hex digest.
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `type` | string
11
- `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `entities` | [Array<EntityBody>](EntityBody.md)
12
+ `action` | [Action](Action.md)
12
13
 
13
14
  ## Example
14
15
 
@@ -19,6 +20,7 @@ import type { SHA512Rule } from '@quba/sensitive-data-protection'
19
20
  const example = {
20
21
  "type": null,
21
22
  "entities": null,
23
+ "action": null,
22
24
  } satisfies SHA512Rule
23
25
 
24
26
  console.log(example)
@@ -11,6 +11,7 @@ Name | Type
11
11
  `language` | string
12
12
  `entities` | Array<string>
13
13
  `confidence_threshold` | number
14
+ `models` | Array<string>
14
15
 
15
16
  ## Example
16
17
 
@@ -23,6 +24,7 @@ const example = {
23
24
  "language": null,
24
25
  "entities": null,
25
26
  "confidence_threshold": null,
27
+ "models": null,
26
28
  } satisfies ScanRequestBody
27
29
 
28
30
  console.log(example)
@@ -9,6 +9,7 @@ Name | Type
9
9
  ------------ | -------------
10
10
  `results` | [Array<ScanResult>](ScanResult.md)
11
11
  `usage` | [Usage](Usage.md)
12
+ `models` | Array<string>
12
13
 
13
14
  ## Example
14
15
 
@@ -19,6 +20,7 @@ import type { ScanResponseBody } from '@quba/sensitive-data-protection'
19
20
  const example = {
20
21
  "results": null,
21
22
  "usage": null,
23
+ "models": null,
22
24
  } satisfies ScanResponseBody
23
25
 
24
26
  console.log(example)
@@ -0,0 +1,39 @@
1
+
2
+ # SegmentSegment
3
+
4
+ An HL7 v2 segment (`PID`).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `name` | string
12
+ `index` | number
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { SegmentSegment } from '@quba/sensitive-data-protection'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "type": null,
22
+ "name": null,
23
+ "index": null,
24
+ } satisfies SegmentSegment
25
+
26
+ console.log(example)
27
+
28
+ // Convert the instance to a JSON string
29
+ const exampleJSON: string = JSON.stringify(example)
30
+ console.log(exampleJSON)
31
+
32
+ // Parse the JSON string back to an object
33
+ const exampleParsed = JSON.parse(exampleJSON) as SegmentSegment
34
+ console.log(exampleParsed)
35
+ ```
36
+
37
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
38
+
39
+
@@ -4,19 +4,112 @@ All URIs are relative to *https://www.quba.co/api/sdp*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**anonymizeFile**](SensitiveDataProtectionApi.md#anonymizefile) | **POST** /anonymize/file | Anonymize File |
7
8
  | [**anonymizeText**](SensitiveDataProtectionApi.md#anonymizetext) | **POST** /anonymize | Anonymize Text |
8
9
  | [**healthCheck**](SensitiveDataProtectionApi.md#healthcheck) | **GET** /health | Health |
10
+ | [**listModels**](SensitiveDataProtectionApi.md#listmodels) | **GET** /models | List Models |
9
11
  | [**scanText**](SensitiveDataProtectionApi.md#scantext) | **POST** /scan | Scan Text |
10
12
 
11
13
 
12
14
 
15
+ ## anonymizeFile
16
+
17
+ > AnonymizeFileResponseBody anonymizeFile(file, rules, confidence_threshold, embedded_rules, table_headers, models, dicom_options)
18
+
19
+ Anonymize File
20
+
21
+ Anonymize sensitive data in a file. Reads the file\'s text (Office parts, cells, lines), applies the rules as `/anonymize` does, and returns the file in its own format with every change made: each value found, with where it is (`path`), and each part removed. With `Accept: application/x-ndjson`, answers with one JSON event per line: `start`, a `batch` per step of reading, then `done` (the same body) or `error`. An Office file\'s images and kept embedded files are read as files of their own beside its text: each has `task` events (queued, started, then done, stopped or failed), and its own `start` and `batch` events carry its `task` path.
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ import {
27
+ Configuration,
28
+ SensitiveDataProtectionApi,
29
+ } from '@quba/sensitive-data-protection';
30
+ import type { AnonymizeFileRequest } from '@quba/sensitive-data-protection';
31
+
32
+ async function example() {
33
+ console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
34
+ const config = new Configuration({
35
+ // To configure API key authorization: ApiKeyAuth
36
+ apiKey: "YOUR API KEY",
37
+ });
38
+ const api = new SensitiveDataProtectionApi(config);
39
+
40
+ const body = {
41
+ // Blob | The file: docx, xlsx, pptx, csv, tsv, txt, md, log, json, jsonl, xml, html, hl7 (HL7 v2), png, jpg, webp, bmp, tiff (one page) or dcm (DICOM Part 10). Office files, images, DICOM, XML, HTML, HL7 v2 and FHIR JSON are told by their bytes; other text by its part\\\'s `Content-Type` when specific, else its name\\\'s extension.
42
+ file: BINARY_DATA_HERE,
43
+ // string | The de-identification rules, a JSON array as for `/anonymize`. Omit for the default rules. (optional)
44
+ rules: rules_example,
45
+ // number | Minimum score for model detections. Does not affect regex matches. (optional)
46
+ confidence_threshold: 8.14,
47
+ // string | Embedded content (embedded files, OLE objects, a FHIR JSON photo\\\'s base64 `data` on Patient, Practitioner, RelatedPerson or Person). `anonymize` (default): what can be read (an Office or text file; a PNG, JPEG, WebP, BMP or TIFF image where this server reads images) is anonymized as a file of its own and written back, the rest removed. `anonymize_or_keep`: the same, the rest kept unread. `remove`: all removed. `keep`: all kept unread. Thumbnails are always removed; fonts and printer settings always kept; an Office file\\\'s pictures are read and masked where this server reads images, whatever the rule. (optional)
48
+ embedded_rules: embedded_rules_example,
49
+ // string | CSV, TSV and xlsx only: where a table\\\'s headers are, in the data\\\'s order (field 1, column A), so each value is read with its header. (optional)
50
+ table_headers: table_headers_example,
51
+ // string | Ids from `GET /models`, comma-separated (or the field repeated), each type\\\'s in order of preference: the first `ready` text model runs, and, for a file with images (an image, a DICOM file\\\'s pixels, an Office file\\\'s images), the first `ready` image reader. A type named none of runs on the first ready of all, largest first, waiting at startup until one is. None named of a type is ready: a 503, with `Retry-After` while one still loads. An unknown id: a 422. Omit for the defaults. (optional)
52
+ models: models_example,
53
+ // string | DICOM only: the options of the Basic Application Level Confidentiality Profile (PS3.15 Annex E) to apply, comma-separated, of: `clean_descriptors`, `retain_longitudinal_full_dates`, `retain_patient_characteristics`, `retain_device_identity`, `retain_institution_identity`, `retain_uids`. Empty for none. `clean_descriptors` scans descriptions and comments with the rules instead of removing them. (optional)
54
+ dicom_options: dicom_options_example,
55
+ } satisfies AnonymizeFileRequest;
56
+
57
+ try {
58
+ const data = await api.anonymizeFile(body);
59
+ console.log(data);
60
+ } catch (error) {
61
+ console.error(error);
62
+ }
63
+ }
64
+
65
+ // Run the test
66
+ example().catch(console.error);
67
+ ```
68
+
69
+ ### Parameters
70
+
71
+
72
+ | Name | Type | Description | Notes |
73
+ |------------- | ------------- | ------------- | -------------|
74
+ | **file** | `Blob` | The file: docx, xlsx, pptx, csv, tsv, txt, md, log, json, jsonl, xml, html, hl7 (HL7 v2), png, jpg, webp, bmp, tiff (one page) or dcm (DICOM Part 10). Office files, images, DICOM, XML, HTML, HL7 v2 and FHIR JSON are told by their bytes; other text by its part\\\'s `Content-Type` when specific, else its name\\\'s extension. | [Defaults to `undefined`] |
75
+ | **rules** | `string` | The de-identification rules, a JSON array as for `/anonymize`. Omit for the default rules. | [Optional] [Defaults to `undefined`] |
76
+ | **confidence_threshold** | `number` | Minimum score for model detections. Does not affect regex matches. | [Optional] [Defaults to `0.5`] |
77
+ | **embedded_rules** | `anonymize`, `anonymize_or_keep`, `remove`, `keep` | Embedded content (embedded files, OLE objects, a FHIR JSON photo\\\'s base64 `data` on Patient, Practitioner, RelatedPerson or Person). `anonymize` (default): what can be read (an Office or text file; a PNG, JPEG, WebP, BMP or TIFF image where this server reads images) is anonymized as a file of its own and written back, the rest removed. `anonymize_or_keep`: the same, the rest kept unread. `remove`: all removed. `keep`: all kept unread. Thumbnails are always removed; fonts and printer settings always kept; an Office file\\\'s pictures are read and masked where this server reads images, whatever the rule. | [Optional] [Defaults to `'anonymize'`] [Enum: anonymize, anonymize_or_keep, remove, keep] |
78
+ | **table_headers** | `none`, `first_row`, `first_column`, `last_column` | CSV, TSV and xlsx only: where a table\\\'s headers are, in the data\\\'s order (field 1, column A), so each value is read with its header. | [Optional] [Defaults to `'none'`] [Enum: none, first_row, first_column, last_column] |
79
+ | **models** | `string` | Ids from `GET /models`, comma-separated (or the field repeated), each type\\\'s in order of preference: the first `ready` text model runs, and, for a file with images (an image, a DICOM file\\\'s pixels, an Office file\\\'s images), the first `ready` image reader. A type named none of runs on the first ready of all, largest first, waiting at startup until one is. None named of a type is ready: a 503, with `Retry-After` while one still loads. An unknown id: a 422. Omit for the defaults. | [Optional] [Defaults to `undefined`] |
80
+ | **dicom_options** | `string` | DICOM only: the options of the Basic Application Level Confidentiality Profile (PS3.15 Annex E) to apply, comma-separated, of: `clean_descriptors`, `retain_longitudinal_full_dates`, `retain_patient_characteristics`, `retain_device_identity`, `retain_institution_identity`, `retain_uids`. Empty for none. `clean_descriptors` scans descriptions and comments with the rules instead of removing them. | [Optional] [Defaults to `'clean_descriptors'`] |
81
+
82
+ ### Return type
83
+
84
+ [**AnonymizeFileResponseBody**](AnonymizeFileResponseBody.md)
85
+
86
+ ### Authorization
87
+
88
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
89
+
90
+ ### HTTP request headers
91
+
92
+ - **Content-Type**: `multipart/form-data`
93
+ - **Accept**: `application/json`
94
+
95
+
96
+ ### HTTP response details
97
+ | Status code | Description | Response headers |
98
+ |-------------|-------------|------------------|
99
+ | **200** | The anonymized file and its results. | - |
100
+ | **422** | A field or the file is invalid; `details` says which. | - |
101
+ | **500** | The request failed, or the output still held a replaced value. Retrying may help. | - |
102
+
103
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
104
+
105
+
13
106
  ## anonymizeText
14
107
 
15
108
  > AnonymizeResponseBody anonymizeText(AnonymizeRequestBody)
16
109
 
17
110
  Anonymize Text
18
111
 
19
- 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.
112
+ 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, pseudonymize, hash, or encrypt) to every match. Returns the anonymized text together with a record of each transformation, including the original and resulting character ranges.
20
113
 
21
114
  ### Example
22
115
 
@@ -77,8 +170,15 @@ example().catch(console.error);
77
170
  | Status code | Description | Response headers |
78
171
  |-------------|-------------|------------------|
79
172
  | **200** | Successful Response | - |
80
- | **404** | No such policy in the calling organization. | - |
81
- | **422** | Validation Error | - |
173
+ | **400** | The body is not JSON. | - |
174
+ | **401** | Missing or invalid API key. | - |
175
+ | **402** | Out of credits. | - |
176
+ | **403** | The calling key or member has an assigned policy, so the request may not send its own rules or confidence_threshold. | - |
177
+ | **409** | The policy assigned to the calling key or member cannot be read. | - |
178
+ | **413** | Text too long without an account. | - |
179
+ | **422** | Some fields are invalid; `details` says which. | - |
180
+ | **500** | The request failed. Retrying may help. | - |
181
+ | **503** | Engine unavailable. Not billed. | - |
82
182
 
83
183
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
84
184
 
@@ -142,6 +242,68 @@ This endpoint does not need any parameter.
142
242
  | Status code | Description | Response headers |
143
243
  |-------------|-------------|------------------|
144
244
  | **200** | Successful Response | - |
245
+ | **401** | Missing or invalid API key. | - |
246
+ | **503** | Engine unavailable. Not billed. | - |
247
+
248
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
249
+
250
+
251
+ ## listModels
252
+
253
+ > Array<ModelStatus> listModels()
254
+
255
+ List Models
256
+
257
+ The models this server offers: text models (`type: text`, run on every request), then image readers (`type: image`, read a file\'s images), each type largest first. A request lists ids in `models`, each type\'s in order of preference: of each type, the first `ready` runs. If none of a type it names is ready, it is refused with a 503, with `Retry-After` while one still loads. A type it names none of runs on its `default`: the first `ready`, largest first (so `default` moves as models load); at startup, before any is ready, the request waits for the first to load. An unknown id is a 422.
258
+
259
+ ### Example
260
+
261
+ ```ts
262
+ import {
263
+ Configuration,
264
+ SensitiveDataProtectionApi,
265
+ } from '@quba/sensitive-data-protection';
266
+ import type { ListModelsRequest } from '@quba/sensitive-data-protection';
267
+
268
+ async function example() {
269
+ console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
270
+ const api = new SensitiveDataProtectionApi();
271
+
272
+ try {
273
+ const data = await api.listModels();
274
+ console.log(data);
275
+ } catch (error) {
276
+ console.error(error);
277
+ }
278
+ }
279
+
280
+ // Run the test
281
+ example().catch(console.error);
282
+ ```
283
+
284
+ ### Parameters
285
+
286
+ This endpoint does not need any parameter.
287
+
288
+ ### Return type
289
+
290
+ [**Array<ModelStatus>**](ModelStatus.md)
291
+
292
+ ### Authorization
293
+
294
+ No authorization required
295
+
296
+ ### HTTP request headers
297
+
298
+ - **Content-Type**: Not defined
299
+ - **Accept**: `application/json`
300
+
301
+
302
+ ### HTTP response details
303
+ | Status code | Description | Response headers |
304
+ |-------------|-------------|------------------|
305
+ | **200** | Successful Response | - |
306
+ | **503** | Engine unavailable. Not billed. | - |
145
307
 
146
308
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
147
309
 
@@ -213,7 +375,13 @@ example().catch(console.error);
213
375
  | Status code | Description | Response headers |
214
376
  |-------------|-------------|------------------|
215
377
  | **200** | Successful Response | - |
216
- | **422** | Validation Error | - |
378
+ | **400** | The body is not JSON. | - |
379
+ | **401** | Missing or invalid API key. | - |
380
+ | **402** | Out of credits. | - |
381
+ | **413** | Text too long without an account. | - |
382
+ | **422** | Some fields are invalid; `details` says which. | - |
383
+ | **500** | The request failed. Retrying may help. | - |
384
+ | **503** | Engine unavailable. Not billed. | - |
217
385
 
218
386
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
219
387
 
@@ -0,0 +1,33 @@
1
+
2
+ # ShapeKind
3
+
4
+ What a shape\'s text is when it is not its own text.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { ShapeKind } from '@quba/sensitive-data-protection'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies ShapeKind
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as ShapeKind
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -0,0 +1,41 @@
1
+
2
+ # ShapeSegment
3
+
4
+ A shape: a text box, picture, table, group; its `cNvPr` / `docPr` id and name. No `kind` for its own text.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `id` | number
12
+ `name` | string
13
+ `kind` | [ShapeKind](ShapeKind.md)
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { ShapeSegment } from '@quba/sensitive-data-protection'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "type": null,
23
+ "id": null,
24
+ "name": null,
25
+ "kind": null,
26
+ } satisfies ShapeSegment
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as ShapeSegment
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+
@@ -0,0 +1,39 @@
1
+
2
+ # SheetSegment
3
+
4
+ A worksheet: its name on the tab, and its part.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `name` | string
12
+ `part` | string
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { SheetSegment } from '@quba/sensitive-data-protection'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "type": null,
22
+ "name": null,
23
+ "part": null,
24
+ } satisfies SheetSegment
25
+
26
+ console.log(example)
27
+
28
+ // Convert the instance to a JSON string
29
+ const exampleJSON: string = JSON.stringify(example)
30
+ console.log(exampleJSON)
31
+
32
+ // Parse the JSON string back to an object
33
+ const exampleParsed = JSON.parse(exampleJSON) as SheetSegment
34
+ console.log(exampleParsed)
35
+ ```
36
+
37
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
38
+
39
+