@azure-rest/health-deidentification 1.0.0-alpha.20250619.1 → 1.0.0-alpha.20250702.3

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.
Files changed (114) hide show
  1. package/README.md +146 -26
  2. package/dist/browser/clientDefinitions.d.ts +6 -6
  3. package/dist/browser/clientDefinitions.d.ts.map +1 -1
  4. package/dist/browser/clientDefinitions.js.map +1 -1
  5. package/dist/browser/deidentificationClient.d.ts.map +1 -1
  6. package/dist/browser/deidentificationClient.js +2 -2
  7. package/dist/browser/deidentificationClient.js.map +1 -1
  8. package/dist/browser/isUnexpected.d.ts +3 -3
  9. package/dist/browser/isUnexpected.d.ts.map +1 -1
  10. package/dist/browser/isUnexpected.js.map +1 -1
  11. package/dist/browser/models.d.ts +45 -28
  12. package/dist/browser/models.d.ts.map +1 -1
  13. package/dist/browser/models.js.map +1 -1
  14. package/dist/browser/outputModels.d.ts +55 -39
  15. package/dist/browser/outputModels.d.ts.map +1 -1
  16. package/dist/browser/outputModels.js.map +1 -1
  17. package/dist/browser/paginateHelper.d.ts +27 -2
  18. package/dist/browser/paginateHelper.d.ts.map +1 -1
  19. package/dist/browser/paginateHelper.js +98 -1
  20. package/dist/browser/paginateHelper.js.map +1 -1
  21. package/dist/browser/parameters.d.ts +14 -7
  22. package/dist/browser/parameters.d.ts.map +1 -1
  23. package/dist/browser/parameters.js.map +1 -1
  24. package/dist/browser/pollingHelper.d.ts +2 -2
  25. package/dist/browser/pollingHelper.d.ts.map +1 -1
  26. package/dist/browser/pollingHelper.js.map +1 -1
  27. package/dist/browser/responses.d.ts +22 -17
  28. package/dist/browser/responses.d.ts.map +1 -1
  29. package/dist/browser/responses.js.map +1 -1
  30. package/dist/commonjs/clientDefinitions.d.ts +6 -6
  31. package/dist/commonjs/clientDefinitions.d.ts.map +1 -1
  32. package/dist/commonjs/clientDefinitions.js.map +1 -1
  33. package/dist/commonjs/deidentificationClient.d.ts.map +1 -1
  34. package/dist/commonjs/deidentificationClient.js +2 -2
  35. package/dist/commonjs/deidentificationClient.js.map +1 -1
  36. package/dist/commonjs/isUnexpected.d.ts +3 -3
  37. package/dist/commonjs/isUnexpected.d.ts.map +1 -1
  38. package/dist/commonjs/isUnexpected.js.map +1 -1
  39. package/dist/commonjs/models.d.ts +45 -28
  40. package/dist/commonjs/models.d.ts.map +1 -1
  41. package/dist/commonjs/models.js.map +1 -1
  42. package/dist/commonjs/outputModels.d.ts +55 -39
  43. package/dist/commonjs/outputModels.d.ts.map +1 -1
  44. package/dist/commonjs/outputModels.js.map +1 -1
  45. package/dist/commonjs/paginateHelper.d.ts +27 -2
  46. package/dist/commonjs/paginateHelper.d.ts.map +1 -1
  47. package/dist/commonjs/paginateHelper.js +99 -2
  48. package/dist/commonjs/paginateHelper.js.map +1 -1
  49. package/dist/commonjs/parameters.d.ts +14 -7
  50. package/dist/commonjs/parameters.d.ts.map +1 -1
  51. package/dist/commonjs/parameters.js.map +1 -1
  52. package/dist/commonjs/pollingHelper.d.ts +2 -2
  53. package/dist/commonjs/pollingHelper.d.ts.map +1 -1
  54. package/dist/commonjs/pollingHelper.js.map +1 -1
  55. package/dist/commonjs/responses.d.ts +22 -17
  56. package/dist/commonjs/responses.d.ts.map +1 -1
  57. package/dist/commonjs/responses.js.map +1 -1
  58. package/dist/esm/clientDefinitions.d.ts +6 -6
  59. package/dist/esm/clientDefinitions.d.ts.map +1 -1
  60. package/dist/esm/clientDefinitions.js.map +1 -1
  61. package/dist/esm/deidentificationClient.d.ts.map +1 -1
  62. package/dist/esm/deidentificationClient.js +2 -2
  63. package/dist/esm/deidentificationClient.js.map +1 -1
  64. package/dist/esm/isUnexpected.d.ts +3 -3
  65. package/dist/esm/isUnexpected.d.ts.map +1 -1
  66. package/dist/esm/isUnexpected.js.map +1 -1
  67. package/dist/esm/models.d.ts +45 -28
  68. package/dist/esm/models.d.ts.map +1 -1
  69. package/dist/esm/models.js.map +1 -1
  70. package/dist/esm/outputModels.d.ts +55 -39
  71. package/dist/esm/outputModels.d.ts.map +1 -1
  72. package/dist/esm/outputModels.js.map +1 -1
  73. package/dist/esm/paginateHelper.d.ts +27 -2
  74. package/dist/esm/paginateHelper.d.ts.map +1 -1
  75. package/dist/esm/paginateHelper.js +98 -1
  76. package/dist/esm/paginateHelper.js.map +1 -1
  77. package/dist/esm/parameters.d.ts +14 -7
  78. package/dist/esm/parameters.d.ts.map +1 -1
  79. package/dist/esm/parameters.js.map +1 -1
  80. package/dist/esm/pollingHelper.d.ts +2 -2
  81. package/dist/esm/pollingHelper.d.ts.map +1 -1
  82. package/dist/esm/pollingHelper.js.map +1 -1
  83. package/dist/esm/responses.d.ts +22 -17
  84. package/dist/esm/responses.d.ts.map +1 -1
  85. package/dist/esm/responses.js.map +1 -1
  86. package/dist/react-native/clientDefinitions.d.ts +6 -6
  87. package/dist/react-native/clientDefinitions.d.ts.map +1 -1
  88. package/dist/react-native/clientDefinitions.js.map +1 -1
  89. package/dist/react-native/deidentificationClient.d.ts.map +1 -1
  90. package/dist/react-native/deidentificationClient.js +2 -2
  91. package/dist/react-native/deidentificationClient.js.map +1 -1
  92. package/dist/react-native/isUnexpected.d.ts +3 -3
  93. package/dist/react-native/isUnexpected.d.ts.map +1 -1
  94. package/dist/react-native/isUnexpected.js.map +1 -1
  95. package/dist/react-native/models.d.ts +45 -28
  96. package/dist/react-native/models.d.ts.map +1 -1
  97. package/dist/react-native/models.js.map +1 -1
  98. package/dist/react-native/outputModels.d.ts +55 -39
  99. package/dist/react-native/outputModels.d.ts.map +1 -1
  100. package/dist/react-native/outputModels.js.map +1 -1
  101. package/dist/react-native/paginateHelper.d.ts +27 -2
  102. package/dist/react-native/paginateHelper.d.ts.map +1 -1
  103. package/dist/react-native/paginateHelper.js +98 -1
  104. package/dist/react-native/paginateHelper.js.map +1 -1
  105. package/dist/react-native/parameters.d.ts +14 -7
  106. package/dist/react-native/parameters.d.ts.map +1 -1
  107. package/dist/react-native/parameters.js.map +1 -1
  108. package/dist/react-native/pollingHelper.d.ts +2 -2
  109. package/dist/react-native/pollingHelper.d.ts.map +1 -1
  110. package/dist/react-native/pollingHelper.js.map +1 -1
  111. package/dist/react-native/responses.d.ts +22 -17
  112. package/dist/react-native/responses.d.ts.map +1 -1
  113. package/dist/react-native/responses.js.map +1 -1
  114. package/package.json +15 -8
package/README.md CHANGED
@@ -1,27 +1,45 @@
1
- # Azure Deidentification REST client library for JavaScript
1
+ # Azure Health Data Services de-identification service REST client library for JavaScript
2
2
 
3
- `@azure-rest/health-deidentification` is a managed service that enables users to tag, redact, or surrogate health data.
3
+ This package contains a client library for the de-identification service in Azure Health Data Services which
4
+ enables users to tag, redact, or surrogate health data containing Protected Health Information (PHI).
4
5
 
5
- <!-- **Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library** -->
6
- <!-- TODO Fix links once they are live use placeholden until then -->
6
+ Use the client library for the de-identification service to:
7
+ - Discover PHI in unstructured text
8
+ - Replace PHI in unstructured text with placeholder values
9
+ - Replace PHI in unstructured text with realistic surrogate values
10
+ - Manage asynchronous jobs to de-identify documents in Azure Storage
11
+
12
+ **Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library.**
13
+
14
+ Use the client library for the de-identification service to:
15
+ - Discover PHI in unstructured text
16
+ - Replace PHI in unstructured text with placeholder values
17
+ - Replace PHI in unstructured text with realistic surrogate values
18
+ - Manage asynchronous jobs to de-identify documents in Azure Storage
7
19
 
8
20
  Key links:
9
21
 
22
+ - [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthdataaiservices/health-deidentification-rest)
10
23
  - [Package (NPM)](https://www.npmjs.com/package/@azure-rest/health-deidentification)
24
+ - [API reference documentation](https://learn.microsoft.com/javascript/api/@azure-rest/health-deidentification)
25
+ - [Product documentation][product_documentation]
11
26
 
12
27
  ## Getting started
13
28
 
14
29
  ### Currently supported environments
15
30
 
16
- - LTS versions of Node.js
31
+ - [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
32
+ - Latest versions of Safari, Chrome, Edge and Firefox.
17
33
 
18
34
  ### Prerequisites
19
35
 
20
- - You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
36
+ - You need an [Azure subscription][azure_sub] to use this package.
37
+ - [Deploy the de-identification service][deid_quickstart].
38
+ - [Configure Azure role-based access control (RBAC)][deid_rbac] for the operations you will perform.
21
39
 
22
40
  ### Install the `@azure-rest/health-deidentification` package
23
41
 
24
- Install the Azure Deidentification REST client REST client library for JavaScript with `npm`:
42
+ Install the library with `npm`:
25
43
 
26
44
  ```bash
27
45
  npm install @azure-rest/health-deidentification
@@ -29,26 +47,50 @@ npm install @azure-rest/health-deidentification
29
47
 
30
48
  ### Create and authenticate a `DeidentificationClient`
31
49
 
32
- To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
33
- provide an instance of the desired credential type obtained from the
34
- [@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
50
+ You can authenticate with Microsoft Entra ID using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
35
51
 
36
- To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
52
+ ```bash
53
+ npm install @azure/identity
54
+ ```
37
55
 
38
56
  After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
39
- As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
40
- can be used to authenticate the client.
57
+ As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential) can be used to authenticate the client.
41
58
 
42
59
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
43
- `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`
60
+ `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
44
61
 
45
- Pull `ServiceUrl` from your created Deidentification Service.
62
+ You will need a **service URL** to instantiate a client object. You can find the service URL for a particular resource in the [Azure portal][azure_portal], or using the [Azure CLI][azure_cli].
63
+ Here's an example of setting an environment variable in Bash using Azure CLI:
46
64
 
47
- ![Service Url Location](documentation/images/ServiceUrl_Location.png)
65
+ ```bash
66
+ # Get the service URL for the resource
67
+ export DEID_SERVICE_ENDPOINT=$(az deidservice show --name "<resource-name>" --resource-group "<resource-group-name>" --query "properties.serviceUrl")
68
+ ```
48
69
 
49
- Basic code snippet to create your Deidentification Client and Deidentify a string.
70
+ Create a client with the endpoint and credential:
71
+ ```ts snippet:CreateClient
72
+ import { DefaultAzureCredential } from "@azure/identity";
73
+ import DeidentificationClient from "@azure-rest/health-deidentification";
74
+
75
+ const credential = new DefaultAzureCredential();
76
+ const serviceEndpoint = process.env.DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
77
+ const client = DeidentificationClient(serviceEndpoint, credential);
78
+ ```
50
79
 
51
- ```ts snippet:ReadmeSample_Deidentify
80
+ ## Key concepts
81
+
82
+ ### De-identification operations:
83
+ Given an input text, the de-identification service can perform three main operations:
84
+ - `Tag` returns the category and location within the text of detected PHI entities.
85
+ - `Redact` returns output text where detected PHI entities are replaced with placeholder text. For example `John` replaced with `[name]`.
86
+ - `Surrogate` returns output text where detected PHI entities are replaced with realistic replacement values. For example, `My name is John Smith` could become `My name is Tom Jones`.
87
+
88
+ ### Available endpoints
89
+ There are two ways to interact with the de-identification service. You can send text directly, or you can create jobs
90
+ to de-identify documents in Azure Storage.
91
+
92
+ You can de-identify text directly using the `DeidentificationClient`:
93
+ ```ts snippet:DeidentifyText
52
94
  import { DefaultAzureCredential } from "@azure/identity";
53
95
  import DeidentificationClient, {
54
96
  DeidentificationContent,
@@ -56,7 +98,7 @@ import DeidentificationClient, {
56
98
  } from "@azure-rest/health-deidentification";
57
99
 
58
100
  const credential = new DefaultAzureCredential();
59
- const serviceEndpoint = "https://example.api.cac001.deid.azure.com";
101
+ const serviceEndpoint = process.env.DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
60
102
  const client = DeidentificationClient(serviceEndpoint, credential);
61
103
 
62
104
  const content: DeidentificationContent = {
@@ -72,18 +114,85 @@ if (isUnexpected(response)) {
72
114
  console.log(response.body.outputText); // Hello, Tom!
73
115
  ```
74
116
 
75
- ## Key concept
117
+ To de-identify documents in Azure Storage, you'll need a storage account with a container to which the de-identification service has been granted an appropriate role. See [Tutorial: Configure Azure Storage to de-identify documents][deid_configure_storage] for prerequisites and configuration options. You can upload the files in the [test data folder][test_data] as blobs, like: `https://<storageaccount>.blob.core.windows.net/<container>/example_patient_1/doctor_dictation.txt`.
118
+
119
+ You can create jobs to de-identify documents in the source Azure Storage account and container with an optional input prefix. If there's no input prefix, all blobs in the container will be de-identified. Azure Storage blobs can use `/` in the blob name to emulate a folder or directory layout. For more on blob naming, see [Naming and Referencing Containers, Blobs, and Metadata][blob_names]. The files you've uploaded can be de-identified by providing `example_patient_1` as the input prefix:
120
+ ```
121
+ <container>/
122
+ ├── example_patient_1/
123
+ └──doctor_dictation.txt
124
+ └──row-2-data.txt
125
+ └──visit-summary.txt
126
+ ```
127
+
128
+ Your target Azure Storage account and container where documents will be written can be the same as the source, or a different account or container. In the examples below, the source and target account and container are the same. You can specify an output prefix to indicate where the job's output documents should be written (defaulting to `_output`). Each document processed by the job will have the same relative blob name with the input prefix replaced by the output prefix:
129
+ ```
130
+ <container>/
131
+ ├── example_patient_1/
132
+ └──doctor_dictation.txt
133
+ └──row-2-data.txt
134
+ └──visit-summary.txt
135
+ ├── _output/
136
+ └──doctor_dictation.txt
137
+ └──row-2-data.txt
138
+ └──visit-summary.txt
139
+ ```
140
+
141
+ Set the following environment variables, updating the storage account and container with real values:
142
+ ```bash
143
+ export AZURE_STORAGE_ACCOUNT_LOCATION="https://<storageaccount>.blob.core.windows.net/<container>"
144
+ export INPUT_PREFIX="example_patient_1"
145
+ export OUTPUT_PREFIX="_output"
146
+ ```
76
147
 
77
- Operation Modes:
148
+ You can create and view job status using the client:
149
+ ```ts snippet:DeidentifyDocuments
150
+ import { DefaultAzureCredential } from "@azure/identity";
151
+ import DeidentificationClient, {
152
+ DeidentificationJob,
153
+ DeidentifyDocumentsDefaultResponse,
154
+ isUnexpected,
155
+ getLongRunningPoller,
156
+ } from "@azure-rest/health-deidentification";
78
157
 
79
- - Tag: Will return a structure of offset and length with the PHI category of the related text spans.
80
- - Redact: Will return output text with placeholder stubbed text. ex. `[name]`
81
- - Surrogate: Will return output text with synthetic replacements.
82
- - `My name is John Smith`
83
- - `My name is Tom Jones`
158
+ const credential = new DefaultAzureCredential();
159
+ const serviceEndpoint =
160
+ process.env["DEID_SERVICE_ENDPOINT"] || "https://example.api.deid.azure.com";
161
+ const storageLocation = `https://${process.env["STORAGE_ACCOUNT_NAME"]}.blob.core.windows.net/${process.env["STORAGE_CONTAINER_NAME"]}`;
162
+ const inputPrefix = "example_patient_1";
163
+ const outputPrefix = process.env["OUTPUT_PREFIX"] || "_output";
164
+
165
+ const client = DeidentificationClient(serviceEndpoint, credential);
166
+ const jobName = "sample-job-" + new Date().getTime().toString().slice(-8);
167
+
168
+ const job: DeidentificationJob = {
169
+ operation: "Surrogate",
170
+ sourceLocation: { location: storageLocation, prefix: inputPrefix },
171
+ targetLocation: { location: storageLocation, prefix: outputPrefix },
172
+ };
173
+ const response = (await client
174
+ .path("/jobs/{name}", jobName)
175
+ .put({ body: job })) as DeidentifyDocumentsDefaultResponse;
176
+
177
+ if (isUnexpected(response)) {
178
+ throw response.body.error;
179
+ }
180
+
181
+ const poller = await getLongRunningPoller(client, response);
182
+ const finalOutput = await poller.pollUntilDone();
183
+ console.log(finalOutput.body);
184
+ ```
185
+
186
+ ## Next steps
187
+
188
+ Find a bug, or have feedback? Raise an issue with the [Health Deidentification][github_issue_label] label.
84
189
 
85
190
  ## Troubleshooting
86
191
 
192
+ - **Unable to Access Source or Target Storage**
193
+ - Ensure you create your deid service with a system assigned managed identity
194
+ - Ensure your storage account has given permissions to that managed identity
195
+
87
196
  ### Logging
88
197
 
89
198
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
@@ -95,3 +204,14 @@ setLogLevel("info");
95
204
  ```
96
205
 
97
206
  For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
207
+
208
+ <!-- LINKS -->
209
+ [azure_sub]: https://azure.microsoft.com/free/
210
+ [deid_quickstart]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/quickstart
211
+ [deid_redact]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format
212
+ [deid_rbac]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/manage-access-rbac
213
+ [deid_managed_identity]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/managed-identities
214
+ [deid_configure_storage]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/configure-storage
215
+ [azure_cli]: https://learn.microsoft.com/cli/azure/healthcareapis/deidservice?view=azure-cli-latest
216
+ [azure_portal]: https://ms.portal.azure.com
217
+ [github_issue_label]: https://github.com/Azure/azure-sdk-for-js/labels/Health%20Deidentification
@@ -1,11 +1,11 @@
1
- import type { GetJobParameters, CreateJobParameters, DeleteJobParameters, ListJobsParameters, ListJobDocumentsParameters, CancelJobParameters, DeidentifyParameters } from "./parameters.js";
2
- import type { GetJob200Response, GetJobDefaultResponse, CreateJob200Response, CreateJob201Response, CreateJobDefaultResponse, DeleteJob204Response, DeleteJobDefaultResponse, ListJobs200Response, ListJobsDefaultResponse, ListJobDocuments200Response, ListJobDocumentsDefaultResponse, CancelJob200Response, CancelJobDefaultResponse, Deidentify200Response, DeidentifyDefaultResponse } from "./responses.js";
1
+ import type { GetJobParameters, DeidentifyDocumentsParameters, DeleteJobParameters, ListJobsParameters, ListJobDocumentsParameters, CancelJobParameters, DeidentifyTextParameters } from "./parameters.js";
2
+ import type { GetJob200Response, GetJobDefaultResponse, DeidentifyDocuments200Response, DeidentifyDocuments201Response, DeidentifyDocumentsDefaultResponse, DeleteJob204Response, DeleteJobDefaultResponse, ListJobs200Response, ListJobsDefaultResponse, ListJobDocuments200Response, ListJobDocumentsDefaultResponse, CancelJob200Response, CancelJobDefaultResponse, DeidentifyText200Response, DeidentifyTextDefaultResponse } from "./responses.js";
3
3
  import type { Client, StreamableMethod } from "@azure-rest/core-client";
4
4
  export interface GetJob {
5
5
  /** Resource read operation template. */
6
6
  get(options?: GetJobParameters): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;
7
7
  /** Long-running resource create or replace operation template. */
8
- put(options: CreateJobParameters): StreamableMethod<CreateJob200Response | CreateJob201Response | CreateJobDefaultResponse>;
8
+ put(options: DeidentifyDocumentsParameters): StreamableMethod<DeidentifyDocuments200Response | DeidentifyDocuments201Response | DeidentifyDocumentsDefaultResponse>;
9
9
  /** Removes the record of the job from the service. Does not delete any documents. */
10
10
  delete(options?: DeleteJobParameters): StreamableMethod<DeleteJob204Response | DeleteJobDefaultResponse>;
11
11
  }
@@ -27,9 +27,9 @@ export interface CancelJob {
27
27
  */
28
28
  post(options?: CancelJobParameters): StreamableMethod<CancelJob200Response | CancelJobDefaultResponse>;
29
29
  }
30
- export interface Deidentify {
30
+ export interface DeidentifyText {
31
31
  /** A remote procedure call (RPC) operation. */
32
- post(options: DeidentifyParameters): StreamableMethod<Deidentify200Response | DeidentifyDefaultResponse>;
32
+ post(options: DeidentifyTextParameters): StreamableMethod<DeidentifyText200Response | DeidentifyTextDefaultResponse>;
33
33
  }
34
34
  export interface Routes {
35
35
  /** Resource for '/jobs/\{name\}' has methods for the following verbs: get, put, delete */
@@ -41,7 +41,7 @@ export interface Routes {
41
41
  /** Resource for '/jobs/\{name\}:cancel' has methods for the following verbs: post */
42
42
  (path: "/jobs/{name}:cancel", name: string): CancelJob;
43
43
  /** Resource for '/deid' has methods for the following verbs: post */
44
- (path: "/deid"): Deidentify;
44
+ (path: "/deid"): DeidentifyText;
45
45
  }
46
46
  export type DeidentificationClient = Client & {
47
47
  path: Routes;
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,WAAW,MAAM;IACrB,wCAAwC;IACxC,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,CAAC;IAC7F,kEAAkE;IAClE,GAAG,CACD,OAAO,EAAE,mBAAmB,GAC3B,gBAAgB,CAAC,oBAAoB,GAAG,oBAAoB,GAAG,wBAAwB,CAAC,CAAC;IAC5F,qFAAqF;IACrF,MAAM,CACJ,OAAO,CAAC,EAAE,mBAAmB,GAC5B,gBAAgB,CAAC,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,CAAC,oBAAoB,GAAG,wBAAwB,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,CACF,OAAO,EAAE,wBAAwB,GAChC,gBAAgB,CAAC,yBAAyB,GAAG,6BAA6B,CAAC,CAAC;CAChF;AAED,MAAM,WAAW,MAAM;IACrB,0FAA0F;IAC1F,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7C,oEAAoE;IACpE,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,uFAAuF;IACvF,CAAC,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACjE,qFAAqF;IACrF,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACvD,qEAAqE;IACrE,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC;CACjC;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJobParameters,\n CreateJobParameters,\n DeleteJobParameters,\n ListJobsParameters,\n ListJobDocumentsParameters,\n CancelJobParameters,\n DeidentifyParameters,\n} from \"./parameters.js\";\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n CreateJob200Response,\n CreateJob201Response,\n CreateJobDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n Deidentify200Response,\n DeidentifyDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetJob {\n /** Resource read operation template. */\n get(options?: GetJobParameters): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;\n /** Long-running resource create or replace operation template. */\n put(\n options: CreateJobParameters,\n ): StreamableMethod<CreateJob200Response | CreateJob201Response | CreateJobDefaultResponse>;\n /** Removes the record of the job from the service. Does not delete any documents. */\n delete(\n options?: DeleteJobParameters,\n ): StreamableMethod<DeleteJob204Response | DeleteJobDefaultResponse>;\n}\n\nexport interface ListJobs {\n /** Resource list operation template. */\n get(\n options?: ListJobsParameters,\n ): StreamableMethod<ListJobs200Response | ListJobsDefaultResponse>;\n}\n\nexport interface ListJobDocuments {\n /** Resource list operation template. */\n get(\n options?: ListJobDocumentsParameters,\n ): StreamableMethod<ListJobDocuments200Response | ListJobDocumentsDefaultResponse>;\n}\n\nexport interface CancelJob {\n /**\n * Cancels a job that is in progress.\n *\n * The job will be marked as canceled and the service will stop processing the job. The service will not delete any documents that have already been processed.\n *\n * If the job is already complete, this will have no effect.\n */\n post(\n options?: CancelJobParameters,\n ): StreamableMethod<CancelJob200Response | CancelJobDefaultResponse>;\n}\n\nexport interface Deidentify {\n /** A remote procedure call (RPC) operation. */\n post(\n options: DeidentifyParameters,\n ): StreamableMethod<Deidentify200Response | DeidentifyDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/jobs/\\{name\\}' has methods for the following verbs: get, put, delete */\n (path: \"/jobs/{name}\", name: string): GetJob;\n /** Resource for '/jobs' has methods for the following verbs: get */\n (path: \"/jobs\"): ListJobs;\n /** Resource for '/jobs/\\{name\\}/documents' has methods for the following verbs: get */\n (path: \"/jobs/{name}/documents\", name: string): ListJobDocuments;\n /** Resource for '/jobs/\\{name\\}:cancel' has methods for the following verbs: post */\n (path: \"/jobs/{name}:cancel\", name: string): CancelJob;\n /** Resource for '/deid' has methods for the following verbs: post */\n (path: \"/deid\"): Deidentify;\n}\n\nexport type DeidentificationClient = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJobParameters,\n DeidentifyDocumentsParameters,\n DeleteJobParameters,\n ListJobsParameters,\n ListJobDocumentsParameters,\n CancelJobParameters,\n DeidentifyTextParameters,\n} from \"./parameters.js\";\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n DeidentifyDocuments200Response,\n DeidentifyDocuments201Response,\n DeidentifyDocumentsDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n DeidentifyText200Response,\n DeidentifyTextDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetJob {\n /** Resource read operation template. */\n get(options?: GetJobParameters): StreamableMethod<GetJob200Response | GetJobDefaultResponse>;\n /** Long-running resource create or replace operation template. */\n put(\n options: DeidentifyDocumentsParameters,\n ): StreamableMethod<\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsDefaultResponse\n >;\n /** Removes the record of the job from the service. Does not delete any documents. */\n delete(\n options?: DeleteJobParameters,\n ): StreamableMethod<DeleteJob204Response | DeleteJobDefaultResponse>;\n}\n\nexport interface ListJobs {\n /** Resource list operation template. */\n get(\n options?: ListJobsParameters,\n ): StreamableMethod<ListJobs200Response | ListJobsDefaultResponse>;\n}\n\nexport interface ListJobDocuments {\n /** Resource list operation template. */\n get(\n options?: ListJobDocumentsParameters,\n ): StreamableMethod<ListJobDocuments200Response | ListJobDocumentsDefaultResponse>;\n}\n\nexport interface CancelJob {\n /**\n * Cancels a job that is in progress.\n *\n * The job will be marked as canceled and the service will stop processing the job. The service will not delete any documents that have already been processed.\n *\n * If the job is already complete, this will have no effect.\n */\n post(\n options?: CancelJobParameters,\n ): StreamableMethod<CancelJob200Response | CancelJobDefaultResponse>;\n}\n\nexport interface DeidentifyText {\n /** A remote procedure call (RPC) operation. */\n post(\n options: DeidentifyTextParameters,\n ): StreamableMethod<DeidentifyText200Response | DeidentifyTextDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/jobs/\\{name\\}' has methods for the following verbs: get, put, delete */\n (path: \"/jobs/{name}\", name: string): GetJob;\n /** Resource for '/jobs' has methods for the following verbs: get */\n (path: \"/jobs\"): ListJobs;\n /** Resource for '/jobs/\\{name\\}/documents' has methods for the following verbs: get */\n (path: \"/jobs/{name}/documents\", name: string): ListJobDocuments;\n /** Resource for '/jobs/\\{name\\}:cancel' has methods for the following verbs: post */\n (path: \"/jobs/{name}:cancel\", name: string): CancelJob;\n /** Resource for '/deid' has methods for the following verbs: post */\n (path: \"/deid\"): DeidentifyText;\n}\n\nexport type DeidentificationClient = Client & {\n path: Routes;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deidentificationClient.d.ts","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,6CAA6C;AAC7C,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAClE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,6BAAkC,GACpF,sBAAsB,CAsCxB"}
1
+ {"version":3,"file":"deidentificationClient.d.ts","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,6CAA6C;AAC7C,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAClE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,6BAAkC,GAC5E,sBAAsB,CAuCxB"}
@@ -11,8 +11,8 @@ import { logger } from "./logger.js";
11
11
  */
12
12
  export default function createClient(endpointParam, credentials, _a = {}) {
13
13
  var _b, _c, _d, _e, _f, _g;
14
- var { apiVersion = "2024-07-12-preview" } = _a, options = __rest(_a, ["apiVersion"]);
15
- const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://${endpointParam}`;
14
+ var { apiVersion = "2024-11-15" } = _a, options = __rest(_a, ["apiVersion"]);
15
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}`;
16
16
  const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;
17
17
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
18
18
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
@@ -1 +1 @@
1
- {"version":3,"file":"deidentificationClient.js","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mapp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I,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { DeidentificationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DeidentificationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `DeidentificationClient`\n * @param endpointParam - Url of your De-identification Service.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2024-07-12-preview\", ...options }: DeidentificationClientOptions = {},\n): DeidentificationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://${endpointParam}`;\n const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://deid.azure.com/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DeidentificationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return client;\n}\n"]}
1
+ {"version":3,"file":"deidentificationClient.js","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,KAA2E,EAAE;;QAA7E,EAAE,UAAU,GAAG,YAAY,OAAkD,EAA7C,OAAO,cAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,MAAM,aAAa,GAAG,oDAAoD,CAAC;IAC3E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,iCAAiC,CAAC;SAC3E,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA2B,CAAC;IAEtF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { DeidentificationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DeidentificationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `DeidentificationClient`\n * @param endpointParam - Url of your De-identification Service.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2024-11-15\", ...options }: DeidentificationClientOptions = {},\n): DeidentificationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://deid.azure.com/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DeidentificationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -1,9 +1,9 @@
1
- import type { GetJob200Response, GetJobDefaultResponse, CreateJob200Response, CreateJob201Response, CreateJobLogicalResponse, CreateJobDefaultResponse, DeleteJob204Response, DeleteJobDefaultResponse, ListJobs200Response, ListJobsDefaultResponse, ListJobDocuments200Response, ListJobDocumentsDefaultResponse, CancelJob200Response, CancelJobDefaultResponse, Deidentify200Response, DeidentifyDefaultResponse } from "./responses.js";
1
+ import type { GetJob200Response, GetJobDefaultResponse, DeidentifyDocuments200Response, DeidentifyDocuments201Response, DeidentifyDocumentsLogicalResponse, DeidentifyDocumentsDefaultResponse, DeleteJob204Response, DeleteJobDefaultResponse, ListJobs200Response, ListJobsDefaultResponse, ListJobDocuments200Response, ListJobDocumentsDefaultResponse, CancelJob200Response, CancelJobDefaultResponse, DeidentifyText200Response, DeidentifyTextDefaultResponse } from "./responses.js";
2
2
  export declare function isUnexpected(response: GetJob200Response | GetJobDefaultResponse): response is GetJobDefaultResponse;
3
- export declare function isUnexpected(response: CreateJob200Response | CreateJob201Response | CreateJobLogicalResponse | CreateJobDefaultResponse): response is CreateJobDefaultResponse;
3
+ export declare function isUnexpected(response: DeidentifyDocuments200Response | DeidentifyDocuments201Response | DeidentifyDocumentsLogicalResponse | DeidentifyDocumentsDefaultResponse): response is DeidentifyDocumentsDefaultResponse;
4
4
  export declare function isUnexpected(response: DeleteJob204Response | DeleteJobDefaultResponse): response is DeleteJobDefaultResponse;
5
5
  export declare function isUnexpected(response: ListJobs200Response | ListJobsDefaultResponse): response is ListJobsDefaultResponse;
6
6
  export declare function isUnexpected(response: ListJobDocuments200Response | ListJobDocumentsDefaultResponse): response is ListJobDocumentsDefaultResponse;
7
7
  export declare function isUnexpected(response: CancelJob200Response | CancelJobDefaultResponse): response is CancelJobDefaultResponse;
8
- export declare function isUnexpected(response: Deidentify200Response | DeidentifyDefaultResponse): response is DeidentifyDefaultResponse;
8
+ export declare function isUnexpected(response: DeidentifyText200Response | DeidentifyTextDefaultResponse): response is DeidentifyTextDefaultResponse;
9
9
  //# sourceMappingURL=isUnexpected.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../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AAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n CreateJob200Response,\n CreateJob201Response,\n CreateJobLogicalResponse,\n CreateJobDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n Deidentify200Response,\n DeidentifyDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /jobs/{name}\": [\"200\"],\n \"PUT /jobs/{name}\": [\"200\", \"201\"],\n \"DELETE /jobs/{name}\": [\"204\"],\n \"GET /jobs\": [\"200\"],\n \"GET /jobs/{name}/documents\": [\"200\"],\n \"POST /jobs/{name}:cancel\": [\"200\"],\n \"POST /deid\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | CreateJob200Response\n | CreateJob201Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse,\n): response is CreateJobDefaultResponse;\nexport function isUnexpected(\n response: DeleteJob204Response | DeleteJobDefaultResponse,\n): response is DeleteJobDefaultResponse;\nexport function isUnexpected(\n response: ListJobs200Response | ListJobsDefaultResponse,\n): response is ListJobsDefaultResponse;\nexport function isUnexpected(\n response: ListJobDocuments200Response | ListJobDocumentsDefaultResponse,\n): response is ListJobDocumentsDefaultResponse;\nexport function isUnexpected(\n response: CancelJob200Response | CancelJobDefaultResponse,\n): response is CancelJobDefaultResponse;\nexport function isUnexpected(\n response: Deidentify200Response | DeidentifyDefaultResponse,\n): response is DeidentifyDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | CreateJob200Response\n | CreateJob201Response\n | CreateJobLogicalResponse\n | CreateJobDefaultResponse\n | DeleteJob204Response\n | DeleteJobDefaultResponse\n | ListJobs200Response\n | ListJobsDefaultResponse\n | ListJobDocuments200Response\n | ListJobDocumentsDefaultResponse\n | CancelJob200Response\n | CancelJobDefaultResponse\n | Deidentify200Response\n | DeidentifyDefaultResponse,\n): response is\n | GetJobDefaultResponse\n | CreateJobDefaultResponse\n | DeleteJobDefaultResponse\n | ListJobsDefaultResponse\n | ListJobDocumentsDefaultResponse\n | CancelJobDefaultResponse\n | DeidentifyDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqBlC,MAAM,WAAW,GAA6B;IAC5C,kBAAkB,EAAE,CAAC,KAAK,CAAC;IAC3B,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAClC,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,WAAW,EAAE,CAAC,KAAK,CAAC;IACpB,4BAA4B,EAAE,CAAC,KAAK,CAAC;IACrC,0BAA0B,EAAE,CAAC,KAAK,CAAC;IACnC,YAAY,EAAE,CAAC,KAAK,CAAC;CACtB,CAAC;AA2BF,MAAM,UAAU,YAAY,CAC1B,QAgBiC;IASjC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WA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,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n DeidentifyDocuments200Response,\n DeidentifyDocuments201Response,\n DeidentifyDocumentsLogicalResponse,\n DeidentifyDocumentsDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n DeidentifyText200Response,\n DeidentifyTextDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /jobs/{name}\": [\"200\"],\n \"PUT /jobs/{name}\": [\"200\", \"201\"],\n \"DELETE /jobs/{name}\": [\"204\"],\n \"GET /jobs\": [\"200\"],\n \"GET /jobs/{name}/documents\": [\"200\"],\n \"POST /jobs/{name}:cancel\": [\"200\"],\n \"POST /deid\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse,\n): response is DeidentifyDocumentsDefaultResponse;\nexport function isUnexpected(\n response: DeleteJob204Response | DeleteJobDefaultResponse,\n): response is DeleteJobDefaultResponse;\nexport function isUnexpected(\n response: ListJobs200Response | ListJobsDefaultResponse,\n): response is ListJobsDefaultResponse;\nexport function isUnexpected(\n response: ListJobDocuments200Response | ListJobDocumentsDefaultResponse,\n): response is ListJobDocumentsDefaultResponse;\nexport function isUnexpected(\n response: CancelJob200Response | CancelJobDefaultResponse,\n): response is CancelJobDefaultResponse;\nexport function isUnexpected(\n response: DeidentifyText200Response | DeidentifyTextDefaultResponse,\n): response is DeidentifyTextDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJob204Response\n | DeleteJobDefaultResponse\n | ListJobs200Response\n | ListJobsDefaultResponse\n | ListJobDocuments200Response\n | ListJobDocumentsDefaultResponse\n | CancelJob200Response\n | CancelJobDefaultResponse\n | DeidentifyText200Response\n | DeidentifyTextDefaultResponse,\n): response is\n | GetJobDefaultResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJobDefaultResponse\n | ListJobsDefaultResponse\n | ListJobDocumentsDefaultResponse\n | CancelJobDefaultResponse\n | DeidentifyTextDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -1,23 +1,17 @@
1
1
  /** A job containing a batch of documents to de-identify. */
2
2
  export interface DeidentificationJob {
3
- /** Storage location to perform the operation on. */
4
- sourceLocation: SourceStorageLocation;
5
- /** Target location to store output of operation. */
6
- targetLocation: TargetStorageLocation;
7
3
  /**
8
4
  * Operation to perform on the input documents.
9
5
  *
10
6
  * Possible values: "Redact", "Surrogate", "Tag"
11
7
  */
12
- operation?: OperationType;
13
- /**
14
- * Data type of the input documents.
15
- *
16
- * Possible values: "Plaintext"
17
- */
18
- dataType?: DocumentDataType;
19
- /** Format of the redacted output. Only valid when Operation is Redact. */
20
- redactionFormat?: string;
8
+ operation?: DeidentificationOperationType;
9
+ /** Storage location to perform the operation on. */
10
+ sourceLocation: SourceStorageLocation;
11
+ /** Target location to store output of operation. */
12
+ targetLocation: TargetStorageLocation;
13
+ /** Customization parameters to override default service behaviors. */
14
+ customizations?: DeidentificationJobCustomizationOptions;
21
15
  }
22
16
  /** Storage location. */
23
17
  export interface SourceStorageLocation {
@@ -32,11 +26,32 @@ export interface SourceStorageLocation {
32
26
  export interface TargetStorageLocation {
33
27
  /** URL to storage location. */
34
28
  location: string;
35
- /** Prefix to filter path by. */
29
+ /**
30
+ * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.
31
+ *
32
+ * Example:
33
+ * File full path: documents/user/note.txt
34
+ * Input Prefix: "documents/user/"
35
+ * Output Prefix: "output_docs/"
36
+ *
37
+ * Output file: "output_docs/note.txt"
38
+ */
36
39
  prefix: string;
40
+ /** When set to true during a job, the service will overwrite the output location if it already exists. */
41
+ overwrite?: boolean;
42
+ }
43
+ /** Customizations options to override default service behaviors for job usage. */
44
+ export interface DeidentificationJobCustomizationOptions {
45
+ /**
46
+ * Format of the redacted output. Only valid when Operation is Redact.
47
+ * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.
48
+ */
49
+ redactionFormat?: string;
50
+ /** Locale in which the output surrogates are written. */
51
+ surrogateLocale?: string;
37
52
  }
38
53
  /** Summary metrics of a job. */
39
- export interface JobSummary {
54
+ export interface DeidentificationJobSummary {
40
55
  /** Number of documents that have completed. */
41
56
  successful: number;
42
57
  /** Number of documents that have failed. */
@@ -53,24 +68,26 @@ export interface DeidentificationContent {
53
68
  /** Input text to de-identify. */
54
69
  inputText: string;
55
70
  /**
56
- * Operation to perform on the input.
71
+ * Operation to perform on the input documents.
57
72
  *
58
73
  * Possible values: "Redact", "Surrogate", "Tag"
59
74
  */
60
- operation?: OperationType;
75
+ operation?: DeidentificationOperationType;
76
+ /** Customization parameters to override default service behaviors. */
77
+ customizations?: DeidentificationCustomizationOptions;
78
+ }
79
+ /** Customizations options to override default service behaviors for synchronous usage. */
80
+ export interface DeidentificationCustomizationOptions {
61
81
  /**
62
- * Data type of the input.
63
- *
64
- * Possible values: "Plaintext"
82
+ * Format of the redacted output. Only valid when Operation is Redact.
83
+ * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.
65
84
  */
66
- dataType?: DocumentDataType;
67
- /** Format of the redacted output. Only valid when OperationType is "Redact". */
68
85
  redactionFormat?: string;
86
+ /** Locale in which the output surrogates are written. */
87
+ surrogateLocale?: string;
69
88
  }
70
- /** Alias for OperationType */
71
- export type OperationType = string;
72
- /** Alias for DocumentDataType */
73
- export type DocumentDataType = string;
74
- /** Alias for JobStatus */
75
- export type JobStatus = string;
89
+ /** Alias for DeidentificationOperationType */
90
+ export type DeidentificationOperationType = string;
91
+ /** Alias for OperationState */
92
+ export type OperationState = string;
76
93
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,cAAc,EAAE,qBAAqB,CAAC;IACtC,oDAAoD;IACpD,cAAc,EAAE,qBAAqB,CAAC;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAwB;AACxB,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAwB;AACxB,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;C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yD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gCAAgC;AAChC,MAAM,WAAW,0BAA0B;IACzC,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,6BAA6B,CAAC;IAC1C,sEAAsE;IACtE,cAAc,CAAC,EAAE,oCAAoC,CAAC;CACvD;AAED,0FAA0F;AAC1F,MAAM,WAAW,oCAAoC;IACnD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,+BAA+B;AAC/B,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJob {\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocation;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocation;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: OperationType;\n /**\n * Data type of the input documents.\n *\n * Possible values: \"Plaintext\"\n */\n dataType?: DocumentDataType;\n /** Format of the redacted output. Only valid when Operation is Redact. */\n redactionFormat?: string;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocation {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocation {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n}\n\n/** Summary metrics of a job. */\nexport interface JobSummary {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Request body for de-identification operation. */\nexport interface DeidentificationContent {\n /** Input text to de-identify. */\n inputText: string;\n /**\n * Operation to perform on the input.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: OperationType;\n /**\n * Data type of the input.\n *\n * Possible values: \"Plaintext\"\n */\n dataType?: DocumentDataType;\n /** Format of the redacted output. Only valid when OperationType is \"Redact\". */\n redactionFormat?: string;\n}\n\n/** Alias for OperationType */\nexport type OperationType = string;\n/** Alias for DocumentDataType */\nexport type DocumentDataType = string;\n/** Alias for JobStatus */\nexport type JobStatus = string;\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJob {\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: DeidentificationOperationType;\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocation;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocation;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationJobCustomizationOptions;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocation {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocation {\n /** URL to storage location. */\n location: string;\n /**\n * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n *\n * Example:\n * File full path: documents/user/note.txt\n * Input Prefix: \"documents/user/\"\n * Output Prefix: \"output_docs/\"\n *\n * Output file: \"output_docs/note.txt\"\n */\n prefix: string;\n /** When set to true during a job, the service will overwrite the output location if it already exists. */\n overwrite?: boolean;\n}\n\n/** Customizations options to override default service behaviors for job usage. */\nexport interface DeidentificationJobCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n}\n\n/** Summary metrics of a job. */\nexport interface DeidentificationJobSummary {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Request body for de-identification operation. */\nexport interface DeidentificationContent {\n /** Input text to de-identify. */\n inputText: string;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: DeidentificationOperationType;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationCustomizationOptions;\n}\n\n/** Customizations options to override default service behaviors for synchronous usage. */\nexport interface DeidentificationCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n}\n\n/** Alias for DeidentificationOperationType */\nexport type DeidentificationOperationType = string;\n/** Alias for OperationState */\nexport type OperationState = string;\n"]}