Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 21 additions & 38 deletions packages/@azure/applicationinsights-query/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
## An isomorphic javascript sdk for - ApplicationInsightsDataClient
# An isomorphic javascript sdk for - ApplicationInsightsDataClient
This project provides an isomorphic javascript package. Right now it supports:
- node.js version 6.x.x or higher
- browser javascript

This package contains an isomorphic SDK for ApplicationInsightsDataClient.

### Currently supported environments

- Node.js version 6.x.x or higher
- Browser JavaScript

### How to Install
## How to Install

- nodejs
```
npm install @azure/applicationinsights-query
```

### How to use

#### nodejs - Authentication, client creation and get metrics as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

```
npm install @azure/ms-rest-nodeauth
- browser
```html
<script type="text/javascript" src="@azure/applicationinsights-query/dist/applicationinsights-query.js"></script>
```

##### Sample code
## How to use

### nodejs - Authentication, client creation and get metrics as an example written in TypeScript.

```ts
import * as msRest from "@azure/ms-rest-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import * as msRest from "ms-rest-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { ApplicationInsightsDataClient, ApplicationInsightsDataModels, ApplicationInsightsDataMappers } from "@azure/applicationinsights-query";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

Expand All @@ -51,26 +44,16 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and get metrics as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

```
npm install @azure/ms-rest-browserauth
```

##### Sample code

See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
### browser - Authentication, client creation and get metrics as an example written in javascript.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/applicationinsights-query sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/applicationinsights-query/dist/applicationinsights-query.js"></script>
<script type="text/javascript">
const subscriptionId = "<Subscription_Id>";
Expand Down Expand Up @@ -103,10 +86,10 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
});
</script>
</head>
<body></body>
<body>
</body>
</html>
```

## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "./models";

const packageName = "@azure/applicationinsights-query";
Expand Down
6 changes: 3 additions & 3 deletions packages/@azure/applicationinsights-query/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import { ServiceClientOptions } from "@azure/ms-rest-js";
import * as msRest from "@azure/ms-rest-js";
import { ServiceClientOptions } from "ms-rest-js";
import * as msRest from "ms-rest-js";


/**
Expand Down Expand Up @@ -1259,7 +1259,7 @@ export interface EventsExceptionInfo {
*/
outerMethod?: string;
/**
* @member {string} [outerAssembly] The outer assmebly of the exception
* @member {string} [outerAssembly] The outer assembly of the exception
*/
outerAssembly?: string;
/**
Expand Down
12 changes: 11 additions & 1 deletion packages/@azure/applicationinsights-query/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";


export const MetricsPostBodySchemaParameters: msRest.CompositeMapper = {
Expand Down Expand Up @@ -729,6 +729,11 @@ export const EventsResults: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "type",
clientName: "type"
},
uberParent: "EventsResultData",
className: "EventsResultData"
}
}
Expand Down Expand Up @@ -760,6 +765,11 @@ export const EventsResult: msRest.CompositeMapper = {
serializedName: "value",
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "type",
clientName: "type"
},
uberParent: "EventsResultData",
className: "EventsResultData"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";

export const aggregation: msRest.OperationQueryParameter = {
parameterPath: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/eventsMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/metricsMappers";
import * as Parameters from "../models/parameters";
Expand Down Expand Up @@ -136,7 +136,7 @@ export class Metrics {

/**
* Gets metadata describing the available metrics
* @summary Retrieve metric metatadata
* @summary Retrieve metric metadata
* @param appId ID of the application. This is Application ID from the API Access settings blade in
* the Azure portal.
* @param [options] The optional parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/queryMappers";
import * as Parameters from "../models/parameters";
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/applicationinsights-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "ApplicationInsightsDataClient Library with typescript type definitions for node.js and browser.",
"version": "0.1.0",
"dependencies": {
"@azure/ms-rest-js": "^1.1.0",
"ms-rest-js": "^1.0.460",
"tslib": "^1.9.3"
},
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions packages/@azure/applicationinsights-query/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import nodeResolve from "rollup-plugin-node-resolve";
*/
const config = {
input: './esm/applicationInsightsDataClient.js',
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
external: ["ms-rest-js", "ms-rest-azure-js"],
output: {
file: "./dist/applicationinsights-query.js",
format: "umd",
name: "Azure.ApplicationinsightsQuery",
sourcemap: true,
globals: {
"@azure/ms-rest-js": "msRest",
"@azure/ms-rest-azure-js": "msRestAzure"
"ms-rest-js": "msRest",
"ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/applicationinsights-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"outDir": "./esm",
"importHelpers": true
},
"include": ["./lib/**/*.ts"],
"include": ["./lib/**/*"],
"exclude": ["node_modules"]
}