Skip to content

Commit 490d7d6

Browse files
author
azure-sdk
committed
[auto]create by sdk generation
1 parent c27b5a9 commit 490d7d6

24 files changed

+2231
-5
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 49 additions & 3 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.
@@ -1935,6 +1935,11 @@
19351935
"packageName": "@azure/arm-hybridcontainerservice",
19361936
"projectFolder": "sdk/hybridcontainerservice/arm-hybridcontainerservice",
19371937
"versionPolicyName": "management"
1938+
},
1939+
{
1940+
"packageName": "@azure-rest/confidentialledger-test",
1941+
"projectFolder": "sdk/confidentialledger/azure-confidentialledger-rest",
1942+
"versionPolicyName": "client"
19381943
}
19391944
]
1940-
}
1945+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0-beta.1 (2022-11-16)
2+
3+
- Initial Release
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Azure Confidential Ledger REST client library for JavaScript
2+
3+
Cadl Test Service
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/confidentialledger-test)
10+
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/confidentialledger-test?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/confidentialledger-test` package
23+
24+
Install the Azure Confidential Ledger REST client REST client library for JavaScript with `npm`:
25+
26+
```bash
27+
npm install @azure-rest/confidentialledger-test
28+
```
29+
30+
### Create and authenticate a `ConfidentialLedgerServiceClient`
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": "./types/src/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/confidentialledger-test.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: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// https://github.com/karma-runner/karma-chrome-launcher
2+
process.env.CHROME_BIN = require("puppeteer").executablePath();
3+
require("dotenv").config();
4+
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
5+
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
6+
7+
module.exports = function (config) {
8+
config.set({
9+
// base path that will be used to resolve all patterns (eg. files, exclude)
10+
basePath: "./",
11+
12+
// frameworks to use
13+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
14+
frameworks: ["source-map-support", "mocha"],
15+
16+
plugins: [
17+
"karma-mocha",
18+
"karma-mocha-reporter",
19+
"karma-chrome-launcher",
20+
"karma-edge-launcher",
21+
"karma-firefox-launcher",
22+
"karma-ie-launcher",
23+
"karma-env-preprocessor",
24+
"karma-coverage",
25+
"karma-sourcemap-loader",
26+
"karma-junit-reporter",
27+
"karma-source-map-support",
28+
],
29+
30+
// list of files / patterns to load in the browser
31+
files: [
32+
"dist-test/index.browser.js",
33+
{
34+
pattern: "dist-test/index.browser.js.map",
35+
type: "html",
36+
included: false,
37+
served: true,
38+
},
39+
],
40+
41+
// list of files / patterns to exclude
42+
exclude: [],
43+
44+
// preprocess matching files before serving them to the browser
45+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
46+
preprocessors: {
47+
"**/*.js": ["sourcemap", "env"],
48+
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
49+
// Preprocess source file to calculate code coverage, however this will make source file unreadable
50+
// "dist-test/index.js": ["coverage"]
51+
},
52+
53+
envPreprocessor: [
54+
"TEST_MODE",
55+
"ENDPOINT",
56+
"AZURE_CLIENT_SECRET",
57+
"AZURE_CLIENT_ID",
58+
"AZURE_TENANT_ID",
59+
"SUBSCRIPTION_ID",
60+
],
61+
62+
// test results reporter to use
63+
// possible values: 'dots', 'progress'
64+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
65+
reporters: ["mocha", "coverage", "junit"],
66+
67+
coverageReporter: {
68+
// specify a common output directory
69+
dir: "coverage-browser/",
70+
reporters: [
71+
{ type: "json", subdir: ".", file: "coverage.json" },
72+
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
73+
{ type: "html", subdir: "html" },
74+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
75+
],
76+
},
77+
78+
junitReporter: {
79+
outputDir: "", // results will be saved as $outputDir/$browserName.xml
80+
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
81+
suite: "", // suite will become the package name attribute in xml testsuite element
82+
useBrowserName: false, // add browser name to report and classes names
83+
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
84+
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
85+
properties: {}, // key value pair of properties to add to the <properties> section of the report
86+
},
87+
88+
// web server port
89+
port: 9876,
90+
91+
// enable / disable colors in the output (reporters and logs)
92+
colors: true,
93+
94+
// level of logging
95+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
96+
logLevel: config.LOG_INFO,
97+
98+
// enable / disable watching file and executing tests whenever any file changes
99+
autoWatch: false,
100+
101+
// --no-sandbox allows our tests to run in Linux without having to change the system.
102+
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
103+
browsers: ["ChromeHeadlessNoSandbox"],
104+
customLaunchers: {
105+
ChromeHeadlessNoSandbox: {
106+
base: "ChromeHeadless",
107+
flags: ["--no-sandbox", "--disable-web-security"],
108+
},
109+
},
110+
111+
// Continuous Integration mode
112+
// if true, Karma captures browsers, runs the tests and exits
113+
singleRun: false,
114+
115+
// Concurrency level
116+
// how many browser should be started simultaneous
117+
concurrency: 1,
118+
119+
browserNoActivityTimeout: 60000000,
120+
browserDisconnectTimeout: 10000,
121+
browserDisconnectTolerance: 3,
122+
123+
client: {
124+
mocha: {
125+
// change Karma's debug.html to the mocha web reporter
126+
reporter: "html",
127+
timeout: "600000",
128+
},
129+
},
130+
});
131+
};

0 commit comments

Comments
 (0)