@quba/sensitive-data-protection 0.0.8 → 0.0.11
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 +90 -12
- package/dist/index.cjs +891 -323
- package/dist/index.d.cts +1024 -422
- package/dist/index.d.mts +1024 -422
- package/dist/index.mjs +833 -315
- package/docs/AnonymizeRequestBody.md +3 -0
- package/docs/AnonymizeRequestBodyRulesInner.md +1 -1
- package/docs/AnonymizeResponseBody.md +3 -0
- package/docs/CreatePolicyRequest.md +36 -0
- package/docs/DetectRule.md +37 -0
- package/docs/DetectRuleEntitiesInner.md +36 -0
- package/docs/EncryptRule.md +2 -1
- package/docs/ListPolicies200Response.md +34 -0
- package/docs/MaskRule.md +2 -1
- package/docs/ModelEntity.md +1 -0
- package/docs/PoliciesApi.md +360 -0
- package/docs/Policy.md +44 -0
- package/docs/PolicyDocument.md +41 -0
- package/docs/PolicyDocumentRulesInner.md +46 -0
- package/docs/PolicySummary.md +42 -0
- package/docs/RedactRule.md +2 -1
- package/docs/RegexEntity.md +1 -0
- package/docs/ReplaceRule.md +2 -1
- package/docs/SHA256Rule.md +2 -1
- package/docs/SHA512Rule.md +2 -1
- package/docs/ScanRequestBody.md +1 -0
- package/docs/ScanResponseBody.md +3 -0
- package/docs/ScanResult.md +1 -0
- package/docs/SensitiveDataProtectionApi.md +23 -10
- package/docs/UpdatePolicyRequest.md +36 -0
- package/docs/Usage.md +37 -0
- package/docs/ValidationError.md +4 -0
- package/package.json +4 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# AnonymizeRequestBody
|
|
3
3
|
|
|
4
|
+
Request body for the anonymize endpoint. Carries the text to anonymize and the list of de-identification rules to apply. See ``AnonymizationCommand`` for field-level details.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
@@ -9,6 +10,7 @@ Name | Type
|
|
|
9
10
|
`text` | string
|
|
10
11
|
`rules` | [Array<AnonymizeRequestBodyRulesInner>](AnonymizeRequestBodyRulesInner.md)
|
|
11
12
|
`confidence_threshold` | number
|
|
13
|
+
`policy` | string
|
|
12
14
|
|
|
13
15
|
## Example
|
|
14
16
|
|
|
@@ -20,6 +22,7 @@ const example = {
|
|
|
20
22
|
"text": null,
|
|
21
23
|
"rules": null,
|
|
22
24
|
"confidence_threshold": null,
|
|
25
|
+
"policy": null,
|
|
23
26
|
} satisfies AnonymizeRequestBody
|
|
24
27
|
|
|
25
28
|
console.log(example)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# AnonymizeResponseBody
|
|
3
3
|
|
|
4
|
+
Response from the anonymize endpoint: the anonymized text and a record of every transformation that was applied.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
@@ -8,6 +9,7 @@ Name | Type
|
|
|
8
9
|
------------ | -------------
|
|
9
10
|
`text` | string
|
|
10
11
|
`results` | [Array<AnonymizeResponseBodyResultsInner>](AnonymizeResponseBodyResultsInner.md)
|
|
12
|
+
`usage` | [Usage](Usage.md)
|
|
11
13
|
|
|
12
14
|
## Example
|
|
13
15
|
|
|
@@ -18,6 +20,7 @@ import type { AnonymizeResponseBody } from '@quba/sensitive-data-protection'
|
|
|
18
20
|
const example = {
|
|
19
21
|
"text": null,
|
|
20
22
|
"results": null,
|
|
23
|
+
"usage": null,
|
|
21
24
|
} satisfies AnonymizeResponseBody
|
|
22
25
|
|
|
23
26
|
console.log(example)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# CreatePolicyRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`document` | [PolicyDocument](PolicyDocument.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { CreatePolicyRequest } from '@quba/sensitive-data-protection'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"name": null,
|
|
20
|
+
"document": null,
|
|
21
|
+
} satisfies CreatePolicyRequest
|
|
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 CreatePolicyRequest
|
|
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
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# DetectRule
|
|
3
|
+
|
|
4
|
+
Report each matched value without changing it. The match is recorded in the results like any other rule, but the text is returned untouched — this is how a policy says \"flag this, don\'t rewrite it\", which is what the browser extension needs when it must not edit the user\'s prompt. Because overlapping spans are resolved first-match-wins, placing a detect rule before a transform also shields those spans from being rewritten.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`type` | string
|
|
11
|
+
`entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { DetectRule } from '@quba/sensitive-data-protection'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"type": null,
|
|
21
|
+
"entities": null,
|
|
22
|
+
} satisfies DetectRule
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as DetectRule
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# DetectRuleEntitiesInner
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`type` | string
|
|
10
|
+
`value` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { DetectRuleEntitiesInner } from '@quba/sensitive-data-protection'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"type": null,
|
|
20
|
+
"value": null,
|
|
21
|
+
} satisfies DetectRuleEntitiesInner
|
|
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 DetectRuleEntitiesInner
|
|
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
|
+
|
package/docs/EncryptRule.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
# EncryptRule
|
|
3
3
|
|
|
4
|
+
Replace each matched value with a Fernet-encrypted token. If no key is supplied, a new Fernet key is generated per rule instance.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
7
8
|
Name | Type
|
|
8
9
|
------------ | -------------
|
|
9
10
|
`type` | string
|
|
10
|
-
`entities` | [
|
|
11
|
+
`entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
|
|
11
12
|
`key` | string
|
|
12
13
|
|
|
13
14
|
## Example
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ListPolicies200Response
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`policies` | [Array<PolicySummary>](PolicySummary.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ListPolicies200Response } from '@quba/sensitive-data-protection'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"policies": null,
|
|
19
|
+
} satisfies ListPolicies200Response
|
|
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 ListPolicies200Response
|
|
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
|
+
|
package/docs/MaskRule.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
# MaskRule
|
|
3
3
|
|
|
4
|
+
Mask part of each matched value with a repeated character. By default the whole value is masked; set ``chars_to_mask`` to mask only a portion, and ``from_end`` to mask the trailing characters instead of leading.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
7
8
|
Name | Type
|
|
8
9
|
------------ | -------------
|
|
9
10
|
`type` | string
|
|
10
|
-
`entities` | [
|
|
11
|
+
`entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
|
|
11
12
|
`masking_char` | string
|
|
12
13
|
`chars_to_mask` | number
|
|
13
14
|
`from_end` | boolean
|
package/docs/ModelEntity.md
CHANGED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# PoliciesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://www.quba.co/api/sdp*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createPolicy**](PoliciesApi.md#createpolicyoperation) | **POST** /policies | Create a policy |
|
|
8
|
+
| [**deletePolicy**](PoliciesApi.md#deletepolicy) | **DELETE** /policies/{id} | Delete a policy |
|
|
9
|
+
| [**getPolicy**](PoliciesApi.md#getpolicy) | **GET** /policies/{id} | Read a policy |
|
|
10
|
+
| [**listPolicies**](PoliciesApi.md#listpolicies) | **GET** /policies | List policies |
|
|
11
|
+
| [**updatePolicy**](PoliciesApi.md#updatepolicyoperation) | **PUT** /policies/{id} | Update a policy |
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## createPolicy
|
|
16
|
+
|
|
17
|
+
> Policy createPolicy(CreatePolicyRequest)
|
|
18
|
+
|
|
19
|
+
Create a policy
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
Configuration,
|
|
26
|
+
PoliciesApi,
|
|
27
|
+
} from '@quba/sensitive-data-protection';
|
|
28
|
+
import type { CreatePolicyOperationRequest } from '@quba/sensitive-data-protection';
|
|
29
|
+
|
|
30
|
+
async function example() {
|
|
31
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
32
|
+
const config = new Configuration({
|
|
33
|
+
// To configure API key authorization: ApiKeyAuth
|
|
34
|
+
apiKey: "YOUR API KEY",
|
|
35
|
+
});
|
|
36
|
+
const api = new PoliciesApi(config);
|
|
37
|
+
|
|
38
|
+
const body = {
|
|
39
|
+
// CreatePolicyRequest
|
|
40
|
+
CreatePolicyRequest: ...,
|
|
41
|
+
} satisfies CreatePolicyOperationRequest;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const data = await api.createPolicy(body);
|
|
45
|
+
console.log(data);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Run the test
|
|
52
|
+
example().catch(console.error);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Parameters
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description | Notes |
|
|
59
|
+
|------------- | ------------- | ------------- | -------------|
|
|
60
|
+
| **CreatePolicyRequest** | [CreatePolicyRequest](CreatePolicyRequest.md) | | |
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
[**Policy**](Policy.md)
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: `application/json`
|
|
73
|
+
- **Accept**: `application/json`
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### HTTP response details
|
|
77
|
+
| Status code | Description | Response headers |
|
|
78
|
+
|-------------|-------------|------------------|
|
|
79
|
+
| **201** | The created policy. | - |
|
|
80
|
+
| **409** | A policy with that name already exists. | - |
|
|
81
|
+
| **422** | The document failed validation. | - |
|
|
82
|
+
|
|
83
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## deletePolicy
|
|
87
|
+
|
|
88
|
+
> deletePolicy(id)
|
|
89
|
+
|
|
90
|
+
Delete a policy
|
|
91
|
+
|
|
92
|
+
### Example
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import {
|
|
96
|
+
Configuration,
|
|
97
|
+
PoliciesApi,
|
|
98
|
+
} from '@quba/sensitive-data-protection';
|
|
99
|
+
import type { DeletePolicyRequest } from '@quba/sensitive-data-protection';
|
|
100
|
+
|
|
101
|
+
async function example() {
|
|
102
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
103
|
+
const config = new Configuration({
|
|
104
|
+
// To configure API key authorization: ApiKeyAuth
|
|
105
|
+
apiKey: "YOUR API KEY",
|
|
106
|
+
});
|
|
107
|
+
const api = new PoliciesApi(config);
|
|
108
|
+
|
|
109
|
+
const body = {
|
|
110
|
+
// string
|
|
111
|
+
id: id_example,
|
|
112
|
+
} satisfies DeletePolicyRequest;
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
const data = await api.deletePolicy(body);
|
|
116
|
+
console.log(data);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error(error);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Run the test
|
|
123
|
+
example().catch(console.error);
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Parameters
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
| Name | Type | Description | Notes |
|
|
130
|
+
|------------- | ------------- | ------------- | -------------|
|
|
131
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
132
|
+
|
|
133
|
+
### Return type
|
|
134
|
+
|
|
135
|
+
`void` (Empty response body)
|
|
136
|
+
|
|
137
|
+
### Authorization
|
|
138
|
+
|
|
139
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
140
|
+
|
|
141
|
+
### HTTP request headers
|
|
142
|
+
|
|
143
|
+
- **Content-Type**: Not defined
|
|
144
|
+
- **Accept**: Not defined
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### HTTP response details
|
|
148
|
+
| Status code | Description | Response headers |
|
|
149
|
+
|-------------|-------------|------------------|
|
|
150
|
+
| **204** | Deleted. | - |
|
|
151
|
+
| **404** | No such policy in this organization. | - |
|
|
152
|
+
|
|
153
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
## getPolicy
|
|
157
|
+
|
|
158
|
+
> Policy getPolicy(id)
|
|
159
|
+
|
|
160
|
+
Read a policy
|
|
161
|
+
|
|
162
|
+
### Example
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
import {
|
|
166
|
+
Configuration,
|
|
167
|
+
PoliciesApi,
|
|
168
|
+
} from '@quba/sensitive-data-protection';
|
|
169
|
+
import type { GetPolicyRequest } from '@quba/sensitive-data-protection';
|
|
170
|
+
|
|
171
|
+
async function example() {
|
|
172
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
173
|
+
const config = new Configuration({
|
|
174
|
+
// To configure API key authorization: ApiKeyAuth
|
|
175
|
+
apiKey: "YOUR API KEY",
|
|
176
|
+
});
|
|
177
|
+
const api = new PoliciesApi(config);
|
|
178
|
+
|
|
179
|
+
const body = {
|
|
180
|
+
// string
|
|
181
|
+
id: id_example,
|
|
182
|
+
} satisfies GetPolicyRequest;
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const data = await api.getPolicy(body);
|
|
186
|
+
console.log(data);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error(error);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Run the test
|
|
193
|
+
example().catch(console.error);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Parameters
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
| Name | Type | Description | Notes |
|
|
200
|
+
|------------- | ------------- | ------------- | -------------|
|
|
201
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
202
|
+
|
|
203
|
+
### Return type
|
|
204
|
+
|
|
205
|
+
[**Policy**](Policy.md)
|
|
206
|
+
|
|
207
|
+
### Authorization
|
|
208
|
+
|
|
209
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
210
|
+
|
|
211
|
+
### HTTP request headers
|
|
212
|
+
|
|
213
|
+
- **Content-Type**: Not defined
|
|
214
|
+
- **Accept**: `application/json`
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### HTTP response details
|
|
218
|
+
| Status code | Description | Response headers |
|
|
219
|
+
|-------------|-------------|------------------|
|
|
220
|
+
| **200** | The policy and its latest document. | - |
|
|
221
|
+
| **404** | No such policy in this organization. | - |
|
|
222
|
+
|
|
223
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## listPolicies
|
|
227
|
+
|
|
228
|
+
> ListPolicies200Response listPolicies()
|
|
229
|
+
|
|
230
|
+
List policies
|
|
231
|
+
|
|
232
|
+
### Example
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
import {
|
|
236
|
+
Configuration,
|
|
237
|
+
PoliciesApi,
|
|
238
|
+
} from '@quba/sensitive-data-protection';
|
|
239
|
+
import type { ListPoliciesRequest } from '@quba/sensitive-data-protection';
|
|
240
|
+
|
|
241
|
+
async function example() {
|
|
242
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
243
|
+
const config = new Configuration({
|
|
244
|
+
// To configure API key authorization: ApiKeyAuth
|
|
245
|
+
apiKey: "YOUR API KEY",
|
|
246
|
+
});
|
|
247
|
+
const api = new PoliciesApi(config);
|
|
248
|
+
|
|
249
|
+
try {
|
|
250
|
+
const data = await api.listPolicies();
|
|
251
|
+
console.log(data);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
console.error(error);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Run the test
|
|
258
|
+
example().catch(console.error);
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Parameters
|
|
262
|
+
|
|
263
|
+
This endpoint does not need any parameter.
|
|
264
|
+
|
|
265
|
+
### Return type
|
|
266
|
+
|
|
267
|
+
[**ListPolicies200Response**](ListPolicies200Response.md)
|
|
268
|
+
|
|
269
|
+
### Authorization
|
|
270
|
+
|
|
271
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
272
|
+
|
|
273
|
+
### HTTP request headers
|
|
274
|
+
|
|
275
|
+
- **Content-Type**: Not defined
|
|
276
|
+
- **Accept**: `application/json`
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
### HTTP response details
|
|
280
|
+
| Status code | Description | Response headers |
|
|
281
|
+
|-------------|-------------|------------------|
|
|
282
|
+
| **200** | The calling organization\'s policies. | - |
|
|
283
|
+
|
|
284
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
## updatePolicy
|
|
288
|
+
|
|
289
|
+
> Policy updatePolicy(id, UpdatePolicyRequest)
|
|
290
|
+
|
|
291
|
+
Update a policy
|
|
292
|
+
|
|
293
|
+
### Example
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
import {
|
|
297
|
+
Configuration,
|
|
298
|
+
PoliciesApi,
|
|
299
|
+
} from '@quba/sensitive-data-protection';
|
|
300
|
+
import type { UpdatePolicyOperationRequest } from '@quba/sensitive-data-protection';
|
|
301
|
+
|
|
302
|
+
async function example() {
|
|
303
|
+
console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
|
|
304
|
+
const config = new Configuration({
|
|
305
|
+
// To configure API key authorization: ApiKeyAuth
|
|
306
|
+
apiKey: "YOUR API KEY",
|
|
307
|
+
});
|
|
308
|
+
const api = new PoliciesApi(config);
|
|
309
|
+
|
|
310
|
+
const body = {
|
|
311
|
+
// string
|
|
312
|
+
id: id_example,
|
|
313
|
+
// UpdatePolicyRequest
|
|
314
|
+
UpdatePolicyRequest: ...,
|
|
315
|
+
} satisfies UpdatePolicyOperationRequest;
|
|
316
|
+
|
|
317
|
+
try {
|
|
318
|
+
const data = await api.updatePolicy(body);
|
|
319
|
+
console.log(data);
|
|
320
|
+
} catch (error) {
|
|
321
|
+
console.error(error);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Run the test
|
|
326
|
+
example().catch(console.error);
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Parameters
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
| Name | Type | Description | Notes |
|
|
333
|
+
|------------- | ------------- | ------------- | -------------|
|
|
334
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
335
|
+
| **UpdatePolicyRequest** | [UpdatePolicyRequest](UpdatePolicyRequest.md) | | |
|
|
336
|
+
|
|
337
|
+
### Return type
|
|
338
|
+
|
|
339
|
+
[**Policy**](Policy.md)
|
|
340
|
+
|
|
341
|
+
### Authorization
|
|
342
|
+
|
|
343
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
|
344
|
+
|
|
345
|
+
### HTTP request headers
|
|
346
|
+
|
|
347
|
+
- **Content-Type**: `application/json`
|
|
348
|
+
- **Accept**: `application/json`
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
### HTTP response details
|
|
352
|
+
| Status code | Description | Response headers |
|
|
353
|
+
|-------------|-------------|------------------|
|
|
354
|
+
| **200** | The updated policy. | - |
|
|
355
|
+
| **404** | No such policy in this organization. | - |
|
|
356
|
+
| **409** | A policy with that name already exists. | - |
|
|
357
|
+
| **422** | The document failed validation. | - |
|
|
358
|
+
|
|
359
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
360
|
+
|
package/docs/Policy.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
# Policy
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`name` | string
|
|
11
|
+
`versionId` | string
|
|
12
|
+
`document` | [PolicyDocument](PolicyDocument.md)
|
|
13
|
+
`createdAt` | number
|
|
14
|
+
`updatedAt` | number
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { Policy } from '@quba/sensitive-data-protection'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"id": null,
|
|
24
|
+
"name": null,
|
|
25
|
+
"versionId": null,
|
|
26
|
+
"document": null,
|
|
27
|
+
"createdAt": null,
|
|
28
|
+
"updatedAt": null,
|
|
29
|
+
} satisfies Policy
|
|
30
|
+
|
|
31
|
+
console.log(example)
|
|
32
|
+
|
|
33
|
+
// Convert the instance to a JSON string
|
|
34
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
35
|
+
console.log(exampleJSON)
|
|
36
|
+
|
|
37
|
+
// Parse the JSON string back to an object
|
|
38
|
+
const exampleParsed = JSON.parse(exampleJSON) as Policy
|
|
39
|
+
console.log(exampleParsed)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# PolicyDocument
|
|
3
|
+
|
|
4
|
+
A reusable set of de-identification rules. Rules are ORDERED: overlapping matches are resolved first-match-wins, so a detect rule placed before a transform shields those spans from being rewritten.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`schema_version` | number
|
|
11
|
+
`name` | string
|
|
12
|
+
`confidence_threshold` | number
|
|
13
|
+
`rules` | [Array<PolicyDocumentRulesInner>](PolicyDocumentRulesInner.md)
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { PolicyDocument } from '@quba/sensitive-data-protection'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"schema_version": null,
|
|
23
|
+
"name": null,
|
|
24
|
+
"confidence_threshold": null,
|
|
25
|
+
"rules": null,
|
|
26
|
+
} satisfies PolicyDocument
|
|
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 PolicyDocument
|
|
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
|
+
|