Skip to content

Commit

Permalink
CodeGen from PR 29064 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge cc08ca087408e728e9d7c26d6a1396cda2524bcb into acea819f6b350a1e2d598d02628a1719b5f9da5d
  • Loading branch information
SDKAuto committed May 12, 2024
1 parent 1733bfa commit d8a3910
Show file tree
Hide file tree
Showing 23 changed files with 987 additions and 892 deletions.
3 changes: 0 additions & 3 deletions sdk/face/ai-vision-face-rest/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"@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",
"@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",
"tsdoc/syntax": "warn"
}
}
24 changes: 2 additions & 22 deletions sdk/face/ai-vision-face-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# Release History
## 1.0.0-beta.1 (2024-05-12)

## 1.0.0-beta.1 (2024-05-10)

This is the first preview of the Azure Face Service client library `@azure-rest/ai-vision-face` that follows the [TypeScript Azure SDK Design Guidelines](https://azure.github.io/azure-sdk/typescript_introduction.html).
This library replaces the package [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).

This package's [documentation](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/face/ai-vision-face-rest/README.md) and [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/face/ai-vision-face-rest/samples) demonstrate the new API.

### Features Added

These are the new features not supported by the old package [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).

- Added support for Liveness Detection.
- Added support for `Person` and `DynamicPersonGroup` operations.
- Added support for face recognition with `PersonDirectory` by passing `IdentifyFromPersonDirectoryParameters` or `IdentifyFromDynamicPersonGroupParameters` to `/identify`.
- Added support for authentication with Microsoft Entra ID using `DefaultAzureCredential` from `@azure/identity`.

### Breaking Changes

- This library supports only the Azure AI Face v1.1-preview.1 API, whose data models are not compatible with the v1.0 API used by [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
- This library follows the design of [REST client](https://devblogs.microsoft.com/azure-sdk/azure-rest-libraries-for-javascript/), which is essentially different from [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
- The Snapshot operations are all removed as [the Snapshot API is no longer supported](https://azure.microsoft.com/updates/facelimitedaccess/).
- Initial Release
448 changes: 22 additions & 426 deletions sdk/face/ai-vision-face-rest/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/face/ai-vision-face-rest/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
}
}
}
}
}
133 changes: 133 additions & 0 deletions sdk/face/ai-vision-face-rest/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config();
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();

module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["source-map-support", "mocha"],

plugins: [
"karma-mocha",
"karma-mocha-reporter",
"karma-chrome-launcher",
"karma-firefox-launcher",
"karma-env-preprocessor",
"karma-coverage",
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-source-map-support",
],

// list of files / patterns to load in the browser
files: [
"dist-test/index.browser.js",
{
pattern: "dist-test/index.browser.js.map",
type: "html",
included: false,
served: true,
},
],

// list of files / patterns to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "dist-test/index.js": ["coverage"]
},

envPreprocessor: [
"TEST_MODE",
"ENDPOINT",
"AZURE_CLIENT_SECRET",
"AZURE_CLIENT_ID",
"AZURE_TENANT_ID",
"SUBSCRIPTION_ID",
"RECORDINGS_RELATIVE_PATH",
],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["mocha", "coverage", "junit"],

coverageReporter: {
// specify a common output directory
dir: "coverage-browser/",
reporters: [
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
],
},

junitReporter: {
outputDir: "", // results will be saved as $outputDir/$browserName.xml
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: "", // suite will become the package name attribute in xml testsuite element
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {}, // key value pair of properties to add to the <properties> section of the report
},

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// --no-sandbox allows our tests to run in Linux without having to change the system.
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
browsers: ["ChromeHeadlessNoSandbox"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-web-security"],
},
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,

browserNoActivityTimeout: 60000000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,

client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000",
},
},
});
};
16 changes: 4 additions & 12 deletions sdk/face/ai-vision-face-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@azure/core-util": "^1.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^4.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@vitest/browser": "^1.3.1",
"@vitest/coverage-istanbul": "^1.3.1",
"playwright": "^1.41.2",
Expand All @@ -91,8 +91,8 @@
"lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
Expand All @@ -109,14 +109,6 @@
"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"
},
"//sampleConfiguration": {
"productName": "Face API",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://aka.ms/azsdk-javascript-face-ref"
},
"exports": {
"./package.json": "./package.json",
".": {
Expand All @@ -140,4 +132,4 @@
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts"
}
}
11 changes: 1 addition & 10 deletions sdk/face/ai-vision-face-rest/review/ai-vision-face.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -896,15 +896,6 @@ export interface CreateLivenessSessionContent {
sendResultsToClient?: boolean;
}

// @public
export interface CreateLivenessSessionContentForMultipart {
authTokenTimeToLiveInSeconds?: number;
deviceCorrelationId?: string;
deviceCorrelationIdSetInClient?: boolean;
livenessOperationMode: LivenessOperationMode;
sendResultsToClient?: boolean;
}

// @public (undocumented)
export interface CreateLivenessSessionDefaultHeaders {
"x-ms-error-code"?: string;
Expand Down Expand Up @@ -949,7 +940,7 @@ export type CreateLivenessWithVerifySessionContent = FormData | Array<CreateLive
// @public (undocumented)
export interface CreateLivenessWithVerifySessionContentParametersPartDescriptor {
// (undocumented)
body: CreateLivenessSessionContentForMultipart;
body: CreateLivenessSessionContent;
// (undocumented)
name: "Parameters";
}
Expand Down
Loading

0 comments on commit d8a3910

Please sign in to comment.