Skip to content

Commit 4fede11

Browse files
author
SDKAuto
committed
CodeGen from PR 3482 in test-repo-billy/azure-rest-api-specs
Merge 6c7f4231c72f34d93168540dea930f470444330e into 2b91022c223ed3618c268c750f831b76fe0f4fb5
1 parent 6036699 commit 4fede11

28 files changed

+2022
-404
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 442 additions & 400 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rush.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* This is the main configuration file for Rush.
33
* For full documentation, please see https://rushjs.io
4-
*/ {
4+
*/{
55
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
66
/**
77
* (Required) This specifies the version of the Rush engine to be used in this repo.
@@ -570,7 +570,9 @@
570570
"projectFolder": "common/tools/dev-tool",
571571
"versionPolicyName": "utility",
572572
// Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency.
573-
"decoupledLocalDependencies": ["@azure/identity"]
573+
"decoupledLocalDependencies": [
574+
"@azure/identity"
575+
]
574576
},
575577
{
576578
"packageName": "@azure/eventgrid",
@@ -610,7 +612,9 @@
610612
{
611613
"packageName": "@azure/identity",
612614
"projectFolder": "sdk/identity/identity",
613-
"decoupledLocalDependencies": ["@azure/keyvault-keys"],
615+
"decoupledLocalDependencies": [
616+
"@azure/keyvault-keys"
617+
],
614618
"versionPolicyName": "client"
615619
},
616620
{
@@ -2267,6 +2271,11 @@
22672271
"packageName": "@azure-rest/batch",
22682272
"projectFolder": "sdk/batch/batch-rest",
22692273
"versionPolicyName": "client"
2274+
},
2275+
{
2276+
"packageName": "@azure-rest/livemetrics-rest",
2277+
"projectFolder": "sdk/applicationinsights.livemetrics/livemetrics-rest",
2278+
"versionPolicyName": "client"
22702279
}
22712280
]
2272-
}
2281+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
2+
3+
trigger:
4+
branches:
5+
include:
6+
- main
7+
- feature/*
8+
- release/*
9+
- hotfix/*
10+
exclude:
11+
- feature/v4
12+
paths:
13+
include:
14+
- sdk/applicationinsights.livemetrics/
15+
pr:
16+
branches:
17+
include:
18+
- main
19+
- feature/*
20+
- release/*
21+
- hotfix/*
22+
exclude:
23+
- feature/v4
24+
paths:
25+
include:
26+
- sdk/applicationinsights.livemetrics/
27+
extends:
28+
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
29+
parameters:
30+
ServiceDirectory: applicationinsights.livemetrics
31+
Artifacts:
32+
- name: azure-rest-livemetrics-rest
33+
safeName: azurerestlivemetricsrest
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0-beta.1 (2024-09-02)
2+
3+
- Initial Release
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 Microsoft
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Azure LiveMetrics REST client library for JavaScript
2+
3+
Live Metrics REST APIs.
4+
5+
**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
6+
7+
Key links:
8+
9+
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/livemetrics-rest)
10+
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/livemetrics-rest?view=azure-node-preview)
11+
12+
## Getting started
13+
14+
### Currently supported environments
15+
16+
- LTS versions of Node.js
17+
18+
### Prerequisites
19+
20+
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
21+
22+
### Install the `@azure-rest/livemetrics-rest` package
23+
24+
Install the Azure LiveMetrics REST client REST client library for JavaScript with `npm`:
25+
26+
```bash
27+
npm install @azure-rest/livemetrics-rest
28+
```
29+
30+
### Create and authenticate a `LiveMetricsClient`
31+
32+
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
33+
provide an instance of the desired credential type obtained from the
34+
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
35+
36+
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
37+
38+
After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
39+
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
40+
can be used to authenticate the client.
41+
42+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
43+
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
44+
45+
## Troubleshooting
46+
47+
### Logging
48+
49+
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`:
50+
51+
```javascript
52+
const { setLogLevel } = require("@azure/logger");
53+
54+
setLogLevel("info");
55+
```
56+
57+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
4+
"docModel": {
5+
"enabled": true
6+
},
7+
"apiReport": {
8+
"enabled": true,
9+
"reportFolder": "./review"
10+
},
11+
"dtsRollup": {
12+
"enabled": true,
13+
"untrimmedFilePath": "",
14+
"publicTrimmedFilePath": "./types/livemetrics-rest.d.ts"
15+
},
16+
"messages": {
17+
"tsdocMessageReporting": {
18+
"default": {
19+
"logLevel": "none"
20+
}
21+
},
22+
"extractorMessageReporting": {
23+
"ae-missing-release-tag": {
24+
"logLevel": "none"
25+
},
26+
"ae-unresolved-link": {
27+
"logLevel": "none"
28+
}
29+
}
30+
}
31+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
2+
3+
export default [
4+
...azsdkEslint.configs.recommended,
5+
{
6+
rules: {
7+
"@azure/azure-sdk/ts-modules-only-named": "warn",
8+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
9+
"@azure/azure-sdk/ts-package-json-types": "warn",
10+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
11+
"@azure/azure-sdk/ts-package-json-module": "off",
12+
"@azure/azure-sdk/ts-package-json-files-required": "off",
13+
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
14+
"tsdoc/syntax": "warn"
15+
}
16+
}
17+
];
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"name": "@azure-rest/livemetrics-rest",
3+
"version": "1.0.0-beta.1",
4+
"description": "LiveMetrics Service",
5+
"engines": {
6+
"node": ">=18.0.0"
7+
},
8+
"sideEffects": false,
9+
"autoPublish": false,
10+
"tshy": {
11+
"exports": {
12+
"./package.json": "./package.json",
13+
".": "./src/index.ts"
14+
},
15+
"dialects": [
16+
"esm",
17+
"commonjs"
18+
],
19+
"esmDialects": [
20+
"browser",
21+
"react-native"
22+
],
23+
"selfLink": false
24+
},
25+
"type": "module",
26+
"keywords": [
27+
"node",
28+
"azure",
29+
"cloud",
30+
"typescript",
31+
"browser",
32+
"isomorphic"
33+
],
34+
"author": "Microsoft Corporation",
35+
"license": "MIT",
36+
"files": [
37+
"dist",
38+
"README.md",
39+
"LICENSE",
40+
"review/*",
41+
"CHANGELOG.md"
42+
],
43+
"sdk-type": "client",
44+
"repository": "github:Azure/azure-sdk-for-js",
45+
"bugs": {
46+
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
47+
},
48+
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
49+
"//metadata": {
50+
"constantPaths": [
51+
{
52+
"path": "src/liveMetricsClient.ts",
53+
"prefix": "userAgentInfo"
54+
}
55+
]
56+
},
57+
"dependencies": {
58+
"@azure-rest/core-client": "^2.1.0",
59+
"@azure/core-auth": "^1.6.0",
60+
"@azure/core-rest-pipeline": "^1.5.0",
61+
"@azure/logger": "^1.0.0",
62+
"tslib": "^2.6.2"
63+
},
64+
"devDependencies": {
65+
"dotenv": "^16.0.0",
66+
"@microsoft/api-extractor": "^7.40.3",
67+
"@types/node": "^18.0.0",
68+
"eslint": "^8.55.0",
69+
"prettier": "^3.2.5",
70+
"rimraf": "^5.0.5",
71+
"mkdirp": "^3.0.1",
72+
"typescript": "~5.5.3",
73+
"tshy": "^1.11.1",
74+
"@azure/core-util": "^1.0.0",
75+
"@azure/identity": "^4.2.1",
76+
"@vitest/browser": "^2.0.5",
77+
"@vitest/coverage-istanbul": "^2.0.5",
78+
"playwright": "^1.41.2",
79+
"vitest": "^2.0.5",
80+
"@azure-tools/test-credential": "^2.0.0",
81+
"@azure-tools/test-recorder": "^4.0.0",
82+
"@azure/dev-tool": "^1.0.0",
83+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
84+
},
85+
"scripts": {
86+
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
87+
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
88+
"pack": "npm pack 2>&1",
89+
"lint": "eslint package.json api-extractor.json src test",
90+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
91+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
92+
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
93+
"unit-test:node": "dev-tool run test:vitest",
94+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
95+
"integration-test:browser": "echo skipped",
96+
"integration-test:node": "echo skipped",
97+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
98+
"build:samples": "dev-tool samples publish --force",
99+
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
100+
"execute:samples": "dev-tool samples run samples-dev",
101+
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
102+
"generate:client": "echo skipped",
103+
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
104+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
105+
"build:test": "npm run clean && tshy && dev-tool run build-test",
106+
"build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api",
107+
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
108+
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
109+
},
110+
"//sampleConfiguration": {
111+
"productName": "@azure-rest/livemetrics-rest",
112+
"productSlugs": [
113+
"azure"
114+
],
115+
"disableDocsMs": true,
116+
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/livemetrics-rest?view=azure-node-preview"
117+
},
118+
"exports": {
119+
"./package.json": "./package.json",
120+
".": {
121+
"browser": {
122+
"source": "./src/index.ts",
123+
"types": "./dist/browser/index.d.ts",
124+
"default": "./dist/browser/index.js"
125+
},
126+
"react-native": {
127+
"source": "./src/index.ts",
128+
"types": "./dist/react-native/index.d.ts",
129+
"default": "./dist/react-native/index.js"
130+
},
131+
"import": {
132+
"source": "./src/index.ts",
133+
"types": "./dist/esm/index.d.ts",
134+
"default": "./dist/esm/index.js"
135+
},
136+
"require": {
137+
"source": "./src/index.ts",
138+
"types": "./dist/commonjs/index.d.ts",
139+
"default": "./dist/commonjs/index.js"
140+
}
141+
}
142+
},
143+
"main": "./dist/commonjs/index.js",
144+
"types": "./dist/commonjs/index.d.ts"
145+
}

0 commit comments

Comments
 (0)