Skip to content

Commit 39cfc07

Browse files
chungshengfuChung Sheng Fu
andauthored
Updates of @azure-rest/ai-vision-face (Azure#29676)
### 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 <[email protected]>
1 parent 2fba31f commit 39cfc07

File tree

15 files changed

+2465
-2570
lines changed

15 files changed

+2465
-2570
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 155 additions & 396 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/face/ai-vision-face-rest/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

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

55
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).
66
This library replaces the package [@azure/cognitiveservices-face](https://www.npmjs.com/package/@azure/cognitiveservices-face).
Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
33
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
4-
"docModel": {
5-
"enabled": true
6-
},
7-
"apiReport": {
8-
"enabled": true,
9-
"reportFolder": "./review"
10-
},
4+
"docModel": { "enabled": true },
5+
"apiReport": { "enabled": true, "reportFolder": "./review" },
116
"dtsRollup": {
127
"enabled": true,
138
"untrimmedFilePath": "",
149
"publicTrimmedFilePath": "./types/ai-vision-face.d.ts"
1510
},
1611
"messages": {
17-
"tsdocMessageReporting": {
18-
"default": {
19-
"logLevel": "none"
20-
}
21-
},
12+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
2213
"extractorMessageReporting": {
23-
"ae-missing-release-tag": {
24-
"logLevel": "none"
25-
},
26-
"ae-unresolved-link": {
27-
"logLevel": "none"
28-
}
14+
"ae-missing-release-tag": { "logLevel": "none" },
15+
"ae-unresolved-link": { "logLevel": "none" }
2916
}
3017
}
3118
}

sdk/face/ai-vision-face-rest/package.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"@azure/core-rest-pipeline": "^1.5.0",
6161
"@azure/logger": "^1.0.0",
6262
"tslib": "^2.6.2",
63-
"@azure/core-lro": "^2.5.4",
64-
"@azure/abort-controller": "^1.0.0"
63+
"@azure/core-lro": "3.0.0-beta.1",
64+
"@azure/abort-controller": "^2.0.0"
6565
},
6666
"devDependencies": {
6767
"dotenv": "^16.0.0",
@@ -115,7 +115,21 @@
115115
"azure"
116116
],
117117
"disableDocsMs": true,
118-
"apiRefLink": "https://aka.ms/azsdk-javascript-face-ref"
118+
"apiRefLink": "https://aka.ms/azsdk-javascript-face-ref",
119+
"extraFiles": {
120+
"./samples-dev/data/detection1.jpg": [
121+
"javascript/data/detection1.jpg",
122+
"typescript/src/data/detection1.jpg"
123+
],
124+
"./samples-dev/data/detection5.jpg": [
125+
"javascript/data/detection5.jpg",
126+
"typescript/src/data/detection5.jpg"
127+
],
128+
"./samples-dev/data/nine-faces.png": [
129+
"javascript/data/nine-faces.png",
130+
"typescript/src/data/nine-faces.png"
131+
]
132+
}
119133
},
120134
"exports": {
121135
"./package.json": "./package.json",

sdk/face/ai-vision-face-rest/review/ai-vision-face.api.md

Lines changed: 125 additions & 112 deletions
Large diffs are not rendered by default.

sdk/face/ai-vision-face-rest/src/clientDefinitions.ts

Lines changed: 657 additions & 656 deletions
Large diffs are not rendered by default.

sdk/face/ai-vision-face-rest/src/faceClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ export default function createClient(
5353
name: "VerifyImageFilenamePolicy",
5454
sendRequest: (request, next) => {
5555
for (const part of request.multipartBody?.parts ?? []) {
56-
if (part.headers.get("content-disposition")?.includes(`name="VerifyImage"`)) {
56+
const contentDisposition = part.headers.get("content-disposition");
57+
if (
58+
contentDisposition &&
59+
contentDisposition.includes(`name="VerifyImage"`) &&
60+
!contentDisposition.includes("filename=")
61+
) {
5762
part.headers.set("content-disposition", `form-data; name="VerifyImage"; filename="blob"`);
5863
}
5964
}

0 commit comments

Comments
 (0)