diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 99371afd82ed..7152b3496525 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1027,6 +1027,9 @@ importers: '@rush-temp/microsoft-playwright-testing': specifier: file:./projects/microsoft-playwright-testing.tgz version: file:projects/microsoft-playwright-testing.tgz + '@rush-temp/microsoft-playwright-testing-1': + specifier: file:./projects/microsoft-playwright-testing-1.tgz + version: file:projects/microsoft-playwright-testing-1.tgz '@rush-temp/mixed-reality-authentication': specifier: file:./projects/mixed-reality-authentication.tgz version: file:projects/mixed-reality-authentication.tgz(msw@2.6.8(@types/node@20.17.10)(typescript@5.7.2))(vite@5.4.11(@types/node@20.17.10)) @@ -3798,8 +3801,12 @@ packages: resolution: {integrity: sha512-3L9N9SrTi+SdvxB/8TQWgZDIuBtS6ODj8qc+QNqdc5XyToQop38/Hh6GV+xVt+W28umT3ZufBQbz9dA5McL/6w==, tarball: file:projects/maps-search.tgz} version: 0.0.0 + '@rush-temp/microsoft-playwright-testing-1@file:projects/microsoft-playwright-testing-1.tgz': + resolution: {integrity: sha512-5pMd9f6kbssWluYnl7qlc1ZXVGfwajlUOoxy5KZLqviMW6seFL9M4B9Fn2abslxV30ktmlNl8AVxEkWXIaf23w==, tarball: file:projects/microsoft-playwright-testing-1.tgz} + version: 0.0.0 + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz': - resolution: {integrity: sha512-bFmkrsJp/HZb6jKwqpSlCfm1efwv6MAIGc7Pt4iALJeqOnqAcaCQLnj5BPyOrrdpPjX7hKThkWjjkyN5udRurQ==, tarball: file:projects/microsoft-playwright-testing.tgz} + resolution: {integrity: sha512-wvHwb9rhE6sSmjID/IjG495WjHR9/u6ZLBUu3TYTWnPvwECbMNDb4OI4B2b2d9Fm3Y8Tv2jXmzCLFzNp+NBCbw==, tarball: file:projects/microsoft-playwright-testing.tgz} version: 0.0.0 '@rush-temp/mixed-reality-authentication@file:projects/mixed-reality-authentication.tgz': @@ -18038,7 +18045,7 @@ snapshots: - vite - webdriverio - '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz': + '@rush-temp/microsoft-playwright-testing-1@file:projects/microsoft-playwright-testing-1.tgz': dependencies: '@playwright/test': 1.49.1 '@types/debug': 4.1.12 @@ -18054,6 +18061,18 @@ snapshots: - jiti - supports-color + '@rush-temp/microsoft-playwright-testing@file:projects/microsoft-playwright-testing.tgz': + dependencies: + '@microsoft/api-extractor': 7.48.0(@types/node@18.19.68) + '@types/node': 18.19.68 + dotenv: 16.4.7 + eslint: 9.16.0 + tslib: 2.8.1 + typescript: 5.6.3 + transitivePeerDependencies: + - jiti + - supports-color + '@rush-temp/mixed-reality-authentication@file:projects/mixed-reality-authentication.tgz(msw@2.6.8(@types/node@20.17.10)(typescript@5.7.2))(vite@5.4.11(@types/node@20.17.10))': dependencies: '@types/node': 18.19.68 @@ -20111,11 +20130,11 @@ snapshots: '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/bunyan@1.8.9': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/chai-as-promised@7.1.8': dependencies: @@ -20133,7 +20152,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/cookie@0.4.1': {} @@ -20141,7 +20160,7 @@ snapshots: '@types/cors@2.8.17': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/debug@4.1.12': dependencies: @@ -20149,7 +20168,7 @@ snapshots: '@types/decompress@4.2.7': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/deep-eql@4.0.2': {} @@ -20168,7 +20187,7 @@ snapshots: '@types/express-serve-static-core@4.19.6': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/qs': 6.9.17 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -20183,16 +20202,16 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/fs-extra@8.1.5': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/glob@7.2.0': dependencies: '@types/minimatch': 5.1.2 - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/http-errors@2.0.4': {} @@ -20203,21 +20222,21 @@ snapshots: '@types/is-buffer@2.0.2': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/json-schema@7.0.15': {} '@types/jsonfile@6.1.4': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/jsonwebtoken@9.0.7': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/jws@3.2.10': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/linkify-it@5.0.0': {} @@ -20246,11 +20265,11 @@ snapshots: '@types/mysql@2.15.26': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/node-fetch@2.6.12': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 form-data: 4.0.1 '@types/node@18.19.68': @@ -20271,7 +20290,7 @@ snapshots: '@types/pg@8.6.1': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 pg-protocol: 1.7.0 pg-types: 2.2.0 @@ -20288,7 +20307,7 @@ snapshots: '@types/readdir-glob@1.1.5': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/resolve@1.20.2': {} @@ -20299,12 +20318,12 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/send': 0.17.4 '@types/shimmer@1.2.0': {} @@ -20319,11 +20338,11 @@ snapshots: '@types/stoppable@1.1.3': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/through@0.0.33': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/tough-cookie@4.0.5': {} @@ -20339,11 +20358,11 @@ snapshots: '@types/ws@7.4.7': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/ws@8.5.13': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 '@types/yargs-parser@21.0.3': {} @@ -20353,7 +20372,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 18.19.68 + '@types/node': 20.17.10 optional: true '@typescript-eslint/eslint-plugin@8.16.0(@typescript-eslint/parser@8.16.0(eslint@9.16.0)(typescript@5.6.3))(eslint@9.16.0)(typescript@5.6.3)': @@ -21420,7 +21439,7 @@ snapshots: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 18.19.68 + '@types/node': 20.17.10 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 @@ -24370,7 +24389,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.6.3 + typescript: 5.7.2 walk-up-path: 3.0.1 tshy@2.0.1: @@ -24384,7 +24403,7 @@ snapshots: resolve-import: 1.4.6 rimraf: 5.0.10 sync-content: 1.0.2 - typescript: 5.6.3 + typescript: 5.7.2 walk-up-path: 3.0.1 tslib@2.8.1: {} diff --git a/rush.json b/rush.json index 56aacb0edf4d..714ce77ecdba 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -570,7 +570,9 @@ "projectFolder": "common/tools/dev-tool", "versionPolicyName": "utility", // Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency. - "decoupledLocalDependencies": ["@azure/identity"] + "decoupledLocalDependencies": [ + "@azure/identity" + ] }, { "packageName": "@azure/eventgrid", @@ -610,7 +612,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2317,6 +2321,11 @@ "packageName": "@azure/arm-connectedcache", "projectFolder": "sdk/connectedcache/arm-connectedcache", "versionPolicyName": "management" + }, + { + "packageName": "@azure-rest/microsoft-playwright-testing", + "projectFolder": "sdk/playwrighttesting/microsoft-playwright-testing-rest", + "versionPolicyName": "client" } ] -} +} \ No newline at end of file diff --git a/sdk/playwrighttesting/ci.yml b/sdk/playwrighttesting/ci.yml index dc38309f36e8..9e48e37cfaa3 100644 --- a/sdk/playwrighttesting/ci.yml +++ b/sdk/playwrighttesting/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -12,7 +12,6 @@ trigger: exclude: - sdk/playwrighttesting/ci.mgmt.yml - sdk/playwrighttesting/arm-playwrighttesting - pr: branches: include: @@ -20,13 +19,14 @@ pr: - feature/* - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/playwrighttesting/ exclude: - sdk/playwrighttesting/ci.mgmt.yml - sdk/playwrighttesting/arm-playwrighttesting - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -36,3 +36,5 @@ extends: safeName: azurecreatemicrosoftplaywrighttesting - name: azure-microsoft-playwright-testing safeName: azuremicrosoftplaywrighttesting + - name: azure-rest-microsoft-playwright-testing + safeName: azurerestmicrosoftplaywrighttesting diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/CHANGELOG.md b/sdk/playwrighttesting/microsoft-playwright-testing-rest/CHANGELOG.md new file mode 100644 index 000000000000..d55fc8bfce17 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0 (2024-12-12) + +### Features Added + +The package of @azure-rest/microsoft-playwright-testing is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/LICENSE b/sdk/playwrighttesting/microsoft-playwright-testing-rest/LICENSE new file mode 100644 index 000000000000..7d5934740965 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +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. \ No newline at end of file diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/README.md b/sdk/playwrighttesting/microsoft-playwright-testing-rest/README.md new file mode 100644 index 000000000000..74dc267775fa --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/README.md @@ -0,0 +1,55 @@ +# Azure Microsoft PlaywrightTesting AuthManager REST client library for JavaScript + +This package contains Microsoft Playwright Testing client library. + +**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** + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/microsoft-playwright-testing-rest) +- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/microsoft-playwright-testing) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/microsoft-playwright-testing) + +## Getting started + +### Currently supported environments + +- LTS versions of Node.js + +### Prerequisites + +- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package. + +### Install the `@azure-rest/microsoft-playwright-testing` package + +Install the Azure Microsoft PlaywrightTesting AuthManager REST client REST client library for JavaScript with `npm`: + +```bash +npm install @azure-rest/microsoft-playwright-testing +``` + +### Create and authenticate a `MicrosoftPlaywrightTestingClient` + +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), +provide an instance of the desired credential type obtained from the +[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library. + +To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) + +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. +As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential) +can be used to authenticate the client. + +## 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`: + +```javascript +const { setLogLevel } = require("@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). diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/api-extractor.json b/sdk/playwrighttesting/microsoft-playwright-testing-rest/api-extractor.json new file mode 100644 index 000000000000..345a226a604a --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$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": "./types/microsoft-playwright-testing.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/eslint.config.mjs b/sdk/playwrighttesting/microsoft-playwright-testing-rest/eslint.config.mjs new file mode 100644 index 000000000000..113bdc3eaf5f --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/eslint.config.mjs @@ -0,0 +1,17 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.configs.recommended, + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "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-module": "off", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/package.json b/sdk/playwrighttesting/microsoft-playwright-testing-rest/package.json new file mode 100644 index 000000000000..57d615f20509 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/package.json @@ -0,0 +1,120 @@ +{ + "name": "@azure-rest/microsoft-playwright-testing", + "version": "1.0.0", + "description": "This package contains Microsoft Playwright Testing client library.", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "type": "module", + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist", + "README.md", + "LICENSE", + "review/*", + "CHANGELOG.md" + ], + "sdk-type": "client", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/microsoft-playwright-testing-rest/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/microsoftPlaywrightTesting.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@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", + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "eslint": "^9.9.0", + "typescript": "~5.6.2", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" + }, + "scripts": { + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "build:samples": "echo skipped", + "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}\" ", + "execute:samples": "echo skipped", + "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}\" ", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "generate:client": "echo skipped", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "echo skipped" + }, + "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" + } + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts" +} \ No newline at end of file diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/review/microsoft-playwright-testing.api.md b/sdk/playwrighttesting/microsoft-playwright-testing-rest/review/microsoft-playwright-testing.api.md new file mode 100644 index 000000000000..c14cf82f5e79 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/review/microsoft-playwright-testing.api.md @@ -0,0 +1,518 @@ +## API Report File for "@azure-rest/microsoft-playwright-testing" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Client } from '@azure-rest/core-client'; +import { ClientOptions } from '@azure-rest/core-client'; +import { ErrorResponse } from '@azure-rest/core-client'; +import { HttpResponse } from '@azure-rest/core-client'; +import { PathUncheckedResponse } from '@azure-rest/core-client'; +import { RawHttpHeaders } from '@azure/core-rest-pipeline'; +import { RawHttpHeadersInput } from '@azure/core-rest-pipeline'; +import { RequestParameters } from '@azure-rest/core-client'; +import { StreamableMethod } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export interface AccessToken { + expiryAt: Date | string; + name: string; +} + +// @public +export interface AccessTokenOutput { + readonly createdAt: string; + expiryAt: string; + readonly id: string; + readonly jwtToken?: string; + name: string; + readonly state: AccessTokenStateOutput; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplace { + delete(options?: AccessTokensDeleteParameters): StreamableMethod; + get(options?: AccessTokensGetParameters): StreamableMethod; + put(options: AccessTokensCreateOrReplaceParameters): StreamableMethod; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplace200Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensCreateOrReplace200Response extends HttpResponse { + // (undocumented) + body: AccessTokenOutput; + // (undocumented) + headers: RawHttpHeaders & AccessTokensCreateOrReplace200Headers; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplace201Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensCreateOrReplace201Response extends HttpResponse { + // (undocumented) + body: AccessTokenOutput; + // (undocumented) + headers: RawHttpHeaders & AccessTokensCreateOrReplace201Headers; + // (undocumented) + status: "201"; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplaceBodyParam { + body: AccessToken; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplaceDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplaceDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccessTokensCreateOrReplaceDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplaceHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccessTokensCreateOrReplaceHeaders; +} + +// @public (undocumented) +export interface AccessTokensCreateOrReplaceHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccessTokensCreateOrReplaceParameters = AccessTokensCreateOrReplaceHeaderParam & AccessTokensCreateOrReplaceBodyParam & RequestParameters; + +// @public (undocumented) +export interface AccessTokensDelete204Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensDelete204Response extends HttpResponse { + // (undocumented) + headers: RawHttpHeaders & AccessTokensDelete204Headers; + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface AccessTokensDeleteDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccessTokensDeleteDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccessTokensDeleteDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccessTokensDeleteHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccessTokensDeleteHeaders; +} + +// @public (undocumented) +export interface AccessTokensDeleteHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccessTokensDeleteParameters = AccessTokensDeleteHeaderParam & RequestParameters; + +// @public (undocumented) +export interface AccessTokensGet200Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensGet200Response extends HttpResponse { + // (undocumented) + body: AccessTokenOutput; + // (undocumented) + headers: RawHttpHeaders & AccessTokensGet200Headers; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface AccessTokensGetDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccessTokensGetDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccessTokensGetDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccessTokensGetHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccessTokensGetHeaders; +} + +// @public (undocumented) +export interface AccessTokensGetHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccessTokensGetParameters = AccessTokensGetHeaderParam & RequestParameters; + +// @public (undocumented) +export interface AccessTokensList { + get(options?: AccessTokensListParameters): StreamableMethod; +} + +// @public (undocumented) +export interface AccessTokensList200Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensList200Response extends HttpResponse { + // (undocumented) + body: PagedAccessTokenOutput; + // (undocumented) + headers: RawHttpHeaders & AccessTokensList200Headers; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface AccessTokensListDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccessTokensListDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccessTokensListDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccessTokensListHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccessTokensListHeaders; +} + +// @public (undocumented) +export interface AccessTokensListHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccessTokensListParameters = AccessTokensListHeaderParam & RequestParameters; + +// @public +export type AccessTokenState = string; + +// @public +export type AccessTokenStateOutput = string; + +// @public (undocumented) +export interface AccessTokensValidate { + post(options?: AccessTokensValidateParameters): StreamableMethod; +} + +// @public (undocumented) +export interface AccessTokensValidate200Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccessTokensValidate200Response extends HttpResponse { + // (undocumented) + headers: RawHttpHeaders & AccessTokensValidate200Headers; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface AccessTokensValidateDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccessTokensValidateDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccessTokensValidateDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccessTokensValidateHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccessTokensValidateHeaders; +} + +// @public (undocumented) +export interface AccessTokensValidateHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccessTokensValidateParameters = AccessTokensValidateHeaderParam & RequestParameters; + +// @public +export interface AccountOutput { + readonly id: string; + readonly localAuth?: EnablementStatusOutput; + readonly location: string; + readonly name: string; + readonly regionalAffinity?: EnablementStatusOutput; + readonly reporting?: EnablementStatusOutput; + readonly resourceId: string; + readonly scalableExecution?: EnablementStatusOutput; + readonly state: AccountStateOutput; + readonly subscriptionId: string; + readonly subscriptionState: SubscriptionStateOutput; + readonly tenantId: string; +} + +// @public (undocumented) +export interface AccountsGet { + get(options?: AccountsGetParameters): StreamableMethod; +} + +// @public (undocumented) +export interface AccountsGet200Headers { + "x-ms-client-request-id"?: string; +} + +// @public +export interface AccountsGet200Response extends HttpResponse { + // (undocumented) + body: AccountOutput; + // (undocumented) + headers: RawHttpHeaders & AccountsGet200Headers; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface AccountsGetBrowsers { + get(options?: AccountsGetBrowsersParameters): StreamableMethod; +} + +// @public (undocumented) +export interface AccountsGetBrowsers302Headers { + "x-ms-client-request-id"?: string; + location: string; +} + +// @public +export interface AccountsGetBrowsers302Response extends HttpResponse { + // (undocumented) + headers: RawHttpHeaders & AccountsGetBrowsers302Headers; + // (undocumented) + status: "302"; +} + +// @public (undocumented) +export interface AccountsGetBrowsersDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccountsGetBrowsersDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccountsGetBrowsersDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccountsGetBrowsersHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccountsGetBrowsersHeaders; +} + +// @public (undocumented) +export interface AccountsGetBrowsersHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccountsGetBrowsersParameters = AccountsGetBrowsersQueryParam & AccountsGetBrowsersHeaderParam & RequestParameters; + +// @public (undocumented) +export interface AccountsGetBrowsersQueryParam { + // (undocumented) + queryParameters?: AccountsGetBrowsersQueryParamProperties; +} + +// @public (undocumented) +export interface AccountsGetBrowsersQueryParamProperties { + os?: Os; + runId?: string; +} + +// @public (undocumented) +export interface AccountsGetDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface AccountsGetDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & AccountsGetDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface AccountsGetHeaderParam { + // (undocumented) + headers?: RawHttpHeadersInput & AccountsGetHeaders; +} + +// @public (undocumented) +export interface AccountsGetHeaders { + "x-ms-client-request-id"?: string; +} + +// @public (undocumented) +export type AccountsGetParameters = AccountsGetHeaderParam & RequestParameters; + +// @public +export type AccountStateOutput = string; + +// @public +function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: MicrosoftPlaywrightTestingClientOptions): MicrosoftPlaywrightTestingClient; +export default createClient; + +// @public +export type EnablementStatusOutput = string; + +// @public +export type GetArrayType = T extends Array ? TData : never; + +// @public +export type GetPage = (pageLink: string) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +// @public (undocumented) +export function isUnexpected(response: AccessTokensCreateOrReplace200Response | AccessTokensCreateOrReplace201Response | AccessTokensCreateOrReplaceDefaultResponse): response is AccessTokensCreateOrReplaceDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccessTokensGet200Response | AccessTokensGetDefaultResponse): response is AccessTokensGetDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccessTokensDelete204Response | AccessTokensDeleteDefaultResponse): response is AccessTokensDeleteDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccessTokensList200Response | AccessTokensListDefaultResponse): response is AccessTokensListDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccessTokensValidate200Response | AccessTokensValidateDefaultResponse): response is AccessTokensValidateDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccountsGet200Response | AccountsGetDefaultResponse): response is AccountsGetDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: AccountsGetBrowsers302Response | AccountsGetBrowsersDefaultResponse): response is AccountsGetBrowsersDefaultResponse; + +// @public (undocumented) +export type MicrosoftPlaywrightTestingClient = Client & { + path: Routes; +}; + +// @public +export interface MicrosoftPlaywrightTestingClientOptions extends ClientOptions { + apiVersion?: string; +} + +// @public +export type Os = string; + +// @public +export interface PagedAccessTokenOutput { + nextLink?: string; + value: Array; +} + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public +export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; + +// @public +export type PaginateReturn = TResult extends { + body: { + value?: infer TPage; + }; +} ? GetArrayType : Array; + +// @public +export interface PagingOptions { + customGetPage?: GetPage[]>; +} + +// @public (undocumented) +export interface Routes { + (path: "/accounts/{accountId}/access-tokens/{accessTokenId}", accountId: string, accessTokenId: string): AccessTokensCreateOrReplace; + (path: "/accounts/{accountId}/access-tokens", accountId: string): AccessTokensList; + (path: "/accounts/{accountId}/access-tokens/validate", accountId: string): AccessTokensValidate; + (path: "/accounts/{accountId}", accountId: string): AccountsGet; + (path: "/accounts/{accountId}/browsers", accountId: string): AccountsGetBrowsers; +} + +// @public +export type SubscriptionStateOutput = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/sample.env b/sdk/playwrighttesting/microsoft-playwright-testing-rest/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/clientDefinitions.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/clientDefinitions.ts new file mode 100644 index 000000000000..c306ceb69769 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/clientDefinitions.ts @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + AccessTokensCreateOrReplaceParameters, + AccessTokensGetParameters, + AccessTokensDeleteParameters, + AccessTokensListParameters, + AccessTokensValidateParameters, + AccountsGetParameters, + AccountsGetBrowsersParameters, +} from "./parameters.js"; +import { + AccessTokensCreateOrReplace200Response, + AccessTokensCreateOrReplace201Response, + AccessTokensCreateOrReplaceDefaultResponse, + AccessTokensGet200Response, + AccessTokensGetDefaultResponse, + AccessTokensDelete204Response, + AccessTokensDeleteDefaultResponse, + AccessTokensList200Response, + AccessTokensListDefaultResponse, + AccessTokensValidate200Response, + AccessTokensValidateDefaultResponse, + AccountsGet200Response, + AccountsGetDefaultResponse, + AccountsGetBrowsers302Response, + AccountsGetBrowsersDefaultResponse, +} from "./responses.js"; +import { Client, StreamableMethod } from "@azure-rest/core-client"; + +export interface AccessTokensCreateOrReplace { + /** Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. */ + put( + options: AccessTokensCreateOrReplaceParameters, + ): StreamableMethod< + | AccessTokensCreateOrReplace200Response + | AccessTokensCreateOrReplace201Response + | AccessTokensCreateOrReplaceDefaultResponse + >; + /** Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. */ + get( + options?: AccessTokensGetParameters, + ): StreamableMethod< + AccessTokensGet200Response | AccessTokensGetDefaultResponse + >; + /** Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID. */ + delete( + options?: AccessTokensDeleteParameters, + ): StreamableMethod< + AccessTokensDelete204Response | AccessTokensDeleteDefaultResponse + >; +} + +export interface AccessTokensList { + /** Lists access-tokens for the given account id. Authorization required is Bearer JWT Access token provided by EntraID. */ + get( + options?: AccessTokensListParameters, + ): StreamableMethod< + AccessTokensList200Response | AccessTokensListDefaultResponse + >; +} + +export interface AccessTokensValidate { + /** Validates access-token provided in authorization header for the given account id. Authorization required is Bearer JWT Access token provided by MPT service. */ + post( + options?: AccessTokensValidateParameters, + ): StreamableMethod< + AccessTokensValidate200Response | AccessTokensValidateDefaultResponse + >; +} + +export interface AccountsGet { + /** Get details of the Azure resource mapped to an account for the given accountId. Authorization required is Bearer JWT Access token provided by EntraID. */ + get( + options?: AccountsGetParameters, + ): StreamableMethod; +} + +export interface AccountsGetBrowsers { + /** Gets remote browsers corresponding to given accountId and redirects the client for running MPT tests. Authorization required is Bearer JWT Access token provided by EntraID or MPT Service. */ + get( + options?: AccountsGetBrowsersParameters, + ): StreamableMethod< + AccountsGetBrowsers302Response | AccountsGetBrowsersDefaultResponse + >; +} + +export interface Routes { + /** Resource for '/accounts/\{accountId\}/access-tokens/\{accessTokenId\}' has methods for the following verbs: put, get, delete */ + ( + path: "/accounts/{accountId}/access-tokens/{accessTokenId}", + accountId: string, + accessTokenId: string, + ): AccessTokensCreateOrReplace; + /** Resource for '/accounts/\{accountId\}/access-tokens' has methods for the following verbs: get */ + ( + path: "/accounts/{accountId}/access-tokens", + accountId: string, + ): AccessTokensList; + /** Resource for '/accounts/\{accountId\}/access-tokens/validate' has methods for the following verbs: post */ + ( + path: "/accounts/{accountId}/access-tokens/validate", + accountId: string, + ): AccessTokensValidate; + /** Resource for '/accounts/\{accountId\}' has methods for the following verbs: get */ + (path: "/accounts/{accountId}", accountId: string): AccountsGet; + /** Resource for '/accounts/\{accountId\}/browsers' has methods for the following verbs: get */ + ( + path: "/accounts/{accountId}/browsers", + accountId: string, + ): AccountsGetBrowsers; +} + +export type MicrosoftPlaywrightTestingClient = Client & { + path: Routes; +}; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/index.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/index.ts new file mode 100644 index 000000000000..698c468b760d --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/index.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import MicrosoftPlaywrightTesting from "./microsoftPlaywrightTesting.js"; + +export * from "./microsoftPlaywrightTesting.js"; +export * from "./parameters.js"; +export * from "./responses.js"; +export * from "./clientDefinitions.js"; +export * from "./isUnexpected.js"; +export * from "./models.js"; +export * from "./outputModels.js"; +export * from "./paginateHelper.js"; + +export default MicrosoftPlaywrightTesting; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/isUnexpected.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/isUnexpected.ts new file mode 100644 index 000000000000..fd75d7fa3f1e --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/isUnexpected.ts @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + AccessTokensCreateOrReplace200Response, + AccessTokensCreateOrReplace201Response, + AccessTokensCreateOrReplaceDefaultResponse, + AccessTokensGet200Response, + AccessTokensGetDefaultResponse, + AccessTokensDelete204Response, + AccessTokensDeleteDefaultResponse, + AccessTokensList200Response, + AccessTokensListDefaultResponse, + AccessTokensValidate200Response, + AccessTokensValidateDefaultResponse, + AccountsGet200Response, + AccountsGetDefaultResponse, + AccountsGetBrowsers302Response, + AccountsGetBrowsersDefaultResponse, +} from "./responses.js"; + +const responseMap: Record = { + "PUT /accounts/{accountId}/access-tokens/{accessTokenId}": ["200", "201"], + "GET /accounts/{accountId}/access-tokens/{accessTokenId}": ["200"], + "DELETE /accounts/{accountId}/access-tokens/{accessTokenId}": ["204"], + "GET /accounts/{accountId}/access-tokens": ["200"], + "POST /accounts/{accountId}/access-tokens/validate": ["200"], + "GET /accounts/{accountId}": ["200"], + "GET /accounts/{accountId}/browsers": ["302"], +}; + +export function isUnexpected( + response: + | AccessTokensCreateOrReplace200Response + | AccessTokensCreateOrReplace201Response + | AccessTokensCreateOrReplaceDefaultResponse, +): response is AccessTokensCreateOrReplaceDefaultResponse; +export function isUnexpected( + response: AccessTokensGet200Response | AccessTokensGetDefaultResponse, +): response is AccessTokensGetDefaultResponse; +export function isUnexpected( + response: AccessTokensDelete204Response | AccessTokensDeleteDefaultResponse, +): response is AccessTokensDeleteDefaultResponse; +export function isUnexpected( + response: AccessTokensList200Response | AccessTokensListDefaultResponse, +): response is AccessTokensListDefaultResponse; +export function isUnexpected( + response: + | AccessTokensValidate200Response + | AccessTokensValidateDefaultResponse, +): response is AccessTokensValidateDefaultResponse; +export function isUnexpected( + response: AccountsGet200Response | AccountsGetDefaultResponse, +): response is AccountsGetDefaultResponse; +export function isUnexpected( + response: AccountsGetBrowsers302Response | AccountsGetBrowsersDefaultResponse, +): response is AccountsGetBrowsersDefaultResponse; +export function isUnexpected( + response: + | AccessTokensCreateOrReplace200Response + | AccessTokensCreateOrReplace201Response + | AccessTokensCreateOrReplaceDefaultResponse + | AccessTokensGet200Response + | AccessTokensGetDefaultResponse + | AccessTokensDelete204Response + | AccessTokensDeleteDefaultResponse + | AccessTokensList200Response + | AccessTokensListDefaultResponse + | AccessTokensValidate200Response + | AccessTokensValidateDefaultResponse + | AccountsGet200Response + | AccountsGetDefaultResponse + | AccountsGetBrowsers302Response + | AccountsGetBrowsersDefaultResponse, +): response is + | AccessTokensCreateOrReplaceDefaultResponse + | AccessTokensGetDefaultResponse + | AccessTokensDeleteDefaultResponse + | AccessTokensListDefaultResponse + | AccessTokensValidateDefaultResponse + | AccountsGetDefaultResponse + | AccountsGetBrowsersDefaultResponse { + const lroOriginal = response.headers["x-ms-original-url"]; + const url = new URL(lroOriginal ?? response.request.url); + const method = response.request.method; + let pathDetails = responseMap[`${method} ${url.pathname}`]; + if (!pathDetails) { + pathDetails = getParametrizedPathSuccess(method, url.pathname); + } + return !pathDetails.includes(response.status); +} + +function getParametrizedPathSuccess(method: string, path: string): string[] { + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(responseMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/logger.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/logger.ts new file mode 100644 index 000000000000..b0563a4bd7fd --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("microsoft-playwright-testing"); diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/microsoftPlaywrightTesting.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/microsoftPlaywrightTesting.ts new file mode 100644 index 000000000000..bf7ab65653a9 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/microsoftPlaywrightTesting.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger.js"; +import { TokenCredential } from "@azure/core-auth"; +import { MicrosoftPlaywrightTestingClient } from "./clientDefinitions.js"; + +/** The optional parameters for the client */ +export interface MicrosoftPlaywrightTestingClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `MicrosoftPlaywrightTestingClient` + * @param endpointParam - Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + * https://{region}.api.playwright.microsoft.com). + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ +export default function createClient( + endpointParam: string, + credentials: TokenCredential, + { + apiVersion = "2024-12-01", + ...options + }: MicrosoftPlaywrightTestingClientOptions = {}, +): MicrosoftPlaywrightTestingClient { + const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; + const userAgentInfo = `azsdk-js-microsoft-playwright-testing-rest/1.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` + : `${userAgentInfo}`; + options = { + ...options, + userAgentOptions: { + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://playwright.microsoft.com/.default", + ], + }, + }; + const client = getClient( + endpointUrl, + credentials, + options, + ) as MicrosoftPlaywrightTestingClient; + + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + + return client; +} diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/models.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/models.ts new file mode 100644 index 000000000000..b45103230dea --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/models.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** Model of an access-token linked to an account. */ +export interface AccessToken { + /** The access-token name. */ + name: string; + /** The access-token expiryAt utcDateTime. */ + expiryAt: Date | string; +} + +/** Alias for AccessTokenState */ +export type AccessTokenState = string; +/** Alias for Os */ +export type Os = string; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/outputModels.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/outputModels.ts new file mode 100644 index 000000000000..c2609b32848c --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/outputModels.ts @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** Model of an access-token linked to an account. */ +export interface AccessTokenOutput { + /** The access-token id. */ + readonly id: string; + /** The access-token name. */ + name: string; + /** The access-token value in JWT format. */ + readonly jwtToken?: string; + /** The access-token createdAt utcDateTime. */ + readonly createdAt: string; + /** The access-token expiryAt utcDateTime. */ + expiryAt: string; + /** + * The access-token state - Active | Expired. + * + * Possible values: "Active", "Expired" + */ + readonly state: AccessTokenStateOutput; +} + +/** Paged collection of AccessToken items */ +export interface PagedAccessTokenOutput { + /** The AccessToken items on this page */ + value: Array; + /** The link to the next page of items */ + nextLink?: string; +} + +/** An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource. */ +export interface AccountOutput { + /** The account id. */ + readonly id: string; + /** The fully-qualified Azure resource id for the account. */ + readonly resourceId: string; + /** The account name. */ + readonly name: string; + /** + * The state of account - Active | Inactive + * + * Possible values: "Active", "Inactive" + */ + readonly state: AccountStateOutput; + /** The Azure subscription id for the account. */ + readonly subscriptionId: string; + /** + * The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted + * + * Possible values: "Registered", "Warned", "Suspended", "Deleted", "Unregistered" + */ + readonly subscriptionState: SubscriptionStateOutput; + /** The Azure tenant id of the account. */ + readonly tenantId: string; + /** The account resource location in Azure, for eg. eastus, southeastasia. */ + readonly location: string; + /** + * This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created. + * + * Possible values: "Enabled", "Disabled" + */ + readonly regionalAffinity?: EnablementStatusOutput; + /** + * When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. + * + * Possible values: "Enabled", "Disabled" + */ + readonly scalableExecution?: EnablementStatusOutput; + /** + * When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. + * + * Possible values: "Enabled", "Disabled" + */ + readonly reporting?: EnablementStatusOutput; + /** + * When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations. + * + * Possible values: "Enabled", "Disabled" + */ + readonly localAuth?: EnablementStatusOutput; +} + +/** Alias for AccessTokenStateOutput */ +export type AccessTokenStateOutput = string; +/** Alias for AccountStateOutput */ +export type AccountStateOutput = string; +/** Alias for SubscriptionStateOutput */ +export type SubscriptionStateOutput = string; +/** Alias for EnablementStatusOutput */ +export type EnablementStatusOutput = string; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/paginateHelper.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/paginateHelper.ts new file mode 100644 index 000000000000..5ef95e5ea0a3 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/paginateHelper.ts @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings = PageSettings, + TLink = string, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator( + pagedResult, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + (((settings?: PageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken as unknown as TLink | undefined, + }); + }) as unknown as ( + settings?: TPageSettings, + ) => AsyncIterableIterator), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value) as TElement[]; + for await (const page of pages) { + yield* toElements(page) as TElement[]; + } + } else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages as unknown as AsyncIterableIterator; + } + } else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page as unknown as TElement[]; + } + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: TLink; + } = {}, +): AsyncIterableIterator { + const { pageLink } = options; + let response = await pagedResult.getPage( + pageLink ?? pagedResult.firstPageLink, + ); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + yield response.page; + } +} + +/** + * An interface that tracks the settings for paged iteration + */ +export interface PageSettings { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +} + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator< + TElement, + TPage, + TPageSettings + >; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator; +} + +/** + * An interface that describes how to communicate with the service. + */ +interface PagedResult { + /** + * Link to the first page of results. + */ + firstPageLink: TLink; + /** + * A method that returns a page of results. + */ + getPage: ( + pageLink: TLink, + ) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => unknown[]; +} + +/** + * Helper type to extract the type of an array + */ +export type GetArrayType = T extends Array ? TData : never; + +/** + * The type of a custom function that defines how to get a page and a link to the next one if any. + */ +export type GetPage = (pageLink: string) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +/** + * Options for the paging helper + */ +export interface PagingOptions { + /** + * Custom function to extract pagination details for crating the PagedAsyncIterableIterator + */ + customGetPage?: GetPage[]>; +} + +/** + * Helper type to infer the Type of the paged elements from the response type + * This type is generated based on the swagger information for x-ms-pageable + * specifically on the itemName property which indicates the property of the response + * where the page items are found. The default value is `value`. + * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter + */ +export type PaginateReturn = TResult extends { + body: { value?: infer TPage }; +} + ? GetArrayType + : Array; + +/** + * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension + * @param client - Client to use for sending the next page requests + * @param initialResponse - Initial response containing the nextLink and current page of elements + * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results + * @returns - PagedAsyncIterableIterator to iterate the elements + */ +export function paginate( + client: Client, + initialResponse: TResponse, + options: PagingOptions = {}, +): PagedAsyncIterableIterator> { + // Extract element type from initial response + type TElement = PaginateReturn; + let firstRun = true; + const itemName = "value"; + const nextLinkName = "nextLink"; + const { customGetPage } = options; + const pagedResult: PagedResult = { + firstPageLink: "", + getPage: + typeof customGetPage === "function" + ? customGetPage + : async (pageLink: string) => { + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); + firstRun = false; + checkPagingRequest(result); + const nextLink = getNextLink(result.body, nextLinkName); + const values = getElements(result.body, itemName); + return { + page: values, + nextPageLink: nextLink, + }; + }, + }; + + return getPagedAsyncIterator(pagedResult); +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + + // value has to be an array according to the x-ms-pageable extension. + // The fact that this must be an array is used above to calculate the + // type of elements in the page in PaginateReturn + if (!Array.isArray(value)) { + throw new Error( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse): void { + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; + if (!Http2xxStatusCodes.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/parameters.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/parameters.ts new file mode 100644 index 000000000000..55bf50960fd0 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/parameters.ts @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RawHttpHeadersInput } from "@azure/core-rest-pipeline"; +import { RequestParameters } from "@azure-rest/core-client"; +import { AccessToken, Os } from "./models.js"; + +export interface AccessTokensCreateOrReplaceHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccessTokensCreateOrReplaceBodyParam { + /** The resource instance. */ + body: AccessToken; +} + +export interface AccessTokensCreateOrReplaceHeaderParam { + headers?: RawHttpHeadersInput & AccessTokensCreateOrReplaceHeaders; +} + +export type AccessTokensCreateOrReplaceParameters = + AccessTokensCreateOrReplaceHeaderParam & + AccessTokensCreateOrReplaceBodyParam & + RequestParameters; + +export interface AccessTokensGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccessTokensGetHeaderParam { + headers?: RawHttpHeadersInput & AccessTokensGetHeaders; +} + +export type AccessTokensGetParameters = AccessTokensGetHeaderParam & + RequestParameters; + +export interface AccessTokensDeleteHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccessTokensDeleteHeaderParam { + headers?: RawHttpHeadersInput & AccessTokensDeleteHeaders; +} + +export type AccessTokensDeleteParameters = AccessTokensDeleteHeaderParam & + RequestParameters; + +export interface AccessTokensListHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccessTokensListHeaderParam { + headers?: RawHttpHeadersInput & AccessTokensListHeaders; +} + +export type AccessTokensListParameters = AccessTokensListHeaderParam & + RequestParameters; + +export interface AccessTokensValidateHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccessTokensValidateHeaderParam { + headers?: RawHttpHeadersInput & AccessTokensValidateHeaders; +} + +export type AccessTokensValidateParameters = AccessTokensValidateHeaderParam & + RequestParameters; + +export interface AccountsGetHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccountsGetHeaderParam { + headers?: RawHttpHeadersInput & AccountsGetHeaders; +} + +export type AccountsGetParameters = AccountsGetHeaderParam & RequestParameters; + +export interface AccountsGetBrowsersHeaders { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +export interface AccountsGetBrowsersQueryParamProperties { + /** The run id provided by client for corresponding remote test run. */ + runId?: string; + /** + * The os provided by client for remote test runs. + * + * Possible values: "linux", "windows" + */ + os?: Os; +} + +export interface AccountsGetBrowsersQueryParam { + queryParameters?: AccountsGetBrowsersQueryParamProperties; +} + +export interface AccountsGetBrowsersHeaderParam { + headers?: RawHttpHeadersInput & AccountsGetBrowsersHeaders; +} + +export type AccountsGetBrowsersParameters = AccountsGetBrowsersQueryParam & + AccountsGetBrowsersHeaderParam & + RequestParameters; diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/responses.ts b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/responses.ts new file mode 100644 index 000000000000..c89267b8fca2 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/src/responses.ts @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; +import { HttpResponse, ErrorResponse } from "@azure-rest/core-client"; +import { + AccessTokenOutput, + PagedAccessTokenOutput, + AccountOutput, +} from "./outputModels.js"; + +export interface AccessTokensCreateOrReplace200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface AccessTokensCreateOrReplace200Response extends HttpResponse { + status: "200"; + body: AccessTokenOutput; + headers: RawHttpHeaders & AccessTokensCreateOrReplace200Headers; +} + +export interface AccessTokensCreateOrReplace201Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface AccessTokensCreateOrReplace201Response extends HttpResponse { + status: "201"; + body: AccessTokenOutput; + headers: RawHttpHeaders & AccessTokensCreateOrReplace201Headers; +} + +export interface AccessTokensCreateOrReplaceDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccessTokensCreateOrReplaceDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccessTokensCreateOrReplaceDefaultHeaders; +} + +export interface AccessTokensGet200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface AccessTokensGet200Response extends HttpResponse { + status: "200"; + body: AccessTokenOutput; + headers: RawHttpHeaders & AccessTokensGet200Headers; +} + +export interface AccessTokensGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccessTokensGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccessTokensGetDefaultHeaders; +} + +export interface AccessTokensDelete204Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface AccessTokensDelete204Response extends HttpResponse { + status: "204"; + headers: RawHttpHeaders & AccessTokensDelete204Headers; +} + +export interface AccessTokensDeleteDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccessTokensDeleteDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccessTokensDeleteDefaultHeaders; +} + +export interface AccessTokensList200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface AccessTokensList200Response extends HttpResponse { + status: "200"; + body: PagedAccessTokenOutput; + headers: RawHttpHeaders & AccessTokensList200Headers; +} + +export interface AccessTokensListDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccessTokensListDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccessTokensListDefaultHeaders; +} + +export interface AccessTokensValidate200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface AccessTokensValidate200Response extends HttpResponse { + status: "200"; + headers: RawHttpHeaders & AccessTokensValidate200Headers; +} + +export interface AccessTokensValidateDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccessTokensValidateDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccessTokensValidateDefaultHeaders; +} + +export interface AccountsGet200Headers { + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** The request has succeeded. */ +export interface AccountsGet200Response extends HttpResponse { + status: "200"; + body: AccountOutput; + headers: RawHttpHeaders & AccountsGet200Headers; +} + +export interface AccountsGetDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccountsGetDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccountsGetDefaultHeaders; +} + +export interface AccountsGetBrowsers302Headers { + /** The redirect target URL to run test on remote browsers. */ + location: string; + /** An opaque, globally-unique, client-generated string identifier for the request. */ + "x-ms-client-request-id"?: string; +} + +/** Redirection */ +export interface AccountsGetBrowsers302Response extends HttpResponse { + status: "302"; + headers: RawHttpHeaders & AccountsGetBrowsers302Headers; +} + +export interface AccountsGetBrowsersDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface AccountsGetBrowsersDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & AccountsGetBrowsersDefaultHeaders; +} diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsconfig.json b/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsconfig.json new file mode 100644 index 000000000000..af5f5f7b7ae4 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../tsconfig", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "rootDir": ".", + "skipLibCheck": true + }, + "include": [ + "src/**/*.ts", + "src/**/*.mts", + "src/**/*.cts", + "test/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsp-location.yaml b/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsp-location.yaml new file mode 100644 index 000000000000..ba48146dea38 --- /dev/null +++ b/sdk/playwrighttesting/microsoft-playwright-testing-rest/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/playwrighttesting/PlaywrightTesting.AuthManager +commit: 657d7ee5d3e7d52d5ccfc239678ab7629b9a3873 +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: