-
Notifications
You must be signed in to change notification settings - Fork 80
Fix the missing parameters in operation options #3502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
de33d4d
fix issue #3501
v-jiaodi a8854e1
add ut
v-jiaodi c641610
update
v-jiaodi f872279
revert change
v-jiaodi 8b5e60d
update
v-jiaodi 186def8
format
v-jiaodi bfcdc50
update ut
v-jiaodi 98ab867
revert
v-jiaodi f7ae32c
fix
v-jiaodi 52cd265
Merge branch 'main' into test-issue3501
MaryGao 00ba86d
Update the test cases and remove useless codes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/typespec-test/test/testOperation/generated/typespec-ts/LICENSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| MIT License | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
70 changes: 70 additions & 0 deletions
70
packages/typespec-test/test/testOperation/generated/typespec-ts/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Azure KeyVault client library for JavaScript | ||
|
|
||
| This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure KeyVault client. | ||
|
|
||
| Azure Key Vault Secrets | ||
|
|
||
| Key links: | ||
|
|
||
| - [Package (NPM)](https://www.npmjs.com/package/@azure/keyvault-secrets) | ||
| - [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/keyvault-secrets?view=azure-node-preview) | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Currently supported environments | ||
|
|
||
| - [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) | ||
| - Latest versions of Safari, Chrome, Edge and Firefox. | ||
|
|
||
| See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - An [Azure subscription][azure_sub]. | ||
|
|
||
| ### Install the `@azure/keyvault-secrets` package | ||
|
|
||
| Install the Azure KeyVault client library for JavaScript with `npm`: | ||
|
|
||
| ```bash | ||
| npm install @azure/keyvault-secrets | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ### JavaScript Bundle | ||
| To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). | ||
|
|
||
| ## Key concepts | ||
|
|
||
| ### KeyVaultClient | ||
|
|
||
| `KeyVaultClient` is the primary interface for developers using the Azure KeyVault client library. Explore the methods on this client object to understand the different features of the Azure KeyVault service that you can access. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Logging | ||
|
|
||
| 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`: | ||
|
|
||
| ```ts | ||
| import { setLogLevel } from "@azure/logger"; | ||
|
|
||
| setLogLevel("info"); | ||
| ``` | ||
|
|
||
| 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). | ||
|
|
||
|
|
||
| ## Contributing | ||
|
|
||
| If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
|
|
||
| ## Related projects | ||
|
|
||
| - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) | ||
|
|
||
| [azure_sub]: https://azure.microsoft.com/free/ | ||
| [azure_portal]: https://portal.azure.com | ||
| [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity | ||
| [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential |
18 changes: 18 additions & 0 deletions
18
packages/typespec-test/test/testOperation/generated/typespec-ts/api-extractor.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "mainEntryPointFilePath": "dist/esm/index.d.ts", | ||
| "docModel": { "enabled": true }, | ||
| "apiReport": { "enabled": true, "reportFolder": "./review" }, | ||
| "dtsRollup": { | ||
| "enabled": true, | ||
| "untrimmedFilePath": "", | ||
| "publicTrimmedFilePath": "dist/keyvault-secrets.d.ts" | ||
| }, | ||
| "messages": { | ||
| "tsdocMessageReporting": { "default": { "logLevel": "none" } }, | ||
| "extractorMessageReporting": { | ||
| "ae-missing-release-tag": { "logLevel": "none" }, | ||
| "ae-unresolved-link": { "logLevel": "none" } | ||
| } | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
packages/typespec-test/test/testOperation/generated/typespec-ts/eslint.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; | ||
|
|
||
| export default azsdkEslint.config([ | ||
| { | ||
| rules: { | ||
| "@azure/azure-sdk/ts-modules-only-named": "warn", | ||
| "@azure/azure-sdk/ts-package-json-types": "warn", | ||
| "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", | ||
| "@azure/azure-sdk/ts-package-json-files-required": "off", | ||
| "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", | ||
| "tsdoc/syntax": "warn" | ||
| } | ||
| } | ||
| ]); |
113 changes: 113 additions & 0 deletions
113
packages/typespec-test/test/testOperation/generated/typespec-ts/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| { | ||
| "name": "@azure/keyvault-secrets", | ||
| "version": "1.0.0-beta.1", | ||
| "description": "Azure Key Vault Secrets", | ||
| "engines": { | ||
| "node": ">=20.0.0" | ||
| }, | ||
| "sideEffects": false, | ||
| "autoPublish": false, | ||
| "tshy": { | ||
| "exports": { | ||
| "./package.json": "./package.json", | ||
| ".": "./src/index.ts", | ||
| "./api": "./src/api/index.ts" | ||
| }, | ||
| "dialects": [ | ||
| "esm", | ||
| "commonjs" | ||
| ], | ||
| "esmDialects": [ | ||
| "browser", | ||
| "react-native" | ||
| ], | ||
| "selfLink": false | ||
| }, | ||
| "type": "module", | ||
| "browser": "./dist/browser/index.js", | ||
| "react-native": "./dist/react-native/index.js", | ||
| "keywords": [ | ||
| "node", | ||
| "azure", | ||
| "cloud", | ||
| "typescript", | ||
| "browser", | ||
| "isomorphic" | ||
| ], | ||
| "author": "Microsoft Corporation", | ||
| "license": "MIT", | ||
| "files": [ | ||
| "dist/", | ||
| "!dist/**/*.d.*ts.map", | ||
| "README.md", | ||
| "LICENSE" | ||
| ], | ||
| "dependencies": { | ||
| "@azure/core-util": "^1.9.2", | ||
| "@azure-rest/core-client": "^2.3.1", | ||
| "@azure/core-auth": "^1.6.0", | ||
| "@azure/core-rest-pipeline": "^1.5.0", | ||
| "@azure/logger": "^1.0.0", | ||
| "tslib": "^2.6.2" | ||
| }, | ||
| "devDependencies": { | ||
| "dotenv": "^16.0.0", | ||
| "@types/node": "^20.0.0", | ||
| "eslint": "^9.9.0", | ||
| "typescript": "~5.8.2", | ||
| "tshy": "^2.0.0", | ||
| "@microsoft/api-extractor": "^7.40.3", | ||
| "rimraf": "^5.0.5", | ||
| "mkdirp": "^3.0.1" | ||
| }, | ||
| "scripts": { | ||
| "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", | ||
| "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local", | ||
| "pack": "npm pack 2>&1", | ||
| "lint": "eslint package.json api-extractor.json src", | ||
| "lint:fix": "eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]", | ||
| "build": "npm run clean && tshy && npm run extract-api" | ||
| }, | ||
| "exports": { | ||
| "./package.json": "./package.json", | ||
| ".": { | ||
| "browser": { | ||
| "types": "./dist/browser/index.d.ts", | ||
| "default": "./dist/browser/index.js" | ||
| }, | ||
| "react-native": { | ||
| "types": "./dist/react-native/index.d.ts", | ||
| "default": "./dist/react-native/index.js" | ||
| }, | ||
| "import": { | ||
| "types": "./dist/esm/index.d.ts", | ||
| "default": "./dist/esm/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/commonjs/index.d.ts", | ||
| "default": "./dist/commonjs/index.js" | ||
| } | ||
| }, | ||
| "./api": { | ||
| "browser": { | ||
| "types": "./dist/browser/api/index.d.ts", | ||
| "default": "./dist/browser/api/index.js" | ||
| }, | ||
| "react-native": { | ||
| "types": "./dist/react-native/api/index.d.ts", | ||
| "default": "./dist/react-native/api/index.js" | ||
| }, | ||
| "import": { | ||
| "types": "./dist/esm/api/index.d.ts", | ||
| "default": "./dist/esm/api/index.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/commonjs/api/index.d.ts", | ||
| "default": "./dist/commonjs/api/index.js" | ||
| } | ||
| } | ||
| }, | ||
| "main": "./dist/commonjs/index.js", | ||
| "types": "./dist/commonjs/index.d.ts", | ||
| "module": "./dist/esm/index.js" | ||
| } |
28 changes: 28 additions & 0 deletions
28
...ec-test/test/testOperation/generated/typespec-ts/review/keyvault-secrets.api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ## API Report File for "@azure/keyvault-secrets" | ||
|
|
||
| > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
|
||
| ```ts | ||
|
|
||
| import { ClientOptions } from '@azure-rest/core-client'; | ||
| import { OperationOptions } from '@azure-rest/core-client'; | ||
| import { Pipeline } from '@azure/core-rest-pipeline'; | ||
|
|
||
| // @public | ||
| export interface GetSecretOptionalParams extends OperationOptions { | ||
| } | ||
|
|
||
| // @public (undocumented) | ||
| export class KeyVaultClient { | ||
| constructor(endpointParam: string, apiVersion: string, options?: KeyVaultClientOptionalParams); | ||
| getSecret(secretName: string, secretVersion: string, options?: GetSecretOptionalParams): Promise<void>; | ||
| readonly pipeline: Pipeline; | ||
| } | ||
|
|
||
| // @public | ||
| export interface KeyVaultClientOptionalParams extends ClientOptions { | ||
| } | ||
|
|
||
| // (No @packageDocumentation comment for this package) | ||
|
|
||
| ``` | ||
118 changes: 118 additions & 0 deletions
118
packages/typespec-test/test/testOperation/generated/typespec-ts/rollup.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import nodeResolve from "@rollup/plugin-node-resolve"; | ||
| import cjs from "@rollup/plugin-commonjs"; | ||
| import sourcemaps from "rollup-plugin-sourcemaps"; | ||
| import multiEntry from "@rollup/plugin-multi-entry"; | ||
| import json from "@rollup/plugin-json"; | ||
|
|
||
| import nodeBuiltins from "builtin-modules"; | ||
|
|
||
| // #region Warning Handler | ||
|
|
||
| /** | ||
| * A function that can determine whether a rollup warning should be ignored. If | ||
| * the function returns `true`, then the warning will not be displayed. | ||
| */ | ||
|
|
||
| function ignoreNiseSinonEval(warning) { | ||
| return ( | ||
| warning.code === "EVAL" && | ||
| warning.id && | ||
| (warning.id.includes("node_modules/nise") || | ||
| warning.id.includes("node_modules/sinon")) === true | ||
| ); | ||
| } | ||
|
|
||
| function ignoreChaiCircularDependency(warning) { | ||
| return ( | ||
| warning.code === "CIRCULAR_DEPENDENCY" && | ||
| warning.importer && | ||
| warning.importer.includes("node_modules/chai") === true | ||
| ); | ||
| } | ||
|
|
||
| const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; | ||
|
|
||
| /** | ||
| * Construct a warning handler for the shared rollup configuration | ||
| * that ignores certain warnings that are not relevant to testing. | ||
| */ | ||
| function makeOnWarnForTesting() { | ||
| return (warning, warn) => { | ||
| // If every inhibitor returns false (i.e. no inhibitors), then show the warning | ||
| if (warningInhibitors.every((inhib) => !inhib(warning))) { | ||
| warn(warning); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| // #endregion | ||
|
|
||
| function makeBrowserTestConfig() { | ||
| const config = { | ||
| input: { | ||
| include: ["dist-esm/test/**/*.spec.js"], | ||
| exclude: ["dist-esm/test/**/node/**"], | ||
| }, | ||
| output: { | ||
| file: `dist-test/index.browser.js`, | ||
| format: "umd", | ||
| sourcemap: true, | ||
| }, | ||
| preserveSymlinks: false, | ||
| plugins: [ | ||
| multiEntry({ exports: false }), | ||
| nodeResolve({ | ||
| mainFields: ["module", "browser"], | ||
| }), | ||
| cjs(), | ||
| json(), | ||
| sourcemaps(), | ||
| //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) | ||
| ], | ||
| onwarn: makeOnWarnForTesting(), | ||
| // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, | ||
| // rollup started respecting the "sideEffects" field in package.json. Since | ||
| // our package.json sets "sideEffects=false", this also applies to test | ||
| // code, which causes all tests to be removed by tree-shaking. | ||
| treeshake: false, | ||
| }; | ||
|
|
||
| return config; | ||
| } | ||
|
|
||
| const defaultConfigurationOptions = { | ||
| disableBrowserBundle: false, | ||
| }; | ||
|
|
||
| export function makeConfig(pkg, options) { | ||
| options = { | ||
| ...defaultConfigurationOptions, | ||
| ...(options || {}), | ||
| }; | ||
|
|
||
| const baseConfig = { | ||
| // Use the package's module field if it has one | ||
| input: pkg["module"] || "dist-esm/src/index.js", | ||
| external: [ | ||
| ...nodeBuiltins, | ||
| ...Object.keys(pkg.dependencies), | ||
| ...Object.keys(pkg.devDependencies), | ||
| ], | ||
| output: { file: "dist/index.js", format: "cjs", sourcemap: true }, | ||
| preserveSymlinks: false, | ||
| plugins: [sourcemaps(), nodeResolve()], | ||
| }; | ||
|
|
||
| const config = [baseConfig]; | ||
|
|
||
| if (!options.disableBrowserBundle) { | ||
| config.push(makeBrowserTestConfig()); | ||
| } | ||
|
|
||
| return config; | ||
| } | ||
|
|
||
| export default makeConfig(require("./package.json")); |
1 change: 1 addition & 0 deletions
1
packages/typespec-test/test/testOperation/generated/typespec-ts/sample.env
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Feel free to add your own environment variables. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-jiaodi Pls remove this smoke testing when you add relevant spector cases.