@quba/sensitive-data-protection 0.0.5 → 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/README.md +4 -4
- package/dist/index.cjs +411 -370
- package/dist/index.d.cts +330 -296
- package/dist/index.d.mts +330 -296
- package/dist/index.mjs +330 -294
- package/docs/AnonymizeRequestBody.md +2 -0
- package/docs/AnonymizeResponseBody.md +2 -2
- package/docs/{MapValueInner.md → AnonymizeResponseBodySpansInner.md} +10 -10
- package/docs/ModelResult.md +45 -0
- package/docs/{ModelSpan.md → RegexResult.md} +11 -13
- package/docs/{RegexSpan.md → TextRange.md} +5 -9
- package/package.json +1 -1
|
@@ -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
|
-
`
|
|
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
|
-
"
|
|
20
|
+
"spans": null,
|
|
21
21
|
} satisfies AnonymizeResponseBody
|
|
22
22
|
|
|
23
23
|
console.log(example)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
#
|
|
2
|
+
# AnonymizeResponseBodySpansInner
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`type` | string
|
|
10
|
-
`
|
|
11
|
-
`end` | number
|
|
10
|
+
`rule` | string
|
|
12
11
|
`value` | string
|
|
13
|
-
`
|
|
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 {
|
|
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
|
-
"
|
|
25
|
-
"end": null,
|
|
24
|
+
"rule": null,
|
|
26
25
|
"value": null,
|
|
27
|
-
"
|
|
26
|
+
"input": null,
|
|
27
|
+
"output": null,
|
|
28
28
|
"score": null,
|
|
29
|
-
} satisfies
|
|
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
|
|
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
|
-
#
|
|
2
|
+
# RegexResult
|
|
3
3
|
|
|
4
|
-
|
|
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
|
-
`
|
|
12
|
-
`end` | number
|
|
11
|
+
`rule` | string
|
|
13
12
|
`value` | string
|
|
14
|
-
`
|
|
15
|
-
`
|
|
13
|
+
`input` | [TextRange](TextRange.md)
|
|
14
|
+
`output` | [TextRange](TextRange.md)
|
|
16
15
|
|
|
17
16
|
## Example
|
|
18
17
|
|
|
19
18
|
```typescript
|
|
20
|
-
import type {
|
|
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
|
-
"
|
|
26
|
-
"end": null,
|
|
24
|
+
"rule": null,
|
|
27
25
|
"value": null,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
} satisfies
|
|
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
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as RegexResult
|
|
40
38
|
console.log(exampleParsed)
|
|
41
39
|
```
|
|
42
40
|
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
|
|
2
|
-
#
|
|
2
|
+
# TextRange
|
|
3
3
|
|
|
4
|
-
A
|
|
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 {
|
|
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
|
-
|
|
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
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as TextRange
|
|
38
34
|
console.log(exampleParsed)
|
|
39
35
|
```
|
|
40
36
|
|