Skip to content

Commit

Permalink
Updates of @azure-rest/ai-vision-face (Azure#29676)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

@azure-rest/ai-vision-face

### Issues associated with this PR


### Describe the problem that is addressed by this PR

1. tsp-client update to
Azure/azure-rest-api-specs@60161e2
([commit](Azure@2189b83))
- Ref: history of face spec
https://github.com/Azure/azure-rest-api-specs/commits/main/specification/ai/Face
2. Refine customization to not set MFD filename when there has already
been one.
([commit](Azure@d688279))
3. Use the `extraFiles` config to copy sample images.
([commit](Azure@389b01d))
4. Fix sanitizer issues in tests.
([commit](Azure@3354597))
5. Update the core-lro to v3 preview version.
([commit](Azure@7ac973d))
- Cherry-picked from
56d8552
6. tsp-client update to
Azure/azure-rest-api-specs@1d2253d
([commit](Azure@9e3a10a))

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)

---------

Co-authored-by: Chung Sheng Fu <Chung.Fu@microsoft.com>
  • Loading branch information
chungshengfu and Chung Sheng Fu authored May 23, 2024
1 parent 2fba31f commit 39cfc07
Show file tree
Hide file tree
Showing 15 changed files with 2,465 additions and 2,570 deletions.
551 changes: 155 additions & 396 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/face/ai-vision-face-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

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

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).
Expand Down
23 changes: 5 additions & 18 deletions sdk/face/ai-vision-face-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
{
"$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/ai-vision-face.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" }
}
}
}
20 changes: 17 additions & 3 deletions sdk/face/ai-vision-face-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.6.2",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0"
"@azure/core-lro": "3.0.0-beta.1",
"@azure/abort-controller": "^2.0.0"
},
"devDependencies": {
"dotenv": "^16.0.0",
Expand Down Expand Up @@ -115,7 +115,21 @@
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://aka.ms/azsdk-javascript-face-ref"
"apiRefLink": "https://aka.ms/azsdk-javascript-face-ref",
"extraFiles": {
"./samples-dev/data/detection1.jpg": [
"javascript/data/detection1.jpg",
"typescript/src/data/detection1.jpg"
],
"./samples-dev/data/detection5.jpg": [
"javascript/data/detection5.jpg",
"typescript/src/data/detection5.jpg"
],
"./samples-dev/data/nine-faces.png": [
"javascript/data/nine-faces.png",
"typescript/src/data/nine-faces.png"
]
}
},
"exports": {
"./package.json": "./package.json",
Expand Down
237 changes: 125 additions & 112 deletions sdk/face/ai-vision-face-rest/review/ai-vision-face.api.md

Large diffs are not rendered by default.

1,313 changes: 657 additions & 656 deletions sdk/face/ai-vision-face-rest/src/clientDefinitions.ts

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion sdk/face/ai-vision-face-rest/src/faceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export default function createClient(
name: "VerifyImageFilenamePolicy",
sendRequest: (request, next) => {
for (const part of request.multipartBody?.parts ?? []) {
if (part.headers.get("content-disposition")?.includes(`name="VerifyImage"`)) {
const contentDisposition = part.headers.get("content-disposition");
if (
contentDisposition &&
contentDisposition.includes(`name="VerifyImage"`) &&
!contentDisposition.includes("filename=")
) {
part.headers.set("content-disposition", `form-data; name="VerifyImage"; filename="blob"`);
}
}
Expand Down
Loading

0 comments on commit 39cfc07

Please sign in to comment.