Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b368490

Browse files
authored
Fix agent-string in packages migrated to use core v2 (Azure#16628)
* [Text Analytics] Update user-agent * Fix all other packages * revert change in kv-admin * add SDK_VERSION back in package.json for kv-admin
1 parent a77a09b commit b368490

File tree

12 files changed

+27
-69
lines changed

12 files changed

+27
-69
lines changed

sdk/eventgrid/eventgrid/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"prefix": "package-version"
5151
},
5252
{
53-
"path": "src/constants.ts",
54-
"prefix": "SDK_VERSION"
53+
"path": "src/generated/generatedClientContext.ts",
54+
"prefix": "packageDetails"
5555
}
5656
]
5757
},
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
export const SDK_VERSION: string = "4.4.1";
54
export const DEFAULT_API_VERSION = "2018-01-01";
65
export const DEFAULT_EVENTGRID_SCOPE = "https://eventgrid.azure.net/.default";

sdk/eventgrid/eventgrid/src/eventGridClient.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isTokenCredential, KeyCredential, SASCredential } from "@azure/core-aut
55
import { OperationOptions, CommonClientOptions } from "@azure/core-client";
66

77
import { eventGridCredentialPolicy } from "./eventGridAuthenticationPolicy";
8-
import { SDK_VERSION, DEFAULT_EVENTGRID_SCOPE } from "./constants";
8+
import { DEFAULT_EVENTGRID_SCOPE } from "./constants";
99
import {
1010
SendCloudEventInput,
1111
SendEventGridEventInput,
@@ -109,20 +109,7 @@ export class EventGridPublisherClient<T extends InputSchema> {
109109
this.endpointUrl = endpointUrl;
110110
this.inputSchema = inputSchema;
111111

112-
const libInfo = `azsdk-js-eventgrid/${SDK_VERSION}`;
113-
const pipelineOptions = { ...options };
114-
115-
if (!pipelineOptions.userAgentOptions) {
116-
pipelineOptions.userAgentOptions = {};
117-
}
118-
119-
if (pipelineOptions.userAgentOptions.userAgentPrefix) {
120-
pipelineOptions.userAgentOptions.userAgentPrefix = `${pipelineOptions.userAgentOptions.userAgentPrefix} ${libInfo}`;
121-
} else {
122-
pipelineOptions.userAgentOptions.userAgentPrefix = libInfo;
123-
}
124-
125-
this.client = new GeneratedClient(pipelineOptions);
112+
this.client = new GeneratedClient(options);
126113

127114
const authPolicy = isTokenCredential(credential)
128115
? bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_EVENTGRID_SCOPE })

sdk/keyvault/keyvault-admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"constantPaths": [
7676
{
7777
"path": "src/generated/keyVaultClientContext.ts",
78-
"prefix": "packageVersion"
78+
"prefix": "packageDetails"
7979
},
8080
{
8181
"path": "src/constants.ts",

sdk/keyvault/keyvault-admin/src/accessControlClient.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
DeleteRoleDefinitionOptions
2727
} from "./accessControlModels";
2828

29-
import { SDK_VERSION, LATEST_API_VERSION, authenticationScopes } from "./constants";
29+
import { LATEST_API_VERSION, authenticationScopes } from "./constants";
3030
import { mappings } from "./mappings";
3131
import { logger } from "./log";
3232
import { v4 as v4uuid } from "uuid";
@@ -76,17 +76,6 @@ export class KeyVaultAccessControlClient {
7676
) {
7777
this.vaultUrl = vaultUrl;
7878

79-
const libInfo = `azsdk-js-keyvault-admin/${SDK_VERSION}`;
80-
81-
const userAgentOptions = options.userAgentOptions;
82-
83-
options.userAgentOptions = {
84-
userAgentPrefix:
85-
userAgentOptions && userAgentOptions.userAgentPrefix
86-
? `${userAgentOptions.userAgentPrefix} ${libInfo}`
87-
: libInfo
88-
};
89-
9079
const serviceVersion = options.serviceVersion || LATEST_API_VERSION;
9180

9281
const clientOptions = {

sdk/keyvault/keyvault-admin/src/backupClient.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
KeyVaultRestoreResult,
1414
KeyVaultSelectiveKeyRestoreResult
1515
} from "./backupClientModels";
16-
import { LATEST_API_VERSION, SDK_VERSION, authenticationScopes } from "./constants";
16+
import { LATEST_API_VERSION, authenticationScopes } from "./constants";
1717
import { logger } from "./log";
1818
import { KeyVaultBackupPoller } from "./lro/backup/poller";
1919
import { KeyVaultRestorePoller } from "./lro/restore/poller";
@@ -76,17 +76,6 @@ export class KeyVaultBackupClient {
7676
) {
7777
this.vaultUrl = vaultUrl;
7878

79-
const libInfo = `azsdk-js-keyvault-admin/${SDK_VERSION}`;
80-
81-
const userAgentOptions = options.userAgentOptions;
82-
83-
options.userAgentOptions = {
84-
userAgentPrefix:
85-
userAgentOptions && userAgentOptions.userAgentPrefix
86-
? `${userAgentOptions.userAgentPrefix} ${libInfo}`
87-
: libInfo
88-
};
89-
9079
const apiVersion = options.serviceVersion || LATEST_API_VERSION;
9180

9281
const clientOptions = {

sdk/remoterendering/mixed-reality-remote-rendering/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"//metadata": {
1313
"constantPaths": [
1414
{
15-
"path": "src/generated/generatedClientContext.ts",
16-
"prefix": "packageVersion"
15+
"path": "swagger/README.md",
16+
"prefix": "package-version"
1717
},
1818
{
19-
"path": "src/constants.ts",
20-
"prefix": "SDK_VERSION"
19+
"path": "src/generated/generatedClientContext.ts",
20+
"prefix": "packageDetails"
2121
}
2222
]
2323
},

sdk/schemaregistry/schema-registry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"constantPaths": [
4444
{
4545
"path": "src/generated/generatedSchemaRegistryClientContext.ts",
46-
"prefix": "packageVersion"
46+
"prefix": "packageDetails"
4747
},
4848
{
4949
"path": "swagger/README.md",

sdk/textanalytics/ai-text-analytics/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"constantPaths": [
3333
{
3434
"path": "src/generated/generatedClientContext.ts",
35-
"prefix": "packageVersion"
35+
"prefix": "packageDetails"
3636
},
3737
{
38-
"path": "src/constants.ts",
39-
"prefix": "SDK_VERSION"
38+
"path": "swagger/README.md",
39+
"prefix": "package-version"
4040
}
4141
]
4242
},

sdk/textanalytics/ai-text-analytics/src/constants.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)