Skip to content

Commit 19be002

Browse files
authored
[mgmt] migrate mgmt package to esm 22 (#33037)
#32184 @azure/arm-storage @azure/arm-sqlvirtualmachine @azure/arm-sql @azure/arm-springappdiscovery @azure/arm-sphere
1 parent c3e4a5a commit 19be002

File tree

1,921 files changed

+7790
-10041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,921 files changed

+7790
-10041
lines changed

Diff for: common/config/rush/pnpm-lock.yaml

+140-65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: sdk/sphere/arm-sphere/README.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,28 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica
4848

4949
For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
5050

51-
```javascript
52-
const { AzureSphereManagementClient } = require("@azure/arm-sphere");
53-
const { DefaultAzureCredential } = require("@azure/identity");
54-
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
51+
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
52+
53+
```ts snippet:ReadmeSampleCreateClient_Node
54+
import { AzureSphereManagementClient } from "@azure/arm-sphere";
55+
import { DefaultAzureCredential } from "@azure/identity";
5556

5657
const subscriptionId = "00000000-0000-0000-0000-000000000000";
5758
const client = new AzureSphereManagementClient(new DefaultAzureCredential(), subscriptionId);
59+
```
60+
61+
For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
62+
63+
```ts snippet:ReadmeSampleCreateClient_Browser
64+
import { InteractiveBrowserCredential } from "@azure/identity";
65+
import { AzureSphereManagementClient } from "@azure/arm-sphere";
5866

59-
// For client-side applications running in the browser, use this code instead:
60-
// const credential = new InteractiveBrowserCredential({
61-
// tenantId: "<YOUR_TENANT_ID>",
62-
// clientId: "<YOUR_CLIENT_ID>"
63-
// });
64-
// const client = new AzureSphereManagementClient(credential, subscriptionId);
67+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
68+
const credential = new InteractiveBrowserCredential({
69+
tenantId: "<YOUR_TENANT_ID>",
70+
clientId: "<YOUR_CLIENT_ID>",
71+
});
72+
const client = new AzureSphereManagementClient(credential, subscriptionId);
6573
```
6674

6775
### JavaScript Bundle
@@ -80,8 +88,9 @@ To use this client library in the browser, first you need to use a bundler. For
8088

8189
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
8290

83-
```javascript
84-
const { setLogLevel } = require("@azure/logger");
91+
```ts snippet:SetLogLevel
92+
import { setLogLevel } from "@azure/logger";
93+
8594
setLogLevel("info");
8695
```
8796

Diff for: sdk/sphere/arm-sphere/api-extractor.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3-
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
3+
"mainEntryPointFilePath": "dist/esm/index.d.ts",
44
"docModel": {
55
"enabled": true
66
},
@@ -11,7 +11,7 @@
1111
"dtsRollup": {
1212
"enabled": true,
1313
"untrimmedFilePath": "",
14-
"publicTrimmedFilePath": "./types/arm-sphere.d.ts"
14+
"publicTrimmedFilePath": "dist/arm-sphere.d.ts"
1515
},
1616
"messages": {
1717
"tsdocMessageReporting": {
@@ -28,4 +28,4 @@
2828
}
2929
}
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)