Skip to content

Commit

Permalink
CodeGen from PR 14047 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge f6c263ca47c9bba0d4d79bffb61086b05e6f1e1a into c555c1c8bc915132c6f3df485ea49c42765ef32a
  • Loading branch information
SDKAuto committed Apr 23, 2021
1 parent 45c1fdf commit f3fdba7
Show file tree
Hide file tree
Showing 12 changed files with 734 additions and 1,063 deletions.
39 changes: 15 additions & 24 deletions sdk/signalr/arm-signalr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,27 @@ npm install @azure/arm-signalr
##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.

```bash
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```

##### Sample code

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

```typescript
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { SignalRManagementClient } = require("@azure/arm-signalr");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth
.interactiveLogin()
.then((creds) => {
const client = new SignalRManagementClient(creds, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
})
.catch((err) => {
console.error(err);
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new SignalRManagementClient(creds, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

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

- index.html

```html
<!DOCTYPE html>
<html lang="en">
Expand All @@ -83,16 +77,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
authManager.login();
}
const client = new Azure.ArmSignalr.SignalRManagementClient(res.creds, subscriptionId);
client.operations
.list()
.then((result) => {
console.log("The result is:");
console.log(result);
})
.catch((err) => {
console.log("An error occurred:");
console.error(err);
});
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
Expand Down
10 changes: 8 additions & 2 deletions sdk/signalr/arm-signalr/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps";
*/
const config = {
input: "./esm/signalRManagementClient.js",
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
external: [
"@azure/ms-rest-js",
"@azure/ms-rest-azure-js"
],
output: {
file: "./dist/arm-signalr.js",
format: "umd",
Expand All @@ -25,7 +28,10 @@ const config = {
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/`
},
plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
plugins: [
nodeResolve({ mainFields: ['module', 'main'] }),
sourcemaps()
]
};

export default config;
Loading

0 comments on commit f3fdba7

Please sign in to comment.