Skip to content

Commit f3fdba7

Browse files
author
SDKAuto
committed
CodeGen from PR 14047 in Azure/azure-rest-api-specs
Merge f6c263ca47c9bba0d4d79bffb61086b05e6f1e1a into c555c1c8bc915132c6f3df485ea49c42765ef32a
1 parent 45c1fdf commit f3fdba7

File tree

12 files changed

+734
-1063
lines changed

12 files changed

+734
-1063
lines changed

sdk/signalr/arm-signalr/README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,27 @@ npm install @azure/arm-signalr
2020
##### Install @azure/ms-rest-nodeauth
2121

2222
- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
23-
2423
```bash
2524
npm install @azure/ms-rest-nodeauth@"^3.0.0"
2625
```
2726

2827
##### Sample code
2928

3029
While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
31-
3230
```typescript
3331
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
3432
const { SignalRManagementClient } = require("@azure/arm-signalr");
3533
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3634

37-
msRestNodeAuth
38-
.interactiveLogin()
39-
.then((creds) => {
40-
const client = new SignalRManagementClient(creds, subscriptionId);
41-
client.operations.list().then((result) => {
42-
console.log("The result is:");
43-
console.log(result);
44-
});
45-
})
46-
.catch((err) => {
47-
console.error(err);
35+
msRestNodeAuth.interactiveLogin().then((creds) => {
36+
const client = new SignalRManagementClient(creds, subscriptionId);
37+
client.operations.list().then((result) => {
38+
console.log("The result is:");
39+
console.log(result);
4840
});
41+
}).catch((err) => {
42+
console.error(err);
43+
});
4944
```
5045

5146
#### browser - Authentication, client creation and list operations as an example written in JavaScript.
@@ -61,7 +56,6 @@ npm install @azure/ms-rest-browserauth
6156
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
6257

6358
- index.html
64-
6559
```html
6660
<!DOCTYPE html>
6761
<html lang="en">
@@ -83,16 +77,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
8377
authManager.login();
8478
}
8579
const client = new Azure.ArmSignalr.SignalRManagementClient(res.creds, subscriptionId);
86-
client.operations
87-
.list()
88-
.then((result) => {
89-
console.log("The result is:");
90-
console.log(result);
91-
})
92-
.catch((err) => {
93-
console.log("An error occurred:");
94-
console.error(err);
95-
});
80+
client.operations.list().then((result) => {
81+
console.log("The result is:");
82+
console.log(result);
83+
}).catch((err) => {
84+
console.log("An error occurred:");
85+
console.error(err);
86+
});
9687
});
9788
</script>
9889
</head>

sdk/signalr/arm-signalr/rollup.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps";
77
*/
88
const config = {
99
input: "./esm/signalRManagementClient.js",
10-
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
10+
external: [
11+
"@azure/ms-rest-js",
12+
"@azure/ms-rest-azure-js"
13+
],
1114
output: {
1215
file: "./dist/arm-signalr.js",
1316
format: "umd",
@@ -25,7 +28,10 @@ const config = {
2528
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
2629
*/`
2730
},
28-
plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
31+
plugins: [
32+
nodeResolve({ mainFields: ['module', 'main'] }),
33+
sourcemaps()
34+
]
2935
};
3036

3137
export default config;

0 commit comments

Comments
 (0)