@quba/sensitive-data-protection 0.0.2 → 0.0.4

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,36 @@
1
+
2
+ # AnonymizeResponseBody
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `text` | string
10
+ `map` | { [key: string]: Array<MapValueInner>; }
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { AnonymizeResponseBody } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "text": null,
20
+ "map": null,
21
+ } satisfies AnonymizeResponseBody
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 AnonymizeResponseBody
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,38 @@
1
+
2
+ # EncryptTransformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+ `key` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { EncryptTransformation } from '@quba/sensitive-data-protection'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "id": null,
21
+ "targets": null,
22
+ "key": null,
23
+ } satisfies EncryptTransformation
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 EncryptTransformation
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,45 @@
1
+
2
+ # EntitySpanResult
3
+
4
+ A detected entity span.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `target` | string
11
+ `start` | number
12
+ `end` | number
13
+ `entity_type` | string
14
+ `text` | string
15
+ `score` | number
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { EntitySpanResult } from '@quba/sensitive-data-protection'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "target": null,
25
+ "start": null,
26
+ "end": null,
27
+ "entity_type": null,
28
+ "text": null,
29
+ "score": null,
30
+ } satisfies EntitySpanResult
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 EntitySpanResult
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
+
@@ -0,0 +1,36 @@
1
+
2
+ # EntityTarget
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `entity_type` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { EntityTarget } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "entity_type": null,
21
+ } satisfies EntityTarget
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 EntityTarget
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,46 @@
1
+
2
+ # MapValueInner
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `target` | string
10
+ `start` | number
11
+ `end` | number
12
+ `entity_type` | string
13
+ `text` | string
14
+ `score` | number
15
+ `pattern` | string
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { MapValueInner } from '@quba/sensitive-data-protection'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "target": null,
25
+ "start": null,
26
+ "end": null,
27
+ "entity_type": null,
28
+ "text": null,
29
+ "score": null,
30
+ "pattern": null,
31
+ } satisfies MapValueInner
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 MapValueInner
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
+ # MaskTransformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+ `masking_char` | string
12
+ `chars_to_mask` | number
13
+ `from_end` | boolean
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { MaskTransformation } from '@quba/sensitive-data-protection'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "id": null,
23
+ "targets": null,
24
+ "masking_char": null,
25
+ "chars_to_mask": null,
26
+ "from_end": null,
27
+ } satisfies MaskTransformation
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 MaskTransformation
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
+
@@ -0,0 +1,36 @@
1
+
2
+ # RedactTransformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { RedactTransformation } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "targets": null,
21
+ } satisfies RedactTransformation
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 RedactTransformation
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,43 @@
1
+
2
+ # RegexSpanResult
3
+
4
+ A detected regex span.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `target` | string
11
+ `start` | number
12
+ `end` | number
13
+ `pattern` | string
14
+ `text` | string
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { RegexSpanResult } from '@quba/sensitive-data-protection'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "target": null,
24
+ "start": null,
25
+ "end": null,
26
+ "pattern": null,
27
+ "text": null,
28
+ } satisfies RegexSpanResult
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 RegexSpanResult
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
+
@@ -0,0 +1,36 @@
1
+
2
+ # RegexTarget
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `pattern` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { RegexTarget } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "pattern": null,
21
+ } satisfies RegexTarget
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 RegexTarget
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,38 @@
1
+
2
+ # ReplaceTransformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+ `replacement` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { ReplaceTransformation } from '@quba/sensitive-data-protection'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "id": null,
21
+ "targets": null,
22
+ "replacement": null,
23
+ } satisfies ReplaceTransformation
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 ReplaceTransformation
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,36 @@
1
+
2
+ # SHA256Transformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { SHA256Transformation } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "targets": null,
21
+ } satisfies SHA256Transformation
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 SHA256Transformation
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,36 @@
1
+
2
+ # SHA512Transformation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `targets` | [Targets](Targets.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { SHA512Transformation } from '@quba/sensitive-data-protection'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "targets": null,
21
+ } satisfies SHA512Transformation
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 SHA512Transformation
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
+
@@ -4,11 +4,80 @@ All URIs are relative to *https://app.quba.ae/api/sdp*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**anonymizeText**](SensitiveDataProtectionApi.md#anonymizetext) | **POST** /anonymize | Anonymize Text |
7
8
  | [**healthCheck**](SensitiveDataProtectionApi.md#healthcheck) | **GET** /health | Health |
8
9
  | [**scanText**](SensitiveDataProtectionApi.md#scantext) | **POST** /scan | Scan Text |
9
10
 
10
11
 
11
12
 
13
+ ## anonymizeText
14
+
15
+ > AnonymizeResponseBody anonymizeText(AnonymizeRequestBody)
16
+
17
+ Anonymize Text
18
+
19
+ Anonymize the provided text.
20
+
21
+ ### Example
22
+
23
+ ```ts
24
+ import {
25
+ Configuration,
26
+ SensitiveDataProtectionApi,
27
+ } from '@quba/sensitive-data-protection';
28
+ import type { AnonymizeTextRequest } from '@quba/sensitive-data-protection';
29
+
30
+ async function example() {
31
+ console.log("🚀 Testing @quba/sensitive-data-protection SDK...");
32
+ const api = new SensitiveDataProtectionApi();
33
+
34
+ const body = {
35
+ // AnonymizeRequestBody
36
+ AnonymizeRequestBody: ...,
37
+ } satisfies AnonymizeTextRequest;
38
+
39
+ try {
40
+ const data = await api.anonymizeText(body);
41
+ console.log(data);
42
+ } catch (error) {
43
+ console.error(error);
44
+ }
45
+ }
46
+
47
+ // Run the test
48
+ example().catch(console.error);
49
+ ```
50
+
51
+ ### Parameters
52
+
53
+
54
+ | Name | Type | Description | Notes |
55
+ |------------- | ------------- | ------------- | -------------|
56
+ | **AnonymizeRequestBody** | [AnonymizeRequestBody](AnonymizeRequestBody.md) | | |
57
+
58
+ ### Return type
59
+
60
+ [**AnonymizeResponseBody**](AnonymizeResponseBody.md)
61
+
62
+ ### Authorization
63
+
64
+ No authorization required
65
+
66
+ ### HTTP request headers
67
+
68
+ - **Content-Type**: `application/json`
69
+ - **Accept**: `application/json`
70
+
71
+
72
+ ### HTTP response details
73
+ | Status code | Description | Response headers |
74
+ |-------------|-------------|------------------|
75
+ | **200** | Successful Response | - |
76
+ | **422** | Validation Error | - |
77
+
78
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
79
+
80
+
12
81
  ## healthCheck
13
82
 
14
83
  > string healthCheck()
@@ -0,0 +1,32 @@
1
+
2
+ # Targets
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import type { Targets } from '@quba/sensitive-data-protection'
14
+
15
+ // TODO: Update the object below with actual values
16
+ const example = {
17
+ } satisfies Targets
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 Targets
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
+
@@ -0,0 +1,38 @@
1
+
2
+ # TargetsAnyOfInner
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `entity_type` | string
11
+ `pattern` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { TargetsAnyOfInner } from '@quba/sensitive-data-protection'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "id": null,
21
+ "entity_type": null,
22
+ "pattern": null,
23
+ } satisfies TargetsAnyOfInner
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 TargetsAnyOfInner
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
+
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.2",
7
+ "version": "0.0.4",
8
8
  "keywords": [
9
9
  "sensitive data protection",
10
10
  "sdp",
@@ -17,19 +17,14 @@
17
17
  "personal data"
18
18
  ],
19
19
  "author": "Quba Ltd",
20
- "main": "./dist/index.js",
21
- "types": "./dist/index.d.ts",
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.mjs",
22
+ "types": "./dist/index.d.mts",
22
23
  "files": [
23
24
  "dist",
24
25
  "docs",
25
26
  "README.md"
26
27
  ],
27
- "exports": {
28
- ".": {
29
- "import": "./dist/index.js",
30
- "types": "./dist/index.d.ts"
31
- }
32
- },
33
28
  "scripts": {
34
29
  "build": "tsdown"
35
30
  },