@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.
@@ -0,0 +1,46 @@
1
+
2
+ # PolicyDocumentRulesInner
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `type` | string
10
+ `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
+ `replacement` | string
12
+ `masking_char` | string
13
+ `chars_to_mask` | number
14
+ `from_end` | boolean
15
+ `key` | string
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { PolicyDocumentRulesInner } from '@quba/sensitive-data-protection'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "type": null,
25
+ "entities": null,
26
+ "replacement": null,
27
+ "masking_char": null,
28
+ "chars_to_mask": null,
29
+ "from_end": null,
30
+ "key": null,
31
+ } satisfies PolicyDocumentRulesInner
32
+
33
+ console.log(example)
34
+
35
+ // Convert the instance to a JSON string
36
+ const exampleJSON: string = JSON.stringify(example)
37
+ console.log(exampleJSON)
38
+
39
+ // Parse the JSON string back to an object
40
+ const exampleParsed = JSON.parse(exampleJSON) as PolicyDocumentRulesInner
41
+ console.log(exampleParsed)
42
+ ```
43
+
44
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
45
+
46
+
@@ -0,0 +1,42 @@
1
+
2
+ # PolicySummary
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `name` | string
11
+ `versionId` | string
12
+ `createdAt` | number
13
+ `updatedAt` | number
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { PolicySummary } from '@quba/sensitive-data-protection'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "id": null,
23
+ "name": null,
24
+ "versionId": null,
25
+ "createdAt": null,
26
+ "updatedAt": null,
27
+ } satisfies PolicySummary
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as PolicySummary
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
41
+
42
+
@@ -1,13 +1,14 @@
1
1
 
2
2
  # RedactRule
3
3
 
4
+ Remove each matched value entirely (replace with an empty string).
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `type` | string
10
- `entities` | [Entities](Entities.md)
11
+ `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
12
 
12
13
  ## Example
13
14
 
@@ -1,6 +1,7 @@
1
1
 
2
2
  # RegexEntity
3
3
 
4
+ A regex pattern to target, e.g. a custom ID or date format.
4
5
 
5
6
  ## Properties
6
7
 
@@ -1,13 +1,14 @@
1
1
 
2
2
  # ReplaceRule
3
3
 
4
+ Replace each matched value with a fixed string (default \'****\').
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `type` | string
10
- `entities` | [Entities](Entities.md)
11
+ `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
12
  `replacement` | string
12
13
 
13
14
  ## Example
@@ -1,13 +1,14 @@
1
1
 
2
2
  # SHA256Rule
3
3
 
4
+ Replace each matched value with its SHA-256 hex digest.
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `type` | string
10
- `entities` | [Entities](Entities.md)
11
+ `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
12
 
12
13
  ## Example
13
14
 
@@ -1,13 +1,14 @@
1
1
 
2
2
  # SHA512Rule
3
3
 
4
+ Replace each matched value with its SHA-512 hex digest.
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `type` | string
10
- `entities` | [Entities](Entities.md)
11
+ `entities` | [Array<DetectRuleEntitiesInner>](DetectRuleEntitiesInner.md)
11
12
 
12
13
  ## Example
13
14
 
@@ -1,6 +1,7 @@
1
1
 
2
2
  # ScanRequestBody
3
3
 
4
+ Request body for the scan endpoint: the text to inspect and which entity types to detect.
4
5
 
5
6
  ## Properties
6
7
 
@@ -1,12 +1,14 @@
1
1
 
2
2
  # ScanResponseBody
3
3
 
4
+ Response from the scan endpoint: the sensitive-data entities detected in the text.
4
5
 
5
6
  ## Properties
6
7
 
7
8
  Name | Type
8
9
  ------------ | -------------
9
10
  `results` | [Array<ScanResult>](ScanResult.md)
11
+ `usage` | [Usage](Usage.md)
10
12
 
11
13
  ## Example
12
14
 
@@ -16,6 +18,7 @@ import type { ScanResponseBody } from '@quba/sensitive-data-protection'
16
18
  // TODO: Update the object below with actual values
17
19
  const example = {
18
20
  "results": null,
21
+ "usage": null,
19
22
  } satisfies ScanResponseBody
20
23
 
21
24
  console.log(example)
@@ -1,6 +1,7 @@
1
1
 
2
2
  # ScanResult
3
3
 
4
+ A single sensitive-data entity detected in scanned text.
4
5
 
5
6
  ## Properties
6
7
 
@@ -1,6 +1,6 @@
1
1
  # SensitiveDataProtectionApi
2
2
 
3
- All URIs are relative to *https://app.quba.ae/api/sdp*
3
+ All URIs are relative to *https://www.quba.co/api/sdp*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
@@ -16,7 +16,7 @@ All URIs are relative to *https://app.quba.ae/api/sdp*
16
16
 
17
17
  Anonymize Text
18
18
 
19
- Anonymize the provided text.
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.
20
20
 
21
21
  ### Example
22
22
 
@@ -29,7 +29,11 @@ import type { AnonymizeTextRequest } from '@quba/sensitive-data-protection';
29
29
 
30
30
  async function example() {
31
31
  console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
32
- const api = new SensitiveDataProtectionApi();
32
+ const config = new Configuration({
33
+ // To configure API key authorization: ApiKeyAuth
34
+ apiKey: "YOUR API KEY",
35
+ });
36
+ const api = new SensitiveDataProtectionApi(config);
33
37
 
34
38
  const body = {
35
39
  // AnonymizeRequestBody
@@ -61,7 +65,7 @@ example().catch(console.error);
61
65
 
62
66
  ### Authorization
63
67
 
64
- No authorization required
68
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
65
69
 
66
70
  ### HTTP request headers
67
71
 
@@ -73,6 +77,7 @@ No authorization required
73
77
  | Status code | Description | Response headers |
74
78
  |-------------|-------------|------------------|
75
79
  | **200** | Successful Response | - |
80
+ | **404** | No such policy in the calling organization. | - |
76
81
  | **422** | Validation Error | - |
77
82
 
78
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,7 +89,7 @@ No authorization required
84
89
 
85
90
  Health
86
91
 
87
- Return basic health probe result.
92
+ Health check. Returns a plain-text message confirming the service is running. Use this as a liveness/readiness probe.
88
93
 
89
94
  ### Example
90
95
 
@@ -97,7 +102,11 @@ import type { HealthCheckRequest } from '@quba/sensitive-data-protection';
97
102
 
98
103
  async function example() {
99
104
  console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
100
- const api = new SensitiveDataProtectionApi();
105
+ const config = new Configuration({
106
+ // To configure API key authorization: ApiKeyAuth
107
+ apiKey: "YOUR API KEY",
108
+ });
109
+ const api = new SensitiveDataProtectionApi(config);
101
110
 
102
111
  try {
103
112
  const data = await api.healthCheck();
@@ -121,7 +130,7 @@ This endpoint does not need any parameter.
121
130
 
122
131
  ### Authorization
123
132
 
124
- No authorization required
133
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
125
134
 
126
135
  ### HTTP request headers
127
136
 
@@ -143,7 +152,7 @@ No authorization required
143
152
 
144
153
  Scan Text
145
154
 
146
- Scan the provided text for sensitive data.
155
+ Scan text for sensitive data. Runs the configured detection entities over the request text and returns every match as a character range with its entity type and confidence score. Detections below the confidence threshold are omitted.
147
156
 
148
157
  ### Example
149
158
 
@@ -156,7 +165,11 @@ import type { ScanTextRequest } from '@quba/sensitive-data-protection';
156
165
 
157
166
  async function example() {
158
167
  console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
159
- const api = new SensitiveDataProtectionApi();
168
+ const config = new Configuration({
169
+ // To configure API key authorization: ApiKeyAuth
170
+ apiKey: "YOUR API KEY",
171
+ });
172
+ const api = new SensitiveDataProtectionApi(config);
160
173
 
161
174
  const body = {
162
175
  // ScanRequestBody
@@ -188,7 +201,7 @@ example().catch(console.error);
188
201
 
189
202
  ### Authorization
190
203
 
191
- No authorization required
204
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
192
205
 
193
206
  ### HTTP request headers
194
207
 
@@ -0,0 +1,36 @@
1
+
2
+ # UpdatePolicyRequest
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 { UpdatePolicyRequest } 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 UpdatePolicyRequest
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 UpdatePolicyRequest
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/Usage.md ADDED
@@ -0,0 +1,37 @@
1
+
2
+ # Usage
3
+
4
+ What one request cost, the unit billing meters against. Only the text the model scanned is counted. Anonymized output is built from the input by substitution, not generated, so counting it would charge twice for the same text. Counted with the detection model\'s own tokenizer, excluding special tokens, so the same text always costs the same for a given model.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `input_tokens` | number
11
+ `inference_ms` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { Usage } from '@quba/sensitive-data-protection'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "input_tokens": null,
21
+ "inference_ms": null,
22
+ } satisfies Usage
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 Usage
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
+
@@ -9,6 +9,8 @@ Name | Type
9
9
  `loc` | [Array<ValidationErrorLocInner>](ValidationErrorLocInner.md)
10
10
  `msg` | string
11
11
  `type` | string
12
+ `input` | any
13
+ `ctx` | object
12
14
 
13
15
  ## Example
14
16
 
@@ -20,6 +22,8 @@ const example = {
20
22
  "loc": null,
21
23
  "msg": null,
22
24
  "type": null,
25
+ "input": null,
26
+ "ctx": null,
23
27
  } satisfies ValidationError
24
28
 
25
29
  console.log(example)
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "description": "SDK for Sensitive Data Protection Service",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "homepage": "https://quba.ae",
8
- "version": "0.0.8",
7
+ "homepage": "https://www.quba.co",
8
+ "version": "0.0.11",
9
9
  "keywords": [
10
10
  "sensitive data protection",
11
11
  "sdp",
@@ -27,7 +27,8 @@
27
27
  "README.md"
28
28
  ],
29
29
  "scripts": {
30
- "build": "tsdown"
30
+ "build": "tsdown",
31
+ "prepare": "tsdown"
31
32
  },
32
33
  "packageManager": "pnpm@10.26.2",
33
34
  "devDependencies": {