Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure-rest/health-deidentification] remove examples-dir from python tspconfig #12164

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Release History

## 1.0.0-beta.1 (2024-08-15)

- Azure Deidentification client library for JS. This package contains Microsoft Azure Deidentification client library.

## 1.0.0-beta.1 (2024-09-27)

### Features Added

- Azure Deidentification client library for JS. This package contains Microsoft Azure Deidentification client library.
- Added Interface DeidServicesClientOptions
- Added Type Alias DeidServicesClient

60 changes: 9 additions & 51 deletions sdk/healthdataaiservices/azure-health-deidentification/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Azure Deidentification REST client library for JavaScript
# Azure DeidServices REST client library for JavaScript

`@azure-rest/health-deidentification` is a managed service that enables users to tag, redact, or surrogate health data.
Health Deidentification Service

**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**

<!-- **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** -->
<!-- TODO Fix links once they are live use placeholden until then -->
Key links:

- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/health-deidentification)
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/health-deidentification?view=azure-node-preview)

## Getting started

Expand All @@ -20,69 +21,26 @@ Key links:

### Install the `@azure-rest/health-deidentification` package

Install the Azure Deidentification REST client REST client library for JavaScript with `npm`:
Install the Azure DeidServices REST client REST client library for JavaScript with `npm`:

```bash
npm install @azure-rest/health-deidentification
```

### Create and authenticate a `DeidentificationClient`
### Create and authenticate a `DeidServicesClient`

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),
provide an instance of the desired credential type obtained from the
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.

To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)

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.
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.

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`

Pull `ServiceUrl` from your created Deidentification Service.

![Service Url Location](documentation/images/ServiceUrl_Location.png)

Basic code snippet to create your Deidentification Client and Deidentify a string.

```javascript
import createClient, {
DeidentificationContent,
isUnexpected,
} from "@azure-rest/health-deidentification";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();

const credential = new DefaultAzureCredential();
const serviceEndpoint =
process.env["DEID_SERVICE_ENDPOINT"] || "https://example.api.cac001.deid.azure.com";
const client = createClient(serviceEndpoint, credential);

const content: DeidentificationContent = {
inputText: "Hello John!"
};

const response = await client.path("/deid").post({ body: content });

if (isUnexpected(response)) {
throw response.body.error;
}

console.log(response.body.outputText); // Hello, Tom!
```

## Key concept

Operation Modes:

- Tag: Will return a structure of offset and length with the PHI category of the related text spans.
- Redact: Will return output text with placeholder stubbed text. ex. `[name]`
- Surrogate: Will return output text with synthetic replacements.
- `My name is John Smith`
- `My name is Tom Jones`
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET

## Troubleshooting

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/health-deidentification.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ export default [
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"tsdoc/syntax": "warn",
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"@azure/azure-sdk/ts-package-json-name": "warn",
"@azure/azure-sdk/ts-package-json-homepage": "warn",
},
},
"tsdoc/syntax": "warn"
}
}
];
104 changes: 48 additions & 56 deletions sdk/healthdataaiservices/azure-health-deidentification/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@azure-rest/health-deidentification",
"version": "1.0.0-beta.1",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthdataaiservices/azure-health-deidentification",
"description": "Health Deidentification Service",
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -38,7 +37,8 @@
"dist",
"README.md",
"LICENSE",
"review/*"
"review/*",
"CHANGELOG.md"
],
"sdk-type": "client",
"repository": "github:Azure/azure-sdk-for-js",
Expand All @@ -49,99 +49,91 @@
"//metadata": {
"constantPaths": [
{
"path": "src/deidentificationClient.ts",
"prefix": "package-version"
"path": "src/deidServicesClient.ts",
"prefix": "userAgentInfo"
}
],
"sampleConfiguration": {
"skipFolder": false,
"disableDocsMs": true,
"productName": "Health Deidentification Service",
"productSlugs": [],
"apiRefLink": "https://docs.microsoft.com/javascript/api/",
"requiredResources": {
"De-identification Service": "https://docs.microsoft.com/javascript/api/"
}
}
]
},
"dependencies": {
"@azure-rest/core-client": "^2.2.0",
"@azure/abort-controller": "^2.0.0",
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-lro": "^3.0.0",
"@azure/core-paging": "^1.6.2",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/identity": "^4.4.0",
"@azure/logger": "^1.0.0",
"dotenv": "^16.0.0",
"tslib": "^2.6.2"
"tslib": "^2.6.2",
"@azure/core-lro": "^3.0.0",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.5.0"
},
"devDependencies": {
"@azure-tools/test-credential": "^2.1.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure/core-util": "^1.9.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"dotenv": "^16.0.0",
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"eslint": "^8.55.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"mkdirp": "^3.0.1",
"typescript": "~5.5.3",
"tshy": "^1.11.1",
"@azure/identity": "^4.2.1",
"@vitest/browser": "^2.0.5",
"@vitest/coverage-istanbul": "^2.0.5",
"eslint": "^9.9.0",
"loupe": "~3.1.1",
"mkdirp": "^3.0.1",
"playwright": "^1.41.2",
"rimraf": "^5.0.5",
"typescript": "~5.6.2",
"vitest": "^2.0.5"
"vitest": "^2.0.5",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"build:node": "dev-tool run build-package",
"build:samples": "echo Obsolete.",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\" \"samples-dev/**/*.ts\"",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "dev-tool run build-package && dev-tool run extract-api",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\" \"samples-dev/**/*.ts\"",
"generate:client": "autorest --typescript ./swagger/README.md",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
"integration-test:node": "dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest",
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
"pack": "npm pack 2>&1",
"lint": "eslint package.json api-extractor.json src test",
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "npm run integration-test:browser",
"unit-test:node": "npm run integration-test:node",
"update-snippets": "echo skipped"
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"execute:samples": "echo skipped",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
"generate:client": "echo skipped",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}
"types": "./dist/commonjs/index.d.ts"
}
Loading