Skip to content

Commit 0903fbf

Browse files
author
SDKAuto
committed
CodeGen from PR 3421 in test-repo-billy/azure-rest-api-specs
Merge 6651cc7aa36b054765d54e0576c1fe371a1e5396 into 0bc7c1e79795562287755b516934c77fbc1e5759
1 parent 4aee463 commit 0903fbf

25 files changed

+3381
-399
lines changed

common/config/rush/pnpm-lock.yaml

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

rush.json

Lines changed: 7 additions & 2 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.
@@ -2256,6 +2256,11 @@
22562256
"packageName": "@azure/arm-redhatopenshift",
22572257
"projectFolder": "sdk/redhatopenshift/arm-redhatopenshift",
22582258
"versionPolicyName": "management"
2259+
},
2260+
{
2261+
"packageName": "@azure-rest/azure-apicenter-rest",
2262+
"projectFolder": "sdk/apicenter/azure-apicenter-rest",
2263+
"versionPolicyName": "management"
22592264
}
22602265
]
2261-
}
2266+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": ["@azure/azure-sdk"],
3+
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
4+
"rules": {
5+
"@azure/azure-sdk/ts-modules-only-named": "warn",
6+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
7+
"@azure/azure-sdk/ts-package-json-types": "warn",
8+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
9+
"tsdoc/syntax": "warn",
10+
"@azure/azure-sdk/ts-package-json-module": "off",
11+
"@azure/azure-sdk/ts-package-json-files-required": "off",
12+
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off"
13+
}
14+
}
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: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Azure DataApi REST client library for JavaScript
2+
3+
Data API introduces endpoints to manage your API Center resources.
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+
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/azure-apicenter-rest)
10+
- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/azure-apicenter-rest)
11+
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/azure-apicenter-rest?view=azure-node-preview)
12+
- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/azure-apicenter-rest/samples)
13+
14+
## Getting started
15+
16+
### Currently supported environments
17+
18+
- LTS versions of Node.js
19+
20+
### Prerequisites
21+
22+
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
23+
24+
### Install the `@azure-rest/azure-apicenter-rest` package
25+
26+
Install the Azure DataApi REST client REST client library for JavaScript with `npm`:
27+
28+
```bash
29+
npm install @azure-rest/azure-apicenter-rest
30+
```
31+
32+
### Create and authenticate a `DataApiClient`
33+
34+
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),
35+
provide an instance of the desired credential type obtained from the
36+
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
37+
38+
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
39+
40+
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.
41+
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
42+
can be used to authenticate the client.
43+
44+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
45+
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
46+
47+
## Troubleshooting
48+
49+
### Logging
50+
51+
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`:
52+
53+
```javascript
54+
const { setLogLevel } = require("@azure/logger");
55+
56+
setLogLevel("info");
57+
```
58+
59+
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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": { "enabled": true },
5+
"apiReport": { "enabled": true, "reportFolder": "./review" },
6+
"dtsRollup": {
7+
"enabled": true,
8+
"untrimmedFilePath": "",
9+
"publicTrimmedFilePath": "./types/azure-apicenter-rest.d.ts"
10+
},
11+
"messages": {
12+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
13+
"extractorMessageReporting": {
14+
"ae-missing-release-tag": { "logLevel": "none" },
15+
"ae-unresolved-link": { "logLevel": "none" }
16+
}
17+
}
18+
}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"name": "@azure-rest/azure-apicenter-rest",
3+
"version": "1.0.0-beta.1",
4+
"description": "azure.ApiCenter 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+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/azure-apicenter-rest/README.md",
49+
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
50+
"//metadata": {
51+
"constantPaths": [
52+
{
53+
"path": "src/dataApiClient.ts",
54+
"prefix": "userAgentInfo"
55+
}
56+
]
57+
},
58+
"dependencies": {
59+
"@azure-rest/core-client": "^2.1.0",
60+
"@azure/core-auth": "^1.6.0",
61+
"@azure/core-rest-pipeline": "^1.5.0",
62+
"@azure/logger": "^1.0.0",
63+
"tslib": "^2.6.2",
64+
"@azure/core-lro": "^3.0.0",
65+
"@azure/abort-controller": "^2.1.2",
66+
"@azure/core-paging": "^1.5.0"
67+
},
68+
"devDependencies": {
69+
"dotenv": "^16.0.0",
70+
"@microsoft/api-extractor": "^7.40.3",
71+
"@types/node": "^18.0.0",
72+
"eslint": "^8.55.0",
73+
"prettier": "^3.2.5",
74+
"rimraf": "^5.0.5",
75+
"mkdirp": "^3.0.1",
76+
"typescript": "~5.5.3",
77+
"tshy": "^1.11.1",
78+
"@azure/core-util": "^1.0.0",
79+
"@azure/identity": "^4.2.1",
80+
"@vitest/browser": "^1.3.1",
81+
"@vitest/coverage-istanbul": "^1.3.1",
82+
"playwright": "^1.41.2",
83+
"vitest": "^1.3.1",
84+
"@azure-tools/test-credential": "^2.0.0",
85+
"@azure-tools/test-recorder": "^4.0.0",
86+
"@azure/dev-tool": "^1.0.0",
87+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
88+
},
89+
"scripts": {
90+
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
91+
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
92+
"pack": "npm pack 2>&1",
93+
"lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts",
94+
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]",
95+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
96+
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
97+
"unit-test:node": "dev-tool run test:vitest",
98+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
99+
"integration-test:browser": "echo skipped",
100+
"integration-test:node": "echo skipped",
101+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
102+
"build:samples": "echo skipped",
103+
"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}\"",
104+
"execute:samples": "echo skipped",
105+
"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}\"",
106+
"generate:client": "echo skipped",
107+
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
108+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
109+
"build:test": "npm run clean && tshy && dev-tool run build-test",
110+
"build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api",
111+
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
112+
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
113+
},
114+
"exports": {
115+
"./package.json": "./package.json",
116+
".": {
117+
"browser": {
118+
"source": "./src/index.ts",
119+
"types": "./dist/browser/index.d.ts",
120+
"default": "./dist/browser/index.js"
121+
},
122+
"react-native": {
123+
"source": "./src/index.ts",
124+
"types": "./dist/react-native/index.d.ts",
125+
"default": "./dist/react-native/index.js"
126+
},
127+
"import": {
128+
"source": "./src/index.ts",
129+
"types": "./dist/esm/index.d.ts",
130+
"default": "./dist/esm/index.js"
131+
},
132+
"require": {
133+
"source": "./src/index.ts",
134+
"types": "./dist/commonjs/index.d.ts",
135+
"default": "./dist/commonjs/index.js"
136+
}
137+
}
138+
},
139+
"main": "./dist/commonjs/index.js",
140+
"types": "./dist/commonjs/index.d.ts",
141+
"module": "./dist/esm/index.js"
142+
}

0 commit comments

Comments
 (0)