@quba/sensitive-data-protection 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/HTTPValidationError.md +34 -0
- package/docs/ScanRequestBody.md +40 -0
- package/docs/ScanResponseBody.md +34 -0
- package/docs/ScanResult.md +40 -0
- package/docs/SensitiveDataProtectionApi.md +137 -0
- package/docs/ValidationError.md +38 -0
- package/docs/ValidationErrorLocInner.md +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# HTTPValidationError
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`detail` | [Array<ValidationError>](ValidationError.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { HTTPValidationError } from '@quba/sensitive-data-protection'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"detail": null,
|
|
19
|
+
} satisfies HTTPValidationError
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as HTTPValidationError
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# ScanRequestBody
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`text` | string
|
|
10
|
+
`language` | string
|
|
11
|
+
`entities` | Array<string>
|
|
12
|
+
`confidence_threshold` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { ScanRequestBody } from '@quba/sensitive-data-protection'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"text": null,
|
|
22
|
+
"language": null,
|
|
23
|
+
"entities": null,
|
|
24
|
+
"confidence_threshold": null,
|
|
25
|
+
} satisfies ScanRequestBody
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as ScanRequestBody
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ScanResponseBody
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`results` | [Array<ScanResult>](ScanResult.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ScanResponseBody } from '@quba/sensitive-data-protection'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"results": null,
|
|
19
|
+
} satisfies ScanResponseBody
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ScanResponseBody
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# ScanResult
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`start` | number
|
|
10
|
+
`end` | number
|
|
11
|
+
`score` | number
|
|
12
|
+
`entity_type` | string
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { ScanResult } from '@quba/sensitive-data-protection'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"start": null,
|
|
22
|
+
"end": null,
|
|
23
|
+
"score": null,
|
|
24
|
+
"entity_type": null,
|
|
25
|
+
} satisfies ScanResult
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as ScanResult
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# SensitiveDataProtectionApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://app.quba.ae/api/sdp*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**healthCheck**](SensitiveDataProtectionApi.md#healthcheck) | **GET** /health | Health |
|
|
8
|
+
| [**scanText**](SensitiveDataProtectionApi.md#scantext) | **POST** /scan | Scan Text |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## healthCheck
|
|
13
|
+
|
|
14
|
+
> string healthCheck()
|
|
15
|
+
|
|
16
|
+
Health
|
|
17
|
+
|
|
18
|
+
Return basic health probe result.
|
|
19
|
+
|
|
20
|
+
### Example
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {
|
|
24
|
+
Configuration,
|
|
25
|
+
SensitiveDataProtectionApi,
|
|
26
|
+
} from '@quba/sensitive-data-protection';
|
|
27
|
+
import type { HealthCheckRequest } from '@quba/sensitive-data-protection';
|
|
28
|
+
|
|
29
|
+
async function example() {
|
|
30
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
31
|
+
const api = new SensitiveDataProtectionApi();
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const data = await api.healthCheck();
|
|
35
|
+
console.log(data);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Run the test
|
|
42
|
+
example().catch(console.error);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Parameters
|
|
46
|
+
|
|
47
|
+
This endpoint does not need any parameter.
|
|
48
|
+
|
|
49
|
+
### Return type
|
|
50
|
+
|
|
51
|
+
**string**
|
|
52
|
+
|
|
53
|
+
### Authorization
|
|
54
|
+
|
|
55
|
+
No authorization required
|
|
56
|
+
|
|
57
|
+
### HTTP request headers
|
|
58
|
+
|
|
59
|
+
- **Content-Type**: Not defined
|
|
60
|
+
- **Accept**: `application/json`
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### HTTP response details
|
|
64
|
+
| Status code | Description | Response headers |
|
|
65
|
+
|-------------|-------------|------------------|
|
|
66
|
+
| **200** | Successful Response | - |
|
|
67
|
+
|
|
68
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## scanText
|
|
72
|
+
|
|
73
|
+
> ScanResponseBody scanText(ScanRequestBody)
|
|
74
|
+
|
|
75
|
+
Scan Text
|
|
76
|
+
|
|
77
|
+
Scan the provided text for sensitive data.
|
|
78
|
+
|
|
79
|
+
### Example
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import {
|
|
83
|
+
Configuration,
|
|
84
|
+
SensitiveDataProtectionApi,
|
|
85
|
+
} from '@quba/sensitive-data-protection';
|
|
86
|
+
import type { ScanTextRequest } from '@quba/sensitive-data-protection';
|
|
87
|
+
|
|
88
|
+
async function example() {
|
|
89
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
90
|
+
const api = new SensitiveDataProtectionApi();
|
|
91
|
+
|
|
92
|
+
const body = {
|
|
93
|
+
// ScanRequestBody
|
|
94
|
+
ScanRequestBody: ...,
|
|
95
|
+
} satisfies ScanTextRequest;
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const data = await api.scanText(body);
|
|
99
|
+
console.log(data);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Run the test
|
|
106
|
+
example().catch(console.error);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Parameters
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
| Name | Type | Description | Notes |
|
|
113
|
+
|------------- | ------------- | ------------- | -------------|
|
|
114
|
+
| **ScanRequestBody** | [ScanRequestBody](ScanRequestBody.md) | | |
|
|
115
|
+
|
|
116
|
+
### Return type
|
|
117
|
+
|
|
118
|
+
[**ScanResponseBody**](ScanResponseBody.md)
|
|
119
|
+
|
|
120
|
+
### Authorization
|
|
121
|
+
|
|
122
|
+
No authorization required
|
|
123
|
+
|
|
124
|
+
### HTTP request headers
|
|
125
|
+
|
|
126
|
+
- **Content-Type**: `application/json`
|
|
127
|
+
- **Accept**: `application/json`
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### HTTP response details
|
|
131
|
+
| Status code | Description | Response headers |
|
|
132
|
+
|-------------|-------------|------------------|
|
|
133
|
+
| **200** | Successful Response | - |
|
|
134
|
+
| **422** | Validation Error | - |
|
|
135
|
+
|
|
136
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
137
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ValidationError
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`loc` | [Array<ValidationErrorLocInner>](ValidationErrorLocInner.md)
|
|
10
|
+
`msg` | string
|
|
11
|
+
`type` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ValidationError } from '@quba/sensitive-data-protection'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"loc": null,
|
|
21
|
+
"msg": null,
|
|
22
|
+
"type": null,
|
|
23
|
+
} satisfies ValidationError
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ValidationError
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
# ValidationErrorLocInner
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import type { ValidationErrorLocInner } from '@quba/sensitive-data-protection'
|
|
14
|
+
|
|
15
|
+
// TODO: Update the object below with actual values
|
|
16
|
+
const example = {
|
|
17
|
+
} satisfies ValidationErrorLocInner
|
|
18
|
+
|
|
19
|
+
console.log(example)
|
|
20
|
+
|
|
21
|
+
// Convert the instance to a JSON string
|
|
22
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
23
|
+
console.log(exampleJSON)
|
|
24
|
+
|
|
25
|
+
// Parse the JSON string back to an object
|
|
26
|
+
const exampleParsed = JSON.parse(exampleJSON) as ValidationErrorLocInner
|
|
27
|
+
console.log(exampleParsed)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
31
|
+
|
|
32
|
+
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://quba.ae",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.2",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"sensitive data protection",
|
|
10
10
|
"sdp",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"
|
|
24
|
+
"docs",
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"exports": {
|