From 693e394d9d351290b84a6cc710f02ef40064c66e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 15 Feb 2021 14:59:21 +0000 Subject: [PATCH 001/166] Start of ARR client. --- dataplane.code-workspace | 4 + rush.json | 5 + .../mixedreality-remoterendering/.nycrc | 19 ++ .../mixedreality-remoterendering/CHANGELOG.md | 53 +++++ .../mixedreality-remoterendering/LICENSE | 21 ++ .../README-EXAMPLE.md | 188 ++++++++++++++++++ .../mixedreality-remoterendering/README.md | 102 ++++++++++ .../api-extractor.json | 31 +++ .../karma.conf.js | 138 +++++++++++++ .../mixedreality-remoterendering/package.json | 123 ++++++++++++ .../mixedreality-remoterendering.api.md | 44 ++++ .../review/template.api.md | 44 ++++ .../rollup.config.js | 3 + .../mixedreality-remoterendering/sample.env | 26 +++ .../src/constants.ts | 4 + .../mixedreality-remoterendering/src/index.ts | 4 + .../src/logger.ts | 11 + .../src/remoteRenderingClient.ts | 39 ++++ .../src/tracing.ts | 59 ++++++ .../swagger/README.md | 23 +++ .../mixedreality-remoterendering/tests.yml | 12 ++ .../tsconfig.json | 17 ++ 22 files changed, 970 insertions(+) create mode 100644 sdk/mixedreality/mixedreality-remoterendering/.nycrc create mode 100644 sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/LICENSE create mode 100644 sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/README.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/api-extractor.json create mode 100644 sdk/mixedreality/mixedreality-remoterendering/karma.conf.js create mode 100644 sdk/mixedreality/mixedreality-remoterendering/package.json create mode 100644 sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/review/template.api.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/rollup.config.js create mode 100644 sdk/mixedreality/mixedreality-remoterendering/sample.env create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/constants.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/index.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/logger.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/swagger/README.md create mode 100644 sdk/mixedreality/mixedreality-remoterendering/tests.yml create mode 100644 sdk/mixedreality/mixedreality-remoterendering/tsconfig.json diff --git a/dataplane.code-workspace b/dataplane.code-workspace index 8ffbd11b10f8..ea8b6f24204f 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -271,6 +271,10 @@ { "name": "iot-device-update", "path": "sdk/deviceupdate/iot-device-update" + }, + { + "name": "mixedreality-remoterendering", + "path": "sdk/mixedreality/mixedreality-remoterendering" } ], "settings": { diff --git a/rush.json b/rush.json index c8b941b088ee..df3572d5a59b 100644 --- a/rush.json +++ b/rush.json @@ -760,6 +760,11 @@ "projectFolder": "sdk/deviceupdate/iot-device-update", "versionPolicyName": "client" }, + { + "packageName": "@azure/mixedreality-remoterendering", + "projectFolder": "sdk/mixedreality/mixedreality-remoterendering", + "versionPolicyName": "client" + } { "packageName": "@azure/web-pubsub", "projectFolder": "sdk/web-pubsub/web-pubsub", diff --git a/sdk/mixedreality/mixedreality-remoterendering/.nycrc b/sdk/mixedreality/mixedreality-remoterendering/.nycrc new file mode 100644 index 000000000000..320eddfeffb9 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/.nycrc @@ -0,0 +1,19 @@ +{ + "include": [ + "dist-esm/src/**/*.js" + ], + "exclude": [ + "**/*.d.ts", + "dist-esm/src/generated/*" + ], + "reporter": [ + "text-summary", + "html", + "cobertura" + ], + "exclude-after-remap": false, + "sourceMap": true, + "produce-source-map": true, + "instrument": true, + "all": true + } diff --git a/sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md b/sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md new file mode 100644 index 000000000000..6a7473963bfe --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md @@ -0,0 +1,53 @@ +# Release History + +## 1.0.11-beta.1 (Unreleased) + +- Restructured the template package to use the Client SDK developer training materials. + +## 1.0.10-beta.1 (2020-11-16) + +- Test Release Pipeline + +## 1.0.9-beta.13 (2020-10-13) + +- Test Release Pipeline + +## 1.0.9-beta.3 (2020-09-05) + +- Test Release Pipeline + +## 1.0.9-beta.2 (2020-09-04) + +- Testing release tag replacement + +## 1.0.9-beta.1 (2020-08-27) + +- Testing prerelease versioning changes + +## 1.0.8 (Unreleased) + +## 1.0.7 (2020-04-01) + +## 1.0.6 (2020-03-26) + +- Test Release Pipeline + +## 1.0.5 (2020-03-25) + +- Test Release Pipeline + +## 1.0.4 (2020-03-245 + +- Test Release Pipeline + +## 1.0.3 (2020-03-24) + +- Test Release Pipeline + +## 1.0.2 (2020-03-24) + +- Test Release Pipeline + +## 1.0.1 (2020-03-24) + +- Test Release Pipeline diff --git a/sdk/mixedreality/mixedreality-remoterendering/LICENSE b/sdk/mixedreality/mixedreality-remoterendering/LICENSE new file mode 100644 index 000000000000..ea8fb1516028 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 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. diff --git a/sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md b/sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md new file mode 100644 index 000000000000..f22df945d438 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md @@ -0,0 +1,188 @@ +# App Configuration client library for JavaScript + + + +[Azure App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/overview) is a managed service that helps developers centralize their application and feature settings simply and securely. + +Use the client library for App Configuration to: + +- Create flexible key representations and mappings +- Tag keys with labels +- Replay settings from any point in time + +[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/appconfiguration/app-configuration/) | +[Package (NPM)](https://www.npmjs.com/package/@azure/app-configuration) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/app-configuration) | +[Product documentation](https://docs.microsoft.com/azure/azure-app-configuration/) | +[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples) + +## Getting started + +### Install the package + +```bash +npm install @azure/app-configuration +``` + +### Prerequisites + +- You must have an [Azure Subscription](https://azure.microsoft.com) and an [App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/) resource to use this package. +- Node.js version 8.x.x or higher + +### Create an App Configuration resource + +You can use the [Azure Portal](https://portal.azure.com) or the [Azure CLI](https://docs.microsoft.com/cli/azure) to create an Azure App Configuration resource. + +Example (Azure CLI): + +``` +az appconfig create --name --resource-group --location eastus +``` + +### Authenticate the client + +AppConfigurationClient can authenticate using a [service principal](#authenticating-with-a-service-principal) or using a [connection string](#authenticating-with-a-connection-string). + +#### Authenticating with a service principal + +Authentication via service principal is done by: + +- Creating a credential using the `@azure/identity` package. +- Setting appropriate RBAC rules on your AppConfiguration resource. + More information on App Configuration roles can be found [here](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + +Using [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential) + +```javascript +const azureIdentity = require("@azure/identity"); +const appConfig = require("@azure/app-configuration"); + +const credential = new azureIdentity.DefaultAzureCredential(); +const client = new appConfig.AppConfigurationClient( + endpoint, // ex: .azconfig.io> + credential +); +``` + +More information about `@azure/identity` can be found [here](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md) + +#### Authenticating with a connection string + +To get the Primary **connection string** for an App Configuration resource you can use this Azure CLI command: + +``` +az appconfig credential list -g -n --query "([?name=='Primary'].connectionString)[0]" +``` + +And in code you can now create your App Configuration client with the **connection string** you got from the Azure CLI: + +```typescript +const client = new AppConfigurationClient(""); +``` + +## Key concepts + +The [`AppConfigurationClient`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/appconfigurationclient) has some terminology changes from App Configuration in the portal. + +- Key/Value pairs are represented as [`ConfigurationSetting`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsetting) objects +- Locking and unlocking a setting is represented in the `isReadOnly` field, which you can toggle using `setReadOnly`. + +The client follows a simple design methodology - [`ConfigurationSetting`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsetting) can be passed into any method that takes a [`ConfigurationSettingParam`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsettingparam) or [`ConfigurationSettingId`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsettingid). + +This means this pattern works: + +```typescript +const setting = await client.getConfigurationSetting({ + key: "hello" +}); + +setting.value = "new value!"; +await client.setConfigurationSetting(setting); + +// fields unrelated to just identifying the setting are simply +// ignored (for instance, the `value` field) +await client.setReadOnly(setting, true); + +// delete just needs to identify the setting so other fields are +// just ignored +await client.deleteConfigurationSetting(setting); +``` + +or, for example, re-getting a setting: + +```typescript +let setting = await client.getConfigurationSetting({ + key: "hello" +}); + +// re-get the setting +setting = await.getConfigurationSetting(setting); +``` + +## Examples + +#### Create and get a setting + +```javascript +const appConfig = require("@azure/app-configuration"); + +const client = new appConfig.AppConfigurationClient( + "" +); + +async function run() { + const newSetting = await client.setConfigurationSetting({ + key: "testkey", + value: "testvalue", + // Labels allow you to create variants of a key tailored + // for specific use-cases like supporting multiple environments. + // https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value#label-keys + label: "optional-label" + }); + + let retrievedSetting = await client.getConfigurationSetting({ + key: "testkey", + label: "optional-label" + }); + + console.log("Retrieved value:", retrievedSetting.value); +} + +run().catch((err) => console.log("ERROR:", err)); +``` + +## Next steps + +The following samples show you the various ways you can interact with App Configuration: + +- [`helloworld.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/helloworld.ts) - Get, set, and delete configuration values. +- [`helloworldWithLabels.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/helloworldWithLabels.ts) - Use labels to add additional dimensions to your settings for scenarios like beta vs production. +- [`optimisticConcurrencyViaEtag.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/optimisticConcurrencyViaEtag.ts) - Set values using etags to prevent accidental overwrites. +- [`setReadOnlySample.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/setReadOnlySample.ts) - Marking settings as read-only to prevent modification. +- [`getSettingOnlyIfChanged.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/getSettingOnlyIfChanged.ts) - Get a setting only if it changed from the last time you got it. +- [`listRevisions.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/listRevisions.ts) - List the revisions of a key, allowing you to see previous values and when they were set. + +More in-depth examples can be found in the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples) folder on GitHub. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. + +This module's tests are a mixture of live and unit tests, which require you to have an Azure App Configuration instance. To execute the tests you'll need to run: + +1. `rush update` +2. `rush build -t @azure/app-configuration` +3. Create a .env file with these contents in the `sdk\appconfiguration\app-configuration` folder: + `APPCONFIG_CONNECTION_STRING=connection string for your App Configuration instance` +4. `cd sdk\appconfiguration\app-configuration` +5. `npm run test`. + +View our [tests](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/appconfiguration/app-configuration/test) +folder for more details. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) +- [Azure App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/overview) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappconfiguration%2Fapp-configuration%2FREADME.png) diff --git a/sdk/mixedreality/mixedreality-remoterendering/README.md b/sdk/mixedreality/mixedreality-remoterendering/README.md new file mode 100644 index 000000000000..266c1c7075af --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/README.md @@ -0,0 +1,102 @@ +# Azure Template client library for JavaScript + + + +This project is used as a template package for the Azure SDK for JavaScript. It is intended to help Azure SDK developers bootstrap new packages, and it provides an example of how to organize the code and documentation of a client library for an Azure service. + +## Getting started + +### Currently supported environments + +- Node.js version 8.x or higher + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +Usually you'd put a shell command for provisioning the necessary Azure services here. + +### Install the `@azure/template` package + +Install the Template client library for JavaScript with `npm`: + +```bash +npm install @azure/template +``` + +### Browser support + +#### 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). + +#### CORS + + + +You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). + +For example, you can create the following CORS settings for debugging. But please customize the settings carefully according to your requirements in a production environment. + +- Allowed origins: \* +- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT +- Allowed headers: \* +- Exposed headers: \* +- Maximum age (seconds): 86400 + +### Further examples + +Top-level examples usually include things like creating and authenticating the main Client. If your service supports multiple means of authenticating (e.g. key-based and Azure Active Directory) you can give a separate example of each. + +## Key concepts + +### ConfigurationClient + +Describe your primary client here. Talk about what operations it can do and when a developer would want to use it. + +### Additional Examples + +Create a section for each top-level service concept you want to explain. + +## Examples + +### First Example + + + +Create several code examples for how someone would use your library to accomplish a common task with the service. + +## Troubleshooting + +### Enable logs + +You can set the following environment variable to see debug logs when using this library. + +- Getting debug logs from the Azure TextAnalytics client library + +```bash +export DEBUG=azure* +``` + +## Next steps + +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/samples) directory for detailed examples that demonstrate how to use the client libraries. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/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) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftemplate%2Ftemplate%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/mixedreality/mixedreality-remoterendering/api-extractor.json b/sdk/mixedreality/mixedreality-remoterendering/api-extractor.json new file mode 100644 index 000000000000..6cea81b416bd --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "types/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/mixedreality-remoterendering.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/karma.conf.js b/sdk/mixedreality/mixedreality-remoterendering/karma.conf.js new file mode 100644 index 000000000000..9bca108da550 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/karma.conf.js @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// https://github.com/karma-runner/karma-chrome-launcher +process.env.CHROME_BIN = require("puppeteer").executablePath(); +require("dotenv").config(); +const { + jsonRecordingFilterFunction, + isPlaybackMode, + isSoftRecordMode, + isRecordMode +} = require("@azure/test-utils-recorder"); + +module.exports = function(config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-edge-launcher", + "karma-firefox-launcher", + "karma-ie-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-junit-reporter", + "karma-json-to-file-reporter", + "karma-json-preprocessor" + ], + + // list of files / patterns to load in the browser + files: [ + "dist-test/index.browser.js", + { pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true } + ].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []), + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["env"], + "recordings/browsers/**/*.json": ["json"], + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + "test-browser/index.js": ["coverage"] + }, + + envPreprocessor: [ + "TEST_MODE", + "APPCONFIG_ENDPOINT", + "APPCONFIG_TEST_SETTING_KEY", + "APPCONFIG_TEST_SETTING_EXPECTED_VALUE", + "AZURE_CLIENT_ID", + "AZURE_CLIENT_SECRET", + "AZURE_TENANT_ID" + ], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "junit", "json-to-file"], + + coverageReporter: { + // specify a common output directory + dir: "coverage-browser/", + reporters: [{ type: "json", subdir: ".", file: "coverage.json" }] + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + }, + + jsonToFileReporter: { + filter: jsonRecordingFilterFunction, + outputPath: "." + }, + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // --no-sandbox allows our tests to run in Linux without having to change the system. + // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox", "--disable-web-security"] + } + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 600000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + browserConsoleLogOptions: { + terminal: !isRecordMode() + }, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000" + } + } + }); +}; diff --git a/sdk/mixedreality/mixedreality-remoterendering/package.json b/sdk/mixedreality/mixedreality-remoterendering/package.json new file mode 100644 index 000000000000..7c6f68b1b6fe --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/package.json @@ -0,0 +1,123 @@ +{ + "name": "@azure/mixedreality-remoterendering", + "version": "1.0.0-beta.1", + "description": "Example project for learning how to build a client library", + "sdk-type": "client", + "main": "dist/index.js", + "module": "dist-esm/src/index.js", + "browser": {}, + "types": "types/mixedreality-remoterendering.d.ts", + "//metadata": { + "constantPaths": [ + { + "path": "src/generated/generatedClientContext.ts", + "prefix": "packageVersion" + }, + { + "path": "src/constants.ts", + "prefix": "SDK_VERSION" + } + ] + }, + "scripts": { + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", + "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", + "build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .", + "build:test": "tsc -p . && rollup -c 2>&1", + "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-* test-dist temp types *.tgz *.log", + "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src", + "execute:samples": "npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/", + "extract-api": "tsc -p . && api-extractor run --local", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "generate:client": "autorest --typescript --v3 swagger", + "integration-test:browser": "karma start --single-run", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts", + "pack": "npm pack 2>&1", + "prebuild": "npm run clean", + "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", + "test": "npm run build:test && npm run unit-test && npm run integration-test", + "unit-test:browser": "karma start --single-run", + "unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, + "files": [ + "dist/", + "dist-esm/src/", + "types/mixedreality-remoterendering.d.ts", + "README.md", + "LICENSE" + ], + "repository": "github:Azure/azure-sdk-for-js", + "engines": { + "node": ">=8.0.0" + }, + "keywords": [ + "azure", + "cloud", + "typescript" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-remoterendering/README.md", + "sideEffects": false, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "dependencies": { + "@azure/core-auth": "^1.2.0", + "@azure/core-http": "^1.2.0", + "@azure/core-tracing": "1.0.0-preview.9", + "@azure/logger": "^1.0.0", + "@opentelemetry/api": "^0.10.2", + "tslib": "^2.0.0" + }, + "devDependencies": { + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^1.1.0", + "@azure/test-utils-recorder": "^1.0.0", + "@microsoft/api-extractor": "7.7.11", + "@types/chai": "^4.1.6", + "@types/chai-as-promised": "^7.1.0", + "@types/mocha": "^7.0.2", + "@types/node": "^8.0.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "cross-env": "^7.0.2", + "dotenv": "^8.2.0", + "eslint": "^7.15.0", + "inherits": "^2.0.3", + "karma": "^5.1.0", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-json-preprocessor": "^0.3.3", + "karma-json-to-file-reporter": "^1.0.1", + "karma-junit-reporter": "^2.0.1", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.18.0", + "nyc": "^14.0.0", + "prettier": "^1.16.4", + "rimraf": "^3.0.0", + "rollup": "^1.16.3", + "typedoc": "0.15.2", + "typescript": "4.1.2", + "util": "^0.12.1" + }, + "//sampleConfiguration": { + "skipFolder": false + } +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md new file mode 100644 index 000000000000..993ca3fd6b5d --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/mixedreality-remoterendering" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { OperationOptions } from '@azure/core-http'; +import { PipelineOptions } from '@azure/core-http'; +import { TokenCredential } from '@azure/core-http'; + +// @public +export class ConfigurationClient { + constructor(endpointUrl: string, credential: TokenCredential, options?: ConfigurationClientOptions); + getConfigurationSetting(key: string, options?: GetConfigurationSettingOptions): Promise; + getConfigurationSetting(setting: ConfigurationSetting, options?: GetConfigurationSettingOptions): Promise; +} + +// @public +export interface ConfigurationClientOptions extends PipelineOptions { +} + +// @public (undocumented) +export interface ConfigurationSetting { + contentType?: string; + etag?: string; + isReadOnly?: boolean; + key: string; + label?: string; + lastModified?: Date; + tags?: { + [propertyName: string]: string; + }; + value?: string; +} + +// @public +export interface GetConfigurationSettingOptions extends OperationOptions { + onlyIfChanged?: boolean; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/mixedreality/mixedreality-remoterendering/review/template.api.md b/sdk/mixedreality/mixedreality-remoterendering/review/template.api.md new file mode 100644 index 000000000000..3ee61bc94c0a --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/review/template.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/template" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { OperationOptions } from '@azure/core-http'; +import { PipelineOptions } from '@azure/core-http'; +import { TokenCredential } from '@azure/core-http'; + +// @public +export class ConfigurationClient { + constructor(endpointUrl: string, credential: TokenCredential, options?: ConfigurationClientOptions); + getConfigurationSetting(key: string, options?: GetConfigurationSettingOptions): Promise; + getConfigurationSetting(setting: ConfigurationSetting, options?: GetConfigurationSettingOptions): Promise; +} + +// @public +export interface ConfigurationClientOptions extends PipelineOptions { +} + +// @public (undocumented) +export interface ConfigurationSetting { + contentType?: string; + etag?: string; + isReadOnly?: boolean; + key: string; + label?: string; + lastModified?: Date; + tags?: { + [propertyName: string]: string; + }; + value?: string; +} + +// @public +export interface GetConfigurationSettingOptions extends OperationOptions { + onlyIfChanged?: boolean; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/mixedreality/mixedreality-remoterendering/rollup.config.js b/sdk/mixedreality/mixedreality-remoterendering/rollup.config.js new file mode 100644 index 000000000000..5d7deee44c14 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/rollup.config.js @@ -0,0 +1,3 @@ +import { makeConfig } from "@azure/dev-tool/shared-config/rollup"; + +export default makeConfig(require("./package.json")); diff --git a/sdk/mixedreality/mixedreality-remoterendering/sample.env b/sdk/mixedreality/mixedreality-remoterendering/sample.env new file mode 100644 index 000000000000..63d2520e7232 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/sample.env @@ -0,0 +1,26 @@ +# Used in most samples. Retrieve these values from an instance in the Azure +# Portal. + +APPCONFIG_ENDPOINT: "https://.azconfig.io", + +# Used in the tests to indicate the key to use when retrieving a setting from +# the App Configuration and the expected value of that setting. + +APPCONFIG_TEST_SETTING_KEY="" +APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" + +# Used to authenticate using Azure AD as a service principal for role-based +# authentication in the tokenAuth sample. +# +# See the documentation for `EnvironmentCredential` at the following link: +# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential + +AZURE_TENANT_ID="" +AZURE_CLIENT_ID="" +AZURE_CLIENT_SECRET="" + +# Our tests assume that TEST_MODE is "playback" by default. You can change it +# to "record" to generate new recordings, or "live" to bypass the recorder +# entirely. + +# TEST_MODE="playback" diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts b/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts new file mode 100644 index 000000000000..c9e9e40f2cd8 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export const SDK_VERSION: string = "1.0.0-beta.1"; \ No newline at end of file diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/index.ts new file mode 100644 index 000000000000..5b9b0b92ce76 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/index.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export * from "./remoteRenderingClient"; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/logger.ts b/sdk/mixedreality/mixedreality-remoterendering/src/logger.ts new file mode 100644 index 000000000000..f98322638ff0 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/logger.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createClientLogger } from "@azure/logger"; + +/** + * The \@azure/logger configuration for this package. + * + * @internal + */ +export const logger = createClientLogger("template"); diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts new file mode 100644 index 000000000000..2510743febac --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/* +import { + PipelineOptions, + TokenCredential, + OperationOptions, + bearerTokenAuthenticationPolicy, + createPipelineFromOptions, + InternalPipelineOptions +} from "@azure/core-http"; +import { CanonicalCode } from "@opentelemetry/api"; + +*/ +//import { GeneratedClient } from "./generated"; +//import { SDK_VERSION } from "./constants"; +//import { logger } from "./logger"; +//import { createSpan } from "./tracing"; + +/** + * The client class used to interact with the App Configuration service. + */ +export class RemoteRenderingClient { + //private client: GeneratedClient; + + /** + * Creates an instance of a MixedRealityStsClient. + * @param accountId The Mixed Reality service account identifier. + * @param accountDomain The Mixed Reality service account domain. + * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * @param options Additional client options. + */ + constructor( + ) + { + // this.client = new GeneratedClient(); + } +} \ No newline at end of file diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts b/sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts new file mode 100644 index 000000000000..d5bd668486f5 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { getTracer } from "@azure/core-tracing"; +import { Span, SpanOptions, SpanKind } from "@opentelemetry/api"; +import { OperationOptions } from "@azure/core-http"; + +type OperationTracingOptions = OperationOptions["tracingOptions"]; + +/** + * Creates a span using the global tracer. + * @internal + * @param name The name of the operation being performed. + * @param tracingOptions The options for the underlying http request. + */ +export function createSpan( + operationName: string, + operationOptions: T +): { span: Span; updatedOptions: T } { + const tracer = getTracer(); + const tracingOptions = operationOptions.tracingOptions || {}; + const spanOptions: SpanOptions = { + ...tracingOptions.spanOptions, + kind: SpanKind.INTERNAL + }; + + const span = tracer.startSpan(`Azure.MixedReality.${operationName}`, spanOptions); + + // Resource providers are documented here: + // https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers + span.setAttribute("Microsoft.MixedReality", "Microsoft.MixedReality"); + + let newSpanOptions = tracingOptions.spanOptions || {}; + if (span.isRecording()) { + newSpanOptions = { + ...tracingOptions.spanOptions, + parent: span.context(), + attributes: { + ...spanOptions.attributes, + "Microsoft.MixedReality": "Microsoft.MixedReality" + } + }; + } + + const newTracingOptions: OperationTracingOptions = { + ...tracingOptions, + spanOptions: newSpanOptions + }; + + const newOperationOptions: T = { + ...operationOptions, + tracingOptions: newTracingOptions + }; + + return { + span, + updatedOptions: newOperationOptions + }; +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md b/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md new file mode 100644 index 000000000000..3a08e7aa9156 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md @@ -0,0 +1,23 @@ +# Azure Example TypeScript Protocol Layer + +> see https://aka.ms/autorest + +## Configuration + +```yaml +v3: true +package-name: "@azure/mixedreality-remoterendering" +title: GeneratedClient +description: Example Client +generate-metadata: false +license-header: MICROSOFT_MIT_NO_VERSION +output-folder: ../ +source-code-folder-path: ./src/generated +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/92aa7802beffd6bdae18b808e45c4897de2cb2e2/specification/mixedreality/data-plane/Microsoft.MixedReality/preview/2021-01-01-preview/mr-arr.json +add-credentials: false +package-version: 1.0.0-beta.1 +disable-async-iterators: true +hide-clients: true +use-extension: + "@autorest/typescript": "6.0.0-dev.20210121.2" +``` diff --git a/sdk/mixedreality/mixedreality-remoterendering/tests.yml b/sdk/mixedreality/mixedreality-remoterendering/tests.yml new file mode 100644 index 000000000000..8ee6aca1536a --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/tests.yml @@ -0,0 +1,12 @@ +trigger: none + +extends: + template: ../../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml + parameters: + PackageName: "@azure/template" + ResourceServiceDirectory: template + TestMinMax: true + EnvVars: + AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) + AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) + AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) diff --git a/sdk/mixedreality/mixedreality-remoterendering/tsconfig.json b/sdk/mixedreality/mixedreality-remoterendering/tsconfig.json new file mode 100644 index 000000000000..9784ff1f1ed3 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../tsconfig.package", + "compilerOptions": { + "outDir": "./dist-esm", + "declarationDir": "./types" + }, + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-samples", + "dist-esm", + "./samples/**/*.ts" + ] +} From d801810f3729d6f496fbda82045ddc4bbdaf8ab9 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 15 Feb 2021 15:10:44 +0000 Subject: [PATCH 002/166] Add generated code --- .../src/constants.ts | 2 +- .../src/generated/generatedClient.ts | 27 + .../src/generated/generatedClientContext.ts | 53 ++ .../src/generated/index.ts | 11 + .../src/generated/models/index.ts | 514 ++++++++++++ .../src/generated/models/mappers.ts | 735 ++++++++++++++++++ .../src/generated/models/parameters.ts | 126 +++ .../src/generated/operations/index.ts | 9 + .../generated/operations/remoteRendering.ts | 667 ++++++++++++++++ .../src/remoteRenderingClient.ts | 8 +- 10 files changed, 2146 insertions(+), 6 deletions(-) create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts b/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts index c9e9e40f2cd8..47dc16dd0f7c 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts @@ -1,4 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export const SDK_VERSION: string = "1.0.0-beta.1"; \ No newline at end of file +export const SDK_VERSION: string = "1.0.0-beta.1"; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts new file mode 100644 index 000000000000..b84e01065326 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { RemoteRendering } from "./operations"; +import { GeneratedClientContext } from "./generatedClientContext"; +import { GeneratedClientOptionalParams } from "./models"; + +/** @hidden */ +export class GeneratedClient extends GeneratedClientContext { + /** + * Initializes a new instance of the GeneratedClient class. + * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A + * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. + * @param options The parameter options + */ + constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + super(endpoint, options); + this.remoteRendering = new RemoteRendering(this); + } + + remoteRendering: RemoteRendering; +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts new file mode 100644 index 000000000000..294ea9bac93b --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import { GeneratedClientOptionalParams } from "./models"; + +const packageName = "@azure/mixedreality-remoterendering"; +const packageVersion = "1.0.0-beta.1"; + +/** @hidden */ +export class GeneratedClientContext extends coreHttp.ServiceClient { + endpoint: string; + apiVersion: string; + + /** + * Initializes a new instance of the GeneratedClientContext class. + * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A + * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. + * @param options The parameter options + */ + constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + + if (!options.userAgent) { + const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(undefined, options); + + this.requestContentType = "application/json; charset=utf-8"; + + this.baseUri = options.endpoint || "{endpoint}"; + + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2021-01-01-preview"; + } +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts new file mode 100644 index 000000000000..3aebf3c9a56c --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { GeneratedClient } from "./generatedClient"; +export { GeneratedClientContext } from "./generatedClientContext"; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts new file mode 100644 index 000000000000..26d3cb454183 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts @@ -0,0 +1,514 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +/** Request to start a conversion */ +export interface CreateConversionSettings { + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: ConversionSettings; +} + +/** Conversion settings describe the origin of input files and destination of output files. */ +export interface ConversionSettings { + /** Conversion input settings describe the origin of conversion input. */ + inputLocation: ConversionInputSettings; + /** Conversion output settings describe the destination of conversion output. */ + outputLocation: ConversionOutputSettings; +} + +/** Conversion input settings describe the origin of conversion input. */ +export interface ConversionInputSettings { + /** The URI of the Azure blob storage container containing the input model. */ + storageContainerUri: string; + /** An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ + storageContainerReadListSas?: string; + /** Only Blobs starting with this prefix will be downloaded to perform the conversion. Optional. If not provided, all Blobs from the container will be downloaded. */ + blobPrefix?: string; + /** The relative path starting at blobPrefix (or at the container root if blobPrefix is not provided) to the input model. Must point to a file with a supported file format ending. See https://docs.microsoft.com/azure/remote-rendering/how-tos/conversion/model-conversion for details. */ + relativeInputAssetPath: string; +} + +/** Conversion output settings describe the destination of conversion output. */ +export interface ConversionOutputSettings { + /** The URI of the Azure blob storage container where the result of the conversion should be written to. */ + storageContainerUri: string; + /** An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ + storageContainerWriteSas?: string; + /** A prefix which gets prepended in front of all files produced by the conversion process. Will be treated as a virtual folder. Optional. If not provided, output files will be stored at the container root. */ + blobPrefix?: string; + /** The file name of the output asset. Must end in '.arrAsset'. Optional. If not provided, file name will the same name as the input asset, with '.arrAsset' extension */ + outputAssetFilename?: string; +} + +/** The properties of the conversion. */ +export interface Conversion { + /** The ID of the conversion supplied when the conversion was created. */ + id: string; + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: ConversionSettings; + /** + * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly output?: ConversionOutput; + /** The error object containing details about the conversion failure. */ + error: ErrorModel; + /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ + status: ConversionStatus; + /** The time when the conversion was created. Date and time in ISO 8601 format. */ + creationTime: Date; +} + +/** Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. */ +export interface ConversionOutput { + /** + * URI of the asset generated by the conversion process. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly outputAssetUri?: string; +} + +/** The error object containing details of why the request failed. */ +export interface ErrorModel { + /** Error code. */ + code: string; + /** A human-readable representation of the error. */ + message: string; + /** + * An array of details about specific errors that led to this reported error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorModel[]; + /** + * The target of the particular error (e.g., the name of the property in error). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * An object containing more specific information than the current object about the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly innerError?: ErrorModel; +} + +/** The error response containing details of why the request failed. */ +export interface ErrorResponse { + /** The error object containing details of why the request failed. */ + error: ErrorModel; +} + +/** List of conversions. */ +export interface ConversionList { + /** The list of conversions. */ + conversions: Conversion[]; + /** + * If more conversions are available this field will contain a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Settings of the session to be created. */ +export interface CreateSessionSettings { + /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ + maxLeaseTimeMinutes: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: SessionSize; +} + +/** The properties of a rendering session. */ +export interface SessionProperties { + /** The ID of the session supplied when the session was created. */ + id: string; + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elapsedTimeMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hostname?: string; + /** + * The time in minutes the session will run after reaching the 'Ready' state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maxLeaseTimeMinutes?: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: SessionSize; + /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ + status: SessionStatus; + /** + * The computational power of the rendering session GPU measured in teraflops. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly teraflops?: number; + /** + * The error object containing details about the rendering session startup failure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorModel; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationTime?: Date; +} + +/** Settings used to update the session. */ +export interface UpdateSessionSettings { + /** Update to the time the session will run after it reached the 'Ready' state. It has to be larger than the current value of maxLeaseTimeMinutes and less than 1440. */ + maxLeaseTimeMinutes: number; +} + +/** The result of a list sessions request. */ +export interface SessionsList { + /** The list of rendering sessions. Does not include sessions in 'Stopped' state. */ + sessions: SessionProperties[]; + /** + * If more rendering sessions are available this field will contain a URL where the next batch of sessions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Defines headers for RemoteRendering_createConversion operation. */ +export interface RemoteRenderingCreateConversionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_createConversion operation. */ +export interface RemoteRenderingCreateConversionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_getConversion operation. */ +export interface RemoteRenderingGetConversionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Time in seconds when the status of this conversion should be polled again */ + retryAfter?: number; +} + +/** Defines headers for RemoteRendering_getConversion operation. */ +export interface RemoteRenderingGetConversionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listConversions operation. */ +export interface RemoteRenderingListConversionsHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_listConversions operation. */ +export interface RemoteRenderingListConversionsExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting errors to the Azure Remote Rendering team. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_createSession operation. */ +export interface RemoteRenderingCreateSessionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_createSession operation. */ +export interface RemoteRenderingCreateSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_getSession operation. */ +export interface RemoteRenderingGetSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_updateSession operation. */ +export interface RemoteRenderingUpdateSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_stopSession operation. */ +export interface RemoteRenderingStopSessionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_stopSession operation. */ +export interface RemoteRenderingStopSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listSessions operation. */ +export interface RemoteRenderingListSessionsExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listConversionsNext operation. */ +export interface RemoteRenderingListConversionsNextHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_listConversionsNext operation. */ +export interface RemoteRenderingListConversionsNextExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting errors to the Azure Remote Rendering team. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listSessionsNext operation. */ +export interface RemoteRenderingListSessionsNextExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Known values of {@link ConversionStatus} that the service accepts. */ +export const enum KnownConversionStatus { + /** The conversion was created but hasn't started. */ + NotStarted = "NotStarted", + /** The conversion is running. */ + Running = "Running", + /** The conversion was cancelled. This is a terminal state. */ + Cancelled = "Cancelled", + /** The conversion has failed. Check the 'error' field for more details. This is a terminal state. */ + Failed = "Failed", + /** The conversion has succeeded. Check the 'output' field for output asset location. This is a terminal state. */ + Succeeded = "Succeeded" +} + +/** + * Defines values for ConversionStatus. \ + * {@link KnownConversionStatus} can be used interchangeably with ConversionStatus, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **NotStarted**: The conversion was created but hasn't started. \ + * **Running**: The conversion is running. \ + * **Cancelled**: The conversion was cancelled. This is a terminal state. \ + * **Failed**: The conversion has failed. Check the 'error' field for more details. This is a terminal state. \ + * **Succeeded**: The conversion has succeeded. Check the 'output' field for output asset location. This is a terminal state. + */ +export type ConversionStatus = string; + +/** Known values of {@link SessionSize} that the service accepts. */ +export const enum KnownSessionSize { + /** Standard rendering session size. */ + Standard = "Standard", + /** Premium rendering session size. */ + Premium = "Premium" +} + +/** + * Defines values for SessionSize. \ + * {@link KnownSessionSize} can be used interchangeably with SessionSize, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Standard**: Standard rendering session size. \ + * **Premium**: Premium rendering session size. + */ +export type SessionSize = string; + +/** Known values of {@link SessionStatus} that the service accepts. */ +export const enum KnownSessionStatus { + /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ + Error = "Error", + /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ + Expired = "Expired", + /** The rendering session is starting, but not accepting incoming connections yet. */ + Starting = "Starting", + /** The rendering session is ready for incoming connections. */ + Ready = "Ready", + /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ + Stopped = "Stopped" +} + +/** + * Defines values for SessionStatus. \ + * {@link KnownSessionStatus} can be used interchangeably with SessionStatus, + * this enum contains the known values that the service supports. + * ### Know values supported by the service + * **Error**: The rendering session has encountered an error, and is unusable. This is a terminal state. \ + * **Expired**: The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. \ + * **Starting**: The rendering session is starting, but not accepting incoming connections yet. \ + * **Ready**: The rendering session is ready for incoming connections. \ + * **Stopped**: The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. + */ +export type SessionStatus = string; + +/** Contains response data for the createConversion operation. */ +export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & + Conversion & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: Conversion; + /** The parsed HTTP response headers. */ + parsedHeaders: RemoteRenderingCreateConversionHeaders; + }; + }; + +/** Contains response data for the getConversion operation. */ +export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & + Conversion & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: Conversion; + /** The parsed HTTP response headers. */ + parsedHeaders: RemoteRenderingGetConversionHeaders; + }; + }; + +/** Contains response data for the listConversions operation. */ +export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversionsHeaders & + ConversionList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: ConversionList; + /** The parsed HTTP response headers. */ + parsedHeaders: RemoteRenderingListConversionsHeaders; + }; + }; + +/** Contains response data for the createSession operation. */ +export type RemoteRenderingCreateSessionResponse = SessionProperties & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SessionProperties; + }; +}; + +/** Contains response data for the getSession operation. */ +export type RemoteRenderingGetSessionResponse = SessionProperties & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SessionProperties; + }; +}; + +/** Contains response data for the updateSession operation. */ +export type RemoteRenderingUpdateSessionResponse = SessionProperties & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SessionProperties; + }; +}; + +/** Contains response data for the stopSession operation. */ +export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The parsed HTTP response headers. */ + parsedHeaders: RemoteRenderingStopSessionHeaders; + }; +}; + +/** Contains response data for the listSessions operation. */ +export type RemoteRenderingListSessionsResponse = SessionsList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SessionsList; + }; +}; + +/** Contains response data for the listConversionsNext operation. */ +export type RemoteRenderingListConversionsNextResponse = RemoteRenderingListConversionsNextHeaders & + ConversionList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: ConversionList; + /** The parsed HTTP response headers. */ + parsedHeaders: RemoteRenderingListConversionsNextHeaders; + }; + }; + +/** Contains response data for the listSessionsNext operation. */ +export type RemoteRenderingListSessionsNextResponse = SessionsList & { + /** The underlying HTTP response. */ + _response: coreHttp.HttpResponse & { + /** The response body as text (string format) */ + bodyAsText: string; + + /** The response body as parsed JSON or XML */ + parsedBody: SessionsList; + }; +}; + +/** Optional parameters. */ +export interface GeneratedClientOptionalParams + extends coreHttp.ServiceClientOptions { + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts new file mode 100644 index 000000000000..c51d569ae67a --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -0,0 +1,735 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +export const CreateConversionSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CreateConversionSettings", + modelProperties: { + settings: { + serializedName: "settings", + type: { + name: "Composite", + className: "ConversionSettings" + } + } + } + } +}; + +export const ConversionSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionSettings", + modelProperties: { + inputLocation: { + serializedName: "inputLocation", + type: { + name: "Composite", + className: "ConversionInputSettings" + } + }, + outputLocation: { + serializedName: "outputLocation", + type: { + name: "Composite", + className: "ConversionOutputSettings" + } + } + } + } +}; + +export const ConversionInputSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionInputSettings", + modelProperties: { + storageContainerUri: { + serializedName: "storageContainerUri", + required: true, + type: { + name: "String" + } + }, + storageContainerReadListSas: { + serializedName: "storageContainerReadListSas", + type: { + name: "String" + } + }, + blobPrefix: { + serializedName: "blobPrefix", + type: { + name: "String" + } + }, + relativeInputAssetPath: { + serializedName: "relativeInputAssetPath", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ConversionOutputSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionOutputSettings", + modelProperties: { + storageContainerUri: { + serializedName: "storageContainerUri", + required: true, + type: { + name: "String" + } + }, + storageContainerWriteSas: { + serializedName: "storageContainerWriteSas", + type: { + name: "String" + } + }, + blobPrefix: { + serializedName: "blobPrefix", + type: { + name: "String" + } + }, + outputAssetFilename: { + serializedName: "outputAssetFilename", + type: { + name: "String" + } + } + } + } +}; + +export const Conversion: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "Conversion", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + settings: { + serializedName: "settings", + type: { + name: "Composite", + className: "ConversionSettings" + } + }, + output: { + serializedName: "output", + type: { + name: "Composite", + className: "ConversionOutput" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + creationTime: { + serializedName: "creationTime", + required: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ConversionOutput: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionOutput", + modelProperties: { + outputAssetUri: { + serializedName: "outputAssetUri", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorModel: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + innerError: { + serializedName: "innerError", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ErrorResponse: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ConversionList: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionList", + modelProperties: { + conversions: { + serializedName: "conversions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Conversion" + } + } + } + }, + nextLink: { + serializedName: "@nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CreateSessionSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CreateSessionSettings", + modelProperties: { + maxLeaseTimeMinutes: { + serializedName: "maxLeaseTimeMinutes", + required: true, + type: { + name: "Number" + } + }, + size: { + serializedName: "size", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SessionProperties: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "SessionProperties", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + arrInspectorPort: { + constraints: { + InclusiveMaximum: 65534, + InclusiveMinimum: 49152 + }, + serializedName: "arrInspectorPort", + readOnly: true, + type: { + name: "Number" + } + }, + handshakePort: { + constraints: { + InclusiveMaximum: 65534, + InclusiveMinimum: 49152 + }, + serializedName: "handshakePort", + readOnly: true, + type: { + name: "Number" + } + }, + elapsedTimeMinutes: { + serializedName: "elapsedTimeMinutes", + readOnly: true, + type: { + name: "Number" + } + }, + hostname: { + serializedName: "hostname", + readOnly: true, + type: { + name: "String" + } + }, + maxLeaseTimeMinutes: { + serializedName: "maxLeaseTimeMinutes", + readOnly: true, + type: { + name: "Number" + } + }, + size: { + serializedName: "size", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + teraflops: { + serializedName: "teraflops", + readOnly: true, + type: { + name: "Number" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + }, + creationTime: { + serializedName: "creationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const UpdateSessionSettings: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateSessionSettings", + modelProperties: { + maxLeaseTimeMinutes: { + serializedName: "maxLeaseTimeMinutes", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const SessionsList: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "SessionsList", + modelProperties: { + sessions: { + serializedName: "sessions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SessionProperties" + } + } + } + }, + nextLink: { + serializedName: "@nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateConversionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateConversionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateConversionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateConversionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingGetConversionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetConversionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const RemoteRenderingGetConversionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetConversionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateSessionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateSessionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateSessionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingGetSessionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingUpdateSessionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingUpdateSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingStopSessionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingStopSessionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingStopSessionExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingStopSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListSessionsExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListSessionsExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsNextHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsNextHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsNextExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsNextExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListSessionsNextExceptionHeaders: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListSessionsNextExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts new file mode 100644 index 000000000000..a9bf1d9480f9 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-http"; +import { + CreateConversionSettings as CreateConversionSettingsMapper, + CreateSessionSettings as CreateSessionSettingsMapper, + UpdateSessionSettings as UpdateSessionSettingsMapper +} from "../models/mappers"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CreateConversionSettingsMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const endpoint: OperationURLParameter = { + parameterPath: "endpoint", + mapper: { + serializedName: "endpoint", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-01-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const accountId: OperationURLParameter = { + parameterPath: "accountId", + mapper: { + serializedName: "account_id", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const conversionId: OperationURLParameter = { + parameterPath: "conversionId", + mapper: { + serializedName: "conversion_id", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: CreateSessionSettingsMapper +}; + +export const sessionId: OperationURLParameter = { + parameterPath: "sessionId", + mapper: { + serializedName: "session_id", + required: true, + type: { + name: "String" + } + } +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: UpdateSessionSettingsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts new file mode 100644 index 000000000000..80a01585d4b1 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./remoteRendering"; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts new file mode 100644 index 000000000000..f6f306529c8e --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -0,0 +1,667 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { GeneratedClient } from "../generatedClient"; +import { + CreateConversionSettings, + RemoteRenderingCreateConversionResponse, + RemoteRenderingGetConversionResponse, + RemoteRenderingListConversionsResponse, + CreateSessionSettings, + RemoteRenderingCreateSessionResponse, + RemoteRenderingGetSessionResponse, + UpdateSessionSettings, + RemoteRenderingUpdateSessionResponse, + RemoteRenderingStopSessionResponse, + RemoteRenderingListSessionsResponse, + RemoteRenderingListConversionsNextResponse, + RemoteRenderingListSessionsNextResponse +} from "../models"; + +/** Class representing a RemoteRendering. */ +export class RemoteRendering { + private readonly client: GeneratedClient; + + /** + * Initialize a new instance of the class RemoteRendering class. + * @param client Reference to the service client + */ + constructor(client: GeneratedClient) { + this.client = client; + } + + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param body Request body configuring the settings for an asset conversion. + * @param options The options parameters. + */ + createConversion( + accountId: string, + conversionId: string, + body: CreateConversionSettings, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + conversionId, + body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + createConversionOperationSpec + ) as Promise; + } + + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param options The options parameters. + */ + getConversion( + accountId: string, + conversionId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + conversionId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + getConversionOperationSpec + ) as Promise; + } + + /** + * Gets a list of all conversions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listConversions( + accountId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listConversionsOperationSpec + ) as Promise; + } + + /** + * Creates a new rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param body Settings of the session to be created. + * @param options The options parameters. + */ + createSession( + accountId: string, + sessionId: string, + body: CreateSessionSettings, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + sessionId, + body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + createSessionOperationSpec + ) as Promise; + } + + /** + * Gets the properties of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters. + */ + getSession( + accountId: string, + sessionId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + sessionId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + getSessionOperationSpec + ) as Promise; + } + + /** + * Updates the max lease time of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param body Settings used to update the session. + * @param options The options parameters. + */ + updateSession( + accountId: string, + sessionId: string, + body: UpdateSessionSettings, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + sessionId, + body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + updateSessionOperationSpec + ) as Promise; + } + + /** + * Stops a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters. + */ + stopSession( + accountId: string, + sessionId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + sessionId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + stopSessionOperationSpec + ) as Promise; + } + + /** + * Gets a list of all rendering sessions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listSessions( + accountId: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listSessionsOperationSpec + ) as Promise; + } + + /** + * ListConversionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListConversions method. + * @param options The options parameters. + */ + listConversionsNext( + accountId: string, + nextLink: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listConversionsNextOperationSpec + ) as Promise; + } + + /** + * ListSessionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListSessions method. + * @param options The options parameters. + */ + listSessionsNext( + accountId: string, + nextLink: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationArguments: coreHttp.OperationArguments = { + accountId, + nextLink, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest( + operationArguments, + listSessionsNextOperationSpec + ) as Promise; + } +} +// Operation Specifications +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + +const createConversionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/conversions/{conversion_id}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingCreateConversionHeaders + }, + 201: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingCreateConversionHeaders + }, + 400: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 401: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 409: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + isError: true + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.conversionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getConversionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/conversions/{conversion_id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingGetConversionHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.conversionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listConversionsOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/conversions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConversionList, + headersMapper: Mappers.RemoteRenderingListConversionsHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.endpoint, Parameters.accountId], + headerParameters: [Parameters.accept], + serializer +}; +const createSessionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 201: { + bodyMapper: Mappers.SessionProperties, + headersMapper: Mappers.RemoteRenderingCreateSessionHeaders + }, + 400: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 401: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 409: { + bodyMapper: Mappers.ErrorResponse, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getSessionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 401: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateSessionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 401: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 422: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const stopSessionOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}/:stop", + httpMethod: "POST", + responses: { + 204: { + headersMapper: Mappers.RemoteRenderingStopSessionHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listSessionsOperationSpec: coreHttp.OperationSpec = { + path: "/accounts/{account_id}/sessions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionsList + }, + 401: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.endpoint, Parameters.accountId], + headerParameters: [Parameters.accept], + serializer +}; +const listConversionsNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConversionList, + headersMapper: Mappers.RemoteRenderingListConversionsNextHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listSessionsNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionsList + }, + 401: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2510743febac..1ebed2c71429 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -31,9 +31,7 @@ export class RemoteRenderingClient { * @param keyCredential The Mixed Reality service account primary or secondary key credential. * @param options Additional client options. */ - constructor( - ) - { - // this.client = new GeneratedClient(); + constructor() { + // this.client = new GeneratedClient(); } -} \ No newline at end of file +} From f0a78e03b5c3cc95ad368b460c06a758e0b871f0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 16 Feb 2021 11:25:56 +0000 Subject: [PATCH 003/166] Better naming of generated structs. --- .../src/generated/index.ts | 4 ++-- .../src/generated/models/index.ts | 2 +- .../src/generated/operations/remoteRendering.ts | 6 +++--- ...eratedClient.ts => remoteRenderingRestClient.ts} | 13 ++++++++----- ...ntext.ts => remoteRenderingRestClientContext.ts} | 11 +++++++---- .../mixedreality-remoterendering/swagger/README.md | 4 ++-- 6 files changed, 23 insertions(+), 17 deletions(-) rename sdk/mixedreality/mixedreality-remoterendering/src/generated/{generatedClient.ts => remoteRenderingRestClient.ts} (62%) rename sdk/mixedreality/mixedreality-remoterendering/src/generated/{generatedClientContext.ts => remoteRenderingRestClientContext.ts} (81%) diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts index 3aebf3c9a56c..9ed6903f2d7a 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts @@ -7,5 +7,5 @@ */ export * from "./models"; -export { GeneratedClient } from "./generatedClient"; -export { GeneratedClientContext } from "./generatedClientContext"; +export { RemoteRenderingRestClient } from "./remoteRenderingRestClient"; +export { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts index 26d3cb454183..f794d5bcbe4a 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts @@ -505,7 +505,7 @@ export type RemoteRenderingListSessionsNextResponse = SessionsList & { }; /** Optional parameters. */ -export interface GeneratedClientOptionalParams +export interface RemoteRenderingRestClientOptionalParams extends coreHttp.ServiceClientOptions { /** Api Version */ apiVersion?: string; diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index f6f306529c8e..9ca7e2b49067 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -9,7 +9,7 @@ import * as coreHttp from "@azure/core-http"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { GeneratedClient } from "../generatedClient"; +import { RemoteRenderingRestClient } from "../remoteRenderingRestClient"; import { CreateConversionSettings, RemoteRenderingCreateConversionResponse, @@ -28,13 +28,13 @@ import { /** Class representing a RemoteRendering. */ export class RemoteRendering { - private readonly client: GeneratedClient; + private readonly client: RemoteRenderingRestClient; /** * Initialize a new instance of the class RemoteRendering class. * @param client Reference to the service client */ - constructor(client: GeneratedClient) { + constructor(client: RemoteRenderingRestClient) { this.client = client; } diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts similarity index 62% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts rename to sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts index b84e01065326..346c22086b7d 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClient.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts @@ -7,18 +7,21 @@ */ import { RemoteRendering } from "./operations"; -import { GeneratedClientContext } from "./generatedClientContext"; -import { GeneratedClientOptionalParams } from "./models"; +import { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; +import { RemoteRenderingRestClientOptionalParams } from "./models"; /** @hidden */ -export class GeneratedClient extends GeneratedClientContext { +export class RemoteRenderingRestClient extends RemoteRenderingRestClientContext { /** - * Initializes a new instance of the GeneratedClient class. + * Initializes a new instance of the RemoteRenderingRestClient class. * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. * @param options The parameter options */ - constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + constructor( + endpoint: string, + options?: RemoteRenderingRestClientOptionalParams + ) { super(endpoint, options); this.remoteRendering = new RemoteRendering(this); } diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts b/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts similarity index 81% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts rename to sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts index 294ea9bac93b..3bd6adce2053 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/generated/generatedClientContext.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts @@ -7,23 +7,26 @@ */ import * as coreHttp from "@azure/core-http"; -import { GeneratedClientOptionalParams } from "./models"; +import { RemoteRenderingRestClientOptionalParams } from "./models"; const packageName = "@azure/mixedreality-remoterendering"; const packageVersion = "1.0.0-beta.1"; /** @hidden */ -export class GeneratedClientContext extends coreHttp.ServiceClient { +export class RemoteRenderingRestClientContext extends coreHttp.ServiceClient { endpoint: string; apiVersion: string; /** - * Initializes a new instance of the GeneratedClientContext class. + * Initializes a new instance of the RemoteRenderingRestClientContext class. * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. * @param options The parameter options */ - constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + constructor( + endpoint: string, + options?: RemoteRenderingRestClientOptionalParams + ) { if (endpoint === undefined) { throw new Error("'endpoint' cannot be null"); } diff --git a/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md b/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md index 3a08e7aa9156..d34ffea06c58 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md +++ b/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md @@ -7,8 +7,8 @@ ```yaml v3: true package-name: "@azure/mixedreality-remoterendering" -title: GeneratedClient -description: Example Client +title: RemoteRenderingRestClient +description: Azure Remote Rendering Client generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ From dda6082d3b140c59deb7f54a5c1a7dab485d99cd Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 17 Feb 2021 16:16:45 +0000 Subject: [PATCH 004/166] Use sts SDK --- .../mixedreality-remoterendering/package.json | 3 +- .../src/options.ts | 19 +++++ .../src/remoteRenderingAccount.ts | 20 ++++++ .../src/remoteRenderingClient.ts | 72 ++++++++++++++++--- 4 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/options.ts create mode 100644 sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/package.json b/sdk/mixedreality/mixedreality-remoterendering/package.json index 7c6f68b1b6fe..f97a7f357147 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/package.json +++ b/sdk/mixedreality/mixedreality-remoterendering/package.json @@ -77,7 +77,8 @@ "@azure/core-tracing": "1.0.0-preview.9", "@azure/logger": "^1.0.0", "@opentelemetry/api": "^0.10.2", - "tslib": "^2.0.0" + "tslib": "^2.0.0", + "@azure/mixedreality-authentication": "1.0.0-beta.1" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/options.ts b/sdk/mixedreality/mixedreality-remoterendering/src/options.ts new file mode 100644 index 000000000000..58458c5ffd2f --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/options.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PipelineOptions } from "@azure/core-http"; + +/** + * Options to create the MixedRealityStsClient. + */ +export interface RemoteRenderingClientOptions extends PipelineOptions { + /** + * Overrides the Mixed Reality STS service endpoint. + */ + authenticationEndpointUrl?: string; +} + +/** + * Options to create the MixedRealityStsClient. + */ +//export interface GetTokenOptions extends OperationOptions {} diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts new file mode 100644 index 000000000000..1f3513694781 --- /dev/null +++ b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +class RemoteRenderingAccount { + public readonly accountId : string; + + public readonly accountDomain : string; + + // TODO UUID? + constructor(accountId : string, accountDomain : string) { + if (!accountId) { + throw new Error("Argument cannot be null or empty: 'accountId'."); + } + if (!accountDomain) { + throw new Error("Argument cannot be null or empty: 'accountDomain'."); + } + this.accountId = accountId; + this.accountDomain = accountDomain; + } +} diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts index 1ebed2c71429..f7e8b26159bc 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -1,28 +1,35 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* + import { - PipelineOptions, + //PipelineOptions, TokenCredential, - OperationOptions, + //OperationOptions, bearerTokenAuthenticationPolicy, createPipelineFromOptions, InternalPipelineOptions } from "@azure/core-http"; -import { CanonicalCode } from "@opentelemetry/api"; +//import { CanonicalCode } from "@opentelemetry/api"; + + +import { RemoteRenderingRestClient } from "./generated"; +import { RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; + +import { RemoteRenderingClientOptions } from "./options"; +import { RemoteRenderingAccount } from "./remoteRenderingAccount"; -*/ -//import { GeneratedClient } from "./generated"; -//import { SDK_VERSION } from "./constants"; -//import { logger } from "./logger"; +import { SDK_VERSION } from "./constants"; +import { logger } from "./logger"; //import { createSpan } from "./tracing"; +import { constructAuthenticationEndpointFromDomain } from "../../mixedreality-authentication/src/util/authenticationEndpoint"; + /** * The client class used to interact with the App Configuration service. */ export class RemoteRenderingClient { - //private client: GeneratedClient; + private client: RemoteRenderingRestClient; /** * Creates an instance of a MixedRealityStsClient. @@ -31,7 +38,50 @@ export class RemoteRenderingClient { * @param keyCredential The Mixed Reality service account primary or secondary key credential. * @param options Additional client options. */ - constructor() { - // this.client = new GeneratedClient(); + constructor(endpoint: string, account: RemoteRenderingAccount, tokenCredential: TokenCredential, options: RemoteRenderingClientOptions = {}) { + + // The below code helps us set a proper User-Agent header on all requests + const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; + + if (!options.userAgentOptions) { + options.userAgentOptions = {}; + } + + const userAgentOptions = { ...options.userAgentOptions }; + if (options.userAgentOptions.userAgentPrefix) { + userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`; + } else { + userAgentOptions.userAgentPrefix = libInfo; + } + + const internalPipelineOptions: InternalPipelineOptions = { + ...{ ...options, userAgentOptions }, + ...{ + loggingOptions: { + logger: logger.info, + // This array contains header names we want to log that are not already + // included as safe. Unknown/unsafe headers are logged as "". + allowedHeaderNames: ["X-MRC-CV", "MS-CV"] + } + } + }; + + const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(account.domain); + + const mrTokenCredential : TokenCredential = new MixedRealityTokenCredential(account.AccountId, authenticationEndpoint, tokenCredential); + + const authPolicy = bearerTokenAuthenticationPolicy( + mrTokenCredential, + `${endpoint}/.default` + ); + const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); + + const clientOptions: RemoteRenderingRestClientOptionalParams = { + ...internalPipelineOptions, + ...pipeline, + endpoint: endpoint + }; + + this.client = new RemoteRenderingRestClient(endpoint, clientOptions); } } From 8dc25c9dee772579e26dae3b8aba9ab2ffd4d59c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 25 Feb 2021 13:30:07 +0000 Subject: [PATCH 005/166] Move files to the remoterendering SDK folder --- dataplane.code-workspace | 2 +- rush.json | 2 +- .../mixedreality-remoterendering/.nycrc | 0 .../mixedreality-remoterendering/CHANGELOG.md | 0 .../mixedreality-remoterendering/LICENSE | 0 .../mixedreality-remoterendering/README-EXAMPLE.md | 0 .../mixedreality-remoterendering/README.md | 0 .../mixedreality-remoterendering/api-extractor.json | 0 .../mixedreality-remoterendering/karma.conf.js | 0 .../mixedreality-remoterendering/package.json | 2 +- .../review/mixedreality-remoterendering.api.md | 0 .../mixedreality-remoterendering/review/template.api.md | 0 .../mixedreality-remoterendering/rollup.config.js | 0 .../mixedreality-remoterendering/sample.env | 0 .../mixedreality-remoterendering/src/constants.ts | 0 .../mixedreality-remoterendering/src/generated/index.ts | 0 .../mixedreality-remoterendering/src/generated/models/index.ts | 0 .../src/generated/models/mappers.ts | 0 .../src/generated/models/parameters.ts | 0 .../src/generated/operations/index.ts | 0 .../src/generated/operations/remoteRendering.ts | 0 .../src/generated/remoteRenderingRestClient.ts | 0 .../src/generated/remoteRenderingRestClientContext.ts | 0 .../mixedreality-remoterendering/src/index.ts | 0 .../mixedreality-remoterendering/src/logger.ts | 0 .../mixedreality-remoterendering/src/options.ts | 0 .../mixedreality-remoterendering/src/remoteRenderingAccount.ts | 0 .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 0 .../mixedreality-remoterendering/src/tracing.ts | 0 .../mixedreality-remoterendering/swagger/README.md | 0 .../mixedreality-remoterendering/tests.yml | 0 .../mixedreality-remoterendering/tsconfig.json | 0 32 files changed, 3 insertions(+), 3 deletions(-) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/.nycrc (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/CHANGELOG.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/LICENSE (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/README-EXAMPLE.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/README.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/api-extractor.json (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/karma.conf.js (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/package.json (98%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/review/template.api.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/rollup.config.js (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/sample.env (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/constants.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/index.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/models/index.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/models/mappers.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/models/parameters.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/operations/index.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/index.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/logger.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/options.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/remoteRenderingAccount.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/remoteRenderingClient.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/src/tracing.ts (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/swagger/README.md (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/tests.yml (100%) rename sdk/{mixedreality => remoterendering}/mixedreality-remoterendering/tsconfig.json (100%) diff --git a/dataplane.code-workspace b/dataplane.code-workspace index ea8b6f24204f..ebcceffa5a94 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -274,7 +274,7 @@ }, { "name": "mixedreality-remoterendering", - "path": "sdk/mixedreality/mixedreality-remoterendering" + "path": "sdk/remoterendering/mixedreality-remoterendering" } ], "settings": { diff --git a/rush.json b/rush.json index df3572d5a59b..156d42995f28 100644 --- a/rush.json +++ b/rush.json @@ -762,7 +762,7 @@ }, { "packageName": "@azure/mixedreality-remoterendering", - "projectFolder": "sdk/mixedreality/mixedreality-remoterendering", + "projectFolder": "sdk/remoterendering/mixedreality-remoterendering", "versionPolicyName": "client" } { diff --git a/sdk/mixedreality/mixedreality-remoterendering/.nycrc b/sdk/remoterendering/mixedreality-remoterendering/.nycrc similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/.nycrc rename to sdk/remoterendering/mixedreality-remoterendering/.nycrc diff --git a/sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md b/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/CHANGELOG.md rename to sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/LICENSE b/sdk/remoterendering/mixedreality-remoterendering/LICENSE similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/LICENSE rename to sdk/remoterendering/mixedreality-remoterendering/LICENSE diff --git a/sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md b/sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/README-EXAMPLE.md rename to sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/README.md rename to sdk/remoterendering/mixedreality-remoterendering/README.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/api-extractor.json b/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/api-extractor.json rename to sdk/remoterendering/mixedreality-remoterendering/api-extractor.json diff --git a/sdk/mixedreality/mixedreality-remoterendering/karma.conf.js b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/karma.conf.js rename to sdk/remoterendering/mixedreality-remoterendering/karma.conf.js diff --git a/sdk/mixedreality/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json similarity index 98% rename from sdk/mixedreality/mixedreality-remoterendering/package.json rename to sdk/remoterendering/mixedreality-remoterendering/package.json index f97a7f357147..7fa946e29043 100644 --- a/sdk/mixedreality/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -68,7 +68,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/mixedreality/mixedreality-remoterendering/README.md", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/remoterendering/mixedreality-remoterendering/README.md", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { diff --git a/sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md rename to sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/review/template.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/template.api.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/review/template.api.md rename to sdk/remoterendering/mixedreality-remoterendering/review/template.api.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/rollup.config.js b/sdk/remoterendering/mixedreality-remoterendering/rollup.config.js similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/rollup.config.js rename to sdk/remoterendering/mixedreality-remoterendering/rollup.config.js diff --git a/sdk/mixedreality/mixedreality-remoterendering/sample.env b/sdk/remoterendering/mixedreality-remoterendering/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/sample.env rename to sdk/remoterendering/mixedreality-remoterendering/sample.env diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/constants.ts b/sdk/remoterendering/mixedreality-remoterendering/src/constants.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/constants.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/constants.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/index.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/models/index.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/models/mappers.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/models/parameters.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/index.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/index.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/index.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/index.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/logger.ts b/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/logger.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/logger.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/options.ts b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/options.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/options.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingAccount.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/remoteRenderingClient.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts b/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/src/tracing.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts diff --git a/sdk/mixedreality/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/swagger/README.md rename to sdk/remoterendering/mixedreality-remoterendering/swagger/README.md diff --git a/sdk/mixedreality/mixedreality-remoterendering/tests.yml b/sdk/remoterendering/mixedreality-remoterendering/tests.yml similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/tests.yml rename to sdk/remoterendering/mixedreality-remoterendering/tests.yml diff --git a/sdk/mixedreality/mixedreality-remoterendering/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json similarity index 100% rename from sdk/mixedreality/mixedreality-remoterendering/tsconfig.json rename to sdk/remoterendering/mixedreality-remoterendering/tsconfig.json From bb7b5c0eb367a66662f2843e0e1c962235b1111b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 26 Feb 2021 18:08:00 +0000 Subject: [PATCH 006/166] Some auth code. --- .../mixedRealityTokenCredential.ts | 37 +++++++++++++++++++ .../staticAccessTokenCredential.ts | 23 ++++++++++++ .../src/remoteRenderingAccount.ts | 20 ---------- .../src/remoteRenderingClient.ts | 32 ++++++++++------ 4 files changed, 81 insertions(+), 31 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts create mode 100644 sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts new file mode 100644 index 000000000000..9b02857547dd --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + TokenCredential, + GetTokenOptions, + AccessToken +} from "@azure/core-http"; + +import { MixedRealityStsClient, MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; +import { StaticAccessTokenCredential } from "./staticAccessTokenCredential" +import { v4 as uuid } from "uuid"; + +class MixedRealityTokenCredential implements TokenCredential { + + private stsClient : MixedRealityStsClient; + + constructor(accountId : uuid, accountDomain : string, credential : TokenCredential, options : MixedRealityStsClientOptions) { + this.stsClient = new MixedRealityStsClient(accountId, accountDomain, credential, options); + } + + getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + return this.stsClient.getToken(options); + } + + static getMixedRealityCredential(accountId : uuid, accountDomain : string, credential : TokenCredential, options : MixedRealityStsClientOptions) : TokenCredential { + var token = credential as StaticAccessTokenCredential; + if (token) + { + // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange + // them using the MixedRealityTokenCredential. + return credential; + } + + return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); + } +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts new file mode 100644 index 000000000000..b2f727308908 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + TokenCredential, + GetTokenOptions, + AccessToken +} from "@azure/core-http"; + +class StaticAccessTokenCredential implements TokenCredential +{ + private token : AccessToken; + + constructor(token : AccessToken) { + this.token = token; + } + + getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + return new Promise(function(resolve, reject){ + return this.token; + }); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts deleted file mode 100644 index 1f3513694781..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingAccount.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -class RemoteRenderingAccount { - public readonly accountId : string; - - public readonly accountDomain : string; - - // TODO UUID? - constructor(accountId : string, accountDomain : string) { - if (!accountId) { - throw new Error("Argument cannot be null or empty: 'accountId'."); - } - if (!accountDomain) { - throw new Error("Argument cannot be null or empty: 'accountDomain'."); - } - this.accountId = accountId; - this.accountDomain = accountDomain; - } -} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index f7e8b26159bc..5fa3cd73fed2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. - import { //PipelineOptions, TokenCredential, @@ -12,12 +11,11 @@ import { } from "@azure/core-http"; //import { CanonicalCode } from "@opentelemetry/api"; - import { RemoteRenderingRestClient } from "./generated"; import { RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; import { RemoteRenderingClientOptions } from "./options"; -import { RemoteRenderingAccount } from "./remoteRenderingAccount"; +import { MixedRealityTokenCredential } from "../authentication/MixedRealityTokenCredential" import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; @@ -38,8 +36,13 @@ export class RemoteRenderingClient { * @param keyCredential The Mixed Reality service account primary or secondary key credential. * @param options Additional client options. */ - constructor(endpoint: string, account: RemoteRenderingAccount, tokenCredential: TokenCredential, options: RemoteRenderingClientOptions = {}) { - + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + tokenCredential: TokenCredential, + options: RemoteRenderingClientOptions = {} + ) { // The below code helps us set a proper User-Agent header on all requests const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; @@ -66,14 +69,17 @@ export class RemoteRenderingClient { } }; - const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(account.domain); - - const mrTokenCredential : TokenCredential = new MixedRealityTokenCredential(account.AccountId, authenticationEndpoint, tokenCredential); + const authenticationEndpoint = + options.authenticationEndpointUrl ?? + constructAuthenticationEndpointFromDomain(accountDomain); - const authPolicy = bearerTokenAuthenticationPolicy( - mrTokenCredential, - `${endpoint}/.default` + const mrTokenCredential: TokenCredential = new MixedRealityTokenCredential( + accountId, + authenticationEndpoint, + tokenCredential ); + + const authPolicy = bearerTokenAuthenticationPolicy(mrTokenCredential, `${endpoint}/.default`); const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); const clientOptions: RemoteRenderingRestClientOptionalParams = { @@ -84,4 +90,8 @@ export class RemoteRenderingClient { this.client = new RemoteRenderingRestClient(endpoint, clientOptions); } + + constructor() { + + } } From 70c828ace3feb996b896b520e66c5d748540c31d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 2 Mar 2021 12:19:46 +0000 Subject: [PATCH 007/166] More auth code --- .../mixedRealityAccountKeyCredential.ts | 27 ++++++++ .../mixedRealityTokenCredential.ts | 65 ++++++++++--------- .../staticAccessTokenCredential.ts | 25 +++---- .../src/remoteRenderingClient.ts | 58 ++++++++++++++--- 4 files changed, 120 insertions(+), 55 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts new file mode 100644 index 000000000000..866d00d83883 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; + +import { v4 as uuid } from "uuid"; + +import { AzureKeyCredential } from "@azure/core-auth"; + +export class MixedRealityAccountKeyCredential implements TokenCredential { + private accountId : string; + private accountKey : AzureKeyCredential; + + /// + /// Initializes a new instance of the class. + /// + /// The Mixed Reality service account identifier. + /// The Mixed Reality service account primary or secondary key. + constructor(accountId : string, accountKey : AzureKeyCredential) { + this.accountId = accountId; + this.accountKey = accountKey; + } + + getToken(scopes: string | string[], options?: GetTokenOptions) : Promise { + return new Promise((resolve, reject) => ({ token: (this.accountId + ":" + this.accountKey), expiresOnTimestamp: Number.MAX_VALUE }) ); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts index 9b02857547dd..d980ea52214a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts @@ -1,37 +1,44 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - TokenCredential, - GetTokenOptions, - AccessToken -} from "@azure/core-http"; +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { MixedRealityStsClient, MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; -import { StaticAccessTokenCredential } from "./staticAccessTokenCredential" +import { + MixedRealityStsClient, + MixedRealityStsClientOptions +} from "@azure/mixedreality-authentication"; +import { StaticAccessTokenCredential } from "./staticAccessTokenCredential"; import { v4 as uuid } from "uuid"; -class MixedRealityTokenCredential implements TokenCredential { - - private stsClient : MixedRealityStsClient; - - constructor(accountId : uuid, accountDomain : string, credential : TokenCredential, options : MixedRealityStsClientOptions) { - this.stsClient = new MixedRealityStsClient(accountId, accountDomain, credential, options); +export class MixedRealityTokenCredential implements TokenCredential { + private stsClient: MixedRealityStsClient; + + constructor( + accountId: uuid, + accountDomain: string, + credential: TokenCredential, + options: MixedRealityStsClientOptions + ) { + this.stsClient = new MixedRealityStsClient(accountId, accountDomain, credential, options); + } + + getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + return this.stsClient.getToken(options); + } + + static getMixedRealityCredential( + accountId: uuid, + accountDomain: string, + credential: TokenCredential, + options: MixedRealityStsClientOptions + ): TokenCredential { + var token = credential as StaticAccessTokenCredential; + if (token) { + // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange + // them using the MixedRealityTokenCredential. + return credential; } - getToken(scopes: string | string[], options?: GetTokenOptions): Promise { - return this.stsClient.getToken(options); - } - - static getMixedRealityCredential(accountId : uuid, accountDomain : string, credential : TokenCredential, options : MixedRealityStsClientOptions) : TokenCredential { - var token = credential as StaticAccessTokenCredential; - if (token) - { - // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange - // them using the MixedRealityTokenCredential. - return credential; - } - - return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); - } -} \ No newline at end of file + return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index b2f727308908..20c8ace5ca0c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -1,23 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - TokenCredential, - GetTokenOptions, - AccessToken -} from "@azure/core-http"; +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -class StaticAccessTokenCredential implements TokenCredential -{ - private token : AccessToken; +export class StaticAccessTokenCredential implements TokenCredential { + private token: AccessToken; - constructor(token : AccessToken) { - this.token = token; - } + constructor(token: AccessToken) { + this.token = token; + } - getToken(scopes: string | string[], options?: GetTokenOptions): Promise { - return new Promise(function(resolve, reject){ - return this.token; - }); - } + getToken(scopes: string | string[], options?: GetTokenOptions) : Promise { + return new Promise((resolve, reject) => this.token); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 5fa3cd73fed2..b9c5a758b4fb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -11,17 +11,23 @@ import { } from "@azure/core-http"; //import { CanonicalCode } from "@opentelemetry/api"; +import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; + import { RemoteRenderingRestClient } from "./generated"; import { RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; import { RemoteRenderingClientOptions } from "./options"; -import { MixedRealityTokenCredential } from "../authentication/MixedRealityTokenCredential" +import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; +import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; + +import { MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; //import { createSpan } from "./tracing"; -import { constructAuthenticationEndpointFromDomain } from "../../mixedreality-authentication/src/util/authenticationEndpoint"; +import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; +import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; /** * The client class used to interact with the App Configuration service. @@ -40,7 +46,37 @@ export class RemoteRenderingClient { endpoint: string, accountId: string, accountDomain: string, - tokenCredential: TokenCredential, + credential: AzureKeyCredential, + options: RemoteRenderingClientOptions + ); + + /** + * Creates an instance of a MixedRealityStsClient. + * @param accountId The Mixed Reality service account identifier. + * @param accountDomain The Mixed Reality service account domain. + * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * @param options Additional client options. + */ + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + credential: TokenCredential, + options: RemoteRenderingClientOptions + ); + + /** + * Creates an instance of a MixedRealityStsClient. + * @param accountId The Mixed Reality service account identifier. + * @param accountDomain The Mixed Reality service account domain. + * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * @param options Additional client options. + */ + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + credential: TokenCredential | AzureKeyCredential | AccessToken, options: RemoteRenderingClientOptions = {} ) { // The below code helps us set a proper User-Agent header on all requests @@ -69,14 +105,19 @@ export class RemoteRenderingClient { } }; + const tokenCredential : TokenCredential = + (credential as AzureKeyCredential) ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) : + (credential as AccessToken) ? new StaticAccessTokenCredential(credential as AccessToken) : + (credential as TokenCredential); + const authenticationEndpoint = - options.authenticationEndpointUrl ?? - constructAuthenticationEndpointFromDomain(accountDomain); + options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); - const mrTokenCredential: TokenCredential = new MixedRealityTokenCredential( + const mrTokenCredential: TokenCredential = MixedRealityTokenCredential.getMixedRealityCredential( accountId, authenticationEndpoint, - tokenCredential + tokenCredential, + { customEndpointUrl: authenticationEndpoint } ); const authPolicy = bearerTokenAuthenticationPolicy(mrTokenCredential, `${endpoint}/.default`); @@ -91,7 +132,4 @@ export class RemoteRenderingClient { this.client = new RemoteRenderingRestClient(endpoint, clientOptions); } - constructor() { - - } } From 6dbbc744dbc6c6881b220e414501a3a69e989dbc Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 2 Mar 2021 12:32:31 +0000 Subject: [PATCH 008/166] Use _ prefix for unused parameters. --- .../mixedRealityAccountKeyCredential.ts | 33 ++++++++++--------- .../mixedRealityTokenCredential.ts | 7 ++-- .../staticAccessTokenCredential.ts | 4 +-- .../src/remoteRenderingClient.ts | 14 ++++---- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index 866d00d83883..4156c17afd65 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -3,25 +3,26 @@ import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; -import { v4 as uuid } from "uuid"; - import { AzureKeyCredential } from "@azure/core-auth"; export class MixedRealityAccountKeyCredential implements TokenCredential { - private accountId : string; - private accountKey : AzureKeyCredential; + private accountId: string; + private accountKey: AzureKeyCredential; - /// - /// Initializes a new instance of the class. - /// - /// The Mixed Reality service account identifier. - /// The Mixed Reality service account primary or secondary key. - constructor(accountId : string, accountKey : AzureKeyCredential) { - this.accountId = accountId; - this.accountKey = accountKey; - } + /// + /// Initializes a new instance of the class. + /// + /// The Mixed Reality service account identifier. + /// The Mixed Reality service account primary or secondary key. + constructor(accountId: string, accountKey: AzureKeyCredential) { + this.accountId = accountId; + this.accountKey = accountKey; + } - getToken(scopes: string | string[], options?: GetTokenOptions) : Promise { - return new Promise((resolve, reject) => ({ token: (this.accountId + ":" + this.accountKey), expiresOnTimestamp: Number.MAX_VALUE }) ); - } + getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { + return new Promise((_resolve, _reject) => ({ + token: this.accountId + ":" + this.accountKey, + expiresOnTimestamp: Number.MAX_VALUE + })); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts index d980ea52214a..a51784a9d901 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts @@ -8,13 +8,12 @@ import { MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; import { StaticAccessTokenCredential } from "./staticAccessTokenCredential"; -import { v4 as uuid } from "uuid"; export class MixedRealityTokenCredential implements TokenCredential { private stsClient: MixedRealityStsClient; constructor( - accountId: uuid, + accountId: string, accountDomain: string, credential: TokenCredential, options: MixedRealityStsClientOptions @@ -22,12 +21,12 @@ export class MixedRealityTokenCredential implements TokenCredential { this.stsClient = new MixedRealityStsClient(accountId, accountDomain, credential, options); } - getToken(scopes: string | string[], options?: GetTokenOptions): Promise { + getToken(_scopes: string | string[], options?: GetTokenOptions): Promise { return this.stsClient.getToken(options); } static getMixedRealityCredential( - accountId: uuid, + accountId: string, accountDomain: string, credential: TokenCredential, options: MixedRealityStsClientOptions diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index 20c8ace5ca0c..9ccbd3aefe41 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -10,7 +10,7 @@ export class StaticAccessTokenCredential implements TokenCredential { this.token = token; } - getToken(scopes: string | string[], options?: GetTokenOptions) : Promise { - return new Promise((resolve, reject) => this.token); + getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { + return new Promise((_resolve, _reject) => this.token); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index b9c5a758b4fb..d7c5442dcb28 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -20,8 +20,6 @@ import { RemoteRenderingClientOptions } from "./options"; import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; -import { MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; - import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; //import { createSpan } from "./tracing"; @@ -49,7 +47,7 @@ export class RemoteRenderingClient { credential: AzureKeyCredential, options: RemoteRenderingClientOptions ); - + /** * Creates an instance of a MixedRealityStsClient. * @param accountId The Mixed Reality service account identifier. @@ -105,10 +103,11 @@ export class RemoteRenderingClient { } }; - const tokenCredential : TokenCredential = - (credential as AzureKeyCredential) ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) : - (credential as AccessToken) ? new StaticAccessTokenCredential(credential as AccessToken) : - (credential as TokenCredential); + const tokenCredential: TokenCredential = (credential as AzureKeyCredential) + ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) + : (credential as AccessToken) + ? new StaticAccessTokenCredential(credential as AccessToken) + : (credential as TokenCredential); const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); @@ -131,5 +130,4 @@ export class RemoteRenderingClient { this.client = new RemoteRenderingRestClient(endpoint, clientOptions); } - } From daa00209002dacbdd212c4212b5b97787edba06e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 4 Mar 2021 11:23:20 +0000 Subject: [PATCH 009/166] Switch to non-preview API and rename classes --- .../swagger/README.md | 98 ++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index d34ffea06c58..057ff722674f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -13,7 +13,7 @@ generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../ source-code-folder-path: ./src/generated -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/92aa7802beffd6bdae18b808e45c4897de2cb2e2/specification/mixedreality/data-plane/Microsoft.MixedReality/preview/2021-01-01-preview/mr-arr.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2a65b0a2bbd9113b91c889f187d8778c2725c0b9/specification/mixedreality/data-plane/Microsoft.MixedReality/stable/2021-01-01/mr-arr.json add-credentials: false package-version: 1.0.0-beta.1 disable-async-iterators: true @@ -21,3 +21,99 @@ hide-clients: true use-extension: "@autorest/typescript": "6.0.0-dev.20210121.2" ``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion + transform: > + $["x-ms-client-name"] = "AssetConversion"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_output + transform: > + $["x-ms-client-name"] = "AssetConversionOutput"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings + transform: > + $["x-ms-client-name"] = "AssetConversionOptions"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_input_settings + transform: > + $["x-ms-client-name"] = "AssetConversionInputOptions"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_output_settings + transform: > + $["x-ms-client-name"] = "AssetConversionOutputOptions"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_status + transform: > + $["x-ms-client-name"] = "AssetConversionStatus"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.error + transform: > + $["x-ms-client-name"] = "RemoteRenderingServiceError"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties + transform: > + $["x-ms-client-name"] = "RenderingSession"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_size + transform: > + $["x-ms-client-name"] = "RenderingServerSize"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.create_session_settings + transform: > + $["x-ms-client-name"] = "RenderingSessionOptions"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_status + transform: > + $["x-ms-client-name"] = "RenderingSessionStatus"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.update_session_settings + transform: > + $["x-ms-client-name"] = "UpdateSessionOptions"; +``` From b1431134e1c58b7e53e02f573f36109d08e9074f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 4 Mar 2021 11:23:47 +0000 Subject: [PATCH 010/166] Take latest generated code --- .../src/generated/models/index.ts | 58 +++++++++---------- .../src/generated/models/mappers.ts | 54 ++++++++--------- .../src/generated/models/parameters.ts | 10 ++-- .../generated/operations/remoteRendering.ts | 22 +++---- .../remoteRenderingRestClientContext.ts | 2 +- 5 files changed, 73 insertions(+), 73 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index f794d5bcbe4a..692bb894ceff 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -11,19 +11,19 @@ import * as coreHttp from "@azure/core-http"; /** Request to start a conversion */ export interface CreateConversionSettings { /** Conversion settings describe the origin of input files and destination of output files. */ - settings: ConversionSettings; + settings: AssetConversionOptions; } /** Conversion settings describe the origin of input files and destination of output files. */ -export interface ConversionSettings { +export interface AssetConversionOptions { /** Conversion input settings describe the origin of conversion input. */ - inputLocation: ConversionInputSettings; + inputLocation: AssetConversionInputOptions; /** Conversion output settings describe the destination of conversion output. */ - outputLocation: ConversionOutputSettings; + outputLocation: AssetConversionOutputOptions; } /** Conversion input settings describe the origin of conversion input. */ -export interface ConversionInputSettings { +export interface AssetConversionInputOptions { /** The URI of the Azure blob storage container containing the input model. */ storageContainerUri: string; /** An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ @@ -35,7 +35,7 @@ export interface ConversionInputSettings { } /** Conversion output settings describe the destination of conversion output. */ -export interface ConversionOutputSettings { +export interface AssetConversionOutputOptions { /** The URI of the Azure blob storage container where the result of the conversion should be written to. */ storageContainerUri: string; /** An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ @@ -47,18 +47,18 @@ export interface ConversionOutputSettings { } /** The properties of the conversion. */ -export interface Conversion { +export interface AssetConversion { /** The ID of the conversion supplied when the conversion was created. */ id: string; /** Conversion settings describe the origin of input files and destination of output files. */ - settings: ConversionSettings; + settings: AssetConversionOptions; /** * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly output?: ConversionOutput; /** The error object containing details about the conversion failure. */ - error: ErrorModel; + error: RemoteRenderingServiceError | null; /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ status: ConversionStatus; /** The time when the conversion was created. Date and time in ISO 8601 format. */ @@ -75,7 +75,7 @@ export interface ConversionOutput { } /** The error object containing details of why the request failed. */ -export interface ErrorModel { +export interface RemoteRenderingServiceError { /** Error code. */ code: string; /** A human-readable representation of the error. */ @@ -84,7 +84,7 @@ export interface ErrorModel { * An array of details about specific errors that led to this reported error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorModel[]; + readonly details?: RemoteRenderingServiceError[]; /** * The target of the particular error (e.g., the name of the property in error). * NOTE: This property will not be serialized. It can only be populated by the server. @@ -94,19 +94,19 @@ export interface ErrorModel { * An object containing more specific information than the current object about the error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly innerError?: ErrorModel; + readonly innerError?: RemoteRenderingServiceError; } /** The error response containing details of why the request failed. */ export interface ErrorResponse { /** The error object containing details of why the request failed. */ - error: ErrorModel; + error: RemoteRenderingServiceError; } /** List of conversions. */ export interface ConversionList { /** The list of conversions. */ - conversions: Conversion[]; + conversions: AssetConversion[]; /** * If more conversions are available this field will contain a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -115,7 +115,7 @@ export interface ConversionList { } /** Settings of the session to be created. */ -export interface CreateSessionSettings { +export interface RenderingSessionOptions { /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ maxLeaseTimeMinutes: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ @@ -123,7 +123,7 @@ export interface CreateSessionSettings { } /** The properties of a rendering session. */ -export interface SessionProperties { +export interface RenderingSession { /** The ID of the session supplied when the session was created. */ id: string; /** @@ -164,7 +164,7 @@ export interface SessionProperties { * The error object containing details about the rendering session startup failure. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: ErrorModel; + readonly error?: RemoteRenderingServiceError | null; /** * The time when the rendering session was created. Date and time in ISO 8601 format. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -173,7 +173,7 @@ export interface SessionProperties { } /** Settings used to update the session. */ -export interface UpdateSessionSettings { +export interface UpdateSessionOptions { /** Update to the time the session will run after it reached the 'Ready' state. It has to be larger than the current value of maxLeaseTimeMinutes and less than 1440. */ maxLeaseTimeMinutes: number; } @@ -181,7 +181,7 @@ export interface UpdateSessionSettings { /** The result of a list sessions request. */ export interface SessionsList { /** The list of rendering sessions. Does not include sessions in 'Stopped' state. */ - sessions: SessionProperties[]; + sessions: RenderingSession[]; /** * If more rendering sessions are available this field will contain a URL where the next batch of sessions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -377,14 +377,14 @@ export type SessionStatus = string; /** Contains response data for the createConversion operation. */ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & - Conversion & { + AssetConversion & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ bodyAsText: string; /** The response body as parsed JSON or XML */ - parsedBody: Conversion; + parsedBody: AssetConversion; /** The parsed HTTP response headers. */ parsedHeaders: RemoteRenderingCreateConversionHeaders; }; @@ -392,14 +392,14 @@ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConve /** Contains response data for the getConversion operation. */ export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & - Conversion & { + AssetConversion & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ bodyAsText: string; /** The response body as parsed JSON or XML */ - parsedBody: Conversion; + parsedBody: AssetConversion; /** The parsed HTTP response headers. */ parsedHeaders: RemoteRenderingGetConversionHeaders; }; @@ -421,38 +421,38 @@ export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversi }; /** Contains response data for the createSession operation. */ -export type RemoteRenderingCreateSessionResponse = SessionProperties & { +export type RemoteRenderingCreateSessionResponse = RenderingSession & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ bodyAsText: string; /** The response body as parsed JSON or XML */ - parsedBody: SessionProperties; + parsedBody: RenderingSession; }; }; /** Contains response data for the getSession operation. */ -export type RemoteRenderingGetSessionResponse = SessionProperties & { +export type RemoteRenderingGetSessionResponse = RenderingSession & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ bodyAsText: string; /** The response body as parsed JSON or XML */ - parsedBody: SessionProperties; + parsedBody: RenderingSession; }; }; /** Contains response data for the updateSession operation. */ -export type RemoteRenderingUpdateSessionResponse = SessionProperties & { +export type RemoteRenderingUpdateSessionResponse = RenderingSession & { /** The underlying HTTP response. */ _response: coreHttp.HttpResponse & { /** The response body as text (string format) */ bodyAsText: string; /** The response body as parsed JSON or XML */ - parsedBody: SessionProperties; + parsedBody: RenderingSession; }; }; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index c51d569ae67a..5ebd539e340b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -17,40 +17,40 @@ export const CreateConversionSettings: coreHttp.CompositeMapper = { serializedName: "settings", type: { name: "Composite", - className: "ConversionSettings" + className: "AssetConversionOptions" } } } } }; -export const ConversionSettings: coreHttp.CompositeMapper = { +export const AssetConversionOptions: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ConversionSettings", + className: "AssetConversionOptions", modelProperties: { inputLocation: { serializedName: "inputLocation", type: { name: "Composite", - className: "ConversionInputSettings" + className: "AssetConversionInputOptions" } }, outputLocation: { serializedName: "outputLocation", type: { name: "Composite", - className: "ConversionOutputSettings" + className: "AssetConversionOutputOptions" } } } } }; -export const ConversionInputSettings: coreHttp.CompositeMapper = { +export const AssetConversionInputOptions: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ConversionInputSettings", + className: "AssetConversionInputOptions", modelProperties: { storageContainerUri: { serializedName: "storageContainerUri", @@ -82,10 +82,10 @@ export const ConversionInputSettings: coreHttp.CompositeMapper = { } }; -export const ConversionOutputSettings: coreHttp.CompositeMapper = { +export const AssetConversionOutputOptions: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ConversionOutputSettings", + className: "AssetConversionOutputOptions", modelProperties: { storageContainerUri: { serializedName: "storageContainerUri", @@ -116,10 +116,10 @@ export const ConversionOutputSettings: coreHttp.CompositeMapper = { } }; -export const Conversion: coreHttp.CompositeMapper = { +export const AssetConversion: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "Conversion", + className: "AssetConversion", modelProperties: { id: { serializedName: "id", @@ -132,7 +132,7 @@ export const Conversion: coreHttp.CompositeMapper = { serializedName: "settings", type: { name: "Composite", - className: "ConversionSettings" + className: "AssetConversionOptions" } }, output: { @@ -146,7 +146,7 @@ export const Conversion: coreHttp.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorModel" + className: "RemoteRenderingServiceError" } }, status: { @@ -183,10 +183,10 @@ export const ConversionOutput: coreHttp.CompositeMapper = { } }; -export const ErrorModel: coreHttp.CompositeMapper = { +export const RemoteRenderingServiceError: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "RemoteRenderingServiceError", modelProperties: { code: { serializedName: "code", @@ -210,7 +210,7 @@ export const ErrorModel: coreHttp.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorModel" + className: "RemoteRenderingServiceError" } } } @@ -226,7 +226,7 @@ export const ErrorModel: coreHttp.CompositeMapper = { serializedName: "innerError", type: { name: "Composite", - className: "ErrorModel" + className: "RemoteRenderingServiceError" } } } @@ -242,7 +242,7 @@ export const ErrorResponse: coreHttp.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorModel" + className: "RemoteRenderingServiceError" } } } @@ -262,7 +262,7 @@ export const ConversionList: coreHttp.CompositeMapper = { element: { type: { name: "Composite", - className: "Conversion" + className: "AssetConversion" } } } @@ -278,10 +278,10 @@ export const ConversionList: coreHttp.CompositeMapper = { } }; -export const CreateSessionSettings: coreHttp.CompositeMapper = { +export const RenderingSessionOptions: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CreateSessionSettings", + className: "RenderingSessionOptions", modelProperties: { maxLeaseTimeMinutes: { serializedName: "maxLeaseTimeMinutes", @@ -301,10 +301,10 @@ export const CreateSessionSettings: coreHttp.CompositeMapper = { } }; -export const SessionProperties: coreHttp.CompositeMapper = { +export const RenderingSession: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "SessionProperties", + className: "RenderingSession", modelProperties: { id: { serializedName: "id", @@ -381,7 +381,7 @@ export const SessionProperties: coreHttp.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorModel" + className: "RemoteRenderingServiceError" } }, creationTime: { @@ -395,10 +395,10 @@ export const SessionProperties: coreHttp.CompositeMapper = { } }; -export const UpdateSessionSettings: coreHttp.CompositeMapper = { +export const UpdateSessionOptions: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "UpdateSessionSettings", + className: "UpdateSessionOptions", modelProperties: { maxLeaseTimeMinutes: { serializedName: "maxLeaseTimeMinutes", @@ -424,7 +424,7 @@ export const SessionsList: coreHttp.CompositeMapper = { element: { type: { name: "Composite", - className: "SessionProperties" + className: "RenderingSession" } } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts index a9bf1d9480f9..54927caadef4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts @@ -13,8 +13,8 @@ import { } from "@azure/core-http"; import { CreateConversionSettings as CreateConversionSettingsMapper, - CreateSessionSettings as CreateSessionSettingsMapper, - UpdateSessionSettings as UpdateSessionSettingsMapper + RenderingSessionOptions as RenderingSessionOptionsMapper, + UpdateSessionOptions as UpdateSessionOptionsMapper } from "../models/mappers"; export const contentType: OperationParameter = { @@ -61,7 +61,7 @@ export const endpoint: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-01-01-preview", + defaultValue: "2021-01-01", isConstant: true, serializedName: "api-version", type: { @@ -94,7 +94,7 @@ export const conversionId: OperationURLParameter = { export const body1: OperationParameter = { parameterPath: "body", - mapper: CreateSessionSettingsMapper + mapper: RenderingSessionOptionsMapper }; export const sessionId: OperationURLParameter = { @@ -110,7 +110,7 @@ export const sessionId: OperationURLParameter = { export const body2: OperationParameter = { parameterPath: "body", - mapper: UpdateSessionSettingsMapper + mapper: UpdateSessionOptionsMapper }; export const nextLink: OperationURLParameter = { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index 9ca7e2b49067..4b9b74594f2a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -15,10 +15,10 @@ import { RemoteRenderingCreateConversionResponse, RemoteRenderingGetConversionResponse, RemoteRenderingListConversionsResponse, - CreateSessionSettings, + RenderingSessionOptions, RemoteRenderingCreateSessionResponse, RemoteRenderingGetSessionResponse, - UpdateSessionSettings, + UpdateSessionOptions, RemoteRenderingUpdateSessionResponse, RemoteRenderingStopSessionResponse, RemoteRenderingListSessionsResponse, @@ -120,7 +120,7 @@ export class RemoteRendering { createSession( accountId: string, sessionId: string, - body: CreateSessionSettings, + body: RenderingSessionOptions, options?: coreHttp.OperationOptions ): Promise { const operationArguments: coreHttp.OperationArguments = { @@ -171,7 +171,7 @@ export class RemoteRendering { updateSession( accountId: string, sessionId: string, - body: UpdateSessionSettings, + body: UpdateSessionOptions, options?: coreHttp.OperationOptions ): Promise { const operationArguments: coreHttp.OperationArguments = { @@ -281,11 +281,11 @@ const createConversionOperationSpec: coreHttp.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Conversion, + bodyMapper: Mappers.AssetConversion, headersMapper: Mappers.RemoteRenderingCreateConversionHeaders }, 201: { - bodyMapper: Mappers.Conversion, + bodyMapper: Mappers.AssetConversion, headersMapper: Mappers.RemoteRenderingCreateConversionHeaders }, 400: { @@ -331,7 +331,7 @@ const getConversionOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Conversion, + bodyMapper: Mappers.AssetConversion, headersMapper: Mappers.RemoteRenderingGetConversionHeaders }, 401: { @@ -401,10 +401,10 @@ const createSessionOperationSpec: coreHttp.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.SessionProperties + bodyMapper: Mappers.RenderingSession }, 201: { - bodyMapper: Mappers.SessionProperties, + bodyMapper: Mappers.RenderingSession, headersMapper: Mappers.RemoteRenderingCreateSessionHeaders }, 400: { @@ -450,7 +450,7 @@ const getSessionOperationSpec: coreHttp.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SessionProperties + bodyMapper: Mappers.RenderingSession }, 401: { headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, @@ -488,7 +488,7 @@ const updateSessionOperationSpec: coreHttp.OperationSpec = { httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.SessionProperties + bodyMapper: Mappers.RenderingSession }, 401: { headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts index 3bd6adce2053..0f1dc1e3ae43 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts @@ -51,6 +51,6 @@ export class RemoteRenderingRestClientContext extends coreHttp.ServiceClient { this.endpoint = endpoint; // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "2021-01-01-preview"; + this.apiVersion = options.apiVersion || "2021-01-01"; } } From 4d5c8052c61cc9788e29f1e8d4e9acb5a5a6a4f1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 4 Mar 2021 13:21:28 +0000 Subject: [PATCH 011/166] Customize conversion properties --- .../src/generated/models/index.ts | 20 +++--- .../src/generated/models/mappers.ts | 22 +++--- .../src/remoteRenderingClient.ts | 4 ++ .../swagger/README.md | 69 ++++++++++++++++++- 4 files changed, 92 insertions(+), 23 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 692bb894ceff..6814c0349a5e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -17,15 +17,15 @@ export interface CreateConversionSettings { /** Conversion settings describe the origin of input files and destination of output files. */ export interface AssetConversionOptions { /** Conversion input settings describe the origin of conversion input. */ - inputLocation: AssetConversionInputOptions; + inputOptions: AssetConversionInputOptions; /** Conversion output settings describe the destination of conversion output. */ - outputLocation: AssetConversionOutputOptions; + outputOptions: AssetConversionOutputOptions; } /** Conversion input settings describe the origin of conversion input. */ export interface AssetConversionInputOptions { /** The URI of the Azure blob storage container containing the input model. */ - storageContainerUri: string; + storageContainerUrl: string; /** An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ storageContainerReadListSas?: string; /** Only Blobs starting with this prefix will be downloaded to perform the conversion. Optional. If not provided, all Blobs from the container will be downloaded. */ @@ -37,7 +37,7 @@ export interface AssetConversionInputOptions { /** Conversion output settings describe the destination of conversion output. */ export interface AssetConversionOutputOptions { /** The URI of the Azure blob storage container where the result of the conversion should be written to. */ - storageContainerUri: string; + storageContainerUrl: string; /** An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ storageContainerWriteSas?: string; /** A prefix which gets prepended in front of all files produced by the conversion process. Will be treated as a virtual folder. Optional. If not provided, output files will be stored at the container root. */ @@ -49,29 +49,29 @@ export interface AssetConversionOutputOptions { /** The properties of the conversion. */ export interface AssetConversion { /** The ID of the conversion supplied when the conversion was created. */ - id: string; + conversionId: string; /** Conversion settings describe the origin of input files and destination of output files. */ - settings: AssetConversionOptions; + options: AssetConversionOptions; /** * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly output?: ConversionOutput; + readonly output?: AssetConversionOutput; /** The error object containing details about the conversion failure. */ error: RemoteRenderingServiceError | null; /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ status: ConversionStatus; /** The time when the conversion was created. Date and time in ISO 8601 format. */ - creationTime: Date; + createdOn: Date; } /** Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. */ -export interface ConversionOutput { +export interface AssetConversionOutput { /** * URI of the asset generated by the conversion process. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly outputAssetUri?: string; + readonly outputAssetUrl?: string; } /** The error object containing details of why the request failed. */ diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 5ebd539e340b..0a52feb397e3 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -29,14 +29,14 @@ export const AssetConversionOptions: coreHttp.CompositeMapper = { name: "Composite", className: "AssetConversionOptions", modelProperties: { - inputLocation: { + inputOptions: { serializedName: "inputLocation", type: { name: "Composite", className: "AssetConversionInputOptions" } }, - outputLocation: { + outputOptions: { serializedName: "outputLocation", type: { name: "Composite", @@ -52,7 +52,7 @@ export const AssetConversionInputOptions: coreHttp.CompositeMapper = { name: "Composite", className: "AssetConversionInputOptions", modelProperties: { - storageContainerUri: { + storageContainerUrl: { serializedName: "storageContainerUri", required: true, type: { @@ -87,7 +87,7 @@ export const AssetConversionOutputOptions: coreHttp.CompositeMapper = { name: "Composite", className: "AssetConversionOutputOptions", modelProperties: { - storageContainerUri: { + storageContainerUrl: { serializedName: "storageContainerUri", required: true, type: { @@ -121,14 +121,14 @@ export const AssetConversion: coreHttp.CompositeMapper = { name: "Composite", className: "AssetConversion", modelProperties: { - id: { + conversionId: { serializedName: "id", required: true, type: { name: "String" } }, - settings: { + options: { serializedName: "settings", type: { name: "Composite", @@ -139,7 +139,7 @@ export const AssetConversion: coreHttp.CompositeMapper = { serializedName: "output", type: { name: "Composite", - className: "ConversionOutput" + className: "AssetConversionOutput" } }, error: { @@ -156,7 +156,7 @@ export const AssetConversion: coreHttp.CompositeMapper = { name: "String" } }, - creationTime: { + createdOn: { serializedName: "creationTime", required: true, type: { @@ -167,12 +167,12 @@ export const AssetConversion: coreHttp.CompositeMapper = { } }; -export const ConversionOutput: coreHttp.CompositeMapper = { +export const AssetConversionOutput: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ConversionOutput", + className: "AssetConversionOutput", modelProperties: { - outputAssetUri: { + outputAssetUrl: { serializedName: "outputAssetUri", readOnly: true, type: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index d7c5442dcb28..0feacd12b831 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -24,7 +24,9 @@ import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; //import { createSpan } from "./tracing"; +// TODO: Maybe copy and paste this? import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; + import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; /** @@ -130,4 +132,6 @@ export class RemoteRenderingClient { this.client = new RemoteRenderingRestClient(endpoint, clientOptions); } + + } diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 057ff722674f..642df5721672 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -33,9 +33,34 @@ directive: ```yaml directive: - from: swagger-document - where: $.definitions.conversion_output + where: $.definitions.conversion.properties.id transform: > - $["x-ms-client-name"] = "AssetConversionOutput"; + $["x-ms-client-name"] = "conversionId"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion.properties.settings + transform: > + $["x-ms-client-name"] = "options"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion.properties.creationTime + transform: > + $["x-ms-client-name"] = "createdOn"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions + transform: > + $["AssetConversionOutput"] = $.conversion.properties.output; + $.conversion.properties["output"] = {"$ref": "#/definitions/AssetConversionOutput"}; ``` ```yaml @@ -46,6 +71,22 @@ directive: $["x-ms-client-name"] = "AssetConversionOptions"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings.properties.inputLocation + transform: > + $["x-ms-client-name"] = "inputOptions"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings.properties.outputLocation + transform: > + $["x-ms-client-name"] = "outputOptions"; +``` + ```yaml directive: - from: swagger-document @@ -54,6 +95,14 @@ directive: $["x-ms-client-name"] = "AssetConversionInputOptions"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_input_settings.properties.storageContainerUri + transform: > + $["x-ms-client-name"] = "storageContainerUrl"; +``` + ```yaml directive: - from: swagger-document @@ -62,6 +111,14 @@ directive: $["x-ms-client-name"] = "AssetConversionOutputOptions"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_output_settings.properties.storageContainerUri + transform: > + $["x-ms-client-name"] = "storageContainerUrl"; +``` + ```yaml directive: - from: swagger-document @@ -70,6 +127,14 @@ directive: $["x-ms-client-name"] = "AssetConversionStatus"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.AssetConversionOutput.properties.outputAssetUri + transform: > + $["x-ms-client-name"] = "outputAssetUrl"; +``` + ```yaml directive: - from: swagger-document From 040d4337969a67e0facddaa0e81ebc62b04d38e7 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 4 Mar 2021 15:26:53 +0000 Subject: [PATCH 012/166] Rename some rendering properties --- .../src/generated/models/index.ts | 6 ++--- .../src/generated/models/mappers.ts | 6 ++--- .../swagger/README.md | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 6814c0349a5e..d4d95d90327a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -125,7 +125,7 @@ export interface RenderingSessionOptions { /** The properties of a rendering session. */ export interface RenderingSession { /** The ID of the session supplied when the session was created. */ - id: string; + sessionId: string; /** * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -145,7 +145,7 @@ export interface RenderingSession { * The hostname under which the rendering session is reachable. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hostname?: string; + readonly host?: string; /** * The time in minutes the session will run after reaching the 'Ready' state. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -169,7 +169,7 @@ export interface RenderingSession { * The time when the rendering session was created. Date and time in ISO 8601 format. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly creationTime?: Date; + readonly createdOn?: Date; } /** Settings used to update the session. */ diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 0a52feb397e3..b4e81ae58a52 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -306,7 +306,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { name: "Composite", className: "RenderingSession", modelProperties: { - id: { + sessionId: { serializedName: "id", required: true, type: { @@ -342,7 +342,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { name: "Number" } }, - hostname: { + host: { serializedName: "hostname", readOnly: true, type: { @@ -384,7 +384,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { className: "RemoteRenderingServiceError" } }, - creationTime: { + createdOn: { serializedName: "creationTime", readOnly: true, type: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 642df5721672..042ac347bbe1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -151,6 +151,30 @@ directive: $["x-ms-client-name"] = "RenderingSession"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.id + transform: > + $["x-ms-client-name"] = "sessionId"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.hostname + transform: > + $["x-ms-client-name"] = "host"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.creationTime + transform: > + $["x-ms-client-name"] = "createdOn"; +``` + ```yaml directive: - from: swagger-document From 296a2b8264e13fe7721f34d484121d90f909406a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 5 Mar 2021 12:08:04 +0000 Subject: [PATCH 013/166] Add getConversion method. --- .../src/remoteRenderingClient.ts | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 0feacd12b831..b48ffae1afc1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -2,14 +2,13 @@ // Licensed under the MIT license. import { - //PipelineOptions, TokenCredential, - //OperationOptions, + OperationOptions, bearerTokenAuthenticationPolicy, createPipelineFromOptions, - InternalPipelineOptions + InternalPipelineOptions, } from "@azure/core-http"; -//import { CanonicalCode } from "@opentelemetry/api"; +import { CanonicalCode } from "@opentelemetry/api"; import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; @@ -22,18 +21,22 @@ import { StaticAccessTokenCredential } from "../authentication/staticAccessToken import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; -//import { createSpan } from "./tracing"; +import { createSpan } from "./tracing"; // TODO: Maybe copy and paste this? import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; +import { AssetConversion } from "./generated/models/index" +import { RemoteRendering } from "./generated/operations"; + /** * The client class used to interact with the App Configuration service. */ export class RemoteRenderingClient { private client: RemoteRenderingRestClient; + private operations : RemoteRendering; /** * Creates an instance of a MixedRealityStsClient. @@ -131,7 +134,36 @@ export class RemoteRenderingClient { }; this.client = new RemoteRenderingRestClient(endpoint, clientOptions); + this.operations = new RemoteRendering(this.client); } - + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param options The options parameters. + */ + public async getConversion( + accountId: string, + conversionId: string, + options?: OperationOptions + ): Promise { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversion", { conversionId : conversionId, ...options }); + + try { + let result = await this.operations.getConversion(accountId, conversionId, updatedOptions); + + return Promise.resolve(result as AssetConversion); + } catch (e) { + span.setStatus({ + code: CanonicalCode.UNKNOWN, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } } From 1d046e07403c54156c4512f7784993a10d382846 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 8 Mar 2021 17:06:13 +0000 Subject: [PATCH 014/166] Fix customizations. --- .../src/generated/models/index.ts | 38 +++++++++---------- .../swagger/README.md | 6 +-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index d4d95d90327a..ea0c18dc9ee0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -60,7 +60,7 @@ export interface AssetConversion { /** The error object containing details about the conversion failure. */ error: RemoteRenderingServiceError | null; /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ - status: ConversionStatus; + status: AssetConversionStatus; /** The time when the conversion was created. Date and time in ISO 8601 format. */ createdOn: Date; } @@ -119,7 +119,7 @@ export interface RenderingSessionOptions { /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ maxLeaseTimeMinutes: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ - size: SessionSize; + size: RenderingServerSize; } /** The properties of a rendering session. */ @@ -152,9 +152,9 @@ export interface RenderingSession { */ readonly maxLeaseTimeMinutes?: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ - size: SessionSize; + size: RenderingServerSize; /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ - status: SessionStatus; + status: RenderingSessionStatus; /** * The computational power of the rendering session GPU measured in teraflops. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -303,8 +303,8 @@ export interface RemoteRenderingListSessionsNextExceptionHeaders { wWWAuthenticate?: string; } -/** Known values of {@link ConversionStatus} that the service accepts. */ -export const enum KnownConversionStatus { +/** Known values of {@link AssetConversionStatus} that the service accepts. */ +export const enum KnownAssetConversionStatus { /** The conversion was created but hasn't started. */ NotStarted = "NotStarted", /** The conversion is running. */ @@ -318,8 +318,8 @@ export const enum KnownConversionStatus { } /** - * Defines values for ConversionStatus. \ - * {@link KnownConversionStatus} can be used interchangeably with ConversionStatus, + * Defines values for AssetConversionStatus. \ + * {@link KnownAssetConversionStatus} can be used interchangeably with AssetConversionStatus, * this enum contains the known values that the service supports. * ### Know values supported by the service * **NotStarted**: The conversion was created but hasn't started. \ @@ -328,10 +328,10 @@ export const enum KnownConversionStatus { * **Failed**: The conversion has failed. Check the 'error' field for more details. This is a terminal state. \ * **Succeeded**: The conversion has succeeded. Check the 'output' field for output asset location. This is a terminal state. */ -export type ConversionStatus = string; +export type AssetConversionStatus = string; -/** Known values of {@link SessionSize} that the service accepts. */ -export const enum KnownSessionSize { +/** Known values of {@link RenderingServerSize} that the service accepts. */ +export const enum KnownRenderingServerSize { /** Standard rendering session size. */ Standard = "Standard", /** Premium rendering session size. */ @@ -339,17 +339,17 @@ export const enum KnownSessionSize { } /** - * Defines values for SessionSize. \ - * {@link KnownSessionSize} can be used interchangeably with SessionSize, + * Defines values for RenderingServerSize. \ + * {@link KnownRenderingServerSize} can be used interchangeably with RenderingServerSize, * this enum contains the known values that the service supports. * ### Know values supported by the service * **Standard**: Standard rendering session size. \ * **Premium**: Premium rendering session size. */ -export type SessionSize = string; +export type RenderingServerSize = string; -/** Known values of {@link SessionStatus} that the service accepts. */ -export const enum KnownSessionStatus { +/** Known values of {@link RenderingSessionStatus} that the service accepts. */ +export const enum KnownRenderingSessionStatus { /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ Error = "Error", /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ @@ -363,8 +363,8 @@ export const enum KnownSessionStatus { } /** - * Defines values for SessionStatus. \ - * {@link KnownSessionStatus} can be used interchangeably with SessionStatus, + * Defines values for RenderingSessionStatus. \ + * {@link KnownRenderingSessionStatus} can be used interchangeably with RenderingSessionStatus, * this enum contains the known values that the service supports. * ### Know values supported by the service * **Error**: The rendering session has encountered an error, and is unusable. This is a terminal state. \ @@ -373,7 +373,7 @@ export const enum KnownSessionStatus { * **Ready**: The rendering session is ready for incoming connections. \ * **Stopped**: The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ -export type SessionStatus = string; +export type RenderingSessionStatus = string; /** Contains response data for the createConversion operation. */ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 042ac347bbe1..c69971ebdd47 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -124,7 +124,7 @@ directive: - from: swagger-document where: $.definitions.conversion_status transform: > - $["x-ms-client-name"] = "AssetConversionStatus"; + $["x-ms-enum"].name = "AssetConversionStatus"; ``` ```yaml @@ -180,7 +180,7 @@ directive: - from: swagger-document where: $.definitions.session_size transform: > - $["x-ms-client-name"] = "RenderingServerSize"; + $["x-ms-enum"].name = "RenderingServerSize"; ``` ```yaml @@ -196,7 +196,7 @@ directive: - from: swagger-document where: $.definitions.session_status transform: > - $["x-ms-client-name"] = "RenderingSessionStatus"; + $["x-ms-enum"].name = "RenderingSessionStatus"; ``` ```yaml From 63d466ac119c66ee11d0087df4d0a93f4101d530 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 8 Mar 2021 17:06:58 +0000 Subject: [PATCH 015/166] Basic shape of conversion LRO --- .../mixedreality-remoterendering/package.json | 4 +- .../src/lro/assetConversionPoller.ts | 106 ++++++++++++++++++ .../src/remoteRenderingClient.ts | 37 ++++-- 3 files changed, 138 insertions(+), 9 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 7fa946e29043..13f14d2c3707 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -78,7 +78,9 @@ "@azure/logger": "^1.0.0", "@opentelemetry/api": "^0.10.2", "tslib": "^2.0.0", - "@azure/mixedreality-authentication": "1.0.0-beta.1" + "@azure/mixedreality-authentication": "1.0.0-beta.1", + "@azure/core-lro": "^1.0.2", + "@azure/abort-controller": "^1.0.0" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts new file mode 100644 index 000000000000..7ceb02e38704 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; +import { RemoteRenderingClient } from "../remoteRenderingClient"; +import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; + +import { AbortSignalLike } from "@azure/abort-controller"; + +export class AssetConversionOperationState implements PollOperationState { + client : RemoteRenderingClient; + accountId : string; + conversionState : AssetConversion; + + constructor(client : RemoteRenderingClient, accountId : string, conversionState : AssetConversion) + { + this.client = client; + this.accountId = accountId; + this.conversionState = conversionState; + } + + get isStarted() : boolean { + return true; + } + + get isCompleted() : boolean { + return (this.conversionState.status != KnownAssetConversionStatus.NotStarted) && (this.conversionState.status != KnownAssetConversionStatus.Running); + } + + get isCancelled() : boolean { + return false; + } + + get error() : Error | undefined { + if (this.conversionState.error != null) { + //TODO Add details. + return new Error(this.conversionState.error.message); + } + return undefined; + } + + get result(): AssetConversion { + return this.conversionState; + } +} + +class AssetConversionOperation implements PollOperation { + state : AssetConversionOperationState; + + constructor(state : AssetConversionOperationState) { + this.state = state; + } + + update(_options?: { + abortSignal?: AbortSignalLike; + fireProgress?: (state: AssetConversionOperationState) => void; + }): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * It returns a promise that should be resolved with an updated version of the poller's operation. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Serializes the operation. + * Useful when wanting to create a poller that monitors an existing operation. + */ + toString(): string { + throw new Error("Not yet implemented."); + } +} + +export class AssetConversionPoller extends Poller { + /** + * Defines how much time the poller is going to wait before making a new request to the service. + */ + public intervalInMs: number = 10000; + + constructor(client : RemoteRenderingClient, accountId : string, assetConversion : AssetConversion) { + super(new AssetConversionOperation(new AssetConversionOperationState(client, accountId, assetConversion))); + } + + /** + * The method used by the poller to wait before attempting to update its operation. + */ + async delay(): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Gets the public state of the polling operation + */ + public getOperationState(): AssetConversionOperationState { + throw new Error("Not yet implemented."); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index b48ffae1afc1..52523e38fc6a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -6,15 +6,17 @@ import { OperationOptions, bearerTokenAuthenticationPolicy, createPipelineFromOptions, - InternalPipelineOptions, + InternalPipelineOptions } from "@azure/core-http"; import { CanonicalCode } from "@opentelemetry/api"; import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; -import { RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; +import { AssetConversionOptions, RemoteRenderingCreateConversionResponse, RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; +// TODO: Maybe copy and paste this? +import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; import { RemoteRenderingClientOptions } from "./options"; import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; @@ -23,20 +25,21 @@ import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; import { createSpan } from "./tracing"; -// TODO: Maybe copy and paste this? -import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; +import { PollerLike } from "@azure/core-lro"; + import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; -import { AssetConversion } from "./generated/models/index" +import { AssetConversion } from "./generated/models/index"; import { RemoteRendering } from "./generated/operations"; +import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; /** * The client class used to interact with the App Configuration service. */ export class RemoteRenderingClient { private client: RemoteRenderingRestClient; - private operations : RemoteRendering; + private operations: RemoteRendering; /** * Creates an instance of a MixedRealityStsClient. @@ -137,6 +140,20 @@ export class RemoteRenderingClient { this.operations = new RemoteRendering(this.client); } + public async beginConversion( + accountId: string, + conversionId: string, + conversionOptions: AssetConversionOptions, + options?: OperationOptions + ): Promise> { + let assetConversion : RemoteRenderingCreateConversionResponse = await this.operations.createConversion(accountId, conversionId, { settings : conversionOptions }, options); + + let poller = new AssetConversionPoller(this, accountId, assetConversion); + + await poller.poll(); + return poller; + } + /** * Gets the status of a particular conversion. * @param accountId The Azure Remote Rendering account ID. @@ -150,12 +167,16 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversion", { conversionId : conversionId, ...options }); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversion", { + conversionId: conversionId, + ...options + }); try { let result = await this.operations.getConversion(accountId, conversionId, updatedOptions); - return Promise.resolve(result as AssetConversion); + // TODO Presumably, this may not carry a conversion object. + return Promise.resolve(result); } catch (e) { span.setStatus({ code: CanonicalCode.UNKNOWN, From 68343810853193a196ccc5f00a6567b0d97a48a4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 9 Mar 2021 10:33:58 +0000 Subject: [PATCH 016/166] Some rendering session methods --- .../src/lro/assetConversionPoller.ts | 37 +++--- .../src/lro/renderingSessionPoller.ts | 110 ++++++++++++++++++ .../src/remoteRenderingClient.ts | 81 ++++++++++++- 3 files changed, 207 insertions(+), 21 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 7ceb02e38704..641c6e1f5843 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -8,30 +8,32 @@ import { AssetConversion, KnownAssetConversionStatus } from "../generated/models import { AbortSignalLike } from "@azure/abort-controller"; export class AssetConversionOperationState implements PollOperationState { - client : RemoteRenderingClient; - accountId : string; - conversionState : AssetConversion; + client: RemoteRenderingClient; + accountId: string; + conversionState: AssetConversion; - constructor(client : RemoteRenderingClient, accountId : string, conversionState : AssetConversion) - { + constructor(client: RemoteRenderingClient, accountId: string, conversionState: AssetConversion) { this.client = client; this.accountId = accountId; this.conversionState = conversionState; } - get isStarted() : boolean { + get isStarted(): boolean { return true; } - get isCompleted() : boolean { - return (this.conversionState.status != KnownAssetConversionStatus.NotStarted) && (this.conversionState.status != KnownAssetConversionStatus.Running); + get isCompleted(): boolean { + return ( + this.conversionState.status != KnownAssetConversionStatus.NotStarted && + this.conversionState.status != KnownAssetConversionStatus.Running + ); } - get isCancelled() : boolean { + get isCancelled(): boolean { return false; } - get error() : Error | undefined { + get error(): Error | undefined { if (this.conversionState.error != null) { //TODO Add details. return new Error(this.conversionState.error.message); @@ -44,10 +46,11 @@ export class AssetConversionOperationState implements PollOperationState { - state : AssetConversionOperationState; +class AssetConversionOperation + implements PollOperation { + state: AssetConversionOperationState; - constructor(state : AssetConversionOperationState) { + constructor(state: AssetConversionOperationState) { this.state = state; } @@ -86,8 +89,12 @@ export class AssetConversionPoller extends Poller { + client: RemoteRenderingClient; + accountId: string; + conversionState: RenderingSession; + + constructor(client: RemoteRenderingClient, accountId: string, conversionState: RenderingSession) { + this.client = client; + this.accountId = accountId; + this.conversionState = conversionState; + } + + get isStarted(): boolean { + return true; + } + + get isCompleted(): boolean { + return this.conversionState.status != KnownRenderingSessionStatus.Starting; + } + + get isCancelled(): boolean { + return false; + } + + get error(): Error | undefined { + if (this.conversionState.error != null) { + //TODO Add details. + return new Error(this.conversionState.error.message); + } + return undefined; + } + + get result(): RenderingSession { + return this.conversionState; + } +} + +class RenderingSessionOperation + implements PollOperation { + state: RenderingSessionOperationState; + + constructor(state: RenderingSessionOperationState) { + this.state = state; + } + + update(_options?: { + abortSignal?: AbortSignalLike; + fireProgress?: (state: RenderingSessionOperationState) => void; + }): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * It returns a promise that should be resolved with an updated version of the poller's operation. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Serializes the operation. + * Useful when wanting to create a poller that monitors an existing operation. + */ + toString(): string { + throw new Error("Not yet implemented."); + } +} + +export class RenderingSessionPoller extends Poller { + /** + * Defines how much time the poller is going to wait before making a new request to the service. + */ + public intervalInMs: number = 10000; + + constructor(client: RemoteRenderingClient, accountId: string, RenderingSession: RenderingSession) { + super( + new RenderingSessionOperation( + new RenderingSessionOperationState(client, accountId, RenderingSession) + ) + ); + } + + /** + * The method used by the poller to wait before attempting to update its operation. + */ + async delay(): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Gets the public state of the polling operation + */ + public getOperationState(): RenderingSessionOperationState { + throw new Error("Not yet implemented."); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 52523e38fc6a..ece194d40f23 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -13,7 +13,15 @@ import { CanonicalCode } from "@opentelemetry/api"; import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; -import { AssetConversionOptions, RemoteRenderingCreateConversionResponse, RemoteRenderingRestClientOptionalParams } from "./generated/models/index"; +import { + AssetConversion, + AssetConversionOptions, + RemoteRenderingCreateConversionResponse, + RemoteRenderingRestClientOptionalParams, + RenderingSession, + RenderingSessionOptions, + RemoteRenderingCreateSessionResponse +} from "./generated/models/index"; // TODO: Maybe copy and paste this? import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; @@ -27,12 +35,15 @@ import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; - import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; -import { AssetConversion } from "./generated/models/index"; import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; +import { RenderingSessionPoller, RenderingSessionOperationState } from "./lro/renderingSessionPoller"; + +export { AssetConversionOperationState, AssetConversion, RenderingSessionPoller, RenderingSessionOperationState }; +export type AssetConversionPollerLike = PollerLike; +export type RenderingSessionPollerLike = PollerLike; /** * The client class used to interact with the App Configuration service. @@ -145,9 +156,14 @@ export class RemoteRenderingClient { conversionId: string, conversionOptions: AssetConversionOptions, options?: OperationOptions - ): Promise> { - let assetConversion : RemoteRenderingCreateConversionResponse = await this.operations.createConversion(accountId, conversionId, { settings : conversionOptions }, options); - + ): Promise { + let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( + accountId, + conversionId, + { settings: conversionOptions }, + options + ); + let poller = new AssetConversionPoller(this, accountId, assetConversion); await poller.poll(); @@ -187,4 +203,57 @@ export class RemoteRenderingClient { span.end(); } } + + public async beginRenderingSession( + accountId: string, + sessionId: string, + renderingSessionOptions: RenderingSessionOptions, + options?: OperationOptions + ): Promise { + let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( + accountId, + sessionId, + renderingSessionOptions, + options + ); + + let poller = new RenderingSessionPoller(this, accountId, renderingSession); + + await poller.poll(); + return poller; + } + + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param options The options parameters. + */ + public async getSession( + accountId: string, + sessionId: string, + options?: OperationOptions + ): Promise { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetSession", { + sessionId, + ...options + }); + + try { + let result = await this.operations.getSession(accountId, sessionId, updatedOptions); + + // TODO Presumably, this may not carry a session object. + return Promise.resolve(result); + } catch (e) { + span.setStatus({ + code: CanonicalCode.UNKNOWN, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } } From 880711a7e5df52a4ed00cd5f6018adfc6f7e4e29 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 9 Mar 2021 10:36:37 +0000 Subject: [PATCH 017/166] Add comments. --- .../src/lro/renderingSessionPoller.ts | 11 +++++- .../src/remoteRenderingClient.ts | 37 +++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 1c829daff89b..1b66464cde12 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -80,13 +80,20 @@ class RenderingSessionOperation } } -export class RenderingSessionPoller extends Poller { +export class RenderingSessionPoller extends Poller< + RenderingSessionOperationState, + RenderingSession +> { /** * Defines how much time the poller is going to wait before making a new request to the service. */ public intervalInMs: number = 10000; - constructor(client: RemoteRenderingClient, accountId: string, RenderingSession: RenderingSession) { + constructor( + client: RemoteRenderingClient, + accountId: string, + RenderingSession: RenderingSession + ) { super( new RenderingSessionOperation( new RenderingSessionOperationState(client, accountId, RenderingSession) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index ece194d40f23..c8ce859cc905 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -34,16 +34,29 @@ import { logger } from "./logger"; import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; +//import "@azure/core-paging"; +import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; -import { RenderingSessionPoller, RenderingSessionOperationState } from "./lro/renderingSessionPoller"; +import { + RenderingSessionPoller, + RenderingSessionOperationState +} from "./lro/renderingSessionPoller"; -export { AssetConversionOperationState, AssetConversion, RenderingSessionPoller, RenderingSessionOperationState }; +export { + AssetConversionOperationState, + AssetConversion, + RenderingSessionPoller, + RenderingSessionOperationState +}; export type AssetConversionPollerLike = PollerLike; -export type RenderingSessionPollerLike = PollerLike; +export type RenderingSessionPollerLike = PollerLike< + RenderingSessionOperationState, + RenderingSession +>; /** * The client class used to interact with the App Configuration service. @@ -151,6 +164,15 @@ export class RemoteRenderingClient { this.operations = new RemoteRendering(this.client); } + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param conversionOptions Settings configuring the asset conversion. + * @param options The options parameters. + */ public async beginConversion( accountId: string, conversionId: string, @@ -204,6 +226,15 @@ export class RemoteRenderingClient { } } + /** + * Creates a new rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param renderingSessionOptions Settings of the session to be created. + * @param options The options parameters. + */ public async beginRenderingSession( accountId: string, sessionId: string, From 1bcaf52698fb7d637bcb8e6c1bb93beb269a1f65 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 9 Mar 2021 12:20:03 +0000 Subject: [PATCH 018/166] Add remaining API methods --- .../mixedreality-remoterendering/package.json | 3 +- .../src/lro/assetConversionPoller.ts | 8 +- .../src/lro/renderingSessionPoller.ts | 7 +- .../src/remoteRenderingClient.ts | 102 +++++++++++++----- 4 files changed, 82 insertions(+), 38 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 13f14d2c3707..e1999e00c9ac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -80,7 +80,8 @@ "tslib": "^2.0.0", "@azure/mixedreality-authentication": "1.0.0-beta.1", "@azure/core-lro": "^1.0.2", - "@azure/abort-controller": "^1.0.0" + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 641c6e1f5843..8cb8b2e28283 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -9,12 +9,10 @@ import { AbortSignalLike } from "@azure/abort-controller"; export class AssetConversionOperationState implements PollOperationState { client: RemoteRenderingClient; - accountId: string; conversionState: AssetConversion; - constructor(client: RemoteRenderingClient, accountId: string, conversionState: AssetConversion) { + constructor(client: RemoteRenderingClient, conversionState: AssetConversion) { this.client = client; - this.accountId = accountId; this.conversionState = conversionState; } @@ -89,10 +87,10 @@ export class AssetConversionPoller extends Poller { client: RemoteRenderingClient; - accountId: string; conversionState: RenderingSession; - constructor(client: RemoteRenderingClient, accountId: string, conversionState: RenderingSession) { + constructor(client: RemoteRenderingClient, conversionState: RenderingSession) { this.client = client; - this.accountId = accountId; this.conversionState = conversionState; } @@ -91,12 +89,11 @@ export class RenderingSessionPoller extends Poller< constructor( client: RemoteRenderingClient, - accountId: string, RenderingSession: RenderingSession ) { super( new RenderingSessionOperation( - new RenderingSessionOperationState(client, accountId, RenderingSession) + new RenderingSessionOperationState(client, RenderingSession) ) ); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index c8ce859cc905..51110f7bdf5d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -20,7 +20,8 @@ import { RemoteRenderingRestClientOptionalParams, RenderingSession, RenderingSessionOptions, - RemoteRenderingCreateSessionResponse + RemoteRenderingCreateSessionResponse, + UpdateSessionOptions } from "./generated/models/index"; // TODO: Maybe copy and paste this? @@ -35,7 +36,7 @@ import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; //import "@azure/core-paging"; -import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; @@ -62,14 +63,15 @@ export type RenderingSessionPollerLike = PollerLike< * The client class used to interact with the App Configuration service. */ export class RemoteRenderingClient { + private accountId: string; private client: RemoteRenderingRestClient; private operations: RemoteRendering; /** - * Creates an instance of a MixedRealityStsClient. - * @param accountId The Mixed Reality service account identifier. - * @param accountDomain The Mixed Reality service account domain. - * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * Creates an instance of a RemoteRenderingClient. + * @param accountId The Remote Rendering service account identifier. + * @param accountDomain The Remote Rendering service account domain. + * @param keyCredential The Remote Rendering service account primary or secondary key credential. * @param options Additional client options. */ constructor( @@ -81,10 +83,10 @@ export class RemoteRenderingClient { ); /** - * Creates an instance of a MixedRealityStsClient. - * @param accountId The Mixed Reality service account identifier. - * @param accountDomain The Mixed Reality service account domain. - * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * Creates an instance of a RemoteRenderingClient. + * @param accountId The Remote Rendering service account identifier. + * @param accountDomain The Remote Rendering service account domain. + * @param credential A token credential obtained from the Mixed Reality STS service. * @param options Additional client options. */ constructor( @@ -97,9 +99,9 @@ export class RemoteRenderingClient { /** * Creates an instance of a MixedRealityStsClient. - * @param accountId The Mixed Reality service account identifier. - * @param accountDomain The Mixed Reality service account domain. - * @param keyCredential The Mixed Reality service account primary or secondary key credential. + * @param accountId The Remote Rendering service account identifier. + * @param accountDomain The Remote Rendering service account domain. + * @param credential A token credential suitable for use with the Mixed Reality STS service. * @param options Additional client options. */ constructor( @@ -109,6 +111,8 @@ export class RemoteRenderingClient { credential: TokenCredential | AzureKeyCredential | AccessToken, options: RemoteRenderingClientOptions = {} ) { + this.accountId = accountId; + // The below code helps us set a proper User-Agent header on all requests const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; @@ -166,7 +170,6 @@ export class RemoteRenderingClient { /** * Creates a conversion using an asset stored in an Azure Blob Storage account. - * @param accountId The Azure Remote Rendering account ID. * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. @@ -174,19 +177,18 @@ export class RemoteRenderingClient { * @param options The options parameters. */ public async beginConversion( - accountId: string, conversionId: string, conversionOptions: AssetConversionOptions, options?: OperationOptions ): Promise { let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( - accountId, + this.accountId, conversionId, { settings: conversionOptions }, options ); - let poller = new AssetConversionPoller(this, accountId, assetConversion); + let poller = new AssetConversionPoller(this, assetConversion); await poller.poll(); return poller; @@ -194,14 +196,12 @@ export class RemoteRenderingClient { /** * Gets the status of a particular conversion. - * @param accountId The Azure Remote Rendering account ID. * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. * @param options The options parameters. */ public async getConversion( - accountId: string, conversionId: string, options?: OperationOptions ): Promise { @@ -211,7 +211,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.getConversion(accountId, conversionId, updatedOptions); + let result = await this.operations.getConversion(this.accountId, conversionId, updatedOptions); // TODO Presumably, this may not carry a conversion object. return Promise.resolve(result); @@ -226,9 +226,18 @@ export class RemoteRenderingClient { } } + /** + * Gets a list of all conversions. + * @param options The options parameters. + */ + public listConversions( + options?: OperationOptions + ): PagedAsyncIterableIterator { + throw new Error("Not yet implemented."); + } + /** * Creates a new rendering session. - * @param accountId The Azure Remote Rendering account ID. * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. @@ -236,19 +245,18 @@ export class RemoteRenderingClient { * @param options The options parameters. */ public async beginRenderingSession( - accountId: string, sessionId: string, renderingSessionOptions: RenderingSessionOptions, options?: OperationOptions ): Promise { let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( - accountId, + this.accountId, sessionId, renderingSessionOptions, options ); - let poller = new RenderingSessionPoller(this, accountId, renderingSession); + let poller = new RenderingSessionPoller(this, renderingSession); await poller.poll(); return poller; @@ -256,14 +264,12 @@ export class RemoteRenderingClient { /** * Gets the status of a particular conversion. - * @param accountId The Azure Remote Rendering account ID. * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. * @param options The options parameters. */ public async getSession( - accountId: string, sessionId: string, options?: OperationOptions ): Promise { @@ -273,7 +279,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.getSession(accountId, sessionId, updatedOptions); + let result = await this.operations.getSession(this.accountId, sessionId, updatedOptions); // TODO Presumably, this may not carry a session object. return Promise.resolve(result); @@ -287,4 +293,46 @@ export class RemoteRenderingClient { span.end(); } } + + /** + * Updates the max lease time of a particular rendering session. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param updateOptions Settings used to update the session. + * @param options The options parameters. + */ + updateSession( + sessionId: string, + updateOptions: UpdateSessionOptions, + options?: OperationOptions + ): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Stops a particular rendering session. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters. + */ + stopSession( + sessionId: string, + options?: OperationOptions + ): Promise { + throw new Error("Not yet implemented."); + } + + /** + * Gets a list of all sessions. + * @param options The options parameters. + */ + public listSessions( + options?: OperationOptions + ): PagedAsyncIterableIterator { + throw new Error("Not yet implemented."); + } + + } From 10814ce1fb89e03b5237e60f6506e7376c3aade4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 9 Mar 2021 19:29:37 +0000 Subject: [PATCH 019/166] Fix iterator compile issue --- .../mixedreality-remoterendering/src/index.ts | 1 + .../src/lro/assetConversionPoller.ts | 6 +--- .../src/lro/renderingSessionPoller.ts | 9 ++--- .../src/remoteRenderingClient.ts | 34 +++++++++++-------- 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/index.ts index 5b9b0b92ce76..97064c1ba05b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/index.ts @@ -1,4 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/// export * from "./remoteRenderingClient"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 8cb8b2e28283..4a91e1f599ac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -88,11 +88,7 @@ export class AssetConversionPoller extends Poller; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, @@ -211,7 +220,11 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.getConversion(this.accountId, conversionId, updatedOptions); + let result = await this.operations.getConversion( + this.accountId, + conversionId, + updatedOptions + ); // TODO Presumably, this may not carry a conversion object. return Promise.resolve(result); @@ -230,9 +243,7 @@ export class RemoteRenderingClient { * Gets a list of all conversions. * @param options The options parameters. */ - public listConversions( - options?: OperationOptions - ): PagedAsyncIterableIterator { + public listConversions(options?: OperationOptions): PagedAsyncIterableIterator { throw new Error("Not yet implemented."); } @@ -244,7 +255,7 @@ export class RemoteRenderingClient { * @param renderingSessionOptions Settings of the session to be created. * @param options The options parameters. */ - public async beginRenderingSession( + public async beginSession( sessionId: string, renderingSessionOptions: RenderingSessionOptions, options?: OperationOptions @@ -309,7 +320,7 @@ export class RemoteRenderingClient { ): Promise { throw new Error("Not yet implemented."); } - + /** * Stops a particular rendering session. * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is @@ -317,10 +328,7 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters. */ - stopSession( - sessionId: string, - options?: OperationOptions - ): Promise { + endSession(sessionId: string, options?: OperationOptions): Promise { throw new Error("Not yet implemented."); } @@ -328,11 +336,7 @@ export class RemoteRenderingClient { * Gets a list of all sessions. * @param options The options parameters. */ - public listSessions( - options?: OperationOptions - ): PagedAsyncIterableIterator { + public listSessions(options?: OperationOptions): PagedAsyncIterableIterator { throw new Error("Not yet implemented."); } - - } From 3299da6146d4067e88139ab961dee6d077e255de Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 9 Mar 2021 19:32:29 +0000 Subject: [PATCH 020/166] Update todos --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index e6299ed0ff14..c4c3dc772206 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -1,8 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -// TODO: -// * Fix compile error +// TODO: // * Work out how options should be passed to functions. // * Work out how responses are normally obtained // * Should there be a synchronous version of the API? From c22a4ba8e769e0a43af3167c22d6a274ee9654c0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 10 Mar 2021 09:52:59 +0000 Subject: [PATCH 021/166] Fix comments --- .../src/remoteRenderingClient.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index c4c3dc772206..8ea53d70b934 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -42,7 +42,6 @@ import { logger } from "./logger"; import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; -//import "@azure/core-paging"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; @@ -94,7 +93,7 @@ export class RemoteRenderingClient { * Creates an instance of a RemoteRenderingClient. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. - * @param credential A token credential obtained from the Mixed Reality STS service. + * @param credential A token credential for authenticating the account with the Mixed Reality STS service. * @param options Additional client options. */ constructor( @@ -109,7 +108,7 @@ export class RemoteRenderingClient { * Creates an instance of a MixedRealityStsClient. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. - * @param credential A token credential suitable for use with the Mixed Reality STS service. + * @param credential An access token obtained from the Mixed Reality STS service. * @param options Additional client options. */ constructor( From 3c5338196ddb3f4c593c4c4d3f9126989177bd5a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 11 Mar 2021 13:53:53 +0000 Subject: [PATCH 022/166] Use InMinutes as the time suffix. --- .../src/generated/models/index.ts | 8 +++--- .../src/generated/models/mappers.ts | 8 +++--- .../swagger/README.md | 25 +++++++++++++++++++ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index ea0c18dc9ee0..3c4b76cdcdbd 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -117,7 +117,7 @@ export interface ConversionList { /** Settings of the session to be created. */ export interface RenderingSessionOptions { /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ - maxLeaseTimeMinutes: number; + maxLeaseTimeInMinutes: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ size: RenderingServerSize; } @@ -140,7 +140,7 @@ export interface RenderingSession { * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly elapsedTimeMinutes?: number; + readonly elapsedTimeInMinutes?: number; /** * The hostname under which the rendering session is reachable. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -150,7 +150,7 @@ export interface RenderingSession { * The time in minutes the session will run after reaching the 'Ready' state. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly maxLeaseTimeMinutes?: number; + readonly maxLeaseTimeInMinutes?: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ size: RenderingServerSize; /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ @@ -175,7 +175,7 @@ export interface RenderingSession { /** Settings used to update the session. */ export interface UpdateSessionOptions { /** Update to the time the session will run after it reached the 'Ready' state. It has to be larger than the current value of maxLeaseTimeMinutes and less than 1440. */ - maxLeaseTimeMinutes: number; + maxLeaseTimeInMinutes: number; } /** The result of a list sessions request. */ diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index b4e81ae58a52..bf89966382b4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -283,7 +283,7 @@ export const RenderingSessionOptions: coreHttp.CompositeMapper = { name: "Composite", className: "RenderingSessionOptions", modelProperties: { - maxLeaseTimeMinutes: { + maxLeaseTimeInMinutes: { serializedName: "maxLeaseTimeMinutes", required: true, type: { @@ -335,7 +335,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { name: "Number" } }, - elapsedTimeMinutes: { + elapsedTimeInMinutes: { serializedName: "elapsedTimeMinutes", readOnly: true, type: { @@ -349,7 +349,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { name: "String" } }, - maxLeaseTimeMinutes: { + maxLeaseTimeInMinutes: { serializedName: "maxLeaseTimeMinutes", readOnly: true, type: { @@ -400,7 +400,7 @@ export const UpdateSessionOptions: coreHttp.CompositeMapper = { name: "Composite", className: "UpdateSessionOptions", modelProperties: { - maxLeaseTimeMinutes: { + maxLeaseTimeInMinutes: { serializedName: "maxLeaseTimeMinutes", required: true, type: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index c69971ebdd47..88f108942aa5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -159,6 +159,14 @@ directive: $["x-ms-client-name"] = "sessionId"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.elapsedTimeMinutes + transform: > + $["x-ms-client-name"] = "elapsedTimeInMinutes"; +``` + ```yaml directive: - from: swagger-document @@ -167,6 +175,14 @@ directive: $["x-ms-client-name"] = "host"; ``` +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.maxLeaseTimeMinutes + transform: > + $["x-ms-client-name"] = "maxLeaseTimeInMinutes"; +``` + ```yaml directive: - from: swagger-document @@ -189,6 +205,7 @@ directive: where: $.definitions.create_session_settings transform: > $["x-ms-client-name"] = "RenderingSessionOptions"; + $.properties.maxLeaseTimeMinutes["x-ms-client-name"] = "maxLeaseTimeInMinutes" ``` ```yaml @@ -206,3 +223,11 @@ directive: transform: > $["x-ms-client-name"] = "UpdateSessionOptions"; ``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.update_session_settings.properties.maxLeaseTimeMinutes + transform: > + $["x-ms-client-name"] = "maxLeaseTimeInMinutes"; +``` From 196bb1bbec372770dfa3f95bf50a7409888dcde1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 11 Mar 2021 14:01:03 +0000 Subject: [PATCH 023/166] Distinguish between options and settings --- .../src/generated/models/index.ts | 18 +++++----- .../src/generated/models/mappers.ts | 34 +++++++++---------- .../src/generated/models/parameters.ts | 8 ++--- .../generated/operations/remoteRendering.ts | 8 ++--- .../src/remoteRenderingClient.ts | 22 ++++++------ .../swagger/README.md | 22 ++++-------- 6 files changed, 52 insertions(+), 60 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 3c4b76cdcdbd..f79cfcce9674 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -11,19 +11,19 @@ import * as coreHttp from "@azure/core-http"; /** Request to start a conversion */ export interface CreateConversionSettings { /** Conversion settings describe the origin of input files and destination of output files. */ - settings: AssetConversionOptions; + settings: AssetConversionSettings; } /** Conversion settings describe the origin of input files and destination of output files. */ -export interface AssetConversionOptions { +export interface AssetConversionSettings { /** Conversion input settings describe the origin of conversion input. */ - inputOptions: AssetConversionInputOptions; + inputSettings: AssetConversionInputSettings; /** Conversion output settings describe the destination of conversion output. */ - outputOptions: AssetConversionOutputOptions; + outputSettings: AssetConversionOutputSettings; } /** Conversion input settings describe the origin of conversion input. */ -export interface AssetConversionInputOptions { +export interface AssetConversionInputSettings { /** The URI of the Azure blob storage container containing the input model. */ storageContainerUrl: string; /** An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ @@ -35,7 +35,7 @@ export interface AssetConversionInputOptions { } /** Conversion output settings describe the destination of conversion output. */ -export interface AssetConversionOutputOptions { +export interface AssetConversionOutputSettings { /** The URI of the Azure blob storage container where the result of the conversion should be written to. */ storageContainerUrl: string; /** An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ @@ -51,7 +51,7 @@ export interface AssetConversion { /** The ID of the conversion supplied when the conversion was created. */ conversionId: string; /** Conversion settings describe the origin of input files and destination of output files. */ - options: AssetConversionOptions; + settings: AssetConversionSettings; /** * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -115,7 +115,7 @@ export interface ConversionList { } /** Settings of the session to be created. */ -export interface RenderingSessionOptions { +export interface RenderingSessionSettings { /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ maxLeaseTimeInMinutes: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ @@ -173,7 +173,7 @@ export interface RenderingSession { } /** Settings used to update the session. */ -export interface UpdateSessionOptions { +export interface UpdateSessionSettings { /** Update to the time the session will run after it reached the 'Ready' state. It has to be larger than the current value of maxLeaseTimeMinutes and less than 1440. */ maxLeaseTimeInMinutes: number; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index bf89966382b4..9f4b5639deaa 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -17,40 +17,40 @@ export const CreateConversionSettings: coreHttp.CompositeMapper = { serializedName: "settings", type: { name: "Composite", - className: "AssetConversionOptions" + className: "AssetConversionSettings" } } } } }; -export const AssetConversionOptions: coreHttp.CompositeMapper = { +export const AssetConversionSettings: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "AssetConversionOptions", + className: "AssetConversionSettings", modelProperties: { - inputOptions: { + inputSettings: { serializedName: "inputLocation", type: { name: "Composite", - className: "AssetConversionInputOptions" + className: "AssetConversionInputSettings" } }, - outputOptions: { + outputSettings: { serializedName: "outputLocation", type: { name: "Composite", - className: "AssetConversionOutputOptions" + className: "AssetConversionOutputSettings" } } } } }; -export const AssetConversionInputOptions: coreHttp.CompositeMapper = { +export const AssetConversionInputSettings: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "AssetConversionInputOptions", + className: "AssetConversionInputSettings", modelProperties: { storageContainerUrl: { serializedName: "storageContainerUri", @@ -82,10 +82,10 @@ export const AssetConversionInputOptions: coreHttp.CompositeMapper = { } }; -export const AssetConversionOutputOptions: coreHttp.CompositeMapper = { +export const AssetConversionOutputSettings: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "AssetConversionOutputOptions", + className: "AssetConversionOutputSettings", modelProperties: { storageContainerUrl: { serializedName: "storageContainerUri", @@ -128,11 +128,11 @@ export const AssetConversion: coreHttp.CompositeMapper = { name: "String" } }, - options: { + settings: { serializedName: "settings", type: { name: "Composite", - className: "AssetConversionOptions" + className: "AssetConversionSettings" } }, output: { @@ -278,10 +278,10 @@ export const ConversionList: coreHttp.CompositeMapper = { } }; -export const RenderingSessionOptions: coreHttp.CompositeMapper = { +export const RenderingSessionSettings: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "RenderingSessionOptions", + className: "RenderingSessionSettings", modelProperties: { maxLeaseTimeInMinutes: { serializedName: "maxLeaseTimeMinutes", @@ -395,10 +395,10 @@ export const RenderingSession: coreHttp.CompositeMapper = { } }; -export const UpdateSessionOptions: coreHttp.CompositeMapper = { +export const UpdateSessionSettings: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "UpdateSessionOptions", + className: "UpdateSessionSettings", modelProperties: { maxLeaseTimeInMinutes: { serializedName: "maxLeaseTimeMinutes", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts index 54927caadef4..57a61f6aa134 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts @@ -13,8 +13,8 @@ import { } from "@azure/core-http"; import { CreateConversionSettings as CreateConversionSettingsMapper, - RenderingSessionOptions as RenderingSessionOptionsMapper, - UpdateSessionOptions as UpdateSessionOptionsMapper + RenderingSessionSettings as RenderingSessionSettingsMapper, + UpdateSessionSettings as UpdateSessionSettingsMapper } from "../models/mappers"; export const contentType: OperationParameter = { @@ -94,7 +94,7 @@ export const conversionId: OperationURLParameter = { export const body1: OperationParameter = { parameterPath: "body", - mapper: RenderingSessionOptionsMapper + mapper: RenderingSessionSettingsMapper }; export const sessionId: OperationURLParameter = { @@ -110,7 +110,7 @@ export const sessionId: OperationURLParameter = { export const body2: OperationParameter = { parameterPath: "body", - mapper: UpdateSessionOptionsMapper + mapper: UpdateSessionSettingsMapper }; export const nextLink: OperationURLParameter = { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index 4b9b74594f2a..b526046b03e7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -15,10 +15,10 @@ import { RemoteRenderingCreateConversionResponse, RemoteRenderingGetConversionResponse, RemoteRenderingListConversionsResponse, - RenderingSessionOptions, + RenderingSessionSettings, RemoteRenderingCreateSessionResponse, RemoteRenderingGetSessionResponse, - UpdateSessionOptions, + UpdateSessionSettings, RemoteRenderingUpdateSessionResponse, RemoteRenderingStopSessionResponse, RemoteRenderingListSessionsResponse, @@ -120,7 +120,7 @@ export class RemoteRendering { createSession( accountId: string, sessionId: string, - body: RenderingSessionOptions, + body: RenderingSessionSettings, options?: coreHttp.OperationOptions ): Promise { const operationArguments: coreHttp.OperationArguments = { @@ -171,7 +171,7 @@ export class RemoteRendering { updateSession( accountId: string, sessionId: string, - body: UpdateSessionOptions, + body: UpdateSessionSettings, options?: coreHttp.OperationOptions ): Promise { const operationArguments: coreHttp.OperationArguments = { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 8ea53d70b934..ad080d1b90a7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -22,13 +22,13 @@ import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; import { AssetConversion, - AssetConversionOptions, + AssetConversionSettings, RemoteRenderingCreateConversionResponse, RemoteRenderingRestClientOptionalParams, RenderingSession, - RenderingSessionOptions, + RenderingSessionSettings, RemoteRenderingCreateSessionResponse, - UpdateSessionOptions + UpdateSessionSettings } from "./generated/models/index"; // TODO: Maybe copy and paste this? @@ -180,18 +180,18 @@ export class RemoteRenderingClient { * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. - * @param conversionOptions Settings configuring the asset conversion. + * @param assetConversionSettings Settings configuring the asset conversion. * @param options The options parameters. */ public async beginConversion( conversionId: string, - conversionOptions: AssetConversionOptions, + assetConversionSettings: AssetConversionSettings, options?: OperationOptions ): Promise { let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( this.accountId, conversionId, - { settings: conversionOptions }, + { settings: assetConversionSettings }, options ); @@ -250,18 +250,18 @@ export class RemoteRenderingClient { * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param renderingSessionOptions Settings of the session to be created. + * @param renderingSessionSettings Settings of the session to be created. * @param options The options parameters. */ public async beginSession( sessionId: string, - renderingSessionOptions: RenderingSessionOptions, + renderingSessionSettings: RenderingSessionSettings, options?: OperationOptions ): Promise { let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( this.accountId, sessionId, - renderingSessionOptions, + renderingSessionSettings, options ); @@ -308,12 +308,12 @@ export class RemoteRenderingClient { * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param updateOptions Settings used to update the session. + * @param updateSessionSettings Settings used to update the session. * @param options The options parameters. */ updateSession( sessionId: string, - updateOptions: UpdateSessionOptions, + updateSessionSettings: UpdateSessionSettings, options?: OperationOptions ): Promise { throw new Error("Not yet implemented."); diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 88f108942aa5..81ffaf3481e1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -38,14 +38,6 @@ directive: $["x-ms-client-name"] = "conversionId"; ``` -```yaml -directive: - - from: swagger-document - where: $.definitions.conversion.properties.settings - transform: > - $["x-ms-client-name"] = "options"; -``` - ```yaml directive: - from: swagger-document @@ -68,7 +60,7 @@ directive: - from: swagger-document where: $.definitions.conversion_settings transform: > - $["x-ms-client-name"] = "AssetConversionOptions"; + $["x-ms-client-name"] = "AssetConversionSettings"; ``` ```yaml @@ -76,7 +68,7 @@ directive: - from: swagger-document where: $.definitions.conversion_settings.properties.inputLocation transform: > - $["x-ms-client-name"] = "inputOptions"; + $["x-ms-client-name"] = "inputSettings"; ``` ```yaml @@ -84,7 +76,7 @@ directive: - from: swagger-document where: $.definitions.conversion_settings.properties.outputLocation transform: > - $["x-ms-client-name"] = "outputOptions"; + $["x-ms-client-name"] = "outputSettings"; ``` ```yaml @@ -92,7 +84,7 @@ directive: - from: swagger-document where: $.definitions.conversion_input_settings transform: > - $["x-ms-client-name"] = "AssetConversionInputOptions"; + $["x-ms-client-name"] = "AssetConversionInputSettings"; ``` ```yaml @@ -108,7 +100,7 @@ directive: - from: swagger-document where: $.definitions.conversion_output_settings transform: > - $["x-ms-client-name"] = "AssetConversionOutputOptions"; + $["x-ms-client-name"] = "AssetConversionOutputSettings"; ``` ```yaml @@ -204,7 +196,7 @@ directive: - from: swagger-document where: $.definitions.create_session_settings transform: > - $["x-ms-client-name"] = "RenderingSessionOptions"; + $["x-ms-client-name"] = "RenderingSessionSettings"; $.properties.maxLeaseTimeMinutes["x-ms-client-name"] = "maxLeaseTimeInMinutes" ``` @@ -221,7 +213,7 @@ directive: - from: swagger-document where: $.definitions.update_session_settings transform: > - $["x-ms-client-name"] = "UpdateSessionOptions"; + $["x-ms-client-name"] = "UpdateSessionSettings"; ``` ```yaml From 0e558c1668162bf451cb3d01ee247e4963a52f0c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 11 Mar 2021 15:30:04 +0000 Subject: [PATCH 024/166] Add getPoller methods. --- .../src/remoteRenderingClient.ts | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index ad080d1b90a7..73f87fac984d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -2,7 +2,6 @@ // Licensed under the MIT license. // TODO: -// * Work out how options should be passed to functions. // * Work out how responses are normally obtained // * Should there be a synchronous version of the API? // * Generate the artifact (a doc model file: https://api-extractor.com/pages/setup/generating_docs/) @@ -203,9 +202,7 @@ export class RemoteRenderingClient { /** * Gets the status of a particular conversion. - * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case - * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, - * and cannot contain more than 256 characters. + * @param conversionId The ID of a previously created conversion. * @param options The options parameters. */ public async getConversion( @@ -237,11 +234,26 @@ export class RemoteRenderingClient { } } + /** + * Returns a poller for a pre-existing conversion by conversionId + * @param conversionId The ID of a previously created conversion. + * @param options The options parameters. + */ + public async getConversionPoller( + conversionId: string, + options?: OperationOptions + ): Promise { + conversionId = conversionId; + options = options; + throw new Error("Not yet implemented."); + } + /** * Gets a list of all conversions. * @param options The options parameters. */ public listConversions(options?: OperationOptions): PagedAsyncIterableIterator { + options = options; throw new Error("Not yet implemented."); } @@ -272,7 +284,7 @@ export class RemoteRenderingClient { } /** - * Gets the status of a particular conversion. + * Gets the status of a particular session. * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. @@ -303,6 +315,20 @@ export class RemoteRenderingClient { } } + /** + * Returns a poller for a pre-existing session by sessionId. + * @param sessionId The ID of a previously created session. + * @param options The options parameters. + */ + public async getSessionPoller( + sessionId: string, + options?: OperationOptions + ): Promise { + sessionId = sessionId; + options = options; + throw new Error("Not yet implemented."); + } + /** * Updates the max lease time of a particular rendering session. * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is @@ -316,6 +342,9 @@ export class RemoteRenderingClient { updateSessionSettings: UpdateSessionSettings, options?: OperationOptions ): Promise { + sessionId = sessionId; + updateSessionSettings = updateSessionSettings; + options = options; throw new Error("Not yet implemented."); } @@ -327,6 +356,8 @@ export class RemoteRenderingClient { * @param options The options parameters. */ endSession(sessionId: string, options?: OperationOptions): Promise { + sessionId = sessionId; + options = options; throw new Error("Not yet implemented."); } @@ -335,6 +366,7 @@ export class RemoteRenderingClient { * @param options The options parameters. */ public listSessions(options?: OperationOptions): PagedAsyncIterableIterator { + options = options; throw new Error("Not yet implemented."); } } From 3b01fd8b3b06e09a0110d235c123a05e45bdcdfb Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 11 Mar 2021 16:33:36 +0000 Subject: [PATCH 025/166] Use WithResponse. --- .../src/lro/assetConversionPoller.ts | 14 +++++----- .../src/lro/renderingSessionPoller.ts | 14 +++++----- .../src/remoteRenderingClient.ts | 27 +++++++++++++------ 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 4a91e1f599ac..7fdf463f7d30 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -2,16 +2,16 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { RemoteRenderingClient } from "../remoteRenderingClient"; +import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; import { AbortSignalLike } from "@azure/abort-controller"; -export class AssetConversionOperationState implements PollOperationState { +export class AssetConversionOperationState implements PollOperationState> { client: RemoteRenderingClient; - conversionState: AssetConversion; + conversionState: WithResponse; - constructor(client: RemoteRenderingClient, conversionState: AssetConversion) { + constructor(client: RemoteRenderingClient, conversionState: WithResponse) { this.client = client; this.conversionState = conversionState; } @@ -39,7 +39,7 @@ export class AssetConversionOperationState implements PollOperationState { return this.conversionState; } } @@ -81,13 +81,13 @@ class AssetConversionOperation } } -export class AssetConversionPoller extends Poller { +export class AssetConversionPoller extends Poller> { /** * Defines how much time the poller is going to wait before making a new request to the service. */ public intervalInMs: number = 10000; - constructor(client: RemoteRenderingClient, assetConversion: AssetConversion) { + constructor(client: RemoteRenderingClient, assetConversion: WithResponse) { super(new AssetConversionOperation(new AssetConversionOperationState(client, assetConversion))); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 9795ae64234d..0d508c5290f2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -2,16 +2,16 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { RemoteRenderingClient } from "../remoteRenderingClient"; +import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; import { AbortSignalLike } from "@azure/abort-controller"; -export class RenderingSessionOperationState implements PollOperationState { +export class RenderingSessionOperationState implements PollOperationState> { client: RemoteRenderingClient; - conversionState: RenderingSession; + conversionState: WithResponse; - constructor(client: RemoteRenderingClient, conversionState: RenderingSession) { + constructor(client: RemoteRenderingClient, conversionState: WithResponse) { this.client = client; this.conversionState = conversionState; } @@ -36,7 +36,7 @@ export class RenderingSessionOperationState implements PollOperationState { return this.conversionState; } } @@ -80,14 +80,14 @@ class RenderingSessionOperation export class RenderingSessionPoller extends Poller< RenderingSessionOperationState, - RenderingSession + WithResponse > { /** * Defines how much time the poller is going to wait before making a new request to the service. */ public intervalInMs: number = 10000; - constructor(client: RemoteRenderingClient, RenderingSession: RenderingSession) { + constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { super( new RenderingSessionOperation(new RenderingSessionOperationState(client, RenderingSession)) ); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 73f87fac984d..bb719ac6f639 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -12,7 +12,8 @@ import { OperationOptions, bearerTokenAuthenticationPolicy, createPipelineFromOptions, - InternalPipelineOptions + InternalPipelineOptions, + HttpResponse } from "@azure/core-http"; import { CanonicalCode } from "@opentelemetry/api"; @@ -59,12 +60,22 @@ export { RenderingSessionOperationState }; -export type AssetConversionPollerLike = PollerLike; +export type AssetConversionPollerLike = PollerLike>; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, - RenderingSession + WithResponse >; +/** + * Represents the returned response of the operation along with the raw response. + */ +export type WithResponse = T & { + /** + * The underlying HTTP response. + */ + _response: HttpResponse; +}; + /** * The client class used to interact with the App Configuration service. */ @@ -208,7 +219,7 @@ export class RemoteRenderingClient { public async getConversion( conversionId: string, options?: OperationOptions - ): Promise { + ): Promise> { const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversion", { conversionId: conversionId, ...options @@ -293,7 +304,7 @@ export class RemoteRenderingClient { public async getSession( sessionId: string, options?: OperationOptions - ): Promise { + ): Promise> { const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetSession", { sessionId, ...options @@ -337,11 +348,11 @@ export class RemoteRenderingClient { * @param updateSessionSettings Settings used to update the session. * @param options The options parameters. */ - updateSession( + public async updateSession( sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions - ): Promise { + ): Promise> { sessionId = sessionId; updateSessionSettings = updateSessionSettings; options = options; @@ -355,7 +366,7 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters. */ - endSession(sessionId: string, options?: OperationOptions): Promise { + public async endSession(sessionId: string, options?: OperationOptions): Promise> { sessionId = sessionId; options = options; throw new Error("Not yet implemented."); From 0fb5b9dd55517bc1e5fd56aae015d33b1c7a55f5 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 12:11:57 +0100 Subject: [PATCH 026/166] Latest changes --- .../api-extractor.json | 2 +- .../mixedreality-remoterendering.api.md | 170 ++++++++++++++++-- .../samples/tsconfig.json | 10 ++ .../samples/typescript/package.json | 39 ++++ .../samples/typescript/src/conversion.ts | 29 +++ .../samples/typescript/tsconfig.json | 16 ++ .../src/lro/assetConversionPoller.ts | 43 +++-- .../src/lro/renderingSessionPoller.ts | 40 +++-- .../src/remoteRenderingClient.ts | 58 +++++- 9 files changed, 350 insertions(+), 57 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json b/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json index 6cea81b416bd..0745508b465d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json +++ b/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "types/src/index.d.ts", + "mainEntryPointFilePath": "types/remoterendering/mixedreality-remoterendering/src/index.d.ts", "docModel": { "enabled": true }, diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 993ca3fd6b5d..76369dfa1366 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -4,40 +4,174 @@ ```ts +import { AccessToken } from '@azure/core-auth'; +import { AzureKeyCredential } from '@azure/core-auth'; +import { HttpResponse } from '@azure/core-http'; import { OperationOptions } from '@azure/core-http'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PipelineOptions } from '@azure/core-http'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; import { TokenCredential } from '@azure/core-http'; // @public -export class ConfigurationClient { - constructor(endpointUrl: string, credential: TokenCredential, options?: ConfigurationClientOptions); - getConfigurationSetting(key: string, options?: GetConfigurationSettingOptions): Promise; - getConfigurationSetting(setting: ConfigurationSetting, options?: GetConfigurationSettingOptions): Promise; +export interface AssetConversion { + conversionId: string; + createdOn: Date; + error: RemoteRenderingServiceError | null; + readonly output?: AssetConversionOutput; + settings: AssetConversionSettings; + status: AssetConversionStatus; } // @public -export interface ConfigurationClientOptions extends PipelineOptions { +export interface AssetConversionInputSettings { + blobPrefix?: string; + relativeInputAssetPath: string; + storageContainerReadListSas?: string; + storageContainerUrl: string; } // @public (undocumented) -export interface ConfigurationSetting { - contentType?: string; - etag?: string; - isReadOnly?: boolean; - key: string; - label?: string; - lastModified?: Date; - tags?: { - [propertyName: string]: string; - }; - value?: string; +export interface AssetConversionOperationState extends PollOperationState> { + latestResponse: WithResponse; } // @public -export interface GetConfigurationSettingOptions extends OperationOptions { - onlyIfChanged?: boolean; +export interface AssetConversionOutput { + readonly outputAssetUrl?: string; } +// @public +export interface AssetConversionOutputSettings { + blobPrefix?: string; + outputAssetFilename?: string; + storageContainerUrl: string; + storageContainerWriteSas?: string; +} + +// @public (undocumented) +export type AssetConversionPollerLike = PollerLike>; + +// @public +export interface AssetConversionSettings { + inputSettings: AssetConversionInputSettings; + outputSettings: AssetConversionOutputSettings; +} + +// @public +export type AssetConversionStatus = string; + +// @public +export const enum KnownAssetConversionStatus { + Cancelled = "Cancelled", + Failed = "Failed", + NotStarted = "NotStarted", + Running = "Running", + Succeeded = "Succeeded" +} + +// @public +export const enum KnownRenderingServerSize { + Premium = "Premium", + Standard = "Standard" +} + +// @public +export const enum KnownRenderingSessionStatus { + Error = "Error", + Expired = "Expired", + Ready = "Ready", + Starting = "Starting", + Stopped = "Stopped" +} + +// @public +export class RemoteRenderingClient { + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AccessToken, options: RemoteRenderingClientOptions); + beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: OperationOptions): Promise; + beginSession(sessionId: string, renderingSessionSettings: RenderingSessionSettings, options?: OperationOptions): Promise; + endSession(sessionId: string, options?: OperationOptions): Promise>; + getConversion(conversionId: string, options?: OperationOptions): Promise>; + getConversionPoller(conversionId: string, options?: OperationOptions): Promise; + getSession(sessionId: string, options?: OperationOptions): Promise>; + getSessionPoller(sessionId: string, options?: OperationOptions): Promise; + listConversions(options?: OperationOptions): PagedAsyncIterableIterator; + listSessions(options?: OperationOptions): PagedAsyncIterableIterator; + updateSession(sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions): Promise>; +} + +// @public +export interface RemoteRenderingClientOptions extends PipelineOptions { + authenticationEndpointUrl?: string; +} + +// @public +export interface RemoteRenderingServiceError { + code: string; + readonly details?: RemoteRenderingServiceError[]; + readonly innerError?: RemoteRenderingServiceError; + message: string; + readonly target?: string; +} + +// @public +export type RenderingServerSize = string; + +// @public +export interface RenderingSession { + readonly arrInspectorPort?: number; + readonly createdOn?: Date; + readonly elapsedTimeInMinutes?: number; + readonly error?: RemoteRenderingServiceError | null; + readonly handshakePort?: number; + readonly host?: string; + readonly maxLeaseTimeInMinutes?: number; + sessionId: string; + size: RenderingServerSize; + // Warning: (ae-forgotten-export) The symbol "RenderingSessionStatus" needs to be exported by the entry point index.d.ts + status: RenderingSessionStatus; + readonly teraflops?: number; +} + +// @public (undocumented) +export class RenderingSessionOperationState implements PollOperationState> { + constructor(client: RemoteRenderingClient, conversionState: WithResponse); + // (undocumented) + get error(): Error | undefined; + // (undocumented) + get isCancelled(): boolean; + // (undocumented) + get isCompleted(): boolean; + // (undocumented) + get isStarted(): boolean; + // (undocumented) + latestResponse: WithResponse; + // (undocumented) + get result(): WithResponse; +} + +// @public (undocumented) +export type RenderingSessionPollerLike = PollerLike>; + +// @public +export interface RenderingSessionSettings { + maxLeaseTimeInMinutes: number; + size: RenderingServerSize; +} + +// @public +export interface UpdateSessionSettings { + maxLeaseTimeInMinutes: number; +} + +// @public +export type WithResponse = T & { + _response: HttpResponse; +}; + // (No @packageDocumentation comment for this package) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json new file mode 100644 index 000000000000..8c89eac7173a --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "typescript/dist", + "lib": ["DOM", "ES6"] + }, + "include": ["typescript/src/**.ts"], + "exclude": ["typescript/*.json", "**/node_modules/", "../node_modules", "../typings"] +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json new file mode 100644 index 000000000000..f26d05289529 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json @@ -0,0 +1,39 @@ +{ + "name": "mixedreality-remoterendering-samples-ts", + "private": true, + "version": "0.1.0", + "description": "Azure Remote Rendering client library samples for TypeScript", + "engine": { + "node": ">=8.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/mixedreality/mixedreality-remoterendering" + }, + "keywords": [ + "Azure", + "Node.js", + "TypeScript" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template", + "sideEffects": false, + "dependencies": { + "@azure/mixedreality-remoterendering": "latest", + "dotenv": "^8.2.0" + }, + "devDependencies": { + "@types/node": "^8.0.0", + "rimraf": "^3.0.0", + "typescript": "^3.9.9" + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts new file mode 100644 index 000000000000..0e3d0040b94a --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Demonstrates using the Remote Rendering SDK to convert an asset. + */ + +import { + RemoteRenderingClient +} from "@azure/mixedreality-remoterendering"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || ""; +const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const storageAccountName = process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; +const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; + +export async function main() { + console.log("== Alternative Document Input Objects Sample =="); + + const client = new RemoteRenderingClient(); +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json new file mode 100644 index 000000000000..5ed056486b40 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + + "allowSyntheticDefaultImports": true, + + "strict": true, + "alwaysStrict": true, + + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 7fdf463f7d30..5b9d0c51b588 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -7,23 +7,33 @@ import { AssetConversion, KnownAssetConversionStatus } from "../generated/models import { AbortSignalLike } from "@azure/abort-controller"; -export class AssetConversionOperationState implements PollOperationState> { - client: RemoteRenderingClient; - conversionState: WithResponse; +export interface AssetConversionOperationState extends PollOperationState> { + /** + * The latest response when querying the service. The conversion may or may not be completed. + */ + latestResponse: WithResponse; +} + +export class AssetConversionOperationStateImpl + implements AssetConversionOperationState { + private client: RemoteRenderingClient; + latestResponse: WithResponse; constructor(client: RemoteRenderingClient, conversionState: WithResponse) { this.client = client; - this.conversionState = conversionState; + this.latestResponse = conversionState; } get isStarted(): boolean { + // TODO + this.client = this.client; return true; } get isCompleted(): boolean { return ( - this.conversionState.status != KnownAssetConversionStatus.NotStarted && - this.conversionState.status != KnownAssetConversionStatus.Running + this.latestResponse.status != KnownAssetConversionStatus.NotStarted && + this.latestResponse.status != KnownAssetConversionStatus.Running ); } @@ -32,23 +42,23 @@ export class AssetConversionOperationState implements PollOperationState { - return this.conversionState; + return this.latestResponse; } } class AssetConversionOperation - implements PollOperation { - state: AssetConversionOperationState; + implements PollOperation { + state: AssetConversionOperationStateImpl; - constructor(state: AssetConversionOperationState) { + constructor(state: AssetConversionOperationStateImpl) { this.state = state; } @@ -81,14 +91,17 @@ class AssetConversionOperation } } -export class AssetConversionPoller extends Poller> { +export class AssetConversionPoller extends Poller< + AssetConversionOperationStateImpl, + WithResponse +> { /** * Defines how much time the poller is going to wait before making a new request to the service. */ public intervalInMs: number = 10000; constructor(client: RemoteRenderingClient, assetConversion: WithResponse) { - super(new AssetConversionOperation(new AssetConversionOperationState(client, assetConversion))); + super(new AssetConversionOperation(new AssetConversionOperationStateImpl(client, assetConversion))); } /** @@ -101,7 +114,7 @@ export class AssetConversionPoller extends Poller> { - client: RemoteRenderingClient; - conversionState: WithResponse; +export interface RenderingSessionOperationState extends PollOperationState> { + /** + * The latest response when querying the service. The session may or may not be ready. + */ + latestResponse: WithResponse; +} + +export class RenderingSessionOperationStateImpl + implements PollOperationState> { + private client: RemoteRenderingClient; + latestResponse: WithResponse; constructor(client: RemoteRenderingClient, conversionState: WithResponse) { this.client = client; - this.conversionState = conversionState; + this.latestResponse = conversionState; } get isStarted(): boolean { + // TODO + this.client = this.client return true; } get isCompleted(): boolean { - return this.conversionState.status != KnownRenderingSessionStatus.Starting; + return this.latestResponse.status != KnownRenderingSessionStatus.Starting; } get isCancelled(): boolean { @@ -29,29 +39,29 @@ export class RenderingSessionOperationState implements PollOperationState { - return this.conversionState; + return this.latestResponse; } } class RenderingSessionOperation - implements PollOperation { - state: RenderingSessionOperationState; + implements PollOperation { + state: RenderingSessionOperationStateImpl; - constructor(state: RenderingSessionOperationState) { + constructor(state: RenderingSessionOperationStateImpl) { this.state = state; } update(_options?: { abortSignal?: AbortSignalLike; - fireProgress?: (state: RenderingSessionOperationState) => void; + fireProgress?: (state: RenderingSessionOperationStateImpl) => void; }): Promise { throw new Error("Not yet implemented."); } @@ -79,7 +89,7 @@ class RenderingSessionOperation } export class RenderingSessionPoller extends Poller< - RenderingSessionOperationState, + RenderingSessionOperationStateImpl, WithResponse > { /** @@ -89,7 +99,7 @@ export class RenderingSessionPoller extends Poller< constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { super( - new RenderingSessionOperation(new RenderingSessionOperationState(client, RenderingSession)) + new RenderingSessionOperation(new RenderingSessionOperationStateImpl(client, RenderingSession)) ); } @@ -103,7 +113,7 @@ export class RenderingSessionPoller extends Poller< /** * Gets the public state of the polling operation */ - public getOperationState(): RenderingSessionOperationState { + public getOperationState(): RenderingSessionOperationStateImpl { throw new Error("Not yet implemented."); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index bb719ac6f639..75e9f1e6bf3f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -23,8 +23,8 @@ import { RemoteRenderingRestClient } from "./generated"; import { AssetConversion, AssetConversionSettings, - RemoteRenderingCreateConversionResponse, RemoteRenderingRestClientOptionalParams, + RemoteRenderingCreateConversionResponse, RenderingSession, RenderingSessionSettings, RemoteRenderingCreateSessionResponse, @@ -50,19 +50,50 @@ import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; import { RenderingSessionPoller, - RenderingSessionOperationState + RenderingSessionOperationStateImpl } from "./lro/renderingSessionPoller"; export { AssetConversionOperationState, AssetConversion, - RenderingSessionPoller, - RenderingSessionOperationState + AssetConversionSettings, + RenderingSession, + RenderingSessionSettings, + RenderingSessionOperationStateImpl as RenderingSessionOperationState, + UpdateSessionSettings, + RemoteRenderingClientOptions +}; + +import { + AssetConversionInputSettings, + AssetConversionOutputSettings, + RemoteRenderingServiceError, + AssetConversionOutput, + AssetConversionStatus, + KnownAssetConversionStatus, + KnownRenderingSessionStatus, + RenderingServerSize, + KnownRenderingServerSize +} from "./generated/models/index"; + +export { + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionOutput, + AssetConversionStatus, + RemoteRenderingServiceError, + KnownAssetConversionStatus, + KnownRenderingSessionStatus, + RenderingServerSize, + KnownRenderingServerSize }; -export type AssetConversionPollerLike = PollerLike>; +export type AssetConversionPollerLike = PollerLike< + AssetConversionOperationState, + WithResponse +>; export type RenderingSessionPollerLike = PollerLike< - RenderingSessionOperationState, + RenderingSessionOperationStateImpl, WithResponse >; @@ -115,12 +146,20 @@ export class RemoteRenderingClient { ); /** - * Creates an instance of a MixedRealityStsClient. + * Creates an instance of a RemoteRenderingClient. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. * @param credential An access token obtained from the Mixed Reality STS service. * @param options Additional client options. */ + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + credential: AccessToken, + options: RemoteRenderingClientOptions + ); + constructor( endpoint: string, accountId: string, @@ -366,7 +405,10 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters. */ - public async endSession(sessionId: string, options?: OperationOptions): Promise> { + public async endSession( + sessionId: string, + options?: OperationOptions + ): Promise> { sessionId = sessionId; options = options; throw new Error("Not yet implemented."); From 14b34b919733b35ade881940c006be85c42a6ea4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 12:12:26 +0100 Subject: [PATCH 027/166] Formattign --- .../samples/typescript/src/conversion.ts | 10 +++++----- .../src/lro/assetConversionPoller.ts | 10 ++++++---- .../src/lro/renderingSessionPoller.ts | 9 ++++++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts index 0e3d0040b94a..32525972b7e5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts @@ -5,9 +5,7 @@ * Demonstrates using the Remote Rendering SDK to convert an asset. */ -import { - RemoteRenderingClient -} from "@azure/mixedreality-remoterendering"; +import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; // Load the .env file if it exists import * as dotenv from "dotenv"; @@ -18,8 +16,10 @@ const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountKey = process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || ""; const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; -const storageAccountName = process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; -const blobContainerName = process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; +const storageAccountName = + process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = + process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; export async function main() { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 5b9d0c51b588..7b2f5402e870 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -7,15 +7,15 @@ import { AssetConversion, KnownAssetConversionStatus } from "../generated/models import { AbortSignalLike } from "@azure/abort-controller"; -export interface AssetConversionOperationState extends PollOperationState> { +export interface AssetConversionOperationState + extends PollOperationState> { /** * The latest response when querying the service. The conversion may or may not be completed. */ latestResponse: WithResponse; } -export class AssetConversionOperationStateImpl - implements AssetConversionOperationState { +export class AssetConversionOperationStateImpl implements AssetConversionOperationState { private client: RemoteRenderingClient; latestResponse: WithResponse; @@ -101,7 +101,9 @@ export class AssetConversionPoller extends Poller< public intervalInMs: number = 10000; constructor(client: RemoteRenderingClient, assetConversion: WithResponse) { - super(new AssetConversionOperation(new AssetConversionOperationStateImpl(client, assetConversion))); + super( + new AssetConversionOperation(new AssetConversionOperationStateImpl(client, assetConversion)) + ); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 6bd0af90fe40..cb5991ed39ee 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -7,7 +7,8 @@ import { RenderingSession, KnownRenderingSessionStatus } from "../generated/mode import { AbortSignalLike } from "@azure/abort-controller"; -export interface RenderingSessionOperationState extends PollOperationState> { +export interface RenderingSessionOperationState + extends PollOperationState> { /** * The latest response when querying the service. The session may or may not be ready. */ @@ -26,7 +27,7 @@ export class RenderingSessionOperationStateImpl get isStarted(): boolean { // TODO - this.client = this.client + this.client = this.client; return true; } @@ -99,7 +100,9 @@ export class RenderingSessionPoller extends Poller< constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { super( - new RenderingSessionOperation(new RenderingSessionOperationStateImpl(client, RenderingSession)) + new RenderingSessionOperation( + new RenderingSessionOperationStateImpl(client, RenderingSession) + ) ); } From 02badcc68a6eb0fb7c806c9aa0bff198d81162e1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 12:23:58 +0100 Subject: [PATCH 028/166] Update dependency versions --- .../mixedreality-remoterendering/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index e1999e00c9ac..8c10e0b49518 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -72,11 +72,11 @@ "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { - "@azure/core-auth": "^1.2.0", + "@azure/core-auth": "^1.3.0", "@azure/core-http": "^1.2.0", - "@azure/core-tracing": "1.0.0-preview.9", + "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "^0.10.2", + "@opentelemetry/api": "1.0.0-rc.0", "tslib": "^2.0.0", "@azure/mixedreality-authentication": "1.0.0-beta.1", "@azure/core-lro": "^1.0.2", @@ -99,7 +99,7 @@ "dotenv": "^8.2.0", "eslint": "^7.15.0", "inherits": "^2.0.3", - "karma": "^5.1.0", + "karma": "^6.2.0", "karma-chrome-launcher": "^3.0.0", "karma-coverage": "^2.0.0", "karma-edge-launcher": "^0.4.2", @@ -118,7 +118,7 @@ "rimraf": "^3.0.0", "rollup": "^1.16.3", "typedoc": "0.15.2", - "typescript": "4.1.2", + "typescript": "~4.2.0", "util": "^0.12.1" }, "//sampleConfiguration": { From cf239a55db1b8cec2c9008d3b4031db1a4c979e0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 14:35:42 +0100 Subject: [PATCH 029/166] Update to latest source --- .../mixedreality-remoterendering/package.json | 1 - .../src/remoteRenderingClient.ts | 6 +- .../src/tracing.ts | 58 +++---------------- 3 files changed, 10 insertions(+), 55 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 8c10e0b49518..52f28cda636b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -76,7 +76,6 @@ "@azure/core-http": "^1.2.0", "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "1.0.0-rc.0", "tslib": "^2.0.0", "@azure/mixedreality-authentication": "1.0.0-beta.1", "@azure/core-lro": "^1.0.2", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 75e9f1e6bf3f..e1c6b2a3d6e9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -15,7 +15,7 @@ import { InternalPipelineOptions, HttpResponse } from "@azure/core-http"; -import { CanonicalCode } from "@opentelemetry/api"; +import { SpanStatusCode } from "@azure/core-tracing"; import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; @@ -275,7 +275,7 @@ export class RemoteRenderingClient { return Promise.resolve(result); } catch (e) { span.setStatus({ - code: CanonicalCode.UNKNOWN, + code: SpanStatusCode.ERROR, message: e.message }); throw e; @@ -356,7 +356,7 @@ export class RemoteRenderingClient { return Promise.resolve(result); } catch (e) { span.setStatus({ - code: CanonicalCode.UNKNOWN, + code: SpanStatusCode.ERROR, message: e.message }); throw e; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts b/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts index d5bd668486f5..b8b1ae740956 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts @@ -1,59 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getTracer } from "@azure/core-tracing"; -import { Span, SpanOptions, SpanKind } from "@opentelemetry/api"; -import { OperationOptions } from "@azure/core-http"; - -type OperationTracingOptions = OperationOptions["tracingOptions"]; +import { createSpanFunction } from "@azure/core-tracing"; /** * Creates a span using the global tracer. * @internal - * @param name The name of the operation being performed. - * @param tracingOptions The options for the underlying http request. */ -export function createSpan( - operationName: string, - operationOptions: T -): { span: Span; updatedOptions: T } { - const tracer = getTracer(); - const tracingOptions = operationOptions.tracingOptions || {}; - const spanOptions: SpanOptions = { - ...tracingOptions.spanOptions, - kind: SpanKind.INTERNAL - }; - - const span = tracer.startSpan(`Azure.MixedReality.${operationName}`, spanOptions); - - // Resource providers are documented here: - // https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers - span.setAttribute("Microsoft.MixedReality", "Microsoft.MixedReality"); - - let newSpanOptions = tracingOptions.spanOptions || {}; - if (span.isRecording()) { - newSpanOptions = { - ...tracingOptions.spanOptions, - parent: span.context(), - attributes: { - ...spanOptions.attributes, - "Microsoft.MixedReality": "Microsoft.MixedReality" - } - }; - } - - const newTracingOptions: OperationTracingOptions = { - ...tracingOptions, - spanOptions: newSpanOptions - }; - - const newOperationOptions: T = { - ...operationOptions, - tracingOptions: newTracingOptions - }; - - return { - span, - updatedOptions: newOperationOptions - }; -} +export const createSpan = createSpanFunction({ + packagePrefix: "Azure.MixedReality-RemoteRendering", + // TODO: oddly enough the createSpan here was actually the attribute named + // 'Microsoft.MixedReality', not 'az.namespace'. Might have been a bug. + namespace: "Microsoft.MixedReality" +}); From 6947313d2cc02f49dd8946d998c1f229cfa5e2b2 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 14:41:43 +0100 Subject: [PATCH 030/166] Copy authenticationEndpoint.ts from auth lib. --- .../api-extractor.json | 2 +- .../authentication/authenticationEndpoint.ts | 15 +++++++++++++++ .../src/remoteRenderingClient.ts | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json b/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json index 0745508b465d..6cea81b416bd 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json +++ b/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "types/remoterendering/mixedreality-remoterendering/src/index.d.ts", + "mainEntryPointFilePath": "types/src/index.d.ts", "docModel": { "enabled": true }, diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts new file mode 100644 index 000000000000..2e0ac1738ed3 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * Constructs the authentication endpoint from a Mixed Reality account domain. + * @internal + * @param accountDomain The Mixed Reality account domain. + */ +export function constructAuthenticationEndpointFromDomain(accountDomain: string): string { + if (!accountDomain) { + throw new Error("Argument cannot be null or empty: 'accountDomain'."); + } + + return `https://sts.${accountDomain}`; +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index e1c6b2a3d6e9..b8c84539099f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -32,7 +32,7 @@ import { } from "./generated/models/index"; // TODO: Maybe copy and paste this? -import { constructAuthenticationEndpointFromDomain } from "../../../mixedreality/mixedreality-authentication/src/util/authenticationEndpoint"; +import { constructAuthenticationEndpointFromDomain } from "../authentication/authenticationEndpoint"; import { RemoteRenderingClientOptions } from "./options"; import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; From 9d71f2224f2b8f25fef2698f33d3582517c12d7a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 31 Mar 2021 14:43:31 +0100 Subject: [PATCH 031/166] Remove comment --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index b8c84539099f..81b6b0c1c8b0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -31,7 +31,6 @@ import { UpdateSessionSettings } from "./generated/models/index"; -// TODO: Maybe copy and paste this? import { constructAuthenticationEndpointFromDomain } from "../authentication/authenticationEndpoint"; import { RemoteRenderingClientOptions } from "./options"; import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; From 88d0a2ac32ea03f8727be7e0f18753190d3be60b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Apr 2021 10:31:42 +0100 Subject: [PATCH 032/166] Flesh out conversion sample. --- .../mixedreality-remoterendering.api.md | 6 +-- .../samples/typescript/package.json | 6 ++- .../samples/typescript/src/conversion.ts | 40 +++++++++++++++++-- .../src/remoteRenderingClient.ts | 6 +-- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 76369dfa1366..372382c51f3a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -88,9 +88,9 @@ export const enum KnownRenderingSessionStatus { // @public export class RemoteRenderingClient { - constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options: RemoteRenderingClientOptions); - constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options: RemoteRenderingClientOptions); - constructor(endpoint: string, accountId: string, accountDomain: string, credential: AccessToken, options: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AccessToken, options?: RemoteRenderingClientOptions); beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: OperationOptions): Promise; beginSession(sessionId: string, renderingSessionSettings: RenderingSessionSettings, options?: OperationOptions): Promise; endSession(sessionId: string, options?: OperationOptions): Promise>; diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json index f26d05289529..551a7b898fa2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json @@ -28,11 +28,13 @@ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template", "sideEffects": false, "dependencies": { - "@azure/mixedreality-remoterendering": "latest", - "dotenv": "^8.2.0" + "@azure/mixedreality-remoterendering": "file:../..", + "dotenv": "^8.2.0", + "uuid": "^8.3.0" }, "devDependencies": { "@types/node": "^8.0.0", + "@types/uuid": "^8.3.0", "rimraf": "^3.0.0", "typescript": "^3.9.9" } diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts index 32525972b7e5..a78f7093276d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts @@ -1,11 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/// + +import { v4 as uuid } from "uuid"; /** * Demonstrates using the Remote Rendering SDK to convert an asset. */ -import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion, + KnownAssetConversionStatus +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists import * as dotenv from "dotenv"; @@ -14,7 +26,7 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || ""; +const accountKey = new AzureKeyCredential(process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || ""); const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; const storageAccountName = process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; @@ -25,5 +37,27 @@ const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; export async function main() { console.log("== Alternative Document Input Objects Sample =="); - const client = new RemoteRenderingClient(); + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + var storageContainerUrl : string = storageAccountName + ".blob.core.windows.net/" + blobContainerName; + + var inputSettings : AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas : sasToken, relativeInputAssetPath : "box.fbx" }; + var outputSettings : AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas : sasToken }; + var conversionOptions : AssetConversionSettings = { inputSettings, outputSettings }; + + // A randomly generated GUID is a good choice for a conversionId. + var conversionId : string = uuid(); + + var conversionPoller : AssetConversionPollerLike = await client.beginConversion(conversionId, conversionOptions); + + var conversion : AssetConversion = await conversionPoller.pollUntilDone(); + + if (conversion.status == KnownAssetConversionStatus.Succeeded) + { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } + else if (conversion.status == KnownAssetConversionStatus.Failed) + { + console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 81b6b0c1c8b0..e1ee6988e93b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -126,7 +126,7 @@ export class RemoteRenderingClient { accountId: string, accountDomain: string, credential: AzureKeyCredential, - options: RemoteRenderingClientOptions + options?: RemoteRenderingClientOptions ); /** @@ -141,7 +141,7 @@ export class RemoteRenderingClient { accountId: string, accountDomain: string, credential: TokenCredential, - options: RemoteRenderingClientOptions + options?: RemoteRenderingClientOptions ); /** @@ -156,7 +156,7 @@ export class RemoteRenderingClient { accountId: string, accountDomain: string, credential: AccessToken, - options: RemoteRenderingClientOptions + options?: RemoteRenderingClientOptions ); constructor( From 08a51848ffeab5dec244b6592358de34785cab7b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Apr 2021 10:32:02 +0100 Subject: [PATCH 033/166] Formatting --- .../samples/typescript/src/conversion.ts | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts index a78f7093276d..ef63b75eb492 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts @@ -3,12 +3,12 @@ /// -import { v4 as uuid } from "uuid"; +import { v4 as uuid } from "uuid"; /** * Demonstrates using the Remote Rendering SDK to convert an asset. */ -import { +import { RemoteRenderingClient, AssetConversionInputSettings, AssetConversionOutputSettings, @@ -26,7 +26,9 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential(process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || ""); +const accountKey = new AzureKeyCredential( + process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || "" +); const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; const storageAccountName = process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; @@ -39,25 +41,33 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var storageContainerUrl : string = storageAccountName + ".blob.core.windows.net/" + blobContainerName; + var storageContainerUrl: string = + storageAccountName + ".blob.core.windows.net/" + blobContainerName; - var inputSettings : AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas : sasToken, relativeInputAssetPath : "box.fbx" }; - var outputSettings : AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas : sasToken }; - var conversionOptions : AssetConversionSettings = { inputSettings, outputSettings }; + var inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: sasToken, + relativeInputAssetPath: "box.fbx" + }; + var outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: sasToken + }; + var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; // A randomly generated GUID is a good choice for a conversionId. - var conversionId : string = uuid(); + var conversionId: string = uuid(); - var conversionPoller : AssetConversionPollerLike = await client.beginConversion(conversionId, conversionOptions); + var conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionOptions + ); - var conversion : AssetConversion = await conversionPoller.pollUntilDone(); + var conversion: AssetConversion = await conversionPoller.pollUntilDone(); - if (conversion.status == KnownAssetConversionStatus.Succeeded) - { + if (conversion.status == KnownAssetConversionStatus.Succeeded) { console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); - } - else if (conversion.status == KnownAssetConversionStatus.Failed) - { + } else if (conversion.status == KnownAssetConversionStatus.Failed) { console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); } } From 71d778b47efcf86c8173ec5c34f397678ee570a8 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Apr 2021 14:27:16 +0100 Subject: [PATCH 034/166] Add test resources --- sdk/remoterendering/TestResources/testBox.fbx | 346 ++++++++++++++++++ sdk/remoterendering/test-resources-post.ps1 | 30 ++ sdk/remoterendering/test-resources.json | 121 ++++++ 3 files changed, 497 insertions(+) create mode 100644 sdk/remoterendering/TestResources/testBox.fbx create mode 100644 sdk/remoterendering/test-resources-post.ps1 create mode 100644 sdk/remoterendering/test-resources.json diff --git a/sdk/remoterendering/TestResources/testBox.fbx b/sdk/remoterendering/TestResources/testBox.fbx new file mode 100644 index 000000000000..13b967f33315 --- /dev/null +++ b/sdk/remoterendering/TestResources/testBox.fbx @@ -0,0 +1,346 @@ +; FBX 7.5.0 project file +; ---------------------------------------------------- + +FBXHeaderExtension: { + FBXHeaderVersion: 1003 + FBXVersion: 7500 + CreationTimeStamp: { + Version: 1000 + Year: 2021 + Month: 1 + Day: 24 + Hour: 10 + Minute: 15 + Second: 0 + Millisecond: 529 + } + Creator: "FBX SDK/FBX Plugins version 2018.1.1" + SceneInfo: "SceneInfo::GlobalInfo", "UserData" { + Type: "UserData" + Version: 100 + MetaData: { + Version: 100 + Title: "Exported .fbx from Lift" + Subject: "fbx" + Author: "" + Keywords: "Microsoft Community Paint" + Revision: "rev. 1.0" + Comment: "" + } + Properties70: { + P: "DocumentUrl", "KString", "Url", "", "testBox.fbx" + P: "SrcDocumentUrl", "KString", "Url", "", "testBox.fbx" + P: "Original", "Compound", "", "" + P: "Original|ApplicationVendor", "KString", "", "", "" + P: "Original|ApplicationName", "KString", "", "", "" + P: "Original|ApplicationVersion", "KString", "", "", "" + P: "Original|DateTime_GMT", "DateTime", "", "", "" + P: "Original|FileName", "KString", "", "", "" + P: "LastSaved", "Compound", "", "" + P: "LastSaved|ApplicationVendor", "KString", "", "", "" + P: "LastSaved|ApplicationName", "KString", "", "", "" + P: "LastSaved|ApplicationVersion", "KString", "", "", "" + P: "LastSaved|DateTime_GMT", "DateTime", "", "", "" + } + } +} +GlobalSettings: { + Version: 1000 + Properties70: { + P: "UpAxis", "int", "Integer", "",1 + P: "UpAxisSign", "int", "Integer", "",1 + P: "FrontAxis", "int", "Integer", "",2 + P: "FrontAxisSign", "int", "Integer", "",1 + P: "CoordAxis", "int", "Integer", "",0 + P: "CoordAxisSign", "int", "Integer", "",1 + P: "OriginalUpAxis", "int", "Integer", "",-1 + P: "OriginalUpAxisSign", "int", "Integer", "",1 + P: "UnitScaleFactor", "double", "Number", "",100 + P: "OriginalUnitScaleFactor", "double", "Number", "",1 + P: "AmbientColor", "ColorRGB", "Color", "",0,0,0 + P: "DefaultCamera", "KString", "", "", "Producer Perspective" + P: "TimeMode", "enum", "", "",0 + P: "TimeProtocol", "enum", "", "",2 + P: "SnapOnFrameMode", "enum", "", "",0 + P: "TimeSpanStart", "KTime", "Time", "",0 + P: "TimeSpanStop", "KTime", "Time", "",46186158000 + P: "CustomFrameRate", "double", "Number", "",-1 + P: "TimeMarker", "Compound", "", "" + P: "CurrentTimeMarker", "int", "Integer", "",-1 + } +} + +; Documents Description +;------------------------------------------------------------------ + +Documents: { + Count: 1 + Document: 2520542649728, "Scene", "Scene" { + Properties70: { + P: "SourceObject", "object", "", "" + P: "ActiveAnimStackName", "KString", "", "", "" + } + RootNode: 0 + } +} + +; Document References +;------------------------------------------------------------------ + +References: { +} + +; Object definitions +;------------------------------------------------------------------ + +Definitions: { + Version: 100 + Count: 4 + ObjectType: "GlobalSettings" { + Count: 1 + } + ObjectType: "Model" { + Count: 1 + PropertyTemplate: "FbxNode" { + Properties70: { + P: "QuaternionInterpolate", "enum", "", "",0 + P: "RotationOffset", "Vector3D", "Vector", "",0,0,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "ScalingOffset", "Vector3D", "Vector", "",0,0,0 + P: "ScalingPivot", "Vector3D", "Vector", "",0,0,0 + P: "TranslationActive", "bool", "", "",0 + P: "TranslationMin", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMax", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMinX", "bool", "", "",0 + P: "TranslationMinY", "bool", "", "",0 + P: "TranslationMinZ", "bool", "", "",0 + P: "TranslationMaxX", "bool", "", "",0 + P: "TranslationMaxY", "bool", "", "",0 + P: "TranslationMaxZ", "bool", "", "",0 + P: "RotationOrder", "enum", "", "",0 + P: "RotationSpaceForLimitOnly", "bool", "", "",0 + P: "RotationStiffnessX", "double", "Number", "",0 + P: "RotationStiffnessY", "double", "Number", "",0 + P: "RotationStiffnessZ", "double", "Number", "",0 + P: "AxisLen", "double", "Number", "",10 + P: "PreRotation", "Vector3D", "Vector", "",0,0,0 + P: "PostRotation", "Vector3D", "Vector", "",0,0,0 + P: "RotationActive", "bool", "", "",0 + P: "RotationMin", "Vector3D", "Vector", "",0,0,0 + P: "RotationMax", "Vector3D", "Vector", "",0,0,0 + P: "RotationMinX", "bool", "", "",0 + P: "RotationMinY", "bool", "", "",0 + P: "RotationMinZ", "bool", "", "",0 + P: "RotationMaxX", "bool", "", "",0 + P: "RotationMaxY", "bool", "", "",0 + P: "RotationMaxZ", "bool", "", "",0 + P: "InheritType", "enum", "", "",0 + P: "ScalingActive", "bool", "", "",0 + P: "ScalingMin", "Vector3D", "Vector", "",0,0,0 + P: "ScalingMax", "Vector3D", "Vector", "",1,1,1 + P: "ScalingMinX", "bool", "", "",0 + P: "ScalingMinY", "bool", "", "",0 + P: "ScalingMinZ", "bool", "", "",0 + P: "ScalingMaxX", "bool", "", "",0 + P: "ScalingMaxY", "bool", "", "",0 + P: "ScalingMaxZ", "bool", "", "",0 + P: "GeometricTranslation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricRotation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricScaling", "Vector3D", "Vector", "",1,1,1 + P: "MinDampRangeX", "double", "Number", "",0 + P: "MinDampRangeY", "double", "Number", "",0 + P: "MinDampRangeZ", "double", "Number", "",0 + P: "MaxDampRangeX", "double", "Number", "",0 + P: "MaxDampRangeY", "double", "Number", "",0 + P: "MaxDampRangeZ", "double", "Number", "",0 + P: "MinDampStrengthX", "double", "Number", "",0 + P: "MinDampStrengthY", "double", "Number", "",0 + P: "MinDampStrengthZ", "double", "Number", "",0 + P: "MaxDampStrengthX", "double", "Number", "",0 + P: "MaxDampStrengthY", "double", "Number", "",0 + P: "MaxDampStrengthZ", "double", "Number", "",0 + P: "PreferedAngleX", "double", "Number", "",0 + P: "PreferedAngleY", "double", "Number", "",0 + P: "PreferedAngleZ", "double", "Number", "",0 + P: "LookAtProperty", "object", "", "" + P: "UpVectorProperty", "object", "", "" + P: "Show", "bool", "", "",1 + P: "NegativePercentShapeSupport", "bool", "", "",1 + P: "DefaultAttributeIndex", "int", "Integer", "",-1 + P: "Freeze", "bool", "", "",0 + P: "LODBox", "bool", "", "",0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "Lcl Scaling", "Lcl Scaling", "", "A",1,1,1 + P: "Visibility", "Visibility", "", "A",1 + P: "Visibility Inheritance", "Visibility Inheritance", "", "",1 + } + } + } + ObjectType: "Material" { + Count: 1 + PropertyTemplate: "FbxSurfacePhong" { + Properties70: { + P: "ShadingModel", "KString", "", "", "Phong" + P: "MultiLayer", "bool", "", "",0 + P: "EmissiveColor", "Color", "", "A",0,0,0 + P: "EmissiveFactor", "Number", "", "A",1 + P: "AmbientColor", "Color", "", "A",0.2,0.2,0.2 + P: "AmbientFactor", "Number", "", "A",1 + P: "DiffuseColor", "Color", "", "A",0.8,0.8,0.8 + P: "DiffuseFactor", "Number", "", "A",1 + P: "Bump", "Vector3D", "Vector", "",0,0,0 + P: "NormalMap", "Vector3D", "Vector", "",0,0,0 + P: "BumpFactor", "double", "Number", "",1 + P: "TransparentColor", "Color", "", "A",0,0,0 + P: "TransparencyFactor", "Number", "", "A",0 + P: "DisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "DisplacementFactor", "double", "Number", "",1 + P: "VectorDisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "VectorDisplacementFactor", "double", "Number", "",1 + P: "SpecularColor", "Color", "", "A",0.2,0.2,0.2 + P: "SpecularFactor", "Number", "", "A",1 + P: "ShininessExponent", "Number", "", "A",20 + P: "ReflectionColor", "Color", "", "A",0,0,0 + P: "ReflectionFactor", "Number", "", "A",1 + } + } + } + ObjectType: "Geometry" { + Count: 1 + PropertyTemplate: "FbxMesh" { + Properties70: { + P: "Color", "ColorRGB", "Color", "",0.8,0.8,0.8 + P: "BBoxMin", "Vector3D", "Vector", "",0,0,0 + P: "BBoxMax", "Vector3D", "Vector", "",0,0,0 + P: "Primary Visibility", "bool", "", "",1 + P: "Casts Shadows", "bool", "", "",1 + P: "Receive Shadows", "bool", "", "",1 + } + } + } +} + +; Object properties +;------------------------------------------------------------------ + +Objects: { + Geometry: 2520544655040, "Geometry::mesh_id43", "Mesh" { + Properties70: { + P: "BBoxMin", "Vector3D", "Vector", "",-100,-100,-100 + P: "BBoxMax", "Vector3D", "Vector", "",100,100,100 + } + Vertices: *72 { + a: 100,100,-100,-100,-100,-100,-100,100,-100,100,-100,-100,-100,100,100,100,-100,100,100,100,100,-100,-100,100,100,100,100,100,-100,-100,100,100,-100,100,-100,100,-100,100,-100,-100,-100,100,-100,100,100,-100,-100,-100,-100,100,-100,100,100,100,100,100,-100,-100,100,100,-100,-100,100,100,-100,-100,100,-100,100,-100,-100,-100 + } + PolygonVertexIndex: *36 { + a: 0,1,-3,0,3,-2,4,5,-7,4,7,-6,8,9,-11,8,11,-10,12,13,-15,12,15,-14,16,17,-19,16,19,-18,20,21,-23,20,23,-22 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 102 + Name: "" + MappingInformationType: "ByVertice" + ReferenceInformationType: "Direct" + Normals: *72 { + a: 0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0 + } + NormalsW: *24 { + a: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + } + } + LayerElementColor: 0 { + Version: 101 + Name: "VertexColors" + MappingInformationType: "ByVertice" + ReferenceInformationType: "IndexToDirect" + Colors: *96 { + a: 0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByVertice" + ReferenceInformationType: "Direct" + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementColor" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 2520544652560, "Model::root", "Mesh" { + Version: 232 + Properties70: { + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "GeometricTranslation", "Vector3D", "Vector", "",0.029182942584157,0.0412420704960823,0.200006887316704 + P: "GeometricRotation", "Vector3D", "Vector", "",19.5286376895952,-30.3983310953995,0 + P: "GeometricScaling", "Vector3D", "Vector", "",0.00176811746427344,0.00159080407945701,0.00159080401671689 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: T + Culling: "CullingOff" + } + Material: 2520544654560, "Material::Material_50", "" { + Version: 102 + ShadingModel: "phong" + MultiLayer: 0 + Properties70: { + P: "DiffuseColor", "Color", "", "A",0.992156862745098,0.925490196078431,0.650980392156863 + P: "SpecularColor", "Color", "", "A",0.0352941176470588,0.0352941176470588,0.0352941176470588 + P: "ShininessExponent", "Number", "", "A",62.8694496154785 + P: "Emissive", "Vector3D", "Vector", "",0,0,0 + P: "Ambient", "Vector3D", "Vector", "",0.2,0.2,0.2 + P: "Diffuse", "Vector3D", "Vector", "",0.992156862745098,0.925490196078431,0.650980392156863 + P: "Specular", "Vector3D", "Vector", "",0.0352941176470588,0.0352941176470588,0.0352941176470588 + P: "Shininess", "double", "Number", "",62.8694496154785 + P: "Opacity", "double", "Number", "",1 + P: "Reflectivity", "double", "Number", "",0 + } + } +} + +; Object connections +;------------------------------------------------------------------ + +Connections: { + + ;Model::root, Model::RootNode + C: "OO",2520544652560,0 + + ;Geometry::mesh_id43, Model::root + C: "OO",2520544655040,2520544652560 + + ;Material::Material_50, Model::root + C: "OO",2520544654560,2520544652560 +} +;Takes section +;---------------------------------------------------- + +Takes: { + Current: "" +} diff --git a/sdk/remoterendering/test-resources-post.ps1 b/sdk/remoterendering/test-resources-post.ps1 new file mode 100644 index 000000000000..068dd4ebc92a --- /dev/null +++ b/sdk/remoterendering/test-resources-post.ps1 @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# This script is used to generate the Test Configuration file for Storage live tests. +# It is invoked by the https://github.com/Azure/azure-sdk-for-net/blob/master/eng/New-TestResources.ps1 +# script after the ARM template, defined in https://github.com/Azure/azure-sdk-for-net/blob/arm-template-storage/sdk/storage/test-resources.json, +# is finished being deployed. The ARM template is responsible for creating the Storage accounts needed for live tests. + +param ( + [hashtable] $DeploymentOutputs, + [string] $TenantId, + [string] $TestApplicationId, + [string] $TestApplicationSecret +) + +# outputs from the ARM deployment passed in from New-TestResources +$StorageAccountName = $DeploymentOutputs['REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME'] +$StorageAccountKey = $DeploymentOutputs['REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY'] +$BlobContainerName = $DeploymentOutputs['REMOTERENDERING_ARR_BLOB_CONTAINER_NAME'] + +$LocalFilePath = Join-Path $PSScriptRoot "TestResources\testBox.fbx" +$TargetBlob = "Input/testBox.fbx" + +Write-Verbose ( "Copying test asset to blob storage") + +$StorageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey + +$blob = Set-AzStorageBlobContent -File $LocalFilePath -Blob $TargetBlob -Container $BlobContainerName -Context $StorageContext -Force + +Write-Verbose ("Test asset successfully copied to blob storage") diff --git a/sdk/remoterendering/test-resources.json b/sdk/remoterendering/test-resources.json new file mode 100644 index 000000000000..441732ff8796 --- /dev/null +++ b/sdk/remoterendering/test-resources.json @@ -0,0 +1,121 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } + }, + "baseTime": { + "type": "string", + "defaultValue": "[utcNow('u')]" + } + }, + "variables": { + "apiVersion": "2020-05-01", + "arrApiVersion": "2020-04-06-preview", + "arrAccountName": "[concat(parameters('baseName'), '-arr-account')]", + "storageApiVersion": "2019-06-01", + "storageAccountName": "[parameters('baseName')]", + "blobContainerName": "test", + "blobContainerResourceName": "[concat(variables('storageAccountName'), '/default/', variables('blobContainerName'))]", + "sasProperties": { + "signedPermission": "rwl", + "signedExpiry": "[dateTimeAdd(parameters('baseTime'), 'P1D')]", + "signedResource": "c", + "canonicalizedResource": "[concat('/blob/', variables('storageAccountName'), '/', variables('blobContainerName'))]" + } + }, + "resources": [ + { + "type": "Microsoft.MixedReality/remoteRenderingAccounts", + "name": "[variables('arrAccountName')]", + "apiVersion": "[variables('arrApiVersion')]", + "location": "[parameters('location')]", + "properties": {}, + "identity": { "type": "systemAssigned" } + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('storageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "kind": "StorageV2", + "properties": { + "supportsHttpsTrafficOnly": true, + "encryption": { + "keySource": "Microsoft.Storage", + "services": { + "blob": { + "enabled": true + } + }, + }, + "accessTier": "Hot" + } + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('blobContainerResourceName')]", + "dependsOn": [ + "[variables('storageAccountName')]" + ] + } + ], + "outputs": { + "REMOTERENDERING_ARR_ACCOUNT_ID": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountId]" + }, + "REMOTERENDERING_ARR_ACCOUNT_DOMAIN": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountDomain]" + }, + "REMOTERENDERING_ARR_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('storageAccountName')]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value]" + }, + "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "REMOTERENDERING_ARR_SAS_TOKEN": { + "type": "string", + "value": "[listServiceSas(variables('storageAccountName'), variables('storageApiVersion'), variables('sasProperties')).serviceSasToken]" + }, + "REMOTERENDERING_ARR_SERVICE_ENDPOINT": { + "type": "string", + "value": "[concat('https://remoterendering.', parameters('location'), '.mixedreality.azure.com')]" + } + } +} \ No newline at end of file From b2de38eae35708e634cbca9a9a1ccd87241b6787 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Apr 2021 14:28:54 +0100 Subject: [PATCH 035/166] More conversion poller implementation. --- .../samples/typescript/src/conversion.ts | 6 +- .../src/lro/assetConversionPoller.ts | 28 +--- sdk/remoterendering/test-resources.json | 146 +++++++++--------- 3 files changed, 83 insertions(+), 97 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts index ef63b75eb492..3686d1960105 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts @@ -37,7 +37,7 @@ const blobContainerName = const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; export async function main() { - console.log("== Alternative Document Input Objects Sample =="); + console.log("== Convert an asset example =="); const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); @@ -47,7 +47,7 @@ export async function main() { var inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: sasToken, - relativeInputAssetPath: "box.fbx" + relativeInputAssetPath: "testBox.fbx" }; var outputSettings: AssetConversionOutputSettings = { storageContainerUrl, @@ -71,3 +71,5 @@ export async function main() { console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); } } + +main(); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 7b2f5402e870..977f91f02e98 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -16,17 +16,14 @@ export interface AssetConversionOperationState } export class AssetConversionOperationStateImpl implements AssetConversionOperationState { - private client: RemoteRenderingClient; latestResponse: WithResponse; - constructor(client: RemoteRenderingClient, conversionState: WithResponse) { - this.client = client; + constructor(conversionState: WithResponse) { this.latestResponse = conversionState; } get isStarted(): boolean { - // TODO - this.client = this.client; + // We do not take the KnownAssetConversionStatus.NotStarted status into account here. return true; } @@ -56,36 +53,25 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati class AssetConversionOperation implements PollOperation { + private client: RemoteRenderingClient; state: AssetConversionOperationStateImpl; - constructor(state: AssetConversionOperationStateImpl) { + constructor(client: RemoteRenderingClient, state: AssetConversionOperationStateImpl) { this.state = state; + this.client = client; } update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: AssetConversionOperationState) => void; }): Promise { - throw new Error("Not yet implemented."); + return this.client.getConversion(this.state.latestResponse.conversionId).then((res) => { this.state.latestResponse = res; return this; }); } - /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * It returns a promise that should be resolved with an updated version of the poller's operation. - * - * @param options - Optional properties passed to the operation's update method. - */ cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { throw new Error("Not yet implemented."); } - /** - * Serializes the operation. - * Useful when wanting to create a poller that monitors an existing operation. - */ toString(): string { throw new Error("Not yet implemented."); } @@ -102,7 +88,7 @@ export class AssetConversionPoller extends Poller< constructor(client: RemoteRenderingClient, assetConversion: WithResponse) { super( - new AssetConversionOperation(new AssetConversionOperationStateImpl(client, assetConversion)) + new AssetConversionOperation(client, new AssetConversionOperationStateImpl(assetConversion)) ); } diff --git a/sdk/remoterendering/test-resources.json b/sdk/remoterendering/test-resources.json index 441732ff8796..9f69130b2ebb 100644 --- a/sdk/remoterendering/test-resources.json +++ b/sdk/remoterendering/test-resources.json @@ -1,6 +1,6 @@ { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": { "baseName": { "type": "string", @@ -43,79 +43,77 @@ "canonicalizedResource": "[concat('/blob/', variables('storageAccountName'), '/', variables('blobContainerName'))]" } }, - "resources": [ - { - "type": "Microsoft.MixedReality/remoteRenderingAccounts", - "name": "[variables('arrAccountName')]", - "apiVersion": "[variables('arrApiVersion')]", - "location": "[parameters('location')]", - "properties": {}, - "identity": { "type": "systemAssigned" } - }, - { - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "[variables('storageApiVersion')]", - "name": "[variables('storageAccountName')]", - "location": "[parameters('location')]", - "sku": { - "name": "Standard_RAGRS", - "tier": "Standard" - }, - "kind": "StorageV2", - "properties": { - "supportsHttpsTrafficOnly": true, - "encryption": { - "keySource": "Microsoft.Storage", - "services": { - "blob": { - "enabled": true - } - }, - }, - "accessTier": "Hot" + "resources": [ + { + "type": "Microsoft.MixedReality/remoteRenderingAccounts", + "name": "[variables('arrAccountName')]", + "apiVersion": "[variables('arrApiVersion')]", + "location": "[parameters('location')]", + "properties": {}, + "identity": { "type": "systemAssigned" } + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('storageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "kind": "StorageV2", + "properties": { + "supportsHttpsTrafficOnly": true, + "encryption": { + "keySource": "Microsoft.Storage", + "services": { + "blob": { + "enabled": true } + } }, - { - "type": "Microsoft.Storage/storageAccounts/blobServices/containers", - "apiVersion": "[variables('storageApiVersion')]", - "name": "[variables('blobContainerResourceName')]", - "dependsOn": [ - "[variables('storageAccountName')]" - ] - } - ], - "outputs": { - "REMOTERENDERING_ARR_ACCOUNT_ID": { - "type": "string", - "value": "[reference(variables('arrAccountName')).accountId]" - }, - "REMOTERENDERING_ARR_ACCOUNT_DOMAIN": { - "type": "string", - "value": "[reference(variables('arrAccountName')).accountDomain]" - }, - "REMOTERENDERING_ARR_ACCOUNT_KEY": { - "type": "string", - "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" - }, - "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME": { - "type": "string", - "value": "[variables('storageAccountName')]" - }, - "REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY": { - "type": "string", - "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value]" - }, - "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME": { - "type": "string", - "value": "[variables('blobContainerName')]" - }, - "REMOTERENDERING_ARR_SAS_TOKEN": { - "type": "string", - "value": "[listServiceSas(variables('storageAccountName'), variables('storageApiVersion'), variables('sasProperties')).serviceSasToken]" - }, - "REMOTERENDERING_ARR_SERVICE_ENDPOINT": { - "type": "string", - "value": "[concat('https://remoterendering.', parameters('location'), '.mixedreality.azure.com')]" + "accessTier": "Hot" } + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('blobContainerResourceName')]", + "dependsOn": ["[variables('storageAccountName')]"] + } + ], + "outputs": { + "REMOTERENDERING_ARR_ACCOUNT_ID": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountId]" + }, + "REMOTERENDERING_ARR_ACCOUNT_DOMAIN": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountDomain]" + }, + "REMOTERENDERING_ARR_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('storageAccountName')]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value]" + }, + "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "REMOTERENDERING_ARR_SAS_TOKEN": { + "type": "string", + "value": "[listServiceSas(variables('storageAccountName'), variables('storageApiVersion'), variables('sasProperties')).serviceSasToken]" + }, + "REMOTERENDERING_ARR_SERVICE_ENDPOINT": { + "type": "string", + "value": "[concat('https://remoterendering.', parameters('location'), '.mixedreality.azure.com')]" } -} \ No newline at end of file + } +} From 2273492abf5144b8f0b092c775ce9397837f0b61 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 12 Apr 2021 19:42:35 +0100 Subject: [PATCH 036/166] Switch to samples-dev --- .../mixedreality-remoterendering/package.json | 21 +++-- .../mixedreality-remoterendering/sample.env | 22 +++-- .../samples-dev/conversion.ts | 90 +++++++++++++++++++ .../tsconfig.json | 8 +- 4 files changed, 127 insertions(+), 14 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 52f28cda636b..d6fde287fde5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -23,15 +23,15 @@ "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", - "build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .", "build:test": "tsc -p . && rollup -c 2>&1", "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-* test-dist temp types *.tgz *.log", "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src", - "execute:samples": "npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/", + "build:samples": "echo Obsolete.", + "execute:samples": "dev-tool samples run samples-dev", "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", "generate:client": "autorest --typescript --v3 swagger", "integration-test:browser": "karma start --single-run", "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", @@ -118,9 +118,18 @@ "rollup": "^1.16.3", "typedoc": "0.15.2", "typescript": "~4.2.0", - "util": "^0.12.1" + "util": "^0.12.1", + "@types/uuid": "^8.0.0" }, "//sampleConfiguration": { - "skipFolder": false + "productName": "Azure Remote Rendering", + "productSlugs": [ + "azure", + "azure-mixedreality-remoterendering" + ], + "requiredResources": { + "Azure Remote Rendering account": "https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account", + "Azure Storage account": "https://docs.microsoft.com/azure/storage/common/storage-account-create" + } } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/sample.env b/sdk/remoterendering/mixedreality-remoterendering/sample.env index 63d2520e7232..e841aca27fb9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/sample.env +++ b/sdk/remoterendering/mixedreality-remoterendering/sample.env @@ -1,13 +1,13 @@ # Used in most samples. Retrieve these values from an instance in the Azure # Portal. -APPCONFIG_ENDPOINT: "https://.azconfig.io", +#APPCONFIG_ENDPOINT: "https://.azconfig.io", # Used in the tests to indicate the key to use when retrieving a setting from # the App Configuration and the expected value of that setting. -APPCONFIG_TEST_SETTING_KEY="" -APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" +#APPCONFIG_TEST_SETTING_KEY="" +#APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" # Used to authenticate using Azure AD as a service principal for role-based # authentication in the tokenAuth sample. @@ -15,12 +15,22 @@ APPCONFIG_TEST_SETTING_EXPECTED_VALUE="" # See the documentation for `EnvironmentCredential` at the following link: # https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential -AZURE_TENANT_ID="" -AZURE_CLIENT_ID="" -AZURE_CLIENT_SECRET="" +#AZURE_TENANT_ID="" +#AZURE_CLIENT_ID="" +#AZURE_CLIENT_SECRET="" # Our tests assume that TEST_MODE is "playback" by default. You can change it # to "record" to generate new recordings, or "live" to bypass the recorder # entirely. # TEST_MODE="playback" + + +REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME="" +REMOTERENDERING_ARR_BLOB_CONTAINER_NAME="" +REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY="" +REMOTERENDERING_ARR_ACCOUNT_KEY="" +REMOTERENDERING_ARR_ACCOUNT_DOMAIN="" +REMOTERENDERING_ARR_ACCOUNT_ID="" +REMOTERENDERING_ARR_SAS_TOKEN="" +REMOTERENDERING_ARR_SERVICE_ENDPOINT="" diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts new file mode 100644 index 000000000000..36806a18885a --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to convert an asset. + */ + +/// + +//import { v4 as uuid } from "uuid"; + +//const uuid = require("uuid").v4; + +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion, + KnownAssetConversionStatus +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = new AzureKeyCredential( + process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || "" +); +const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const storageAccountName = + process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = + process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; +const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + var storageContainerUrl: string = + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + + var inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: sasToken, + relativeInputAssetPath: "testBox.fbx" + }; + var outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: sasToken + }; + var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; + + // A randomly generated GUID is a good choice for a conversionId. + //var conversionId: string = uuid(); + var conversionId: string = "asslkdjas"; + + console.log("== Starting the conversion =="); + + var conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionOptions + ); + + console.log("== Polling =="); + + var conversion: AssetConversion = await conversionPoller.pollUntilDone(); + + console.log("== Check results =="); + + if (conversion.status == KnownAssetConversionStatus.Succeeded) { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } else if (conversion.status == KnownAssetConversionStatus.Failed) { + console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); + } +} + +main(); +//.catch((err) => { +// console.error("The sample encountered an error:", err); +//}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json index 9784ff1f1ed3..e4ceba069325 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json +++ b/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json @@ -2,7 +2,10 @@ "extends": "../../../tsconfig.package", "compilerOptions": { "outDir": "./dist-esm", - "declarationDir": "./types" + "declarationDir": "./types", + "paths": { + "@azure/mixedreality-remoterendering": ["./src/index"] + } }, "exclude": [ "node_modules", @@ -13,5 +16,6 @@ "dist-samples", "dist-esm", "./samples/**/*.ts" - ] + ], + "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] } From db2cc668dbd3221e08ecbbc9d612c33eb6b55325 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 10:28:08 +0100 Subject: [PATCH 037/166] Import UUID --- .../mixedreality-remoterendering/package.json | 2 +- .../samples-dev/conversion.ts | 21 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index d6fde287fde5..4775e5dff783 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -119,7 +119,7 @@ "typedoc": "0.15.2", "typescript": "~4.2.0", "util": "^0.12.1", - "@types/uuid": "^8.0.0" + "uuid": "^8.3.0" }, "//sampleConfiguration": { "productName": "Azure Remote Rendering", diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index 36806a18885a..892e65bd43d1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -7,9 +7,7 @@ /// -//import { v4 as uuid } from "uuid"; - -//const uuid = require("uuid").v4; +import { v4 as uuid } from "uuid"; import { RemoteRenderingClient, @@ -27,17 +25,17 @@ import * as dotenv from "dotenv"; dotenv.config(); // You will need to set this environment variables or edit the following values -const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; -const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; const accountKey = new AzureKeyCredential( - process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || "" + process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" ); -const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; const storageAccountName = - process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; + process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; const blobContainerName = - process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; -const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; + process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; +const sasToken = process.env["REMOTERENDERING_ARR_SAS_TOKEN"] || ""; export async function main() { console.log("== Convert an asset example =="); @@ -61,8 +59,7 @@ export async function main() { var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; // A randomly generated GUID is a good choice for a conversionId. - //var conversionId: string = uuid(); - var conversionId: string = "asslkdjas"; + var conversionId: string = uuid(); console.log("== Starting the conversion =="); From 65a55562c840b72bfcdea611727943c1e854a10c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:14:01 +0100 Subject: [PATCH 038/166] Remove old samples --- .../samples/tsconfig.json | 10 --- .../samples/typescript/package.json | 41 ---------- .../samples/typescript/src/conversion.ts | 75 ------------------- .../samples/typescript/tsconfig.json | 16 ---- 4 files changed, 142 deletions(-) delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json deleted file mode 100644 index 8c89eac7173a..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "typescript/dist", - "lib": ["DOM", "ES6"] - }, - "include": ["typescript/src/**.ts"], - "exclude": ["typescript/*.json", "**/node_modules/", "../node_modules", "../typings"] -} diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json deleted file mode 100644 index 551a7b898fa2..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "mixedreality-remoterendering-samples-ts", - "private": true, - "version": "0.1.0", - "description": "Azure Remote Rendering client library samples for TypeScript", - "engine": { - "node": ">=8.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/mixedreality/mixedreality-remoterendering" - }, - "keywords": [ - "Azure", - "Node.js", - "TypeScript" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template", - "sideEffects": false, - "dependencies": { - "@azure/mixedreality-remoterendering": "file:../..", - "dotenv": "^8.2.0", - "uuid": "^8.3.0" - }, - "devDependencies": { - "@types/node": "^8.0.0", - "@types/uuid": "^8.3.0", - "rimraf": "^3.0.0", - "typescript": "^3.9.9" - } -} diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts deleted file mode 100644 index 3686d1960105..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/src/conversion.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/// - -import { v4 as uuid } from "uuid"; -/** - * Demonstrates using the Remote Rendering SDK to convert an asset. - */ - -import { - RemoteRenderingClient, - AssetConversionInputSettings, - AssetConversionOutputSettings, - AssetConversionSettings, - AssetConversionPollerLike, - AssetConversion, - KnownAssetConversionStatus -} from "@azure/mixedreality-remoterendering"; -import { AzureKeyCredential } from "@azure/core-auth"; - -// Load the .env file if it exists -import * as dotenv from "dotenv"; -dotenv.config(); - -// You will need to set this environment variables or edit the following values -const accountDomain = process.env["REMOTE_RENDERING_ARR_ACCOUNT_DOMAIN"] || ""; -const accountId = process.env["REMOTE_RENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTE_RENDERING_ARR_ACCOUNT_KEY"] || "" -); -const serviceEndpoint = process.env["REMOTE_RENDERING_ARR_SERVICE_ENDPOINT"] || ""; -const storageAccountName = - process.env["REMOTE_RENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; -const blobContainerName = - process.env["REMOTE_RENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; -const sasToken = process.env["REMOTE_RENDERING_ARR_SAS_TOKEN"] || ""; - -export async function main() { - console.log("== Convert an asset example =="); - - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - - var storageContainerUrl: string = - storageAccountName + ".blob.core.windows.net/" + blobContainerName; - - var inputSettings: AssetConversionInputSettings = { - storageContainerUrl, - storageContainerReadListSas: sasToken, - relativeInputAssetPath: "testBox.fbx" - }; - var outputSettings: AssetConversionOutputSettings = { - storageContainerUrl, - storageContainerWriteSas: sasToken - }; - var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; - - // A randomly generated GUID is a good choice for a conversionId. - var conversionId: string = uuid(); - - var conversionPoller: AssetConversionPollerLike = await client.beginConversion( - conversionId, - conversionOptions - ); - - var conversion: AssetConversion = await conversionPoller.pollUntilDone(); - - if (conversion.status == KnownAssetConversionStatus.Succeeded) { - console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); - } else if (conversion.status == KnownAssetConversionStatus.Failed) { - console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); - } -} - -main(); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json b/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json deleted file mode 100644 index 5ed056486b40..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/samples/typescript/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - - "allowSyntheticDefaultImports": true, - - "strict": true, - "alwaysStrict": true, - - "outDir": "dist", - "rootDir": "src" - }, - "include": ["src/**.ts"], - "exclude": ["node_modules"] -} From 8e28d733c81e45566dbce916fc5c85c63ca75d09 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:16:47 +0100 Subject: [PATCH 039/166] More UUID package stuff --- sdk/remoterendering/mixedreality-remoterendering/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 4775e5dff783..4794bba62327 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -119,6 +119,7 @@ "typedoc": "0.15.2", "typescript": "~4.2.0", "util": "^0.12.1", + "@types/uuid": "^8.0.0", "uuid": "^8.3.0" }, "//sampleConfiguration": { From 5f23d36c8493f35ea59586c772841be8748e4a8c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:19:57 +0100 Subject: [PATCH 040/166] Add try catch to beginConversion --- .../src/remoteRenderingClient.ts | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index e1ee6988e93b..9103b787439c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -236,17 +236,38 @@ export class RemoteRenderingClient { assetConversionSettings: AssetConversionSettings, options?: OperationOptions ): Promise { - let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( - this.accountId, - conversionId, - { settings: assetConversionSettings }, - options - ); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { + conversionId: conversionId, + ...options + }); - let poller = new AssetConversionPoller(this, assetConversion); + try { + let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( + this.accountId, + conversionId, + { settings: assetConversionSettings }, + updatedOptions + ); + + let poller = new AssetConversionPoller(this, assetConversion); + + // TODO Do I want this? + await poller.poll(); + + return poller; + } catch (e) { + // There are different standard codes available for different errors: + // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#status + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + + throw e; + } finally { + span.end(); + } - await poller.poll(); - return poller; } /** From 771188a9f58f0ebee9bf20af7e0fa5d24c3cf89e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:38:24 +0100 Subject: [PATCH 041/166] Fix trivial promises. --- .../authentication/mixedRealityAccountKeyCredential.ts | 4 ++-- .../authentication/staticAccessTokenCredential.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index 4156c17afd65..e052833b0435 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -20,9 +20,9 @@ export class MixedRealityAccountKeyCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((_resolve, _reject) => ({ + return new Promise((resolve, _reject) => (resolve({ token: this.accountId + ":" + this.accountKey, expiresOnTimestamp: Number.MAX_VALUE - })); + }))); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index 9ccbd3aefe41..ab29ce1db9b4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -11,6 +11,6 @@ export class StaticAccessTokenCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((_resolve, _reject) => this.token); + return new Promise((resolve, _reject) => resolve(this.token)); } } From 2484ec860ccd4c2594725fe69731d8a41ac90982 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:39:28 +0100 Subject: [PATCH 042/166] Formatting. --- .../authentication/mixedRealityAccountKeyCredential.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index e052833b0435..4884e3708ad8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -20,9 +20,11 @@ export class MixedRealityAccountKeyCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((resolve, _reject) => (resolve({ - token: this.accountId + ":" + this.accountKey, - expiresOnTimestamp: Number.MAX_VALUE - }))); + return new Promise((resolve, _reject) => + resolve({ + token: this.accountId + ":" + this.accountKey, + expiresOnTimestamp: Number.MAX_VALUE + }) + ); } } From 2304577f62935bcf391b8fbfd48613b3925a35ba Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:42:11 +0100 Subject: [PATCH 043/166] Formatting --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 9103b787439c..abf2ce423fa1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -267,7 +267,6 @@ export class RemoteRenderingClient { } finally { span.end(); } - } /** From 2f9c952ddbf0a66cc72779be1f04179c4bab0b24 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 12:54:47 +0100 Subject: [PATCH 044/166] Make Trivial promises more correct. --- .../mixedRealityAccountKeyCredential.ts | 11 ++++++----- .../authentication/staticAccessTokenCredential.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index 4884e3708ad8..a8f74315706d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -20,11 +20,12 @@ export class MixedRealityAccountKeyCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((resolve, _reject) => - resolve({ - token: this.accountId + ":" + this.accountKey, - expiresOnTimestamp: Number.MAX_VALUE - }) + return new Promise((resolve, _reject) => { + resolve({ + token: this.accountId + ":" + this.accountKey, + expiresOnTimestamp: Number.MAX_VALUE + }); + } ); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index ab29ce1db9b4..0f685b4c88ea 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -11,6 +11,6 @@ export class StaticAccessTokenCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((resolve, _reject) => resolve(this.token)); + return new Promise((resolve, _reject) => { resolve(this.token); }); } } From 6d4b36bdbd8bcafe8488de6f97e489fdf4294ca1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 14:31:40 +0100 Subject: [PATCH 045/166] Copy MixedRealityAccountKeyCredential from auth lib --- .../mixedRealityAccountKeyCredential.ts | 54 ++++++++++++------- .../mixedRealityTokenCredential.ts | 3 +- .../staticAccessTokenCredential.ts | 2 +- .../src/remoteRenderingClient.ts | 7 +-- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index a8f74315706d..72e33b464aab 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -1,31 +1,47 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; - import { AzureKeyCredential } from "@azure/core-auth"; +import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-http"; + +const maxTimestampMs = 8640000000000000; +/** + * Represents an object used for Mixed Reality account key authentication. + * @internal + */ export class MixedRealityAccountKeyCredential implements TokenCredential { - private accountId: string; - private accountKey: AzureKeyCredential; + private readonly accountKey: AzureKeyCredential; - /// - /// Initializes a new instance of the class. - /// - /// The Mixed Reality service account identifier. - /// The Mixed Reality service account primary or secondary key. - constructor(accountId: string, accountKey: AzureKeyCredential) { - this.accountId = accountId; - this.accountKey = accountKey; + /** + * Creates an instance of a MixedRealityAccountKeyCredential. + * @param accountId The Mixed Reality service account identifier. + * @param accountKey The Mixed Reality service account primary or secondary key. + */ + constructor(public readonly accountId: string, accountKey: string | AzureKeyCredential) { + if (typeof accountKey === "string") { + this.accountKey = new AzureKeyCredential(accountKey); + } else { + this.accountKey = accountKey; + } } + /** + * Gets the token provided by this credential. + * + * This method is called automatically by Azure SDK client libraries. You may call this method + * directly, but you must also handle token caching and token refreshing. + * + * @param scopes - The list of scopes for which the token will have access. + * @param options - The options used to configure any requests this + * TokenCredential implementation might make. + */ getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((resolve, _reject) => { - resolve({ - token: this.accountId + ":" + this.accountKey, - expiresOnTimestamp: Number.MAX_VALUE - }); - } - ); + const result: AccessToken = { + expiresOnTimestamp: maxTimestampMs, + token: `${this.accountId}:${this.accountKey.key}` + }; + + return Promise.resolve(result); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts index a51784a9d901..c1165bff9914 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts @@ -31,8 +31,7 @@ export class MixedRealityTokenCredential implements TokenCredential { credential: TokenCredential, options: MixedRealityStsClientOptions ): TokenCredential { - var token = credential as StaticAccessTokenCredential; - if (token) { + if (credential instanceof StaticAccessTokenCredential) { // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange // them using the MixedRealityTokenCredential. return credential; diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index 0f685b4c88ea..aec4e7ba5328 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -11,6 +11,6 @@ export class StaticAccessTokenCredential implements TokenCredential { } getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { - return new Promise((resolve, _reject) => { resolve(this.token); }); + return Promise.resolve(this.token); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index abf2ce423fa1..3c983275f9f0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -169,7 +169,7 @@ export class RemoteRenderingClient { this.accountId = accountId; // The below code helps us set a proper User-Agent header on all requests - const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; + const libInfo = `azsdk-js-mixedreality-remoterendering/${SDK_VERSION}`; if (!options.userAgentOptions) { options.userAgentOptions = {}; @@ -194,9 +194,10 @@ export class RemoteRenderingClient { } }; - const tokenCredential: TokenCredential = (credential as AzureKeyCredential) + const tokenCredential: TokenCredential = (credential instanceof AzureKeyCredential) ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) - : (credential as AccessToken) + // TODO Make this more type safe. + : (credential.hasOwnProperty("token") !== undefined) ? new StaticAccessTokenCredential(credential as AccessToken) : (credential as TokenCredential); From 3630ecb8be4fd24ccd78c689013f6429cef21182 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 15:13:47 +0100 Subject: [PATCH 046/166] Conversion sample now working. --- .../samples-dev/conversion.ts | 9 +++++---- .../src/lro/assetConversionPoller.ts | 6 +++--- .../src/lro/renderingSessionPoller.ts | 6 +++--- .../src/remoteRenderingClient.ts | 18 ++++++++++-------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index 892e65bd43d1..f5ae0733a5e7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -44,17 +44,18 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var storageContainerUrl: string = - storageAccountName + ".blob.core.windows.net/" + blobContainerName; + var storageContainerUrl: string = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; var inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: sasToken, - relativeInputAssetPath: "testBox.fbx" + relativeInputAssetPath: "testBox.fbx", + blobPrefix: "Input" }; var outputSettings: AssetConversionOutputSettings = { storageContainerUrl, - storageContainerWriteSas: sasToken + storageContainerWriteSas: sasToken, + blobPrefix: "Output" }; var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 977f91f02e98..e2b313e99bcf 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -5,7 +5,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; -import { AbortSignalLike } from "@azure/abort-controller"; +import { delay, AbortSignalLike } from "@azure/core-http"; export interface AssetConversionOperationState extends PollOperationState> { @@ -96,13 +96,13 @@ export class AssetConversionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - throw new Error("Not yet implemented."); + return delay(this.intervalInMs); } /** * Gets the public state of the polling operation */ public getOperationState(): AssetConversionOperationStateImpl { - throw new Error("Not yet implemented."); + return this.operation.state; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index cb5991ed39ee..6c4c1b52ae8a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -5,7 +5,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; -import { AbortSignalLike } from "@azure/abort-controller"; +import { delay, AbortSignalLike } from "@azure/core-http"; export interface RenderingSessionOperationState extends PollOperationState> { @@ -110,13 +110,13 @@ export class RenderingSessionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - throw new Error("Not yet implemented."); + return delay(this.intervalInMs); } /** * Gets the public state of the polling operation */ public getOperationState(): RenderingSessionOperationStateImpl { - throw new Error("Not yet implemented."); + return this.operation.state; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 3c983275f9f0..2f8396b055c1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -31,10 +31,12 @@ import { UpdateSessionSettings } from "./generated/models/index"; -import { constructAuthenticationEndpointFromDomain } from "../authentication/authenticationEndpoint"; import { RemoteRenderingClientOptions } from "./options"; + +import { constructAuthenticationEndpointFromDomain } from "../authentication/authenticationEndpoint"; import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; +import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; @@ -43,7 +45,6 @@ import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; @@ -194,12 +195,13 @@ export class RemoteRenderingClient { } }; - const tokenCredential: TokenCredential = (credential instanceof AzureKeyCredential) - ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) - // TODO Make this more type safe. - : (credential.hasOwnProperty("token") !== undefined) - ? new StaticAccessTokenCredential(credential as AccessToken) - : (credential as TokenCredential); + const tokenCredential: TokenCredential = + credential instanceof AzureKeyCredential + ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) + : // TODO Make this more type safe. + credential.hasOwnProperty("token") !== undefined + ? new StaticAccessTokenCredential(credential as AccessToken) + : (credential as TokenCredential); const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); From 932a3be0fca62836151211753b728b109db10f2b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 16:14:16 +0100 Subject: [PATCH 047/166] Session sample --- .../samples-dev/conversion.ts | 14 ++-- .../samples-dev/session.ts | 73 +++++++++++++++++++ .../src/lro/assetConversionPoller.ts | 5 +- .../src/lro/renderingSessionPoller.ts | 22 +++--- .../src/remoteRenderingClient.ts | 62 ++++++++++++---- 5 files changed, 143 insertions(+), 33 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index f5ae0733a5e7..f36792346d82 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -44,7 +44,8 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var storageContainerUrl: string = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + var storageContainerUrl: string = + "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; var inputSettings: AssetConversionInputSettings = { storageContainerUrl, @@ -57,7 +58,7 @@ export async function main() { storageContainerWriteSas: sasToken, blobPrefix: "Output" }; - var conversionOptions: AssetConversionSettings = { inputSettings, outputSettings }; + var conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; // A randomly generated GUID is a good choice for a conversionId. var conversionId: string = uuid(); @@ -66,7 +67,7 @@ export async function main() { var conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, - conversionOptions + conversionSettings ); console.log("== Polling =="); @@ -82,7 +83,6 @@ export async function main() { } } -main(); -//.catch((err) => { -// console.error("The sample encountered an error:", err); -//}); +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts new file mode 100644 index 000000000000..30bb161b6c09 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to start a session. + */ + +/// + +import { v4 as uuid } from "uuid"; + +import { + KnownRenderingServerSize, + RemoteRenderingClient, + RenderingSessionSettings, + RenderingSessionPollerLike, + RenderingSession, + KnownRenderingSessionStatus +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = new AzureKeyCredential( + process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" +); +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Start a session example =="); + + console.log("== Creating a client =="); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + var sessionSettings : RenderingSessionSettings = { + maxLeaseTimeInMinutes : 4, + size: KnownRenderingServerSize.Standard + }; + + // A randomly generated GUID is a good choice for a conversionId. + var sessionId: string = uuid(); + + console.log("== Starting the conversion =="); + + var sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings + ); + + console.log("== Polling =="); + + var session: RenderingSession = await sessionPoller.pollUntilDone(); + + console.log("== Check results =="); + + if (session.status == KnownRenderingSessionStatus.Ready) { + console.log("The rendering session is ready"); + } else if (session.status == KnownRenderingSessionStatus.Error) { + console.log("The rendering session encountered an error: " + session.error?.message); + } + + client.endSession(sessionId); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index e2b313e99bcf..9c411f441fc8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -65,7 +65,10 @@ class AssetConversionOperation abortSignal?: AbortSignalLike; fireProgress?: (state: AssetConversionOperationState) => void; }): Promise { - return this.client.getConversion(this.state.latestResponse.conversionId).then((res) => { this.state.latestResponse = res; return this; }); + return this.client.getConversion(this.state.latestResponse.conversionId).then((res) => { + this.state.latestResponse = res; + return this; + }); } cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 6c4c1b52ae8a..a743855ed732 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -15,19 +15,14 @@ export interface RenderingSessionOperationState latestResponse: WithResponse; } -export class RenderingSessionOperationStateImpl - implements PollOperationState> { - private client: RemoteRenderingClient; +export class RenderingSessionOperationStateImpl implements RenderingSessionOperationState { latestResponse: WithResponse; - constructor(client: RemoteRenderingClient, conversionState: WithResponse) { - this.client = client; + constructor(conversionState: WithResponse) { this.latestResponse = conversionState; } get isStarted(): boolean { - // TODO - this.client = this.client; return true; } @@ -54,17 +49,22 @@ export class RenderingSessionOperationStateImpl class RenderingSessionOperation implements PollOperation { + private client: RemoteRenderingClient; state: RenderingSessionOperationStateImpl; - constructor(state: RenderingSessionOperationStateImpl) { + constructor(client: RemoteRenderingClient, state: RenderingSessionOperationStateImpl) { this.state = state; + this.client = client; } update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: RenderingSessionOperationStateImpl) => void; }): Promise { - throw new Error("Not yet implemented."); + return this.client.getSession(this.state.latestResponse.sessionId).then((res) => { + this.state.latestResponse = res; + return this; + }); } /** @@ -100,8 +100,8 @@ export class RenderingSessionPoller extends Poller< constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { super( - new RenderingSessionOperation( - new RenderingSessionOperationStateImpl(client, RenderingSession) + new RenderingSessionOperation(client, + new RenderingSessionOperationStateImpl(RenderingSession) ) ); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2f8396b055c1..032e59d5a59e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -45,7 +45,6 @@ import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; - import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; import { @@ -293,7 +292,6 @@ export class RemoteRenderingClient { updatedOptions ); - // TODO Presumably, this may not carry a conversion object. return Promise.resolve(result); } catch (e) { span.setStatus({ @@ -342,17 +340,34 @@ export class RemoteRenderingClient { renderingSessionSettings: RenderingSessionSettings, options?: OperationOptions ): Promise { - let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( - this.accountId, - sessionId, - renderingSessionSettings, - options - ); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { + conversionId: sessionId, + ...options + }); - let poller = new RenderingSessionPoller(this, renderingSession); + try { + let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( + this.accountId, + sessionId, + renderingSessionSettings, + updatedOptions + ); - await poller.poll(); - return poller; + let poller = new RenderingSessionPoller(this, renderingSession); + + // Do I want this? + await poller.poll(); + + return poller; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } /** @@ -431,9 +446,28 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise> { - sessionId = sessionId; - options = options; - throw new Error("Not yet implemented."); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-EndSession", { + conversionId: sessionId, + ...options + }); + + try { + let result = await this.operations.stopSession( + this.accountId, + sessionId, + updatedOptions + ); + + return Promise.resolve(result); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } /** From 657eb33d76caf1820db889bb571a7c543f5a797b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 13 Apr 2021 18:02:09 +0100 Subject: [PATCH 048/166] listConversions --- .../samples-dev/listConversions.ts | 49 +++++++++++++++++++ .../samples-dev/session.ts | 6 +-- .../src/lro/renderingSessionPoller.ts | 3 +- .../src/remoteRenderingClient.ts | 48 +++++++++++++++++- 4 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts new file mode 100644 index 000000000000..df5e2d04e7ad --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to list conversions. + */ + +/// + +import { + RemoteRenderingClient, + AssetConversion, + KnownAssetConversionStatus +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = new AzureKeyCredential( + process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" +); +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + console.log("== Starting listing conversions =="); + + for await (const conversion of client.listConversions()) { + if (conversion.status == KnownAssetConversionStatus.Succeeded) { + console.log(`Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}`); + } else if (conversion.status == KnownAssetConversionStatus.Failed) { + console.log(`Conversion ${conversion.conversionId} failed: ${conversion.error?.code} ${conversion.error?.message}`); + } + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index 30bb161b6c09..9f2e9cdcccb2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -38,15 +38,15 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var sessionSettings : RenderingSessionSettings = { - maxLeaseTimeInMinutes : 4, + var sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, size: KnownRenderingServerSize.Standard }; // A randomly generated GUID is a good choice for a conversionId. var sessionId: string = uuid(); - console.log("== Starting the conversion =="); + console.log("== Starting the session =="); var sessionPoller: RenderingSessionPollerLike = await client.beginSession( sessionId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index a743855ed732..d5045a199079 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -100,7 +100,8 @@ export class RenderingSessionPoller extends Poller< constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { super( - new RenderingSessionOperation(client, + new RenderingSessionOperation( + client, new RenderingSessionOperationStateImpl(RenderingSession) ) ); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 032e59d5a59e..883263cdb3f6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -318,13 +318,57 @@ export class RemoteRenderingClient { throw new Error("Not yet implemented."); } + private async *getAllConversionsPagingPage( + options?: OperationOptions + ): AsyncIterableIterator { + let result = await this.operations.listConversions(this.accountId, options); + yield result.conversions; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this.operations.listConversionsNext(this.accountId, continuationToken, options); + continuationToken = result.nextLink; + yield result.conversions; + } + } + + private async *getAllConversionsPagingAll( + options?: OperationOptions + ): AsyncIterableIterator { + for await (const page of this.getAllConversionsPagingPage(options)) { + yield* page; + } + } + /** * Gets a list of all conversions. * @param options The options parameters. */ public listConversions(options?: OperationOptions): PagedAsyncIterableIterator { - options = options; - throw new Error("Not yet implemented."); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { + ...options + }); + try { + const iter = this.getAllConversionsPagingAll(updatedOptions); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getAllConversionsPagingPage(updatedOptions); + } + }; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } /** From 0ef28d17d18e18a2f6ad4cef9dda458fbefc36d2 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 09:35:15 +0100 Subject: [PATCH 049/166] List sessions sample. --- .../samples-dev/listConversions.ts | 13 +- .../samples-dev/listSessions.ts | 68 +++++++++ .../src/remoteRenderingClient.ts | 137 ++++++++++++++---- 3 files changed, 185 insertions(+), 33 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index df5e2d04e7ad..a7a7212e2f60 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -9,7 +9,6 @@ import { RemoteRenderingClient, - AssetConversion, KnownAssetConversionStatus } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -37,10 +36,14 @@ export async function main() { for await (const conversion of client.listConversions()) { if (conversion.status == KnownAssetConversionStatus.Succeeded) { - console.log(`Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}`); - } else if (conversion.status == KnownAssetConversionStatus.Failed) { - console.log(`Conversion ${conversion.conversionId} failed: ${conversion.error?.code} ${conversion.error?.message}`); - } + console.log( + `Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}` + ); + } else if (conversion.status == KnownAssetConversionStatus.Failed) { + console.log( + `Conversion ${conversion.conversionId} failed: ${conversion.error?.code} ${conversion.error?.message}` + ); + } } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts new file mode 100644 index 000000000000..5ddda51a022a --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to list conversions. + */ + +/// + +import { + RemoteRenderingClient, + KnownRenderingSessionStatus, + KnownRenderingServerSize +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +import { v4 as uuid } from "uuid"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +import { delay } from "@azure/core-http"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = new AzureKeyCredential( + process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" +); +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + console.log("== Creating a test session to query =="); + + const sessionId: string = uuid(); + await client.beginSession(sessionId, { maxLeaseTimeInMinutes: 5, size: KnownRenderingServerSize.Standard}); + await delay(10000); + + console.log("== Starting listing sessions =="); + + for await (const session of client.listSessions()) { + if (session.status == KnownRenderingSessionStatus.Starting) { + console.log( + `Session ${session.sessionId} is starting` + ); + } else if (session.status == KnownRenderingSessionStatus.Ready) { + console.log( + `Session ${session.sessionId} is ready` + ); + } + } + + console.log("== All sessions listed =="); + + console.log("== Stop the test session =="); + + client.endSession(sessionId); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 883263cdb3f6..a2a4bbe22c19 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -1,12 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -// TODO: -// * Work out how responses are normally obtained -// * Should there be a synchronous version of the API? -// * Generate the artifact (a doc model file: https://api-extractor.com/pages/setup/generating_docs/) -// * Upload to apiview - import { TokenCredential, OperationOptions, @@ -28,7 +22,8 @@ import { RenderingSession, RenderingSessionSettings, RemoteRenderingCreateSessionResponse, - UpdateSessionSettings + UpdateSessionSettings, + RemoteRenderingGetSessionResponse } from "./generated/models/index"; import { RemoteRenderingClientOptions } from "./options"; @@ -49,7 +44,7 @@ import { RemoteRendering } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; import { RenderingSessionPoller, - RenderingSessionOperationStateImpl + RenderingSessionOperationState } from "./lro/renderingSessionPoller"; export { @@ -58,7 +53,7 @@ export { AssetConversionSettings, RenderingSession, RenderingSessionSettings, - RenderingSessionOperationStateImpl as RenderingSessionOperationState, + RenderingSessionOperationState, UpdateSessionSettings, RemoteRenderingClientOptions }; @@ -92,7 +87,7 @@ export type AssetConversionPollerLike = PollerLike< WithResponse >; export type RenderingSessionPollerLike = PollerLike< - RenderingSessionOperationStateImpl, + RenderingSessionOperationState, WithResponse >; @@ -286,7 +281,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.getConversion( + let result: RemoteRenderingCreateConversionResponse = await this.operations.getConversion( this.accountId, conversionId, updatedOptions @@ -313,9 +308,28 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise { - conversionId = conversionId; - options = options; - throw new Error("Not yet implemented."); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversionPoller", { + conversionId, + ...options + }); + + try { + let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.getConversion( + this.accountId, + conversionId, + updatedOptions + ); + + return new AssetConversionPoller(this, assetConversion); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } private async *getAllConversionsPagingPage( @@ -325,12 +339,16 @@ export class RemoteRenderingClient { yield result.conversions; let continuationToken = result.nextLink; while (continuationToken) { - result = await this.operations.listConversionsNext(this.accountId, continuationToken, options); + result = await this.operations.listConversionsNext( + this.accountId, + continuationToken, + options + ); continuationToken = result.nextLink; yield result.conversions; } } - + private async *getAllConversionsPagingAll( options?: OperationOptions ): AsyncIterableIterator { @@ -401,7 +419,7 @@ export class RemoteRenderingClient { // Do I want this? await poller.poll(); - + return poller; } catch (e) { span.setStatus({ @@ -454,10 +472,29 @@ export class RemoteRenderingClient { public async getSessionPoller( sessionId: string, options?: OperationOptions - ): Promise { - sessionId = sessionId; - options = options; - throw new Error("Not yet implemented."); + ): Promise { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetSessionPoller", { + sessionId, + ...options + }); + + try { + let renderingSession: RemoteRenderingGetSessionResponse = await this.operations.getSession( + this.accountId, + sessionId, + updatedOptions + ); + + return new RenderingSessionPoller(this, renderingSession); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } /** @@ -496,11 +533,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.stopSession( - this.accountId, - sessionId, - updatedOptions - ); + let result = await this.operations.stopSession(this.accountId, sessionId, updatedOptions); return Promise.resolve(result); } catch (e) { @@ -514,12 +547,60 @@ export class RemoteRenderingClient { } } + private async *getAllSessionsPagingPage( + options?: OperationOptions + ): AsyncIterableIterator { + let result = await this.operations.listSessions(this.accountId, options); + yield result.sessions; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this.operations.listSessionsNext( + this.accountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.sessions; + } + } + + private async *getAllSessionsPagingAll( + options?: OperationOptions + ): AsyncIterableIterator { + for await (const page of this.getAllSessionsPagingPage(options)) { + yield* page; + } + } + /** * Gets a list of all sessions. * @param options The options parameters. */ public listSessions(options?: OperationOptions): PagedAsyncIterableIterator { - options = options; - throw new Error("Not yet implemented."); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { + ...options + }); + try { + const iter = this.getAllSessionsPagingAll(updatedOptions); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getAllSessionsPagingPage(updatedOptions); + } + }; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } } From 766b0761384f54f3273723d3bfdf73ac87f1258e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 09:49:05 +0100 Subject: [PATCH 050/166] UpdateSession --- .../samples-dev/listSessions.ts | 15 ++++--- .../src/remoteRenderingClient.ts | 39 ++++++++++--------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index 5ddda51a022a..67ab1147ee53 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -39,20 +39,19 @@ export async function main() { console.log("== Creating a test session to query =="); const sessionId: string = uuid(); - await client.beginSession(sessionId, { maxLeaseTimeInMinutes: 5, size: KnownRenderingServerSize.Standard}); + await client.beginSession(sessionId, { + maxLeaseTimeInMinutes: 5, + size: KnownRenderingServerSize.Standard + }); await delay(10000); - + console.log("== Starting listing sessions =="); for await (const session of client.listSessions()) { if (session.status == KnownRenderingSessionStatus.Starting) { - console.log( - `Session ${session.sessionId} is starting` - ); + console.log(`Session ${session.sessionId} is starting`); } else if (session.status == KnownRenderingSessionStatus.Ready) { - console.log( - `Session ${session.sessionId} is ready` - ); + console.log(`Session ${session.sessionId} is ready`); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index a2a4bbe22c19..b76d15054cce 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -281,13 +281,11 @@ export class RemoteRenderingClient { }); try { - let result: RemoteRenderingCreateConversionResponse = await this.operations.getConversion( + return await this.operations.getConversion( this.accountId, conversionId, updatedOptions ); - - return Promise.resolve(result); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -449,10 +447,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.getSession(this.accountId, sessionId, updatedOptions); - - // TODO Presumably, this may not carry a session object. - return Promise.resolve(result); + return this.operations.getSession(this.accountId, sessionId, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -510,10 +505,22 @@ export class RemoteRenderingClient { updateSessionSettings: UpdateSessionSettings, options?: OperationOptions ): Promise> { - sessionId = sessionId; - updateSessionSettings = updateSessionSettings; - options = options; - throw new Error("Not yet implemented."); + const { span, updatedOptions } = createSpan("RemoteRenderingClient-UpdateSession", { + conversionId: sessionId, + ...options + }); + + try { + return this.operations.updateSession(this.accountId, sessionId, updateSessionSettings, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } /** @@ -533,9 +540,7 @@ export class RemoteRenderingClient { }); try { - let result = await this.operations.stopSession(this.accountId, sessionId, updatedOptions); - - return Promise.resolve(result); + return this.operations.stopSession(this.accountId, sessionId, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -554,11 +559,7 @@ export class RemoteRenderingClient { yield result.sessions; let continuationToken = result.nextLink; while (continuationToken) { - result = await this.operations.listSessionsNext( - this.accountId, - continuationToken, - options - ); + result = await this.operations.listSessionsNext(this.accountId, continuationToken, options); continuationToken = result.nextLink; yield result.sessions; } From 88f5425df7fcc70058e84127d9b5acf698628969 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 11:22:33 +0100 Subject: [PATCH 051/166] commonQueries for conversion --- .../src/internal/commonQueries.ts | 38 +++++++++++++ .../src/lro/assetConversionPoller.ts | 19 ++++--- .../src/remoteRenderingClient.ts | 55 +++++-------------- 3 files changed, 64 insertions(+), 48 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts new file mode 100644 index 000000000000..dade99d2a65a --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + OperationOptions +} from "@azure/core-http"; +import { + AssetConversion, + } from "../generated/models/index"; +import { RemoteRendering } from "../generated/operations"; +import { WithResponse } from "../remoteRenderingClient"; +import { createSpan } from "../tracing"; +import { SpanStatusCode } from "@azure/core-tracing"; + +export async function getConversionInternal( + accountId: string, + operations: RemoteRendering, + conversionId: string, + tracingSpanName: string, + options?: OperationOptions +) : Promise> { + const { span, updatedOptions } = createSpan(tracingSpanName, { + conversionId: conversionId, + ...options + }); + + try { + return await operations.getConversion(accountId, conversionId, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 9c411f441fc8..28b31e7e570c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -2,9 +2,10 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; +import { WithResponse } from "../remoteRenderingClient"; import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; - +import { RemoteRendering } from "../generated/operations"; +import { getConversionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; export interface AssetConversionOperationState @@ -53,19 +54,21 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati class AssetConversionOperation implements PollOperation { - private client: RemoteRenderingClient; + private accountId: string; + private operations: RemoteRendering; state: AssetConversionOperationStateImpl; - constructor(client: RemoteRenderingClient, state: AssetConversionOperationStateImpl) { + constructor(accountId: string, operations: RemoteRendering, state: AssetConversionOperationStateImpl) { + this.operations = operations; + this.accountId = accountId; this.state = state; - this.client = client; } update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: AssetConversionOperationState) => void; }): Promise { - return this.client.getConversion(this.state.latestResponse.conversionId).then((res) => { + return getConversionInternal(this.accountId, this.operations, this.state.latestResponse.conversionId, "AssetConversionPoller-Update").then((res) => { this.state.latestResponse = res; return this; }); @@ -89,9 +92,9 @@ export class AssetConversionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(client: RemoteRenderingClient, assetConversion: WithResponse) { + constructor(accountId: string, operations: RemoteRendering, assetConversion: WithResponse) { super( - new AssetConversionOperation(client, new AssetConversionOperationStateImpl(assetConversion)) + new AssetConversionOperation(accountId, operations, new AssetConversionOperationStateImpl(assetConversion)) ); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index b76d15054cce..9a8f164a14b7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -47,6 +47,8 @@ import { RenderingSessionOperationState } from "./lro/renderingSessionPoller"; +import { getConversionInternal } from "./internal/commonQueries"; + export { AssetConversionOperationState, AssetConversion, @@ -246,7 +248,7 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new AssetConversionPoller(this, assetConversion); + let poller = new AssetConversionPoller(this.accountId, this.operations, assetConversion); // TODO Do I want this? await poller.poll(); @@ -275,26 +277,7 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise> { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversion", { - conversionId: conversionId, - ...options - }); - - try { - return await this.operations.getConversion( - this.accountId, - conversionId, - updatedOptions - ); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + return getConversionInternal(this.accountId, this.operations, conversionId, "RemoteRenderingClient-GetConversion", options); } /** @@ -306,28 +289,15 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetConversionPoller", { - conversionId, - ...options - }); - - try { - let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.getConversion( + let assetConversion: WithResponse = await getConversionInternal( this.accountId, + this.operations, conversionId, - updatedOptions + "RemoteRenderingClient-GetConversionPoller", + options ); - return new AssetConversionPoller(this, assetConversion); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + return new AssetConversionPoller(this.accountId, this.operations, assetConversion); } private async *getAllConversionsPagingPage( @@ -511,7 +481,12 @@ export class RemoteRenderingClient { }); try { - return this.operations.updateSession(this.accountId, sessionId, updateSessionSettings, updatedOptions); + return this.operations.updateSession( + this.accountId, + sessionId, + updateSessionSettings, + updatedOptions + ); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, From 1b97b9587bd452662d50e772a338dce0ca673973 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 11:33:02 +0100 Subject: [PATCH 052/166] commonQueries for sessions --- .../src/internal/commonQueries.ts | 57 ++++++++++----- .../src/lro/assetConversionPoller.ts | 25 +++++-- .../src/lro/renderingSessionPoller.ts | 20 +++--- .../src/remoteRenderingClient.ts | 70 ++++++------------- 4 files changed, 95 insertions(+), 77 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index dade99d2a65a..f2666f89c7d7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -1,38 +1,59 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - OperationOptions -} from "@azure/core-http"; -import { - AssetConversion, - } from "../generated/models/index"; +import { OperationOptions } from "@azure/core-http"; +import { AssetConversion, RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { WithResponse } from "../remoteRenderingClient"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; export async function getConversionInternal( + accountId: string, + operations: RemoteRendering, + conversionId: string, + tracingSpanName: string, + options?: OperationOptions +): Promise> { + const { span, updatedOptions } = createSpan(tracingSpanName, { + conversionId: conversionId, + ...options + }); + + try { + return await operations.getConversion(accountId, conversionId, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} + +export async function getSessionInternal( accountId: string, operations: RemoteRendering, - conversionId: string, + sessionId: string, tracingSpanName: string, options?: OperationOptions -) : Promise> { +): Promise> { const { span, updatedOptions } = createSpan(tracingSpanName, { - conversionId: conversionId, + sessionId, ...options - }); - - try { - return await operations.getConversion(accountId, conversionId, updatedOptions); - } catch (e) { + }); + + try { + return operations.getSession(accountId, sessionId, updatedOptions); + } catch (e) { span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message + code: SpanStatusCode.ERROR, + message: e.message }); throw e; - } finally { + } finally { span.end(); - } + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 28b31e7e570c..15fecf441e43 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -58,7 +58,11 @@ class AssetConversionOperation private operations: RemoteRendering; state: AssetConversionOperationStateImpl; - constructor(accountId: string, operations: RemoteRendering, state: AssetConversionOperationStateImpl) { + constructor( + accountId: string, + operations: RemoteRendering, + state: AssetConversionOperationStateImpl + ) { this.operations = operations; this.accountId = accountId; this.state = state; @@ -68,7 +72,12 @@ class AssetConversionOperation abortSignal?: AbortSignalLike; fireProgress?: (state: AssetConversionOperationState) => void; }): Promise { - return getConversionInternal(this.accountId, this.operations, this.state.latestResponse.conversionId, "AssetConversionPoller-Update").then((res) => { + return getConversionInternal( + this.accountId, + this.operations, + this.state.latestResponse.conversionId, + "AssetConversionOperation-Update" + ).then((res) => { this.state.latestResponse = res; return this; }); @@ -92,9 +101,17 @@ export class AssetConversionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(accountId: string, operations: RemoteRendering, assetConversion: WithResponse) { + constructor( + accountId: string, + operations: RemoteRendering, + assetConversion: WithResponse + ) { super( - new AssetConversionOperation(accountId, operations, new AssetConversionOperationStateImpl(assetConversion)) + new AssetConversionOperation( + accountId, + operations, + new AssetConversionOperationStateImpl(assetConversion) + ) ); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index d5045a199079..0b87e981ca94 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -2,10 +2,11 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { RemoteRenderingClient, WithResponse } from "../remoteRenderingClient"; +import { WithResponse } from "../remoteRenderingClient"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; - +import { getSessionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; +import { RemoteRendering } from "../generated/operations"; export interface RenderingSessionOperationState extends PollOperationState> { @@ -49,19 +50,21 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera class RenderingSessionOperation implements PollOperation { - private client: RemoteRenderingClient; + private accountId: string; + private operations: RemoteRendering; state: RenderingSessionOperationStateImpl; - constructor(client: RemoteRenderingClient, state: RenderingSessionOperationStateImpl) { + constructor(accountId: string, operations: RemoteRendering, state: RenderingSessionOperationStateImpl) { + this.accountId = accountId; + this.operations = operations; this.state = state; - this.client = client; } update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: RenderingSessionOperationStateImpl) => void; }): Promise { - return this.client.getSession(this.state.latestResponse.sessionId).then((res) => { + return getSessionInternal(this.accountId, this.operations, this.state.latestResponse.sessionId, "RenderingSessionOperation-Update").then((res) => { this.state.latestResponse = res; return this; }); @@ -98,10 +101,11 @@ export class RenderingSessionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(client: RemoteRenderingClient, RenderingSession: WithResponse) { + constructor(accountId: string, operations: RemoteRendering, RenderingSession: WithResponse) { super( new RenderingSessionOperation( - client, + accountId, + operations, new RenderingSessionOperationStateImpl(RenderingSession) ) ); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 9a8f164a14b7..739b57012b43 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -23,7 +23,6 @@ import { RenderingSessionSettings, RemoteRenderingCreateSessionResponse, UpdateSessionSettings, - RemoteRenderingGetSessionResponse } from "./generated/models/index"; import { RemoteRenderingClientOptions } from "./options"; @@ -47,7 +46,7 @@ import { RenderingSessionOperationState } from "./lro/renderingSessionPoller"; -import { getConversionInternal } from "./internal/commonQueries"; +import { getConversionInternal, getSessionInternal } from "./internal/commonQueries"; export { AssetConversionOperationState, @@ -277,7 +276,13 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise> { - return getConversionInternal(this.accountId, this.operations, conversionId, "RemoteRenderingClient-GetConversion", options); + return getConversionInternal( + this.accountId, + this.operations, + conversionId, + "RemoteRenderingClient-GetConversion", + options + ); } /** @@ -289,15 +294,15 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise { - let assetConversion: WithResponse = await getConversionInternal( - this.accountId, - this.operations, - conversionId, - "RemoteRenderingClient-GetConversionPoller", - options - ); + let assetConversion: WithResponse = await getConversionInternal( + this.accountId, + this.operations, + conversionId, + "RemoteRenderingClient-GetConversionPoller", + options + ); - return new AssetConversionPoller(this.accountId, this.operations, assetConversion); + return new AssetConversionPoller(this.accountId, this.operations, assetConversion); } private async *getAllConversionsPagingPage( @@ -383,7 +388,7 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new RenderingSessionPoller(this, renderingSession); + let poller = new RenderingSessionPoller(this.accountId, this.operations, renderingSession); // Do I want this? await poller.poll(); @@ -411,22 +416,7 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise> { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetSession", { - sessionId, - ...options - }); - - try { - return this.operations.getSession(this.accountId, sessionId, updatedOptions); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + return getSessionInternal(this.accountId, this.operations, sessionId, "RemoteRenderingClient-GetSession", options); } /** @@ -438,28 +428,14 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-GetSessionPoller", { - sessionId, - ...options - }); - - try { - let renderingSession: RemoteRenderingGetSessionResponse = await this.operations.getSession( + let renderingSession: WithResponse = await getSessionInternal( this.accountId, + this.operations, sessionId, - updatedOptions + "RemoteRenderingClient-GetSessionPoller", + options ); - - return new RenderingSessionPoller(this, renderingSession); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + return new RenderingSessionPoller(this.accountId, this.operations, renderingSession); } /** From 0de5b3adf6502d262e87e6bd50564969741237c6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 11:33:30 +0100 Subject: [PATCH 053/166] Formatting --- .../src/internal/commonQueries.ts | 42 +++++++++---------- .../src/lro/renderingSessionPoller.ts | 19 +++++++-- .../src/remoteRenderingClient.ts | 26 +++++++----- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index f2666f89c7d7..287f6ce69d31 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -34,26 +34,26 @@ export async function getConversionInternal( } export async function getSessionInternal( - accountId: string, - operations: RemoteRendering, - sessionId: string, - tracingSpanName: string, - options?: OperationOptions + accountId: string, + operations: RemoteRendering, + sessionId: string, + tracingSpanName: string, + options?: OperationOptions ): Promise> { - const { span, updatedOptions } = createSpan(tracingSpanName, { - sessionId, - ...options - }); - - try { - return operations.getSession(accountId, sessionId, updatedOptions); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + const { span, updatedOptions } = createSpan(tracingSpanName, { + sessionId, + ...options + }); + + try { + return operations.getSession(accountId, sessionId, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 0b87e981ca94..1d0555b26fd2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -54,7 +54,11 @@ class RenderingSessionOperation private operations: RemoteRendering; state: RenderingSessionOperationStateImpl; - constructor(accountId: string, operations: RemoteRendering, state: RenderingSessionOperationStateImpl) { + constructor( + accountId: string, + operations: RemoteRendering, + state: RenderingSessionOperationStateImpl + ) { this.accountId = accountId; this.operations = operations; this.state = state; @@ -64,7 +68,12 @@ class RenderingSessionOperation abortSignal?: AbortSignalLike; fireProgress?: (state: RenderingSessionOperationStateImpl) => void; }): Promise { - return getSessionInternal(this.accountId, this.operations, this.state.latestResponse.sessionId, "RenderingSessionOperation-Update").then((res) => { + return getSessionInternal( + this.accountId, + this.operations, + this.state.latestResponse.sessionId, + "RenderingSessionOperation-Update" + ).then((res) => { this.state.latestResponse = res; return this; }); @@ -101,7 +110,11 @@ export class RenderingSessionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(accountId: string, operations: RemoteRendering, RenderingSession: WithResponse) { + constructor( + accountId: string, + operations: RemoteRendering, + RenderingSession: WithResponse + ) { super( new RenderingSessionOperation( accountId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 739b57012b43..f6e6d0039684 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -22,7 +22,7 @@ import { RenderingSession, RenderingSessionSettings, RemoteRenderingCreateSessionResponse, - UpdateSessionSettings, + UpdateSessionSettings } from "./generated/models/index"; import { RemoteRenderingClientOptions } from "./options"; @@ -416,7 +416,13 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise> { - return getSessionInternal(this.accountId, this.operations, sessionId, "RemoteRenderingClient-GetSession", options); + return getSessionInternal( + this.accountId, + this.operations, + sessionId, + "RemoteRenderingClient-GetSession", + options + ); } /** @@ -428,14 +434,14 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise { - let renderingSession: WithResponse = await getSessionInternal( - this.accountId, - this.operations, - sessionId, - "RemoteRenderingClient-GetSessionPoller", - options - ); - return new RenderingSessionPoller(this.accountId, this.operations, renderingSession); + let renderingSession: WithResponse = await getSessionInternal( + this.accountId, + this.operations, + sessionId, + "RemoteRenderingClient-GetSessionPoller", + options + ); + return new RenderingSessionPoller(this.accountId, this.operations, renderingSession); } /** From 2f91301dad30bfcd067fffbed87775a880a64ce0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 12:25:30 +0100 Subject: [PATCH 054/166] cancel for renderingsession lro --- .../src/internal/commonQueries.ts | 25 +++++++++++++++++++ .../src/lro/assetConversionPoller.ts | 12 ++++----- .../src/lro/renderingSessionPoller.ts | 18 ++++++------- .../src/remoteRenderingClient.ts | 19 ++------------ 4 files changed, 41 insertions(+), 33 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index 287f6ce69d31..dada34022b12 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -57,3 +57,28 @@ export async function getSessionInternal( span.end(); } } + +export async function endSessionInternal( + accountId: string, + operations: RemoteRendering, + sessionId: string, + tracingSpanName: string, + options?: OperationOptions +): Promise> { + const { span, updatedOptions } = createSpan(tracingSpanName, { + conversionId: sessionId, + ...options + }); + + try { + return operations.stopSession(accountId, sessionId, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 15fecf441e43..95fe56ce7770 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -68,23 +68,21 @@ class AssetConversionOperation this.state = state; } - update(_options?: { + async update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: AssetConversionOperationState) => void; }): Promise { - return getConversionInternal( + this.state.latestResponse = await getConversionInternal( this.accountId, this.operations, this.state.latestResponse.conversionId, "AssetConversionOperation-Update" - ).then((res) => { - this.state.latestResponse = res; - return this; - }); + ); + return this; } cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { - throw new Error("Not yet implemented."); + throw new Error("Cancel operation is not supported."); } toString(): string { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 1d0555b26fd2..6f4737a04e90 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -4,7 +4,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { WithResponse } from "../remoteRenderingClient"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; -import { getSessionInternal } from "../internal/commonQueries"; +import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; import { RemoteRendering } from "../generated/operations"; @@ -64,19 +64,17 @@ class RenderingSessionOperation this.state = state; } - update(_options?: { + async update(_options?: { abortSignal?: AbortSignalLike; fireProgress?: (state: RenderingSessionOperationStateImpl) => void; }): Promise { - return getSessionInternal( + this.state.latestResponse = await getSessionInternal( this.accountId, this.operations, this.state.latestResponse.sessionId, "RenderingSessionOperation-Update" - ).then((res) => { - this.state.latestResponse = res; - return this; - }); + ) + return this; } /** @@ -88,8 +86,10 @@ class RenderingSessionOperation * * @param options - Optional properties passed to the operation's update method. */ - cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { - throw new Error("Not yet implemented."); + async cancel(options?: { abortSignal?: AbortSignalLike }): Promise { + await endSessionInternal(this.accountId, this.operations, this.state.latestResponse.sessionId, + "RenderingSessionOperation-Cancel", options); + return this; } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index f6e6d0039684..b7d576711c5f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -46,7 +46,7 @@ import { RenderingSessionOperationState } from "./lro/renderingSessionPoller"; -import { getConversionInternal, getSessionInternal } from "./internal/commonQueries"; +import { endSessionInternal, getConversionInternal, getSessionInternal } from "./internal/commonQueries"; export { AssetConversionOperationState, @@ -491,22 +491,7 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise> { - const { span, updatedOptions } = createSpan("RemoteRenderingClient-EndSession", { - conversionId: sessionId, - ...options - }); - - try { - return this.operations.stopSession(this.accountId, sessionId, updatedOptions); - } catch (e) { - span.setStatus({ - code: SpanStatusCode.ERROR, - message: e.message - }); - throw e; - } finally { - span.end(); - } + return endSessionInternal(this.accountId, this.operations, sessionId, "RemoteRenderingClient-EndSession", options); } private async *getAllSessionsPagingPage( From ad29520e2c4b707412c672a8d19d9b66e52c3aaa Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 12:26:00 +0100 Subject: [PATCH 055/166] Formatting --- .../src/lro/renderingSessionPoller.ts | 11 ++++++++--- .../src/remoteRenderingClient.ts | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 6f4737a04e90..de577c75219c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -73,7 +73,7 @@ class RenderingSessionOperation this.operations, this.state.latestResponse.sessionId, "RenderingSessionOperation-Update" - ) + ); return this; } @@ -87,8 +87,13 @@ class RenderingSessionOperation * @param options - Optional properties passed to the operation's update method. */ async cancel(options?: { abortSignal?: AbortSignalLike }): Promise { - await endSessionInternal(this.accountId, this.operations, this.state.latestResponse.sessionId, - "RenderingSessionOperation-Cancel", options); + await endSessionInternal( + this.accountId, + this.operations, + this.state.latestResponse.sessionId, + "RenderingSessionOperation-Cancel", + options + ); return this; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index b7d576711c5f..efb3ce16dac3 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -46,7 +46,11 @@ import { RenderingSessionOperationState } from "./lro/renderingSessionPoller"; -import { endSessionInternal, getConversionInternal, getSessionInternal } from "./internal/commonQueries"; +import { + endSessionInternal, + getConversionInternal, + getSessionInternal +} from "./internal/commonQueries"; export { AssetConversionOperationState, @@ -491,7 +495,13 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise> { - return endSessionInternal(this.accountId, this.operations, sessionId, "RemoteRenderingClient-EndSession", options); + return endSessionInternal( + this.accountId, + this.operations, + sessionId, + "RemoteRenderingClient-EndSession", + options + ); } private async *getAllSessionsPagingPage( From 5f4062d851775426ac8a58a7f7ecc7e1c91dee03 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 15:14:11 +0100 Subject: [PATCH 056/166] Start writing tests. --- .../src/lro/assetConversionPoller.ts | 1 - .../src/remoteRenderingClient.ts | 12 +++ .../test/public/remoteRenderingClient.spec.ts | 83 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 95fe56ce7770..cd61c1c0d837 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -41,7 +41,6 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati get error(): Error | undefined { if (this.latestResponse.error != null) { - //TODO Add details. return new Error(this.latestResponse.error.message); } return undefined; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index efb3ce16dac3..e609a1f47f7c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -166,6 +166,18 @@ export class RemoteRenderingClient { credential: TokenCredential | AzureKeyCredential | AccessToken, options: RemoteRenderingClientOptions = {} ) { + if (!endpoint) { + throw new Error("Argument cannot be null or empty: 'endpoint'."); + } + + if (!accountId) { + throw new Error("Argument cannot be null or empty: 'accountId'."); + } + + if (!accountDomain) { + throw new Error("Argument cannot be null or empty: 'accountDomain'."); + } + this.accountId = accountId; // The below code helps us set a proper User-Agent header on all requests diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts new file mode 100644 index 000000000000..de9c4e88e9c5 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { assert } from "chai"; +//import { Context } from "mocha"; +//import { Recorder } from "@azure/test-utils-recorder"; + +import { + RemoteRenderingClient, +// AssetConversionInputSettings, +// AssetConversionOutputSettings, +// AssetConversionSettings, +// AssetConversionPollerLike, +// AssetConversion, +// KnownAssetConversionStatus + } from "../../src"; + import { AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; + import { AccessToken } from "@azure/core-http"; + +//import { AzureKeyCredential, MixedRealityStsClient } from "../src"; +//import { createClient, createRecorder } from "./utils/recordedClient"; + +describe("RemoteRenderingClient", () => { + const accountDomain = "mixedreality.azure.com"; + const accountId = "00000000-0000-0000-0000-000000000000"; + const accountKey = "00000000-0000-0000-0000-000000000000"; + const serviceEndpoint = "https://sts.mixedreality.azure.com"; + const keyCredential = new AzureKeyCredential(accountKey); + + it("can create", () => { + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, keyCredential); + + assert.isNotNull(client); + }); + + it("can create with AccessToken", () => { + const maxTimestampMs = 8640000000000000; + const accessToken: AccessToken = { expiresOnTimestamp: maxTimestampMs, token: `abcdefghijk` }; + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accessToken); + + assert.isNotNull(client); + }); + + it("can create with TokenCredential", () => { + const tokenCredential: TokenCredential = { getToken: (_scopes: string | string[], _options?: GetTokenOptions) => { return Promise.resolve(null); } }; + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, tokenCredential); + + assert.isNotNull(client); + }); + + it("can create with invalid arguments", () => { + assert.throws( + () => new RemoteRenderingClient(undefined!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, undefined!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), + "Argument cannot be null or empty: 'accountDomain'." + ); + + assert.throws( + () => new RemoteRenderingClient(null!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, null!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, null!, keyCredential), + "Argument cannot be null or empty: 'accountDomain'." + ); + }); +}); + From bba0c6b3a8f7053222700332e92ce41e7d423f36 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 17:05:23 +0100 Subject: [PATCH 057/166] Conversion tests --- .../samples-dev/conversion.ts | 14 +- .../samples-dev/listConversions.ts | 2 + .../samples-dev/session.ts | 8 +- .../test/public/remoteRenderingClient.spec.ts | 234 ++++++++++++------ .../test/utils/recordedClient.ts | 64 +++++ 5 files changed, 236 insertions(+), 86 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index f36792346d82..2be6cb8a5c6a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -44,35 +44,35 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var storageContainerUrl: string = + let storageContainerUrl: string = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; - var inputSettings: AssetConversionInputSettings = { + let inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: sasToken, relativeInputAssetPath: "testBox.fbx", blobPrefix: "Input" }; - var outputSettings: AssetConversionOutputSettings = { + let outputSettings: AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas: sasToken, blobPrefix: "Output" }; - var conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; // A randomly generated GUID is a good choice for a conversionId. - var conversionId: string = uuid(); + let conversionId: string = uuid(); console.log("== Starting the conversion =="); - var conversionPoller: AssetConversionPollerLike = await client.beginConversion( + let conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, conversionSettings ); console.log("== Polling =="); - var conversion: AssetConversion = await conversionPoller.pollUntilDone(); + let conversion: AssetConversion = await conversionPoller.pollUntilDone(); console.log("== Check results =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index a7a7212e2f60..c2ea1875282c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -45,6 +45,8 @@ export async function main() { ); } } + + console.log("== All conversions listed =="); } main().catch((err) => { diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index 9f2e9cdcccb2..d09447c76ae2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -38,24 +38,24 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - var sessionSettings: RenderingSessionSettings = { + let sessionSettings: RenderingSessionSettings = { maxLeaseTimeInMinutes: 4, size: KnownRenderingServerSize.Standard }; // A randomly generated GUID is a good choice for a conversionId. - var sessionId: string = uuid(); + let sessionId: string = uuid(); console.log("== Starting the session =="); - var sessionPoller: RenderingSessionPollerLike = await client.beginSession( + let sessionPoller: RenderingSessionPollerLike = await client.beginSession( sessionId, sessionSettings ); console.log("== Polling =="); - var session: RenderingSession = await sessionPoller.pollUntilDone(); + let session: RenderingSession = await sessionPoller.pollUntilDone(); console.log("== Check results =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index de9c4e88e9c5..e5282f919294 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -2,82 +2,166 @@ // Licensed under the MIT license. import { assert } from "chai"; -//import { Context } from "mocha"; -//import { Recorder } from "@azure/test-utils-recorder"; +import { Context } from "mocha"; +import { Recorder } from "@azure/test-utils-recorder"; import { - RemoteRenderingClient, -// AssetConversionInputSettings, -// AssetConversionOutputSettings, -// AssetConversionSettings, -// AssetConversionPollerLike, -// AssetConversion, -// KnownAssetConversionStatus - } from "../../src"; - import { AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; - import { AccessToken } from "@azure/core-http"; - -//import { AzureKeyCredential, MixedRealityStsClient } from "../src"; -//import { createClient, createRecorder } from "./utils/recordedClient"; - -describe("RemoteRenderingClient", () => { - const accountDomain = "mixedreality.azure.com"; - const accountId = "00000000-0000-0000-0000-000000000000"; - const accountKey = "00000000-0000-0000-0000-000000000000"; - const serviceEndpoint = "https://sts.mixedreality.azure.com"; - const keyCredential = new AzureKeyCredential(accountKey); - - it("can create", () => { - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, keyCredential); - - assert.isNotNull(client); - }); - - it("can create with AccessToken", () => { - const maxTimestampMs = 8640000000000000; - const accessToken: AccessToken = { expiresOnTimestamp: maxTimestampMs, token: `abcdefghijk` }; - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accessToken); - - assert.isNotNull(client); - }); - - it("can create with TokenCredential", () => { - const tokenCredential: TokenCredential = { getToken: (_scopes: string | string[], _options?: GetTokenOptions) => { return Promise.resolve(null); } }; - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, tokenCredential); - - assert.isNotNull(client); - }); - - it("can create with invalid arguments", () => { - assert.throws( - () => new RemoteRenderingClient(undefined!, accountId, accountDomain, keyCredential), - "Argument cannot be null or empty: 'endpoint'." - ); - - assert.throws( - () => new RemoteRenderingClient(serviceEndpoint, undefined!, accountDomain, keyCredential), - "Argument cannot be null or empty: 'accountId'." - ); - - assert.throws( - () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), - "Argument cannot be null or empty: 'accountDomain'." - ); - - assert.throws( - () => new RemoteRenderingClient(null!, accountId, accountDomain, keyCredential), - "Argument cannot be null or empty: 'endpoint'." - ); - - assert.throws( - () => new RemoteRenderingClient(serviceEndpoint, null!, accountDomain, keyCredential), - "Argument cannot be null or empty: 'accountId'." - ); - - assert.throws( - () => new RemoteRenderingClient(serviceEndpoint, accountId, null!, keyCredential), - "Argument cannot be null or empty: 'accountDomain'." - ); - }); + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion, + KnownAssetConversionStatus +} from "../../src"; +import { AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; +import { AccessToken } from "@azure/core-http"; +import { createClient, createRecorder, getEnv } from "../utils/recordedClient"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +describe("RemoteRenderingClient construction", () => { + const accountDomain = "mixedreality.azure.com"; + const accountId = "00000000-0000-0000-0000-000000000000"; + const accountKey = "00000000-0000-0000-0000-000000000000"; + const serviceEndpoint = "https://sts.mixedreality.azure.com"; + const keyCredential = new AzureKeyCredential(accountKey); + + it("can create", () => { + const client = new RemoteRenderingClient( + serviceEndpoint, + accountId, + accountDomain, + keyCredential + ); + + assert.isNotNull(client); + }); + + it("can create with AccessToken", () => { + const maxTimestampMs = 8640000000000000; + const accessToken: AccessToken = { expiresOnTimestamp: maxTimestampMs, token: `abcdefghijk` }; + const client = new RemoteRenderingClient( + serviceEndpoint, + accountId, + accountDomain, + accessToken + ); + + assert.isNotNull(client); + }); + + it("can create with TokenCredential", () => { + const tokenCredential: TokenCredential = { + getToken: (_scopes: string | string[], _options?: GetTokenOptions) => { + return Promise.resolve(null); + } + }; + const client = new RemoteRenderingClient( + serviceEndpoint, + accountId, + accountDomain, + tokenCredential + ); + + assert.isNotNull(client); + }); + + it("can create with invalid arguments", () => { + assert.throws( + () => new RemoteRenderingClient(undefined!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, undefined!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), + "Argument cannot be null or empty: 'accountDomain'." + ); + + assert.throws( + () => new RemoteRenderingClient(null!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, null!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, null!, keyCredential), + "Argument cannot be null or empty: 'accountDomain'." + ); + }); }); +describe("RemoteRendering functional tests", () => { + let client: RemoteRenderingClient; + let recorder: Recorder; + + beforeEach(function(this: Context) { + recorder = createRecorder(this); + client = createClient(); + }); + + afterEach(async function() { + // Stop the recording. + await recorder.stop(); + }); + + it("simple conversion", async () => { + let storageContainerUrl: string = + "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + let inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + relativeInputAssetPath: "testBox.fbx", + blobPrefix: "Input" + }; + let outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + blobPrefix: "Output" + }; + let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + let conversionId: string = recorder.getUniqueName("conversionId"); + + let conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + assert.equal(conversionPoller.getOperationState().latestResponse.conversionId, conversionId); + assert.equal(conversionPoller.getOperationState().latestResponse.settings.inputSettings.relativeInputAssetPath, inputSettings.relativeInputAssetPath); + assert.notEqual(conversionPoller.getOperationState().latestResponse.status, KnownAssetConversionStatus.Failed); + + let conversion: AssetConversion = await client.getConversion(conversionId); + assert.equal(conversion.conversionId, conversionId); + assert.notEqual(conversion.status, KnownAssetConversionStatus.Failed); + + let conversion2: AssetConversion = await conversionPoller.pollUntilDone(); + assert.equal(conversion2.conversionId, conversionId); + assert.equal(conversion2.status, KnownAssetConversionStatus.Succeeded); + assert.isDefined(conversion2.output); + assert.isDefined(conversion2.output?.outputAssetUrl); + assert.isTrue(conversion2.output?.outputAssetUrl?.endsWith("Output/testBox.arrAsset")); + + let foundConversion: boolean = false; + for await (const c of client.listConversions()) + { + if (c.conversionId == conversionId) + { + foundConversion = true; + } + } + assert.isTrue(foundConversion); + }); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts new file mode 100644 index 000000000000..58ac6284cfaa --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Context } from "mocha"; + +import { AzureKeyCredential } from "@azure/core-auth"; +import { env, record, Recorder, RecorderEnvironmentSetup } from "@azure/test-utils-recorder"; + +import { RemoteRenderingClient } from "../../src"; +//import "./env"; + +// When the recorder observes the values of these environment variables +// in any recorded HTTP request or response, it will replace them with +// the values they are mapped to below, which are not real account details. +const replaceableVariables: Record = { + REMOTERENDERING_ARR_ACCOUNT_DOMAIN: "eastus2.mixedreality.azure.com", + REMOTERENDERING_ARR_ACCOUNT_ID: "arr_account_id", + REMOTERENDERING_ARR_ACCOUNT_KEY: "arr_account_key", + REMOTERENDERING_ARR_BLOB_CONTAINER_NAME: "test", + REMOTERENDERING_ARR_SAS_TOKEN: "arr_sas_token", + REMOTERENDERING_ARR_SERVICE_ENDPOINT: "https://remoterendering.eastus2.mixedreality.azure.com", + REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY: "arr_storage_account_key", + REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME: "sdktest" +}; + +export const environmentSetup: RecorderEnvironmentSetup = { + replaceableVariables, + queryParametersToSkip: [], + customizationsOnRecordings: [ + // Replace the recorded AccessToken value with a fake one. + (recording: string): string => + recording.replace( + /"AccessToken":"[^"]*"/g, + `"AccessToken":""` + ) + ] +}; + +export function getEnv(name: string): string { + // If a value exists on the real environment, use it, + // otherwise, try to use the default values from + // replaceableVariables + return env[name] ?? replaceableVariables[name]; +} + +export function createClient(): RemoteRenderingClient { + const serviceEndpoint = getEnv("REMOTERENDERING_ARR_SERVICE_ENDPOINT") + const accountDomain = getEnv("REMOTERENDERING_ARR_ACCOUNT_DOMAIN"); + const accountId = getEnv("REMOTERENDERING_ARR_ACCOUNT_ID"); + const accountKey = getEnv("REMOTERENDERING_ARR_ACCOUNT_KEY"); + + const keyCredential = new AzureKeyCredential(accountKey); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, keyCredential); +} + +/** + * Creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export function createRecorder(context: Context): Recorder { + return record(context, environmentSetup); +} From 10cb13d70a3cdbf10782e6c1be3117133f606b7e Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 14 Apr 2021 17:05:47 +0100 Subject: [PATCH 058/166] Formatting --- .../samples-dev/listConversions.ts | 2 +- .../test/public/remoteRenderingClient.spec.ts | 26 ++++++++++++------- .../test/utils/recordedClient.ts | 7 ++--- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index c2ea1875282c..0881cd5ea950 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -45,7 +45,7 @@ export async function main() { ); } } - + console.log("== All conversions listed =="); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index e5282f919294..b951bafc846d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -118,7 +118,10 @@ describe("RemoteRendering functional tests", () => { it("simple conversion", async () => { let storageContainerUrl: string = - "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); let inputSettings: AssetConversionInputSettings = { storageContainerUrl, @@ -140,8 +143,15 @@ describe("RemoteRendering functional tests", () => { conversionSettings ); assert.equal(conversionPoller.getOperationState().latestResponse.conversionId, conversionId); - assert.equal(conversionPoller.getOperationState().latestResponse.settings.inputSettings.relativeInputAssetPath, inputSettings.relativeInputAssetPath); - assert.notEqual(conversionPoller.getOperationState().latestResponse.status, KnownAssetConversionStatus.Failed); + assert.equal( + conversionPoller.getOperationState().latestResponse.settings.inputSettings + .relativeInputAssetPath, + inputSettings.relativeInputAssetPath + ); + assert.notEqual( + conversionPoller.getOperationState().latestResponse.status, + KnownAssetConversionStatus.Failed + ); let conversion: AssetConversion = await client.getConversion(conversionId); assert.equal(conversion.conversionId, conversionId); @@ -155,12 +165,10 @@ describe("RemoteRendering functional tests", () => { assert.isTrue(conversion2.output?.outputAssetUrl?.endsWith("Output/testBox.arrAsset")); let foundConversion: boolean = false; - for await (const c of client.listConversions()) - { - if (c.conversionId == conversionId) - { - foundConversion = true; - } + for await (const c of client.listConversions()) { + if (c.conversionId == conversionId) { + foundConversion = true; + } } assert.isTrue(foundConversion); }); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index 58ac6284cfaa..7f64ebd9d85b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -29,10 +29,7 @@ export const environmentSetup: RecorderEnvironmentSetup = { customizationsOnRecordings: [ // Replace the recorded AccessToken value with a fake one. (recording: string): string => - recording.replace( - /"AccessToken":"[^"]*"/g, - `"AccessToken":""` - ) + recording.replace(/"AccessToken":"[^"]*"/g, `"AccessToken":""`) ] }; @@ -44,7 +41,7 @@ export function getEnv(name: string): string { } export function createClient(): RemoteRenderingClient { - const serviceEndpoint = getEnv("REMOTERENDERING_ARR_SERVICE_ENDPOINT") + const serviceEndpoint = getEnv("REMOTERENDERING_ARR_SERVICE_ENDPOINT"); const accountDomain = getEnv("REMOTERENDERING_ARR_ACCOUNT_DOMAIN"); const accountId = getEnv("REMOTERENDERING_ARR_ACCOUNT_ID"); const accountKey = getEnv("REMOTERENDERING_ARR_ACCOUNT_KEY"); From 8b666102901551a27b6792e8530d47baf0cae078 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 16 Apr 2021 11:45:48 +0100 Subject: [PATCH 059/166] Tidy samples --- .../samples-dev/conversion.ts | 20 +++++++++---------- .../samples-dev/listConversions.ts | 5 ++--- .../samples-dev/listSessions.ts | 8 +++----- .../samples-dev/session.ts | 16 +++++++-------- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index 2be6cb8a5c6a..90169cb5a828 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -16,7 +16,6 @@ import { AssetConversionSettings, AssetConversionPollerLike, AssetConversion, - KnownAssetConversionStatus } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -44,41 +43,42 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - let storageContainerUrl: string = + let storageContainerUrl = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; - let inputSettings: AssetConversionInputSettings = { + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: sasToken, relativeInputAssetPath: "testBox.fbx", blobPrefix: "Input" }; - let outputSettings: AssetConversionOutputSettings = { + const outputSettings: AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas: sasToken, blobPrefix: "Output" }; - let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; // A randomly generated GUID is a good choice for a conversionId. - let conversionId: string = uuid(); + const conversionId = uuid(); console.log("== Starting the conversion =="); - let conversionPoller: AssetConversionPollerLike = await client.beginConversion( + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, conversionSettings ); console.log("== Polling =="); - let conversion: AssetConversion = await conversionPoller.pollUntilDone(); + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); console.log("== Check results =="); - if (conversion.status == KnownAssetConversionStatus.Succeeded) { + // Use a string for the enum. + if (conversion.status === "Succeeded") { console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); - } else if (conversion.status == KnownAssetConversionStatus.Failed) { + } else if (conversion.status === "Failed") { console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index 0881cd5ea950..b4b5ef312df6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -9,7 +9,6 @@ import { RemoteRenderingClient, - KnownAssetConversionStatus } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -35,11 +34,11 @@ export async function main() { console.log("== Starting listing conversions =="); for await (const conversion of client.listConversions()) { - if (conversion.status == KnownAssetConversionStatus.Succeeded) { + if (conversion.status === "Succeeded") { console.log( `Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}` ); - } else if (conversion.status == KnownAssetConversionStatus.Failed) { + } else if (conversion.status === "Failed") { console.log( `Conversion ${conversion.conversionId} failed: ${conversion.error?.code} ${conversion.error?.message}` ); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index 67ab1147ee53..c132270762df 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -9,8 +9,6 @@ import { RemoteRenderingClient, - KnownRenderingSessionStatus, - KnownRenderingServerSize } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -41,16 +39,16 @@ export async function main() { const sessionId: string = uuid(); await client.beginSession(sessionId, { maxLeaseTimeInMinutes: 5, - size: KnownRenderingServerSize.Standard + size: "Standard" }); await delay(10000); console.log("== Starting listing sessions =="); for await (const session of client.listSessions()) { - if (session.status == KnownRenderingSessionStatus.Starting) { + if (session.status === "Starting") { console.log(`Session ${session.sessionId} is starting`); - } else if (session.status == KnownRenderingSessionStatus.Ready) { + } else if (session.status === "Ready") { console.log(`Session ${session.sessionId} is ready`); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index d09447c76ae2..dee0350df309 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -10,12 +10,10 @@ import { v4 as uuid } from "uuid"; import { - KnownRenderingServerSize, RemoteRenderingClient, RenderingSessionSettings, RenderingSessionPollerLike, RenderingSession, - KnownRenderingSessionStatus } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -38,30 +36,30 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); - let sessionSettings: RenderingSessionSettings = { + const sessionSettings: RenderingSessionSettings = { maxLeaseTimeInMinutes: 4, - size: KnownRenderingServerSize.Standard + size: "Standard" }; // A randomly generated GUID is a good choice for a conversionId. - let sessionId: string = uuid(); + const sessionId = uuid(); console.log("== Starting the session =="); - let sessionPoller: RenderingSessionPollerLike = await client.beginSession( + const sessionPoller: RenderingSessionPollerLike = await client.beginSession( sessionId, sessionSettings ); console.log("== Polling =="); - let session: RenderingSession = await sessionPoller.pollUntilDone(); + const session: RenderingSession = await sessionPoller.pollUntilDone(); console.log("== Check results =="); - if (session.status == KnownRenderingSessionStatus.Ready) { + if (session.status == "Ready") { console.log("The rendering session is ready"); - } else if (session.status == KnownRenderingSessionStatus.Error) { + } else if (session.status == "Error") { console.log("The rendering session encountered an error: " + session.error?.message); } From 42bcba17ca74089e85157dee11874c9f896640a6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 16 Apr 2021 11:47:52 +0100 Subject: [PATCH 060/166] Formatting --- .../mixedreality-remoterendering/samples-dev/conversion.ts | 2 +- .../samples-dev/listConversions.ts | 4 +--- .../mixedreality-remoterendering/samples-dev/listSessions.ts | 4 +--- .../mixedreality-remoterendering/samples-dev/session.ts | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts index 90169cb5a828..def0a1b43b5b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts @@ -15,7 +15,7 @@ import { AssetConversionOutputSettings, AssetConversionSettings, AssetConversionPollerLike, - AssetConversion, + AssetConversion } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index b4b5ef312df6..f04353eb3782 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -7,9 +7,7 @@ /// -import { - RemoteRenderingClient, -} from "@azure/mixedreality-remoterendering"; +import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index c132270762df..0598c452e885 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -7,9 +7,7 @@ /// -import { - RemoteRenderingClient, -} from "@azure/mixedreality-remoterendering"; +import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; import { v4 as uuid } from "uuid"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index dee0350df309..bdf430c3dfc9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -13,7 +13,7 @@ import { RemoteRenderingClient, RenderingSessionSettings, RenderingSessionPollerLike, - RenderingSession, + RenderingSession } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; From 8d54390265645c50cd9bd2c6559331b341f589d3 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 16 Apr 2021 14:33:57 +0100 Subject: [PATCH 061/166] Remove WithResponse --- .../src/internal/commonQueries.ts | 9 +++---- .../src/lro/assetConversionPoller.ts | 15 +++++------ .../src/lro/renderingSessionPoller.ts | 15 +++++------ .../src/remoteRenderingClient.ts | 27 ++++++------------- 4 files changed, 26 insertions(+), 40 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index dada34022b12..b540daebb2b2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -4,7 +4,6 @@ import { OperationOptions } from "@azure/core-http"; import { AssetConversion, RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; -import { WithResponse } from "../remoteRenderingClient"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -14,7 +13,7 @@ export async function getConversionInternal( conversionId: string, tracingSpanName: string, options?: OperationOptions -): Promise> { +): Promise { const { span, updatedOptions } = createSpan(tracingSpanName, { conversionId: conversionId, ...options @@ -39,7 +38,7 @@ export async function getSessionInternal( sessionId: string, tracingSpanName: string, options?: OperationOptions -): Promise> { +): Promise { const { span, updatedOptions } = createSpan(tracingSpanName, { sessionId, ...options @@ -64,14 +63,14 @@ export async function endSessionInternal( sessionId: string, tracingSpanName: string, options?: OperationOptions -): Promise> { +): Promise { const { span, updatedOptions } = createSpan(tracingSpanName, { conversionId: sessionId, ...options }); try { - return operations.stopSession(accountId, sessionId, updatedOptions); + operations.stopSession(accountId, sessionId, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index cd61c1c0d837..3ab861ff55eb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -2,24 +2,23 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { WithResponse } from "../remoteRenderingClient"; import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; export interface AssetConversionOperationState - extends PollOperationState> { + extends PollOperationState { /** * The latest response when querying the service. The conversion may or may not be completed. */ - latestResponse: WithResponse; + latestResponse: AssetConversion; } export class AssetConversionOperationStateImpl implements AssetConversionOperationState { - latestResponse: WithResponse; + latestResponse: AssetConversion; - constructor(conversionState: WithResponse) { + constructor(conversionState: AssetConversion) { this.latestResponse = conversionState; } @@ -46,7 +45,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati return undefined; } - get result(): WithResponse { + get result(): AssetConversion { return this.latestResponse; } } @@ -91,7 +90,7 @@ class AssetConversionOperation export class AssetConversionPoller extends Poller< AssetConversionOperationStateImpl, - WithResponse + AssetConversion > { /** * Defines how much time the poller is going to wait before making a new request to the service. @@ -101,7 +100,7 @@ export class AssetConversionPoller extends Poller< constructor( accountId: string, operations: RemoteRendering, - assetConversion: WithResponse + assetConversion: AssetConversion ) { super( new AssetConversionOperation( diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index de577c75219c..d14f2d754139 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -2,24 +2,23 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { WithResponse } from "../remoteRenderingClient"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; import { RemoteRendering } from "../generated/operations"; export interface RenderingSessionOperationState - extends PollOperationState> { + extends PollOperationState { /** * The latest response when querying the service. The session may or may not be ready. */ - latestResponse: WithResponse; + latestResponse: RenderingSession; } export class RenderingSessionOperationStateImpl implements RenderingSessionOperationState { - latestResponse: WithResponse; + latestResponse: RenderingSession; - constructor(conversionState: WithResponse) { + constructor(conversionState: RenderingSession) { this.latestResponse = conversionState; } @@ -43,7 +42,7 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera return undefined; } - get result(): WithResponse { + get result(): RenderingSession { return this.latestResponse; } } @@ -108,7 +107,7 @@ class RenderingSessionOperation export class RenderingSessionPoller extends Poller< RenderingSessionOperationStateImpl, - WithResponse + RenderingSession > { /** * Defines how much time the poller is going to wait before making a new request to the service. @@ -118,7 +117,7 @@ export class RenderingSessionPoller extends Poller< constructor( accountId: string, operations: RemoteRendering, - RenderingSession: WithResponse + RenderingSession: RenderingSession ) { super( new RenderingSessionOperation( diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index e609a1f47f7c..4bad07b5ff05 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -7,7 +7,6 @@ import { bearerTokenAuthenticationPolicy, createPipelineFromOptions, InternalPipelineOptions, - HttpResponse } from "@azure/core-http"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -89,23 +88,13 @@ export { export type AssetConversionPollerLike = PollerLike< AssetConversionOperationState, - WithResponse + AssetConversion >; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, - WithResponse + RenderingSession >; -/** - * Represents the returned response of the operation along with the raw response. - */ -export type WithResponse = T & { - /** - * The underlying HTTP response. - */ - _response: HttpResponse; -}; - /** * The client class used to interact with the App Configuration service. */ @@ -291,7 +280,7 @@ export class RemoteRenderingClient { public async getConversion( conversionId: string, options?: OperationOptions - ): Promise> { + ): Promise { return getConversionInternal( this.accountId, this.operations, @@ -310,7 +299,7 @@ export class RemoteRenderingClient { conversionId: string, options?: OperationOptions ): Promise { - let assetConversion: WithResponse = await getConversionInternal( + let assetConversion: AssetConversion = await getConversionInternal( this.accountId, this.operations, conversionId, @@ -431,7 +420,7 @@ export class RemoteRenderingClient { public async getSession( sessionId: string, options?: OperationOptions - ): Promise> { + ): Promise { return getSessionInternal( this.accountId, this.operations, @@ -450,7 +439,7 @@ export class RemoteRenderingClient { sessionId: string, options?: OperationOptions ): Promise { - let renderingSession: WithResponse = await getSessionInternal( + let renderingSession: RenderingSession = await getSessionInternal( this.accountId, this.operations, sessionId, @@ -472,7 +461,7 @@ export class RemoteRenderingClient { sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions - ): Promise> { + ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-UpdateSession", { conversionId: sessionId, ...options @@ -506,7 +495,7 @@ export class RemoteRenderingClient { public async endSession( sessionId: string, options?: OperationOptions - ): Promise> { + ): Promise { return endSessionInternal( this.accountId, this.operations, From 64bf3236647bc6b8c19799822163b37bba59305d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 16 Apr 2021 14:34:24 +0100 Subject: [PATCH 062/166] Formatting --- .../src/lro/assetConversionPoller.ts | 9 ++------- .../src/lro/renderingSessionPoller.ts | 9 ++------- .../src/remoteRenderingClient.ts | 12 +++--------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 3ab861ff55eb..afdba6f63ecc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -7,8 +7,7 @@ import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; -export interface AssetConversionOperationState - extends PollOperationState { +export interface AssetConversionOperationState extends PollOperationState { /** * The latest response when querying the service. The conversion may or may not be completed. */ @@ -97,11 +96,7 @@ export class AssetConversionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor( - accountId: string, - operations: RemoteRendering, - assetConversion: AssetConversion - ) { + constructor(accountId: string, operations: RemoteRendering, assetConversion: AssetConversion) { super( new AssetConversionOperation( accountId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index d14f2d754139..fad802cf2910 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -7,8 +7,7 @@ import { getSessionInternal, endSessionInternal } from "../internal/commonQuerie import { delay, AbortSignalLike } from "@azure/core-http"; import { RemoteRendering } from "../generated/operations"; -export interface RenderingSessionOperationState - extends PollOperationState { +export interface RenderingSessionOperationState extends PollOperationState { /** * The latest response when querying the service. The session may or may not be ready. */ @@ -114,11 +113,7 @@ export class RenderingSessionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor( - accountId: string, - operations: RemoteRendering, - RenderingSession: RenderingSession - ) { + constructor(accountId: string, operations: RemoteRendering, RenderingSession: RenderingSession) { super( new RenderingSessionOperation( accountId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 4bad07b5ff05..ae6505e5e33c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -6,7 +6,7 @@ import { OperationOptions, bearerTokenAuthenticationPolicy, createPipelineFromOptions, - InternalPipelineOptions, + InternalPipelineOptions } from "@azure/core-http"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -86,10 +86,7 @@ export { KnownRenderingServerSize }; -export type AssetConversionPollerLike = PollerLike< - AssetConversionOperationState, - AssetConversion ->; +export type AssetConversionPollerLike = PollerLike; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, RenderingSession @@ -492,10 +489,7 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters. */ - public async endSession( - sessionId: string, - options?: OperationOptions - ): Promise { + public async endSession(sessionId: string, options?: OperationOptions): Promise { return endSessionInternal( this.accountId, this.operations, From 4c063133ad481af6ed6680802eb17cf16f0661b1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 16 Apr 2021 14:37:59 +0100 Subject: [PATCH 063/166] Add failure test --- .../test/public/remoteRenderingClient.spec.ts | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index b951bafc846d..7ac8424f6c5a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -116,7 +116,7 @@ describe("RemoteRendering functional tests", () => { await recorder.stop(); }); - it("simple conversion", async () => { + it("successful conversion", async () => { let storageContainerUrl: string = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + @@ -172,4 +172,31 @@ describe("RemoteRendering functional tests", () => { } assert.isTrue(foundConversion); }); + + it("failed conversion no access", async () => { + let storageContainerUrl = + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + // Do not provide SAS tokens + let inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + relativeInputAssetPath: "testBox.fbx", + blobPrefix: "Input" + }; + let outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + blobPrefix: "Output" + }; + let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + let conversionId = recorder.getUniqueName("conversionId"); + + assert.throws( + () => client.beginConversion(conversionId, conversionSettings), + "" + ); + }); }); From 5dc91ca4fc6700b912dd7a47ef352b12d6ad8f93 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 20 Apr 2021 12:11:29 +0100 Subject: [PATCH 064/166] Allow options to specify poll period --- .../src/lro/assetConversionPoller.ts | 9 ++++-- .../src/lro/renderingSessionPoller.ts | 7 ++++- .../src/remoteRenderingClient.ts | 29 ++++++++++++------- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index afdba6f63ecc..fad19336f524 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -7,6 +7,10 @@ import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { delay, AbortSignalLike } from "@azure/core-http"; +export interface AssetConversionPollerOptions { + intervalInMs?: number; +} + export interface AssetConversionOperationState extends PollOperationState { /** * The latest response when querying the service. The conversion may or may not be completed. @@ -94,9 +98,9 @@ export class AssetConversionPoller extends Poller< /** * Defines how much time the poller is going to wait before making a new request to the service. */ - public intervalInMs: number = 10000; + public intervalInMs: number; - constructor(accountId: string, operations: RemoteRendering, assetConversion: AssetConversion) { + constructor(accountId: string, operations: RemoteRendering, assetConversion: AssetConversion, options: AssetConversionPollerOptions) { super( new AssetConversionOperation( accountId, @@ -104,6 +108,7 @@ export class AssetConversionPoller extends Poller< new AssetConversionOperationStateImpl(assetConversion) ) ); + this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000; } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index fad802cf2910..a42fa72de5d6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -7,6 +7,10 @@ import { getSessionInternal, endSessionInternal } from "../internal/commonQuerie import { delay, AbortSignalLike } from "@azure/core-http"; import { RemoteRendering } from "../generated/operations"; +export interface RenderingSessionPollerOptions { + intervalInMs?: number; +} + export interface RenderingSessionOperationState extends PollOperationState { /** * The latest response when querying the service. The session may or may not be ready. @@ -113,7 +117,7 @@ export class RenderingSessionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(accountId: string, operations: RemoteRendering, RenderingSession: RenderingSession) { + constructor(accountId: string, operations: RemoteRendering, RenderingSession: RenderingSession, options: RenderingSessionPollerOptions) { super( new RenderingSessionOperation( accountId, @@ -121,6 +125,7 @@ export class RenderingSessionPoller extends Poller< new RenderingSessionOperationStateImpl(RenderingSession) ) ); + this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000; } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index ae6505e5e33c..141578e646c5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -39,10 +39,11 @@ import { PollerLike } from "@azure/core-lro"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RemoteRendering } from "./generated/operations"; -import { AssetConversionPoller, AssetConversionOperationState } from "./lro/assetConversionPoller"; +import { AssetConversionPoller, AssetConversionOperationState, AssetConversionPollerOptions } from "./lro/assetConversionPoller"; import { RenderingSessionPoller, - RenderingSessionOperationState + RenderingSessionOperationState, + RenderingSessionPollerOptions } from "./lro/renderingSessionPoller"; import { @@ -59,7 +60,9 @@ export { RenderingSessionSettings, RenderingSessionOperationState, UpdateSessionSettings, - RemoteRenderingClientOptions + RemoteRenderingClientOptions, + AssetConversionPollerOptions, + RenderingSessionPollerOptions }; import { @@ -87,6 +90,10 @@ export { }; export type AssetConversionPollerLike = PollerLike; + +export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions; +export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; + export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, RenderingSession @@ -234,7 +241,7 @@ export class RemoteRenderingClient { public async beginConversion( conversionId: string, assetConversionSettings: AssetConversionSettings, - options?: OperationOptions + options: AssetConversionOptions = {} ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { conversionId: conversionId, @@ -249,7 +256,7 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new AssetConversionPoller(this.accountId, this.operations, assetConversion); + let poller = new AssetConversionPoller(this.accountId, this.operations, assetConversion, options); // TODO Do I want this? await poller.poll(); @@ -294,7 +301,7 @@ export class RemoteRenderingClient { */ public async getConversionPoller( conversionId: string, - options?: OperationOptions + options: AssetConversionOptions = {} ): Promise { let assetConversion: AssetConversion = await getConversionInternal( this.accountId, @@ -304,7 +311,7 @@ export class RemoteRenderingClient { options ); - return new AssetConversionPoller(this.accountId, this.operations, assetConversion); + return new AssetConversionPoller(this.accountId, this.operations, assetConversion, options); } private async *getAllConversionsPagingPage( @@ -375,7 +382,7 @@ export class RemoteRenderingClient { public async beginSession( sessionId: string, renderingSessionSettings: RenderingSessionSettings, - options?: OperationOptions + options: RenderingSessionOptions = {} ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { conversionId: sessionId, @@ -390,7 +397,7 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new RenderingSessionPoller(this.accountId, this.operations, renderingSession); + let poller = new RenderingSessionPoller(this.accountId, this.operations, renderingSession, options); // Do I want this? await poller.poll(); @@ -434,7 +441,7 @@ export class RemoteRenderingClient { */ public async getSessionPoller( sessionId: string, - options?: OperationOptions + options: RenderingSessionOptions = {} ): Promise { let renderingSession: RenderingSession = await getSessionInternal( this.accountId, @@ -443,7 +450,7 @@ export class RemoteRenderingClient { "RemoteRenderingClient-GetSessionPoller", options ); - return new RenderingSessionPoller(this.accountId, this.operations, renderingSession); + return new RenderingSessionPoller(this.accountId, this.operations, renderingSession, options); } /** From cd1c17b7f15aea23d0369e373187125d59c523d3 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 20 Apr 2021 12:12:22 +0100 Subject: [PATCH 065/166] Formatting --- .../src/lro/assetConversionPoller.ts | 7 +++++- .../src/lro/renderingSessionPoller.ts | 7 +++++- .../src/remoteRenderingClient.ts | 22 +++++++++++++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index fad19336f524..7734ccb2e514 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -100,7 +100,12 @@ export class AssetConversionPoller extends Poller< */ public intervalInMs: number; - constructor(accountId: string, operations: RemoteRendering, assetConversion: AssetConversion, options: AssetConversionPollerOptions) { + constructor( + accountId: string, + operations: RemoteRendering, + assetConversion: AssetConversion, + options: AssetConversionPollerOptions + ) { super( new AssetConversionOperation( accountId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index a42fa72de5d6..a250cfb15f2a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -117,7 +117,12 @@ export class RenderingSessionPoller extends Poller< */ public intervalInMs: number = 10000; - constructor(accountId: string, operations: RemoteRendering, RenderingSession: RenderingSession, options: RenderingSessionPollerOptions) { + constructor( + accountId: string, + operations: RemoteRendering, + RenderingSession: RenderingSession, + options: RenderingSessionPollerOptions + ) { super( new RenderingSessionOperation( accountId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 141578e646c5..fcb0d923987f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -39,7 +39,11 @@ import { PollerLike } from "@azure/core-lro"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RemoteRendering } from "./generated/operations"; -import { AssetConversionPoller, AssetConversionOperationState, AssetConversionPollerOptions } from "./lro/assetConversionPoller"; +import { + AssetConversionPoller, + AssetConversionOperationState, + AssetConversionPollerOptions +} from "./lro/assetConversionPoller"; import { RenderingSessionPoller, RenderingSessionOperationState, @@ -92,7 +96,7 @@ export { export type AssetConversionPollerLike = PollerLike; export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions; -export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; +export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, @@ -256,7 +260,12 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new AssetConversionPoller(this.accountId, this.operations, assetConversion, options); + let poller = new AssetConversionPoller( + this.accountId, + this.operations, + assetConversion, + options + ); // TODO Do I want this? await poller.poll(); @@ -397,7 +406,12 @@ export class RemoteRenderingClient { updatedOptions ); - let poller = new RenderingSessionPoller(this.accountId, this.operations, renderingSession, options); + let poller = new RenderingSessionPoller( + this.accountId, + this.operations, + renderingSession, + options + ); // Do I want this? await poller.poll(); From a9e536ffcf188d5773d408cda57a37f3b6f73d78 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Mon, 19 Apr 2021 18:06:54 +0000 Subject: [PATCH 066/166] initial migration to corev2 --- common/config/rush/pnpm-lock.yaml | 2 + .../mixedRealityAccountKeyCredential.ts | 8 +- .../mixedRealityTokenCredential.ts | 2 +- .../staticAccessTokenCredential.ts | 2 +- .../mixedreality-remoterendering/package.json | 3 +- .../mixedreality-remoterendering.api.md | 70 ++++----- .../samples-dev/listSessions.ts | 4 +- .../src/generated/models/index.ts | 119 ++------------- .../src/generated/models/mappers.ts | 60 ++++---- .../src/generated/models/parameters.ts | 2 +- .../generated/operations/remoteRendering.ts | 141 ++++++------------ .../remoteRenderingRestClientContext.ts | 25 ++-- .../src/internal/commonQueries.ts | 2 +- .../src/lro/assetConversionPoller.ts | 4 +- .../src/lro/renderingSessionPoller.ts | 5 +- .../src/options.ts | 2 +- .../src/remoteRenderingClient.ts | 22 +-- .../swagger/README.md | 3 +- .../test/public/remoteRenderingClient.spec.ts | 3 +- 19 files changed, 171 insertions(+), 308 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 68a8d64ec858..41ccf3c14ac6 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -51,6 +51,7 @@ dependencies: '@rush-temp/keyvault-secrets': file:projects/keyvault-secrets.tgz '@rush-temp/logger': file:projects/logger.tgz '@rush-temp/mixedreality-authentication': file:projects/mixedreality-authentication.tgz + '@rush-temp/mixedreality-remoterendering': file:projects/mixedreality-remoterendering.tgz '@rush-temp/mock-hub': file:projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:projects/monitor-query.tgz @@ -11957,6 +11958,7 @@ specifiers: '@rush-temp/keyvault-secrets': file:./projects/keyvault-secrets.tgz '@rush-temp/logger': file:./projects/logger.tgz '@rush-temp/mixedreality-authentication': file:./projects/mixedreality-authentication.tgz + '@rush-temp/mixedreality-remoterendering': file:./projects/mixedreality-remoterendering.tgz '@rush-temp/mock-hub': file:./projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:./projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:./projects/monitor-query.tgz diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts index 72e33b464aab..1d52f19df5f9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts @@ -1,8 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { AzureKeyCredential } from "@azure/core-auth"; -import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-http"; +import { + AzureKeyCredential, + AccessToken, + GetTokenOptions, + TokenCredential +} from "@azure/core-auth"; const maxTimestampMs = 8640000000000000; diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts index c1165bff9914..c562c89c8364 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth"; import { MixedRealityStsClient, diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts index aec4e7ba5328..0701740a3299 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-http"; +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth"; export class StaticAccessTokenCredential implements TokenCredential { private token: AccessToken; diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 4794bba62327..aa6d11db4037 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -73,7 +73,8 @@ "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { "@azure/core-auth": "^1.3.0", - "@azure/core-http": "^1.2.0", + "@azure/core-rest-pipeline": "^1.0.0", + "@azure/core-client": "^1.0.0", "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", "tslib": "^2.0.0", diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 372382c51f3a..d170e79f7936 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -6,13 +6,12 @@ import { AccessToken } from '@azure/core-auth'; import { AzureKeyCredential } from '@azure/core-auth'; -import { HttpResponse } from '@azure/core-http'; -import { OperationOptions } from '@azure/core-http'; +import { OperationOptions } from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PipelineOptions } from '@azure/core-http'; +import { PipelineOptions } from '@azure/core-rest-pipeline'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; -import { TokenCredential } from '@azure/core-http'; +import { TokenCredential } from '@azure/core-auth'; // @public export interface AssetConversion { @@ -33,10 +32,13 @@ export interface AssetConversionInputSettings { } // @public (undocumented) -export interface AssetConversionOperationState extends PollOperationState> { - latestResponse: WithResponse; +export interface AssetConversionOperationState extends PollOperationState { + latestResponse: AssetConversion; } +// @public (undocumented) +export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions; + // @public export interface AssetConversionOutput { readonly outputAssetUrl?: string; @@ -51,7 +53,13 @@ export interface AssetConversionOutputSettings { } // @public (undocumented) -export type AssetConversionPollerLike = PollerLike>; +export type AssetConversionPollerLike = PollerLike; + +// @public (undocumented) +export interface AssetConversionPollerOptions { + // (undocumented) + intervalInMs?: number; +} // @public export interface AssetConversionSettings { @@ -91,16 +99,16 @@ export class RemoteRenderingClient { constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); constructor(endpoint: string, accountId: string, accountDomain: string, credential: AccessToken, options?: RemoteRenderingClientOptions); - beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: OperationOptions): Promise; - beginSession(sessionId: string, renderingSessionSettings: RenderingSessionSettings, options?: OperationOptions): Promise; - endSession(sessionId: string, options?: OperationOptions): Promise>; - getConversion(conversionId: string, options?: OperationOptions): Promise>; - getConversionPoller(conversionId: string, options?: OperationOptions): Promise; - getSession(sessionId: string, options?: OperationOptions): Promise>; - getSessionPoller(sessionId: string, options?: OperationOptions): Promise; + beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: AssetConversionOptions): Promise; + beginSession(sessionId: string, renderingSessionSettings: RenderingSessionSettings, options?: RenderingSessionOptions): Promise; + endSession(sessionId: string, options?: OperationOptions): Promise; + getConversion(conversionId: string, options?: OperationOptions): Promise; + getConversionPoller(conversionId: string, options?: AssetConversionOptions): Promise; + getSession(sessionId: string, options?: OperationOptions): Promise; + getSessionPoller(sessionId: string, options?: RenderingSessionOptions): Promise; listConversions(options?: OperationOptions): PagedAsyncIterableIterator; listSessions(options?: OperationOptions): PagedAsyncIterableIterator; - updateSession(sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions): Promise>; + updateSession(sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions): Promise; } // @public @@ -137,24 +145,21 @@ export interface RenderingSession { } // @public (undocumented) -export class RenderingSessionOperationState implements PollOperationState> { - constructor(client: RemoteRenderingClient, conversionState: WithResponse); - // (undocumented) - get error(): Error | undefined; - // (undocumented) - get isCancelled(): boolean; - // (undocumented) - get isCompleted(): boolean; - // (undocumented) - get isStarted(): boolean; - // (undocumented) - latestResponse: WithResponse; - // (undocumented) - get result(): WithResponse; +export interface RenderingSessionOperationState extends PollOperationState { + latestResponse: RenderingSession; } // @public (undocumented) -export type RenderingSessionPollerLike = PollerLike>; +export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; + +// @public (undocumented) +export type RenderingSessionPollerLike = PollerLike; + +// @public (undocumented) +export interface RenderingSessionPollerOptions { + // (undocumented) + intervalInMs?: number; +} // @public export interface RenderingSessionSettings { @@ -167,11 +172,6 @@ export interface UpdateSessionSettings { maxLeaseTimeInMinutes: number; } -// @public -export type WithResponse = T & { - _response: HttpResponse; -}; - // (No @packageDocumentation comment for this package) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index 0598c452e885..442d68272683 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -14,7 +14,7 @@ import { v4 as uuid } from "uuid"; // Load the .env file if it exists import * as dotenv from "dotenv"; -import { delay } from "@azure/core-http"; +// import { delay } from "@azure/core-http"; dotenv.config(); // You will need to set this environment variables or edit the following values @@ -39,7 +39,7 @@ export async function main() { maxLeaseTimeInMinutes: 5, size: "Standard" }); - await delay(10000); + // await delay(10000); console.log("== Starting listing sessions =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index f79cfcce9674..9edff69c690d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; /** Request to start a conversion */ export interface CreateConversionSettings { @@ -377,136 +377,41 @@ export type RenderingSessionStatus = string; /** Contains response data for the createConversion operation. */ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & - AssetConversion & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: AssetConversion; - /** The parsed HTTP response headers. */ - parsedHeaders: RemoteRenderingCreateConversionHeaders; - }; - }; + AssetConversion; /** Contains response data for the getConversion operation. */ export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & - AssetConversion & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: AssetConversion; - /** The parsed HTTP response headers. */ - parsedHeaders: RemoteRenderingGetConversionHeaders; - }; - }; + AssetConversion; /** Contains response data for the listConversions operation. */ export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversionsHeaders & - ConversionList & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: ConversionList; - /** The parsed HTTP response headers. */ - parsedHeaders: RemoteRenderingListConversionsHeaders; - }; - }; + ConversionList; /** Contains response data for the createSession operation. */ -export type RemoteRenderingCreateSessionResponse = RenderingSession & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: RenderingSession; - }; -}; +export type RemoteRenderingCreateSessionResponse = RenderingSession; /** Contains response data for the getSession operation. */ -export type RemoteRenderingGetSessionResponse = RenderingSession & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: RenderingSession; - }; -}; +export type RemoteRenderingGetSessionResponse = RenderingSession; /** Contains response data for the updateSession operation. */ -export type RemoteRenderingUpdateSessionResponse = RenderingSession & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: RenderingSession; - }; -}; +export type RemoteRenderingUpdateSessionResponse = RenderingSession; /** Contains response data for the stopSession operation. */ -export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The parsed HTTP response headers. */ - parsedHeaders: RemoteRenderingStopSessionHeaders; - }; -}; +export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders; /** Contains response data for the listSessions operation. */ -export type RemoteRenderingListSessionsResponse = SessionsList & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: SessionsList; - }; -}; +export type RemoteRenderingListSessionsResponse = SessionsList; /** Contains response data for the listConversionsNext operation. */ export type RemoteRenderingListConversionsNextResponse = RemoteRenderingListConversionsNextHeaders & - ConversionList & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: ConversionList; - /** The parsed HTTP response headers. */ - parsedHeaders: RemoteRenderingListConversionsNextHeaders; - }; - }; + ConversionList; /** Contains response data for the listSessionsNext operation. */ -export type RemoteRenderingListSessionsNextResponse = SessionsList & { - /** The underlying HTTP response. */ - _response: coreHttp.HttpResponse & { - /** The response body as text (string format) */ - bodyAsText: string; - - /** The response body as parsed JSON or XML */ - parsedBody: SessionsList; - }; -}; +export type RemoteRenderingListSessionsNextResponse = SessionsList; /** Optional parameters. */ export interface RemoteRenderingRestClientOptionalParams - extends coreHttp.ServiceClientOptions { + extends coreClient.ServiceClientOptions { /** Api Version */ apiVersion?: string; /** Overrides client endpoint. */ diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 9f4b5639deaa..1d8715421421 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -6,9 +6,9 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; -export const CreateConversionSettings: coreHttp.CompositeMapper = { +export const CreateConversionSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "CreateConversionSettings", @@ -24,7 +24,7 @@ export const CreateConversionSettings: coreHttp.CompositeMapper = { } }; -export const AssetConversionSettings: coreHttp.CompositeMapper = { +export const AssetConversionSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "AssetConversionSettings", @@ -47,7 +47,7 @@ export const AssetConversionSettings: coreHttp.CompositeMapper = { } }; -export const AssetConversionInputSettings: coreHttp.CompositeMapper = { +export const AssetConversionInputSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "AssetConversionInputSettings", @@ -82,7 +82,7 @@ export const AssetConversionInputSettings: coreHttp.CompositeMapper = { } }; -export const AssetConversionOutputSettings: coreHttp.CompositeMapper = { +export const AssetConversionOutputSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "AssetConversionOutputSettings", @@ -116,7 +116,7 @@ export const AssetConversionOutputSettings: coreHttp.CompositeMapper = { } }; -export const AssetConversion: coreHttp.CompositeMapper = { +export const AssetConversion: coreClient.CompositeMapper = { type: { name: "Composite", className: "AssetConversion", @@ -167,7 +167,7 @@ export const AssetConversion: coreHttp.CompositeMapper = { } }; -export const AssetConversionOutput: coreHttp.CompositeMapper = { +export const AssetConversionOutput: coreClient.CompositeMapper = { type: { name: "Composite", className: "AssetConversionOutput", @@ -183,7 +183,7 @@ export const AssetConversionOutput: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingServiceError: coreHttp.CompositeMapper = { +export const RemoteRenderingServiceError: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingServiceError", @@ -233,7 +233,7 @@ export const RemoteRenderingServiceError: coreHttp.CompositeMapper = { } }; -export const ErrorResponse: coreHttp.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorResponse", @@ -249,7 +249,7 @@ export const ErrorResponse: coreHttp.CompositeMapper = { } }; -export const ConversionList: coreHttp.CompositeMapper = { +export const ConversionList: coreClient.CompositeMapper = { type: { name: "Composite", className: "ConversionList", @@ -278,7 +278,7 @@ export const ConversionList: coreHttp.CompositeMapper = { } }; -export const RenderingSessionSettings: coreHttp.CompositeMapper = { +export const RenderingSessionSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "RenderingSessionSettings", @@ -301,7 +301,7 @@ export const RenderingSessionSettings: coreHttp.CompositeMapper = { } }; -export const RenderingSession: coreHttp.CompositeMapper = { +export const RenderingSession: coreClient.CompositeMapper = { type: { name: "Composite", className: "RenderingSession", @@ -395,7 +395,7 @@ export const RenderingSession: coreHttp.CompositeMapper = { } }; -export const UpdateSessionSettings: coreHttp.CompositeMapper = { +export const UpdateSessionSettings: coreClient.CompositeMapper = { type: { name: "Composite", className: "UpdateSessionSettings", @@ -411,7 +411,7 @@ export const UpdateSessionSettings: coreHttp.CompositeMapper = { } }; -export const SessionsList: coreHttp.CompositeMapper = { +export const SessionsList: coreClient.CompositeMapper = { type: { name: "Composite", className: "SessionsList", @@ -440,7 +440,7 @@ export const SessionsList: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingCreateConversionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingCreateConversionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingCreateConversionHeaders", @@ -455,7 +455,7 @@ export const RemoteRenderingCreateConversionHeaders: coreHttp.CompositeMapper = } }; -export const RemoteRenderingCreateConversionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingCreateConversionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingCreateConversionExceptionHeaders", @@ -470,7 +470,7 @@ export const RemoteRenderingCreateConversionExceptionHeaders: coreHttp.Composite } }; -export const RemoteRenderingGetConversionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingGetConversionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingGetConversionHeaders", @@ -491,7 +491,7 @@ export const RemoteRenderingGetConversionHeaders: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingGetConversionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingGetConversionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingGetConversionExceptionHeaders", @@ -512,7 +512,7 @@ export const RemoteRenderingGetConversionExceptionHeaders: coreHttp.CompositeMap } }; -export const RemoteRenderingListConversionsHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListConversionsHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListConversionsHeaders", @@ -527,7 +527,7 @@ export const RemoteRenderingListConversionsHeaders: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingListConversionsExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListConversionsExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListConversionsExceptionHeaders", @@ -548,7 +548,7 @@ export const RemoteRenderingListConversionsExceptionHeaders: coreHttp.CompositeM } }; -export const RemoteRenderingCreateSessionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingCreateSessionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingCreateSessionHeaders", @@ -563,7 +563,7 @@ export const RemoteRenderingCreateSessionHeaders: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingCreateSessionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingCreateSessionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingCreateSessionExceptionHeaders", @@ -578,7 +578,7 @@ export const RemoteRenderingCreateSessionExceptionHeaders: coreHttp.CompositeMap } }; -export const RemoteRenderingGetSessionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingGetSessionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingGetSessionExceptionHeaders", @@ -599,7 +599,7 @@ export const RemoteRenderingGetSessionExceptionHeaders: coreHttp.CompositeMapper } }; -export const RemoteRenderingUpdateSessionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingUpdateSessionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingUpdateSessionExceptionHeaders", @@ -620,7 +620,7 @@ export const RemoteRenderingUpdateSessionExceptionHeaders: coreHttp.CompositeMap } }; -export const RemoteRenderingStopSessionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingStopSessionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingStopSessionHeaders", @@ -635,7 +635,7 @@ export const RemoteRenderingStopSessionHeaders: coreHttp.CompositeMapper = { } }; -export const RemoteRenderingStopSessionExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingStopSessionExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingStopSessionExceptionHeaders", @@ -656,7 +656,7 @@ export const RemoteRenderingStopSessionExceptionHeaders: coreHttp.CompositeMappe } }; -export const RemoteRenderingListSessionsExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListSessionsExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListSessionsExceptionHeaders", @@ -677,7 +677,7 @@ export const RemoteRenderingListSessionsExceptionHeaders: coreHttp.CompositeMapp } }; -export const RemoteRenderingListConversionsNextHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListConversionsNextHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListConversionsNextHeaders", @@ -692,7 +692,7 @@ export const RemoteRenderingListConversionsNextHeaders: coreHttp.CompositeMapper } }; -export const RemoteRenderingListConversionsNextExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListConversionsNextExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListConversionsNextExceptionHeaders", @@ -713,7 +713,7 @@ export const RemoteRenderingListConversionsNextExceptionHeaders: coreHttp.Compos } }; -export const RemoteRenderingListSessionsNextExceptionHeaders: coreHttp.CompositeMapper = { +export const RemoteRenderingListSessionsNextExceptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RemoteRenderingListSessionsNextExceptionHeaders", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts index 57a61f6aa134..f40b95277662 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts @@ -10,7 +10,7 @@ import { OperationParameter, OperationURLParameter, OperationQueryParameter -} from "@azure/core-http"; +} from "@azure/core-client"; import { CreateConversionSettings as CreateConversionSettingsMapper, RenderingSessionSettings as RenderingSessionSettingsMapper, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index b526046b03e7..ba6d39203bce 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -6,10 +6,10 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RemoteRenderingRestClient } from "../remoteRenderingRestClient"; +import { RemoteRenderingRestClientContext } from "../remoteRenderingRestClientContext"; import { CreateConversionSettings, RemoteRenderingCreateConversionResponse, @@ -28,13 +28,13 @@ import { /** Class representing a RemoteRendering. */ export class RemoteRendering { - private readonly client: RemoteRenderingRestClient; + private readonly client: RemoteRenderingRestClientContext; /** * Initialize a new instance of the class RemoteRendering class. * @param client Reference to the service client */ - constructor(client: RemoteRenderingRestClient) { + constructor(client: RemoteRenderingRestClientContext) { this.client = client; } @@ -51,18 +51,12 @@ export class RemoteRendering { accountId: string, conversionId: string, body: CreateConversionSettings, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - conversionId, - body, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, conversionId, body, options }, createConversionOperationSpec - ) as Promise; + ); } /** @@ -76,17 +70,12 @@ export class RemoteRendering { getConversion( accountId: string, conversionId: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - conversionId, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, conversionId, options }, getConversionOperationSpec - ) as Promise; + ); } /** @@ -96,16 +85,12 @@ export class RemoteRendering { */ listConversions( accountId: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, options }, listConversionsOperationSpec - ) as Promise; + ); } /** @@ -121,18 +106,12 @@ export class RemoteRendering { accountId: string, sessionId: string, body: RenderingSessionSettings, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - sessionId, - body, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, sessionId, body, options }, createSessionOperationSpec - ) as Promise; + ); } /** @@ -146,17 +125,12 @@ export class RemoteRendering { getSession( accountId: string, sessionId: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - sessionId, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, sessionId, options }, getSessionOperationSpec - ) as Promise; + ); } /** @@ -172,18 +146,12 @@ export class RemoteRendering { accountId: string, sessionId: string, body: UpdateSessionSettings, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - sessionId, - body, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, sessionId, body, options }, updateSessionOperationSpec - ) as Promise; + ); } /** @@ -197,17 +165,12 @@ export class RemoteRendering { stopSession( accountId: string, sessionId: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - sessionId, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, sessionId, options }, stopSessionOperationSpec - ) as Promise; + ); } /** @@ -217,16 +180,12 @@ export class RemoteRendering { */ listSessions( accountId: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, options }, listSessionsOperationSpec - ) as Promise; + ); } /** @@ -238,17 +197,12 @@ export class RemoteRendering { listConversionsNext( accountId: string, nextLink: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - nextLink, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, nextLink, options }, listConversionsNextOperationSpec - ) as Promise; + ); } /** @@ -260,23 +214,18 @@ export class RemoteRendering { listSessionsNext( accountId: string, nextLink: string, - options?: coreHttp.OperationOptions + options?: coreClient.OperationOptions ): Promise { - const operationArguments: coreHttp.OperationArguments = { - accountId, - nextLink, - options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) - }; return this.client.sendOperationRequest( - operationArguments, + { accountId, nextLink, options }, listSessionsNextOperationSpec - ) as Promise; + ); } } // Operation Specifications -const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createConversionOperationSpec: coreHttp.OperationSpec = { +const createConversionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/conversions/{conversion_id}", httpMethod: "PUT", responses: { @@ -326,7 +275,7 @@ const createConversionOperationSpec: coreHttp.OperationSpec = { mediaType: "json", serializer }; -const getConversionOperationSpec: coreHttp.OperationSpec = { +const getConversionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/conversions/{conversion_id}", httpMethod: "GET", responses: { @@ -365,7 +314,7 @@ const getConversionOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const listConversionsOperationSpec: coreHttp.OperationSpec = { +const listConversionsOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/conversions", httpMethod: "GET", responses: { @@ -396,7 +345,7 @@ const listConversionsOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const createSessionOperationSpec: coreHttp.OperationSpec = { +const createSessionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/sessions/{session_id}", httpMethod: "PUT", responses: { @@ -445,7 +394,7 @@ const createSessionOperationSpec: coreHttp.OperationSpec = { mediaType: "json", serializer }; -const getSessionOperationSpec: coreHttp.OperationSpec = { +const getSessionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/sessions/{session_id}", httpMethod: "GET", responses: { @@ -483,7 +432,7 @@ const getSessionOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const updateSessionOperationSpec: coreHttp.OperationSpec = { +const updateSessionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/sessions/{session_id}", httpMethod: "PATCH", responses: { @@ -528,7 +477,7 @@ const updateSessionOperationSpec: coreHttp.OperationSpec = { mediaType: "json", serializer }; -const stopSessionOperationSpec: coreHttp.OperationSpec = { +const stopSessionOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/sessions/{session_id}/:stop", httpMethod: "POST", responses: { @@ -566,7 +515,7 @@ const stopSessionOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const listSessionsOperationSpec: coreHttp.OperationSpec = { +const listSessionsOperationSpec: coreClient.OperationSpec = { path: "/accounts/{account_id}/sessions", httpMethod: "GET", responses: { @@ -596,7 +545,7 @@ const listSessionsOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const listConversionsNextOperationSpec: coreHttp.OperationSpec = { +const listConversionsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { @@ -631,7 +580,7 @@ const listConversionsNextOperationSpec: coreHttp.OperationSpec = { headerParameters: [Parameters.accept], serializer }; -const listSessionsNextOperationSpec: coreHttp.OperationSpec = { +const listSessionsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts index 0f1dc1e3ae43..73089e5f6356 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts @@ -6,14 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import * as coreClient from "@azure/core-client"; import { RemoteRenderingRestClientOptionalParams } from "./models"; -const packageName = "@azure/mixedreality-remoterendering"; -const packageVersion = "1.0.0-beta.1"; - /** @hidden */ -export class RemoteRenderingRestClientContext extends coreHttp.ServiceClient { +export class RemoteRenderingRestClientContext extends coreClient.ServiceClient { endpoint: string; apiVersion: string; @@ -36,17 +33,17 @@ export class RemoteRenderingRestClientContext extends coreHttp.ServiceClient { options = {}; } - if (!options.userAgent) { - const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(undefined, options); - - this.requestContentType = "application/json; charset=utf-8"; + const defaults: RemoteRenderingRestClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; - this.baseUri = options.endpoint || "{endpoint}"; + const optionsWithDefaults = { + ...defaults, + ...options, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); // Parameter assignments this.endpoint = endpoint; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index b540daebb2b2..72403515c805 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { OperationOptions } from "@azure/core-http"; +import { OperationOptions } from "@azure/core-client"; import { AssetConversion, RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { createSpan } from "../tracing"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 7734ccb2e514..b67d33625d1d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -5,7 +5,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; -import { delay, AbortSignalLike } from "@azure/core-http"; +import { AbortSignalLike } from "@azure/abort-controller"; export interface AssetConversionPollerOptions { intervalInMs?: number; @@ -120,7 +120,7 @@ export class AssetConversionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - return delay(this.intervalInMs); + // return delay(this.intervalInMs); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index a250cfb15f2a..e9abf6313aac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -4,7 +4,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; -import { delay, AbortSignalLike } from "@azure/core-http"; +import { AbortSignalLike } from "@azure/abort-controller"; import { RemoteRendering } from "../generated/operations"; export interface RenderingSessionPollerOptions { @@ -137,7 +137,8 @@ export class RenderingSessionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - return delay(this.intervalInMs); + // TODO + // return delay(this.intervalInMs); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts index 58458c5ffd2f..84e30b6f9736 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PipelineOptions } from "@azure/core-http"; +import { PipelineOptions } from "@azure/core-rest-pipeline"; /** * Options to create the MixedRealityStsClient. diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index fcb0d923987f..071f9ed24f5a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -2,15 +2,14 @@ // Licensed under the MIT license. import { - TokenCredential, - OperationOptions, - bearerTokenAuthenticationPolicy, createPipelineFromOptions, - InternalPipelineOptions -} from "@azure/core-http"; + InternalPipelineOptions, + bearerTokenAuthenticationPolicy +} from "@azure/core-rest-pipeline"; +import { OperationOptions } from "@azure/core-client"; import { SpanStatusCode } from "@azure/core-tracing"; -import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; +import { AccessToken, AzureKeyCredential, TokenCredential } from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; import { @@ -198,7 +197,7 @@ export class RemoteRenderingClient { logger: logger.info, // This array contains header names we want to log that are not already // included as safe. Unknown/unsafe headers are logged as "". - allowedHeaderNames: ["X-MRC-CV", "MS-CV"] + additionalAllowedHeaderNames: ["X-MRC-CV", "MS-CV"] } } }; @@ -221,8 +220,13 @@ export class RemoteRenderingClient { { customEndpointUrl: authenticationEndpoint } ); - const authPolicy = bearerTokenAuthenticationPolicy(mrTokenCredential, `${endpoint}/.default`); - const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); + const authPolicy = bearerTokenAuthenticationPolicy({ + credential: mrTokenCredential, + scopes: `${endpoint}/.default` + }); + + const pipeline = createPipelineFromOptions(internalPipelineOptions); + pipeline.addPolicy(authPolicy); const clientOptions: RemoteRenderingRestClientOptionalParams = { ...internalPipelineOptions, diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 81ffaf3481e1..84b01b0206de 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -18,8 +18,9 @@ add-credentials: false package-version: 1.0.0-beta.1 disable-async-iterators: true hide-clients: true +use-core-v2: true use-extension: - "@autorest/typescript": "6.0.0-dev.20210121.2" + "@autorest/typescript": "https://aka.ms/autorest/typescript/corev2" ``` ```yaml diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 7ac8424f6c5a..5da1b8f3d6c0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -14,8 +14,7 @@ import { AssetConversion, KnownAssetConversionStatus } from "../../src"; -import { AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; -import { AccessToken } from "@azure/core-http"; +import { AccessToken, AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; import { createClient, createRecorder, getEnv } from "../utils/recordedClient"; // Load the .env file if it exists From 22701c2303b039864e4f41ff98bfdc6a53246aa0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 21 Apr 2021 12:14:56 +0100 Subject: [PATCH 067/166] Fix usage of new core pipeline --- .../mixedreality-remoterendering/package.json | 3 ++- .../samples-dev/listSessions.ts | 4 ++-- .../src/lro/assetConversionPoller.ts | 3 ++- .../src/lro/renderingSessionPoller.ts | 4 ++-- .../src/remoteRenderingClient.ts | 19 ++++--------------- 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index aa6d11db4037..dd7fa6614cb5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -81,7 +81,8 @@ "@azure/mixedreality-authentication": "1.0.0-beta.1", "@azure/core-lro": "^1.0.2", "@azure/abort-controller": "^1.0.0", - "@azure/core-paging": "^1.1.1" + "@azure/core-paging": "^1.1.1", + "@azure/core-util": "1.0.0-beta.1" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index 442d68272683..42c6194980e6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -9,12 +9,12 @@ import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; import { AzureKeyCredential } from "@azure/core-auth"; +import { delay } from "@azure/core-util"; import { v4 as uuid } from "uuid"; // Load the .env file if it exists import * as dotenv from "dotenv"; -// import { delay } from "@azure/core-http"; dotenv.config(); // You will need to set this environment variables or edit the following values @@ -39,7 +39,7 @@ export async function main() { maxLeaseTimeInMinutes: 5, size: "Standard" }); - // await delay(10000); + await delay(10000); console.log("== Starting listing sessions =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index b67d33625d1d..a26c4b86afdc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -6,6 +6,7 @@ import { AssetConversion, KnownAssetConversionStatus } from "../generated/models import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; +import { delay } from "@azure/core-util"; export interface AssetConversionPollerOptions { intervalInMs?: number; @@ -120,7 +121,7 @@ export class AssetConversionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - // return delay(this.intervalInMs); + return delay(this.intervalInMs); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index e9abf6313aac..bbe83151c8e5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -6,6 +6,7 @@ import { RenderingSession, KnownRenderingSessionStatus } from "../generated/mode import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; import { RemoteRendering } from "../generated/operations"; +import { delay } from "@azure/core-util"; export interface RenderingSessionPollerOptions { intervalInMs?: number; @@ -137,8 +138,7 @@ export class RenderingSessionPoller extends Poller< * The method used by the poller to wait before attempting to update its operation. */ async delay(): Promise { - // TODO - // return delay(this.intervalInMs); + return delay(this.intervalInMs); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 071f9ed24f5a..2a3e4af8d3dc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - createPipelineFromOptions, - InternalPipelineOptions, - bearerTokenAuthenticationPolicy -} from "@azure/core-rest-pipeline"; +import { InternalPipelineOptions } from "@azure/core-rest-pipeline"; import { OperationOptions } from "@azure/core-client"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -220,18 +216,11 @@ export class RemoteRenderingClient { { customEndpointUrl: authenticationEndpoint } ); - const authPolicy = bearerTokenAuthenticationPolicy({ - credential: mrTokenCredential, - scopes: `${endpoint}/.default` - }); - - const pipeline = createPipelineFromOptions(internalPipelineOptions); - pipeline.addPolicy(authPolicy); - const clientOptions: RemoteRenderingRestClientOptionalParams = { ...internalPipelineOptions, - ...pipeline, - endpoint: endpoint + endpoint: endpoint, + credential: mrTokenCredential, + credentialScopes: `${endpoint}/.default` }; this.client = new RemoteRenderingRestClient(endpoint, clientOptions); From 4c7a0ecc2e015d44d6f3db05d75bfc29188c9e6c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 21 Apr 2021 16:32:03 +0100 Subject: [PATCH 068/166] Make AssetConversion interface more natural --- .../src/generated/models/index.ts | 8 ++--- .../src/generated/models/mappers.ts | 6 ++-- .../generated/operations/remoteRendering.ts | 6 ++-- .../generated/remoteRenderingRestClient.ts | 2 +- .../remoteRenderingRestClientContext.ts | 2 +- .../src/internal/assetConversion.ts | 36 +++++++++++++++++++ .../src/internal/commonQueries.ts | 6 ++-- .../src/lro/assetConversionPoller.ts | 3 +- .../src/remoteRenderingClient.ts | 15 ++++---- .../swagger/README.md | 8 ----- 10 files changed, 63 insertions(+), 29 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 9edff69c690d..ab0f9f14117b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -47,7 +47,7 @@ export interface AssetConversionOutputSettings { } /** The properties of the conversion. */ -export interface AssetConversion { +export interface Conversion { /** The ID of the conversion supplied when the conversion was created. */ conversionId: string; /** Conversion settings describe the origin of input files and destination of output files. */ @@ -106,7 +106,7 @@ export interface ErrorResponse { /** List of conversions. */ export interface ConversionList { /** The list of conversions. */ - conversions: AssetConversion[]; + conversions: Conversion[]; /** * If more conversions are available this field will contain a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -377,11 +377,11 @@ export type RenderingSessionStatus = string; /** Contains response data for the createConversion operation. */ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & - AssetConversion; + Conversion; /** Contains response data for the getConversion operation. */ export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & - AssetConversion; + Conversion; /** Contains response data for the listConversions operation. */ export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversionsHeaders & diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 1d8715421421..337e2be3f332 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -116,10 +116,10 @@ export const AssetConversionOutputSettings: coreClient.CompositeMapper = { } }; -export const AssetConversion: coreClient.CompositeMapper = { +export const Conversion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AssetConversion", + className: "Conversion", modelProperties: { conversionId: { serializedName: "id", @@ -262,7 +262,7 @@ export const ConversionList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "AssetConversion" + className: "Conversion" } } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index ba6d39203bce..0de129c89c09 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -230,11 +230,11 @@ const createConversionOperationSpec: coreClient.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.AssetConversion, + bodyMapper: Mappers.Conversion, headersMapper: Mappers.RemoteRenderingCreateConversionHeaders }, 201: { - bodyMapper: Mappers.AssetConversion, + bodyMapper: Mappers.Conversion, headersMapper: Mappers.RemoteRenderingCreateConversionHeaders }, 400: { @@ -280,7 +280,7 @@ const getConversionOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AssetConversion, + bodyMapper: Mappers.Conversion, headersMapper: Mappers.RemoteRenderingGetConversionHeaders }, 401: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts index 346c22086b7d..10c05ca7afb6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts @@ -10,7 +10,7 @@ import { RemoteRendering } from "./operations"; import { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; import { RemoteRenderingRestClientOptionalParams } from "./models"; -/** @hidden */ +/** @internal */ export class RemoteRenderingRestClient extends RemoteRenderingRestClientContext { /** * Initializes a new instance of the RemoteRenderingRestClient class. diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts index 73089e5f6356..7cbd1edd2d61 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts @@ -9,7 +9,7 @@ import * as coreClient from "@azure/core-client"; import { RemoteRenderingRestClientOptionalParams } from "./models"; -/** @hidden */ +/** @internal */ export class RemoteRenderingRestClientContext extends coreClient.ServiceClient { endpoint: string; apiVersion: string; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts new file mode 100644 index 000000000000..d063b8adff1f --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + Conversion, + AssetConversionSettings, + AssetConversionOutput, + RemoteRenderingServiceError, + AssetConversionStatus +} from "../generated/models/index"; + +/** The properties of the conversion. */ +export interface AssetConversion { + /** The ID of the conversion supplied when the conversion was created. */ + conversionId: string; + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: AssetConversionSettings; + /** + * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly output?: AssetConversionOutput; + /** The error object containing details about the conversion failure. */ + error?: RemoteRenderingServiceError; + /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ + status: AssetConversionStatus; + /** The time when the conversion was created. Date and time in ISO 8601 format. */ + createdOn: Date; +} + +export function assetConversionFromConversion(conversion: Conversion): AssetConversion { + return { + ...conversion, + error: conversion.error ? conversion.error : undefined + }; +}; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index 72403515c805..4f3ae5d19f53 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -2,10 +2,11 @@ // Licensed under the MIT license. import { OperationOptions } from "@azure/core-client"; -import { AssetConversion, RenderingSession } from "../generated/models/index"; +import { RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; +import { AssetConversion, assetConversionFromConversion } from "./assetConversion" export async function getConversionInternal( accountId: string, @@ -20,7 +21,8 @@ export async function getConversionInternal( }); try { - return await operations.getConversion(accountId, conversionId, updatedOptions); + let conversion = await operations.getConversion(accountId, conversionId, updatedOptions); + return assetConversionFromConversion(conversion); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index a26c4b86afdc..f86d9cede9eb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -2,11 +2,12 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { AssetConversion, KnownAssetConversionStatus } from "../generated/models/index"; +import { KnownAssetConversionStatus } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; import { delay } from "@azure/core-util"; +import { AssetConversion } from "../internal/assetConversion" export interface AssetConversionPollerOptions { intervalInMs?: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2a3e4af8d3dc..58473e9f77f8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -9,7 +9,6 @@ import { AccessToken, AzureKeyCredential, TokenCredential } from "@azure/core-au import { RemoteRenderingRestClient } from "./generated"; import { - AssetConversion, AssetConversionSettings, RemoteRenderingRestClientOptionalParams, RemoteRenderingCreateConversionResponse, @@ -51,9 +50,11 @@ import { getSessionInternal } from "./internal/commonQueries"; +import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion" + export { - AssetConversionOperationState, AssetConversion, + AssetConversionOperationState, AssetConversionSettings, RenderingSession, RenderingSessionSettings, @@ -246,7 +247,7 @@ export class RemoteRenderingClient { }); try { - let assetConversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( + let conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( this.accountId, conversionId, { settings: assetConversionSettings }, @@ -256,7 +257,7 @@ export class RemoteRenderingClient { let poller = new AssetConversionPoller( this.accountId, this.operations, - assetConversion, + assetConversionFromConversion(conversion), options ); @@ -320,7 +321,8 @@ export class RemoteRenderingClient { options?: OperationOptions ): AsyncIterableIterator { let result = await this.operations.listConversions(this.accountId, options); - yield result.conversions; + let assetConversionResult = Array.from(result.conversions).map(assetConversionFromConversion); + yield assetConversionResult; let continuationToken = result.nextLink; while (continuationToken) { result = await this.operations.listConversionsNext( @@ -329,7 +331,8 @@ export class RemoteRenderingClient { options ); continuationToken = result.nextLink; - yield result.conversions; + assetConversionResult = Array.from(result.conversions).map(assetConversionFromConversion); + yield assetConversionResult; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 84b01b0206de..d193fa89e17c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -23,14 +23,6 @@ use-extension: "@autorest/typescript": "https://aka.ms/autorest/typescript/corev2" ``` -```yaml -directive: - - from: swagger-document - where: $.definitions.conversion - transform: > - $["x-ms-client-name"] = "AssetConversion"; -``` - ```yaml directive: - from: swagger-document From 8433a962d46ce168135a19dd02e0327c12c1dd0a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 21 Apr 2021 16:32:53 +0100 Subject: [PATCH 069/166] Formatting --- .../src/internal/assetConversion.ts | 2 +- .../mixedreality-remoterendering/src/internal/commonQueries.ts | 2 +- .../src/lro/assetConversionPoller.ts | 2 +- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index d063b8adff1f..1ca6f53c018c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -33,4 +33,4 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv ...conversion, error: conversion.error ? conversion.error : undefined }; -}; +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index 4f3ae5d19f53..e4c1d3531327 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -6,7 +6,7 @@ import { RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; -import { AssetConversion, assetConversionFromConversion } from "./assetConversion" +import { AssetConversion, assetConversionFromConversion } from "./assetConversion"; export async function getConversionInternal( accountId: string, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index f86d9cede9eb..9fb09c68ec3e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -7,7 +7,7 @@ import { RemoteRendering } from "../generated/operations"; import { getConversionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; import { delay } from "@azure/core-util"; -import { AssetConversion } from "../internal/assetConversion" +import { AssetConversion } from "../internal/assetConversion"; export interface AssetConversionPollerOptions { intervalInMs?: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 58473e9f77f8..f62b3f401fbd 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -50,7 +50,7 @@ import { getSessionInternal } from "./internal/commonQueries"; -import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion" +import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion"; export { AssetConversion, From 95d76a4aae6530abdd18cbc784ea351d2ae5b13f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 21 Apr 2021 16:50:17 +0100 Subject: [PATCH 070/166] Make RenderingSession more convenient --- .../src/generated/models/index.ts | 10 +-- .../src/generated/models/mappers.ts | 6 +- .../generated/operations/remoteRendering.ts | 8 +-- .../src/internal/commonQueries.ts | 5 +- .../src/internal/renderingSession.ts | 61 +++++++++++++++++++ .../src/lro/renderingSessionPoller.ts | 3 +- .../src/remoteRenderingClient.ts | 15 +++-- .../swagger/README.md | 8 --- 8 files changed, 87 insertions(+), 29 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index ab0f9f14117b..69a30b6a50df 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -123,7 +123,7 @@ export interface RenderingSessionSettings { } /** The properties of a rendering session. */ -export interface RenderingSession { +export interface SessionProperties { /** The ID of the session supplied when the session was created. */ sessionId: string; /** @@ -181,7 +181,7 @@ export interface UpdateSessionSettings { /** The result of a list sessions request. */ export interface SessionsList { /** The list of rendering sessions. Does not include sessions in 'Stopped' state. */ - sessions: RenderingSession[]; + sessions: SessionProperties[]; /** * If more rendering sessions are available this field will contain a URL where the next batch of sessions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -388,13 +388,13 @@ export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversi ConversionList; /** Contains response data for the createSession operation. */ -export type RemoteRenderingCreateSessionResponse = RenderingSession; +export type RemoteRenderingCreateSessionResponse = SessionProperties; /** Contains response data for the getSession operation. */ -export type RemoteRenderingGetSessionResponse = RenderingSession; +export type RemoteRenderingGetSessionResponse = SessionProperties; /** Contains response data for the updateSession operation. */ -export type RemoteRenderingUpdateSessionResponse = RenderingSession; +export type RemoteRenderingUpdateSessionResponse = SessionProperties; /** Contains response data for the stopSession operation. */ export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 337e2be3f332..64f1dc56328e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -301,10 +301,10 @@ export const RenderingSessionSettings: coreClient.CompositeMapper = { } }; -export const RenderingSession: coreClient.CompositeMapper = { +export const SessionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RenderingSession", + className: "SessionProperties", modelProperties: { sessionId: { serializedName: "id", @@ -424,7 +424,7 @@ export const SessionsList: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RenderingSession" + className: "SessionProperties" } } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index 0de129c89c09..e7646975d600 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -350,10 +350,10 @@ const createSessionOperationSpec: coreClient.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.RenderingSession + bodyMapper: Mappers.SessionProperties }, 201: { - bodyMapper: Mappers.RenderingSession, + bodyMapper: Mappers.SessionProperties, headersMapper: Mappers.RemoteRenderingCreateSessionHeaders }, 400: { @@ -399,7 +399,7 @@ const getSessionOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.RenderingSession + bodyMapper: Mappers.SessionProperties }, 401: { headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, @@ -437,7 +437,7 @@ const updateSessionOperationSpec: coreClient.OperationSpec = { httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.RenderingSession + bodyMapper: Mappers.SessionProperties }, 401: { headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index e4c1d3531327..1ece857b6145 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -2,11 +2,11 @@ // Licensed under the MIT license. import { OperationOptions } from "@azure/core-client"; -import { RenderingSession } from "../generated/models/index"; import { RemoteRendering } from "../generated/operations"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; import { AssetConversion, assetConversionFromConversion } from "./assetConversion"; +import { RenderingSession, renderingSessionFromSessionProperties } from "./renderingSession"; export async function getConversionInternal( accountId: string, @@ -47,7 +47,8 @@ export async function getSessionInternal( }); try { - return operations.getSession(accountId, sessionId, updatedOptions); + let sessionProperties = await operations.getSession(accountId, sessionId, updatedOptions); + return renderingSessionFromSessionProperties(sessionProperties); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts new file mode 100644 index 000000000000..d19b5d79198e --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RenderingServerSize, RenderingSessionStatus, RemoteRenderingServiceError, SessionProperties } from "../generated/index"; + +/** The properties of a rendering session. */ +export interface RenderingSession { + /** The ID of the session supplied when the session was created. */ + sessionId: string; + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elapsedTimeInMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly host?: string; + /** + * The time in minutes the session will run after reaching the 'Ready' state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maxLeaseTimeInMinutes?: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: RenderingServerSize; + /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ + status: RenderingSessionStatus; + /** + * The computational power of the rendering session GPU measured in teraflops. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly teraflops?: number; + /** + * The error object containing details about the rendering session startup failure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: RemoteRenderingServiceError; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdOn?: Date; + }; + + export function renderingSessionFromSessionProperties(session : SessionProperties) { + return { + ...session, + error: (session.error ? session.error : undefined) + }; + } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index bbe83151c8e5..78d4fef8e75c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -2,11 +2,12 @@ // Licensed under the MIT license. import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; -import { RenderingSession, KnownRenderingSessionStatus } from "../generated/models/index"; +import { KnownRenderingSessionStatus } from "../generated/models/index"; import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; import { RemoteRendering } from "../generated/operations"; import { delay } from "@azure/core-util"; +import { RenderingSession } from "../internal/renderingSession"; export interface RenderingSessionPollerOptions { intervalInMs?: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index f62b3f401fbd..73d85e8c33cb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -12,7 +12,6 @@ import { AssetConversionSettings, RemoteRenderingRestClientOptionalParams, RemoteRenderingCreateConversionResponse, - RenderingSession, RenderingSessionSettings, RemoteRenderingCreateSessionResponse, UpdateSessionSettings @@ -51,6 +50,7 @@ import { } from "./internal/commonQueries"; import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion"; +import { RenderingSession, renderingSessionFromSessionProperties } from "./internal/renderingSession"; export { AssetConversion, @@ -395,7 +395,7 @@ export class RemoteRenderingClient { }); try { - let renderingSession: RemoteRenderingCreateSessionResponse = await this.operations.createSession( + let sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( this.accountId, sessionId, renderingSessionSettings, @@ -405,7 +405,7 @@ export class RemoteRenderingClient { let poller = new RenderingSessionPoller( this.accountId, this.operations, - renderingSession, + renderingSessionFromSessionProperties(sessionProperties), options ); @@ -482,12 +482,13 @@ export class RemoteRenderingClient { }); try { - return this.operations.updateSession( + let sessionProperties = await this.operations.updateSession( this.accountId, sessionId, updateSessionSettings, updatedOptions ); + return renderingSessionFromSessionProperties(sessionProperties); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -520,12 +521,14 @@ export class RemoteRenderingClient { options?: OperationOptions ): AsyncIterableIterator { let result = await this.operations.listSessions(this.accountId, options); - yield result.sessions; + let sessions = Array.from(result.sessions).map(renderingSessionFromSessionProperties); + yield sessions; let continuationToken = result.nextLink; while (continuationToken) { result = await this.operations.listSessionsNext(this.accountId, continuationToken, options); continuationToken = result.nextLink; - yield result.sessions; + sessions = Array.from(result.sessions).map(renderingSessionFromSessionProperties); + yield sessions; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index d193fa89e17c..8748d88b6a8c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -128,14 +128,6 @@ directive: $["x-ms-client-name"] = "RemoteRenderingServiceError"; ``` -```yaml -directive: - - from: swagger-document - where: $.definitions.session_properties - transform: > - $["x-ms-client-name"] = "RenderingSession"; -``` - ```yaml directive: - from: swagger-document From 98e1a4f98c9aef2b69d716d6641af7007d666e87 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 21 Apr 2021 16:57:53 +0100 Subject: [PATCH 071/166] Formatting --- .../src/internal/renderingSession.ts | 113 +++++++++--------- .../src/remoteRenderingClient.ts | 5 +- 2 files changed, 63 insertions(+), 55 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index d19b5d79198e..b8ded0318c65 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -1,61 +1,66 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { RenderingServerSize, RenderingSessionStatus, RemoteRenderingServiceError, SessionProperties } from "../generated/index"; +import { + RenderingServerSize, + RenderingSessionStatus, + RemoteRenderingServiceError, + SessionProperties +} from "../generated/index"; /** The properties of a rendering session. */ export interface RenderingSession { - /** The ID of the session supplied when the session was created. */ - sessionId: string; - /** - * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly arrInspectorPort?: number; - /** - * The TCP port used for the handshake when establishing a connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly handshakePort?: number; - /** - * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly elapsedTimeInMinutes?: number; - /** - * The hostname under which the rendering session is reachable. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly host?: string; - /** - * The time in minutes the session will run after reaching the 'Ready' state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maxLeaseTimeInMinutes?: number; - /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ - size: RenderingServerSize; - /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ - status: RenderingSessionStatus; - /** - * The computational power of the rendering session GPU measured in teraflops. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly teraflops?: number; - /** - * The error object containing details about the rendering session startup failure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: RemoteRenderingServiceError; - /** - * The time when the rendering session was created. Date and time in ISO 8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly createdOn?: Date; - }; + /** The ID of the session supplied when the session was created. */ + sessionId: string; + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elapsedTimeInMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly host?: string; + /** + * The time in minutes the session will run after reaching the 'Ready' state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maxLeaseTimeInMinutes?: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: RenderingServerSize; + /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ + status: RenderingSessionStatus; + /** + * The computational power of the rendering session GPU measured in teraflops. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly teraflops?: number; + /** + * The error object containing details about the rendering session startup failure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: RemoteRenderingServiceError; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdOn?: Date; +} - export function renderingSessionFromSessionProperties(session : SessionProperties) { - return { - ...session, - error: (session.error ? session.error : undefined) - }; - } +export function renderingSessionFromSessionProperties(session: SessionProperties) { + return { + ...session, + error: session.error ? session.error : undefined + }; +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 73d85e8c33cb..47e8437eda92 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -50,7 +50,10 @@ import { } from "./internal/commonQueries"; import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion"; -import { RenderingSession, renderingSessionFromSessionProperties } from "./internal/renderingSession"; +import { + RenderingSession, + renderingSessionFromSessionProperties +} from "./internal/renderingSession"; export { AssetConversion, From 1f860a44e2a8471aa7670a2713159a0bb9f6c0a6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 22 Apr 2021 13:48:55 +0100 Subject: [PATCH 072/166] RenderingSession is now a tagged union --- .../samples-dev/session.ts | 2 +- .../src/internal/renderingSession.ts | 184 +++++++++++++----- .../src/lro/renderingSessionPoller.ts | 4 +- .../src/remoteRenderingClient.ts | 16 ++ 4 files changed, 157 insertions(+), 49 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index bdf430c3dfc9..5f07ac4187a8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -60,7 +60,7 @@ export async function main() { if (session.status == "Ready") { console.log("The rendering session is ready"); } else if (session.status == "Error") { - console.log("The rendering session encountered an error: " + session.error?.message); + console.log("The rendering session encountered an error: " + session.error.message); } client.endSession(sessionId); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index b8ded0318c65..cfb29d976552 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -3,64 +3,156 @@ import { RenderingServerSize, - RenderingSessionStatus, RemoteRenderingServiceError, - SessionProperties + SessionProperties, + KnownRenderingSessionStatus } from "../generated/index"; -/** The properties of a rendering session. */ -export interface RenderingSession { +/** Properties available for a rendering session in any state */ +export interface RenderingSessionBase { /** The ID of the session supplied when the session was created. */ sessionId: string; - /** - * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly arrInspectorPort?: number; - /** - * The TCP port used for the handshake when establishing a connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly handshakePort?: number; - /** - * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly elapsedTimeInMinutes?: number; - /** - * The hostname under which the rendering session is reachable. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly host?: string; - /** - * The time in minutes the session will run after reaching the 'Ready' state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maxLeaseTimeInMinutes?: number; /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ size: RenderingServerSize; - /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ - status: RenderingSessionStatus; + /** The time in minutes the session will run after reaching the 'Ready' state. */ + maxLeaseTimeInMinutes: number; +}; + +/** The properties of a complete rendering session */ +export interface RenderingSessionProperties { /** - * The computational power of the rendering session GPU measured in teraflops. - * NOTE: This property will not be serialized. It can only be populated by the server. + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. */ - readonly teraflops?: number; + readonly arrInspectorPort: number; + /** + * The TCP port used for the handshake when establishing a connection. + */ + readonly handshakePort: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + */ + readonly elapsedTimeInMinutes: number; + /** + * The hostname under which the rendering session is reachable. + */ + readonly host: string; + /** + * The computational power of the rendering session GPU measured in teraflops. + */ + readonly teraflops: number; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + */ + readonly createdOn: Date; +}; + +/** The properties of a rendering session that may not be complete */ +export type PartialRenderingSessionProperties = { [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P] }; + +/** The rendering session is ready for incoming connections. */ +export interface ReadyRenderingSession extends RenderingSessionBase { + /** The rendering session is ready for incoming connections. */ + status: "Ready"; + properties: RenderingSessionProperties +} + +/** The rendering session has encountered an error, and is unusable. */ +export interface ErrorRenderingSession extends RenderingSessionBase { + /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ + status: "Error"; /** * The error object containing details about the rendering session startup failure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly error?: RemoteRenderingServiceError; - /** - * The time when the rendering session was created. Date and time in ISO 8601 format. - * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly createdOn?: Date; + readonly error: RemoteRenderingServiceError; + partialProperties: PartialRenderingSessionProperties; +} + +/** The rendering session is starting, but not accepting incoming connections yet. */ +export interface StartingRenderingSession extends RenderingSessionBase { + /** The rendering session is starting, but not accepting incoming connections yet. */ + status: "Starting"; + partialProperties: PartialRenderingSessionProperties; +} + +/** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ +export interface ExpiredRenderingSession extends RenderingSessionBase { + /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ + status: "Expired"; + properties: RenderingSessionProperties +} + +/** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ +export interface StoppedRenderingSession extends RenderingSessionBase { + /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ + status: "Stopped"; + partialProperties: PartialRenderingSessionProperties; +} + +/** Information about a rendering session. This is a tagged union with "status" as its discriminant property. */ +export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; + +function renderingSessionPropertiesFromSessionProperties(session: SessionProperties) : RenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort!, + handshakePort: session.handshakePort!, + elapsedTimeInMinutes: session.elapsedTimeInMinutes!, + host: session.host!, + teraflops: session.teraflops!, + createdOn: session.createdOn! + }; +} + +function partialRenderingSessionPropertiesFromSessionProperties(session: SessionProperties) : PartialRenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort, + handshakePort: session.handshakePort, + elapsedTimeInMinutes: session.elapsedTimeInMinutes, + host: session.host, + teraflops: session.teraflops, + createdOn: session.createdOn + }; } -export function renderingSessionFromSessionProperties(session: SessionProperties) { - return { - ...session, - error: session.error ? session.error : undefined - }; +export function renderingSessionFromSessionProperties(session: SessionProperties) : RenderingSession { + let baseProperties: RenderingSessionBase = { + sessionId: session.sessionId, + size: session.size, + maxLeaseTimeInMinutes: session.maxLeaseTimeInMinutes! + }; + switch (session.status) + { + case KnownRenderingSessionStatus.Ready: + return { + status: "Ready", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Starting: + return { + status: "Starting", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Error: + return { + status: "Error", + ...baseProperties, + error: session.error!, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Expired: + return { + status: "Expired", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Stopped: + return { + status: "Stopped", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + default: + throw new Error("Unrecognized RenderingSessionStatus returned by the service"); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 78d4fef8e75c..81f5edbbe08f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -40,8 +40,8 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera } get error(): Error | undefined { - if (this.latestResponse.error != null) { - //TODO Add details. + if (this.latestResponse.status === "Error") { + //TODO Add details? return new Error(this.latestResponse.error.message); } return undefined; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 47e8437eda92..ece75eb8490e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -52,6 +52,14 @@ import { import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion"; import { RenderingSession, + RenderingSessionBase, + RenderingSessionProperties, + PartialRenderingSessionProperties, + ReadyRenderingSession, + ErrorRenderingSession, + StartingRenderingSession, + ExpiredRenderingSession, + StoppedRenderingSession, renderingSessionFromSessionProperties } from "./internal/renderingSession"; @@ -62,6 +70,14 @@ export { RenderingSession, RenderingSessionSettings, RenderingSessionOperationState, + RenderingSessionBase, + RenderingSessionProperties, + PartialRenderingSessionProperties, + ReadyRenderingSession, + ErrorRenderingSession, + StartingRenderingSession, + ExpiredRenderingSession, + StoppedRenderingSession, UpdateSessionSettings, RemoteRenderingClientOptions, AssetConversionPollerOptions, From 55ca90787550f46425136a10562fb336fb8c76a9 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 22 Apr 2021 15:30:29 +0100 Subject: [PATCH 073/166] Use a tagged union for AssetConversion too. --- .../mixedreality-remoterendering.api.md | 102 +++++++-- .../src/internal/assetConversion.ts | 92 ++++++-- .../src/internal/renderingSession.ts | 196 ++++++++++-------- .../src/lro/assetConversionPoller.ts | 2 +- .../src/remoteRenderingClient.ts | 25 ++- .../test/public/remoteRenderingClient.spec.ts | 10 +- 6 files changed, 297 insertions(+), 130 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index d170e79f7936..e01186180a80 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -13,14 +13,14 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; import { TokenCredential } from '@azure/core-auth'; +// @public (undocumented) +export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; + // @public -export interface AssetConversion { +export interface AssetConversionBase { conversionId: string; createdOn: Date; - error: RemoteRenderingServiceError | null; - readonly output?: AssetConversionOutput; settings: AssetConversionSettings; - status: AssetConversionStatus; } // @public @@ -70,6 +70,32 @@ export interface AssetConversionSettings { // @public export type AssetConversionStatus = string; +// @public +export interface CancelledAssetConversion extends AssetConversionBase { + status: "Cancelled"; +} + +// @public +export interface ErrorRenderingSession extends RenderingSessionBase { + readonly error: RemoteRenderingServiceError; + // (undocumented) + partialProperties: PartialRenderingSessionProperties; + status: "Error"; +} + +// @public +export interface ExpiredRenderingSession extends RenderingSessionBase { + // (undocumented) + properties: RenderingSessionProperties; + status: "Expired"; +} + +// @public +export interface FailedAssetConversion extends AssetConversionBase { + error: RemoteRenderingServiceError; + status: "Failed"; +} + // @public export const enum KnownAssetConversionStatus { Cancelled = "Cancelled", @@ -94,6 +120,23 @@ export const enum KnownRenderingSessionStatus { Stopped = "Stopped" } +// @public +export interface NonStartedAssetConversion extends AssetConversionBase { + status: "NotStarted"; +} + +// @public +export type PartialRenderingSessionProperties = { + [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P]; +}; + +// @public +export interface ReadyRenderingSession extends RenderingSessionBase { + // (undocumented) + properties: RenderingSessionProperties; + status: "Ready"; +} + // @public export class RemoteRenderingClient { constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); @@ -129,19 +172,13 @@ export interface RemoteRenderingServiceError { export type RenderingServerSize = string; // @public -export interface RenderingSession { - readonly arrInspectorPort?: number; - readonly createdOn?: Date; - readonly elapsedTimeInMinutes?: number; - readonly error?: RemoteRenderingServiceError | null; - readonly handshakePort?: number; - readonly host?: string; - readonly maxLeaseTimeInMinutes?: number; +export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; + +// @public +export interface RenderingSessionBase { + maxLeaseTimeInMinutes: number; sessionId: string; size: RenderingServerSize; - // Warning: (ae-forgotten-export) The symbol "RenderingSessionStatus" needs to be exported by the entry point index.d.ts - status: RenderingSessionStatus; - readonly teraflops?: number; } // @public (undocumented) @@ -161,12 +198,47 @@ export interface RenderingSessionPollerOptions { intervalInMs?: number; } +// @public +export interface RenderingSessionProperties { + readonly arrInspectorPort: number; + readonly createdOn: Date; + readonly elapsedTimeInMinutes: number; + readonly handshakePort: number; + readonly host: string; + readonly teraflops: number; +} + // @public export interface RenderingSessionSettings { maxLeaseTimeInMinutes: number; size: RenderingServerSize; } +// @public +export interface RunningAssetConversion extends AssetConversionBase { + status: "Running"; +} + +// @public +export interface StartingRenderingSession extends RenderingSessionBase { + // (undocumented) + partialProperties: PartialRenderingSessionProperties; + status: "Starting"; +} + +// @public +export interface StoppedRenderingSession extends RenderingSessionBase { + // (undocumented) + partialProperties: PartialRenderingSessionProperties; + status: "Stopped"; +} + +// @public +export interface SucceededAssetConversion extends AssetConversionBase { + readonly output: AssetConversionOutput; + status: "Succeeded"; +} + // @public export interface UpdateSessionSettings { maxLeaseTimeInMinutes: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 1ca6f53c018c..14d0c502ccf1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -6,31 +6,93 @@ import { AssetConversionSettings, AssetConversionOutput, RemoteRenderingServiceError, - AssetConversionStatus + KnownAssetConversionStatus } from "../generated/models/index"; -/** The properties of the conversion. */ -export interface AssetConversion { +/** Properties available for an AssetConversion in any state. */ +export interface AssetConversionBase { /** The ID of the conversion supplied when the conversion was created. */ conversionId: string; /** Conversion settings describe the origin of input files and destination of output files. */ settings: AssetConversionSettings; + /** The time when the conversion was created. Date and time in ISO 8601 format. */ + createdOn: Date; +}; + +/** The conversion was created but hasn't started. */ +export interface NonStartedAssetConversion extends AssetConversionBase { + /** The conversion was created but hasn't started. */ + status: "NotStarted"; +}; + +/** The conversion is running. */ +export interface RunningAssetConversion extends AssetConversionBase { + /** The conversion is running. */ + status: "Running"; +}; + +/** The conversion has succeeded. */ +export interface SucceededAssetConversion extends AssetConversionBase { + /** The conversion has succeeded. This is a terminal state. */ + status: "Succeeded"; /** - * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. - * NOTE: This property will not be serialized. It can only be populated by the server. + * Information about the output of a successful conversion. */ - readonly output?: AssetConversionOutput; + readonly output: AssetConversionOutput; +}; + +/** The conversion has failed. Check the 'error' field for more details. */ +export interface FailedAssetConversion extends AssetConversionBase { + /** The conversion has failed. Check the 'error' field for more details. This is a terminal state. */ + status: "Failed"; /** The error object containing details about the conversion failure. */ - error?: RemoteRenderingServiceError; - /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ - status: AssetConversionStatus; - /** The time when the conversion was created. Date and time in ISO 8601 format. */ - createdOn: Date; -} + error: RemoteRenderingServiceError; +}; + +/** The conversion was cancelled. */ +export interface CancelledAssetConversion extends AssetConversionBase { + /** The conversion was cancelled. This is a terminal state. */ + status: "Cancelled"; +}; + +export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; export function assetConversionFromConversion(conversion: Conversion): AssetConversion { - return { - ...conversion, - error: conversion.error ? conversion.error : undefined + let baseProperties: AssetConversionBase = { + conversionId: conversion.conversionId, + settings: conversion.settings, + createdOn: conversion.createdOn }; + switch (conversion.status) + { + case KnownAssetConversionStatus.NotStarted: + return { + status: "NotStarted", + ...baseProperties + }; + case KnownAssetConversionStatus.Running: + return { + status: "Running", + ...baseProperties + }; + case KnownAssetConversionStatus.Succeeded: + return { + status: "Succeeded", + ...baseProperties, + output: conversion.output! + }; + case KnownAssetConversionStatus.Cancelled: + return { + status: "Cancelled", + ...baseProperties + }; + case KnownAssetConversionStatus.Failed: + return { + status: "Failed", + ...baseProperties, + error: conversion.error! + }; + default: + throw new Error("Unrecognized AssetConversionStatus returned by the service"); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index cfb29d976552..7db39cf0f892 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -16,44 +16,46 @@ export interface RenderingSessionBase { size: RenderingServerSize; /** The time in minutes the session will run after reaching the 'Ready' state. */ maxLeaseTimeInMinutes: number; -}; +} /** The properties of a complete rendering session */ export interface RenderingSessionProperties { /** * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. */ - readonly arrInspectorPort: number; - /** - * The TCP port used for the handshake when establishing a connection. - */ - readonly handshakePort: number; - /** - * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. - */ - readonly elapsedTimeInMinutes: number; - /** - * The hostname under which the rendering session is reachable. - */ - readonly host: string; - /** - * The computational power of the rendering session GPU measured in teraflops. - */ - readonly teraflops: number; - /** - * The time when the rendering session was created. Date and time in ISO 8601 format. - */ - readonly createdOn: Date; -}; + readonly arrInspectorPort: number; + /** + * The TCP port used for the handshake when establishing a connection. + */ + readonly handshakePort: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + */ + readonly elapsedTimeInMinutes: number; + /** + * The hostname under which the rendering session is reachable. + */ + readonly host: string; + /** + * The computational power of the rendering session GPU measured in teraflops. + */ + readonly teraflops: number; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + */ + readonly createdOn: Date; +} /** The properties of a rendering session that may not be complete */ -export type PartialRenderingSessionProperties = { [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P] }; +export type PartialRenderingSessionProperties = { + [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P]; +}; /** The rendering session is ready for incoming connections. */ export interface ReadyRenderingSession extends RenderingSessionBase { /** The rendering session is ready for incoming connections. */ status: "Ready"; - properties: RenderingSessionProperties + properties: RenderingSessionProperties; } /** The rendering session has encountered an error, and is unusable. */ @@ -76,83 +78,93 @@ export interface StartingRenderingSession extends RenderingSessionBase { /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ export interface ExpiredRenderingSession extends RenderingSessionBase { - /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ - status: "Expired"; - properties: RenderingSessionProperties + /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ + status: "Expired"; + properties: RenderingSessionProperties; } /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ export interface StoppedRenderingSession extends RenderingSessionBase { - /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ - status: "Stopped"; - partialProperties: PartialRenderingSessionProperties; + /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ + status: "Stopped"; + partialProperties: PartialRenderingSessionProperties; } /** Information about a rendering session. This is a tagged union with "status" as its discriminant property. */ -export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; +export type RenderingSession = + | StartingRenderingSession + | ReadyRenderingSession + | ErrorRenderingSession + | ExpiredRenderingSession + | StoppedRenderingSession; -function renderingSessionPropertiesFromSessionProperties(session: SessionProperties) : RenderingSessionProperties { - return { - arrInspectorPort: session.arrInspectorPort!, - handshakePort: session.handshakePort!, - elapsedTimeInMinutes: session.elapsedTimeInMinutes!, - host: session.host!, - teraflops: session.teraflops!, - createdOn: session.createdOn! - }; +function renderingSessionPropertiesFromSessionProperties( + session: SessionProperties +): RenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort!, + handshakePort: session.handshakePort!, + elapsedTimeInMinutes: session.elapsedTimeInMinutes!, + host: session.host!, + teraflops: session.teraflops!, + createdOn: session.createdOn! + }; } -function partialRenderingSessionPropertiesFromSessionProperties(session: SessionProperties) : PartialRenderingSessionProperties { - return { - arrInspectorPort: session.arrInspectorPort, - handshakePort: session.handshakePort, - elapsedTimeInMinutes: session.elapsedTimeInMinutes, - host: session.host, - teraflops: session.teraflops, - createdOn: session.createdOn - }; +function partialRenderingSessionPropertiesFromSessionProperties( + session: SessionProperties +): PartialRenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort, + handshakePort: session.handshakePort, + elapsedTimeInMinutes: session.elapsedTimeInMinutes, + host: session.host, + teraflops: session.teraflops, + createdOn: session.createdOn + }; } -export function renderingSessionFromSessionProperties(session: SessionProperties) : RenderingSession { - let baseProperties: RenderingSessionBase = { - sessionId: session.sessionId, - size: session.size, - maxLeaseTimeInMinutes: session.maxLeaseTimeInMinutes! - }; - switch (session.status) - { - case KnownRenderingSessionStatus.Ready: - return { - status: "Ready", - ...baseProperties, - properties: renderingSessionPropertiesFromSessionProperties(session) - }; - case KnownRenderingSessionStatus.Starting: - return { - status: "Starting", - ...baseProperties, - partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) - }; - case KnownRenderingSessionStatus.Error: - return { - status: "Error", - ...baseProperties, - error: session.error!, - partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) - }; - case KnownRenderingSessionStatus.Expired: - return { - status: "Expired", - ...baseProperties, - properties: renderingSessionPropertiesFromSessionProperties(session) - }; - case KnownRenderingSessionStatus.Stopped: - return { - status: "Stopped", - ...baseProperties, - partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) - }; - default: - throw new Error("Unrecognized RenderingSessionStatus returned by the service"); - } +export function renderingSessionFromSessionProperties( + session: SessionProperties +): RenderingSession { + let baseProperties: RenderingSessionBase = { + sessionId: session.sessionId, + size: session.size, + maxLeaseTimeInMinutes: session.maxLeaseTimeInMinutes! + }; + switch (session.status) { + case KnownRenderingSessionStatus.Ready: + return { + status: "Ready", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Starting: + return { + status: "Starting", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Error: + return { + status: "Error", + ...baseProperties, + error: session.error!, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Expired: + return { + status: "Expired", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Stopped: + return { + status: "Stopped", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + default: + throw new Error("Unrecognized RenderingSessionStatus returned by the service"); + } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 9fb09c68ec3e..c16552d570bc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -44,7 +44,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati } get error(): Error | undefined { - if (this.latestResponse.error != null) { + if (this.latestResponse.status === "Failed") { return new Error(this.latestResponse.error.message); } return undefined; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index ece75eb8490e..a8bc365899a8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -49,7 +49,16 @@ import { getSessionInternal } from "./internal/commonQueries"; -import { AssetConversion, assetConversionFromConversion } from "./internal/assetConversion"; +import { + AssetConversion, + AssetConversionBase, + NonStartedAssetConversion, + RunningAssetConversion, + SucceededAssetConversion, + FailedAssetConversion, + CancelledAssetConversion, + assetConversionFromConversion +} from "./internal/assetConversion"; import { RenderingSession, RenderingSessionBase, @@ -65,6 +74,12 @@ import { export { AssetConversion, + AssetConversionBase, + NonStartedAssetConversion, + RunningAssetConversion, + SucceededAssetConversion, + FailedAssetConversion, + CancelledAssetConversion, AssetConversionOperationState, AssetConversionSettings, RenderingSession, @@ -110,7 +125,13 @@ export { export type AssetConversionPollerLike = PollerLike; -export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions; +export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions & { + /** Conversion input settings describe the origin of conversion input. */ + inputSettings: AssetConversionInputSettings; + /** Conversion output settings describe the destination of conversion output. */ + outputSettings: AssetConversionOutputSettings; +}; + export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; export type RenderingSessionPollerLike = PollerLike< diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 5da1b8f3d6c0..7a9dd15539c0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -154,14 +154,14 @@ describe("RemoteRendering functional tests", () => { let conversion: AssetConversion = await client.getConversion(conversionId); assert.equal(conversion.conversionId, conversionId); - assert.notEqual(conversion.status, KnownAssetConversionStatus.Failed); + assert.notEqual(conversion.status, "Failed"); let conversion2: AssetConversion = await conversionPoller.pollUntilDone(); assert.equal(conversion2.conversionId, conversionId); - assert.equal(conversion2.status, KnownAssetConversionStatus.Succeeded); - assert.isDefined(conversion2.output); - assert.isDefined(conversion2.output?.outputAssetUrl); - assert.isTrue(conversion2.output?.outputAssetUrl?.endsWith("Output/testBox.arrAsset")); + assert.equal(conversion2.status, "Succeeded"); + if (conversion2.status === "Succeeded") { + assert.isTrue(conversion2.output.outputAssetUrl?.endsWith("Output/testBox.arrAsset")); + } let foundConversion: boolean = false; for await (const c of client.listConversions()) { From 5bb841c325e6d7c091ddf88b2e4061b660385fe6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 22 Apr 2021 15:30:56 +0100 Subject: [PATCH 074/166] Formatting --- .../src/internal/assetConversion.ts | 22 +++++++++++-------- .../src/remoteRenderingClient.ts | 19 ++++++++-------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 14d0c502ccf1..3b1d90b8602d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -17,19 +17,19 @@ export interface AssetConversionBase { settings: AssetConversionSettings; /** The time when the conversion was created. Date and time in ISO 8601 format. */ createdOn: Date; -}; +} /** The conversion was created but hasn't started. */ export interface NonStartedAssetConversion extends AssetConversionBase { /** The conversion was created but hasn't started. */ status: "NotStarted"; -}; +} /** The conversion is running. */ export interface RunningAssetConversion extends AssetConversionBase { /** The conversion is running. */ status: "Running"; -}; +} /** The conversion has succeeded. */ export interface SucceededAssetConversion extends AssetConversionBase { @@ -39,7 +39,7 @@ export interface SucceededAssetConversion extends AssetConversionBase { * Information about the output of a successful conversion. */ readonly output: AssetConversionOutput; -}; +} /** The conversion has failed. Check the 'error' field for more details. */ export interface FailedAssetConversion extends AssetConversionBase { @@ -47,15 +47,20 @@ export interface FailedAssetConversion extends AssetConversionBase { status: "Failed"; /** The error object containing details about the conversion failure. */ error: RemoteRenderingServiceError; -}; +} /** The conversion was cancelled. */ export interface CancelledAssetConversion extends AssetConversionBase { /** The conversion was cancelled. This is a terminal state. */ status: "Cancelled"; -}; +} -export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; +export type AssetConversion = + | NonStartedAssetConversion + | RunningAssetConversion + | SucceededAssetConversion + | FailedAssetConversion + | CancelledAssetConversion; export function assetConversionFromConversion(conversion: Conversion): AssetConversion { let baseProperties: AssetConversionBase = { @@ -63,8 +68,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv settings: conversion.settings, createdOn: conversion.createdOn }; - switch (conversion.status) - { + switch (conversion.status) { case KnownAssetConversionStatus.NotStarted: return { status: "NotStarted", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index a8bc365899a8..4fc401263955 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -49,15 +49,15 @@ import { getSessionInternal } from "./internal/commonQueries"; -import { - AssetConversion, +import { + AssetConversion, AssetConversionBase, NonStartedAssetConversion, RunningAssetConversion, SucceededAssetConversion, FailedAssetConversion, CancelledAssetConversion, - assetConversionFromConversion + assetConversionFromConversion } from "./internal/assetConversion"; import { RenderingSession, @@ -125,12 +125,13 @@ export { export type AssetConversionPollerLike = PollerLike; -export type AssetConversionOptions = AssetConversionPollerOptions & OperationOptions & { - /** Conversion input settings describe the origin of conversion input. */ - inputSettings: AssetConversionInputSettings; - /** Conversion output settings describe the destination of conversion output. */ - outputSettings: AssetConversionOutputSettings; -}; +export type AssetConversionOptions = AssetConversionPollerOptions & + OperationOptions & { + /** Conversion input settings describe the origin of conversion input. */ + inputSettings: AssetConversionInputSettings; + /** Conversion output settings describe the destination of conversion output. */ + outputSettings: AssetConversionOutputSettings; + }; export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; From 9e684acc9a34591bf0eae7b5e83b63c958162bd6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 22 Apr 2021 16:02:54 +0100 Subject: [PATCH 075/166] Ensure we don't take setting objects side-by-side --- .../src/remoteRenderingClient.ts | 35 +++++++++---------- .../test/public/remoteRenderingClient.spec.ts | 12 ++++--- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 4fc401263955..2259f14f948d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -125,15 +125,15 @@ export { export type AssetConversionPollerLike = PollerLike; -export type AssetConversionOptions = AssetConversionPollerOptions & - OperationOptions & { - /** Conversion input settings describe the origin of conversion input. */ - inputSettings: AssetConversionInputSettings; - /** Conversion output settings describe the destination of conversion output. */ - outputSettings: AssetConversionOutputSettings; - }; +export type BeginConversionOptions = AssetConversionSettings & AssetConversionPollerOptions & OperationOptions; -export type RenderingSessionOptions = RenderingSessionPollerOptions & OperationOptions; +export type GetConversionPollerOptions = AssetConversionPollerOptions & OperationOptions; + +export type BeginSessionOptions = RenderingSessionSettings & RenderingSessionPollerOptions & OperationOptions; + +export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; + +export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, @@ -279,8 +279,7 @@ export class RemoteRenderingClient { */ public async beginConversion( conversionId: string, - assetConversionSettings: AssetConversionSettings, - options: AssetConversionOptions = {} + options: BeginConversionOptions, ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { conversionId: conversionId, @@ -291,7 +290,7 @@ export class RemoteRenderingClient { let conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( this.accountId, conversionId, - { settings: assetConversionSettings }, + { settings: options }, updatedOptions ); @@ -345,7 +344,7 @@ export class RemoteRenderingClient { */ public async getConversionPoller( conversionId: string, - options: AssetConversionOptions = {} + options: GetConversionPollerOptions = {} ): Promise { let assetConversion: AssetConversion = await getConversionInternal( this.accountId, @@ -427,8 +426,7 @@ export class RemoteRenderingClient { */ public async beginSession( sessionId: string, - renderingSessionSettings: RenderingSessionSettings, - options: RenderingSessionOptions = {} + options: BeginSessionOptions ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { conversionId: sessionId, @@ -439,7 +437,7 @@ export class RemoteRenderingClient { let sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( this.accountId, sessionId, - renderingSessionSettings, + options, updatedOptions ); @@ -492,7 +490,7 @@ export class RemoteRenderingClient { */ public async getSessionPoller( sessionId: string, - options: RenderingSessionOptions = {} + options: GetSessionPollerOptions = {} ): Promise { let renderingSession: RenderingSession = await getSessionInternal( this.accountId, @@ -514,8 +512,7 @@ export class RemoteRenderingClient { */ public async updateSession( sessionId: string, - updateSessionSettings: UpdateSessionSettings, - options?: OperationOptions + options: UpdateSessionOptions ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-UpdateSession", { conversionId: sessionId, @@ -526,7 +523,7 @@ export class RemoteRenderingClient { let sessionProperties = await this.operations.updateSession( this.accountId, sessionId, - updateSessionSettings, + options, updatedOptions ); return renderingSessionFromSessionProperties(sessionProperties); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 7a9dd15539c0..7f296fbd9a9a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -14,7 +14,12 @@ import { AssetConversion, KnownAssetConversionStatus } from "../../src"; -import { AccessToken, AzureKeyCredential, TokenCredential, GetTokenOptions } from "@azure/core-auth"; +import { + AccessToken, + AzureKeyCredential, + TokenCredential, + GetTokenOptions +} from "@azure/core-auth"; import { createClient, createRecorder, getEnv } from "../utils/recordedClient"; // Load the .env file if it exists @@ -193,9 +198,6 @@ describe("RemoteRendering functional tests", () => { let conversionId = recorder.getUniqueName("conversionId"); - assert.throws( - () => client.beginConversion(conversionId, conversionSettings), - "" - ); + assert.throws(() => client.beginConversion(conversionId, conversionSettings), ""); }); }); From 8e27336ba0fd1579fd05bac67bab2c8867c7f72f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 22 Apr 2021 16:03:22 +0100 Subject: [PATCH 076/166] Formatting --- .../src/remoteRenderingClient.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2259f14f948d..42c2675a040b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -125,11 +125,15 @@ export { export type AssetConversionPollerLike = PollerLike; -export type BeginConversionOptions = AssetConversionSettings & AssetConversionPollerOptions & OperationOptions; +export type BeginConversionOptions = AssetConversionSettings & + AssetConversionPollerOptions & + OperationOptions; export type GetConversionPollerOptions = AssetConversionPollerOptions & OperationOptions; -export type BeginSessionOptions = RenderingSessionSettings & RenderingSessionPollerOptions & OperationOptions; +export type BeginSessionOptions = RenderingSessionSettings & + RenderingSessionPollerOptions & + OperationOptions; export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; @@ -279,7 +283,7 @@ export class RemoteRenderingClient { */ public async beginConversion( conversionId: string, - options: BeginConversionOptions, + options: BeginConversionOptions ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { conversionId: conversionId, From d55555d931322378067161fe9dbf7c2940ce5e41 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 26 Apr 2021 15:50:37 +0100 Subject: [PATCH 077/166] Use an overload for resumeFrom --- .../src/lro/assetConversionPoller.ts | 2 +- .../src/remoteRenderingClient.ts | 67 ++++++++++++------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index c16552d570bc..9cf0a691d55f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -89,7 +89,7 @@ class AssetConversionOperation } toString(): string { - throw new Error("Not yet implemented."); + return this.state.latestResponse.conversionId; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 42c2675a040b..e6fc3fb9881c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -125,11 +125,11 @@ export { export type AssetConversionPollerLike = PollerLike; -export type BeginConversionOptions = AssetConversionSettings & +export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; -export type GetConversionPollerOptions = AssetConversionPollerOptions & OperationOptions; +export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string } export type BeginSessionOptions = RenderingSessionSettings & RenderingSessionPollerOptions & @@ -281,10 +281,45 @@ export class RemoteRenderingClient { * @param assetConversionSettings Settings configuring the asset conversion. * @param options The options parameters. */ - public async beginConversion( + public async beginConversion( conversionId: string, - options: BeginConversionOptions + assetConversionSettings: AssetConversionSettings, + options?: BeginConversionOptions + ): Promise; + + /** + * Obtains a poller corresponding to a conversion that was already started. + * @param options The options parameters, carrying a resumeFrom value. + */ + public async beginConversion( + options: ResumeBeginConversionOptions + ): Promise; + + public async beginConversion( + conversionIdOrResumeOptions: string | ResumeBeginConversionOptions, + assetConversionSettings?: AssetConversionSettings, + options?: BeginConversionOptions ): Promise { + let conversionId: string; + let settings: AssetConversionSettings; + let operationOptions: BeginConversionOptions; + if (typeof conversionIdOrResumeOptions === "string") { + conversionId = conversionIdOrResumeOptions; + settings = assetConversionSettings!; + operationOptions = options ?? {}; + } + else { + let assetConversion: AssetConversion = await getConversionInternal( + this.accountId, + this.operations, + conversionIdOrResumeOptions.resumeFrom, + "RemoteRenderingClient-GetConversionPoller", + options + ); + + return new AssetConversionPoller(this.accountId, this.operations, assetConversion, conversionIdOrResumeOptions); + } + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { conversionId: conversionId, ...options @@ -294,7 +329,7 @@ export class RemoteRenderingClient { let conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( this.accountId, conversionId, - { settings: options }, + { settings: settings }, updatedOptions ); @@ -302,7 +337,7 @@ export class RemoteRenderingClient { this.accountId, this.operations, assetConversionFromConversion(conversion), - options + operationOptions ); // TODO Do I want this? @@ -341,26 +376,6 @@ export class RemoteRenderingClient { ); } - /** - * Returns a poller for a pre-existing conversion by conversionId - * @param conversionId The ID of a previously created conversion. - * @param options The options parameters. - */ - public async getConversionPoller( - conversionId: string, - options: GetConversionPollerOptions = {} - ): Promise { - let assetConversion: AssetConversion = await getConversionInternal( - this.accountId, - this.operations, - conversionId, - "RemoteRenderingClient-GetConversionPoller", - options - ); - - return new AssetConversionPoller(this.accountId, this.operations, assetConversion, options); - } - private async *getAllConversionsPagingPage( options?: OperationOptions ): AsyncIterableIterator { From bef9fdef1fc90dfaf1b314fc6fda3353422bb360 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 26 Apr 2021 16:20:05 +0100 Subject: [PATCH 078/166] Use an overload so beginSession can be resumed.. --- .../src/lro/renderingSessionPoller.ts | 2 +- .../src/remoteRenderingClient.ts | 96 +++++++++++-------- 2 files changed, 59 insertions(+), 39 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 81f5edbbe08f..d0321e4e3851 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -106,7 +106,7 @@ class RenderingSessionOperation * Useful when wanting to create a poller that monitors an existing operation. */ toString(): string { - throw new Error("Not yet implemented."); + return this.state.latestResponse.sessionId; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index e6fc3fb9881c..c68e5d15d534 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -125,16 +125,15 @@ export { export type AssetConversionPollerLike = PollerLike; -export type BeginConversionOptions = - AssetConversionPollerOptions & - OperationOptions; +export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; -export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string } +export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string }; -export type BeginSessionOptions = RenderingSessionSettings & - RenderingSessionPollerOptions & +export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; +export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: string }; + export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; @@ -281,18 +280,18 @@ export class RemoteRenderingClient { * @param assetConversionSettings Settings configuring the asset conversion. * @param options The options parameters. */ - public async beginConversion( + public async beginConversion( conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions ): Promise; - + /** * Obtains a poller corresponding to a conversion that was already started. * @param options The options parameters, carrying a resumeFrom value. */ - public async beginConversion( - options: ResumeBeginConversionOptions + public async beginConversion( + options: ResumeBeginConversionOptions ): Promise; public async beginConversion( @@ -307,8 +306,7 @@ export class RemoteRenderingClient { conversionId = conversionIdOrResumeOptions; settings = assetConversionSettings!; operationOptions = options ?? {}; - } - else { + } else { let assetConversion: AssetConversion = await getConversionInternal( this.accountId, this.operations, @@ -316,8 +314,13 @@ export class RemoteRenderingClient { "RemoteRenderingClient-GetConversionPoller", options ); - - return new AssetConversionPoller(this.accountId, this.operations, assetConversion, conversionIdOrResumeOptions); + + return new AssetConversionPoller( + this.accountId, + this.operations, + assetConversion, + conversionIdOrResumeOptions + ); } const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { @@ -443,20 +446,56 @@ export class RemoteRenderingClient { * @param renderingSessionSettings Settings of the session to be created. * @param options The options parameters. */ - public async beginSession( + public async beginSession( sessionId: string, - options: BeginSessionOptions + settings: RenderingSessionSettings, + options?: BeginSessionOptions + ): Promise; + + /** + * Obtains a poller for a pre-existing session + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters, carrying a resumeFrom value. + */ + public async beginSession( + options: ResumeBeginSessionOptions + ): Promise; + + public async beginSession( + sessionIdOrResumeOptions: string | ResumeBeginSessionOptions, + renderingSessionSettings?: RenderingSessionSettings, + options?: BeginSessionOptions ): Promise { + let sessionId: string; + let settings: RenderingSessionSettings; + let operationOptions: BeginSessionOptions; + if (typeof sessionIdOrResumeOptions === "string") { + sessionId = sessionIdOrResumeOptions; + settings = renderingSessionSettings!; + operationOptions = options ?? {}; + } else { + let renderingSession: RenderingSession = await getSessionInternal( + this.accountId, + this.operations, + sessionIdOrResumeOptions.resumeFrom, + "RemoteRenderingClient-GetSessionPoller", + sessionIdOrResumeOptions + ); + return new RenderingSessionPoller(this.accountId, this.operations, renderingSession, sessionIdOrResumeOptions); + } + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { conversionId: sessionId, - ...options + ...operationOptions }); try { let sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( this.accountId, sessionId, - options, + settings, updatedOptions ); @@ -464,7 +503,7 @@ export class RemoteRenderingClient { this.accountId, this.operations, renderingSessionFromSessionProperties(sessionProperties), - options + operationOptions ); // Do I want this? @@ -502,25 +541,6 @@ export class RemoteRenderingClient { ); } - /** - * Returns a poller for a pre-existing session by sessionId. - * @param sessionId The ID of a previously created session. - * @param options The options parameters. - */ - public async getSessionPoller( - sessionId: string, - options: GetSessionPollerOptions = {} - ): Promise { - let renderingSession: RenderingSession = await getSessionInternal( - this.accountId, - this.operations, - sessionId, - "RemoteRenderingClient-GetSessionPoller", - options - ); - return new RenderingSessionPoller(this.accountId, this.operations, renderingSession, options); - } - /** * Updates the max lease time of a particular rendering session. * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is From 6f7b54b810a373b6239bb13ad550fd0a74d16608 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 26 Apr 2021 16:21:19 +0100 Subject: [PATCH 079/166] Formatting. --- .../src/remoteRenderingClient.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index c68e5d15d534..7a7bda4354f4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -129,8 +129,7 @@ export type BeginConversionOptions = AssetConversionPollerOptions & OperationOpt export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string }; -export type BeginSessionOptions = RenderingSessionPollerOptions & - OperationOptions; +export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: string }; @@ -446,7 +445,7 @@ export class RemoteRenderingClient { * @param renderingSessionSettings Settings of the session to be created. * @param options The options parameters. */ - public async beginSession( + public async beginSession( sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions @@ -459,7 +458,7 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters, carrying a resumeFrom value. */ - public async beginSession( + public async beginSession( options: ResumeBeginSessionOptions ): Promise; @@ -483,7 +482,12 @@ export class RemoteRenderingClient { "RemoteRenderingClient-GetSessionPoller", sessionIdOrResumeOptions ); - return new RenderingSessionPoller(this.accountId, this.operations, renderingSession, sessionIdOrResumeOptions); + return new RenderingSessionPoller( + this.accountId, + this.operations, + renderingSession, + sessionIdOrResumeOptions + ); } const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { From 26543163ee2dc7eb0e2bc0c5739b3a42b44ad36f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 27 Apr 2021 12:13:23 +0100 Subject: [PATCH 080/166] expand PartialRenderingSessionProperties --- .../src/internal/renderingSession.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 7db39cf0f892..ec90bb949fdd 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -46,10 +46,42 @@ export interface RenderingSessionProperties { readonly createdOn: Date; } +/** + * In certain RenderingSession states, some properties are available and some are not. + */ +export interface PartialRenderingSessionProperties { + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + */ + readonly elapsedTimeInMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + */ + readonly host?: string; + /** + * The computational power of the rendering session GPU measured in teraflops. + */ + readonly teraflops?: number; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + */ + readonly createdOn?: Date; +} + /** The properties of a rendering session that may not be complete */ +/* export type PartialRenderingSessionProperties = { [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P]; }; +*/ /** The rendering session is ready for incoming connections. */ export interface ReadyRenderingSession extends RenderingSessionBase { From 76a280e92eee57c68faec2f207c6e7c2a24703d7 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 27 Apr 2021 12:13:38 +0100 Subject: [PATCH 081/166] Fix conversion tests. --- .../test/public/remoteRenderingClient.spec.ts | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 7f296fbd9a9a..c6d7de65fc11 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -4,6 +4,7 @@ import { assert } from "chai"; import { Context } from "mocha"; import { Recorder } from "@azure/test-utils-recorder"; +import { RestError } from "@azure/core-rest-pipeline"; import { RemoteRenderingClient, @@ -198,6 +199,54 @@ describe("RemoteRendering functional tests", () => { let conversionId = recorder.getUniqueName("conversionId"); - assert.throws(() => client.beginConversion(conversionId, conversionSettings), ""); + let didThrowExpected: Boolean = false; + try { + await client.beginConversion(conversionId, conversionSettings); + } + catch (e) { + assert(e instanceof RestError); + if (e instanceof RestError) { + assert.isTrue(e.message.toLowerCase().includes("storage")); + assert.isTrue(e.message.toLowerCase().includes("permission")); + } + didThrowExpected = true; + } + assert.isTrue(didThrowExpected); + }); + + it("failed conversion missing asset", async () => { + let storageContainerUrl = + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + let inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + relativeInputAssetPath: "boxWhichDoesNotExist.fbx", + blobPrefix: "Input" + }; + let outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + blobPrefix: "Output" + }; + let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + let conversionId = recorder.getUniqueName("conversionId"); + + let conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + let conversion: AssetConversion = await conversionPoller.pollUntilDone(); + assert.equal(conversion.status, "Failed"); + if (conversion.status == "Failed") + { + // Invalid input provided. Check logs in output container for details. + assert.isTrue(conversion.error.message.toLowerCase().includes("invalid input")); + assert.isTrue(conversion.error.message.toLowerCase().includes("logs")); + } }); }); From 1ee646ac13860eeaa434020d66c689ae14f24e2d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 27 Apr 2021 12:14:01 +0100 Subject: [PATCH 082/166] Formatting --- .../test/public/remoteRenderingClient.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index c6d7de65fc11..44da98a01808 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -202,8 +202,7 @@ describe("RemoteRendering functional tests", () => { let didThrowExpected: Boolean = false; try { await client.beginConversion(conversionId, conversionSettings); - } - catch (e) { + } catch (e) { assert(e instanceof RestError); if (e instanceof RestError) { assert.isTrue(e.message.toLowerCase().includes("storage")); @@ -242,8 +241,7 @@ describe("RemoteRendering functional tests", () => { ); let conversion: AssetConversion = await conversionPoller.pollUntilDone(); assert.equal(conversion.status, "Failed"); - if (conversion.status == "Failed") - { + if (conversion.status == "Failed") { // Invalid input provided. Check logs in output container for details. assert.isTrue(conversion.error.message.toLowerCase().includes("invalid input")); assert.isTrue(conversion.error.message.toLowerCase().includes("logs")); From 93bcb58640bdb67ff3611738eb1e784fd74b7758 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 27 Apr 2021 15:16:53 +0100 Subject: [PATCH 083/166] Add rendering session tests. --- .../test/public/remoteRenderingClient.spec.ts | 84 ++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 44da98a01808..7c86e4014294 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -13,7 +13,10 @@ import { AssetConversionSettings, AssetConversionPollerLike, AssetConversion, - KnownAssetConversionStatus + KnownAssetConversionStatus, + RenderingSessionPollerLike, + RenderingSessionSettings, + RenderingSession } from "../../src"; import { AccessToken, @@ -247,4 +250,83 @@ describe("RemoteRendering functional tests", () => { assert.isTrue(conversion.error.message.toLowerCase().includes("logs")); } }); + + it("successful session", async () => { + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, + size: "Standard" + }; + let sessionId: string = recorder.getUniqueName("sessionId"); + + let sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings + ); + + assert.equal(sessionPoller.getOperationState().latestResponse.sessionId, sessionId); + assert.equal( + sessionPoller.getOperationState().latestResponse.size, + sessionSettings.size + ); + assert.equal( + sessionPoller.getOperationState().latestResponse.maxLeaseTimeInMinutes, + sessionSettings.maxLeaseTimeInMinutes + ); + assert.notEqual( + sessionPoller.getOperationState().latestResponse.status, + "Error" + ); + + let renderingSession = await client.getSession(sessionId); + assert.equal(renderingSession.sessionId, sessionId); + + let newPoller = await client.beginSession({ resumeFrom: sessionPoller.toString() }); + assert.equal(newPoller.getOperationState().latestResponse.sessionId, sessionId); + + let updatedSession: RenderingSession = await client.updateSession(sessionId, { maxLeaseTimeInMinutes: 5 }); + assert.equal(updatedSession.maxLeaseTimeInMinutes, 5); + + let readyRenderingSession: RenderingSession = await sessionPoller.pollUntilDone(); + + // beginSession does one interval of polling. If the session was ready within that time, then the poller + // would carry the earlier maxLeastTimeInMinutes value. + assert.isTrue((readyRenderingSession.maxLeaseTimeInMinutes == 4) || (readyRenderingSession.maxLeaseTimeInMinutes == 5)); + + assert.equal(readyRenderingSession.status, "Ready"); + + let foundSession: boolean = false; + for await (const s of client.listSessions()) { + if (s.sessionId == sessionId) { + foundSession = true; + } + } + assert.isTrue(foundSession); + + client.endSession(sessionId); + }); + + it("invalid session", async () => { + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: -4, + size: "Standard" + }; + let sessionId: string = recorder.getUniqueName("sessionId"); + + let didThrowExpected: Boolean = false; + try { + await client.beginSession( + sessionId, + sessionSettings + ); + } catch (e) { + assert(e instanceof RestError); + if (e instanceof RestError) { + // The maxLeaseTimeMinutes value cannot be negative + assert.isTrue(e.message.toLowerCase().includes("lease")); + assert.isTrue(e.message.toLowerCase().includes("negative")); + } + didThrowExpected = true; + } + assert.isTrue(didThrowExpected); + }); }); From 3c0e302da928a4db89a821880a285a7538655eef Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 27 Apr 2021 15:17:37 +0100 Subject: [PATCH 084/166] Formatting --- .../test/public/remoteRenderingClient.spec.ts | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 7c86e4014294..cf761c6fc71f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -264,18 +264,12 @@ describe("RemoteRendering functional tests", () => { ); assert.equal(sessionPoller.getOperationState().latestResponse.sessionId, sessionId); - assert.equal( - sessionPoller.getOperationState().latestResponse.size, - sessionSettings.size - ); + assert.equal(sessionPoller.getOperationState().latestResponse.size, sessionSettings.size); assert.equal( sessionPoller.getOperationState().latestResponse.maxLeaseTimeInMinutes, sessionSettings.maxLeaseTimeInMinutes ); - assert.notEqual( - sessionPoller.getOperationState().latestResponse.status, - "Error" - ); + assert.notEqual(sessionPoller.getOperationState().latestResponse.status, "Error"); let renderingSession = await client.getSession(sessionId); assert.equal(renderingSession.sessionId, sessionId); @@ -283,14 +277,19 @@ describe("RemoteRendering functional tests", () => { let newPoller = await client.beginSession({ resumeFrom: sessionPoller.toString() }); assert.equal(newPoller.getOperationState().latestResponse.sessionId, sessionId); - let updatedSession: RenderingSession = await client.updateSession(sessionId, { maxLeaseTimeInMinutes: 5 }); + let updatedSession: RenderingSession = await client.updateSession(sessionId, { + maxLeaseTimeInMinutes: 5 + }); assert.equal(updatedSession.maxLeaseTimeInMinutes, 5); let readyRenderingSession: RenderingSession = await sessionPoller.pollUntilDone(); - + // beginSession does one interval of polling. If the session was ready within that time, then the poller // would carry the earlier maxLeastTimeInMinutes value. - assert.isTrue((readyRenderingSession.maxLeaseTimeInMinutes == 4) || (readyRenderingSession.maxLeaseTimeInMinutes == 5)); + assert.isTrue( + readyRenderingSession.maxLeaseTimeInMinutes == 4 || + readyRenderingSession.maxLeaseTimeInMinutes == 5 + ); assert.equal(readyRenderingSession.status, "Ready"); @@ -311,13 +310,10 @@ describe("RemoteRendering functional tests", () => { size: "Standard" }; let sessionId: string = recorder.getUniqueName("sessionId"); - + let didThrowExpected: Boolean = false; try { - await client.beginSession( - sessionId, - sessionSettings - ); + await client.beginSession(sessionId, sessionSettings); } catch (e) { assert(e instanceof RestError); if (e instanceof RestError) { From 63fc7969fada9fd1cb99072a89e4574c3796a02c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 10:47:31 +0100 Subject: [PATCH 085/166] Post rebase fix --- rush.json | 10 +++++----- .../mixedreality-remoterendering/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rush.json b/rush.json index 156d42995f28..3fe529a973ea 100644 --- a/rush.json +++ b/rush.json @@ -760,11 +760,6 @@ "projectFolder": "sdk/deviceupdate/iot-device-update", "versionPolicyName": "client" }, - { - "packageName": "@azure/mixedreality-remoterendering", - "projectFolder": "sdk/remoterendering/mixedreality-remoterendering", - "versionPolicyName": "client" - } { "packageName": "@azure/web-pubsub", "projectFolder": "sdk/web-pubsub/web-pubsub", @@ -794,6 +789,11 @@ "packageName": "@azure-tests/perf-app-configuration", "projectFolder": "sdk/appconfiguration/perf-tests/app-configuration", "versionPolicyName": "test" + }, + { + "packageName": "@azure/mixedreality-remoterendering", + "projectFolder": "sdk/remoterendering/mixedreality-remoterendering", + "versionPolicyName": "client" } ] } diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index dd7fa6614cb5..d08ab74f452b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -82,7 +82,7 @@ "@azure/core-lro": "^1.0.2", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.1.1", - "@azure/core-util": "1.0.0-beta.1" + "@azure/core-util": "^1.0.0-beta.1" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", From 912f6ea872318376b53ece5fd0f291ea75bcbb29 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 11:23:30 +0100 Subject: [PATCH 086/166] Improve tests --- .../test/public/remoteRenderingClient.spec.ts | 19 ++++++++++++------ .../test/utils/recordedClient.ts | 20 +++++++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index cf761c6fc71f..e8ea58d2f591 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -124,7 +124,7 @@ describe("RemoteRendering functional tests", () => { await recorder.stop(); }); - it("successful conversion", async () => { + it("can convert successfully", async () => { let storageContainerUrl: string = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + @@ -181,7 +181,7 @@ describe("RemoteRendering functional tests", () => { assert.isTrue(foundConversion); }); - it("failed conversion no access", async () => { + it("throws correct exception on no access", async () => { let storageContainerUrl = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + @@ -216,7 +216,7 @@ describe("RemoteRendering functional tests", () => { assert.isTrue(didThrowExpected); }); - it("failed conversion missing asset", async () => { + it("will fail in the correct way on missing asset", async () => { let storageContainerUrl = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + @@ -242,6 +242,13 @@ describe("RemoteRendering functional tests", () => { conversionId, conversionSettings ); + + let assetConversion: AssetConversion = await client.getConversion(conversionId); + assert.equal(assetConversion.conversionId, conversionId); + + let newPoller = await client.beginConversion({ resumeFrom: conversionPoller.toString() }); + assert.equal(newPoller.getOperationState().latestResponse.conversionId, conversionId); + let conversion: AssetConversion = await conversionPoller.pollUntilDone(); assert.equal(conversion.status, "Failed"); if (conversion.status == "Failed") { @@ -251,7 +258,7 @@ describe("RemoteRendering functional tests", () => { } }); - it("successful session", async () => { + it("can start a session", async () => { const sessionSettings: RenderingSessionSettings = { maxLeaseTimeInMinutes: 4, size: "Standard" @@ -301,10 +308,10 @@ describe("RemoteRendering functional tests", () => { } assert.isTrue(foundSession); - client.endSession(sessionId); + await client.endSession(sessionId); }); - it("invalid session", async () => { + it("throws the correct exception on invalid session properties", async () => { const sessionSettings: RenderingSessionSettings = { maxLeaseTimeInMinutes: -4, size: "Standard" diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index 7f64ebd9d85b..fc31ad9c5741 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -3,8 +3,8 @@ import { Context } from "mocha"; -import { AzureKeyCredential } from "@azure/core-auth"; -import { env, record, Recorder, RecorderEnvironmentSetup } from "@azure/test-utils-recorder"; +import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; +import { env, record, Recorder, RecorderEnvironmentSetup, isPlaybackMode } from "@azure/test-utils-recorder"; import { RemoteRenderingClient } from "../../src"; //import "./env"; @@ -14,7 +14,7 @@ import { RemoteRenderingClient } from "../../src"; // the values they are mapped to below, which are not real account details. const replaceableVariables: Record = { REMOTERENDERING_ARR_ACCOUNT_DOMAIN: "eastus2.mixedreality.azure.com", - REMOTERENDERING_ARR_ACCOUNT_ID: "arr_account_id", + REMOTERENDERING_ARR_ACCOUNT_ID: "00000000-1111-2222-3333-444455556666", REMOTERENDERING_ARR_ACCOUNT_KEY: "arr_account_key", REMOTERENDERING_ARR_BLOB_CONTAINER_NAME: "test", REMOTERENDERING_ARR_SAS_TOKEN: "arr_sas_token", @@ -46,9 +46,17 @@ export function createClient(): RemoteRenderingClient { const accountId = getEnv("REMOTERENDERING_ARR_ACCOUNT_ID"); const accountKey = getEnv("REMOTERENDERING_ARR_ACCOUNT_KEY"); - const keyCredential = new AzureKeyCredential(accountKey); - - return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, keyCredential); + if (isPlaybackMode()) { + // When playing back, we do not want to interact with the STS service, so we use + // the AccessToken auth path. + const maxTimestampMs = 8640000000000000; + let credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + } + else { + let credential: AzureKeyCredential = new AzureKeyCredential(accountKey); + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + } } /** From c694221208da87c72c414f73c6b6e4a9fc60e487 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 11:23:56 +0100 Subject: [PATCH 087/166] Formatting --- .../test/utils/recordedClient.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index fc31ad9c5741..23075093753c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -4,7 +4,13 @@ import { Context } from "mocha"; import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; -import { env, record, Recorder, RecorderEnvironmentSetup, isPlaybackMode } from "@azure/test-utils-recorder"; +import { + env, + record, + Recorder, + RecorderEnvironmentSetup, + isPlaybackMode +} from "@azure/test-utils-recorder"; import { RemoteRenderingClient } from "../../src"; //import "./env"; @@ -52,8 +58,7 @@ export function createClient(): RemoteRenderingClient { const maxTimestampMs = 8640000000000000; let credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); - } - else { + } else { let credential: AzureKeyCredential = new AzureKeyCredential(accountKey); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); } From 59ab237749ed1ef104112fbab341924d74d7bddf Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 13:37:25 +0100 Subject: [PATCH 088/166] Test improvements --- .../mixedreality-remoterendering.api.md | 49 +++++++++++++------ .../test/public/remoteRenderingClient.spec.ts | 4 -- .../test/utils/env.browser.ts | 2 + .../test/utils/env.ts | 6 +++ .../test/utils/recordedClient.ts | 2 +- 5 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts create mode 100644 sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index e01186180a80..7918317c0a4c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -36,9 +36,6 @@ export interface AssetConversionOperationState extends PollOperationState; - beginSession(sessionId: string, renderingSessionSettings: RenderingSessionSettings, options?: RenderingSessionOptions): Promise; + beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions): Promise; + beginConversion(options: ResumeBeginConversionOptions): Promise; + beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; + beginSession(options: ResumeBeginSessionOptions): Promise; endSession(sessionId: string, options?: OperationOptions): Promise; getConversion(conversionId: string, options?: OperationOptions): Promise; - getConversionPoller(conversionId: string, options?: AssetConversionOptions): Promise; getSession(sessionId: string, options?: OperationOptions): Promise; - getSessionPoller(sessionId: string, options?: RenderingSessionOptions): Promise; listConversions(options?: OperationOptions): PagedAsyncIterableIterator; listSessions(options?: OperationOptions): PagedAsyncIterableIterator; - updateSession(sessionId: string, updateSessionSettings: UpdateSessionSettings, options?: OperationOptions): Promise; + updateSession(sessionId: string, options: UpdateSessionOptions): Promise; } // @public @@ -186,9 +197,6 @@ export interface RenderingSessionOperationState extends PollOperationState; @@ -214,6 +222,16 @@ export interface RenderingSessionSettings { size: RenderingServerSize; } +// @public (undocumented) +export type ResumeBeginConversionOptions = BeginConversionOptions & { + resumeFrom: string; +}; + +// @public (undocumented) +export type ResumeBeginSessionOptions = BeginSessionOptions & { + resumeFrom: string; +}; + // @public export interface RunningAssetConversion extends AssetConversionBase { status: "Running"; @@ -239,6 +257,9 @@ export interface SucceededAssetConversion extends AssetConversionBase { status: "Succeeded"; } +// @public (undocumented) +export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; + // @public export interface UpdateSessionSettings { maxLeaseTimeInMinutes: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index e8ea58d2f591..605652397d8f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -26,10 +26,6 @@ import { } from "@azure/core-auth"; import { createClient, createRecorder, getEnv } from "../utils/recordedClient"; -// Load the .env file if it exists -import * as dotenv from "dotenv"; -dotenv.config(); - describe("RemoteRenderingClient construction", () => { const accountDomain = "mixedreality.azure.com"; const accountId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts new file mode 100644 index 000000000000..fd2aca680c7b --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts @@ -0,0 +1,2 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts new file mode 100644 index 000000000000..0e06855b73ae --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import * as dotenv from "dotenv"; + +dotenv.config(); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index 23075093753c..52532046d26d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -13,7 +13,7 @@ import { } from "@azure/test-utils-recorder"; import { RemoteRenderingClient } from "../../src"; -//import "./env"; +import "./env"; // When the recorder observes the values of these environment variables // in any recorded HTTP request or response, it will replace them with From 9710060f0e3c12f6ec4305cc1073394f94d24d4a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 13:38:03 +0100 Subject: [PATCH 089/166] Add pipeline files. --- sdk/remoterendering/ci.yml | 32 +++++++++++++++++++ .../mixedreality-remoterendering/tests.yml | 12 +++---- 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 sdk/remoterendering/ci.yml diff --git a/sdk/remoterendering/ci.yml b/sdk/remoterendering/ci.yml new file mode 100644 index 000000000000..8b93f28e039d --- /dev/null +++ b/sdk/remoterendering/ci.yml @@ -0,0 +1,32 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - release/* + - hotfix/* + paths: + include: + - sdk/remoterendering/ + +pr: + branches: + include: + - master + - main + - feature/* + - release/* + - hotfix/* + paths: + include: + - sdk/remoterendering/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: remoterendering + Artifacts: + - name: azure-mixedreality-remoterendering + safeName: azuremixedrealityremoterendering diff --git a/sdk/remoterendering/mixedreality-remoterendering/tests.yml b/sdk/remoterendering/mixedreality-remoterendering/tests.yml index 8ee6aca1536a..5a825cf43ae4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/tests.yml +++ b/sdk/remoterendering/mixedreality-remoterendering/tests.yml @@ -3,10 +3,8 @@ trigger: none extends: template: ../../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml parameters: - PackageName: "@azure/template" - ResourceServiceDirectory: template - TestMinMax: true - EnvVars: - AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) - AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) + PackageName: "@azure/mixedreality-remoterendering" + ServiceDirectory: remoterendering + Location: eastus2 + MatrixFilters: + - DependencyVersion=^$ \ No newline at end of file From 8932982a4e69ba83ad68fa20e304f0dbf21265c4 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 13:38:29 +0100 Subject: [PATCH 090/166] Karma fix --- .../mixedreality-remoterendering/karma.conf.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js index 9bca108da550..344be1f2cd2a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js +++ b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js @@ -55,9 +55,14 @@ module.exports = function(config) { envPreprocessor: [ "TEST_MODE", - "APPCONFIG_ENDPOINT", - "APPCONFIG_TEST_SETTING_KEY", - "APPCONFIG_TEST_SETTING_EXPECTED_VALUE", + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME", + "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME", + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY", + "REMOTERENDERING_ARR_ACCOUNT_KEY", + "REMOTERENDERING_ARR_ACCOUNT_DOMAIN", + "REMOTERENDERING_ARR_ACCOUNT_ID", + "REMOTERENDERING_ARR_SAS_TOKEN", + "REMOTERENDERING_ARR_SERVICE_ENDPOINT", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET", "AZURE_TENANT_ID" From 11178fd1259c9831c3154236ccb8d95eb38ac13b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 13:38:58 +0100 Subject: [PATCH 091/166] Add recordings from node --- .../recording_can_convert_successfully.js | 417 +++++++ .../recording_can_start_a_session.js | 1047 +++++++++++++++++ ...g_throws_correct_exception_on_no_access.js | 43 + ...exception_on_invalid_session_properties.js | 57 + ...ail_in_the_correct_way_on_missing_asset.js | 421 +++++++ 5 files changed, 1985 insertions(+) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js new file mode 100644 index 000000000000..083574437c56 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js @@ -0,0 +1,417 @@ +let nock = require('nock'); + +module.exports.hash = "15351b68172a2a7defdf4f33342ade03"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960623149001403"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'sMIjBEIxQkuNoL+AC6a+Ag.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .query(true) + .reply(201, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '429', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'NqExo3SFkECPxQTW5rftUQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'mBBjVxvwaEOCVKyqVQoS/g.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '429', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'n7LmyGxolkO03JpsMgEJcw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:14 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '9daUQGXPuU6B0FpF9o1BEw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:14 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '1y69Dkle6kyUOxLuoGMuiQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:14 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'cLzFbZD4d0GwaiZt51lspA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:15 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'oVCsYwZnLEeJm+doT9YUnw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:25 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'lvI063DC2E6O7EuwhRNCTw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:25 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '8l43gSrD20e1+FbWgDC7aQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:36 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'XyIhpZYH00qQpFphz+RtWQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:36 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'qBoSp1klt0i9739hKDMvAA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:47 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'SjnkbnduTkeD14VKfEemWA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:48 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '8KmpjfQ7MUi2vx0F6ZwaRA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'dewSylb9cUerWcV9mtNNOg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:37:59 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '426', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'vzNqfdfwpU+o6xczQ4bxyA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'slQLanQn8UeKxcLLfPLfRA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .query(true) + .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '525', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '7D2WxTPJ2UiZ6XXosIrAUw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'wxrETwgSpUGjPs+5Trdi8A.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions') + .query(true) + .reply(200, {"conversions":[{"id":"conversionId161953782173201356","creationTime":"2021-04-27T15:37:02.4170052Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161953867312805204","creationTime":"2021-04-27T15:51:12.8757221Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161959842804702186","creationTime":"2021-04-28T08:27:10.0095407Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959937948300631","creationTime":"2021-04-28T08:43:00.0756524Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161959980529100367","creationTime":"2021-04-28T08:50:06.6275053Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959988466101111","creationTime":"2021-04-28T08:51:26.204359Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959995214407550","creationTime":"2021-04-28T08:52:32.6961017Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161960363691906183","creationTime":"2021-04-28T09:53:59.196695Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161960454825009485","creationTime":"2021-04-28T10:09:08.7915038Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}],"@nextLink":null}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '5436', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'FMGP1RQzPUm3XLXwAnbufA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js new file mode 100644 index 000000000000..94a950ff4c37 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js @@ -0,0 +1,1047 @@ +let nock = require('nock'); + +module.exports.hash = "59dc56d581f29cf0fcaa83f3b65df716"; + +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161960634870200973"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '0HNricFcN0mBR8qt0DfvRA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973', {"maxLeaseTimeMinutes":4,"size":"Standard"}) + .query(true) + .reply(201, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'bNMYIJpcvEaJHznIfC4I1w.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'z0E4tmQtFk6fg/ceiVsOsw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'VRFndlqqQUyB6b1zDM/neQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'mMavso41oUmrALx9NfEOGA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '1OLjz3EDRE659gPwBo9z3Q.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'kTKkmxjSwkChZOMZJY5nFA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '/Cj+4uTOT0C1a9ZHjjQj2g.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'MBAl6XcVBkSu3a1fNF5mZw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973', {"maxLeaseTimeMinutes":5}) + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '5N2u8Avq5E+xNBfBXEtqgQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'dY3OY3LMCk6wfNYRYghS/A.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '1KywaNI/pkOmYn79vk/Ujw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'qFX0fKkLgkGmN40SHj4KSg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'ffGufshopkekbfw3jeGqPg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:32 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'cmszS+8Lnk6LhcSq8vzsAA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:31 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'jKjnP6bA1kOpiXqnpO5wMw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:41 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'AjDB0LiqL0Kn8QuOP73XFw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:42 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '3MsE1bDJ/0OMC2xsjSLRWw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:52 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '6lfBoYml4UeWZZhgz+zlTQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:52 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'P1nza97nA0+AuemQLlTW5w.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:02 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'AnMGxC8SE02A+9nIlP3gLQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:03 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'qlgPtHFBZ02gwzuRDkaOQA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'yXYzagcjSkCqsh9wLlSByg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'X3jw4CIv4U+jLDiqdzPOpg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:23 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'tuHPLhBdy0mKqBNDSMmOzQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:23 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '48oQVxk2t0GZstRjOC5aHA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:34 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'S9BG1kHye0KelAAfT0Sjmw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:34 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'RiHcz2cIQUOtONarIR1cBQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:45 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'Q1NSg+1hbkmui3Gl8cZd9Q.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:45 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Nxqkc0FRs0SSNEkSiS+M4g.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:55 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'c2zl70gl9k6Vht05HsP2EQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:40:55 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'FNdrLjB2ZUOS+712pfwJmw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:05 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'KI3nlxN9zk+Pw9paaE2nLQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:06 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Py1AnPSHgkyuC9x7gIv8cA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:16 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'Q7FJoZ8e2UmBk9P2cq0+2w.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:16 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'I7Bh9vx7S0G9NKOGieEC+A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:26 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'MIM+kITHI0CB06qDveZMJA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:27 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Y1PovyU4skSybXgqjxH/Qw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:37 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'Rc07CtRwdkKzEoVumYPihA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:38 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '3Vw66D+c+EWNxFPNYjb8TQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:48 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'FRhL3GnjM026tWqGg2Ka1A.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:48 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'rOI3qCR/6Uulp0UpgShlrQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'FGbOX+N6FEGjc4MyG+KdIg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:41:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'WBwm3rihjUO3MOCcvTk6vA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'slM//czSNEiyqufTltNetg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:09 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'WGOyJgPH7UiiMgkc2s939A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '+caM1WBCo0WhHPTQHsXpXw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .query(true) + .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","arrInspectorPort":57393,"handshakePort":49770,"elapsedTimeMinutes":0,"hostname":"806975667-fbc19898-ff01-4e25-8abe-1deebfd58103.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '342', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'o3+RJDqFA0qPPdMvGr6UgQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '5mPb45NfJU6iopszgPkKDw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions') + .query(true) + .reply(200, {"sessions":[{"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","arrInspectorPort":57393,"handshakePort":49770,"elapsedTimeMinutes":0,"hostname":"806975667-fbc19898-ff01-4e25-8abe-1deebfd58103.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '357', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'RUQ+N7JpM0GIATpneHX8pw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js new file mode 100644 index 000000000000..52b9081ff209 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js @@ -0,0 +1,43 @@ +let nock = require('nock'); + +module.exports.hash = "4482e74cdede34465d36732c60dae28f"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960629055603158"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'VOK57jg9CEupMb/KJEC4Lw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629055603158', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output"}}}) + .query(true) + .reply(403, {"error":{"code":"DelegatedResourceAccessError","message":"Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned. Documentation on how to link Remote Rendering Accounts to storage can be found here: https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts."}}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '390', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'WDbBqgOgfkuxLOq9v2Fm1A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js new file mode 100644 index 000000000000..dc649220068b --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js @@ -0,0 +1,57 @@ +let nock = require('nock'); + +module.exports.hash = "acef1917e9635185f91a50bd8cf382ef"; + +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161960654135800182"},"newDate":{}} + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .post('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973/:stop') + .query(true) + .reply(204, "", [ + 'Date', + 'Wed, 28 Apr 2021 10:42:21 GMT', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'A0gcQVT0R0+Pbh9xuXFZvQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:21 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '57zI/Ts+iE6hhCpqbdzpxw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960654135800182', {"maxLeaseTimeMinutes":-4,"size":"Standard"}) + .query(true) + .reply(400, {"error":{"code":"BadRequest","message":"The maxLeaseTimeMinutes value cannot be negative."}}, [ + 'Date', + 'Wed, 28 Apr 2021 10:42:21 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '93', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'a9opucZKg0O3VdjuvuGnGg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js new file mode 100644 index 000000000000..d105827e8407 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js @@ -0,0 +1,421 @@ +let nock = require('nock'); + +module.exports.hash = "98eb3da984f30ffa04babd4ee34a4e41"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960629129403049"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'CUAahpgsQkW0gvYD7enulA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .query(true) + .reply(201, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '455', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Cu9b4mTzLUm/B9TqFcIV2w.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '4YR03J+nDEur3aQOFKZT+g.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '455', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '/PriHG+FAEW1VhNesCapIg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'KHbP5XiHVk2cVKsGq5wjcQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:12 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'XKIDIlGqoEuogvU+ex82ug.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'Pl7/meGxIkGZ92+Aqxw0yQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'BBn01/e+y0eTVUwCVlnJOw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:13 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'viq7301h4U2f9J5BBamCyA.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:14 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'a7RUDbOg3EyTTWqaP37vcg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:24 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'HNKDqzAtfkWvV/UCZVcR4w.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:24 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'UgbrTwr7Ck2O30l5sj5Tpw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:34 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '3urenTWNWkyo6YfBU9dFjQ.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:35 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'hKzPFvr5iEiNfecCKOIJcQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:45 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'r8KC+dNPzUmpJbQtEcTaXw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:46 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'BuMR11/QZ0qJ3noqrPRV5Q.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:56 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'mqTZa+tJTEa1/Hv9q02iHw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:38:56 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '452', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'S+aGkLh+m0Gk6YUJrNh1pg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'oGfPBRZ240md8qScIwTkdg.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .query(true) + .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"}, [ + 'Date', + 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '561', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'E4A/KJEO2kGwZ9bz+AcIsA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); From 148c9c1d47a993a0f4899fdd5be8a87a95654e47 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 28 Apr 2021 14:48:28 +0100 Subject: [PATCH 092/166] Stop browser tests using dotenv. --- sdk/remoterendering/mixedreality-remoterendering/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index d08ab74f452b..0a5292064d8d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -5,7 +5,9 @@ "sdk-type": "client", "main": "dist/index.js", "module": "dist-esm/src/index.js", - "browser": {}, + "browser": { + "./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js" + }, "types": "types/mixedreality-remoterendering.d.ts", "//metadata": { "constantPaths": [ From d697b74b3b494cb2e3270c2c6592326477e89cb3 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 30 Apr 2021 16:13:52 +0100 Subject: [PATCH 093/166] New recordings. --- .../recording_can_convert_successfully.json | 246 ++++++ .../recording_can_start_a_session.json | 566 ++++++++++++++ ...throws_correct_exception_on_no_access.json | 48 ++ ...ception_on_invalid_session_properties.json | 48 ++ ...l_in_the_correct_way_on_missing_asset.json | 408 ++++++++++ .../recording_can_convert_successfully.js | 282 ++----- .../recording_can_start_a_session.js | 702 +++--------------- ...g_throws_correct_exception_on_no_access.js | 12 +- ...exception_on_invalid_session_properties.js | 26 +- ...ail_in_the_correct_way_on_missing_asset.js | 282 ++----- 10 files changed, 1563 insertions(+), 1057 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json create mode 100644 sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json new file mode 100644 index 000000000000..82bc2290e0e7 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json @@ -0,0 +1,246 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:20 GMT", + "ms-cv": "JoTdFOWwl02T1cQKRpIi0g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerReadListSas\":\"arr_sas_token\",\"blobPrefix\":\"Input\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerWriteSas\":\"arr_sas_token\",\"blobPrefix\":\"Output\"}}}", + "status": 201, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:21 GMT", + "ms-cv": "yrDX1oKYo0W5tvKDAtXkZA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:21 GMT", + "ms-cv": "CtcKYqdpYkC39WTiSu9wAA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:22 GMT", + "ms-cv": "nuj7LuwRoUOIrlYEzkYwSQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:22 GMT", + "ms-cv": "Sw0fbqprbkOcbfrilQ4C4g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:32 GMT", + "ms-cv": "UlsRwsueUE2O5jKPAUVdXQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:42 GMT", + "ms-cv": "/5ZZA2Jw+0K3lTHdyllDfQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:53 GMT", + "ms-cv": "VBBeMJ86i0KCD17V07LtFQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:03 GMT", + "ms-cv": "Ume7qfVkY0SB/gpvQSku7g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:13 GMT", + "ms-cv": "w3nAW/S4DUS9DH8dSzTe5Q.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "525", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:23 GMT", + "ms-cv": "zxBm6loxFUeBCLn/zYMjug.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"conversions\":[{\"id\":\"9456e78f-4e86-45d5-9a3a-42f32d98ebfa\",\"creationTime\":\"2021-04-30T09:42:54.4006831Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"4bd0faf2-7279-4351-8255-ff7b1852aa77\",\"creationTime\":\"2021-04-30T11:04:28.3608266Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"5853b38a-a174-44e4-9018-7c324e2d2ba7\",\"creationTime\":\"2021-04-30T11:17:01.4900529Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"9e063aff-0aeb-4ca5-8796-b708680fcf32\",\"creationTime\":\"2021-04-30T11:25:43.4274107Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"conversionId161978216546004121\",\"creationTime\":\"2021-04-30T11:29:27.2323156Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"conversionId161978242766201357\",\"creationTime\":\"2021-04-30T11:33:47.8966192Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":{\"code\":\"ConversionProcessFailed\",\"message\":\"Invalid input provided. Check logs in output container for details.\"},\"status\":\"Failed\"},{\"id\":\"conversionId161978289255208378\",\"creationTime\":\"2021-04-30T11:41:35.9073281Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"conversionId161978296301000875\",\"creationTime\":\"2021-04-30T11:42:43.2118581Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":{\"code\":\"ConversionProcessFailed\",\"message\":\"Invalid input provided. Check logs in output container for details.\"},\"status\":\"Failed\"},{\"id\":\"a6faf3bc-3c10-4ce3-9548-545da9ef2423\",\"creationTime\":\"2021-04-30T11:49:50.4940039Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"b57d6ad3-0077-478b-967a-0219a0fab5cc\",\"creationTime\":\"2021-04-30T13:12:21.8193622Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"conversionId161979083179608548\",\"creationTime\":\"2021-04-30T13:53:53.963195Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"},{\"id\":\"conversionId161979089851105096\",\"creationTime\":\"2021-04-30T13:54:58.578215Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":{\"code\":\"ConversionProcessFailed\",\"message\":\"Invalid input provided. Check logs in output container for details.\"},\"status\":\"Failed\"},{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"testBox.arrAsset\"}},\"output\":{\"outputAssetUri\":\"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset\"},\"error\":null,\"status\":\"Succeeded\"}],\"@nextLink\":null}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "7014", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "NwuvQ+Mp4E+5JXGIyAKl9w.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979116029500129" + }, + "newDate": {} + }, + "hash": "8c0a0f10068e4ab75bfa4fbdfe2c94e8" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json new file mode 100644 index 000000000000..f661d0335080 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json @@ -0,0 +1,566 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:51 GMT", + "ms-cv": "Fz3oQvY9Lk+52P+WBV59Fg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\"}", + "status": 201, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:51 GMT", + "ms-cv": "obtl9RxeVECCgSk5gyZMsA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:53 GMT", + "ms-cv": "yywgdJuZfkqgeqb0Q6e2vg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:53 GMT", + "ms-cv": "3EShG05PFkGsuGglEQsVuQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:53 GMT", + "ms-cv": "55Tdtkq2wUiWa4p16UTdAQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PATCH", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":5}", + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:54 GMT", + "ms-cv": "9UrMJvu9p0mPqh9CUyxgoA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:54 GMT", + "ms-cv": "ggvwuEZE5UGKjeQlWF0iBw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:04 GMT", + "ms-cv": "vZ/xrA/rjU+SExGNlZYobw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:14 GMT", + "ms-cv": "1dTNA8t9YkGPZc1bLInkYw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:24 GMT", + "ms-cv": "kuUH6hSx60ur3OqtPeipow.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:34 GMT", + "ms-cv": "92Tfm6UegUejmDrW1YDG4g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:44 GMT", + "ms-cv": "sXTqOeh+W0SA/jxbh6ZDLQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:03:55 GMT", + "ms-cv": "VX7+Tb623ECvCSX0no2eDQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:05 GMT", + "ms-cv": "mSZkTQKg1E6AOVwVSGqygg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:15 GMT", + "ms-cv": "JQZmAZoUXE6dz/BQrXNVjw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:25 GMT", + "ms-cv": "Iho1ghUHgUKiG4yKZdbu+Q.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:35 GMT", + "ms-cv": "2tshTTBGpEWrRn4bkEFiDw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:45 GMT", + "ms-cv": "WjbEgopdlUuCpGRaSlFTQQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:04:56 GMT", + "ms-cv": "IcuEkLeo3keNE52d2K2jtQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:06 GMT", + "ms-cv": "roZGogfmxECvI9ip57EOPA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:16 GMT", + "ms-cv": "ptZ+3JV58EyieeLOyJpvFg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:26 GMT", + "ms-cv": "G46c4IBiM0q3gR41Ofnceg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:36 GMT", + "ms-cv": "EX1zvhhm2EyJgAyXvwtoeA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:46 GMT", + "ms-cv": "pkfLZ0kHDkiKEyhKECIhkQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:05:56 GMT", + "ms-cv": "NGGK3T9CaU2FiSTcOTmLXg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:07 GMT", + "ms-cv": "8DRpTLPlgUmzzynj7HRUxg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"arrInspectorPort\":61369,\"handshakePort\":52318,\"elapsedTimeMinutes\":0,\"hostname\":\"1603318822-94b654a4-ac98-49b6-a4b7-d362aac80e82.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "343", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:17 GMT", + "ms-cv": "rQU+O2RWsESmGWeka5LeHA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"sessions\":[{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"arrInspectorPort\":61369,\"handshakePort\":52318,\"elapsedTimeMinutes\":0,\"hostname\":\"1603318822-94b654a4-ac98-49b6-a4b7-d362aac80e82.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}]}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "358", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:17 GMT", + "ms-cv": "ItmvW1Gwx0SDD74OmVT6LQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "sessionId": "sessionId161979137193502926" + }, + "newDate": {} + }, + "hash": "554c161ce53f4f7869f364841849d175" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json new file mode 100644 index 000000000000..14cb6a604959 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json @@ -0,0 +1,48 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "E4zeGZyCGUKoKzKkkrWKfQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122504808396", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output\"}}}", + "status": 403, + "response": "{\"error\":{\"code\":\"DelegatedResourceAccessError\",\"message\":\"Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned. Documentation on how to link Remote Rendering Accounts to storage can be found here: https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts.\"}}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "390", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "T+PTfj+/w02sOtxv+AzD9g.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979122504808396" + }, + "newDate": {} + }, + "hash": "5448f09c89c3f5531d50d3a4a5de8701" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json new file mode 100644 index 000000000000..8882f4b0c1ec --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json @@ -0,0 +1,48 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:19 GMT", + "ms-cv": "PS9kmyHmkE2Tp/PrwQsW1w.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979157852807991", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":-4,\"size\":\"Standard\"}", + "status": 400, + "response": "{\"error\":{\"code\":\"BadRequest\",\"message\":\"The maxLeaseTimeMinutes value cannot be negative.\"}}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "93", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:18 GMT", + "ms-cv": "rh7nOOuilkWXYdZegwmKzQ.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "sessionId": "sessionId161979157852807991" + }, + "newDate": {} + }, + "hash": "4e7adffdfb7597f9d798eeab931c41cb" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json new file mode 100644 index 000000000000..43085ef7d482 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json @@ -0,0 +1,408 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:25 GMT", + "ms-cv": "Npo8/OTjr0iwBq+vtU5AWg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerReadListSas\":\"arr_sas_token\",\"blobPrefix\":\"Input\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerWriteSas\":\"arr_sas_token\",\"blobPrefix\":\"Output\"}}}", + "status": 201, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:25 GMT", + "ms-cv": "dfGa1hAO3kuow0EPp0Hntg.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:26 GMT", + "ms-cv": "Dht9xqItcEeFCaMaW7Ecag.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:26 GMT", + "ms-cv": "nKuoCkQTwkWt7d7nV2oaNg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:27 GMT", + "ms-cv": "vxm/zCt3AUC08zmNtTwNnw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:27 GMT", + "ms-cv": "W7OJK4V4zUWGKsGrtymyxA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:37 GMT", + "ms-cv": "fZsPAka8u0e3hpUluHfBpA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:47 GMT", + "ms-cv": "DGpyWKsEgE66NusR+bgVLg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:58 GMT", + "ms-cv": "OQL//nowdEamEt4CiCKj9w.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:08 GMT", + "ms-cv": "7bYo+TXKe0eLRdg8uIC1+A.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:18 GMT", + "ms-cv": "Un63wOUwhEySNoIV3dusJQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"NotStarted\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:28 GMT", + "ms-cv": "FfXe7zFwak+IJs04eYT7oA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:39 GMT", + "ms-cv": "PMMzeSVg/kKOWYaD1l9AsA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:49 GMT", + "ms-cv": "c9d5189xEkOQ51Xu9tR6VQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:59 GMT", + "ms-cv": "cP0IhFwFTUCrrMNDcUCFLg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:09 GMT", + "ms-cv": "V811OpkkIkCqQXA4KJnnPA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:20 GMT", + "ms-cv": "0By2gZeBSEal7QGr5mTnWQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:30 GMT", + "ms-cv": "KnS6IzzqkEmoqdno2Mjphg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":null,\"status\":\"Running\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:40 GMT", + "ms-cv": "/7fR3lVHtUqp0iXxNrXaSQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Input/\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"blobPrefix\":\"Output/\",\"outputAssetFilename\":\"boxWhichDoesNotExist.arrAsset\"}},\"error\":{\"code\":\"ConversionProcessFailed\",\"message\":\"Invalid input provided. Check logs in output container for details.\"},\"status\":\"Failed\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "561", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:51 GMT", + "ms-cv": "O0/cWQXTJ0yn/Eeg35naPg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979122585102248" + }, + "newDate": {} + }, + "hash": "4efe19ec8e60c3195f7266f8389d63c8" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js index 083574437c56..282e8335821d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js @@ -2,14 +2,14 @@ let nock = require('nock'); module.exports.hash = "15351b68172a2a7defdf4f33342ade03"; -module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960623149001403"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979083179608548"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Fri, 30 Apr 2021 13:53:52 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -19,59 +19,39 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - 'sMIjBEIxQkuNoL+AC6a+Ag.0', + 'hLKiQk2b6kizt8jQ8JvE4g.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) .query(true) - .reply(201, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ + .reply(201, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Fri, 30 Apr 2021 13:53:53 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '429', + '428', 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'NqExo3SFkECPxQTW5rftUQ.0', + 'DDi+ubROTEu0aE1SNhJD3A.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:13 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'mBBjVxvwaEOCVKyqVQoS/g.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:13 GMT', + 'Fri, 30 Apr 2021 13:53:53 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '429', + '428', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -79,41 +59,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'n7LmyGxolkO03JpsMgEJcw.0', + 'MvGf6F9Nz0m4i15pE1M+wQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:14 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '9daUQGXPuU6B0FpF9o1BEw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:14 GMT', + 'Fri, 30 Apr 2021 13:53:53 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '428', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -121,41 +81,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '1y69Dkle6kyUOxLuoGMuiQ.0', + 'jgxsOMIX1kix9UpTTpQ7IQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:14 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'cLzFbZD4d0GwaiZt51lspA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:15 GMT', + 'Fri, 30 Apr 2021 13:53:53 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '428', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -163,41 +103,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'oVCsYwZnLEeJm+doT9YUnw.0', + 'Xg0RBqUtaEeSeI/LC49TIw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:25 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'lvI063DC2E6O7EuwhRNCTw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:25 GMT', + 'Fri, 30 Apr 2021 13:54:03 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '425', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -205,41 +125,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '8l43gSrD20e1+FbWgDC7aQ.0', + 'Gn3enW/73EyOxMcoUWPaIw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:36 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'XyIhpZYH00qQpFphz+RtWQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:36 GMT', + 'Fri, 30 Apr 2021 13:54:14 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '425', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -247,41 +147,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'qBoSp1klt0i9739hKDMvAA.0', + 'xS7ApSxOCUK/Q6PDoVDisg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:47 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'SjnkbnduTkeD14VKfEemWA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:48 GMT', + 'Fri, 30 Apr 2021 13:54:24 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '425', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -289,41 +169,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '8KmpjfQ7MUi2vx0F6ZwaRA.0', + 'EniRq3UL00WusW1BElYY4w.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:37:58 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'dewSylb9cUerWcV9mtNNOg.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:37:59 GMT', + 'Fri, 30 Apr 2021 13:54:34 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '426', + '425', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -331,41 +191,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'vzNqfdfwpU+o6xczQ4bxyA.0', + 'ycUTD3OImUitbOwJ9Nb++Q.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:09 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'slQLanQn8UeKxcLLfPLfRA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960623149001403') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:09 GMT', + 'Fri, 30 Apr 2021 13:54:44 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '525', + '425', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -373,45 +213,47 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '7D2WxTPJ2UiZ6XXosIrAUw.0', + 'heKLRAtPw0u1YXF2YNWs9Q.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') .query(true) - .reply(200, {"AccessToken":""}, [ + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:09 GMT', + 'Fri, 30 Apr 2021 13:54:55 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '1219', + '524', 'Cache-Control', 'no-store,no-cache', 'Pragma', 'no-cache', - 'MS-CV', - 'wxrETwgSpUGjPs+5Trdi8A.0', 'X-Content-Type-Options', - 'nosniff' + 'nosniff', + 'MS-CV', + '/znX+vvagUqPszc5AZNohg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/accounts/00000000-1111-2222-3333-444455556666/conversions') .query(true) - .reply(200, {"conversions":[{"id":"conversionId161953782173201356","creationTime":"2021-04-27T15:37:02.4170052Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161953867312805204","creationTime":"2021-04-27T15:51:12.8757221Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161959842804702186","creationTime":"2021-04-28T08:27:10.0095407Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959937948300631","creationTime":"2021-04-28T08:43:00.0756524Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161959980529100367","creationTime":"2021-04-28T08:50:06.6275053Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959988466101111","creationTime":"2021-04-28T08:51:26.204359Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161959995214407550","creationTime":"2021-04-28T08:52:32.6961017Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161960363691906183","creationTime":"2021-04-28T09:53:59.196695Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161960454825009485","creationTime":"2021-04-28T10:09:08.7915038Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161960623149001403","creationTime":"2021-04-28T10:37:13.7693394Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}],"@nextLink":null}, [ + .reply(200, {"conversions":[{"id":"9456e78f-4e86-45d5-9a3a-42f32d98ebfa","creationTime":"2021-04-30T09:42:54.4006831Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"4bd0faf2-7279-4351-8255-ff7b1852aa77","creationTime":"2021-04-30T11:04:28.3608266Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"5853b38a-a174-44e4-9018-7c324e2d2ba7","creationTime":"2021-04-30T11:17:01.4900529Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"9e063aff-0aeb-4ca5-8796-b708680fcf32","creationTime":"2021-04-30T11:25:43.4274107Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161978216546004121","creationTime":"2021-04-30T11:29:27.2323156Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161978242766201357","creationTime":"2021-04-30T11:33:47.8966192Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"conversionId161978289255208378","creationTime":"2021-04-30T11:41:35.9073281Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161978296301000875","creationTime":"2021-04-30T11:42:43.2118581Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"},{"id":"a6faf3bc-3c10-4ce3-9548-545da9ef2423","creationTime":"2021-04-30T11:49:50.4940039Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"b57d6ad3-0077-478b-967a-0219a0fab5cc","creationTime":"2021-04-30T13:12:21.8193622Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"},{"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"testBox.arrAsset"}},"output":{"outputAssetUri":"https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset"},"error":null,"status":"Succeeded"}],"@nextLink":null}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Fri, 30 Apr 2021 13:54:55 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '5436', + '5927', 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'FMGP1RQzPUm3XLXwAnbufA.0', + '/Vs8TjEAAEagOBhmF6bWuA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js index 94a950ff4c37..b7beedf47da6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js @@ -2,14 +2,14 @@ let nock = require('nock'); module.exports.hash = "59dc56d581f29cf0fcaa83f3b65df716"; -module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161960634870200973"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161979097167408229"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Fri, 30 Apr 2021 13:56:11 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -19,17 +19,17 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - '0HNricFcN0mBR8qt0DfvRA.0', + 'vXR/gAFVj02ORvDecWA1FA.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973', {"maxLeaseTimeMinutes":4,"size":"Standard"}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229', {"maxLeaseTimeMinutes":4,"size":"Standard"}) .query(true) - .reply(201, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(201, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Fri, 30 Apr 2021 13:56:11 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -37,37 +37,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'bNMYIJpcvEaJHznIfC4I1w.0', + '0sI8DtToI0K+iOWs5vFajA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:08 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'z0E4tmQtFk6fg/ceiVsOsw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Fri, 30 Apr 2021 13:56:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -79,37 +59,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'VRFndlqqQUyB6b1zDM/neQ.0', + 'pBVIYG5o2kidN3qUEKjMdA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'mMavso41oUmrALx9NfEOGA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Fri, 30 Apr 2021 13:56:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -121,37 +81,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '1OLjz3EDRE659gPwBo9z3Q.0', + 'cm887N/goky3n0shVEumPg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'kTKkmxjSwkChZOMZJY5nFA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Fri, 30 Apr 2021 13:56:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -163,37 +103,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '/Cj+4uTOT0C1a9ZHjjQj2g.0', + '9eCbKHNDw0ODTsGTjfT8Fg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'MBAl6XcVBkSu3a1fNF5mZw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973', {"maxLeaseTimeMinutes":5}) + .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229', {"maxLeaseTimeMinutes":5}) .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', + 'Fri, 30 Apr 2021 13:56:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -201,37 +121,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '5N2u8Avq5E+xNBfBXEtqgQ.0', + 'HibzctpnSE+3PMK3cQzPHA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:09 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'dY3OY3LMCk6wfNYRYghS/A.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:10 GMT', + 'Fri, 30 Apr 2021 13:56:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -243,37 +143,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '1KywaNI/pkOmYn79vk/Ujw.0', + 'KeuayG8Q7km9hv8NKKqSGQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:20 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'qFX0fKkLgkGmN40SHj4KSg.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:20 GMT', + 'Fri, 30 Apr 2021 13:56:22 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -285,79 +165,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'ffGufshopkekbfw3jeGqPg.0', + 'I04dzdcILk2wrE/+841t/A.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:32 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'cmszS+8Lnk6LhcSq8vzsAA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - -nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') - .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:31 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '172', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'X-Content-Type-Options', - 'nosniff', - 'MS-CV', - 'jKjnP6bA1kOpiXqnpO5wMw.0', - 'api-supported-versions', - '2021-01-01-preview, 2021-01-01' -]); - -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:41 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'AjDB0LiqL0Kn8QuOP73XFw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:42 GMT', + 'Fri, 30 Apr 2021 13:56:32 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -369,37 +187,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '3MsE1bDJ/0OMC2xsjSLRWw.0', + 'CzrrJMSJrEuQgXpvdB3H9w.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:39:52 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '6lfBoYml4UeWZZhgz+zlTQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:52 GMT', + 'Fri, 30 Apr 2021 13:56:42 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -411,37 +209,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'P1nza97nA0+AuemQLlTW5w.0', + 'MmX2Wdvzd0GwcE1xlfg16Q.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:02 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'AnMGxC8SE02A+9nIlP3gLQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:03 GMT', + 'Fri, 30 Apr 2021 13:56:53 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -453,37 +231,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'qlgPtHFBZ02gwzuRDkaOQA.0', + 'V8wX2OCmlkq61l4dGnaGEQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:13 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'yXYzagcjSkCqsh9wLlSByg.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:13 GMT', + 'Fri, 30 Apr 2021 13:57:03 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -495,37 +253,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'X3jw4CIv4U+jLDiqdzPOpg.0', + 'McmptrshR06TAyCt1mr+/Q.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:23 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'tuHPLhBdy0mKqBNDSMmOzQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:23 GMT', + 'Fri, 30 Apr 2021 13:57:13 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -537,37 +275,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '48oQVxk2t0GZstRjOC5aHA.0', + 'EnOURUR6pEu0RIuabY91Sw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:34 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'S9BG1kHye0KelAAfT0Sjmw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:34 GMT', + 'Fri, 30 Apr 2021 13:57:23 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -579,37 +297,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'RiHcz2cIQUOtONarIR1cBQ.0', + 'gyTS5Ci1e0Gz1j8YqFQchA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:45 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'Q1NSg+1hbkmui3Gl8cZd9Q.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:45 GMT', + 'Fri, 30 Apr 2021 13:57:33 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -621,37 +319,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'Nxqkc0FRs0SSNEkSiS+M4g.0', + 'j122CmvbpEmpZcEBAp1asg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:40:55 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'c2zl70gl9k6Vht05HsP2EQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:40:55 GMT', + 'Fri, 30 Apr 2021 13:57:44 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -663,37 +341,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'FNdrLjB2ZUOS+712pfwJmw.0', + '+lJt+RuQF0i65rRTQNlShg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:05 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'KI3nlxN9zk+Pw9paaE2nLQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:06 GMT', + 'Fri, 30 Apr 2021 13:57:54 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -705,37 +363,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'Py1AnPSHgkyuC9x7gIv8cA.0', + 'XI1f1ryJ5UKvvAqnJ//okw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:16 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'Q7FJoZ8e2UmBk9P2cq0+2w.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:16 GMT', + 'Fri, 30 Apr 2021 13:58:04 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -747,37 +385,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'I7Bh9vx7S0G9NKOGieEC+A.0', + 'AaTesu8qT0qVnYkcBXpoQQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:26 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'MIM+kITHI0CB06qDveZMJA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:27 GMT', + 'Fri, 30 Apr 2021 13:58:14 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -789,37 +407,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'Y1PovyU4skSybXgqjxH/Qw.0', + '6fLDKLNGnkSvW8lP2wILjQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:37 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'Rc07CtRwdkKzEoVumYPihA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:38 GMT', + 'Fri, 30 Apr 2021 13:58:24 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -831,37 +429,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '3Vw66D+c+EWNxFPNYjb8TQ.0', + 'TLj9CZlbIUW0qtDsY18bqw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:48 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'FRhL3GnjM026tWqGg2Ka1A.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:48 GMT', + 'Fri, 30 Apr 2021 13:58:34 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -873,37 +451,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'rOI3qCR/6Uulp0UpgShlrQ.0', + '2jZqrGc6rUKajHlz5wHFSQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:41:58 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'FGbOX+N6FEGjc4MyG+KdIg.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:41:58 GMT', + 'Fri, 30 Apr 2021 13:58:44 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -915,37 +473,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'WBwm3rihjUO3MOCcvTk6vA.0', + 'tdsHPjSeRUSh7mJPUKQNaw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:42:10 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'slM//czSNEiyqufTltNetg.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Wed, 28 Apr 2021 10:42:09 GMT', + 'Fri, 30 Apr 2021 13:58:55 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -957,41 +495,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'WGOyJgPH7UiiMgkc2s939A.0', + 'pCQaLUZNU0yC2EbDmHsJGA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:42:19 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '+caM1WBCo0WhHPTQHsXpXw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') .query(true) - .reply(200, {"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","arrInspectorPort":57393,"handshakePort":49770,"elapsedTimeMinutes":0,"hostname":"806975667-fbc19898-ff01-4e25-8abe-1deebfd58103.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ + .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","arrInspectorPort":56477,"handshakePort":59875,"elapsedTimeMinutes":0,"hostname":"1603318822-ad45142f-ccc1-4a0d-ad63-760f0b6ec7c7.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ 'Date', - 'Wed, 28 Apr 2021 10:42:20 GMT', + 'Fri, 30 Apr 2021 13:59:05 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '342', + '343', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -999,41 +517,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'o3+RJDqFA0qPPdMvGr6UgQ.0', + 'ECmH8fcKT0O0dS1Yl1tQVA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:42:20 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '5mPb45NfJU6iopszgPkKDw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/accounts/00000000-1111-2222-3333-444455556666/sessions') .query(true) - .reply(200, {"sessions":[{"id":"sessionId161960634870200973","creationTime":"2021-04-28T10:39:09.3267695+00:00","arrInspectorPort":57393,"handshakePort":49770,"elapsedTimeMinutes":0,"hostname":"806975667-fbc19898-ff01-4e25-8abe-1deebfd58103.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ + .reply(200, {"sessions":[{"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","arrInspectorPort":56477,"handshakePort":59875,"elapsedTimeMinutes":0,"hostname":"1603318822-ad45142f-ccc1-4a0d-ad63-760f0b6ec7c7.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ 'Date', - 'Wed, 28 Apr 2021 10:42:20 GMT', + 'Fri, 30 Apr 2021 13:59:05 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '357', + '358', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -1041,7 +539,7 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'RUQ+N7JpM0GIATpneHX8pw.0', + '9NDXIt6xG0mjXnmNnqvNRw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js index 52b9081ff209..da8c25d51525 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js @@ -2,14 +2,14 @@ let nock = require('nock'); module.exports.hash = "4482e74cdede34465d36732c60dae28f"; -module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960629055603158"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979089668904294"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Fri, 30 Apr 2021 13:54:56 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -19,17 +19,17 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - 'VOK57jg9CEupMb/KJEC4Lw.0', + '6jeOh+NNn0e+G1+Br9J+Fw.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629055603158', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output"}}}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089668904294', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output"}}}) .query(true) .reply(403, {"error":{"code":"DelegatedResourceAccessError","message":"Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned. Documentation on how to link Remote Rendering Accounts to storage can be found here: https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts."}}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Fri, 30 Apr 2021 13:54:57 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -37,7 +37,7 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'WDbBqgOgfkuxLOq9v2Fm1A.0', + 'r8XnpG1A40uqRYi4xrhhZg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js index dc649220068b..a268d15b6fac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js @@ -2,28 +2,14 @@ let nock = require('nock'); module.exports.hash = "acef1917e9635185f91a50bd8cf382ef"; -module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161960654135800182"},"newDate":{}} - -nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .post('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960634870200973/:stop') - .query(true) - .reply(204, "", [ - 'Date', - 'Wed, 28 Apr 2021 10:42:21 GMT', - 'X-Content-Type-Options', - 'nosniff', - 'MS-CV', - 'A0gcQVT0R0+Pbh9xuXFZvQ.0', - 'api-supported-versions', - '2021-01-01-preview, 2021-01-01' -]); +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161979114585506877"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Wed, 28 Apr 2021 10:42:21 GMT', + 'Fri, 30 Apr 2021 13:59:05 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -33,17 +19,17 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - '57zI/Ts+iE6hhCpqbdzpxw.0', + 'EYS/fr9qGECyJWUZ+i/4aw.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161960654135800182', {"maxLeaseTimeMinutes":-4,"size":"Standard"}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979114585506877', {"maxLeaseTimeMinutes":-4,"size":"Standard"}) .query(true) .reply(400, {"error":{"code":"BadRequest","message":"The maxLeaseTimeMinutes value cannot be negative."}}, [ 'Date', - 'Wed, 28 Apr 2021 10:42:21 GMT', + 'Fri, 30 Apr 2021 13:59:06 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -51,7 +37,7 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'a9opucZKg0O3VdjuvuGnGg.0', + 'yWZb5GN80UC+N/AhYPyjpg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js index d105827e8407..e74d35e22ba0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js @@ -2,14 +2,14 @@ let nock = require('nock'); module.exports.hash = "98eb3da984f30ffa04babd4ee34a4e41"; -module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161960629129403049"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979089851105096"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:10 GMT', + 'Fri, 30 Apr 2021 13:54:58 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -19,59 +19,39 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - 'CUAahpgsQkW0gvYD7enulA.0', + 'QYkqnFqHRECeTNx0003F0A.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) .query(true) - .reply(201, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ + .reply(201, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Fri, 30 Apr 2021 13:54:57 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '455', + '454', 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'Cu9b4mTzLUm/B9TqFcIV2w.0', + '/Vo8M/0qokSNbs7XzDXwvQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:11 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '4YR03J+nDEur3aQOFKZT+g.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:11 GMT', + 'Fri, 30 Apr 2021 13:54:57 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '455', + '454', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -79,41 +59,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '/PriHG+FAEW1VhNesCapIg.0', + 'CsLrtMoPvEihGk7pSjwWpw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:11 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'KHbP5XiHVk2cVKsGq5wjcQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:12 GMT', + 'Fri, 30 Apr 2021 13:54:58 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '454', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -121,41 +81,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'XKIDIlGqoEuogvU+ex82ug.0', + '83qR9O3Dk0epgo4n6E6ETg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:13 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'Pl7/meGxIkGZ92+Aqxw0yQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:13 GMT', + 'Fri, 30 Apr 2021 13:54:58 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '454', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -163,41 +103,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'BBn01/e+y0eTVUwCVlnJOw.0', + 'B7097SyzHEGVc2Zj6pdH9Q.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:13 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'viq7301h4U2f9J5BBamCyA.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"NotStarted"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:14 GMT', + 'Fri, 30 Apr 2021 13:54:58 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '454', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -205,41 +125,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'a7RUDbOg3EyTTWqaP37vcg.0', + 'glzsHqrWY0GXQel1fPnPUQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:24 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'HNKDqzAtfkWvV/UCZVcR4w.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:24 GMT', + 'Fri, 30 Apr 2021 13:55:08 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -247,41 +147,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'UgbrTwr7Ck2O30l5sj5Tpw.0', + 'TnUNzUuA9EW3YFIMBPkRuQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:34 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - '3urenTWNWkyo6YfBU9dFjQ.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:35 GMT', + 'Fri, 30 Apr 2021 13:55:18 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -289,41 +169,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'hKzPFvr5iEiNfecCKOIJcQ.0', + '3TsdGsK1J06wF8i4u8x+YA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') - .query(true) - .reply(200, {"AccessToken":""}, [ - 'Date', - 'Wed, 28 Apr 2021 10:38:45 GMT', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1219', - 'Cache-Control', - 'no-store,no-cache', - 'Pragma', - 'no-cache', - 'MS-CV', - 'r8KC+dNPzUmpJbQtEcTaXw.0', - 'X-Content-Type-Options', - 'nosniff' -]); - nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:46 GMT', + 'Fri, 30 Apr 2021 13:55:29 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -331,41 +191,43 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'BuMR11/QZ0qJ3noqrPRV5Q.0', + 'FhW+XJwwakiC52FVnK0M5A.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"AccessToken":""}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:56 GMT', + 'Fri, 30 Apr 2021 13:55:39 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '1219', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', 'no-cache', - 'MS-CV', - 'mqTZa+tJTEa1/Hv9q02iHw.0', 'X-Content-Type-Options', - 'nosniff' + 'nosniff', + 'MS-CV', + 'jSJRlFZg6U+rqICAFgUrdQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:38:56 GMT', + 'Fri, 30 Apr 2021 13:55:49 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '452', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -373,41 +235,43 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'S+aGkLh+m0Gk6YUJrNh1pg.0', + 'PPde9mNykkakSIxPxKMgYg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); -nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/Accounts/00000000-1111-2222-3333-444455556666/token') +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"AccessToken":""}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":null,"status":"Running"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Fri, 30 Apr 2021 13:56:00 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '1219', + '451', 'Cache-Control', 'no-store,no-cache', 'Pragma', 'no-cache', - 'MS-CV', - 'oGfPBRZ240md8qScIwTkdg.0', 'X-Content-Type-Options', - 'nosniff' + 'nosniff', + 'MS-CV', + 'mPT+16K3g0K7DDCawJTCpA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161960629129403049') + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') .query(true) - .reply(200, {"id":"conversionId161960629129403049","creationTime":"2021-04-28T10:38:11.8074584Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"}, [ + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Input/","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","blobPrefix":"Output/","outputAssetFilename":"boxWhichDoesNotExist.arrAsset"}},"error":{"code":"ConversionProcessFailed","message":"Invalid input provided. Check logs in output container for details."},"status":"Failed"}, [ 'Date', - 'Wed, 28 Apr 2021 10:39:08 GMT', + 'Fri, 30 Apr 2021 13:56:10 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', - '561', + '560', 'Cache-Control', 'no-store,no-cache', 'Pragma', @@ -415,7 +279,7 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'E4A/KJEO2kGwZ9bz+AcIsA.0', + 'xnmxgHrsRUW0RnQ2tYczRg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); From 615dc0d0a9dd509aea6d5a243587fc43fca5d185 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 30 Apr 2021 11:58:39 +0100 Subject: [PATCH 094/166] Sample and readme improvements --- .../mixedreality-remoterendering/README.md | 330 +++++++++++++++++- .../samples-dev/listConversions.ts | 2 +- .../samples-dev/moreComplexConversion.ts | 84 +++++ .../samples-dev/session.ts | 6 +- .../{conversion.ts => simpleConversion.ts} | 17 +- .../test/public/remoteRenderingClient.spec.ts | 2 +- 6 files changed, 406 insertions(+), 35 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts rename sdk/remoterendering/mixedreality-remoterendering/samples-dev/{conversion.ts => simpleConversion.ts} (86%) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 266c1c7075af..e02acffc7ce9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -1,8 +1,16 @@ -# Azure Template client library for JavaScript +# Azure Remote Rendering client library for JavaScript - +Azure Remote Rendering (ARR) is a service that enables you to render high-quality, interactive 3D content in the cloud and stream it in real time to devices, such as the HoloLens 2. -This project is used as a template package for the Azure SDK for JavaScript. It is intended to help Azure SDK developers bootstrap new packages, and it provides an example of how to organize the code and documentation of a client library for an Azure service. +This SDK offers functionality to convert assets to the format expected by the runtime, and also to manage +the lifetime of remote rendering sessions. + +> NOTE: Once a session is running, a client application will connect to it using one of the "runtime SDKs". +> These SDKs are designed to best support the needs of an interactive application doing 3d rendering. +> They are available in ([.net](https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering) +> or ([C++](https://docs.microsoft.com/cpp/api/remote-rendering/)). + +[Product documentation](https://docs.microsoft.com/azure/remote-rendering/) ## Getting started @@ -12,16 +20,14 @@ This project is used as a template package for the Azure SDK for JavaScript. It ### Prerequisites -- An [Azure subscription][azure_sub]. - -Usually you'd put a shell command for provisioning the necessary Azure services here. +You will need an [Azure subscription](https://azure.microsoft.com/free/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. ### Install the `@azure/template` package Install the Template client library for JavaScript with `npm`: ```bash -npm install @azure/template +npm install @azure/remoterendering ``` ### Browser support @@ -30,15 +36,15 @@ npm install @azure/template 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). -#### CORS You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). @@ -49,28 +55,314 @@ For example, you can create the following CORS settings for debugging. But pleas - Allowed headers: \* - Exposed headers: \* - Maximum age (seconds): 86400 +--> -### Further examples +### Authenticate the client -Top-level examples usually include things like creating and authenticating the main Client. If your service supports multiple means of authenticating (e.g. key-based and Azure Active Directory) you can give a separate example of each. +Constructing a remote rendering client requires an authenticated account, and a remote rendering endpoint. +For an account created in the eastus region, the account domain will have the form "eastus.mixedreality.azure.com". +There are several different forms of authentication: -## Key concepts +- Account Key authentication + - Account keys enable you to get started quickly with using Azure Remote Rendering. But before you deploy your application + to production, we recommend that you update your app to use Azure AD authentication. +- Azure Active Directory (AD) token authentication + - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use + user-based Azure AD authentication in your app. You then grant access to your Azure Remote Rendering accounts by using + your existing Azure AD security groups. You can also grant access directly to users in your organization. + - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this + method for production applications because it allows you to avoid embedding the credentials for access to Azure Spatial + Anchors in your client application. + +See [here](https://docs.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information. + +In all the following examples, the client is constructed with a `remoteRenderingEndpoint` Uri object. +The available endpoints correspond to regions, and the choice of endpoint determines the region in which the service performs its work. +An example is `https://remoterendering.eastus2.mixedreality.azure.com`. + +> NOTE: For converting assets, it is preferable to pick a region close to the storage containing the assets. + +> NOTE: For rendering, it is strongly recommended that you pick the closest region to the devices using the service. +> The time taken to communicate with the server impacts the quality of the experience. + +#### Authenticating with account key authentication + +Use the `AccountKeyCredential` object to use an account identifier and account key to authenticate: + +```typescript Snippet:CreateAClient +const accountKey = new AzureKeyCredential(accountKey); + +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); +``` + +#### Authenticating with an AAD client secret + +Use the `ClientSecretCredential` object to perform client secret authentication. + + + +#### Authenticating a user using device code authentication + +Use the `DeviceCodeCredential` object to perform device code authentication. + + + +See [here](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow) for more +information about using device code authentication flow. + +#### Interactive authentication with DefaultAzureCredential + +Use the `DefaultAzureCredential` object with `includeInteractiveCredentials: true` to use default interactive authentication +flow: + + + +#### Authenticating with a static access token -### ConfigurationClient +You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the +[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/mixedreality/Azure.MixedReality.Authentication) +to be used with a Mixed Reality client library: -Describe your primary client here. Talk about what operations it can do and when a developer would want to use it. +```typescript Snippet:CreateAClientWithStaticAccessToken +// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves +// a Mixed Reality access token from a web service. The web service would use the +// MixedRealityStsClient and credentials to obtain an access token to be returned +// to the client. +const accessToken = GetMixedRealityAccessTokenFromWebService(); -### Additional Examples +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, accountId, accountDomain, accessToken); +``` + +## Key concepts -Create a section for each top-level service concept you want to explain. +### RemoteRenderingClient + +The `RemoteRenderingClient` is the client library used to access the RemoteRenderingService. +It provides methods to create and manage asset conversions and rendering sessions. ## Examples -### First Example +- [Convert a simple asset](#convert-a-simple-asset) +- [Convert a more complex asset](#convert-a-more-complex-asset) +- [Get the output when an asset conversion has finished](#get-the-output-when-an-asset-conversion-has-finished) +- [List conversions](#list-conversions) +- [Create a session](#create-a-session) +- [Extend the lease time of a session](#extend-the-lease-time-of-a-session) +- [List sessions](#list-sessions) +- [Stop a session](#stop-a-session) + +### Convert a simple asset + +We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#authenticate-the-client) section. +The following snippet describes how to request that "box.fbx", found at the root of the blob container at the given URI, gets converted. + +```typescript Snippet:StartAnAssetConversion + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + relativeInputAssetPath: "box.fbx", + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + // A randomly generated UUID is a good choice for a conversionId. + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); +``` + +The output files will be placed beside the input asset. + +### Convert a more complex asset + +Assets can reference other files, and blob containers can contain files belonging to many different assets. +In this example, we show how prefixes can be used to organize your blobs and how to convert an asset to take account of that organization. +Assume that the blob container at `inputStorageUrl` contains many files, including "Bicycle/bicycle.gltf", "Bicycle/bicycle.bin" and "Bicycle/saddleTexture.jpg". +(So the prefix "Bicycle" is acting very like a folder.) +We want to convert the glTF so that it has access to the other files which share the prefix, without requiring the conversion service to access any other files. +To keep things tidy, we also want the output files to be written to a different storage container and given a common prefix: "ConvertedBicycle". +The code is as follows: + +```typescript Snippet:StartAComplexAssetConversion + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl: inputStorageUrl, + blobPrefix: "Bicycle" + relativeInputAssetPath: "bicycle.gltf" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl: outputStorageUrl, + blobPrefix: "ConvertedBicycle" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); +``` + +> NOTE: when a prefix is given in the input options, then the input file parameter is assumed to be relative to that prefix. +> The same applies to the output file parameter in output options. + +### Get the output when an asset conversion has finished + +Converting an asset can take anywhere from seconds to hours. +This code uses the conversionPoller returned by beginConversion to poll regularly until the conversion has finished or failed. +The default polling period is 10 seconds. + +```typescript Snippet:QueryConversionStatus + const conversion = await conversionPoller.pollUntilDone(); + + console.log("== Check results =="); + + if (conversion.status === "Succeeded") { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } else if (conversion.status === "Failed") { + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); + } +``` + +Note that the state of a AssetConversionPollerLike can be serialized by calling conversionPoller.toString(). +That value can later be passed into beginConversion as a `resumeFrom` value, to construct a new poller +which carries on from where the earlier one left off: + +```typescript + const serializedPollerString = conversionPoller.toString(); + // ... + const resumedPoller = client.beginConversion({ resumeFrom: serializedPollerString }); +``` + +### List conversions + +You can get information about your conversions using the `getConversions` method. +This method may return conversions which have yet to start, conversions which are running and conversions which have finished. +In this example, we just list the output URIs of successful conversions started in the last day. + +```typescript Snippet:ListConversions + for await (const conversion of client.listConversions()) { + if (conversion.status === "Succeeded") { + console.log( + `Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}` + ); + } else if (conversion.status === "Failed") { + console.log( + `Conversion ${conversion.conversionId} failed: ${conversion.error.code} ${conversion.error.message}` + ); + } + } +``` + +### Create a session + +We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#authenticate-the-client) section. +The following snippet describes how to request that a new rendering session be started. - +```typescript Snippet:CreateASession + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, + size: "Standard" + }; -Create several code examples for how someone would use your library to accomplish a common task with the service. + // A randomly generated UUID is a good choice for a conversionId. + const sessionId = uuid(); + + const sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings + ); +``` + +Note that the state of a RenderingSessionPollerLike can be serialized by calling toString(). +That value can later be passed into beginSession as a `resumeFrom` value, to construct a new poller +which carries on from where the earlier one left off: + +```typescript + const serializedPollerString = sessionPoller.toString(); + // ... + const resumedPoller = client.beginSession({ resumeFrom: serializedPollerString }); +``` + +### Extend the lease time of a session + +If a session is approaching its maximum lease time, but you want to keep it alive, you will need to make a call to increase +its maximum lease time. +This example shows how to query the current properties and then extend the lease if it will expire soon. + +> NOTE: The runtime SDKs also offer this functionality, and in many typical scenarios, you would use them to +> extend the session lease. + +```typescript Snippet:UpdateSession + if (currentSession.maxLeaseTimeInMinutes - ((Date.now() - currentSession.createdOn) / 1000 * 60) < 2) + { + TimeSpan newLeaseTime = currentSession.maxLeaseTimeInMinutes + 30; + + const longerLeaseSettings = { maxLeaseTimeInMinutes: newLeaseTime }); + + await client.updateSession(sessionId, longerLeaseSettings); + } +``` + +### List sessions + +You can get information about your sessions using the `getSessions` method. +This method may return sessions which have yet to start and sessions which are ready. + +```typescript Snippet:ListSessions + for await (const session of client.listSessions()) { + if (session.status === "Starting") { + console.log(`Session ${session.sessionId} is starting`); + } else if (session.status === "Ready") { + console.log(`Session ${session.sessionId} is ready`); + } + } +``` + +### Stop a session + +The following code will stop a running session with given id. + +```typescript Snippet:StopSession + client.endSession(sessionId); +``` ## Troubleshooting diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index f04353eb3782..8d7af1d7f3a8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -38,7 +38,7 @@ export async function main() { ); } else if (conversion.status === "Failed") { console.log( - `Conversion ${conversion.conversionId} failed: ${conversion.error?.code} ${conversion.error?.message}` + `Conversion ${conversion.conversionId} failed: ${conversion.error.code} ${conversion.error.message}` ); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts new file mode 100644 index 000000000000..e73489a4b195 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to convert an asset. + */ + +/// + +import { v4 as uuid } from "uuid"; + +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion +} from "@azure/mixedreality-remoterendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = new AzureKeyCredential( + process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" +); +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const storageAccountName = + process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = + process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + + let inputStorageUrl = + "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + let outputStorageUrl = + "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl: inputStorageUrl, + blobPrefix: "Bicycle", + relativeInputAssetPath: "bicycle.gltf" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl: outputStorageUrl, + blobPrefix: "ConvertedBicycle" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + + console.log("== Polling =="); + + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); + + console.log("== Check results =="); + + // Use a string for the enum. + if (conversion.status === "Succeeded") { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } else if (conversion.status === "Failed") { + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index 5f07ac4187a8..82275d6b237b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -36,16 +36,16 @@ export async function main() { const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + console.log("== Starting the session =="); + const sessionSettings: RenderingSessionSettings = { maxLeaseTimeInMinutes: 4, size: "Standard" }; - // A randomly generated GUID is a good choice for a conversionId. + // A randomly generated UUID is a good choice for a conversionId. const sessionId = uuid(); - console.log("== Starting the session =="); - const sessionPoller: RenderingSessionPollerLike = await client.beginSession( sessionId, sessionSettings diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts similarity index 86% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts rename to sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts index def0a1b43b5b..a8babe29135e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/conversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts @@ -46,24 +46,20 @@ export async function main() { let storageContainerUrl = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + console.log("== Starting the conversion =="); + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, - storageContainerReadListSas: sasToken, - relativeInputAssetPath: "testBox.fbx", - blobPrefix: "Input" + relativeInputAssetPath: "box.fbx" }; const outputSettings: AssetConversionOutputSettings = { - storageContainerUrl, - storageContainerWriteSas: sasToken, - blobPrefix: "Output" + storageContainerUrl }; const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; - // A randomly generated GUID is a good choice for a conversionId. + // A randomly generated UUID is a good choice for a conversionId. const conversionId = uuid(); - console.log("== Starting the conversion =="); - const conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, conversionSettings @@ -75,11 +71,10 @@ export async function main() { console.log("== Check results =="); - // Use a string for the enum. if (conversion.status === "Succeeded") { console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); } else if (conversion.status === "Failed") { - console.log("Conversion failed: " + conversion.error?.code + " " + conversion.error?.message); + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 605652397d8f..d5f61206c0c4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -30,7 +30,7 @@ describe("RemoteRenderingClient construction", () => { const accountDomain = "mixedreality.azure.com"; const accountId = "00000000-0000-0000-0000-000000000000"; const accountKey = "00000000-0000-0000-0000-000000000000"; - const serviceEndpoint = "https://sts.mixedreality.azure.com"; + const serviceEndpoint = "https://remoterendering.mixedreality.azure.com"; const keyCredential = new AzureKeyCredential(accountKey); it("can create", () => { From 6757a3de4080e02f9cdf9f48effc7dc49d83be23 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 30 Apr 2021 11:59:13 +0100 Subject: [PATCH 095/166] Formatting --- .../mixedreality-remoterendering/README.md | 117 +++++++++--------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index e02acffc7ce9..51ff16705793 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -36,7 +36,6 @@ npm install @azure/remoterendering 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). - #### Authenticating a user using device code authentication Use the `DeviceCodeCredential` object to perform device code authentication. - See [here](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow) for more information about using device code authentication flow. @@ -141,13 +132,13 @@ information about using device code authentication flow. Use the `DefaultAzureCredential` object with `includeInteractiveCredentials: true` to use default interactive authentication flow: - #### Authenticating with a static access token @@ -330,14 +321,16 @@ This example shows how to query the current properties and then extend the lease > extend the session lease. ```typescript Snippet:UpdateSession - if (currentSession.maxLeaseTimeInMinutes - ((Date.now() - currentSession.createdOn) / 1000 * 60) < 2) + /// When the lease is within 2 minutes of expiring, extend it by 15 minutes. + let currentSession = await client.getSession(sessionId); + if (currentSession.status == "Ready") { + if (currentSession.maxLeaseTimeInMinutes - ((Date.now() - currentSession.properties.createdOn.valueOf()) / 60000) < 2) { - TimeSpan newLeaseTime = currentSession.maxLeaseTimeInMinutes + 30; - - const longerLeaseSettings = { maxLeaseTimeInMinutes: newLeaseTime }); - - await client.updateSession(sessionId, longerLeaseSettings); + let newLeaseTime = currentSession.maxLeaseTimeInMinutes + 15; + + await client.updateSession(sessionId, { maxLeaseTimeInMinutes: newLeaseTime }); } + } ``` ### List sessions @@ -375,9 +368,29 @@ You can set the following environment variable to see debug logs when using this export DEBUG=azure* ``` +### Azure Remote Rendering troubleshooting + +For general troubleshooting advice concerning Azure Remote Rendering, see [the Troubleshoot page](https://docs.microsoft.com/azure/remote-rendering/resources/troubleshoot) for remote rendering at docs.microsoft.com. + +The client methods will throw exceptions if the request cannot be made. +However, in the case of both conversions and sessions, the requests can succeed but the requested operation may not be successful. +In this case, no exception will be thrown, but the returned objects can be inspected to understand what happened. + +If the asset in a conversion is invalid, the conversion operation will return an AssetConversion object +with a Failed status and carrying a RemoteRenderingServiceError with details. +Once the conversion service is able to process the file, a <assetName>.result.json file will be written to the output container. +If the input asset is invalid, then that file will contain a more detailed description of the problem. + +Similarly, sometimes when a session is requested, the session ends up in an error state. +The startSessionOperation method will return a RenderingSession object, but that object will have an Error status and carry a +RemoteRenderingServiceError with details. + ## Next steps -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/samples) directory for detailed examples that demonstrate how to use the client libraries. +- Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/) +- Learn about the runtime SDKs: + - .NET: https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering + - C++: https://docs.microsoft.com/cpp/api/remote-rendering/ ## Contributing diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts index 8d7af1d7f3a8..9c36fdc8317a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts @@ -17,9 +17,7 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" -); +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; export async function main() { @@ -27,7 +25,9 @@ export async function main() { console.log("== Creating a client =="); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); console.log("== Starting listing conversions =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index 42c6194980e6..fd5892f32903 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -20,9 +20,7 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" -); +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; export async function main() { @@ -30,7 +28,9 @@ export async function main() { console.log("== Creating a client =="); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); console.log("== Creating a test session to query =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts index 4fd33c03d639..8c84e1c35790 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -17,6 +17,13 @@ import { AssetConversionPollerLike, AssetConversion } from "@azure/mixedreality-remoterendering"; +import { + DeviceCodeCredential, + DeviceCodeInfo, + ClientSecretCredential, + TokenCredential, + DefaultAzureCredential +} from "@azure/identity" import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists @@ -26,9 +33,8 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" -); +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; + const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; const storageAccountName = process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; @@ -41,12 +47,56 @@ const storageAccountName2 = const blobContainerName2 = process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME2"] || blobContainerName; +const tenantId = process.env["REMOTERENDERING_TENANT_ID"] || ""; +const clientId = process.env["REMOTERENDERING_CLIENT_ID"] || ""; +const clientSecret = process.env["REMOTERENDERING_CLIENT_SECRET"] || ""; + +function getClientWithAccountKey() { + let credential = new AzureKeyCredential(accountKey); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +} + +function getClientWithAAD() { + let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { + authorityHost: "https://login.microsoftonline.com/" + tenantId + }); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" + }); +} + +function getClientWithDeviceCode() { + let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { + console.debug(deviceCodeInfo.message); + console.log(deviceCodeInfo.message); + }; + + let credential: TokenCredential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, + { + authorityHost: "https://login.microsoftonline.com/" + tenantId + }); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com/mixedreality.signin" + }); +} + +function getClientWithDefaultAzureCredential() { + let credential: TokenCredential = new DefaultAzureCredential(); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" + }); +} + export async function main() { - console.log("== Convert an asset example =="); + console.log("== Convert a more complex asset example =="); console.log("== Creating a client =="); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + const client = getClientWithAccountKey(); let inputStorageUrl = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts index 82275d6b237b..4dab88990634 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts @@ -24,9 +24,8 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" -); +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; + const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; export async function main() { @@ -34,7 +33,9 @@ export async function main() { console.log("== Creating a client =="); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); console.log("== Starting the session =="); diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts index 646763ae1046..c2c604d58fab 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts @@ -26,9 +26,7 @@ dotenv.config(); // You will need to set this environment variables or edit the following values const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; -const accountKey = new AzureKeyCredential( - process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || "" -); +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; const storageAccountName = process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; @@ -40,7 +38,9 @@ export async function main() { console.log("== Creating a client =="); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, accountKey); + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); let storageContainerUrl = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; From 8b6fdffb904045d3250922b9ebd5bd324f9ad7ec Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 6 May 2021 10:42:26 +0100 Subject: [PATCH 101/166] Formatting --- .../mixedreality-remoterendering/README.md | 58 ++++++++++--------- .../samples-dev/moreComplexConversion.ts | 16 +++-- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 67f3749a79e0..76bbfed3fc3c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -99,11 +99,11 @@ const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDoma Use the `ClientSecretCredential` object to perform client secret authentication. ```typescript Snippet:CreateAClientWithAAD - let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { - authorityHost: "https://login.microsoftonline.com/" + tenantId - }); +let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { + authorityHost: "https://login.microsoftonline.com/" + tenantId +}); - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); ``` #### Authenticating a user using device code authentication @@ -111,17 +111,16 @@ Use the `ClientSecretCredential` object to perform client secret authentication. Use the `DeviceCodeCredential` object to perform device code authentication. ```typescript Snippet:CreateAClientWithDeviceCode - let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { - console.debug(deviceCodeInfo.message); - console.log(deviceCodeInfo.message); - }; - - let credential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, - { - authorityHost: "https://login.microsoftonline.com/" + tenantId - }); - - const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { + console.debug(deviceCodeInfo.message); + console.log(deviceCodeInfo.message); +}; + +let credential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, { + authorityHost: "https://login.microsoftonline.com/" + tenantId +}); + +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); ``` See [here](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow) for more @@ -133,11 +132,11 @@ Use the `DefaultAzureCredential` object with `includeInteractiveCredentials: tru flow: ```typescript Snippet:CreateAClientWithAzureCredential - let credential = new DefaultAzureCredential(); +let credential = new DefaultAzureCredential(); - return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { - authenticationEndpointUrl: "https://sts.mixedreality.azure.com" - }); +return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" +}); ``` #### Authenticating with a static access token @@ -321,16 +320,19 @@ This example shows how to query the current properties and then extend the lease > extend the session lease. ```typescript Snippet:UpdateSession - /// When the lease is within 2 minutes of expiring, extend it by 15 minutes. - let currentSession = await client.getSession(sessionId); - if (currentSession.status == "Ready") { - if (currentSession.maxLeaseTimeInMinutes - ((Date.now() - currentSession.properties.createdOn.valueOf()) / 60000) < 2) - { - let newLeaseTime = currentSession.maxLeaseTimeInMinutes + 15; - - await client.updateSession(sessionId, { maxLeaseTimeInMinutes: newLeaseTime }); - } +/// When the lease is within 2 minutes of expiring, extend it by 15 minutes. +let currentSession = await client.getSession(sessionId); +if (currentSession.status == "Ready") { + if ( + currentSession.maxLeaseTimeInMinutes - + (Date.now() - currentSession.properties.createdOn.valueOf()) / 60000 < + 2 + ) { + let newLeaseTime = currentSession.maxLeaseTimeInMinutes + 15; + + await client.updateSession(sessionId, { maxLeaseTimeInMinutes: newLeaseTime }); } +} ``` ### List sessions diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts index 8c84e1c35790..a1fe94c9c590 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -23,7 +23,7 @@ import { ClientSecretCredential, TokenCredential, DefaultAzureCredential -} from "@azure/identity" +} from "@azure/identity"; import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists @@ -72,11 +72,15 @@ function getClientWithDeviceCode() { console.debug(deviceCodeInfo.message); console.log(deviceCodeInfo.message); }; - - let credential: TokenCredential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, - { - authorityHost: "https://login.microsoftonline.com/" + tenantId - }); + + let credential: TokenCredential = new DeviceCodeCredential( + tenantId, + clientId, + deviceCodeCallback, + { + authorityHost: "https://login.microsoftonline.com/" + tenantId + } + ); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { authenticationEndpointUrl: "https://sts.mixedreality.azure.com/mixedreality.signin" From 75ff64fe8c3294ceb6e85c51155e186549d50b61 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 6 May 2021 17:11:31 +0100 Subject: [PATCH 102/166] Update pnpm-lock file --- .../samples-dev/moreComplexConversion.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts index a1fe94c9c590..b02f87fe23a1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -51,13 +51,13 @@ const tenantId = process.env["REMOTERENDERING_TENANT_ID"] || ""; const clientId = process.env["REMOTERENDERING_CLIENT_ID"] || ""; const clientSecret = process.env["REMOTERENDERING_CLIENT_SECRET"] || ""; -function getClientWithAccountKey() { +export function getClientWithAccountKey() { let credential = new AzureKeyCredential(accountKey); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); } -function getClientWithAAD() { +export function getClientWithAAD() { let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { authorityHost: "https://login.microsoftonline.com/" + tenantId }); @@ -67,7 +67,7 @@ function getClientWithAAD() { }); } -function getClientWithDeviceCode() { +export function getClientWithDeviceCode() { let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { console.debug(deviceCodeInfo.message); console.log(deviceCodeInfo.message); @@ -87,7 +87,7 @@ function getClientWithDeviceCode() { }); } -function getClientWithDefaultAzureCredential() { +export function getClientWithDefaultAzureCredential() { let credential: TokenCredential = new DefaultAzureCredential(); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { From 52c4cda68959906c5088db2184b9adfdf79546b6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 6 May 2021 17:29:49 +0100 Subject: [PATCH 103/166] Remove README-EXAMPLE.md --- .../README-EXAMPLE.md | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md diff --git a/sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md b/sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md deleted file mode 100644 index f22df945d438..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/README-EXAMPLE.md +++ /dev/null @@ -1,188 +0,0 @@ -# App Configuration client library for JavaScript - - - -[Azure App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/overview) is a managed service that helps developers centralize their application and feature settings simply and securely. - -Use the client library for App Configuration to: - -- Create flexible key representations and mappings -- Tag keys with labels -- Replay settings from any point in time - -[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/appconfiguration/app-configuration/) | -[Package (NPM)](https://www.npmjs.com/package/@azure/app-configuration) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/app-configuration) | -[Product documentation](https://docs.microsoft.com/azure/azure-app-configuration/) | -[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples) - -## Getting started - -### Install the package - -```bash -npm install @azure/app-configuration -``` - -### Prerequisites - -- You must have an [Azure Subscription](https://azure.microsoft.com) and an [App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/) resource to use this package. -- Node.js version 8.x.x or higher - -### Create an App Configuration resource - -You can use the [Azure Portal](https://portal.azure.com) or the [Azure CLI](https://docs.microsoft.com/cli/azure) to create an Azure App Configuration resource. - -Example (Azure CLI): - -``` -az appconfig create --name --resource-group --location eastus -``` - -### Authenticate the client - -AppConfigurationClient can authenticate using a [service principal](#authenticating-with-a-service-principal) or using a [connection string](#authenticating-with-a-connection-string). - -#### Authenticating with a service principal - -Authentication via service principal is done by: - -- Creating a credential using the `@azure/identity` package. -- Setting appropriate RBAC rules on your AppConfiguration resource. - More information on App Configuration roles can be found [here](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). - -Using [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential) - -```javascript -const azureIdentity = require("@azure/identity"); -const appConfig = require("@azure/app-configuration"); - -const credential = new azureIdentity.DefaultAzureCredential(); -const client = new appConfig.AppConfigurationClient( - endpoint, // ex: .azconfig.io> - credential -); -``` - -More information about `@azure/identity` can be found [here](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md) - -#### Authenticating with a connection string - -To get the Primary **connection string** for an App Configuration resource you can use this Azure CLI command: - -``` -az appconfig credential list -g -n --query "([?name=='Primary'].connectionString)[0]" -``` - -And in code you can now create your App Configuration client with the **connection string** you got from the Azure CLI: - -```typescript -const client = new AppConfigurationClient(""); -``` - -## Key concepts - -The [`AppConfigurationClient`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/appconfigurationclient) has some terminology changes from App Configuration in the portal. - -- Key/Value pairs are represented as [`ConfigurationSetting`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsetting) objects -- Locking and unlocking a setting is represented in the `isReadOnly` field, which you can toggle using `setReadOnly`. - -The client follows a simple design methodology - [`ConfigurationSetting`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsetting) can be passed into any method that takes a [`ConfigurationSettingParam`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsettingparam) or [`ConfigurationSettingId`](https://docs.microsoft.com/javascript/api/@azure/app-configuration/configurationsettingid). - -This means this pattern works: - -```typescript -const setting = await client.getConfigurationSetting({ - key: "hello" -}); - -setting.value = "new value!"; -await client.setConfigurationSetting(setting); - -// fields unrelated to just identifying the setting are simply -// ignored (for instance, the `value` field) -await client.setReadOnly(setting, true); - -// delete just needs to identify the setting so other fields are -// just ignored -await client.deleteConfigurationSetting(setting); -``` - -or, for example, re-getting a setting: - -```typescript -let setting = await client.getConfigurationSetting({ - key: "hello" -}); - -// re-get the setting -setting = await.getConfigurationSetting(setting); -``` - -## Examples - -#### Create and get a setting - -```javascript -const appConfig = require("@azure/app-configuration"); - -const client = new appConfig.AppConfigurationClient( - "" -); - -async function run() { - const newSetting = await client.setConfigurationSetting({ - key: "testkey", - value: "testvalue", - // Labels allow you to create variants of a key tailored - // for specific use-cases like supporting multiple environments. - // https://docs.microsoft.com/azure/azure-app-configuration/concept-key-value#label-keys - label: "optional-label" - }); - - let retrievedSetting = await client.getConfigurationSetting({ - key: "testkey", - label: "optional-label" - }); - - console.log("Retrieved value:", retrievedSetting.value); -} - -run().catch((err) => console.log("ERROR:", err)); -``` - -## Next steps - -The following samples show you the various ways you can interact with App Configuration: - -- [`helloworld.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/helloworld.ts) - Get, set, and delete configuration values. -- [`helloworldWithLabels.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/helloworldWithLabels.ts) - Use labels to add additional dimensions to your settings for scenarios like beta vs production. -- [`optimisticConcurrencyViaEtag.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/optimisticConcurrencyViaEtag.ts) - Set values using etags to prevent accidental overwrites. -- [`setReadOnlySample.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/setReadOnlySample.ts) - Marking settings as read-only to prevent modification. -- [`getSettingOnlyIfChanged.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/getSettingOnlyIfChanged.ts) - Get a setting only if it changed from the last time you got it. -- [`listRevisions.ts`](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples/typescript/src/listRevisions.ts) - List the revisions of a key, allowing you to see previous values and when they were set. - -More in-depth examples can be found in the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/appconfiguration/app-configuration/samples) folder on GitHub. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. - -This module's tests are a mixture of live and unit tests, which require you to have an Azure App Configuration instance. To execute the tests you'll need to run: - -1. `rush update` -2. `rush build -t @azure/app-configuration` -3. Create a .env file with these contents in the `sdk\appconfiguration\app-configuration` folder: - `APPCONFIG_CONNECTION_STRING=connection string for your App Configuration instance` -4. `cd sdk\appconfiguration\app-configuration` -5. `npm run test`. - -View our [tests](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/appconfiguration/app-configuration/test) -folder for more details. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) -- [Azure App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/overview) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappconfiguration%2Fapp-configuration%2FREADME.png) From a0ccdd222b15bb42f78fbecd2c1c47b6ad1a2e58 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 7 May 2021 15:40:38 +0100 Subject: [PATCH 104/166] Change pipeline definition --- sdk/remoterendering/mixedreality-remoterendering/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/tests.yml b/sdk/remoterendering/mixedreality-remoterendering/tests.yml index 5a825cf43ae4..bf477b57f4a2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/tests.yml +++ b/sdk/remoterendering/mixedreality-remoterendering/tests.yml @@ -1,7 +1,7 @@ trigger: none extends: - template: ../../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: PackageName: "@azure/mixedreality-remoterendering" ServiceDirectory: remoterendering From da2f39bacf4f83f33517cc5e5ba89eb106fe2207 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 10 May 2021 10:18:30 +0100 Subject: [PATCH 105/166] ESLint fixes --- .../src/internal/commonQueries.ts | 4 +- .../src/internal/renderingSession.ts | 2 +- .../src/lro/assetConversionPoller.ts | 4 +- .../src/lro/renderingSessionPoller.ts | 8 +-- .../src/options.ts | 7 +- .../src/remoteRenderingClient.ts | 34 +++++---- .../test/public/remoteRenderingClient.spec.ts | 72 +++++++++---------- .../test/utils/recordedClient.ts | 4 +- 8 files changed, 70 insertions(+), 65 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index 1ece857b6145..6ff75e09885f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -21,7 +21,7 @@ export async function getConversionInternal( }); try { - let conversion = await operations.getConversion(accountId, conversionId, updatedOptions); + const conversion = await operations.getConversion(accountId, conversionId, updatedOptions); return assetConversionFromConversion(conversion); } catch (e) { span.setStatus({ @@ -47,7 +47,7 @@ export async function getSessionInternal( }); try { - let sessionProperties = await operations.getSession(accountId, sessionId, updatedOptions); + const sessionProperties = await operations.getSession(accountId, sessionId, updatedOptions); return renderingSessionFromSessionProperties(sessionProperties); } catch (e) { span.setStatus({ diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index ec90bb949fdd..21dd3772a38a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -159,7 +159,7 @@ function partialRenderingSessionPropertiesFromSessionProperties( export function renderingSessionFromSessionProperties( session: SessionProperties ): RenderingSession { - let baseProperties: RenderingSessionBase = { + const baseProperties: RenderingSessionBase = { sessionId: session.sessionId, size: session.size, maxLeaseTimeInMinutes: session.maxLeaseTimeInMinutes! diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 9cf0a691d55f..cd6088ef5d47 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -34,8 +34,8 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati get isCompleted(): boolean { return ( - this.latestResponse.status != KnownAssetConversionStatus.NotStarted && - this.latestResponse.status != KnownAssetConversionStatus.Running + this.latestResponse.status !== KnownAssetConversionStatus.NotStarted && + this.latestResponse.status !== KnownAssetConversionStatus.Running ); } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index d0321e4e3851..fed88b6265e4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -32,7 +32,7 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera } get isCompleted(): boolean { - return this.latestResponse.status != KnownRenderingSessionStatus.Starting; + return this.latestResponse.status !== KnownRenderingSessionStatus.Starting; } get isCancelled(): boolean { @@ -41,7 +41,7 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera get error(): Error | undefined { if (this.latestResponse.status === "Error") { - //TODO Add details? + // TODO Add details return new Error(this.latestResponse.error.message); } return undefined; @@ -122,14 +122,14 @@ export class RenderingSessionPoller extends Poller< constructor( accountId: string, operations: RemoteRendering, - RenderingSession: RenderingSession, + renderingSession: RenderingSession, options: RenderingSessionPollerOptions ) { super( new RenderingSessionOperation( accountId, operations, - new RenderingSessionOperationStateImpl(RenderingSession) + new RenderingSessionOperationStateImpl(renderingSession) ) ); this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts index 84e30b6f9736..698257b39c24 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts @@ -4,7 +4,7 @@ import { PipelineOptions } from "@azure/core-rest-pipeline"; /** - * Options to create the MixedRealityStsClient. + * Options to create the RemoteRenderingClient. */ export interface RemoteRenderingClientOptions extends PipelineOptions { /** @@ -12,8 +12,3 @@ export interface RemoteRenderingClientOptions extends PipelineOptions { */ authenticationEndpointUrl?: string; } - -/** - * Options to create the MixedRealityStsClient. - */ -//export interface GetTokenOptions extends OperationOptions {} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 5142a335c16b..fcf7ab7c41ac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -137,6 +137,16 @@ export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationO export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; +export type GetSessionOptions = OperationOptions; + +export type GetConversionOptions = OperationOptions; + +export type ListConversionOptions = OperationOptions; + +export type EndSessionOptions = OperationOptions; + +export type ListSessionsOptions = OperationOptions; + export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, RenderingSession @@ -306,7 +316,7 @@ export class RemoteRenderingClient { settings = assetConversionSettings!; operationOptions = options ?? {}; } else { - let assetConversion: AssetConversion = await getConversionInternal( + const assetConversion: AssetConversion = await getConversionInternal( this.accountId, this.operations, conversionIdOrResumeOptions.resumeFrom, @@ -328,14 +338,14 @@ export class RemoteRenderingClient { }); try { - let conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( + const conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( this.accountId, conversionId, { settings: settings }, updatedOptions ); - let poller = new AssetConversionPoller( + const poller = new AssetConversionPoller( this.accountId, this.operations, assetConversionFromConversion(conversion), @@ -367,7 +377,7 @@ export class RemoteRenderingClient { */ public async getConversion( conversionId: string, - options?: OperationOptions + options?: GetConversionOptions ): Promise { return getConversionInternal( this.accountId, @@ -409,7 +419,7 @@ export class RemoteRenderingClient { * Gets a list of all conversions. * @param options The options parameters. */ - public listConversions(options?: OperationOptions): PagedAsyncIterableIterator { + public listConversions(options?: ListConversionOptions): PagedAsyncIterableIterator { const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { ...options }); @@ -475,7 +485,7 @@ export class RemoteRenderingClient { settings = renderingSessionSettings!; operationOptions = options ?? {}; } else { - let renderingSession: RenderingSession = await getSessionInternal( + const renderingSession: RenderingSession = await getSessionInternal( this.accountId, this.operations, sessionIdOrResumeOptions.resumeFrom, @@ -496,14 +506,14 @@ export class RemoteRenderingClient { }); try { - let sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( + const sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( this.accountId, sessionId, settings, updatedOptions ); - let poller = new RenderingSessionPoller( + const poller = new RenderingSessionPoller( this.accountId, this.operations, renderingSessionFromSessionProperties(sessionProperties), @@ -534,7 +544,7 @@ export class RemoteRenderingClient { */ public async getSession( sessionId: string, - options?: OperationOptions + options?: GetSessionOptions ): Promise { return getSessionInternal( this.accountId, @@ -563,7 +573,7 @@ export class RemoteRenderingClient { }); try { - let sessionProperties = await this.operations.updateSession( + const sessionProperties = await this.operations.updateSession( this.accountId, sessionId, options, @@ -588,7 +598,7 @@ export class RemoteRenderingClient { * underscores, and cannot contain more than 256 characters. * @param options The options parameters. */ - public async endSession(sessionId: string, options?: OperationOptions): Promise { + public async endSession(sessionId: string, options?: EndSessionOptions): Promise { return endSessionInternal( this.accountId, this.operations, @@ -625,7 +635,7 @@ export class RemoteRenderingClient { * Gets a list of all sessions. * @param options The options parameters. */ - public listSessions(options?: OperationOptions): PagedAsyncIterableIterator { + public listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator { const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { ...options }); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index d5f61206c0c4..9a02b4022462 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -121,28 +121,28 @@ describe("RemoteRendering functional tests", () => { }); it("can convert successfully", async () => { - let storageContainerUrl: string = + const storageContainerUrl: string = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); - let inputSettings: AssetConversionInputSettings = { + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), relativeInputAssetPath: "testBox.fbx", blobPrefix: "Input" }; - let outputSettings: AssetConversionOutputSettings = { + const outputSettings: AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), blobPrefix: "Output" }; - let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; - let conversionId: string = recorder.getUniqueName("conversionId"); + const conversionId: string = recorder.getUniqueName("conversionId"); - let conversionPoller: AssetConversionPollerLike = await client.beginConversion( + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, conversionSettings ); @@ -157,11 +157,11 @@ describe("RemoteRendering functional tests", () => { KnownAssetConversionStatus.Failed ); - let conversion: AssetConversion = await client.getConversion(conversionId); + const conversion: AssetConversion = await client.getConversion(conversionId); assert.equal(conversion.conversionId, conversionId); assert.notEqual(conversion.status, "Failed"); - let conversion2: AssetConversion = await conversionPoller.pollUntilDone(); + const conversion2: AssetConversion = await conversionPoller.pollUntilDone(); assert.equal(conversion2.conversionId, conversionId); assert.equal(conversion2.status, "Succeeded"); if (conversion2.status === "Succeeded") { @@ -170,7 +170,7 @@ describe("RemoteRendering functional tests", () => { let foundConversion: boolean = false; for await (const c of client.listConversions()) { - if (c.conversionId == conversionId) { + if (c.conversionId === conversionId) { foundConversion = true; } } @@ -178,27 +178,27 @@ describe("RemoteRendering functional tests", () => { }); it("throws correct exception on no access", async () => { - let storageContainerUrl = + const storageContainerUrl = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); // Do not provide SAS tokens - let inputSettings: AssetConversionInputSettings = { + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, relativeInputAssetPath: "testBox.fbx", blobPrefix: "Input" }; - let outputSettings: AssetConversionOutputSettings = { + const outputSettings: AssetConversionOutputSettings = { storageContainerUrl, blobPrefix: "Output" }; - let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; - let conversionId = recorder.getUniqueName("conversionId"); + const conversionId = recorder.getUniqueName("conversionId"); - let didThrowExpected: Boolean = false; + let didThrowExpected: boolean = false; try { await client.beginConversion(conversionId, conversionSettings); } catch (e) { @@ -213,41 +213,41 @@ describe("RemoteRendering functional tests", () => { }); it("will fail in the correct way on missing asset", async () => { - let storageContainerUrl = + const storageContainerUrl = "https://" + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); - let inputSettings: AssetConversionInputSettings = { + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), relativeInputAssetPath: "boxWhichDoesNotExist.fbx", blobPrefix: "Input" }; - let outputSettings: AssetConversionOutputSettings = { + const outputSettings: AssetConversionOutputSettings = { storageContainerUrl, storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), blobPrefix: "Output" }; - let conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; - let conversionId = recorder.getUniqueName("conversionId"); + const conversionId = recorder.getUniqueName("conversionId"); - let conversionPoller: AssetConversionPollerLike = await client.beginConversion( + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( conversionId, conversionSettings ); - let assetConversion: AssetConversion = await client.getConversion(conversionId); + const assetConversion: AssetConversion = await client.getConversion(conversionId); assert.equal(assetConversion.conversionId, conversionId); - let newPoller = await client.beginConversion({ resumeFrom: conversionPoller.toString() }); + const newPoller = await client.beginConversion({ resumeFrom: conversionPoller.toString() }); assert.equal(newPoller.getOperationState().latestResponse.conversionId, conversionId); - let conversion: AssetConversion = await conversionPoller.pollUntilDone(); + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); assert.equal(conversion.status, "Failed"); - if (conversion.status == "Failed") { + if (conversion.status === "Failed") { // Invalid input provided. Check logs in output container for details. assert.isTrue(conversion.error.message.toLowerCase().includes("invalid input")); assert.isTrue(conversion.error.message.toLowerCase().includes("logs")); @@ -259,9 +259,9 @@ describe("RemoteRendering functional tests", () => { maxLeaseTimeInMinutes: 4, size: "Standard" }; - let sessionId: string = recorder.getUniqueName("sessionId"); + const sessionId: string = recorder.getUniqueName("sessionId"); - let sessionPoller: RenderingSessionPollerLike = await client.beginSession( + const sessionPoller: RenderingSessionPollerLike = await client.beginSession( sessionId, sessionSettings ); @@ -274,31 +274,31 @@ describe("RemoteRendering functional tests", () => { ); assert.notEqual(sessionPoller.getOperationState().latestResponse.status, "Error"); - let renderingSession = await client.getSession(sessionId); + const renderingSession = await client.getSession(sessionId); assert.equal(renderingSession.sessionId, sessionId); - let newPoller = await client.beginSession({ resumeFrom: sessionPoller.toString() }); + const newPoller = await client.beginSession({ resumeFrom: sessionPoller.toString() }); assert.equal(newPoller.getOperationState().latestResponse.sessionId, sessionId); - let updatedSession: RenderingSession = await client.updateSession(sessionId, { + const updatedSession: RenderingSession = await client.updateSession(sessionId, { maxLeaseTimeInMinutes: 5 }); assert.equal(updatedSession.maxLeaseTimeInMinutes, 5); - let readyRenderingSession: RenderingSession = await sessionPoller.pollUntilDone(); + const readyRenderingSession: RenderingSession = await sessionPoller.pollUntilDone(); // beginSession does one interval of polling. If the session was ready within that time, then the poller // would carry the earlier maxLeastTimeInMinutes value. assert.isTrue( - readyRenderingSession.maxLeaseTimeInMinutes == 4 || - readyRenderingSession.maxLeaseTimeInMinutes == 5 + readyRenderingSession.maxLeaseTimeInMinutes === 4 || + readyRenderingSession.maxLeaseTimeInMinutes === 5 ); assert.equal(readyRenderingSession.status, "Ready"); let foundSession: boolean = false; for await (const s of client.listSessions()) { - if (s.sessionId == sessionId) { + if (s.sessionId === sessionId) { foundSession = true; } } @@ -312,9 +312,9 @@ describe("RemoteRendering functional tests", () => { maxLeaseTimeInMinutes: -4, size: "Standard" }; - let sessionId: string = recorder.getUniqueName("sessionId"); + const sessionId: string = recorder.getUniqueName("sessionId"); - let didThrowExpected: Boolean = false; + let didThrowExpected: boolean = false; try { await client.beginSession(sessionId, sessionSettings); } catch (e) { diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index 6e5a4eada59d..7156603ad761 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -55,10 +55,10 @@ export function createClient(): RemoteRenderingClient { // When playing back, we do not want to interact with the STS service, so we use // the AccessToken auth path. const maxTimestampMs = 8640000000000000; - let credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; + const credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); } else { - let credential: AzureKeyCredential = new AzureKeyCredential(accountKey); + const credential: AzureKeyCredential = new AzureKeyCredential(accountKey); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); } } From b0759a28a0829c200c52aba8c7731be0dd21433b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 10 May 2021 10:18:54 +0100 Subject: [PATCH 106/166] Formatting --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 4 +++- .../test/public/remoteRenderingClient.spec.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index fcf7ab7c41ac..d3e08f7f6203 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -419,7 +419,9 @@ export class RemoteRenderingClient { * Gets a list of all conversions. * @param options The options parameters. */ - public listConversions(options?: ListConversionOptions): PagedAsyncIterableIterator { + public listConversions( + options?: ListConversionOptions + ): PagedAsyncIterableIterator { const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { ...options }); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 9a02b4022462..e47fc50d6689 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -219,7 +219,7 @@ describe("RemoteRendering functional tests", () => { ".blob.core.windows.net/" + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); - const inputSettings: AssetConversionInputSettings = { + const inputSettings: AssetConversionInputSettings = { storageContainerUrl, storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), relativeInputAssetPath: "boxWhichDoesNotExist.fbx", From 558fec9a772bfcaee7966618ec03abb915e0eec9 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 10 May 2021 10:55:12 +0100 Subject: [PATCH 107/166] API Changes --- .../mixedreality-remoterendering.api.md | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 7918317c0a4c..326a678c2130 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -78,6 +78,9 @@ export interface CancelledAssetConversion extends AssetConversionBase { status: "Cancelled"; } +// @public (undocumented) +export type EndSessionOptions = OperationOptions; + // @public export interface ErrorRenderingSession extends RenderingSessionBase { readonly error: RemoteRenderingServiceError; @@ -99,6 +102,12 @@ export interface FailedAssetConversion extends AssetConversionBase { status: "Failed"; } +// @public (undocumented) +export type GetConversionOptions = OperationOptions; + +// @public (undocumented) +export type GetSessionOptions = OperationOptions; + // @public (undocumented) export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; @@ -126,6 +135,12 @@ export const enum KnownRenderingSessionStatus { Stopped = "Stopped" } +// @public (undocumented) +export type ListConversionOptions = OperationOptions; + +// @public (undocumented) +export type ListSessionsOptions = OperationOptions; + // @public export interface NonStartedAssetConversion extends AssetConversionBase { status: "NotStarted"; @@ -157,11 +172,11 @@ export class RemoteRenderingClient { beginConversion(options: ResumeBeginConversionOptions): Promise; beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; beginSession(options: ResumeBeginSessionOptions): Promise; - endSession(sessionId: string, options?: OperationOptions): Promise; - getConversion(conversionId: string, options?: OperationOptions): Promise; - getSession(sessionId: string, options?: OperationOptions): Promise; - listConversions(options?: OperationOptions): PagedAsyncIterableIterator; - listSessions(options?: OperationOptions): PagedAsyncIterableIterator; + endSession(sessionId: string, options?: EndSessionOptions): Promise; + getConversion(conversionId: string, options?: GetConversionOptions): Promise; + getSession(sessionId: string, options?: GetSessionOptions): Promise; + listConversions(options?: ListConversionOptions): PagedAsyncIterableIterator; + listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator; updateSession(sessionId: string, options: UpdateSessionOptions): Promise; } From dc3488a8ecb96e3fea8853fac17d98be4a20362a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 10 May 2021 11:11:10 +0100 Subject: [PATCH 108/166] updateSessionSettings --- .../mixedreality-remoterendering.api.md | 8 +++---- .../src/internal/assetConversion.ts | 2 +- .../src/remoteRenderingClient.ts | 21 ++++++++++--------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 326a678c2130..f4fd3cba127d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -136,7 +136,7 @@ export const enum KnownRenderingSessionStatus { } // @public (undocumented) -export type ListConversionOptions = OperationOptions; +export type ListConversionsOptions = OperationOptions; // @public (undocumented) export type ListSessionsOptions = OperationOptions; @@ -175,9 +175,9 @@ export class RemoteRenderingClient { endSession(sessionId: string, options?: EndSessionOptions): Promise; getConversion(conversionId: string, options?: GetConversionOptions): Promise; getSession(sessionId: string, options?: GetSessionOptions): Promise; - listConversions(options?: ListConversionOptions): PagedAsyncIterableIterator; + listConversions(options?: ListConversionsOptions): PagedAsyncIterableIterator; listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator; - updateSession(sessionId: string, options: UpdateSessionOptions): Promise; + updateSession(sessionId: string, settings: UpdateSessionSettings, options?: UpdateSessionOptions): Promise; } // @public @@ -273,7 +273,7 @@ export interface SucceededAssetConversion extends AssetConversionBase { } // @public (undocumented) -export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; +export type UpdateSessionOptions = OperationOptions; // @public export interface UpdateSessionSettings { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 3b1d90b8602d..1d8f6f41f3f9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -63,7 +63,7 @@ export type AssetConversion = | CancelledAssetConversion; export function assetConversionFromConversion(conversion: Conversion): AssetConversion { - let baseProperties: AssetConversionBase = { + const baseProperties: AssetConversionBase = { conversionId: conversion.conversionId, settings: conversion.settings, createdOn: conversion.createdOn diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index d3e08f7f6203..30cd0803b8f7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -135,13 +135,13 @@ export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: stri export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; -export type UpdateSessionOptions = UpdateSessionSettings & OperationOptions; +export type UpdateSessionOptions = OperationOptions; export type GetSessionOptions = OperationOptions; export type GetConversionOptions = OperationOptions; -export type ListConversionOptions = OperationOptions; +export type ListConversionsOptions = OperationOptions; export type EndSessionOptions = OperationOptions; @@ -162,6 +162,7 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. + * @param endpoint The RemoteRendering endpoint to use. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. * @param keyCredential The Remote Rendering service account primary or secondary key credential. @@ -177,6 +178,7 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. + * @param endpoint The RemoteRendering endpoint to use. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. * @param credential A token credential for authenticating the account with the Mixed Reality STS service. @@ -192,6 +194,7 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. + * @param endpoint The RemoteRendering endpoint to use. * @param accountId The Remote Rendering service account identifier. * @param accountDomain The Remote Rendering service account domain. * @param credential An access token obtained from the Mixed Reality STS service. @@ -420,7 +423,7 @@ export class RemoteRenderingClient { * @param options The options parameters. */ public listConversions( - options?: ListConversionOptions + options?: ListConversionsOptions ): PagedAsyncIterableIterator { const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { ...options @@ -454,7 +457,7 @@ export class RemoteRenderingClient { * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param renderingSessionSettings Settings of the session to be created. + * @param settings Settings of the session to be created. * @param options The options parameters. */ public async beginSession( @@ -465,9 +468,6 @@ export class RemoteRenderingClient { /** * Obtains a poller for a pre-existing session - * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is - * case sensitive, can contain any combination of alphanumeric characters including hyphens and - * underscores, and cannot contain more than 256 characters. * @param options The options parameters, carrying a resumeFrom value. */ public async beginSession( @@ -539,7 +539,7 @@ export class RemoteRenderingClient { /** * Gets the status of a particular session. - * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * @param sessionId An ID uniquely identifying the session for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. * @param options The options parameters. @@ -567,7 +567,8 @@ export class RemoteRenderingClient { */ public async updateSession( sessionId: string, - options: UpdateSessionOptions + settings: UpdateSessionSettings, + options?: UpdateSessionOptions ): Promise { const { span, updatedOptions } = createSpan("RemoteRenderingClient-UpdateSession", { conversionId: sessionId, @@ -578,7 +579,7 @@ export class RemoteRenderingClient { const sessionProperties = await this.operations.updateSession( this.accountId, sessionId, - options, + settings, updatedOptions ); return renderingSessionFromSessionProperties(sessionProperties); From 4a725037c7b85c2ad4b738a16bce1543caa4eb8a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 12 May 2021 10:38:54 +0100 Subject: [PATCH 109/166] Copy other SDKs and stop the linter failing the pipeline --- sdk/remoterendering/mixedreality-remoterendering/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 0a5292064d8d..1a3065d4682c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -39,7 +39,7 @@ "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", + "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-remoterendering-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", From de0a3355ad460954ecf2d1c1fbc04a52453d058d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 12 May 2021 11:48:17 +0100 Subject: [PATCH 110/166] Changelog --- .../mixedreality-remoterendering/CHANGELOG.md | 52 +------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md b/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md index 6a7473963bfe..967eb9e0f2c0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md +++ b/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md @@ -1,53 +1,5 @@ # Release History -## 1.0.11-beta.1 (Unreleased) +## 1.0.0-beta.1 (Unreleased) -- Restructured the template package to use the Client SDK developer training materials. - -## 1.0.10-beta.1 (2020-11-16) - -- Test Release Pipeline - -## 1.0.9-beta.13 (2020-10-13) - -- Test Release Pipeline - -## 1.0.9-beta.3 (2020-09-05) - -- Test Release Pipeline - -## 1.0.9-beta.2 (2020-09-04) - -- Testing release tag replacement - -## 1.0.9-beta.1 (2020-08-27) - -- Testing prerelease versioning changes - -## 1.0.8 (Unreleased) - -## 1.0.7 (2020-04-01) - -## 1.0.6 (2020-03-26) - -- Test Release Pipeline - -## 1.0.5 (2020-03-25) - -- Test Release Pipeline - -## 1.0.4 (2020-03-245 - -- Test Release Pipeline - -## 1.0.3 (2020-03-24) - -- Test Release Pipeline - -## 1.0.2 (2020-03-24) - -- Test Release Pipeline - -## 1.0.1 (2020-03-24) - -- Test Release Pipeline +- Initial release. From b71f65d2b345b35bde2983c211b2866dfff9b410 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 14 May 2021 13:32:42 +0100 Subject: [PATCH 111/166] Move auth classes into src --- .../{ => src}/authentication/authenticationEndpoint.ts | 0 .../authentication/mixedRealityAccountKeyCredential.ts | 0 .../authentication/mixedRealityTokenCredential.ts | 0 .../authentication/staticAccessTokenCredential.ts | 0 .../src/remoteRenderingClient.ts | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) rename sdk/remoterendering/mixedreality-remoterendering/{ => src}/authentication/authenticationEndpoint.ts (100%) rename sdk/remoterendering/mixedreality-remoterendering/{ => src}/authentication/mixedRealityAccountKeyCredential.ts (100%) rename sdk/remoterendering/mixedreality-remoterendering/{ => src}/authentication/mixedRealityTokenCredential.ts (100%) rename sdk/remoterendering/mixedreality-remoterendering/{ => src}/authentication/staticAccessTokenCredential.ts (100%) diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/authentication/authenticationEndpoint.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityAccountKeyCredential.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/authentication/mixedRealityTokenCredential.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/authentication/staticAccessTokenCredential.ts rename to sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 30cd0803b8f7..216028df2e97 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -19,10 +19,10 @@ import { import { RemoteRenderingClientOptions } from "./options"; -import { constructAuthenticationEndpointFromDomain } from "../authentication/authenticationEndpoint"; -import { MixedRealityTokenCredential } from "../authentication/mixedRealityTokenCredential"; -import { StaticAccessTokenCredential } from "../authentication/staticAccessTokenCredential"; -import { MixedRealityAccountKeyCredential } from "../authentication/mixedRealityAccountKeyCredential"; +import { constructAuthenticationEndpointFromDomain } from "./authentication/authenticationEndpoint"; +import { MixedRealityTokenCredential } from "./authentication/mixedRealityTokenCredential"; +import { StaticAccessTokenCredential } from "./authentication/staticAccessTokenCredential"; +import { MixedRealityAccountKeyCredential } from "./authentication/mixedRealityAccountKeyCredential"; import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; From ce63e43bf1b86bb62c2d78e5c6208cd30f84223c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 14 May 2021 15:08:34 +0100 Subject: [PATCH 112/166] Hopefully fix failing tests --- .../recording_can_start_a_session.json | 314 +++++------------- .../recording_can_start_a_session.js | 212 ++++++------ .../src/internal/commonQueries.ts | 2 +- .../src/remoteRenderingClient.ts | 6 +- 4 files changed, 203 insertions(+), 331 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json index f661d0335080..fef397849e5d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json @@ -13,554 +13,412 @@ "cache-control": "no-store,no-cache", "content-length": "1219", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:51 GMT", - "ms-cv": "Fz3oQvY9Lk+52P+WBV59Fg.0", + "date": "Fri, 14 May 2021 13:59:29 GMT", + "ms-cv": "WbRtn67E4EmuZcAofMWIHA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "PUT", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": "{\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\"}", "status": 201, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:51 GMT", - "ms-cv": "obtl9RxeVECCgSk5gyZMsA.0", + "date": "Fri, 14 May 2021 13:59:29 GMT", + "ms-cv": "yDwn9pKWXkiJpExBySyVPQ.0", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:53 GMT", - "ms-cv": "yywgdJuZfkqgeqb0Q6e2vg.0", + "date": "Fri, 14 May 2021 13:59:29 GMT", + "ms-cv": "KOF/Pr6vE0679EMrnk/oWg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:53 GMT", - "ms-cv": "3EShG05PFkGsuGglEQsVuQ.0", + "date": "Fri, 14 May 2021 13:59:29 GMT", + "ms-cv": "n15ENwVpv0aF3EGkvorA0g.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:53 GMT", - "ms-cv": "55Tdtkq2wUiWa4p16UTdAQ.0", + "date": "Fri, 14 May 2021 13:59:39 GMT", + "ms-cv": "tehZfMghokCksjSaCS7DnA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, - { - "method": "PATCH", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": "{\"maxLeaseTimeMinutes\":5}", - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:54 GMT", - "ms-cv": "9UrMJvu9p0mPqh9CUyxgoA.0", - "x-content-type-options": "nosniff" - } - }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:02:54 GMT", - "ms-cv": "ggvwuEZE5UGKjeQlWF0iBw.0", + "date": "Fri, 14 May 2021 13:59:50 GMT", + "ms-cv": "mzPZr19C0UW1SI8BuzMF2A.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:04 GMT", - "ms-cv": "vZ/xrA/rjU+SExGNlZYobw.0", + "date": "Fri, 14 May 2021 14:00:00 GMT", + "ms-cv": "KGG39w6XS0ubnVUbE5110Q.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:14 GMT", - "ms-cv": "1dTNA8t9YkGPZc1bLInkYw.0", + "date": "Fri, 14 May 2021 14:00:10 GMT", + "ms-cv": "/jW5mVZZl0q0X3n+sG9ztA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:24 GMT", - "ms-cv": "kuUH6hSx60ur3OqtPeipow.0", + "date": "Fri, 14 May 2021 14:00:20 GMT", + "ms-cv": "IJ/rMahdAUWt4wXNpRsBJw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:34 GMT", - "ms-cv": "92Tfm6UegUejmDrW1YDG4g.0", + "date": "Fri, 14 May 2021 14:00:30 GMT", + "ms-cv": "a71g9jlWLESGzZoUZ6FYmw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:44 GMT", - "ms-cv": "sXTqOeh+W0SA/jxbh6ZDLQ.0", + "date": "Fri, 14 May 2021 14:00:40 GMT", + "ms-cv": "nXvqNqgCCEuMjWEIBHoozA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:03:55 GMT", - "ms-cv": "VX7+Tb623ECvCSX0no2eDQ.0", + "date": "Fri, 14 May 2021 14:00:51 GMT", + "ms-cv": "23Hr/hvgYU+9z87V/g/GEg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:05 GMT", - "ms-cv": "mSZkTQKg1E6AOVwVSGqygg.0", + "date": "Fri, 14 May 2021 14:01:01 GMT", + "ms-cv": "I3qXUdthLUGJVjS47CSdCA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:15 GMT", - "ms-cv": "JQZmAZoUXE6dz/BQrXNVjw.0", + "date": "Fri, 14 May 2021 14:01:11 GMT", + "ms-cv": "OE3USjAQyEmB3hoy4SVCdw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:25 GMT", - "ms-cv": "Iho1ghUHgUKiG4yKZdbu+Q.0", + "date": "Fri, 14 May 2021 14:01:21 GMT", + "ms-cv": "dR30NTU6fUeLhrLRvt3Uog.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:35 GMT", - "ms-cv": "2tshTTBGpEWrRn4bkEFiDw.0", + "date": "Fri, 14 May 2021 14:01:31 GMT", + "ms-cv": "dR8fc7z0jEmyFDXPi/MoMA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:45 GMT", - "ms-cv": "WjbEgopdlUuCpGRaSlFTQQ.0", + "date": "Fri, 14 May 2021 14:01:41 GMT", + "ms-cv": "IsIEYem4Yk2lBEyw/nm0bA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:04:56 GMT", - "ms-cv": "IcuEkLeo3keNE52d2K2jtQ.0", + "date": "Fri, 14 May 2021 14:01:52 GMT", + "ms-cv": "a3BEad+7zk+b4YHfTZFlVQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:06 GMT", - "ms-cv": "roZGogfmxECvI9ip57EOPA.0", + "date": "Fri, 14 May 2021 14:02:02 GMT", + "ms-cv": "OnFay9mxBUmRBHWbd83Y+w.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:16 GMT", - "ms-cv": "ptZ+3JV58EyieeLOyJpvFg.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:26 GMT", - "ms-cv": "G46c4IBiM0q3gR41Ofnceg.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:36 GMT", - "ms-cv": "EX1zvhhm2EyJgAyXvwtoeA.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:46 GMT", - "ms-cv": "pkfLZ0kHDkiKEyhKECIhkQ.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:05:56 GMT", - "ms-cv": "NGGK3T9CaU2FiSTcOTmLXg.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", - "responseHeaders": { - "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "172", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:06:07 GMT", - "ms-cv": "8DRpTLPlgUmzzynj7HRUxg.0", - "pragma": "no-cache", - "x-content-type-options": "nosniff" - } - }, - { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979137193502926", - "query": { - "api-version": "2021-01-01" - }, - "requestBody": null, - "status": 200, - "response": "{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"arrInspectorPort\":61369,\"handshakePort\":52318,\"elapsedTimeMinutes\":0,\"hostname\":\"1603318822-94b654a4-ac98-49b6-a4b7-d362aac80e82.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", + "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"arrInspectorPort\":60045,\"handshakePort\":57176,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-7a1040ad-6476-44f8-aab8-a4cdc9be9b62.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "343", "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:06:17 GMT", - "ms-cv": "rQU+O2RWsESmGWeka5LeHA.0", + "date": "Fri, 14 May 2021 14:02:14 GMT", + "ms-cv": "wQY7wBlNOUecRAo7BSeXIw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { - "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions", + "method": "POST", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434/:stop", "query": { "api-version": "2021-01-01" }, "requestBody": null, - "status": 200, - "response": "{\"sessions\":[{\"id\":\"sessionId161979137193502926\",\"creationTime\":\"2021-04-30T14:02:52.3663544+00:00\",\"arrInspectorPort\":61369,\"handshakePort\":52318,\"elapsedTimeMinutes\":0,\"hostname\":\"1603318822-94b654a4-ac98-49b6-a4b7-d362aac80e82.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}]}", + "status": 204, + "response": "", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "cache-control": "no-store,no-cache", - "content-length": "358", - "content-type": "application/json; charset=utf-8", - "date": "Fri, 30 Apr 2021 14:06:17 GMT", - "ms-cv": "ItmvW1Gwx0SDD74OmVT6LQ.0", - "pragma": "no-cache", + "date": "Fri, 14 May 2021 14:02:14 GMT", + "ms-cv": "FLDnKwi8LkuElnVAX7foRg.0", "x-content-type-options": "nosniff" } } ], "uniqueTestInfo": { "uniqueName": { - "sessionId": "sessionId161979137193502926" + "sessionId": "sessionId162100076811003434" }, "newDate": {} }, - "hash": "554c161ce53f4f7869f364841849d175" + "hash": "a01d083474b8e9059226f2d7f6d1ec83" } \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js index b7beedf47da6..80d177b3a29e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js @@ -1,15 +1,15 @@ let nock = require('nock'); -module.exports.hash = "59dc56d581f29cf0fcaa83f3b65df716"; +module.exports.hash = "6822ea4489dc148fe8ffad7a20806d2e"; -module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161979097167408229"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId162100057722809393"},"newDate":{}} nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/Accounts/00000000-1111-2222-3333-444455556666/token') .query(true) .reply(200, {"AccessToken":""}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:11 GMT', + 'Fri, 14 May 2021 13:56:18 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -19,17 +19,17 @@ nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":tru 'Pragma', 'no-cache', 'MS-CV', - 'vXR/gAFVj02ORvDecWA1FA.0', + 'StoLqdra6E6J9q/Z6klbQw.0', 'X-Content-Type-Options', 'nosniff' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229', {"maxLeaseTimeMinutes":4,"size":"Standard"}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393', {"maxLeaseTimeMinutes":4,"size":"Standard"}) .query(true) - .reply(201, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(201, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:11 GMT', + 'Fri, 14 May 2021 13:56:18 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -37,17 +37,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '0sI8DtToI0K+iOWs5vFajA.0', + 'v/hmx7jChUekfRnVpoUcvA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:12 GMT', + 'Fri, 14 May 2021 13:56:19 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -59,17 +59,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'pBVIYG5o2kidN3qUEKjMdA.0', + 'NwwLFYnb8kGLLuWCZe1cwg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:12 GMT', + 'Fri, 14 May 2021 13:56:19 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -81,17 +81,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'cm887N/goky3n0shVEumPg.0', + '1OjlEFvxlE2Yn6DoyhX9Kw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:12 GMT', + 'Fri, 14 May 2021 13:56:19 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -103,17 +103,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '9eCbKHNDw0ODTsGTjfT8Fg.0', + 'pPeVjDnhxkaVx2aIWh8f+g.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229', {"maxLeaseTimeMinutes":5}) + .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393', {"maxLeaseTimeMinutes":5}) .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:12 GMT', + 'Fri, 14 May 2021 13:56:19 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -121,17 +121,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'HibzctpnSE+3PMK3cQzPHA.0', + 'rjw2qlWGKUCwlg+i+P2Hfg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:12 GMT', + 'Fri, 14 May 2021 13:56:19 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -143,17 +143,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'KeuayG8Q7km9hv8NKKqSGQ.0', + '649zDlT9Y0uItMTv2mQeKQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:22 GMT', + 'Fri, 14 May 2021 13:56:29 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -165,17 +165,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'I04dzdcILk2wrE/+841t/A.0', + 'k8YZTsk310ufmMfxENLvZQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:32 GMT', + 'Fri, 14 May 2021 13:56:39 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -187,17 +187,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'CzrrJMSJrEuQgXpvdB3H9w.0', + 'bh/drvAcZkqHmKhXokg1UA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:42 GMT', + 'Fri, 14 May 2021 13:56:50 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -209,17 +209,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'MmX2Wdvzd0GwcE1xlfg16Q.0', + 'oAtprrz3CEqHhKgq2Ni3lQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:56:53 GMT', + 'Fri, 14 May 2021 13:57:00 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -231,17 +231,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'V8wX2OCmlkq61l4dGnaGEQ.0', + 'slr2aRBDaEW/MDwnH2l3nQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:03 GMT', + 'Fri, 14 May 2021 13:57:10 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -253,17 +253,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'McmptrshR06TAyCt1mr+/Q.0', + 'Bbql6LXQi0ea+sRkBy1kCQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:13 GMT', + 'Fri, 14 May 2021 13:57:20 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -275,17 +275,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'EnOURUR6pEu0RIuabY91Sw.0', + 'vKQgIz8sXk+D6HgrpHMC3A.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:23 GMT', + 'Fri, 14 May 2021 13:57:30 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -297,17 +297,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'gyTS5Ci1e0Gz1j8YqFQchA.0', + 'tseH83iVdU+C7iwj868amw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:33 GMT', + 'Fri, 14 May 2021 13:57:40 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -319,17 +319,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'j122CmvbpEmpZcEBAp1asg.0', + 'e5mT5c9hs0WvbD08D1hyiQ.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:44 GMT', + 'Fri, 14 May 2021 13:57:50 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -341,17 +341,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '+lJt+RuQF0i65rRTQNlShg.0', + 'JPPEqu6Sg0qcTZ2M5++8Kw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:57:54 GMT', + 'Fri, 14 May 2021 13:58:00 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -363,17 +363,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'XI1f1ryJ5UKvvAqnJ//okw.0', + '35UaDa4VH0en+7GZ0a0FhA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:04 GMT', + 'Fri, 14 May 2021 13:58:11 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -385,17 +385,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'AaTesu8qT0qVnYkcBXpoQQ.0', + 'cUyV+gZbvkyFhDwoTJZ5Mw.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:14 GMT', + 'Fri, 14 May 2021 13:58:21 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -407,17 +407,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '6fLDKLNGnkSvW8lP2wILjQ.0', + 'ZPZk0deNz06QwgMRBGigbg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:24 GMT', + 'Fri, 14 May 2021 13:58:31 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -429,17 +429,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'TLj9CZlbIUW0qtDsY18bqw.0', + 'rQDIt0prXU2YUPh/NrzvnA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:34 GMT', + 'Fri, 14 May 2021 13:58:41 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -451,17 +451,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '2jZqrGc6rUKajHlz5wHFSQ.0', + 'sgp5XAyFBUKmcJUzhp2ZUA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:44 GMT', + 'Fri, 14 May 2021 13:58:51 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -473,17 +473,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'tdsHPjSeRUSh7mJPUKQNaw.0', + '8Pej+Y57WEOo+UclfCHh4w.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ 'Date', - 'Fri, 30 Apr 2021 13:58:55 GMT', + 'Fri, 14 May 2021 13:59:01 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -495,17 +495,17 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'pCQaLUZNU0yC2EbDmHsJGA.0', + '7uCLGpQpS0mJfSX3mT3XKA.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) - .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979097167408229') + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') .query(true) - .reply(200, {"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","arrInspectorPort":56477,"handshakePort":59875,"elapsedTimeMinutes":0,"hostname":"1603318822-ad45142f-ccc1-4a0d-ad63-760f0b6ec7c7.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","arrInspectorPort":50830,"handshakePort":61353,"elapsedTimeMinutes":0,"hostname":"1362320837-4b5f741c-707f-43fd-87dc-3e048677f9b8.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ 'Date', - 'Fri, 30 Apr 2021 13:59:05 GMT', + 'Fri, 14 May 2021 13:59:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -517,7 +517,7 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - 'ECmH8fcKT0O0dS1Yl1tQVA.0', + 'w+ckxqtEPkOyRAm+4uq6Rg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); @@ -525,9 +525,9 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) .get('/accounts/00000000-1111-2222-3333-444455556666/sessions') .query(true) - .reply(200, {"sessions":[{"id":"sessionId161979097167408229","creationTime":"2021-04-30T13:56:11.8791406+00:00","arrInspectorPort":56477,"handshakePort":59875,"elapsedTimeMinutes":0,"hostname":"1603318822-ad45142f-ccc1-4a0d-ad63-760f0b6ec7c7.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ + .reply(200, {"sessions":[{"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","arrInspectorPort":50830,"handshakePort":61353,"elapsedTimeMinutes":0,"hostname":"1362320837-4b5f741c-707f-43fd-87dc-3e048677f9b8.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ 'Date', - 'Fri, 30 Apr 2021 13:59:05 GMT', + 'Fri, 14 May 2021 13:59:12 GMT', 'Content-Type', 'application/json; charset=utf-8', 'Content-Length', @@ -539,7 +539,21 @@ nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQuer 'X-Content-Type-Options', 'nosniff', 'MS-CV', - '9NDXIt6xG0mjXnmNnqvNRw.0', + 'iXCkt2k7zkeXydGX34/J1A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .post('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393/:stop') + .query(true) + .reply(204, "", [ + 'Date', + 'Fri, 14 May 2021 13:59:12 GMT', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'H9Zlro+/A02pHNmVJtrnJg.0', 'api-supported-versions', '2021-01-01-preview, 2021-01-01' ]); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index 6ff75e09885f..e82e69cefe00 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -73,7 +73,7 @@ export async function endSessionInternal( }); try { - operations.stopSession(accountId, sessionId, updatedOptions); + await operations.stopSession(accountId, sessionId, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 216028df2e97..c7951ea2856d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -382,7 +382,7 @@ export class RemoteRenderingClient { conversionId: string, options?: GetConversionOptions ): Promise { - return getConversionInternal( + return await getConversionInternal( this.accountId, this.operations, conversionId, @@ -548,7 +548,7 @@ export class RemoteRenderingClient { sessionId: string, options?: GetSessionOptions ): Promise { - return getSessionInternal( + return await getSessionInternal( this.accountId, this.operations, sessionId, @@ -602,7 +602,7 @@ export class RemoteRenderingClient { * @param options The options parameters. */ public async endSession(sessionId: string, options?: EndSessionOptions): Promise { - return endSessionInternal( + return await endSessionInternal( this.accountId, this.operations, sessionId, From 53a0d47ab12df5e79fade9443e8b0ba8d56e24ab Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 14 May 2021 15:50:13 +0100 Subject: [PATCH 113/166] Updated pnpm-lock.yaml --- common/config/rush/pnpm-lock.yaml | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 41ccf3c14ac6..ce494c739c50 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10435,6 +10435,52 @@ packages: integrity: sha512-J3o/wRGxiLoaX9H26cUyJ24rF9cmZ3fmsKpQZWIX8fZdKOYd8/FYyY562CkjEmC0tdzQw65h/eWoorg8hFRb3w== tarball: file:projects/mixedreality-authentication.tgz version: 0.0.0 + file:projects/mixedreality-remoterendering.tgz: + dependencies: + '@azure/core-rest-pipeline': 1.0.3 + '@azure/core-tracing': 1.0.0-preview.11 + '@azure/identity': 1.3.0 + '@microsoft/api-extractor': 7.7.11 + '@types/chai': 4.2.16 + '@types/chai-as-promised': 7.1.3 + '@types/mocha': 7.0.2 + '@types/node': 8.10.66 + '@types/uuid': 8.3.0 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + cross-env: 7.0.3 + dotenv: 8.2.0 + eslint: 7.23.0 + inherits: 2.0.4 + karma: 6.3.2 + karma-chrome-launcher: 3.1.0 + karma-coverage: 2.0.3 + karma-edge-launcher: 0.4.2_karma@6.3.2 + karma-env-preprocessor: 0.1.1 + karma-firefox-launcher: 1.3.0 + karma-ie-launcher: 1.0.0_karma@6.3.2 + karma-json-preprocessor: 0.3.3_karma@6.3.2 + karma-json-to-file-reporter: 1.0.1 + karma-junit-reporter: 2.0.1_karma@6.3.2 + karma-mocha: 2.0.1 + karma-mocha-reporter: 2.2.5_karma@6.3.2 + mocha: 7.2.0 + mocha-junit-reporter: 1.23.3_mocha@7.2.0 + nyc: 14.1.1 + prettier: 1.19.1 + rimraf: 3.0.2 + rollup: 1.32.1 + tslib: 2.2.0 + typedoc: 0.15.2 + typescript: 4.2.4 + util: 0.12.3 + uuid: 8.3.2 + dev: false + name: '@rush-temp/mixedreality-remoterendering' + resolution: + integrity: sha512-1Ny6rrGSO8Cydm0MM+IWsI+WCnk1JATj+c+wAlJo6y8SAgThYC8K7ilHf7hP0sipKrH2dFLH9s3C2iWAFqSd+Q== + tarball: file:projects/mixedreality-remoterendering.tgz + version: 0.0.0 file:projects/mock-hub.tgz: dependencies: '@types/node': 8.10.66 From cff9ca9842f7eb4050b1fb84babd4ae0df1dc7ae Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 14 May 2021 17:36:11 +0100 Subject: [PATCH 114/166] Ensure the update message is recorded. --- .../recording_can_start_a_session.json | 264 ++++++++++++------ 1 file changed, 181 insertions(+), 83 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json index fef397849e5d..9eae1a724741 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json +++ b/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json @@ -13,393 +13,491 @@ "cache-control": "no-store,no-cache", "content-length": "1219", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:29 GMT", - "ms-cv": "WbRtn67E4EmuZcAofMWIHA.0", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "GosT3yrFvEGhrMFkLF5lNg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "PUT", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": "{\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\"}", "status": 201, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:29 GMT", - "ms-cv": "yDwn9pKWXkiJpExBySyVPQ.0", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "LTuW12JFFEm+UKgF3x2QQw.0", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:29 GMT", - "ms-cv": "KOF/Pr6vE0679EMrnk/oWg.0", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "4tkw8z/oeUOmGi3+utVOiQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:29 GMT", - "ms-cv": "n15ENwVpv0aF3EGkvorA0g.0", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "6V6hCHTY1kmLlMqY3EHfgQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:39 GMT", - "ms-cv": "tehZfMghokCksjSaCS7DnA.0", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "TeueQf8ea0GuUt1OtnLmfA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PATCH", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":5}", + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "tWPQOWC+kUuY+elyrKekuA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "eTIcaCajoUq+cBJNcxn/dw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 13:59:50 GMT", - "ms-cv": "mzPZr19C0UW1SI8BuzMF2A.0", + "date": "Fri, 14 May 2021 16:25:23 GMT", + "ms-cv": "E8n6+Yik4UCbM1BIdZdiHA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:00 GMT", - "ms-cv": "KGG39w6XS0ubnVUbE5110Q.0", + "date": "Fri, 14 May 2021 16:25:33 GMT", + "ms-cv": "zBb5TsEX7U2UUKs8PYYFsQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:10 GMT", - "ms-cv": "/jW5mVZZl0q0X3n+sG9ztA.0", + "date": "Fri, 14 May 2021 16:25:43 GMT", + "ms-cv": "JAyP8EXQkkS9JFKoES8qCg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:20 GMT", - "ms-cv": "IJ/rMahdAUWt4wXNpRsBJw.0", + "date": "Fri, 14 May 2021 16:25:53 GMT", + "ms-cv": "5ZzVF4nbJkunDR2GbwCJZg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:30 GMT", - "ms-cv": "a71g9jlWLESGzZoUZ6FYmw.0", + "date": "Fri, 14 May 2021 16:26:04 GMT", + "ms-cv": "HtjmR/YTK0WcaF3pNlyYfw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:40 GMT", - "ms-cv": "nXvqNqgCCEuMjWEIBHoozA.0", + "date": "Fri, 14 May 2021 16:26:14 GMT", + "ms-cv": "UGzm000Ln0m4/y6Y6AJQXg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:00:51 GMT", - "ms-cv": "23Hr/hvgYU+9z87V/g/GEg.0", + "date": "Fri, 14 May 2021 16:26:24 GMT", + "ms-cv": "gZtDcfZFeEO4xm+EgjUoPA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:01 GMT", - "ms-cv": "I3qXUdthLUGJVjS47CSdCA.0", + "date": "Fri, 14 May 2021 16:26:34 GMT", + "ms-cv": "TB5QKoLZ5ES8Ie14RNAKbQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:11 GMT", - "ms-cv": "OE3USjAQyEmB3hoy4SVCdw.0", + "date": "Fri, 14 May 2021 16:26:44 GMT", + "ms-cv": "nM/WMntuck6W1CbetiAU/g.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:21 GMT", - "ms-cv": "dR30NTU6fUeLhrLRvt3Uog.0", + "date": "Fri, 14 May 2021 16:26:54 GMT", + "ms-cv": "PDS5L+Hwc0mT6ld50LFSUA.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:31 GMT", - "ms-cv": "dR8fc7z0jEmyFDXPi/MoMA.0", + "date": "Fri, 14 May 2021 16:27:05 GMT", + "ms-cv": "poMrrttI40WihLhoMy6YSQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:41 GMT", - "ms-cv": "IsIEYem4Yk2lBEyw/nm0bA.0", + "date": "Fri, 14 May 2021 16:27:15 GMT", + "ms-cv": "f8amqtPpW06pG/PP7N3gcg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:01:52 GMT", - "ms-cv": "a3BEad+7zk+b4YHfTZFlVQ.0", + "date": "Fri, 14 May 2021 16:27:25 GMT", + "ms-cv": "vjaWrhECOkGmzIeQXetgAg.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "172", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:02:02 GMT", - "ms-cv": "OnFay9mxBUmRBHWbd83Y+w.0", + "date": "Fri, 14 May 2021 16:27:35 GMT", + "ms-cv": "CwVYM19JCkKYcvA8YoZnLw.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "GET", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", "query": { "api-version": "2021-01-01" }, "requestBody": null, "status": 200, - "response": "{\"id\":\"sessionId162100076811003434\",\"creationTime\":\"2021-05-14T13:59:30.3466049+00:00\",\"arrInspectorPort\":60045,\"handshakePort\":57176,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-7a1040ad-6476-44f8-aab8-a4cdc9be9b62.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:45 GMT", + "ms-cv": "288e3aUeNkyA67KXC+rgCA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:55 GMT", + "ms-cv": "25kXfI5RKkqRSsVmSJABqw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"arrInspectorPort\":59540,\"handshakePort\":62073,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-d19c5c2e-86ed-466d-8708-66a1a6369157.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", "cache-control": "no-store,no-cache", "content-length": "343", "content-type": "application/json; charset=utf-8", - "date": "Fri, 14 May 2021 14:02:14 GMT", - "ms-cv": "wQY7wBlNOUecRAo7BSeXIw.0", + "date": "Fri, 14 May 2021 16:28:06 GMT", + "ms-cv": "8CP7b3Co2U+ai2tRwncMNA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"sessions\":[{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"arrInspectorPort\":59540,\"handshakePort\":62073,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-d19c5c2e-86ed-466d-8708-66a1a6369157.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}]}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "358", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:28:08 GMT", + "ms-cv": "UcZ/VjtHr0+rn1nWXsmknQ.0", "pragma": "no-cache", "x-content-type-options": "nosniff" } }, { "method": "POST", - "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100076811003434/:stop", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468/:stop", "query": { "api-version": "2021-01-01" }, @@ -408,17 +506,17 @@ "response": "", "responseHeaders": { "api-supported-versions": "2021-01-01-preview, 2021-01-01", - "date": "Fri, 14 May 2021 14:02:14 GMT", - "ms-cv": "FLDnKwi8LkuElnVAX7foRg.0", + "date": "Fri, 14 May 2021 16:28:08 GMT", + "ms-cv": "Lb3FjYvR8EOY0RNe8EvKGg.0", "x-content-type-options": "nosniff" } } ], "uniqueTestInfo": { "uniqueName": { - "sessionId": "sessionId162100076811003434" + "sessionId": "sessionId162100951102003468" }, "newDate": {} }, - "hash": "a01d083474b8e9059226f2d7f6d1ec83" + "hash": "9fb044520b5b46cc5068e1f2a4812c78" } \ No newline at end of file From 2cc4c2ec303fe457c89674c3909f9b5fff3177a8 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 17 May 2021 13:36:24 +0100 Subject: [PATCH 115/166] Experiment: Extend timeout --- sdk/remoterendering/mixedreality-remoterendering/karma.conf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js index caf9c74a4fff..00febfec3461 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js +++ b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js @@ -124,7 +124,8 @@ module.exports = function(config) { // how many browser should be started simultaneous concurrency: 1, - browserNoActivityTimeout: 600000, + // TODO Experiment: Extend timeout to see if problem is really just a timeout. + browserNoActivityTimeout: 6000000, browserDisconnectTimeout: 10000, browserDisconnectTolerance: 3, browserConsoleLogOptions: { From 3588f1392da5a8f731002b1a395222003e456f8f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 17 May 2021 15:03:09 +0100 Subject: [PATCH 116/166] More balanced timeout --- sdk/remoterendering/mixedreality-remoterendering/karma.conf.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js index 00febfec3461..eb0da13b1f69 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js +++ b/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js @@ -124,8 +124,7 @@ module.exports = function(config) { // how many browser should be started simultaneous concurrency: 1, - // TODO Experiment: Extend timeout to see if problem is really just a timeout. - browserNoActivityTimeout: 6000000, + browserNoActivityTimeout: 1000000, browserDisconnectTimeout: 10000, browserDisconnectTolerance: 3, browserConsoleLogOptions: { From ef290c9e456c2ba11ecc5b6cdae5ec1ce4fb24ca Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 18 May 2021 17:20:49 +0100 Subject: [PATCH 117/166] Use isTokenCredential to disambiguate types. --- .../src/remoteRenderingClient.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index c7951ea2856d..68e47af48c8c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -5,7 +5,7 @@ import { InternalPipelineOptions } from "@azure/core-rest-pipeline"; import { OperationOptions } from "@azure/core-client"; import { SpanStatusCode } from "@azure/core-tracing"; -import { AccessToken, AzureKeyCredential, TokenCredential } from "@azure/core-auth"; +import { AccessToken, AzureKeyCredential, isTokenCredential, TokenCredential } from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; import { @@ -257,11 +257,10 @@ export class RemoteRenderingClient { const tokenCredential: TokenCredential = credential instanceof AzureKeyCredential - ? new MixedRealityAccountKeyCredential(accountId, credential as AzureKeyCredential) - : // TODO Make this more type safe. - credential.hasOwnProperty("token") - ? new StaticAccessTokenCredential(credential as AccessToken) - : (credential as TokenCredential); + ? new MixedRealityAccountKeyCredential(accountId, credential) + : isTokenCredential(credential) + ? credential + : new StaticAccessTokenCredential(credential as AccessToken) const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); From f6c122b65a9be9af93df4d31a523c87e733eb850 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 18 May 2021 17:22:43 +0100 Subject: [PATCH 118/166] Formatting --- .../src/remoteRenderingClient.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 68e47af48c8c..2d494cfe45ef 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -5,7 +5,12 @@ import { InternalPipelineOptions } from "@azure/core-rest-pipeline"; import { OperationOptions } from "@azure/core-client"; import { SpanStatusCode } from "@azure/core-tracing"; -import { AccessToken, AzureKeyCredential, isTokenCredential, TokenCredential } from "@azure/core-auth"; +import { + AccessToken, + AzureKeyCredential, + isTokenCredential, + TokenCredential +} from "@azure/core-auth"; import { RemoteRenderingRestClient } from "./generated"; import { @@ -260,7 +265,7 @@ export class RemoteRenderingClient { ? new MixedRealityAccountKeyCredential(accountId, credential) : isTokenCredential(credential) ? credential - : new StaticAccessTokenCredential(credential as AccessToken) + : new StaticAccessTokenCredential(credential as AccessToken); const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); From 491f074725c75349cb8c8629511320b3c2d0113a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 12:10:05 +0100 Subject: [PATCH 119/166] Some fixes from review. --- .../mixedreality-remoterendering/README.md | 2 +- .../review/template.api.md | 44 ------------------- .../mixedreality-remoterendering/sample.env | 4 +- .../samples-dev/listSessions.ts | 2 +- .../samples-dev/moreComplexConversion.ts | 15 +++---- .../src/internal/assetConversion.ts | 7 ++- .../src/internal/expectDefinedFromService.ts | 12 +++++ .../src/internal/renderingSession.ts | 22 ++++------ .../src/logger.ts | 2 +- .../src/lro/assetConversionPoller.ts | 5 ++- .../src/remoteRenderingClient.ts | 1 - .../src/tracing.ts | 2 - 12 files changed, 41 insertions(+), 77 deletions(-) delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/review/template.api.md create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 76bbfed3fc3c..bfd93fefc057 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -27,7 +27,7 @@ You will need an [Azure subscription](https://azure.microsoft.com/free/) and an Install the Template client library for JavaScript with `npm`: ```bash -npm install @azure/remoterendering +npm install @azure/mixedreality-remoterendering ``` ### Browser support diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/template.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/template.api.md deleted file mode 100644 index 3ee61bc94c0a..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/review/template.api.md +++ /dev/null @@ -1,44 +0,0 @@ -## API Report File for "@azure/template" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { OperationOptions } from '@azure/core-http'; -import { PipelineOptions } from '@azure/core-http'; -import { TokenCredential } from '@azure/core-http'; - -// @public -export class ConfigurationClient { - constructor(endpointUrl: string, credential: TokenCredential, options?: ConfigurationClientOptions); - getConfigurationSetting(key: string, options?: GetConfigurationSettingOptions): Promise; - getConfigurationSetting(setting: ConfigurationSetting, options?: GetConfigurationSettingOptions): Promise; -} - -// @public -export interface ConfigurationClientOptions extends PipelineOptions { -} - -// @public (undocumented) -export interface ConfigurationSetting { - contentType?: string; - etag?: string; - isReadOnly?: boolean; - key: string; - label?: string; - lastModified?: Date; - tags?: { - [propertyName: string]: string; - }; - value?: string; -} - -// @public -export interface GetConfigurationSettingOptions extends OperationOptions { - onlyIfChanged?: boolean; -} - - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/remoterendering/mixedreality-remoterendering/sample.env b/sdk/remoterendering/mixedreality-remoterendering/sample.env index 6fd4b78ad945..42de27e71c0a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/sample.env +++ b/sdk/remoterendering/mixedreality-remoterendering/sample.env @@ -43,8 +43,8 @@ REMOTERENDERING_ARR_SAS_TOKEN="" # Some samples can use these, but if they are not defined the samples will fall back to the # ones defined above. -# REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME2=sdktest2 -# REMOTERENDERING_ARR_BLOB_CONTAINER_NAME2=test2 +# REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME2="" +# REMOTERENDERING_ARR_BLOB_CONTAINER_NAME2="" # Our tests assume that TEST_MODE is "playback" by default. You can change it # to "record" to generate new recordings, or "live" to bypass the recorder diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts index fd5892f32903..2675787df3df 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts @@ -55,7 +55,7 @@ export async function main() { console.log("== Stop the test session =="); - client.endSession(sessionId); + await client.endSession(sessionId); } main().catch((err) => { diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts index b02f87fe23a1..acec5c7b438a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -21,7 +21,6 @@ import { DeviceCodeCredential, DeviceCodeInfo, ClientSecretCredential, - TokenCredential, DefaultAzureCredential } from "@azure/identity"; import { AzureKeyCredential } from "@azure/core-auth"; @@ -52,13 +51,13 @@ const clientId = process.env["REMOTERENDERING_CLIENT_ID"] || ""; const clientSecret = process.env["REMOTERENDERING_CLIENT_SECRET"] || ""; export function getClientWithAccountKey() { - let credential = new AzureKeyCredential(accountKey); + const credential = new AzureKeyCredential(accountKey); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); } export function getClientWithAAD() { - let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { + const credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { authorityHost: "https://login.microsoftonline.com/" + tenantId }); @@ -68,12 +67,12 @@ export function getClientWithAAD() { } export function getClientWithDeviceCode() { - let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { + const deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { console.debug(deviceCodeInfo.message); console.log(deviceCodeInfo.message); }; - let credential: TokenCredential = new DeviceCodeCredential( + const credential = new DeviceCodeCredential( tenantId, clientId, deviceCodeCallback, @@ -88,7 +87,7 @@ export function getClientWithDeviceCode() { } export function getClientWithDefaultAzureCredential() { - let credential: TokenCredential = new DefaultAzureCredential(); + const credential = new DefaultAzureCredential(); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { authenticationEndpointUrl: "https://sts.mixedreality.azure.com" @@ -102,9 +101,9 @@ export async function main() { const client = getClientWithAccountKey(); - let inputStorageUrl = + const inputStorageUrl = "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; - let outputStorageUrl = + const outputStorageUrl = "https://" + storageAccountName2 + ".blob.core.windows.net/" + blobContainerName2; const inputSettings: AssetConversionInputSettings = { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 1d8f6f41f3f9..9ef0755c4704 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -8,6 +8,9 @@ import { RemoteRenderingServiceError, KnownAssetConversionStatus } from "../generated/models/index"; +import { + expectDefinedFromService +} from "./expectDefinedFromService"; /** Properties available for an AssetConversion in any state. */ export interface AssetConversionBase { @@ -83,7 +86,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Succeeded", ...baseProperties, - output: conversion.output! + output: expectDefinedFromService(conversion, "output") }; case KnownAssetConversionStatus.Cancelled: return { @@ -94,7 +97,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Failed", ...baseProperties, - error: conversion.error! + error: expectDefinedFromService(conversion, "error") }; default: throw new Error("Unrecognized AssetConversionStatus returned by the service"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts new file mode 100644 index 000000000000..a399daf48ad8 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +// Check that obj[k] is defined. If not, throw a specific error. +export function expectDefinedFromService(obj: T, k: K) : NonNullable { + const value = obj[k]; + if (value === undefined) { + throw new Error(`Internal Error: The remote rendering service failed to set property ${k}`) + } + return value!; + } + \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 21dd3772a38a..3523f151eb00 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -7,6 +7,9 @@ import { SessionProperties, KnownRenderingSessionStatus } from "../generated/index"; +import { + expectDefinedFromService +} from "./expectDefinedFromService"; /** Properties available for a rendering session in any state */ export interface RenderingSessionBase { @@ -76,13 +79,6 @@ export interface PartialRenderingSessionProperties { readonly createdOn?: Date; } -/** The properties of a rendering session that may not be complete */ -/* -export type PartialRenderingSessionProperties = { - [P in keyof RenderingSessionProperties]+?: RenderingSessionProperties[P]; -}; -*/ - /** The rendering session is ready for incoming connections. */ export interface ReadyRenderingSession extends RenderingSessionBase { /** The rendering session is ready for incoming connections. */ @@ -134,12 +130,12 @@ function renderingSessionPropertiesFromSessionProperties( session: SessionProperties ): RenderingSessionProperties { return { - arrInspectorPort: session.arrInspectorPort!, - handshakePort: session.handshakePort!, - elapsedTimeInMinutes: session.elapsedTimeInMinutes!, - host: session.host!, - teraflops: session.teraflops!, - createdOn: session.createdOn! + arrInspectorPort: expectDefinedFromService(session, "arrInspectorPort"), + handshakePort: expectDefinedFromService(session, "handshakePort"), + elapsedTimeInMinutes: expectDefinedFromService(session, "elapsedTimeInMinutes"), + host: expectDefinedFromService(session, "host"), + teraflops: expectDefinedFromService(session, "teraflops"), + createdOn: expectDefinedFromService(session, "createdOn") }; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts b/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts index f98322638ff0..e5dc69c59636 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts @@ -8,4 +8,4 @@ import { createClientLogger } from "@azure/logger"; * * @internal */ -export const logger = createClientLogger("template"); +export const logger = createClientLogger("mixedreality-remoterendering"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index cd6088ef5d47..41a50a086da5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -28,7 +28,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati } get isStarted(): boolean { - // We do not take the KnownAssetConversionStatus.NotStarted status into account here. + // The poller is always treated as started. return true; } @@ -40,6 +40,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati } get isCancelled(): boolean { + // We don't support cancellation, so the poller is never treated as cancelled. return false; } @@ -85,7 +86,7 @@ class AssetConversionOperation } cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { - throw new Error("Cancel operation is not supported."); + return Promise.reject(new Error("Cancel operation is not supported.")); } toString(): string { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2d494cfe45ef..8199448fc0bb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -359,7 +359,6 @@ export class RemoteRenderingClient { operationOptions ); - // TODO Do I want this? await poller.poll(); return poller; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts b/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts index b8b1ae740956..9cb30cfc222d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts @@ -9,7 +9,5 @@ import { createSpanFunction } from "@azure/core-tracing"; */ export const createSpan = createSpanFunction({ packagePrefix: "Azure.MixedReality-RemoteRendering", - // TODO: oddly enough the createSpan here was actually the attribute named - // 'Microsoft.MixedReality', not 'az.namespace'. Might have been a bug. namespace: "Microsoft.MixedReality" }); From da65fdcfa4b28856d9932e6fac2ba2abde8fd1d6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 12:10:40 +0100 Subject: [PATCH 120/166] Formatting --- .../samples-dev/moreComplexConversion.ts | 11 +++-------- .../src/internal/assetConversion.ts | 4 +--- .../src/internal/expectDefinedFromService.ts | 13 ++++++------- .../src/internal/renderingSession.ts | 4 +--- .../src/lro/assetConversionPoller.ts | 2 +- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts index acec5c7b438a..1cde2a9803e4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts @@ -72,14 +72,9 @@ export function getClientWithDeviceCode() { console.log(deviceCodeInfo.message); }; - const credential = new DeviceCodeCredential( - tenantId, - clientId, - deviceCodeCallback, - { - authorityHost: "https://login.microsoftonline.com/" + tenantId - } - ); + const credential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, { + authorityHost: "https://login.microsoftonline.com/" + tenantId + }); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { authenticationEndpointUrl: "https://sts.mixedreality.azure.com/mixedreality.signin" diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 9ef0755c4704..2db15876b658 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -8,9 +8,7 @@ import { RemoteRenderingServiceError, KnownAssetConversionStatus } from "../generated/models/index"; -import { - expectDefinedFromService -} from "./expectDefinedFromService"; +import { expectDefinedFromService } from "./expectDefinedFromService"; /** Properties available for an AssetConversion in any state. */ export interface AssetConversionBase { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts index a399daf48ad8..b196ac2a47ae 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts @@ -2,11 +2,10 @@ // Licensed under the MIT license. // Check that obj[k] is defined. If not, throw a specific error. -export function expectDefinedFromService(obj: T, k: K) : NonNullable { - const value = obj[k]; - if (value === undefined) { - throw new Error(`Internal Error: The remote rendering service failed to set property ${k}`) - } - return value!; +export function expectDefinedFromService(obj: T, k: K): NonNullable { + const value = obj[k]; + if (value === undefined) { + throw new Error(`Internal Error: The remote rendering service failed to set property ${k}`); } - \ No newline at end of file + return value!; +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 3523f151eb00..32bfc6c6cefc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -7,9 +7,7 @@ import { SessionProperties, KnownRenderingSessionStatus } from "../generated/index"; -import { - expectDefinedFromService -} from "./expectDefinedFromService"; +import { expectDefinedFromService } from "./expectDefinedFromService"; /** Properties available for a rendering session in any state */ export interface RenderingSessionBase { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 41a50a086da5..29284baba498 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -40,7 +40,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati } get isCancelled(): boolean { - // We don't support cancellation, so the poller is never treated as cancelled. + // We don't support cancellation, so the poller is never treated as cancelled. return false; } From 29a81795ddf5154f0484b8a8bf6e0f4592914d8f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 12:52:39 +0100 Subject: [PATCH 121/166] Implement TODO around errors. --- .../mixedreality-remoterendering.api.md | 5 +-- .../src/generated/models/index.ts | 12 +++---- .../src/generated/models/mappers.ts | 14 ++++---- .../src/internal/assetConversion.ts | 4 +-- .../src/internal/renderingSession.ts | 4 +-- .../src/lro/assetConversionPoller.ts | 2 +- .../src/lro/renderingSessionPoller.ts | 5 ++- .../src/remoteRenderingClient.ts | 3 +- .../src/remoteRenderingServiceError.ts | 32 +++++++++++++++++++ .../swagger/README.md | 2 +- 10 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index f4fd3cba127d..598a1787f71e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -186,11 +186,12 @@ export interface RemoteRenderingClientOptions extends PipelineOptions { } // @public -export interface RemoteRenderingServiceError { +export class RemoteRenderingServiceError extends Error { + // Warning: (ae-forgotten-export) The symbol "RemoteRenderingServiceErrorInternal" needs to be exported by the entry point index.d.ts + constructor(serviceError: RemoteRenderingServiceErrorInternal); code: string; readonly details?: RemoteRenderingServiceError[]; readonly innerError?: RemoteRenderingServiceError; - message: string; readonly target?: string; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 69a30b6a50df..e5fd9a85e801 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -58,7 +58,7 @@ export interface Conversion { */ readonly output?: AssetConversionOutput; /** The error object containing details about the conversion failure. */ - error: RemoteRenderingServiceError | null; + error: RemoteRenderingServiceErrorInternal | null; /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ status: AssetConversionStatus; /** The time when the conversion was created. Date and time in ISO 8601 format. */ @@ -75,7 +75,7 @@ export interface AssetConversionOutput { } /** The error object containing details of why the request failed. */ -export interface RemoteRenderingServiceError { +export interface RemoteRenderingServiceErrorInternal { /** Error code. */ code: string; /** A human-readable representation of the error. */ @@ -84,7 +84,7 @@ export interface RemoteRenderingServiceError { * An array of details about specific errors that led to this reported error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: RemoteRenderingServiceError[]; + readonly details?: RemoteRenderingServiceErrorInternal[]; /** * The target of the particular error (e.g., the name of the property in error). * NOTE: This property will not be serialized. It can only be populated by the server. @@ -94,13 +94,13 @@ export interface RemoteRenderingServiceError { * An object containing more specific information than the current object about the error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly innerError?: RemoteRenderingServiceError; + readonly innerError?: RemoteRenderingServiceErrorInternal; } /** The error response containing details of why the request failed. */ export interface ErrorResponse { /** The error object containing details of why the request failed. */ - error: RemoteRenderingServiceError; + error: RemoteRenderingServiceErrorInternal; } /** List of conversions. */ @@ -164,7 +164,7 @@ export interface SessionProperties { * The error object containing details about the rendering session startup failure. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: RemoteRenderingServiceError | null; + readonly error?: RemoteRenderingServiceErrorInternal | null; /** * The time when the rendering session was created. Date and time in ISO 8601 format. * NOTE: This property will not be serialized. It can only be populated by the server. diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts index 64f1dc56328e..d8daf838a4c8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts @@ -146,7 +146,7 @@ export const Conversion: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "RemoteRenderingServiceError" + className: "RemoteRenderingServiceErrorInternal" } }, status: { @@ -183,10 +183,10 @@ export const AssetConversionOutput: coreClient.CompositeMapper = { } }; -export const RemoteRenderingServiceError: coreClient.CompositeMapper = { +export const RemoteRenderingServiceErrorInternal: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RemoteRenderingServiceError", + className: "RemoteRenderingServiceErrorInternal", modelProperties: { code: { serializedName: "code", @@ -210,7 +210,7 @@ export const RemoteRenderingServiceError: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RemoteRenderingServiceError" + className: "RemoteRenderingServiceErrorInternal" } } } @@ -226,7 +226,7 @@ export const RemoteRenderingServiceError: coreClient.CompositeMapper = { serializedName: "innerError", type: { name: "Composite", - className: "RemoteRenderingServiceError" + className: "RemoteRenderingServiceErrorInternal" } } } @@ -242,7 +242,7 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "RemoteRenderingServiceError" + className: "RemoteRenderingServiceErrorInternal" } } } @@ -381,7 +381,7 @@ export const SessionProperties: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "RemoteRenderingServiceError" + className: "RemoteRenderingServiceErrorInternal" } }, createdOn: { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 2db15876b658..35066a791582 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -5,10 +5,10 @@ import { Conversion, AssetConversionSettings, AssetConversionOutput, - RemoteRenderingServiceError, KnownAssetConversionStatus } from "../generated/models/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; +import { RemoteRenderingServiceError } from "../remoteRenderingServiceError"; /** Properties available for an AssetConversion in any state. */ export interface AssetConversionBase { @@ -95,7 +95,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Failed", ...baseProperties, - error: expectDefinedFromService(conversion, "error") + error: new RemoteRenderingServiceError(expectDefinedFromService(conversion, "error")) }; default: throw new Error("Unrecognized AssetConversionStatus returned by the service"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 32bfc6c6cefc..95ce51405404 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -3,11 +3,11 @@ import { RenderingServerSize, - RemoteRenderingServiceError, SessionProperties, KnownRenderingSessionStatus } from "../generated/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; +import { RemoteRenderingServiceError } from "../remoteRenderingServiceError"; /** Properties available for a rendering session in any state */ export interface RenderingSessionBase { @@ -175,7 +175,7 @@ export function renderingSessionFromSessionProperties( return { status: "Error", ...baseProperties, - error: session.error!, + error: new RemoteRenderingServiceError(expectDefinedFromService(session, "error")), partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) }; case KnownRenderingSessionStatus.Expired: diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 29284baba498..d1c5e54bee50 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -46,7 +46,7 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati get error(): Error | undefined { if (this.latestResponse.status === "Failed") { - return new Error(this.latestResponse.error.message); + return this.latestResponse.error; } return undefined; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index fed88b6265e4..f820cf54f0cf 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -36,13 +36,12 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera } get isCancelled(): boolean { - return false; + return this.latestResponse.status === KnownRenderingSessionStatus.Stopped; } get error(): Error | undefined { if (this.latestResponse.status === "Error") { - // TODO Add details - return new Error(this.latestResponse.error.message); + return this.latestResponse.error; } return undefined; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 8199448fc0bb..3f9a1aeff702 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -107,7 +107,6 @@ export { import { AssetConversionInputSettings, AssetConversionOutputSettings, - RemoteRenderingServiceError, AssetConversionOutput, AssetConversionStatus, KnownAssetConversionStatus, @@ -116,6 +115,8 @@ import { KnownRenderingServerSize } from "./generated/models/index"; +import { RemoteRenderingServiceError } from "./remoteRenderingServiceError"; + export { AssetConversionInputSettings, AssetConversionOutputSettings, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts new file mode 100644 index 000000000000..9f94f1e8ee04 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RemoteRenderingServiceErrorInternal } from "./generated"; + +/** Error object containing details about a conversion or session failure. */ +export class RemoteRenderingServiceError extends Error { + constructor(serviceError: RemoteRenderingServiceErrorInternal) { + super(serviceError.message); + Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); + this.code = serviceError.code; + this.details = serviceError.details?.map(x => new RemoteRenderingServiceError(x)); + this.target = serviceError.target; + this.innerError = (serviceError.innerError === undefined) ? undefined : new RemoteRenderingServiceError(serviceError.innerError!); + } + + /** Error code. */ + code: string; + /** + * An array of details about specific errors that led to this reported error. + */ + readonly details?: RemoteRenderingServiceError[]; + /** + * The target of the particular error (e.g., the name of the property in error). + */ + readonly target?: string; + /** + * An object containing more specific information than the current object about the error. + */ + readonly innerError?: RemoteRenderingServiceError; + } + \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 8748d88b6a8c..e1812cd2853b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -125,7 +125,7 @@ directive: - from: swagger-document where: $.definitions.error transform: > - $["x-ms-client-name"] = "RemoteRenderingServiceError"; + $["x-ms-client-name"] = "RemoteRenderingServiceErrorInternal"; ``` ```yaml From a9e67026cf9f1b1ba92e0aad49ff0f371db1982a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 13:06:02 +0100 Subject: [PATCH 122/166] Avoid exporting internal error. --- .../mixedreality-remoterendering.api.md | 9 ++- .../src/internal/assetConversion.ts | 4 +- .../src/internal/renderingSession.ts | 4 +- .../src/remoteRenderingServiceError.ts | 59 +++++++++++-------- 4 files changed, 43 insertions(+), 33 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 598a1787f71e..62365b1f9c4d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -187,12 +187,11 @@ export interface RemoteRenderingClientOptions extends PipelineOptions { // @public export class RemoteRenderingServiceError extends Error { - // Warning: (ae-forgotten-export) The symbol "RemoteRenderingServiceErrorInternal" needs to be exported by the entry point index.d.ts - constructor(serviceError: RemoteRenderingServiceErrorInternal); + constructor(message: string, code: string); code: string; - readonly details?: RemoteRenderingServiceError[]; - readonly innerError?: RemoteRenderingServiceError; - readonly target?: string; + details?: RemoteRenderingServiceError[]; + innerError?: RemoteRenderingServiceError; + target?: string; } // @public diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 35066a791582..7ea754569841 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -8,7 +8,7 @@ import { KnownAssetConversionStatus } from "../generated/models/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; -import { RemoteRenderingServiceError } from "../remoteRenderingServiceError"; +import { RemoteRenderingServiceError, createRemoteRenderingServiceError } from "../remoteRenderingServiceError"; /** Properties available for an AssetConversion in any state. */ export interface AssetConversionBase { @@ -95,7 +95,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Failed", ...baseProperties, - error: new RemoteRenderingServiceError(expectDefinedFromService(conversion, "error")) + error: createRemoteRenderingServiceError(expectDefinedFromService(conversion, "error")) }; default: throw new Error("Unrecognized AssetConversionStatus returned by the service"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 95ce51405404..2db733b14364 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -7,7 +7,7 @@ import { KnownRenderingSessionStatus } from "../generated/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; -import { RemoteRenderingServiceError } from "../remoteRenderingServiceError"; +import { RemoteRenderingServiceError, createRemoteRenderingServiceError } from "../remoteRenderingServiceError"; /** Properties available for a rendering session in any state */ export interface RenderingSessionBase { @@ -175,7 +175,7 @@ export function renderingSessionFromSessionProperties( return { status: "Error", ...baseProperties, - error: new RemoteRenderingServiceError(expectDefinedFromService(session, "error")), + error: createRemoteRenderingServiceError(expectDefinedFromService(session, "error")), partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) }; case KnownRenderingSessionStatus.Expired: diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts index 9f94f1e8ee04..296305c6789b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts @@ -5,28 +5,39 @@ import { RemoteRenderingServiceErrorInternal } from "./generated"; /** Error object containing details about a conversion or session failure. */ export class RemoteRenderingServiceError extends Error { - constructor(serviceError: RemoteRenderingServiceErrorInternal) { - super(serviceError.message); - Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); - this.code = serviceError.code; - this.details = serviceError.details?.map(x => new RemoteRenderingServiceError(x)); - this.target = serviceError.target; - this.innerError = (serviceError.innerError === undefined) ? undefined : new RemoteRenderingServiceError(serviceError.innerError!); - } - - /** Error code. */ - code: string; - /** - * An array of details about specific errors that led to this reported error. - */ - readonly details?: RemoteRenderingServiceError[]; - /** - * The target of the particular error (e.g., the name of the property in error). - */ - readonly target?: string; - /** - * An object containing more specific information than the current object about the error. - */ - readonly innerError?: RemoteRenderingServiceError; + constructor(message:string, code:string) { + super(message); + Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); + this.code = code; } - \ No newline at end of file + + /** Error code. */ + code: string; + + /** + * An array of details about specific errors that led to this reported error. + */ + details?: RemoteRenderingServiceError[]; + + /** + * The target of the particular error (e.g., the name of the property in error). + */ + target?: string; + + /** + * An object containing more specific information than the current object about the error. + */ + innerError?: RemoteRenderingServiceError; +} + +/** Create a RemoteRenderingServiceError from a RemoteRenderingServiceErrorInternal */ +export function createRemoteRenderingServiceError(serviceError: RemoteRenderingServiceErrorInternal): RemoteRenderingServiceError { + const newError = new RemoteRenderingServiceError(serviceError.message, serviceError.code); + newError.details = serviceError.details?.map((x) => createRemoteRenderingServiceError(x)); + newError.target = serviceError.target; + newError.innerError = + serviceError.innerError === undefined + ? undefined + : createRemoteRenderingServiceError(serviceError.innerError!); + return newError; +} From 0089a0c77a88e1585d07a5d170c6d62db6af72a1 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 13:06:27 +0100 Subject: [PATCH 123/166] Formatting --- .../src/internal/assetConversion.ts | 5 ++++- .../src/internal/renderingSession.ts | 5 ++++- .../src/remoteRenderingServiceError.ts | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 7ea754569841..258d48f1fd7d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -8,7 +8,10 @@ import { KnownAssetConversionStatus } from "../generated/models/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; -import { RemoteRenderingServiceError, createRemoteRenderingServiceError } from "../remoteRenderingServiceError"; +import { + RemoteRenderingServiceError, + createRemoteRenderingServiceError +} from "../remoteRenderingServiceError"; /** Properties available for an AssetConversion in any state. */ export interface AssetConversionBase { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 2db733b14364..679b05b44756 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -7,7 +7,10 @@ import { KnownRenderingSessionStatus } from "../generated/index"; import { expectDefinedFromService } from "./expectDefinedFromService"; -import { RemoteRenderingServiceError, createRemoteRenderingServiceError } from "../remoteRenderingServiceError"; +import { + RemoteRenderingServiceError, + createRemoteRenderingServiceError +} from "../remoteRenderingServiceError"; /** Properties available for a rendering session in any state */ export interface RenderingSessionBase { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts index 296305c6789b..2238b0d24dd5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts @@ -5,7 +5,7 @@ import { RemoteRenderingServiceErrorInternal } from "./generated"; /** Error object containing details about a conversion or session failure. */ export class RemoteRenderingServiceError extends Error { - constructor(message:string, code:string) { + constructor(message: string, code: string) { super(message); Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); this.code = code; @@ -31,7 +31,9 @@ export class RemoteRenderingServiceError extends Error { } /** Create a RemoteRenderingServiceError from a RemoteRenderingServiceErrorInternal */ -export function createRemoteRenderingServiceError(serviceError: RemoteRenderingServiceErrorInternal): RemoteRenderingServiceError { +export function createRemoteRenderingServiceError( + serviceError: RemoteRenderingServiceErrorInternal +): RemoteRenderingServiceError { const newError = new RemoteRenderingServiceError(serviceError.message, serviceError.code); newError.details = serviceError.details?.map((x) => createRemoteRenderingServiceError(x)); newError.target = serviceError.target; From 07e66fd23765d08c93941d66b42d52ad26460459 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 13:17:06 +0100 Subject: [PATCH 124/166] Update package name --- sdk/remoterendering/mixedreality-remoterendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index bfd93fefc057..65ef9e7ce02c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -22,7 +22,7 @@ the lifetime of remote rendering sessions. You will need an [Azure subscription](https://azure.microsoft.com/free/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. -### Install the `@azure/template` package +### Install the `@azure/mixedreality-remoterendering` package Install the Template client library for JavaScript with `npm`: From d5430dd6de22d8f6c2dd6a332c2fa6efa336817f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 14:32:31 +0100 Subject: [PATCH 125/166] Mark many functions internal. --- .../review/mixedreality-remoterendering.api.md | 10 +++++----- .../authentication/mixedRealityTokenCredential.ts | 4 ++++ .../authentication/staticAccessTokenCredential.ts | 4 ++++ .../src/internal/assetConversion.ts | 5 +++++ .../src/internal/commonQueries.ts | 15 +++++++++++++++ .../src/internal/expectDefinedFromService.ts | 5 ++++- .../src/internal/renderingSession.ts | 10 ++++++++++ .../src/lro/assetConversionPoller.ts | 15 +++++++++++++++ .../src/lro/renderingSessionPoller.ts | 15 +++++++++++++++ .../src/remoteRenderingServiceError.ts | 3 +++ 10 files changed, 80 insertions(+), 6 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 62365b1f9c4d..02944067e6ae 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -13,7 +13,7 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; import { TokenCredential } from '@azure/core-auth'; -// @public (undocumented) +// @public export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; // @public @@ -31,7 +31,7 @@ export interface AssetConversionInputSettings { storageContainerUrl: string; } -// @public (undocumented) +// @public export interface AssetConversionOperationState extends PollOperationState { latestResponse: AssetConversion; } @@ -52,7 +52,7 @@ export interface AssetConversionOutputSettings { // @public (undocumented) export type AssetConversionPollerLike = PollerLike; -// @public (undocumented) +// @public export interface AssetConversionPollerOptions { // (undocumented) intervalInMs?: number; @@ -207,7 +207,7 @@ export interface RenderingSessionBase { size: RenderingServerSize; } -// @public (undocumented) +// @public export interface RenderingSessionOperationState extends PollOperationState { latestResponse: RenderingSession; } @@ -215,7 +215,7 @@ export interface RenderingSessionOperationState extends PollOperationState; -// @public (undocumented) +// @public export interface RenderingSessionPollerOptions { // (undocumented) intervalInMs?: number; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts index c562c89c8364..01f0480d5e78 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts @@ -9,6 +9,10 @@ import { } from "@azure/mixedreality-authentication"; import { StaticAccessTokenCredential } from "./staticAccessTokenCredential"; +/** + * Represents a token credential that can be used to access a Mixed Reality service. + * @internal + */ export class MixedRealityTokenCredential implements TokenCredential { private stsClient: MixedRealityStsClient; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts index 0701740a3299..e2866cc654ac 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts @@ -3,6 +3,10 @@ import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth"; +/** + * Represents a static access token credential. + * @internal + */ export class StaticAccessTokenCredential implements TokenCredential { private token: AccessToken; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index 258d48f1fd7d..fec147051434 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -59,6 +59,7 @@ export interface CancelledAssetConversion extends AssetConversionBase { status: "Cancelled"; } +/** A type representing the various states of a conversion. This is a tagged union with "status" as its discriminant property. */ export type AssetConversion = | NonStartedAssetConversion | RunningAssetConversion @@ -66,6 +67,10 @@ export type AssetConversion = | FailedAssetConversion | CancelledAssetConversion; +/** + * Build an AssetConversion object from the conversion object returned by the service. + * @internal + */ export function assetConversionFromConversion(conversion: Conversion): AssetConversion { const baseProperties: AssetConversionBase = { conversionId: conversion.conversionId, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index e82e69cefe00..cdf2b268c650 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -8,6 +8,11 @@ import { SpanStatusCode } from "@azure/core-tracing"; import { AssetConversion, assetConversionFromConversion } from "./assetConversion"; import { RenderingSession, renderingSessionFromSessionProperties } from "./renderingSession"; +/** + * Call getConversion on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName The name to use for the span that wraps the call. + * @internal + */ export async function getConversionInternal( accountId: string, operations: RemoteRendering, @@ -34,6 +39,11 @@ export async function getConversionInternal( } } +/** + * Call getSession on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName The name to use for the span that wraps the call. + * @internal + */ export async function getSessionInternal( accountId: string, operations: RemoteRendering, @@ -60,6 +70,11 @@ export async function getSessionInternal( } } +/** + * Call endSession on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName The name to use for the span that wraps the call. + * @internal + */ export async function endSessionInternal( accountId: string, operations: RemoteRendering, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts index b196ac2a47ae..3d7da35e74cb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts @@ -1,7 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -// Check that obj[k] is defined. If not, throw a specific error. +/** + * Check that obj[k] is defined. If not, throw a specific error. + * @internal + */ export function expectDefinedFromService(obj: T, k: K): NonNullable { const value = obj[k]; if (value === undefined) { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 679b05b44756..3257bb032e8c 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -127,6 +127,9 @@ export type RenderingSession = | ExpiredRenderingSession | StoppedRenderingSession; +/** + * @internal + */ function renderingSessionPropertiesFromSessionProperties( session: SessionProperties ): RenderingSessionProperties { @@ -140,6 +143,9 @@ function renderingSessionPropertiesFromSessionProperties( }; } +/** + * @internal + */ function partialRenderingSessionPropertiesFromSessionProperties( session: SessionProperties ): PartialRenderingSessionProperties { @@ -153,6 +159,10 @@ function partialRenderingSessionPropertiesFromSessionProperties( }; } +/** + * Build a RenderingSession object from the SessionProperties object returned by the service. + * @internal + */ export function renderingSessionFromSessionProperties( session: SessionProperties ): RenderingSession { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index d1c5e54bee50..fd4b862feb23 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -9,10 +9,16 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { delay } from "@azure/core-util"; import { AssetConversion } from "../internal/assetConversion"; +/** + * Options to configure the LRO poller for the beginConversion operation. + */ export interface AssetConversionPollerOptions { intervalInMs?: number; } +/** + * The state carried by the LRO poller for the beginConversion operation. + */ export interface AssetConversionOperationState extends PollOperationState { /** * The latest response when querying the service. The conversion may or may not be completed. @@ -20,6 +26,9 @@ export interface AssetConversionOperationState extends PollOperationState { private accountId: string; @@ -94,6 +106,9 @@ class AssetConversionOperation } } +/** + * @internal + */ export class AssetConversionPoller extends Poller< AssetConversionOperationStateImpl, AssetConversion diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index f820cf54f0cf..8c781be85b68 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -9,10 +9,16 @@ import { RemoteRendering } from "../generated/operations"; import { delay } from "@azure/core-util"; import { RenderingSession } from "../internal/renderingSession"; +/** + * Options to configure the LRO poller for the beginSession operation. + */ export interface RenderingSessionPollerOptions { intervalInMs?: number; } +/** + * The state carried by the LRO poller for the beginSession operation. + */ export interface RenderingSessionOperationState extends PollOperationState { /** * The latest response when querying the service. The session may or may not be ready. @@ -20,6 +26,9 @@ export interface RenderingSessionOperationState extends PollOperationState { private accountId: string; @@ -109,6 +121,9 @@ class RenderingSessionOperation } } +/** + * @internal + */ export class RenderingSessionPoller extends Poller< RenderingSessionOperationStateImpl, RenderingSession diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts index 2238b0d24dd5..ff7853d275e9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts @@ -5,6 +5,9 @@ import { RemoteRenderingServiceErrorInternal } from "./generated"; /** Error object containing details about a conversion or session failure. */ export class RemoteRenderingServiceError extends Error { + /** + * Create a RemoteRenderingServiceError with a message and code. + */ constructor(message: string, code: string) { super(message); Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); From baae52e3479eded0b8fc5d5033652a2e8dfdbc93 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 21 May 2021 14:46:07 +0100 Subject: [PATCH 126/166] Document the undocumented. --- .../mixedreality-remoterendering.api.md | 34 +++++++------------ .../src/internal/renderingSession.ts | 15 ++++++++ .../src/lro/assetConversionPoller.ts | 5 +-- .../src/lro/renderingSessionPoller.ts | 5 +-- .../src/remoteRenderingClient.ts | 14 ++++++-- 5 files changed, 45 insertions(+), 28 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 02944067e6ae..1b0025294705 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -49,12 +49,11 @@ export interface AssetConversionOutputSettings { storageContainerWriteSas?: string; } -// @public (undocumented) +// @public export type AssetConversionPollerLike = PollerLike; // @public export interface AssetConversionPollerOptions { - // (undocumented) intervalInMs?: number; } @@ -67,10 +66,10 @@ export interface AssetConversionSettings { // @public export type AssetConversionStatus = string; -// @public (undocumented) +// @public export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; -// @public (undocumented) +// @public export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; // @public @@ -78,20 +77,18 @@ export interface CancelledAssetConversion extends AssetConversionBase { status: "Cancelled"; } -// @public (undocumented) +// @public export type EndSessionOptions = OperationOptions; // @public export interface ErrorRenderingSession extends RenderingSessionBase { readonly error: RemoteRenderingServiceError; - // (undocumented) partialProperties: PartialRenderingSessionProperties; status: "Error"; } // @public export interface ExpiredRenderingSession extends RenderingSessionBase { - // (undocumented) properties: RenderingSessionProperties; status: "Expired"; } @@ -102,15 +99,12 @@ export interface FailedAssetConversion extends AssetConversionBase { status: "Failed"; } -// @public (undocumented) +// @public export type GetConversionOptions = OperationOptions; -// @public (undocumented) +// @public export type GetSessionOptions = OperationOptions; -// @public (undocumented) -export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; - // @public export const enum KnownAssetConversionStatus { Cancelled = "Cancelled", @@ -135,10 +129,10 @@ export const enum KnownRenderingSessionStatus { Stopped = "Stopped" } -// @public (undocumented) +// @public export type ListConversionsOptions = OperationOptions; -// @public (undocumented) +// @public export type ListSessionsOptions = OperationOptions; // @public @@ -158,7 +152,6 @@ export interface PartialRenderingSessionProperties { // @public export interface ReadyRenderingSession extends RenderingSessionBase { - // (undocumented) properties: RenderingSessionProperties; status: "Ready"; } @@ -212,12 +205,11 @@ export interface RenderingSessionOperationState extends PollOperationState; // @public export interface RenderingSessionPollerOptions { - // (undocumented) intervalInMs?: number; } @@ -237,12 +229,12 @@ export interface RenderingSessionSettings { size: RenderingServerSize; } -// @public (undocumented) +// @public export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string; }; -// @public (undocumented) +// @public export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: string; }; @@ -254,14 +246,12 @@ export interface RunningAssetConversion extends AssetConversionBase { // @public export interface StartingRenderingSession extends RenderingSessionBase { - // (undocumented) partialProperties: PartialRenderingSessionProperties; status: "Starting"; } // @public export interface StoppedRenderingSession extends RenderingSessionBase { - // (undocumented) partialProperties: PartialRenderingSessionProperties; status: "Stopped"; } @@ -272,7 +262,7 @@ export interface SucceededAssetConversion extends AssetConversionBase { status: "Succeeded"; } -// @public (undocumented) +// @public export type UpdateSessionOptions = OperationOptions; // @public diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index 3257bb032e8c..a48e891730f4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -84,6 +84,9 @@ export interface PartialRenderingSessionProperties { export interface ReadyRenderingSession extends RenderingSessionBase { /** The rendering session is ready for incoming connections. */ status: "Ready"; + /** + * The properties of the session. + */ properties: RenderingSessionProperties; } @@ -95,6 +98,9 @@ export interface ErrorRenderingSession extends RenderingSessionBase { * The error object containing details about the rendering session startup failure. */ readonly error: RemoteRenderingServiceError; + /** + * The properties of the session which had been set. + */ partialProperties: PartialRenderingSessionProperties; } @@ -102,6 +108,9 @@ export interface ErrorRenderingSession extends RenderingSessionBase { export interface StartingRenderingSession extends RenderingSessionBase { /** The rendering session is starting, but not accepting incoming connections yet. */ status: "Starting"; + /** + * The properties which are currently known about the session. + */ partialProperties: PartialRenderingSessionProperties; } @@ -109,6 +118,9 @@ export interface StartingRenderingSession extends RenderingSessionBase { export interface ExpiredRenderingSession extends RenderingSessionBase { /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ status: "Expired"; + /** + * The properties of the session. + */ properties: RenderingSessionProperties; } @@ -116,6 +128,9 @@ export interface ExpiredRenderingSession extends RenderingSessionBase { export interface StoppedRenderingSession extends RenderingSessionBase { /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ status: "Stopped"; + /** + * The properties that were known about the session. + */ partialProperties: PartialRenderingSessionProperties; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index fd4b862feb23..882b90c715d5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -10,14 +10,15 @@ import { delay } from "@azure/core-util"; import { AssetConversion } from "../internal/assetConversion"; /** - * Options to configure the LRO poller for the beginConversion operation. + * Options to configure the poller for the beginConversion operation. */ export interface AssetConversionPollerOptions { + /** The interval between calls to poll the service for the status of a conversion. */ intervalInMs?: number; } /** - * The state carried by the LRO poller for the beginConversion operation. + * The state carried by the poller for the beginConversion operation. */ export interface AssetConversionOperationState extends PollOperationState { /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index 8c781be85b68..ae3cdd86e37a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -10,14 +10,15 @@ import { delay } from "@azure/core-util"; import { RenderingSession } from "../internal/renderingSession"; /** - * Options to configure the LRO poller for the beginSession operation. + * Options to configure the poller for the beginSession operation. */ export interface RenderingSessionPollerOptions { + /** The interval between calls to poll the service for the status of a session. */ intervalInMs?: number; } /** - * The state carried by the LRO poller for the beginSession operation. + * The state carried by the poller for the beginSession operation. */ export interface RenderingSessionOperationState extends PollOperationState { /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 3f9a1aeff702..952e972630e1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -129,30 +129,40 @@ export { KnownRenderingServerSize }; +/** The poller returned by the beginConversion operation. */ export type AssetConversionPollerLike = PollerLike; +/** Options to configure the beginConversion operation. */ export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; +/** Options for resuming a pre-existing conversion operation. */ export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string }; +/** Options to configure the beginSession operation. */ export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; +/** Options for resuming a pre-existing session operation. */ export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: string }; -export type GetSessionPollerOptions = RenderingSessionPollerOptions & OperationOptions; - +/** Options to configure the updateSession operation. */ export type UpdateSessionOptions = OperationOptions; +/** Options to configure the getSession operation. */ export type GetSessionOptions = OperationOptions; +/** Options to configure the getConversion operation. */ export type GetConversionOptions = OperationOptions; +/** Options to configure the listConversions operation. */ export type ListConversionsOptions = OperationOptions; +/** Options to configure the endSession operation. */ export type EndSessionOptions = OperationOptions; +/** Options to configure the listSessions operation. */ export type ListSessionsOptions = OperationOptions; +/** The poller returned by the beginSession operation. */ export type RenderingSessionPollerLike = PollerLike< RenderingSessionOperationState, RenderingSession From fba8dcbccc8ce63203fa6d5d23b87da9c1b89bb6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 26 May 2021 11:03:03 +0100 Subject: [PATCH 127/166] Update package reference --- sdk/remoterendering/mixedreality-remoterendering/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 1a3065d4682c..34cf84cc4f6b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -75,7 +75,7 @@ "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.0.0", + "@azure/core-rest-pipeline": "^1.0.3", "@azure/core-client": "^1.0.0", "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", From 715fb18ef8904e6c8ef5a655842321a2fcab774b Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 25 Jun 2021 10:03:25 +0100 Subject: [PATCH 128/166] Bring PR up-to-date --- common/config/rush/pnpm-lock.yaml | 28 +++++++++---------- .../mixedreality-remoterendering/package.json | 6 ++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ce494c739c50..349ce999eb45 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10437,48 +10437,46 @@ packages: version: 0.0.0 file:projects/mixedreality-remoterendering.tgz: dependencies: - '@azure/core-rest-pipeline': 1.0.3 - '@azure/core-tracing': 1.0.0-preview.11 '@azure/identity': 1.3.0 '@microsoft/api-extractor': 7.7.11 - '@types/chai': 4.2.16 - '@types/chai-as-promised': 7.1.3 + '@types/chai': 4.2.19 + '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 '@types/node': 8.10.66 '@types/uuid': 8.3.0 chai: 4.3.4 chai-as-promised: 7.1.1_chai@4.3.4 cross-env: 7.0.3 - dotenv: 8.2.0 - eslint: 7.23.0 + dotenv: 8.6.0 + eslint: 7.29.0 inherits: 2.0.4 - karma: 6.3.2 + karma: 6.3.4 karma-chrome-launcher: 3.1.0 karma-coverage: 2.0.3 - karma-edge-launcher: 0.4.2_karma@6.3.2 + karma-edge-launcher: 0.4.2_karma@6.3.4 karma-env-preprocessor: 0.1.1 karma-firefox-launcher: 1.3.0 - karma-ie-launcher: 1.0.0_karma@6.3.2 - karma-json-preprocessor: 0.3.3_karma@6.3.2 + karma-ie-launcher: 1.0.0_karma@6.3.4 + karma-json-preprocessor: 0.3.3_karma@6.3.4 karma-json-to-file-reporter: 1.0.1 - karma-junit-reporter: 2.0.1_karma@6.3.2 + karma-junit-reporter: 2.0.1_karma@6.3.4 karma-mocha: 2.0.1 - karma-mocha-reporter: 2.2.5_karma@6.3.2 + karma-mocha-reporter: 2.2.5_karma@6.3.4 mocha: 7.2.0 mocha-junit-reporter: 1.23.3_mocha@7.2.0 nyc: 14.1.1 prettier: 1.19.1 rimraf: 3.0.2 rollup: 1.32.1 - tslib: 2.2.0 + tslib: 2.3.0 typedoc: 0.15.2 typescript: 4.2.4 - util: 0.12.3 + util: 0.12.4 uuid: 8.3.2 dev: false name: '@rush-temp/mixedreality-remoterendering' resolution: - integrity: sha512-1Ny6rrGSO8Cydm0MM+IWsI+WCnk1JATj+c+wAlJo6y8SAgThYC8K7ilHf7hP0sipKrH2dFLH9s3C2iWAFqSd+Q== + integrity: sha512-Nom/elH8JPiCHQQPDNpUBguvChhXeZGl+TagIMnDmXKxTfbkS55CwBT11VZbhYPcHT9dLFRgQGH6DG6s7BY3bg== tarball: file:projects/mixedreality-remoterendering.tgz version: 0.0.0 file:projects/mock-hub.tgz: diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 34cf84cc4f6b..9cf04749c6d9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -77,11 +77,11 @@ "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.0.3", "@azure/core-client": "^1.0.0", - "@azure/core-tracing": "1.0.0-preview.11", + "@azure/core-tracing": "1.0.0-preview.12", "@azure/logger": "^1.0.0", - "tslib": "^2.0.0", + "tslib": "^2.2.0", "@azure/mixedreality-authentication": "1.0.0-beta.1", - "@azure/core-lro": "^1.0.2", + "@azure/core-lro": "^2.0.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.1.1", "@azure/core-util": "^1.0.0-beta.1" From a092f4f9dfa4104ea007db0f67564b6cf90503a9 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:40:35 +0100 Subject: [PATCH 129/166] Update sdk/remoterendering/mixedreality-remoterendering/README.md Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 65ef9e7ce02c..eedb481a5c02 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -16,7 +16,8 @@ the lifetime of remote rendering sessions. ### Currently supported environments -- Node.js version 8.x or higher +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge, and Firefox. ### Prerequisites From 1211759402421ab03221beb0b6ed95aac5288a8f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:42:37 +0100 Subject: [PATCH 130/166] Update sdk/remoterendering/mixedreality-remoterendering/README.md Co-authored-by: Deyaaeldeen Almahallawi --- .../mixedreality-remoterendering/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index eedb481a5c02..dffadf2826b1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -388,6 +388,15 @@ Similarly, sometimes when a session is requested, the session ends up in an erro The startSessionOperation method will return a RenderingSession object, but that object will have an Error status and carry a RemoteRenderingServiceError with details. +### 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 +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); + ## Next steps - Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/) From 322240a1829ffd0a5f82ea6424dd8a9e73520667 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:42:53 +0100 Subject: [PATCH 131/166] Update sdk/remoterendering/mixedreality-remoterendering/README.md Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index dffadf2826b1..f3e9ed268b72 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -406,7 +406,7 @@ setLogLevel("info"); ## Contributing -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. +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 From 0faf6b0a6986963a566104b432942608f6e90914 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:43:08 +0100 Subject: [PATCH 132/166] Update sdk/remoterendering/mixedreality-remoterendering/README.md Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index f3e9ed268b72..047aaa5f28bf 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -43,7 +43,7 @@ To use this client library in the browser, first you need to use a bundler. For NOTE: if your service supports CORS natively please provide instructions for enabling CORS at the service level (similar to the sample below), otherwise replace this section with guidance such as: -Due to Azure template service CORS limitation this library cannot be used to make direct calls to the template service from a browser. Please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/master/samples/cors/ts/README.md) for guidance. +Due to Azure template service CORS limitation this library cannot be used to make direct calls to the template service from a browser. Please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/cors/ts/README.md) for guidance. You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). From 5883d7d872bfa6e8e97793e42cdb458a641aea4c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:43:17 +0100 Subject: [PATCH 133/166] Update sdk/remoterendering/mixedreality-remoterendering/README.md Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 047aaa5f28bf..b3ec3cbba4bb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -143,7 +143,7 @@ return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, cred #### Authenticating with a static access token You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the -[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/mixedreality/Azure.MixedReality.Authentication) +[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/mixedreality/Azure.MixedReality.Authentication) to be used with a Mixed Reality client library: ```typescript Snippet:CreateAClientWithStaticAccessToken From 8f33756a1328a61c690d5f2925d279e210adb9c0 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:51:11 +0100 Subject: [PATCH 134/166] Update sdk/remoterendering/test-resources-post.ps1 Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/test-resources-post.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/test-resources-post.ps1 b/sdk/remoterendering/test-resources-post.ps1 index 068dd4ebc92a..73cc2b2e88e5 100644 --- a/sdk/remoterendering/test-resources-post.ps1 +++ b/sdk/remoterendering/test-resources-post.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. # This script is used to generate the Test Configuration file for Storage live tests. -# It is invoked by the https://github.com/Azure/azure-sdk-for-net/blob/master/eng/New-TestResources.ps1 +# It is invoked by the https://github.com/Azure/azure-sdk-for-js/blob/main/eng/New-TestResources.ps1 # script after the ARM template, defined in https://github.com/Azure/azure-sdk-for-net/blob/arm-template-storage/sdk/storage/test-resources.json, # is finished being deployed. The ARM template is responsible for creating the Storage accounts needed for live tests. From 7c285b4746bfab40257794c359454ed1dda406da Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:55:14 +0100 Subject: [PATCH 135/166] Update sdk/remoterendering/mixedreality-remoterendering/package.json Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 9cf04749c6d9..737860ba6095 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -70,7 +70,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/remoterendering/mixedreality-remoterendering/README.md", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/remoterendering/mixedreality-remoterendering/README.md", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { From 46d27d7c23696e1ba137345f980b2a4ab4e37f81 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:55:28 +0100 Subject: [PATCH 136/166] Update sdk/remoterendering/mixedreality-remoterendering/package.json Co-authored-by: Deyaaeldeen Almahallawi --- sdk/remoterendering/mixedreality-remoterendering/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 737860ba6095..7dfb509d2635 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -58,7 +58,7 @@ ], "repository": "github:Azure/azure-sdk-for-js", "engines": { - "node": ">=8.0.0" + "node": ">=12.0.0" }, "keywords": [ "azure", From a4492d048280db6a0ceed300ba4d0e6e4686f09c Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell <36992510+MalcolmTyrrell@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:58:51 +0100 Subject: [PATCH 137/166] Update sdk/remoterendering/mixedreality-remoterendering/swagger/README.md Co-authored-by: Deyaaeldeen Almahallawi --- .../mixedreality-remoterendering/swagger/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index e1812cd2853b..954b94d445ed 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -18,9 +18,7 @@ add-credentials: false package-version: 1.0.0-beta.1 disable-async-iterators: true hide-clients: true -use-core-v2: true -use-extension: - "@autorest/typescript": "https://aka.ms/autorest/typescript/corev2" +typescript: true ``` ```yaml From 4f827979273966f9128e4375025a4011a2fb08c8 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 10:14:29 +0100 Subject: [PATCH 138/166] README improvements --- .../mixedreality-remoterendering/README.md | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index b3ec3cbba4bb..9f50540fc342 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -143,7 +143,7 @@ return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, cred #### Authenticating with a static access token You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the -[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/mixedreality/Azure.MixedReality.Authentication) +[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication) to be used with a Mixed Reality client library: ```typescript Snippet:CreateAClientWithStaticAccessToken @@ -361,14 +361,14 @@ client.endSession(sessionId); ## Troubleshooting -### Enable logs +### Logging -You can set the following environment variable to see debug logs when using this library. +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`: -- Getting debug logs from the Azure TextAnalytics client library +```javascript +import { setLogLevel } from "@azure/logger"; -```bash -export DEBUG=azure* +setLogLevel("info"); ``` ### Azure Remote Rendering troubleshooting @@ -388,15 +388,6 @@ Similarly, sometimes when a session is requested, the session ends up in an erro The startSessionOperation method will return a RenderingSession object, but that object will have an Error status and carry a RemoteRenderingServiceError with details. -### 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 -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); - ## Next steps - Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/) From dc70edc86292f31521d5723d3dd6d4fc677c3927 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 12:38:54 +0100 Subject: [PATCH 139/166] Don't use const enum --- .../src/generated/models/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index e5fd9a85e801..481c855f996d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -304,7 +304,7 @@ export interface RemoteRenderingListSessionsNextExceptionHeaders { } /** Known values of {@link AssetConversionStatus} that the service accepts. */ -export const enum KnownAssetConversionStatus { +export enum KnownAssetConversionStatus { /** The conversion was created but hasn't started. */ NotStarted = "NotStarted", /** The conversion is running. */ @@ -331,7 +331,7 @@ export const enum KnownAssetConversionStatus { export type AssetConversionStatus = string; /** Known values of {@link RenderingServerSize} that the service accepts. */ -export const enum KnownRenderingServerSize { +export enum KnownRenderingServerSize { /** Standard rendering session size. */ Standard = "Standard", /** Premium rendering session size. */ @@ -349,7 +349,7 @@ export const enum KnownRenderingServerSize { export type RenderingServerSize = string; /** Known values of {@link RenderingSessionStatus} that the service accepts. */ -export const enum KnownRenderingSessionStatus { +export enum KnownRenderingSessionStatus { /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ Error = "Error", /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ From 5d66bc6e6cc54fe41a04fa7f123b1d48eddf66f8 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 12:39:24 +0100 Subject: [PATCH 140/166] Restore corev2 generation --- .../mixedreality-remoterendering/swagger/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index 954b94d445ed..e1812cd2853b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -18,7 +18,9 @@ add-credentials: false package-version: 1.0.0-beta.1 disable-async-iterators: true hide-clients: true -typescript: true +use-core-v2: true +use-extension: + "@autorest/typescript": "https://aka.ms/autorest/typescript/corev2" ``` ```yaml From 4cca4b69f8cacd4c61e1b31c5d63805a3355d737 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 14:34:36 +0100 Subject: [PATCH 141/166] No need for null check. --- .../src/authentication/authenticationEndpoint.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts index 2e0ac1738ed3..844e165d4656 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts @@ -7,9 +7,5 @@ * @param accountDomain The Mixed Reality account domain. */ export function constructAuthenticationEndpointFromDomain(accountDomain: string): string { - if (!accountDomain) { - throw new Error("Argument cannot be null or empty: 'accountDomain'."); - } - return `https://sts.${accountDomain}`; } From 864bd7b09924603d78477e5e30f5882ad3694334 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 15:50:26 +0100 Subject: [PATCH 142/166] Linter fixes --- .../authentication/authenticationEndpoint.ts | 2 +- .../mixedRealityAccountKeyCredential.ts | 4 +- .../src/internal/commonQueries.ts | 6 +- .../src/remoteRenderingClient.ts | 74 +++++++++---------- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts index 844e165d4656..9885f03acd09 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts @@ -4,7 +4,7 @@ /** * Constructs the authentication endpoint from a Mixed Reality account domain. * @internal - * @param accountDomain The Mixed Reality account domain. + * @param accountDomain - The Mixed Reality account domain. */ export function constructAuthenticationEndpointFromDomain(accountDomain: string): string { return `https://sts.${accountDomain}`; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts index 1d52f19df5f9..ee5096ac1db2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts @@ -19,8 +19,8 @@ export class MixedRealityAccountKeyCredential implements TokenCredential { /** * Creates an instance of a MixedRealityAccountKeyCredential. - * @param accountId The Mixed Reality service account identifier. - * @param accountKey The Mixed Reality service account primary or secondary key. + * @param accountId - The Mixed Reality service account identifier. + * @param accountKey - The Mixed Reality service account primary or secondary key. */ constructor(public readonly accountId: string, accountKey: string | AzureKeyCredential) { if (typeof accountKey === "string") { diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index cdf2b268c650..c4266147fee8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -10,7 +10,7 @@ import { RenderingSession, renderingSessionFromSessionProperties } from "./rende /** * Call getConversion on the service, wrapped in a tracing span with a provided name. - * @param tracingSpanName The name to use for the span that wraps the call. + * @param tracingSpanName - The name to use for the span that wraps the call. * @internal */ export async function getConversionInternal( @@ -41,7 +41,7 @@ export async function getConversionInternal( /** * Call getSession on the service, wrapped in a tracing span with a provided name. - * @param tracingSpanName The name to use for the span that wraps the call. + * @param tracingSpanName - The name to use for the span that wraps the call. * @internal */ export async function getSessionInternal( @@ -72,7 +72,7 @@ export async function getSessionInternal( /** * Call endSession on the service, wrapped in a tracing span with a provided name. - * @param tracingSpanName The name to use for the span that wraps the call. + * @param tracingSpanName - The name to use for the span that wraps the call. * @internal */ export async function endSessionInternal( diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 952e972630e1..68c9124851b6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -178,11 +178,11 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. - * @param endpoint The RemoteRendering endpoint to use. - * @param accountId The Remote Rendering service account identifier. - * @param accountDomain The Remote Rendering service account domain. - * @param keyCredential The Remote Rendering service account primary or secondary key credential. - * @param options Additional client options. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param keyCredential - The Remote Rendering service account primary or secondary key credential. + * @param options - Additional client options. */ constructor( endpoint: string, @@ -194,11 +194,11 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. - * @param endpoint The RemoteRendering endpoint to use. - * @param accountId The Remote Rendering service account identifier. - * @param accountDomain The Remote Rendering service account domain. - * @param credential A token credential for authenticating the account with the Mixed Reality STS service. - * @param options Additional client options. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param credential - A token credential for authenticating the account with the Mixed Reality STS service. + * @param options - Additional client options. */ constructor( endpoint: string, @@ -210,11 +210,11 @@ export class RemoteRenderingClient { /** * Creates an instance of a RemoteRenderingClient. - * @param endpoint The RemoteRendering endpoint to use. - * @param accountId The Remote Rendering service account identifier. - * @param accountDomain The Remote Rendering service account domain. - * @param credential An access token obtained from the Mixed Reality STS service. - * @param options Additional client options. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param credential - An access token obtained from the Mixed Reality STS service. + * @param options - Additional client options. */ constructor( endpoint: string, @@ -301,11 +301,11 @@ export class RemoteRenderingClient { /** * Creates a conversion using an asset stored in an Azure Blob Storage account. - * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * @param conversionId - An ID uniquely identifying the conversion for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. - * @param assetConversionSettings Settings configuring the asset conversion. - * @param options The options parameters. + * @param assetConversionSettings - Settings configuring the asset conversion. + * @param options - The options parameters. */ public async beginConversion( conversionId: string, @@ -315,7 +315,7 @@ export class RemoteRenderingClient { /** * Obtains a poller corresponding to a conversion that was already started. - * @param options The options parameters, carrying a resumeFrom value. + * @param options - The options parameters, carrying a resumeFrom value. */ public async beginConversion( options: ResumeBeginConversionOptions @@ -389,14 +389,14 @@ export class RemoteRenderingClient { /** * Gets the status of a particular conversion. - * @param conversionId The ID of a previously created conversion. - * @param options The options parameters. + * @param conversionId - The ID of a previously created conversion. + * @param options - The options parameters. */ public async getConversion( conversionId: string, options?: GetConversionOptions ): Promise { - return await getConversionInternal( + return getConversionInternal( this.accountId, this.operations, conversionId, @@ -434,7 +434,7 @@ export class RemoteRenderingClient { /** * Gets a list of all conversions. - * @param options The options parameters. + * @param options - The options parameters. */ public listConversions( options?: ListConversionsOptions @@ -468,11 +468,11 @@ export class RemoteRenderingClient { /** * Creates a new rendering session. - * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * @param sessionId - An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param settings Settings of the session to be created. - * @param options The options parameters. + * @param settings - Settings of the session to be created. + * @param options - The options parameters. */ public async beginSession( sessionId: string, @@ -482,7 +482,7 @@ export class RemoteRenderingClient { /** * Obtains a poller for a pre-existing session - * @param options The options parameters, carrying a resumeFrom value. + * @param options - The options parameters, carrying a resumeFrom value. */ public async beginSession( options: ResumeBeginSessionOptions @@ -553,16 +553,16 @@ export class RemoteRenderingClient { /** * Gets the status of a particular session. - * @param sessionId An ID uniquely identifying the session for the given account. The ID is case + * @param sessionId - An ID uniquely identifying the session for the given account. The ID is case * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, * and cannot contain more than 256 characters. - * @param options The options parameters. + * @param options - The options parameters. */ public async getSession( sessionId: string, options?: GetSessionOptions ): Promise { - return await getSessionInternal( + return getSessionInternal( this.accountId, this.operations, sessionId, @@ -573,11 +573,11 @@ export class RemoteRenderingClient { /** * Updates the max lease time of a particular rendering session. - * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * @param sessionId - An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param updateSessionSettings Settings used to update the session. - * @param options The options parameters. + * @param updateSessionSettings - Settings used to update the session. + * @param options - The options parameters. */ public async updateSession( sessionId: string, @@ -610,13 +610,13 @@ export class RemoteRenderingClient { /** * Stops a particular rendering session. - * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * @param sessionId - An ID uniquely identifying the rendering session for the given account. The ID is * case sensitive, can contain any combination of alphanumeric characters including hyphens and * underscores, and cannot contain more than 256 characters. - * @param options The options parameters. + * @param options - The options parameters. */ public async endSession(sessionId: string, options?: EndSessionOptions): Promise { - return await endSessionInternal( + return endSessionInternal( this.accountId, this.operations, sessionId, @@ -650,7 +650,7 @@ export class RemoteRenderingClient { /** * Gets a list of all sessions. - * @param options The options parameters. + * @param options - The options parameters. */ public listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator { const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { From ff92d2130406a391e9cdc0e79018e21a66169373 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 15:50:36 +0100 Subject: [PATCH 143/166] new API --- .../review/mixedreality-remoterendering.api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 1b0025294705..b20e7bab7729 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -106,7 +106,7 @@ export type GetConversionOptions = OperationOptions; export type GetSessionOptions = OperationOptions; // @public -export const enum KnownAssetConversionStatus { +export enum KnownAssetConversionStatus { Cancelled = "Cancelled", Failed = "Failed", NotStarted = "NotStarted", @@ -115,13 +115,13 @@ export const enum KnownAssetConversionStatus { } // @public -export const enum KnownRenderingServerSize { +export enum KnownRenderingServerSize { Premium = "Premium", Standard = "Standard" } // @public -export const enum KnownRenderingSessionStatus { +export enum KnownRenderingSessionStatus { Error = "Error", Expired = "Expired", Ready = "Ready", From 375ec1ff477ec7292500904ea97cb89ea8eaffea Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 18:01:10 +0100 Subject: [PATCH 144/166] typescript: true --- .../mixedreality-remoterendering.api.md | 6 +- .../src/generated/index.ts | 1 + .../src/generated/models/index.ts | 54 +++++- .../generated/operations/remoteRendering.ts | 33 ++-- .../generated/operationsInterfaces/index.ts | 9 + .../operationsInterfaces/remoteRendering.ts | 161 ++++++++++++++++++ .../generated/remoteRenderingRestClient.ts | 5 +- .../remoteRenderingRestClientContext.ts | 11 +- .../src/internal/commonQueries.ts | 2 +- .../src/lro/assetConversionPoller.ts | 2 +- .../src/lro/renderingSessionPoller.ts | 2 +- .../src/remoteRenderingClient.ts | 6 +- .../swagger/README.md | 4 +- 13 files changed, 262 insertions(+), 34 deletions(-) create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts create mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index b20e7bab7729..1b0025294705 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -106,7 +106,7 @@ export type GetConversionOptions = OperationOptions; export type GetSessionOptions = OperationOptions; // @public -export enum KnownAssetConversionStatus { +export const enum KnownAssetConversionStatus { Cancelled = "Cancelled", Failed = "Failed", NotStarted = "NotStarted", @@ -115,13 +115,13 @@ export enum KnownAssetConversionStatus { } // @public -export enum KnownRenderingServerSize { +export const enum KnownRenderingServerSize { Premium = "Premium", Standard = "Standard" } // @public -export enum KnownRenderingSessionStatus { +export const enum KnownRenderingSessionStatus { Error = "Error", Expired = "Expired", Ready = "Ready", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts index 9ed6903f2d7a..e02f01cceb13 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts @@ -9,3 +9,4 @@ export * from "./models"; export { RemoteRenderingRestClient } from "./remoteRenderingRestClient"; export { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 481c855f996d..03474875304f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -164,7 +164,7 @@ export interface SessionProperties { * The error object containing details about the rendering session startup failure. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: RemoteRenderingServiceErrorInternal | null; + readonly error?: RemoteRenderingServiceErrorInternal; /** * The time when the rendering session was created. Date and time in ISO 8601 format. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -304,7 +304,7 @@ export interface RemoteRenderingListSessionsNextExceptionHeaders { } /** Known values of {@link AssetConversionStatus} that the service accepts. */ -export enum KnownAssetConversionStatus { +export const enum KnownAssetConversionStatus { /** The conversion was created but hasn't started. */ NotStarted = "NotStarted", /** The conversion is running. */ @@ -321,7 +321,7 @@ export enum KnownAssetConversionStatus { * Defines values for AssetConversionStatus. \ * {@link KnownAssetConversionStatus} can be used interchangeably with AssetConversionStatus, * this enum contains the known values that the service supports. - * ### Know values supported by the service + * ### Known values supported by the service * **NotStarted**: The conversion was created but hasn't started. \ * **Running**: The conversion is running. \ * **Cancelled**: The conversion was cancelled. This is a terminal state. \ @@ -331,7 +331,7 @@ export enum KnownAssetConversionStatus { export type AssetConversionStatus = string; /** Known values of {@link RenderingServerSize} that the service accepts. */ -export enum KnownRenderingServerSize { +export const enum KnownRenderingServerSize { /** Standard rendering session size. */ Standard = "Standard", /** Premium rendering session size. */ @@ -342,14 +342,14 @@ export enum KnownRenderingServerSize { * Defines values for RenderingServerSize. \ * {@link KnownRenderingServerSize} can be used interchangeably with RenderingServerSize, * this enum contains the known values that the service supports. - * ### Know values supported by the service + * ### Known values supported by the service * **Standard**: Standard rendering session size. \ * **Premium**: Premium rendering session size. */ export type RenderingServerSize = string; /** Known values of {@link RenderingSessionStatus} that the service accepts. */ -export enum KnownRenderingSessionStatus { +export const enum KnownRenderingSessionStatus { /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ Error = "Error", /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ @@ -366,7 +366,7 @@ export enum KnownRenderingSessionStatus { * Defines values for RenderingSessionStatus. \ * {@link KnownRenderingSessionStatus} can be used interchangeably with RenderingSessionStatus, * this enum contains the known values that the service supports. - * ### Know values supported by the service + * ### Known values supported by the service * **Error**: The rendering session has encountered an error, and is unusable. This is a terminal state. \ * **Expired**: The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. \ * **Starting**: The rendering session is starting, but not accepting incoming connections yet. \ @@ -375,37 +375,77 @@ export enum KnownRenderingSessionStatus { */ export type RenderingSessionStatus = string; +/** Optional parameters. */ +export interface RemoteRenderingCreateConversionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the createConversion operation. */ export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & Conversion; +/** Optional parameters. */ +export interface RemoteRenderingGetConversionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getConversion operation. */ export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & Conversion; +/** Optional parameters. */ +export interface RemoteRenderingListConversionsOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listConversions operation. */ export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversionsHeaders & ConversionList; +/** Optional parameters. */ +export interface RemoteRenderingCreateSessionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the createSession operation. */ export type RemoteRenderingCreateSessionResponse = SessionProperties; +/** Optional parameters. */ +export interface RemoteRenderingGetSessionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getSession operation. */ export type RemoteRenderingGetSessionResponse = SessionProperties; +/** Optional parameters. */ +export interface RemoteRenderingUpdateSessionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the updateSession operation. */ export type RemoteRenderingUpdateSessionResponse = SessionProperties; +/** Optional parameters. */ +export interface RemoteRenderingStopSessionOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the stopSession operation. */ export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders; +/** Optional parameters. */ +export interface RemoteRenderingListSessionsOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listSessions operation. */ export type RemoteRenderingListSessionsResponse = SessionsList; +/** Optional parameters. */ +export interface RemoteRenderingListConversionsNextOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listConversionsNext operation. */ export type RemoteRenderingListConversionsNextResponse = RemoteRenderingListConversionsNextHeaders & ConversionList; +/** Optional parameters. */ +export interface RemoteRenderingListSessionsNextOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the listSessionsNext operation. */ export type RemoteRenderingListSessionsNextResponse = SessionsList; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts index e7646975d600..daa069b025ae 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts @@ -6,28 +6,39 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { RemoteRendering } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RemoteRenderingRestClientContext } from "../remoteRenderingRestClientContext"; import { CreateConversionSettings, + RemoteRenderingCreateConversionOptionalParams, RemoteRenderingCreateConversionResponse, + RemoteRenderingGetConversionOptionalParams, RemoteRenderingGetConversionResponse, + RemoteRenderingListConversionsOptionalParams, RemoteRenderingListConversionsResponse, RenderingSessionSettings, + RemoteRenderingCreateSessionOptionalParams, RemoteRenderingCreateSessionResponse, + RemoteRenderingGetSessionOptionalParams, RemoteRenderingGetSessionResponse, UpdateSessionSettings, + RemoteRenderingUpdateSessionOptionalParams, RemoteRenderingUpdateSessionResponse, + RemoteRenderingStopSessionOptionalParams, RemoteRenderingStopSessionResponse, + RemoteRenderingListSessionsOptionalParams, RemoteRenderingListSessionsResponse, + RemoteRenderingListConversionsNextOptionalParams, RemoteRenderingListConversionsNextResponse, + RemoteRenderingListSessionsNextOptionalParams, RemoteRenderingListSessionsNextResponse } from "../models"; /** Class representing a RemoteRendering. */ -export class RemoteRendering { +export class RemoteRenderingImpl implements RemoteRendering { private readonly client: RemoteRenderingRestClientContext; /** @@ -51,7 +62,7 @@ export class RemoteRendering { accountId: string, conversionId: string, body: CreateConversionSettings, - options?: coreClient.OperationOptions + options?: RemoteRenderingCreateConversionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, conversionId, body, options }, @@ -70,7 +81,7 @@ export class RemoteRendering { getConversion( accountId: string, conversionId: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingGetConversionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, conversionId, options }, @@ -85,7 +96,7 @@ export class RemoteRendering { */ listConversions( accountId: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingListConversionsOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, options }, @@ -106,7 +117,7 @@ export class RemoteRendering { accountId: string, sessionId: string, body: RenderingSessionSettings, - options?: coreClient.OperationOptions + options?: RemoteRenderingCreateSessionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, sessionId, body, options }, @@ -125,7 +136,7 @@ export class RemoteRendering { getSession( accountId: string, sessionId: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingGetSessionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, sessionId, options }, @@ -146,7 +157,7 @@ export class RemoteRendering { accountId: string, sessionId: string, body: UpdateSessionSettings, - options?: coreClient.OperationOptions + options?: RemoteRenderingUpdateSessionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, sessionId, body, options }, @@ -165,7 +176,7 @@ export class RemoteRendering { stopSession( accountId: string, sessionId: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingStopSessionOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, sessionId, options }, @@ -180,7 +191,7 @@ export class RemoteRendering { */ listSessions( accountId: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingListSessionsOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, options }, @@ -197,7 +208,7 @@ export class RemoteRendering { listConversionsNext( accountId: string, nextLink: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingListConversionsNextOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, nextLink, options }, @@ -214,7 +225,7 @@ export class RemoteRendering { listSessionsNext( accountId: string, nextLink: string, - options?: coreClient.OperationOptions + options?: RemoteRenderingListSessionsNextOptionalParams ): Promise { return this.client.sendOperationRequest( { accountId, nextLink, options }, diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts new file mode 100644 index 000000000000..80a01585d4b1 --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./remoteRendering"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts new file mode 100644 index 000000000000..d749a2d3557c --- /dev/null +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts @@ -0,0 +1,161 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CreateConversionSettings, + RemoteRenderingCreateConversionOptionalParams, + RemoteRenderingCreateConversionResponse, + RemoteRenderingGetConversionOptionalParams, + RemoteRenderingGetConversionResponse, + RemoteRenderingListConversionsOptionalParams, + RemoteRenderingListConversionsResponse, + RenderingSessionSettings, + RemoteRenderingCreateSessionOptionalParams, + RemoteRenderingCreateSessionResponse, + RemoteRenderingGetSessionOptionalParams, + RemoteRenderingGetSessionResponse, + UpdateSessionSettings, + RemoteRenderingUpdateSessionOptionalParams, + RemoteRenderingUpdateSessionResponse, + RemoteRenderingStopSessionOptionalParams, + RemoteRenderingStopSessionResponse, + RemoteRenderingListSessionsOptionalParams, + RemoteRenderingListSessionsResponse, + RemoteRenderingListConversionsNextOptionalParams, + RemoteRenderingListConversionsNextResponse, + RemoteRenderingListSessionsNextOptionalParams, + RemoteRenderingListSessionsNextResponse +} from "../models"; + +/** Interface representing a RemoteRendering. */ +export interface RemoteRendering { + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param body Request body configuring the settings for an asset conversion. + * @param options The options parameters. + */ + createConversion( + accountId: string, + conversionId: string, + body: CreateConversionSettings, + options?: RemoteRenderingCreateConversionOptionalParams + ): Promise; + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId An ID uniquely identifying the conversion for the given account. The ID is case + * sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, + * and cannot contain more than 256 characters. + * @param options The options parameters. + */ + getConversion( + accountId: string, + conversionId: string, + options?: RemoteRenderingGetConversionOptionalParams + ): Promise; + /** + * Gets a list of all conversions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listConversions( + accountId: string, + options?: RemoteRenderingListConversionsOptionalParams + ): Promise; + /** + * Creates a new rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param body Settings of the session to be created. + * @param options The options parameters. + */ + createSession( + accountId: string, + sessionId: string, + body: RenderingSessionSettings, + options?: RemoteRenderingCreateSessionOptionalParams + ): Promise; + /** + * Gets the properties of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters. + */ + getSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingGetSessionOptionalParams + ): Promise; + /** + * Updates the max lease time of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param body Settings used to update the session. + * @param options The options parameters. + */ + updateSession( + accountId: string, + sessionId: string, + body: UpdateSessionSettings, + options?: RemoteRenderingUpdateSessionOptionalParams + ): Promise; + /** + * Stops a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId An ID uniquely identifying the rendering session for the given account. The ID is + * case sensitive, can contain any combination of alphanumeric characters including hyphens and + * underscores, and cannot contain more than 256 characters. + * @param options The options parameters. + */ + stopSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingStopSessionOptionalParams + ): Promise; + /** + * Gets a list of all rendering sessions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listSessions( + accountId: string, + options?: RemoteRenderingListSessionsOptionalParams + ): Promise; + /** + * ListConversionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListConversions method. + * @param options The options parameters. + */ + listConversionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListConversionsNextOptionalParams + ): Promise; + /** + * ListSessionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListSessions method. + * @param options The options parameters. + */ + listSessionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListSessionsNextOptionalParams + ): Promise; +} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts index 10c05ca7afb6..83bfaa899776 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { RemoteRendering } from "./operations"; +import { RemoteRenderingImpl } from "./operations"; +import { RemoteRendering } from "./operationsInterfaces"; import { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; import { RemoteRenderingRestClientOptionalParams } from "./models"; @@ -23,7 +24,7 @@ export class RemoteRenderingRestClient extends RemoteRenderingRestClientContext options?: RemoteRenderingRestClientOptionalParams ) { super(endpoint, options); - this.remoteRendering = new RemoteRendering(this); + this.remoteRendering = new RemoteRenderingImpl(this); } remoteRendering: RemoteRendering; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts index 7cbd1edd2d61..dde57f209882 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts @@ -32,17 +32,24 @@ export class RemoteRenderingRestClientContext extends coreClient.ServiceClient { if (!options) { options = {}; } - const defaults: RemoteRenderingRestClientOptionalParams = { requestContentType: "application/json; charset=utf-8" }; + const packageDetails = `azsdk-js-mixedreality-remoterendering/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + const optionsWithDefaults = { ...defaults, ...options, + userAgentOptions: { + userAgentPrefix + }, baseUri: options.endpoint || "{endpoint}" }; - super(optionsWithDefaults); // Parameter assignments this.endpoint = endpoint; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts index c4266147fee8..a933b66a0269 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { OperationOptions } from "@azure/core-client"; -import { RemoteRendering } from "../generated/operations"; +import { RemoteRendering } from "../generated/operationsInterfaces"; import { createSpan } from "../tracing"; import { SpanStatusCode } from "@azure/core-tracing"; import { AssetConversion, assetConversionFromConversion } from "./assetConversion"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 882b90c715d5..ef3421938542 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -3,7 +3,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { KnownAssetConversionStatus } from "../generated/models/index"; -import { RemoteRendering } from "../generated/operations"; +import { RemoteRendering } from "../generated/operationsInterfaces"; import { getConversionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; import { delay } from "@azure/core-util"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index ae3cdd86e37a..cea29df91bf0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -5,7 +5,7 @@ import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; import { KnownRenderingSessionStatus } from "../generated/models/index"; import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; import { AbortSignalLike } from "@azure/abort-controller"; -import { RemoteRendering } from "../generated/operations"; +import { RemoteRendering } from "../generated/operationsInterfaces"; import { delay } from "@azure/core-util"; import { RenderingSession } from "../internal/renderingSession"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 68c9124851b6..2980f479c28f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -36,7 +36,7 @@ import { createSpan } from "./tracing"; import { PollerLike } from "@azure/core-lro"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RemoteRendering } from "./generated/operations"; +import { RemoteRenderingImpl } from "./generated/operations"; import { AssetConversionPoller, AssetConversionOperationState, @@ -174,7 +174,7 @@ export type RenderingSessionPollerLike = PollerLike< export class RemoteRenderingClient { private accountId: string; private client: RemoteRenderingRestClient; - private operations: RemoteRendering; + private operations: RemoteRenderingImpl; /** * Creates an instance of a RemoteRenderingClient. @@ -296,7 +296,7 @@ export class RemoteRenderingClient { }; this.client = new RemoteRenderingRestClient(endpoint, clientOptions); - this.operations = new RemoteRendering(this.client); + this.operations = new RemoteRenderingImpl(this.client); } /** diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md index e1812cd2853b..954b94d445ed 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md @@ -18,9 +18,7 @@ add-credentials: false package-version: 1.0.0-beta.1 disable-async-iterators: true hide-clients: true -use-core-v2: true -use-extension: - "@autorest/typescript": "https://aka.ms/autorest/typescript/corev2" +typescript: true ``` ```yaml From 8df342157004680fb45a6ca8ae818cd9aae3d795 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 28 Jun 2021 18:09:31 +0100 Subject: [PATCH 145/166] Linter fixes --- .../src/lro/assetConversionPoller.ts | 10 +++++----- .../src/lro/renderingSessionPoller.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index ef3421938542..56267c2f8609 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -70,15 +70,15 @@ export class AssetConversionOperationStateImpl implements AssetConversionOperati * @internal */ class AssetConversionOperation - implements PollOperation { + implements PollOperation { private accountId: string; private operations: RemoteRendering; - state: AssetConversionOperationStateImpl; + state: AssetConversionOperationState; constructor( accountId: string, operations: RemoteRendering, - state: AssetConversionOperationStateImpl + state: AssetConversionOperationState ) { this.operations = operations; this.accountId = accountId; @@ -111,7 +111,7 @@ class AssetConversionOperation * @internal */ export class AssetConversionPoller extends Poller< - AssetConversionOperationStateImpl, + AssetConversionOperationState, AssetConversion > { /** @@ -145,7 +145,7 @@ export class AssetConversionPoller extends Poller< /** * Gets the public state of the polling operation */ - public getOperationState(): AssetConversionOperationStateImpl { + public getOperationState(): AssetConversionOperationState { return this.operation.state; } } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts index cea29df91bf0..1394e00d4aca 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts @@ -65,15 +65,15 @@ export class RenderingSessionOperationStateImpl implements RenderingSessionOpera * @internal */ class RenderingSessionOperation - implements PollOperation { + implements PollOperation { private accountId: string; private operations: RemoteRendering; - state: RenderingSessionOperationStateImpl; + state: RenderingSessionOperationState; constructor( accountId: string, operations: RemoteRendering, - state: RenderingSessionOperationStateImpl + state: RenderingSessionOperationState ) { this.accountId = accountId; this.operations = operations; @@ -126,7 +126,7 @@ class RenderingSessionOperation * @internal */ export class RenderingSessionPoller extends Poller< - RenderingSessionOperationStateImpl, + RenderingSessionOperationState, RenderingSession > { /** @@ -160,7 +160,7 @@ export class RenderingSessionPoller extends Poller< /** * Gets the public state of the polling operation */ - public getOperationState(): RenderingSessionOperationStateImpl { + public getOperationState(): RenderingSessionOperationState { return this.operation.state; } } From 78a9399849935d5511e1e16d422f5ce3773285bb Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 29 Jun 2021 09:54:25 +0100 Subject: [PATCH 146/166] Formatting --- .../src/lro/assetConversionPoller.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts index 56267c2f8609..876a9b7b06db 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts @@ -110,10 +110,7 @@ class AssetConversionOperation /** * @internal */ -export class AssetConversionPoller extends Poller< - AssetConversionOperationState, - AssetConversion -> { +export class AssetConversionPoller extends Poller { /** * Defines how much time the poller is going to wait before making a new request to the service. */ From c9fae2f37f0be2599b43b3f6d6b1b77f7c3feafe Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 29 Jun 2021 09:54:44 +0100 Subject: [PATCH 147/166] Switch linting on --- sdk/remoterendering/mixedreality-remoterendering/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 7dfb509d2635..11286db76f3d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -39,7 +39,7 @@ "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-remoterendering-lintReport.html || exit 0", + "lint": "eslint package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", From c818029b7f71f218e04a5923718e164d62e43893 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 29 Jun 2021 14:05:06 +0100 Subject: [PATCH 148/166] Merge latest --- .../mixedreality-remoterendering/package.json | 2 +- .../review/mixedreality-remoterendering.api.md | 6 +++--- .../src/generated/models/index.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixedreality-remoterendering/package.json index 11286db76f3d..cf8f372f5020 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixedreality-remoterendering/package.json @@ -95,7 +95,7 @@ "@types/chai": "^4.1.6", "@types/chai-as-promised": "^7.1.0", "@types/mocha": "^7.0.2", - "@types/node": "^8.0.0", + "@types/node": "^12.0.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "cross-env": "^7.0.2", diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index 1b0025294705..b20e7bab7729 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -106,7 +106,7 @@ export type GetConversionOptions = OperationOptions; export type GetSessionOptions = OperationOptions; // @public -export const enum KnownAssetConversionStatus { +export enum KnownAssetConversionStatus { Cancelled = "Cancelled", Failed = "Failed", NotStarted = "NotStarted", @@ -115,13 +115,13 @@ export const enum KnownAssetConversionStatus { } // @public -export const enum KnownRenderingServerSize { +export enum KnownRenderingServerSize { Premium = "Premium", Standard = "Standard" } // @public -export const enum KnownRenderingSessionStatus { +export enum KnownRenderingSessionStatus { Error = "Error", Expired = "Expired", Ready = "Ready", diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts index 03474875304f..89d764582bcc 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts @@ -304,7 +304,7 @@ export interface RemoteRenderingListSessionsNextExceptionHeaders { } /** Known values of {@link AssetConversionStatus} that the service accepts. */ -export const enum KnownAssetConversionStatus { +export enum KnownAssetConversionStatus { /** The conversion was created but hasn't started. */ NotStarted = "NotStarted", /** The conversion is running. */ @@ -331,7 +331,7 @@ export const enum KnownAssetConversionStatus { export type AssetConversionStatus = string; /** Known values of {@link RenderingServerSize} that the service accepts. */ -export const enum KnownRenderingServerSize { +export enum KnownRenderingServerSize { /** Standard rendering session size. */ Standard = "Standard", /** Premium rendering session size. */ @@ -349,7 +349,7 @@ export const enum KnownRenderingServerSize { export type RenderingServerSize = string; /** Known values of {@link RenderingSessionStatus} that the service accepts. */ -export const enum KnownRenderingSessionStatus { +export enum KnownRenderingSessionStatus { /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ Error = "Error", /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ From a8049cb5e2da890a54b27813553e0d910bf3e6a8 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 29 Jun 2021 14:09:24 +0100 Subject: [PATCH 149/166] Include pnpm-lock.yaml --- common/config/rush/pnpm-lock.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 17b5601a2897..1e99423ed78a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9035,7 +9035,7 @@ packages: dev: false name: '@rush-temp/core-client-paging' resolution: - integrity: sha512-56hlO8jgFdKMR/mgzW2WPHAqxx7n+ji+L9ZCeF+9yxkcmBBzsSKfYrQdTtsBN94/1/ZwtmWJluu7WDKieWYY0w== + integrity: sha512-2yfyj7zg3Un1ZqzSMicY6SUmVE+Xnx4HbbAumjTWTAHBPeemreMzkys2OtcP7pYuLkd8mlBuHxzw/9xLf3p8Zg== tarball: file:projects/core-client-paging.tgz version: 0.0.0 file:projects/core-client.tgz: @@ -10442,7 +10442,7 @@ packages: '@types/chai': 4.2.19 '@types/chai-as-promised': 7.1.4 '@types/mocha': 7.0.2 - '@types/node': 8.10.66 + '@types/node': 12.20.15 '@types/uuid': 8.3.0 chai: 4.3.4 chai-as-promised: 7.1.1_chai@4.3.4 @@ -10476,7 +10476,7 @@ packages: dev: false name: '@rush-temp/mixedreality-remoterendering' resolution: - integrity: sha512-Nom/elH8JPiCHQQPDNpUBguvChhXeZGl+TagIMnDmXKxTfbkS55CwBT11VZbhYPcHT9dLFRgQGH6DG6s7BY3bg== + integrity: sha512-C8rmlojMOh5Fei9q15a3kKN3kNioe/SJLK+JtmVMdz3vNUnaotSRGNvSnZ9xCDBeSpujnjiNOY2YbAF12iOGBA== tarball: file:projects/mixedreality-remoterendering.tgz version: 0.0.0 file:projects/mock-hub.tgz: @@ -11891,7 +11891,7 @@ packages: dev: false name: '@rush-temp/web-pubsub-express' resolution: - integrity: sha512-7fhzzPMfrSmDZbdzhtoALZPAyEC+HYfKldEM0RaYayTsuyHOdVz5IwWyKBXMwwCVoiWbbQEtVYf1NbI4e5g3Kg== + integrity: sha512-0BfXTMbuUjTrsR+Tz0lBb+1y+5qhO0XGgmNcy/JjyEZUTn7PccRFYnyK4/wW+St7teCrsF6zampG5ab/h0RhHA== tarball: file:projects/web-pubsub-express.tgz version: 0.0.0 file:projects/web-pubsub.tgz: @@ -11903,6 +11903,7 @@ packages: '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 '@rollup/plugin-replace': 2.4.2_rollup@1.32.1 + '@types/chai': 4.2.19 '@types/jsonwebtoken': 8.5.2 '@types/mocha': 7.0.2 '@types/node': 12.20.15 @@ -11948,7 +11949,7 @@ packages: dev: false name: '@rush-temp/web-pubsub' resolution: - integrity: sha512-NEgAqwtqpS48OPZ9oNnVcyOUBN9+cdG8bmcyFPVcH69lHkGVUKUTWlYQKAer1xuBZbdvZrw7l8UjrFtpnVCqaw== + integrity: sha512-c4EhqvsmN20MNmoKzSpn0/RAmB5FyARVkcVQl8fVxJnH3kcx7H7yud35i3fe+jySbR35elHuXs0uOUw3LijIXQ== tarball: file:projects/web-pubsub.tgz version: 0.0.0 registry: '' From 454601fd41e1ce19bd14dbdddb9465652faca14f Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 30 Jun 2021 13:34:03 +0100 Subject: [PATCH 150/166] Some fixes from review --- .../mixedreality-remoterendering/README.md | 27 +++---------------- .../src/options.ts | 4 +-- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 9f50540fc342..94bef9d11a2a 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -37,25 +37,10 @@ npm install @azure/mixedreality-remoterendering 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). - +This library cannot be used to make direct calls to the Azure Remote Rendering service from a browser. +Please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/cors/ts/README.md) for guidance. ### Authenticate the client @@ -76,7 +61,7 @@ There are several different forms of authentication: See [here](https://docs.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information. -In all the following examples, the client is constructed with a `remoteRenderingEndpoint` Uri object. +In all the following examples, the client is constructed with a `remoteRenderingEndpoint`. The available endpoints correspond to regions, and the choice of endpoint determines the region in which the service performs its work. An example is `https://remoterendering.eastus2.mixedreality.azure.com`. @@ -343,11 +328,7 @@ This method may return sessions which have yet to start and sessions which are r ```typescript Snippet:ListSessions for await (const session of client.listSessions()) { - if (session.status === "Starting") { - console.log(`Session ${session.sessionId} is starting`); - } else if (session.status === "Ready") { - console.log(`Session ${session.sessionId} is ready`); - } + console.log(`Session ${session.sessionId} is ${session.status}`); } ``` diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts index 698257b39c24..c375123fe856 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/options.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PipelineOptions } from "@azure/core-rest-pipeline"; +import { CommonClientOptions } from "@azure/core-client"; /** * Options to create the RemoteRenderingClient. */ -export interface RemoteRenderingClientOptions extends PipelineOptions { +export interface RemoteRenderingClientOptions extends CommonClientOptions { /** * Overrides the Mixed Reality STS service endpoint. */ From 6ed842844c8505a42ddf1d94609b4e7b364554fb Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 30 Jun 2021 13:43:09 +0100 Subject: [PATCH 151/166] Error constructor --- .../src/remoteRenderingServiceError.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts index ff7853d275e9..74438ac29b25 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts @@ -12,6 +12,7 @@ export class RemoteRenderingServiceError extends Error { super(message); Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); this.code = code; + this.name = "RemoteRenderingServiceError"; } /** Error code. */ From bc2fd78e856308e255d3585f64b1bf9067535155 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 30 Jun 2021 14:01:38 +0100 Subject: [PATCH 152/166] More review comments. --- .../review/mixedreality-remoterendering.api.md | 4 ++-- .../src/remoteRenderingClient.ts | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index b20e7bab7729..fe230e4d1796 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -6,9 +6,9 @@ import { AccessToken } from '@azure/core-auth'; import { AzureKeyCredential } from '@azure/core-auth'; +import { CommonClientOptions } from '@azure/core-client'; import { OperationOptions } from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PipelineOptions } from '@azure/core-rest-pipeline'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; import { TokenCredential } from '@azure/core-auth'; @@ -174,7 +174,7 @@ export class RemoteRenderingClient { } // @public -export interface RemoteRenderingClientOptions extends PipelineOptions { +export interface RemoteRenderingClientOptions extends CommonClientOptions { authenticationEndpointUrl?: string; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 2980f479c28f..0e323932c7a7 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -260,14 +260,13 @@ export class RemoteRenderingClient { } const internalPipelineOptions: InternalPipelineOptions = { - ...{ ...options, userAgentOptions }, - ...{ - loggingOptions: { - logger: logger.info, - // This array contains header names we want to log that are not already - // included as safe. Unknown/unsafe headers are logged as "". - additionalAllowedHeaderNames: ["X-MRC-CV", "MS-CV"] - } + ...options, + userAgentOptions, + loggingOptions: { + logger: logger.info, + // This array contains header names we want to log that are not already + // included as safe. Unknown/unsafe headers are logged as "". + additionalAllowedHeaderNames: ["X-MRC-CV", "MS-CV"] } }; From c345b38a43cba9ea61445cf6de70ab6689073edc Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 30 Jun 2021 14:03:54 +0100 Subject: [PATCH 153/166] Formatting --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 0e323932c7a7..53597c2df8c0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -260,7 +260,7 @@ export class RemoteRenderingClient { } const internalPipelineOptions: InternalPipelineOptions = { - ...options, + ...options, userAgentOptions, loggingOptions: { logger: logger.info, From 5819fc37d60136486f85c85eeacd12bc33fb69de Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 08:41:38 +0100 Subject: [PATCH 154/166] No need for AccountKeyCredential. --- .../authentication/mixedRealityAccountKeyCredential.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts index ee5096ac1db2..eacd60fd81c0 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { - AzureKeyCredential, + KeyCredential, AccessToken, GetTokenOptions, TokenCredential @@ -15,16 +15,16 @@ const maxTimestampMs = 8640000000000000; * @internal */ export class MixedRealityAccountKeyCredential implements TokenCredential { - private readonly accountKey: AzureKeyCredential; + private readonly accountKey: KeyCredential; /** * Creates an instance of a MixedRealityAccountKeyCredential. * @param accountId - The Mixed Reality service account identifier. * @param accountKey - The Mixed Reality service account primary or secondary key. */ - constructor(public readonly accountId: string, accountKey: string | AzureKeyCredential) { + constructor(public readonly accountId: string, accountKey: string | KeyCredential) { if (typeof accountKey === "string") { - this.accountKey = new AzureKeyCredential(accountKey); + this.accountKey = { key: accountKey }; } else { this.accountKey = accountKey; } From c734638de7b6d6fac1a15cbfefab85d505279677 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 08:59:13 +0100 Subject: [PATCH 155/166] No need to export the class. --- .../mixedRealityAccountKeyCredential.ts | 7 +---- .../mixedRealityTokenCredential.ts | 30 +++++++++---------- .../src/remoteRenderingClient.ts | 4 +-- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts index eacd60fd81c0..8e7640ee279d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts @@ -1,12 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - KeyCredential, - AccessToken, - GetTokenOptions, - TokenCredential -} from "@azure/core-auth"; +import { KeyCredential, AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth"; const maxTimestampMs = 8640000000000000; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts index 01f0480d5e78..a6ced27c3f83 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts @@ -13,7 +13,7 @@ import { StaticAccessTokenCredential } from "./staticAccessTokenCredential"; * Represents a token credential that can be used to access a Mixed Reality service. * @internal */ -export class MixedRealityTokenCredential implements TokenCredential { +class MixedRealityTokenCredential implements TokenCredential { private stsClient: MixedRealityStsClient; constructor( @@ -28,19 +28,19 @@ export class MixedRealityTokenCredential implements TokenCredential { getToken(_scopes: string | string[], options?: GetTokenOptions): Promise { return this.stsClient.getToken(options); } +} - static getMixedRealityCredential( - accountId: string, - accountDomain: string, - credential: TokenCredential, - options: MixedRealityStsClientOptions - ): TokenCredential { - if (credential instanceof StaticAccessTokenCredential) { - // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange - // them using the MixedRealityTokenCredential. - return credential; - } - - return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); +export function getMixedRealityCredential( + accountId: string, + accountDomain: string, + credential: TokenCredential, + options: MixedRealityStsClientOptions +): TokenCredential { + if (credential instanceof StaticAccessTokenCredential) { + // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange + // them using the MixedRealityTokenCredential. + return credential; } -} + + return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); +} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 53597c2df8c0..8c38a680fe2b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -25,7 +25,7 @@ import { import { RemoteRenderingClientOptions } from "./options"; import { constructAuthenticationEndpointFromDomain } from "./authentication/authenticationEndpoint"; -import { MixedRealityTokenCredential } from "./authentication/mixedRealityTokenCredential"; +import { getMixedRealityCredential } from "./authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "./authentication/staticAccessTokenCredential"; import { MixedRealityAccountKeyCredential } from "./authentication/mixedRealityAccountKeyCredential"; @@ -280,7 +280,7 @@ export class RemoteRenderingClient { const authenticationEndpoint = options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); - const mrTokenCredential: TokenCredential = MixedRealityTokenCredential.getMixedRealityCredential( + const mrTokenCredential: TokenCredential = getMixedRealityCredential( accountId, authenticationEndpoint, tokenCredential, From de40b7c3c62302dd9b1d72ccdc280b0e348f9b07 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 14:55:37 +0100 Subject: [PATCH 156/166] No longer require an accountDomain in the AccessToken scenario --- .../mixedreality-remoterendering.api.md | 2 +- .../mixedRealityTokenCredential.ts | 18 +---- .../src/remoteRenderingClient.ts | 66 +++++++++++-------- .../test/public/remoteRenderingClient.spec.ts | 1 - .../test/utils/recordedClient.ts | 2 +- 5 files changed, 41 insertions(+), 48 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md index fe230e4d1796..3a094b39eab8 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md @@ -160,7 +160,7 @@ export interface ReadyRenderingSession extends RenderingSessionBase { export class RemoteRenderingClient { constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); - constructor(endpoint: string, accountId: string, accountDomain: string, credential: AccessToken, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, credential: AccessToken, options?: RemoteRenderingClientOptions); beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions): Promise; beginConversion(options: ResumeBeginConversionOptions): Promise; beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts index a6ced27c3f83..a826aed0070f 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts @@ -7,13 +7,12 @@ import { MixedRealityStsClient, MixedRealityStsClientOptions } from "@azure/mixedreality-authentication"; -import { StaticAccessTokenCredential } from "./staticAccessTokenCredential"; /** * Represents a token credential that can be used to access a Mixed Reality service. * @internal */ -class MixedRealityTokenCredential implements TokenCredential { +export class MixedRealityTokenCredential implements TokenCredential { private stsClient: MixedRealityStsClient; constructor( @@ -29,18 +28,3 @@ class MixedRealityTokenCredential implements TokenCredential { return this.stsClient.getToken(options); } } - -export function getMixedRealityCredential( - accountId: string, - accountDomain: string, - credential: TokenCredential, - options: MixedRealityStsClientOptions -): TokenCredential { - if (credential instanceof StaticAccessTokenCredential) { - // Static access tokens are assumed to be Mixed Reality access tokens already, so we don't need to exchange - // them using the MixedRealityTokenCredential. - return credential; - } - - return new MixedRealityTokenCredential(accountId, accountDomain, credential, options); -} \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 8c38a680fe2b..5808f5514e60 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -25,7 +25,7 @@ import { import { RemoteRenderingClientOptions } from "./options"; import { constructAuthenticationEndpointFromDomain } from "./authentication/authenticationEndpoint"; -import { getMixedRealityCredential } from "./authentication/mixedRealityTokenCredential"; +import { MixedRealityTokenCredential } from "./authentication/mixedRealityTokenCredential"; import { StaticAccessTokenCredential } from "./authentication/staticAccessTokenCredential"; import { MixedRealityAccountKeyCredential } from "./authentication/mixedRealityAccountKeyCredential"; @@ -219,7 +219,6 @@ export class RemoteRenderingClient { constructor( endpoint: string, accountId: string, - accountDomain: string, credential: AccessToken, options?: RemoteRenderingClientOptions ); @@ -227,10 +226,42 @@ export class RemoteRenderingClient { constructor( endpoint: string, accountId: string, - accountDomain: string, - credential: TokenCredential | AzureKeyCredential | AccessToken, - options: RemoteRenderingClientOptions = {} - ) { + ...args: Array) { + + let tokenCredential: TokenCredential | null = null; + let options: RemoteRenderingClientOptions = {}; + + if ((args.length == 0) || (args.length > 3)) { + throw new Error("Wrong number of arguments"); + } else if ((typeof args[0] === "object") && (args.length <= 2)) { + tokenCredential = new StaticAccessTokenCredential(args[0] as AccessToken); + if (args.length == 2) { + options = args[1]; + } + } else if ((typeof args[0] === "string") && (args.length >= 2) && (args.length <= 3)) { + let accountDomain: string = args[0]; + + let credential: TokenCredential; + + if (args[1] instanceof AzureKeyCredential) { + credential = new MixedRealityAccountKeyCredential(accountId, args[0]); + } else if (!isTokenCredential(args[1])) { + credential = args[1]; + } else { + throw new Error("Argument 4 is not a supported type of credential"); + } + + const authenticationEndpoint = + options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); + const stsOptions = { customEndpointUrl: authenticationEndpoint }; + tokenCredential = new MixedRealityTokenCredential(accountId, accountDomain, credential, stsOptions) + if (args.length == 3) { + options = args[2]; + } + } else { + throw new Error("Argument 3 is not of the expected type"); + } + if (!endpoint) { throw new Error("Argument cannot be null or empty: 'endpoint'."); } @@ -239,10 +270,6 @@ export class RemoteRenderingClient { throw new Error("Argument cannot be null or empty: 'accountId'."); } - if (!accountDomain) { - throw new Error("Argument cannot be null or empty: 'accountDomain'."); - } - this.accountId = accountId; // The below code helps us set a proper User-Agent header on all requests @@ -270,27 +297,10 @@ export class RemoteRenderingClient { } }; - const tokenCredential: TokenCredential = - credential instanceof AzureKeyCredential - ? new MixedRealityAccountKeyCredential(accountId, credential) - : isTokenCredential(credential) - ? credential - : new StaticAccessTokenCredential(credential as AccessToken); - - const authenticationEndpoint = - options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); - - const mrTokenCredential: TokenCredential = getMixedRealityCredential( - accountId, - authenticationEndpoint, - tokenCredential, - { customEndpointUrl: authenticationEndpoint } - ); - const clientOptions: RemoteRenderingRestClientOptionalParams = { ...internalPipelineOptions, endpoint: endpoint, - credential: mrTokenCredential, + credential: tokenCredential, credentialScopes: `${endpoint}/.default` }; diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index e47fc50d6689..09dc4dd64f9e 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -50,7 +50,6 @@ describe("RemoteRenderingClient construction", () => { const client = new RemoteRenderingClient( serviceEndpoint, accountId, - accountDomain, accessToken ); diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts index 7156603ad761..dc724c690fb4 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts @@ -56,7 +56,7 @@ export function createClient(): RemoteRenderingClient { // the AccessToken auth path. const maxTimestampMs = 8640000000000000; const credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; - return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + return new RemoteRenderingClient(serviceEndpoint, accountId, credential); } else { const credential: AzureKeyCredential = new AzureKeyCredential(accountKey); return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); From 8f13c633110d9dcd7ad491a2f69e583eb9597b43 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 14:56:00 +0100 Subject: [PATCH 157/166] Formatting --- .../src/remoteRenderingClient.ts | 22 ++++++++++--------- .../test/public/remoteRenderingClient.spec.ts | 6 +---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 5808f5514e60..491ad956083b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -223,22 +223,18 @@ export class RemoteRenderingClient { options?: RemoteRenderingClientOptions ); - constructor( - endpoint: string, - accountId: string, - ...args: Array) { - + constructor(endpoint: string, accountId: string, ...args: Array) { let tokenCredential: TokenCredential | null = null; let options: RemoteRenderingClientOptions = {}; - if ((args.length == 0) || (args.length > 3)) { + if (args.length == 0 || args.length > 3) { throw new Error("Wrong number of arguments"); - } else if ((typeof args[0] === "object") && (args.length <= 2)) { + } else if (typeof args[0] === "object" && args.length <= 2) { tokenCredential = new StaticAccessTokenCredential(args[0] as AccessToken); if (args.length == 2) { options = args[1]; } - } else if ((typeof args[0] === "string") && (args.length >= 2) && (args.length <= 3)) { + } else if (typeof args[0] === "string" && args.length >= 2 && args.length <= 3) { let accountDomain: string = args[0]; let credential: TokenCredential; @@ -252,9 +248,15 @@ export class RemoteRenderingClient { } const authenticationEndpoint = - options.authenticationEndpointUrl ?? constructAuthenticationEndpointFromDomain(accountDomain); + options.authenticationEndpointUrl ?? + constructAuthenticationEndpointFromDomain(accountDomain); const stsOptions = { customEndpointUrl: authenticationEndpoint }; - tokenCredential = new MixedRealityTokenCredential(accountId, accountDomain, credential, stsOptions) + tokenCredential = new MixedRealityTokenCredential( + accountId, + accountDomain, + credential, + stsOptions + ); if (args.length == 3) { options = args[2]; } diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index 09dc4dd64f9e..abb1be724878 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -47,11 +47,7 @@ describe("RemoteRenderingClient construction", () => { it("can create with AccessToken", () => { const maxTimestampMs = 8640000000000000; const accessToken: AccessToken = { expiresOnTimestamp: maxTimestampMs, token: `abcdefghijk` }; - const client = new RemoteRenderingClient( - serviceEndpoint, - accountId, - accessToken - ); + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accessToken); assert.isNotNull(client); }); From fb17ed0c521689d5226b6592b3eec6ffcc10b98a Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 14:56:43 +0100 Subject: [PATCH 158/166] Update docs --- sdk/remoterendering/mixedreality-remoterendering/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixedreality-remoterendering/README.md index 94bef9d11a2a..df5b9837f6c2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixedreality-remoterendering/README.md @@ -138,7 +138,7 @@ to be used with a Mixed Reality client library: // to the client. const accessToken = GetMixedRealityAccessTokenFromWebService(); -RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, accountId, accountDomain, accessToken); +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, accountId, accessToken); ``` ## Key concepts From dbb40077dd8c55e2a3b8aef484139607326c7d9d Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Thu, 1 Jul 2021 16:55:39 +0100 Subject: [PATCH 159/166] Drop expectDefinedFromService.ts --- .../src/internal/assetConversion.ts | 5 ++--- .../src/internal/expectDefinedFromService.ts | 14 -------------- .../src/internal/renderingSession.ts | 15 +++++++-------- 3 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts index fec147051434..20f69c4ea008 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts @@ -7,7 +7,6 @@ import { AssetConversionOutput, KnownAssetConversionStatus } from "../generated/models/index"; -import { expectDefinedFromService } from "./expectDefinedFromService"; import { RemoteRenderingServiceError, createRemoteRenderingServiceError @@ -92,7 +91,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Succeeded", ...baseProperties, - output: expectDefinedFromService(conversion, "output") + output: conversion.output! }; case KnownAssetConversionStatus.Cancelled: return { @@ -103,7 +102,7 @@ export function assetConversionFromConversion(conversion: Conversion): AssetConv return { status: "Failed", ...baseProperties, - error: createRemoteRenderingServiceError(expectDefinedFromService(conversion, "error")) + error: createRemoteRenderingServiceError(conversion.error!) }; default: throw new Error("Unrecognized AssetConversionStatus returned by the service"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts deleted file mode 100644 index 3d7da35e74cb..000000000000 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/expectDefinedFromService.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/** - * Check that obj[k] is defined. If not, throw a specific error. - * @internal - */ -export function expectDefinedFromService(obj: T, k: K): NonNullable { - const value = obj[k]; - if (value === undefined) { - throw new Error(`Internal Error: The remote rendering service failed to set property ${k}`); - } - return value!; -} diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts index a48e891730f4..3e378b9e6c4b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts @@ -6,7 +6,6 @@ import { SessionProperties, KnownRenderingSessionStatus } from "../generated/index"; -import { expectDefinedFromService } from "./expectDefinedFromService"; import { RemoteRenderingServiceError, createRemoteRenderingServiceError @@ -149,12 +148,12 @@ function renderingSessionPropertiesFromSessionProperties( session: SessionProperties ): RenderingSessionProperties { return { - arrInspectorPort: expectDefinedFromService(session, "arrInspectorPort"), - handshakePort: expectDefinedFromService(session, "handshakePort"), - elapsedTimeInMinutes: expectDefinedFromService(session, "elapsedTimeInMinutes"), - host: expectDefinedFromService(session, "host"), - teraflops: expectDefinedFromService(session, "teraflops"), - createdOn: expectDefinedFromService(session, "createdOn") + arrInspectorPort: session.arrInspectorPort!, + handshakePort: session.handshakePort!, + elapsedTimeInMinutes: session.elapsedTimeInMinutes!, + host: session.host!, + teraflops: session.teraflops!, + createdOn: session.createdOn! }; } @@ -203,7 +202,7 @@ export function renderingSessionFromSessionProperties( return { status: "Error", ...baseProperties, - error: createRemoteRenderingServiceError(expectDefinedFromService(session, "error")), + error: createRemoteRenderingServiceError(session.error!), partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) }; case KnownRenderingSessionStatus.Expired: From a7d03c9a6fdd24d88f9ebe86c076c96977426355 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Fri, 2 Jul 2021 10:12:16 +0100 Subject: [PATCH 160/166] Fixes --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 4 ++-- .../test/public/remoteRenderingClient.spec.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 491ad956083b..9b3ce3aba369 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -241,7 +241,7 @@ export class RemoteRenderingClient { if (args[1] instanceof AzureKeyCredential) { credential = new MixedRealityAccountKeyCredential(accountId, args[0]); - } else if (!isTokenCredential(args[1])) { + } else if (isTokenCredential(args[1])) { credential = args[1]; } else { throw new Error("Argument 4 is not a supported type of credential"); @@ -261,7 +261,7 @@ export class RemoteRenderingClient { options = args[2]; } } else { - throw new Error("Argument 3 is not of the expected type"); + throw new Error("Argument 3 is invalid."); } if (!endpoint) { diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index abb1be724878..efe428cadfb5 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -81,7 +81,7 @@ describe("RemoteRenderingClient construction", () => { assert.throws( () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), - "Argument cannot be null or empty: 'accountDomain'." + "Argument 3 is invalid." ); assert.throws( From ea6e04c0dbb6b0a3fab72f17282a39d401316a94 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 5 Jul 2021 10:09:43 +0100 Subject: [PATCH 161/166] Fix playback tests. --- .../src/remoteRenderingClient.ts | 6 ++++-- .../test/public/remoteRenderingClient.spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 9b3ce3aba369..d18c9fb61149 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -228,7 +228,9 @@ export class RemoteRenderingClient { let options: RemoteRenderingClientOptions = {}; if (args.length == 0 || args.length > 3) { - throw new Error("Wrong number of arguments"); + throw new Error("Wrong number of arguments."); + } else if (!args[0]) { + throw new Error("Argument 3 cannot be null or empty."); } else if (typeof args[0] === "object" && args.length <= 2) { tokenCredential = new StaticAccessTokenCredential(args[0] as AccessToken); if (args.length == 2) { @@ -244,7 +246,7 @@ export class RemoteRenderingClient { } else if (isTokenCredential(args[1])) { credential = args[1]; } else { - throw new Error("Argument 4 is not a supported type of credential"); + throw new Error("Argument 4 is not a supported type of credential."); } const authenticationEndpoint = diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts index efe428cadfb5..16e7ee135182 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts @@ -81,7 +81,7 @@ describe("RemoteRenderingClient construction", () => { assert.throws( () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), - "Argument 3 is invalid." + "Argument 3 cannot be null or empty." ); assert.throws( @@ -96,7 +96,7 @@ describe("RemoteRenderingClient construction", () => { assert.throws( () => new RemoteRenderingClient(serviceEndpoint, accountId, null!, keyCredential), - "Argument cannot be null or empty: 'accountDomain'." + "Argument 3 cannot be null or empty." ); }); }); From 8e0b5edc2a1533818a177a2d13131ba344f897a6 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 5 Jul 2021 11:18:46 +0100 Subject: [PATCH 162/166] Fix --- .../mixedreality-remoterendering/src/remoteRenderingClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index d18c9fb61149..9ffa727a43ca 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -242,7 +242,7 @@ export class RemoteRenderingClient { let credential: TokenCredential; if (args[1] instanceof AzureKeyCredential) { - credential = new MixedRealityAccountKeyCredential(accountId, args[0]); + credential = new MixedRealityAccountKeyCredential(accountId, args[1]); } else if (isTokenCredential(args[1])) { credential = args[1]; } else { From abd7be3d756445b7de9903a5126d7df1698d3d67 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 5 Jul 2021 12:08:52 +0100 Subject: [PATCH 163/166] Lint fix --- .../src/remoteRenderingClient.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts index 9ffa727a43ca..9f00e138f8a2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts @@ -227,17 +227,17 @@ export class RemoteRenderingClient { let tokenCredential: TokenCredential | null = null; let options: RemoteRenderingClientOptions = {}; - if (args.length == 0 || args.length > 3) { + if (args.length === 0 || args.length > 3) { throw new Error("Wrong number of arguments."); } else if (!args[0]) { throw new Error("Argument 3 cannot be null or empty."); } else if (typeof args[0] === "object" && args.length <= 2) { tokenCredential = new StaticAccessTokenCredential(args[0] as AccessToken); - if (args.length == 2) { + if (args.length === 2) { options = args[1]; } } else if (typeof args[0] === "string" && args.length >= 2 && args.length <= 3) { - let accountDomain: string = args[0]; + const accountDomain: string = args[0]; let credential: TokenCredential; @@ -259,7 +259,7 @@ export class RemoteRenderingClient { credential, stsOptions ); - if (args.length == 3) { + if (args.length === 3) { options = args[2]; } } else { From 070491e5fa1a789f617c0cb70fb4193acc6fd243 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 7 Jul 2021 16:57:51 +0100 Subject: [PATCH 164/166] Rename sdk to mixed-reality-remote-rendering --- common/config/rush/pnpm-lock.yaml | 10 +- dataplane.code-workspace | 4 +- rush.json | 4 +- sdk/remoterendering/ci.yml | 2 +- .../mixed-reality-remote-rendering/.gitignore | 2 + .../.nycrc | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 .../README.md | 4 +- .../api-extractor.json | 2 +- .../karma.conf.js | 0 .../package.json | 10 +- .../recording_can_convert_successfully.json | 0 .../recording_can_start_a_session.json | 0 ...throws_correct_exception_on_no_access.json | 0 ...ception_on_invalid_session_properties.json | 0 ...l_in_the_correct_way_on_missing_asset.json | 0 .../recording_can_convert_successfully.js | 0 .../recording_can_start_a_session.js | 0 ...g_throws_correct_exception_on_no_access.js | 0 ...exception_on_invalid_session_properties.js | 0 ...ail_in_the_correct_way_on_missing_asset.js | 0 .../mixed-reality-remote-rendering.api.md | 276 ++++++++++++++++++ .../mixedreality-remoterendering.api.md | 2 +- .../rollup.config.js | 0 .../sample.env | 0 .../samples-dev/listConversions.ts | 2 +- .../samples-dev/listSessions.ts | 2 +- .../samples-dev/moreComplexConversion.ts | 2 +- .../samples-dev/session.ts | 2 +- .../samples-dev/simpleConversion.ts | 2 +- .../authentication/authenticationEndpoint.ts | 0 .../mixedRealityAccountKeyCredential.ts | 0 .../mixedRealityTokenCredential.ts | 0 .../staticAccessTokenCredential.ts | 0 .../src/constants.ts | 0 .../src/generated/index.ts | 0 .../src/generated/models/index.ts | 0 .../src/generated/models/mappers.ts | 0 .../src/generated/models/parameters.ts | 2 +- .../src/generated/operations/index.ts | 0 .../generated/operations/remoteRendering.ts | 0 .../generated/operationsInterfaces/index.ts | 0 .../operationsInterfaces/remoteRendering.ts | 0 .../generated/remoteRenderingRestClient.ts | 0 .../remoteRenderingRestClientContext.ts | 2 +- .../src/index.ts | 0 .../src/internal/assetConversion.ts | 0 .../src/internal/commonQueries.ts | 0 .../src/internal/renderingSession.ts | 0 .../src/logger.ts | 2 +- .../src/lro/assetConversionPoller.ts | 0 .../src/lro/renderingSessionPoller.ts | 0 .../src/options.ts | 0 .../src/remoteRenderingClient.ts | 2 +- .../src/remoteRenderingServiceError.ts | 0 .../src/tracing.ts | 2 +- .../swagger/README.md | 2 +- .../test/public/remoteRenderingClient.spec.ts | 0 .../test/utils/env.browser.ts | 0 .../test/utils/env.ts | 0 .../test/utils/recordedClient.ts | 0 .../tests.yml | 4 +- .../tsconfig.json | 2 +- 64 files changed, 311 insertions(+), 33 deletions(-) create mode 100644 sdk/remoterendering/mixed-reality-remote-rendering/.gitignore rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/.nycrc (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/CHANGELOG.md (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/LICENSE (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/README.md (99%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/api-extractor.json (89%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/karma.conf.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/package.json (95%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js (100%) create mode 100644 sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/review/mixedreality-remoterendering.api.md (99%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/rollup.config.js (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/sample.env (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/samples-dev/listConversions.ts (95%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/samples-dev/listSessions.ts (96%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/samples-dev/moreComplexConversion.ts (99%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/samples-dev/session.ts (97%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/samples-dev/simpleConversion.ts (98%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/authentication/authenticationEndpoint.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/authentication/mixedRealityAccountKeyCredential.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/authentication/mixedRealityTokenCredential.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/authentication/staticAccessTokenCredential.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/constants.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/index.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/models/index.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/models/mappers.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/models/parameters.ts (98%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/operations/index.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/operations/remoteRendering.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/operationsInterfaces/index.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/operationsInterfaces/remoteRendering.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/remoteRenderingRestClient.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/generated/remoteRenderingRestClientContext.ts (95%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/index.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/internal/assetConversion.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/internal/commonQueries.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/internal/renderingSession.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/logger.ts (73%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/lro/assetConversionPoller.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/lro/renderingSessionPoller.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/options.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/remoteRenderingClient.ts (99%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/remoteRenderingServiceError.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/src/tracing.ts (83%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/swagger/README.md (98%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/test/public/remoteRenderingClient.spec.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/test/utils/env.browser.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/test/utils/env.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/test/utils/recordedClient.ts (100%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/tests.yml (68%) rename sdk/remoterendering/{mixedreality-remoterendering => mixed-reality-remote-rendering}/tsconfig.json (85%) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d513056bd064..ed823e992c57 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -51,7 +51,7 @@ dependencies: '@rush-temp/keyvault-secrets': file:projects/keyvault-secrets.tgz '@rush-temp/logger': file:projects/logger.tgz '@rush-temp/mixedreality-authentication': file:projects/mixedreality-authentication.tgz - '@rush-temp/mixedreality-remoterendering': file:projects/mixedreality-remoterendering.tgz + '@rush-temp/mixed-reality-remote-rendering': file:projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:projects/monitor-query.tgz @@ -10467,7 +10467,7 @@ packages: integrity: sha512-Dah2yhabK5HI4F06xOEqvf+iUXgLPdtJXFBVgIQy1+KFICPCqM0PMc0olF3nG/4KEo2t3Q2397KQLdRlfeUm2w== tarball: file:projects/mixedreality-authentication.tgz version: 0.0.0 - file:projects/mixedreality-remoterendering.tgz: + file:projects/mixed-reality-remote-rendering.tgz: dependencies: '@azure/identity': 1.3.0 '@microsoft/api-extractor': 7.7.11 @@ -10506,10 +10506,10 @@ packages: util: 0.12.4 uuid: 8.3.2 dev: false - name: '@rush-temp/mixedreality-remoterendering' + name: '@rush-temp/mixed-reality-remote-rendering' resolution: integrity: sha512-C8rmlojMOh5Fei9q15a3kKN3kNioe/SJLK+JtmVMdz3vNUnaotSRGNvSnZ9xCDBeSpujnjiNOY2YbAF12iOGBA== - tarball: file:projects/mixedreality-remoterendering.tgz + tarball: file:projects/mixed-reality-remote-rendering.tgz version: 0.0.0 file:projects/mock-hub.tgz: dependencies: @@ -12058,7 +12058,7 @@ specifiers: '@rush-temp/keyvault-secrets': file:./projects/keyvault-secrets.tgz '@rush-temp/logger': file:./projects/logger.tgz '@rush-temp/mixedreality-authentication': file:./projects/mixedreality-authentication.tgz - '@rush-temp/mixedreality-remoterendering': file:./projects/mixedreality-remoterendering.tgz + '@rush-temp/mixed-reality-remote-rendering': file:./projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:./projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:./projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:./projects/monitor-query.tgz diff --git a/dataplane.code-workspace b/dataplane.code-workspace index b5f188090dc4..b612418814c9 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -279,8 +279,8 @@ "path": "sdk/web-pubsub/web-pubsub-express" }, { - "name": "mixedreality-remoterendering", - "path": "sdk/remoterendering/mixedreality-remoterendering" + "name": "mixed-reality-remote-rendering", + "path": "sdk/remoterendering/mixed-reality-remote-rendering" } ], "settings": { diff --git a/rush.json b/rush.json index 3fe529a973ea..c7423324781f 100644 --- a/rush.json +++ b/rush.json @@ -791,8 +791,8 @@ "versionPolicyName": "test" }, { - "packageName": "@azure/mixedreality-remoterendering", - "projectFolder": "sdk/remoterendering/mixedreality-remoterendering", + "packageName": "@azure/mixed-reality-remote-rendering", + "projectFolder": "sdk/remoterendering/mixed-reality-remote-rendering", "versionPolicyName": "client" } ] diff --git a/sdk/remoterendering/ci.yml b/sdk/remoterendering/ci.yml index 8b93f28e039d..425edbddb2af 100644 --- a/sdk/remoterendering/ci.yml +++ b/sdk/remoterendering/ci.yml @@ -28,5 +28,5 @@ extends: parameters: ServiceDirectory: remoterendering Artifacts: - - name: azure-mixedreality-remoterendering + - name: azure-mixed-reality-remote-rendering safeName: azuremixedrealityremoterendering diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore b/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore new file mode 100644 index 000000000000..92f24649d57f --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore @@ -0,0 +1,2 @@ +samples +.vscode \ No newline at end of file diff --git a/sdk/remoterendering/mixedreality-remoterendering/.nycrc b/sdk/remoterendering/mixed-reality-remote-rendering/.nycrc similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/.nycrc rename to sdk/remoterendering/mixed-reality-remote-rendering/.nycrc diff --git a/sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md b/sdk/remoterendering/mixed-reality-remote-rendering/CHANGELOG.md similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/CHANGELOG.md rename to sdk/remoterendering/mixed-reality-remote-rendering/CHANGELOG.md diff --git a/sdk/remoterendering/mixedreality-remoterendering/LICENSE b/sdk/remoterendering/mixed-reality-remote-rendering/LICENSE similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/LICENSE rename to sdk/remoterendering/mixed-reality-remote-rendering/LICENSE diff --git a/sdk/remoterendering/mixedreality-remoterendering/README.md b/sdk/remoterendering/mixed-reality-remote-rendering/README.md similarity index 99% rename from sdk/remoterendering/mixedreality-remoterendering/README.md rename to sdk/remoterendering/mixed-reality-remote-rendering/README.md index df5b9837f6c2..41f9fcae6dd1 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/README.md +++ b/sdk/remoterendering/mixed-reality-remote-rendering/README.md @@ -23,12 +23,12 @@ the lifetime of remote rendering sessions. You will need an [Azure subscription](https://azure.microsoft.com/free/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. -### Install the `@azure/mixedreality-remoterendering` package +### Install the `@azure/mixed-reality-remote-rendering` package Install the Template client library for JavaScript with `npm`: ```bash -npm install @azure/mixedreality-remoterendering +npm install @azure/mixed-reality-remote-rendering ``` ### Browser support diff --git a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json b/sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json similarity index 89% rename from sdk/remoterendering/mixedreality-remoterendering/api-extractor.json rename to sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json index 6cea81b416bd..fb4a9ef9f374 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/api-extractor.json +++ b/sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/mixedreality-remoterendering.d.ts" + "publicTrimmedFilePath": "./types/mixed-reality-remote-rendering.d.ts" }, "messages": { "tsdocMessageReporting": { diff --git a/sdk/remoterendering/mixedreality-remoterendering/karma.conf.js b/sdk/remoterendering/mixed-reality-remote-rendering/karma.conf.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/karma.conf.js rename to sdk/remoterendering/mixed-reality-remote-rendering/karma.conf.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/package.json b/sdk/remoterendering/mixed-reality-remote-rendering/package.json similarity index 95% rename from sdk/remoterendering/mixedreality-remoterendering/package.json rename to sdk/remoterendering/mixed-reality-remote-rendering/package.json index cf8f372f5020..548f7594e8e6 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/package.json +++ b/sdk/remoterendering/mixed-reality-remote-rendering/package.json @@ -1,5 +1,5 @@ { - "name": "@azure/mixedreality-remoterendering", + "name": "@azure/mixed-reality-remote-rendering", "version": "1.0.0-beta.1", "description": "Example project for learning how to build a client library", "sdk-type": "client", @@ -8,7 +8,7 @@ "browser": { "./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js" }, - "types": "types/mixedreality-remoterendering.d.ts", + "types": "types/mixed-reality-remote-rendering.d.ts", "//metadata": { "constantPaths": [ { @@ -52,7 +52,7 @@ "files": [ "dist/", "dist-esm/src/", - "types/mixedreality-remoterendering.d.ts", + "types/mixed-reality-remote-rendering.d.ts", "README.md", "LICENSE" ], @@ -70,7 +70,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/remoterendering/mixedreality-remoterendering/README.md", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/remoterendering/mixed-reality-remote-rendering/README.md", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { @@ -130,7 +130,7 @@ "productName": "Azure Remote Rendering", "productSlugs": [ "azure", - "azure-mixedreality-remoterendering" + "azure-mixed-reality-remote-rendering" ], "requiredResources": { "Azure Remote Rendering account": "https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account", diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js rename to sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md new file mode 100644 index 000000000000..3b9ab75d7e45 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md @@ -0,0 +1,276 @@ +## API Report File for "@azure/mixed-reality-remote-rendering" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AccessToken } from '@azure/core-auth'; +import { AzureKeyCredential } from '@azure/core-auth'; +import { CommonClientOptions } from '@azure/core-client'; +import { OperationOptions } from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; + +// @public +export interface AssetConversionBase { + conversionId: string; + createdOn: Date; + settings: AssetConversionSettings; +} + +// @public +export interface AssetConversionInputSettings { + blobPrefix?: string; + relativeInputAssetPath: string; + storageContainerReadListSas?: string; + storageContainerUrl: string; +} + +// @public +export interface AssetConversionOperationState extends PollOperationState { + latestResponse: AssetConversion; +} + +// @public +export interface AssetConversionOutput { + readonly outputAssetUrl?: string; +} + +// @public +export interface AssetConversionOutputSettings { + blobPrefix?: string; + outputAssetFilename?: string; + storageContainerUrl: string; + storageContainerWriteSas?: string; +} + +// @public +export type AssetConversionPollerLike = PollerLike; + +// @public +export interface AssetConversionPollerOptions { + intervalInMs?: number; +} + +// @public +export interface AssetConversionSettings { + inputSettings: AssetConversionInputSettings; + outputSettings: AssetConversionOutputSettings; +} + +// @public +export type AssetConversionStatus = string; + +// @public +export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; + +// @public +export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; + +// @public +export interface CancelledAssetConversion extends AssetConversionBase { + status: "Cancelled"; +} + +// @public +export type EndSessionOptions = OperationOptions; + +// @public +export interface ErrorRenderingSession extends RenderingSessionBase { + readonly error: RemoteRenderingServiceError; + partialProperties: PartialRenderingSessionProperties; + status: "Error"; +} + +// @public +export interface ExpiredRenderingSession extends RenderingSessionBase { + properties: RenderingSessionProperties; + status: "Expired"; +} + +// @public +export interface FailedAssetConversion extends AssetConversionBase { + error: RemoteRenderingServiceError; + status: "Failed"; +} + +// @public +export type GetConversionOptions = OperationOptions; + +// @public +export type GetSessionOptions = OperationOptions; + +// @public +export enum KnownAssetConversionStatus { + Cancelled = "Cancelled", + Failed = "Failed", + NotStarted = "NotStarted", + Running = "Running", + Succeeded = "Succeeded" +} + +// @public +export enum KnownRenderingServerSize { + Premium = "Premium", + Standard = "Standard" +} + +// @public +export enum KnownRenderingSessionStatus { + Error = "Error", + Expired = "Expired", + Ready = "Ready", + Starting = "Starting", + Stopped = "Stopped" +} + +// @public +export type ListConversionsOptions = OperationOptions; + +// @public +export type ListSessionsOptions = OperationOptions; + +// @public +export interface NonStartedAssetConversion extends AssetConversionBase { + status: "NotStarted"; +} + +// @public +export interface PartialRenderingSessionProperties { + readonly arrInspectorPort?: number; + readonly createdOn?: Date; + readonly elapsedTimeInMinutes?: number; + readonly handshakePort?: number; + readonly host?: string; + readonly teraflops?: number; +} + +// @public +export interface ReadyRenderingSession extends RenderingSessionBase { + properties: RenderingSessionProperties; + status: "Ready"; +} + +// @public +export class RemoteRenderingClient { + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, credential: AccessToken, options?: RemoteRenderingClientOptions); + beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions): Promise; + beginConversion(options: ResumeBeginConversionOptions): Promise; + beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; + beginSession(options: ResumeBeginSessionOptions): Promise; + endSession(sessionId: string, options?: EndSessionOptions): Promise; + getConversion(conversionId: string, options?: GetConversionOptions): Promise; + getSession(sessionId: string, options?: GetSessionOptions): Promise; + listConversions(options?: ListConversionsOptions): PagedAsyncIterableIterator; + listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator; + updateSession(sessionId: string, settings: UpdateSessionSettings, options?: UpdateSessionOptions): Promise; +} + +// @public +export interface RemoteRenderingClientOptions extends CommonClientOptions { + authenticationEndpointUrl?: string; +} + +// @public +export class RemoteRenderingServiceError extends Error { + constructor(message: string, code: string); + code: string; + details?: RemoteRenderingServiceError[]; + innerError?: RemoteRenderingServiceError; + target?: string; +} + +// @public +export type RenderingServerSize = string; + +// @public +export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; + +// @public +export interface RenderingSessionBase { + maxLeaseTimeInMinutes: number; + sessionId: string; + size: RenderingServerSize; +} + +// @public +export interface RenderingSessionOperationState extends PollOperationState { + latestResponse: RenderingSession; +} + +// @public +export type RenderingSessionPollerLike = PollerLike; + +// @public +export interface RenderingSessionPollerOptions { + intervalInMs?: number; +} + +// @public +export interface RenderingSessionProperties { + readonly arrInspectorPort: number; + readonly createdOn: Date; + readonly elapsedTimeInMinutes: number; + readonly handshakePort: number; + readonly host: string; + readonly teraflops: number; +} + +// @public +export interface RenderingSessionSettings { + maxLeaseTimeInMinutes: number; + size: RenderingServerSize; +} + +// @public +export type ResumeBeginConversionOptions = BeginConversionOptions & { + resumeFrom: string; +}; + +// @public +export type ResumeBeginSessionOptions = BeginSessionOptions & { + resumeFrom: string; +}; + +// @public +export interface RunningAssetConversion extends AssetConversionBase { + status: "Running"; +} + +// @public +export interface StartingRenderingSession extends RenderingSessionBase { + partialProperties: PartialRenderingSessionProperties; + status: "Starting"; +} + +// @public +export interface StoppedRenderingSession extends RenderingSessionBase { + partialProperties: PartialRenderingSessionProperties; + status: "Stopped"; +} + +// @public +export interface SucceededAssetConversion extends AssetConversionBase { + readonly output: AssetConversionOutput; + status: "Succeeded"; +} + +// @public +export type UpdateSessionOptions = OperationOptions; + +// @public +export interface UpdateSessionSettings { + maxLeaseTimeInMinutes: number; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md similarity index 99% rename from sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md rename to sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md index 3a094b39eab8..3b9ab75d7e45 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/review/mixedreality-remoterendering.api.md +++ b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md @@ -1,4 +1,4 @@ -## API Report File for "@azure/mixedreality-remoterendering" +## API Report File for "@azure/mixed-reality-remote-rendering" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/sdk/remoterendering/mixedreality-remoterendering/rollup.config.js b/sdk/remoterendering/mixed-reality-remote-rendering/rollup.config.js similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/rollup.config.js rename to sdk/remoterendering/mixed-reality-remote-rendering/rollup.config.js diff --git a/sdk/remoterendering/mixedreality-remoterendering/sample.env b/sdk/remoterendering/mixed-reality-remote-rendering/sample.env similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/sample.env rename to sdk/remoterendering/mixed-reality-remote-rendering/sample.env diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts similarity index 95% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts index 9c36fdc8317a..54c953ee7493 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listConversions.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts @@ -7,7 +7,7 @@ /// -import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; +import { RemoteRenderingClient } from "@azure/mixed-reality-remote-rendering"; import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts similarity index 96% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts index 2675787df3df..32f2c705ac3b 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/listSessions.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts @@ -7,7 +7,7 @@ /// -import { RemoteRenderingClient } from "@azure/mixedreality-remoterendering"; +import { RemoteRenderingClient } from "@azure/mixed-reality-remote-rendering"; import { AzureKeyCredential } from "@azure/core-auth"; import { delay } from "@azure/core-util"; diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts similarity index 99% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts index 1cde2a9803e4..921fa4e32ef9 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/moreComplexConversion.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts @@ -16,7 +16,7 @@ import { AssetConversionSettings, AssetConversionPollerLike, AssetConversion -} from "@azure/mixedreality-remoterendering"; +} from "@azure/mixed-reality-remote-rendering"; import { DeviceCodeCredential, DeviceCodeInfo, diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts similarity index 97% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts index 4dab88990634..805b49be1a97 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/session.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts @@ -14,7 +14,7 @@ import { RenderingSessionSettings, RenderingSessionPollerLike, RenderingSession -} from "@azure/mixedreality-remoterendering"; +} from "@azure/mixed-reality-remote-rendering"; import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists diff --git a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts similarity index 98% rename from sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts index c2c604d58fab..c7e0511241eb 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/samples-dev/simpleConversion.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts @@ -16,7 +16,7 @@ import { AssetConversionSettings, AssetConversionPollerLike, AssetConversion -} from "@azure/mixedreality-remoterendering"; +} from "@azure/mixed-reality-remote-rendering"; import { AzureKeyCredential } from "@azure/core-auth"; // Load the .env file if it exists diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/authenticationEndpoint.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/authentication/authenticationEndpoint.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/authenticationEndpoint.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityAccountKeyCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityAccountKeyCredential.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityAccountKeyCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/authentication/mixedRealityTokenCredential.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/staticAccessTokenCredential.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/authentication/staticAccessTokenCredential.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/staticAccessTokenCredential.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/constants.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/constants.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/constants.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/constants.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/index.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/index.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/index.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/index.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/models/index.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/index.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/mappers.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/models/mappers.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/mappers.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts similarity index 98% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts index f40b95277662..de4379990874 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/models/parameters.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts @@ -15,7 +15,7 @@ import { CreateConversionSettings as CreateConversionSettingsMapper, RenderingSessionSettings as RenderingSessionSettingsMapper, UpdateSessionSettings as UpdateSessionSettingsMapper -} from "../models/mappers"; +} from "./mappers"; export const contentType: OperationParameter = { parameterPath: ["options", "contentType"], diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/index.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/index.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/index.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/remoteRendering.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/operations/remoteRendering.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/remoteRendering.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/index.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/index.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/index.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/remoteRendering.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/operationsInterfaces/remoteRendering.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/remoteRendering.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClient.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClient.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClient.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts similarity index 95% rename from sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts index dde57f209882..f0cd8195c871 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/generated/remoteRenderingRestClientContext.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts @@ -36,7 +36,7 @@ export class RemoteRenderingRestClientContext extends coreClient.ServiceClient { requestContentType: "application/json; charset=utf-8" }; - const packageDetails = `azsdk-js-mixedreality-remoterendering/1.0.0-beta.1`; + const packageDetails = `azsdk-js-mixed-reality-remote-rendering/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/index.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/index.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/index.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/assetConversion.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/internal/assetConversion.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/internal/assetConversion.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/commonQueries.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/internal/commonQueries.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/internal/commonQueries.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/renderingSession.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/internal/renderingSession.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/internal/renderingSession.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts similarity index 73% rename from sdk/remoterendering/mixedreality-remoterendering/src/logger.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts index e5dc69c59636..0abaa79eb55d 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/logger.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts @@ -8,4 +8,4 @@ import { createClientLogger } from "@azure/logger"; * * @internal */ -export const logger = createClientLogger("mixedreality-remoterendering"); +export const logger = createClientLogger("mixed-reality-remote-rendering"); diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/assetConversionPoller.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/lro/assetConversionPoller.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/lro/assetConversionPoller.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/renderingSessionPoller.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/lro/renderingSessionPoller.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/lro/renderingSessionPoller.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/options.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/options.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/options.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/options.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts similarity index 99% rename from sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts index 9f00e138f8a2..323065dc4bc2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingClient.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts @@ -277,7 +277,7 @@ export class RemoteRenderingClient { this.accountId = accountId; // The below code helps us set a proper User-Agent header on all requests - const libInfo = `azsdk-js-mixedreality-remoterendering/${SDK_VERSION}`; + const libInfo = `azsdk-js-mixed-reality-remote-rendering/${SDK_VERSION}`; if (!options.userAgentOptions) { options.userAgentOptions = {}; diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingServiceError.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/src/remoteRenderingServiceError.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingServiceError.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts similarity index 83% rename from sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts index 9cb30cfc222d..8a44b9a0bfb2 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/src/tracing.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts @@ -8,6 +8,6 @@ import { createSpanFunction } from "@azure/core-tracing"; * @internal */ export const createSpan = createSpanFunction({ - packagePrefix: "Azure.MixedReality-RemoteRendering", + packagePrefix: "Azure.mixed-reality-remote-rendering", namespace: "Microsoft.MixedReality" }); diff --git a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md b/sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md similarity index 98% rename from sdk/remoterendering/mixedreality-remoterendering/swagger/README.md rename to sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md index 954b94d445ed..567ccb3ca817 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/swagger/README.md +++ b/sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md @@ -6,7 +6,7 @@ ```yaml v3: true -package-name: "@azure/mixedreality-remoterendering" +package-name: "@azure/mixed-reality-remote-rendering" title: RemoteRenderingRestClient description: Azure Remote Rendering Client generate-metadata: false diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/public/remoteRenderingClient.spec.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/test/public/remoteRenderingClient.spec.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/test/public/remoteRenderingClient.spec.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.browser.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/test/utils/env.browser.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.browser.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/test/utils/env.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/recordedClient.ts similarity index 100% rename from sdk/remoterendering/mixedreality-remoterendering/test/utils/recordedClient.ts rename to sdk/remoterendering/mixed-reality-remote-rendering/test/utils/recordedClient.ts diff --git a/sdk/remoterendering/mixedreality-remoterendering/tests.yml b/sdk/remoterendering/mixed-reality-remote-rendering/tests.yml similarity index 68% rename from sdk/remoterendering/mixedreality-remoterendering/tests.yml rename to sdk/remoterendering/mixed-reality-remote-rendering/tests.yml index bf477b57f4a2..5c69d891ad48 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/tests.yml +++ b/sdk/remoterendering/mixed-reality-remote-rendering/tests.yml @@ -3,8 +3,8 @@ trigger: none extends: template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - PackageName: "@azure/mixedreality-remoterendering" + PackageName: "@azure/mixed-reality-remote-rendering" ServiceDirectory: remoterendering Location: eastus2 MatrixFilters: - - DependencyVersion=^$ \ No newline at end of file + - DependencyVersion=^$ diff --git a/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json b/sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json similarity index 85% rename from sdk/remoterendering/mixedreality-remoterendering/tsconfig.json rename to sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json index e4ceba069325..5b129befdb47 100644 --- a/sdk/remoterendering/mixedreality-remoterendering/tsconfig.json +++ b/sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "./dist-esm", "declarationDir": "./types", "paths": { - "@azure/mixedreality-remoterendering": ["./src/index"] + "@azure/mixed-reality-remote-rendering": ["./src/index"] } }, "exclude": [ From a6a6c19299a24cf7ca58b6e6cb5f2fb0cd1ba7f3 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 7 Jul 2021 17:04:26 +0100 Subject: [PATCH 165/166] Adapt STS to new naming scheme --- common/config/rush/pnpm-lock.yaml | 10 ++++----- dataplane.code-workspace | 4 ++-- rush.json | 4 ++-- sdk/mixedreality/ci.yml | 2 +- .../.nycrc | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 .../README.md | 22 +++++++++---------- .../api-extractor.json | 2 +- .../karma.conf.js | 0 .../package.json | 12 +++++----- .../recording_get_token.json | 0 .../recording_get_token.js | 0 .../mixed-reality-authentication.api.md} | 2 +- .../rollup.config.js | 0 .../sample.env | 0 .../samples-dev}/getToken.ts | 2 +- .../samples/v1/javascript/README.md | 6 ++--- .../samples/v1/javascript/getToken.js | 2 +- .../samples/v1/javascript/package.json | 8 +++---- .../samples/v1/javascript/sample.env | 0 .../samples/v1/typescript/README.md | 6 ++--- .../samples/v1/typescript/package.json | 8 +++---- .../samples/v1/typescript/sample.env | 0 .../samples/v1/typescript/src}/getToken.ts | 2 +- .../samples/v1/typescript/tsconfig.json | 0 .../snippets/prerequisites.md | 0 .../src/constants.ts | 0 .../src/generated/index.ts | 0 .../generated/mixedRealityStsRestClient.ts | 0 .../mixedRealityStsRestClientContext.ts | 2 +- .../src/generated/models/index.ts | 0 .../src/generated/models/mappers.ts | 0 .../src/generated/models/parameters.ts | 0 .../src/index.ts | 0 .../src/logger.ts | 2 +- .../src/mixedRealityStsClient.ts | 2 +- .../src/models/auth.ts | 0 .../src/models/mappers.ts | 0 .../src/models/options.ts | 0 .../src/tracing.ts | 0 .../src/util/authenticationEndpoint.ts | 0 .../src/util/base64.ts | 0 .../src/util/cv.ts | 0 .../src/util/jwt.ts | 0 .../swagger/README.md | 2 +- .../test/authenticationEndpoint.spec.ts | 0 .../test/jwt.spec.ts | 0 .../test/mixedRealityStsClient.spec.ts | 0 .../test/utils/env.browser.ts | 0 .../test/utils/env.ts | 0 .../test/utils/recordedClient.ts | 0 .../test/utils/tokenCredentialHelper.ts | 0 .../tests.yml | 2 +- .../tsconfig.json | 2 +- .../mixed-reality-remote-rendering/README.md | 2 +- .../package.json | 2 +- .../mixedRealityTokenCredential.ts | 2 +- 58 files changed, 55 insertions(+), 55 deletions(-) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/.nycrc (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/CHANGELOG.md (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/LICENSE (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/README.md (91%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/api-extractor.json (89%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/karma.conf.js (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/package.json (94%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js (100%) rename sdk/mixedreality/{mixedreality-authentication/review/mixedreality-authentication.api.md => mixed-reality-authentication/review/mixed-reality-authentication.api.md} (94%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/rollup.config.js (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/sample.env (100%) rename sdk/mixedreality/{mixedreality-authentication/samples/v1/typescript/src => mixed-reality-authentication/samples-dev}/getToken.ts (93%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/javascript/README.md (95%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/javascript/getToken.js (93%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/javascript/package.json (74%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/javascript/sample.env (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/typescript/README.md (95%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/typescript/package.json (77%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/typescript/sample.env (100%) rename sdk/mixedreality/{mixedreality-authentication/samples-dev => mixed-reality-authentication/samples/v1/typescript/src}/getToken.ts (93%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/samples/v1/typescript/tsconfig.json (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/snippets/prerequisites.md (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/constants.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/index.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/mixedRealityStsRestClient.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/mixedRealityStsRestClientContext.ts (95%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/models/index.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/models/mappers.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/generated/models/parameters.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/index.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/logger.ts (71%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/mixedRealityStsClient.ts (98%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/models/auth.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/models/mappers.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/models/options.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/tracing.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/util/authenticationEndpoint.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/util/base64.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/util/cv.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/src/util/jwt.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/swagger/README.md (94%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/authenticationEndpoint.spec.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/jwt.spec.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/mixedRealityStsClient.spec.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/utils/env.browser.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/utils/env.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/utils/recordedClient.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/test/utils/tokenCredentialHelper.ts (100%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/tests.yml (81%) rename sdk/mixedreality/{mixedreality-authentication => mixed-reality-authentication}/tsconfig.json (78%) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ed823e992c57..d76c35d79d88 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -50,7 +50,7 @@ dependencies: '@rush-temp/keyvault-keys': file:projects/keyvault-keys.tgz '@rush-temp/keyvault-secrets': file:projects/keyvault-secrets.tgz '@rush-temp/logger': file:projects/logger.tgz - '@rush-temp/mixedreality-authentication': file:projects/mixedreality-authentication.tgz + '@rush-temp/mixed-reality-authentication': file:projects/mixed-reality-authentication.tgz '@rush-temp/mixed-reality-remote-rendering': file:projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:projects/monitor-opentelemetry-exporter.tgz @@ -10424,7 +10424,7 @@ packages: integrity: sha512-nYl70rSzi6HROwq6Tby45FL6Wfr0bIIL75bIBdgOoNqZ4Jbjrtghfx+iElia55MMylPZ5Zc+yYaBwOKf2wld4Q== tarball: file:projects/logger.tgz version: 0.0.0 - file:projects/mixedreality-authentication.tgz: + file:projects/mixed-reality-authentication.tgz: dependencies: '@azure/core-tracing': 1.0.0-preview.12 '@microsoft/api-extractor': 7.7.11 @@ -10462,10 +10462,10 @@ packages: typescript: 4.2.4 util: 0.12.4 dev: false - name: '@rush-temp/mixedreality-authentication' + name: '@rush-temp/mixed-reality-authentication' resolution: integrity: sha512-Dah2yhabK5HI4F06xOEqvf+iUXgLPdtJXFBVgIQy1+KFICPCqM0PMc0olF3nG/4KEo2t3Q2397KQLdRlfeUm2w== - tarball: file:projects/mixedreality-authentication.tgz + tarball: file:projects/mixed-reality-authentication.tgz version: 0.0.0 file:projects/mixed-reality-remote-rendering.tgz: dependencies: @@ -12057,7 +12057,7 @@ specifiers: '@rush-temp/keyvault-keys': file:./projects/keyvault-keys.tgz '@rush-temp/keyvault-secrets': file:./projects/keyvault-secrets.tgz '@rush-temp/logger': file:./projects/logger.tgz - '@rush-temp/mixedreality-authentication': file:./projects/mixedreality-authentication.tgz + '@rush-temp/mixed-reality-authentication': file:./projects/mixed-reality-authentication.tgz '@rush-temp/mixed-reality-remote-rendering': file:./projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:./projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:./projects/monitor-opentelemetry-exporter.tgz diff --git a/dataplane.code-workspace b/dataplane.code-workspace index b612418814c9..88804c88d9db 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -261,8 +261,8 @@ "path": "sdk/digitaltwins/digital-twins-core" }, { - "name": "mixedreality-authentication", - "path": "sdk/mixedreality/mixedreality-authentication" + "name": "mixed-reality-authentication", + "path": "sdk/mixedreality/mixed-reality-authentication" }, { "name": "attestation", diff --git a/rush.json b/rush.json index c7423324781f..b9f02cfd039d 100644 --- a/rush.json +++ b/rush.json @@ -751,8 +751,8 @@ "versionPolicyName": "test" }, { - "packageName": "@azure/mixedreality-authentication", - "projectFolder": "sdk/mixedreality/mixedreality-authentication", + "packageName": "@azure/mixed-reality-authentication", + "projectFolder": "sdk/mixedreality/mixed-reality-authentication", "versionPolicyName": "client" }, { diff --git a/sdk/mixedreality/ci.yml b/sdk/mixedreality/ci.yml index 9f3a61d98a9a..27bc16c0f621 100644 --- a/sdk/mixedreality/ci.yml +++ b/sdk/mixedreality/ci.yml @@ -26,5 +26,5 @@ extends: parameters: ServiceDirectory: mixedreality Artifacts: - - name: azure-mixedreality-authentication + - name: azure-mixed-reality-authentication safeName: azuremixedrealityauthentication diff --git a/sdk/mixedreality/mixedreality-authentication/.nycrc b/sdk/mixedreality/mixed-reality-authentication/.nycrc similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/.nycrc rename to sdk/mixedreality/mixed-reality-authentication/.nycrc diff --git a/sdk/mixedreality/mixedreality-authentication/CHANGELOG.md b/sdk/mixedreality/mixed-reality-authentication/CHANGELOG.md similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/CHANGELOG.md rename to sdk/mixedreality/mixed-reality-authentication/CHANGELOG.md diff --git a/sdk/mixedreality/mixedreality-authentication/LICENSE b/sdk/mixedreality/mixed-reality-authentication/LICENSE similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/LICENSE rename to sdk/mixedreality/mixed-reality-authentication/LICENSE diff --git a/sdk/mixedreality/mixedreality-authentication/README.md b/sdk/mixedreality/mixed-reality-authentication/README.md similarity index 91% rename from sdk/mixedreality/mixedreality-authentication/README.md rename to sdk/mixedreality/mixed-reality-authentication/README.md index 288023bba79c..0075fd13dae6 100644 --- a/sdk/mixedreality/mixedreality-authentication/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/README.md @@ -4,10 +4,10 @@ Mixed Reality services, like Azure Spatial Anchors, Azure Remote Rendering, and token service (STS) for authentication. This package supports exchanging Mixed Reality account credentials for an access token from the STS that can be used to access Mixed Reality services. -[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) | -[Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) | -[API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) | -[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples) +[Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/) | +[Package (NPM)](https://www.npmjs.com/package/@azure/mixed-reality-authentication) | +[API reference documentation](https://aka.ms/azsdk/js/mixed-reality-authentication/docs) | +[Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/samples) ![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) @@ -25,12 +25,12 @@ token from the STS that can be used to access Mixed Reality services. - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/) - Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity]. -### Install the `@azure/mixedreality-authentication` package +### Install the `@azure/mixed-reality-authentication` package Install the Azure Mixed Reality Authentication client library for JavaScript with `npm`: ```bash -npm install @azure/mixedreality-authentication +npm install @azure/mixed-reality-authentication ``` ### Create and authenticate a `MixedRealityStsClient` @@ -62,7 +62,7 @@ Once you have an account key, you can use the `AzureKeyCredential` class to auth ```js const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const accountId = ""; const accountDomain = ""; @@ -95,7 +95,7 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. ```js -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const { DefaultAzureCredential } = require("@azure/identity"); const client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential()); @@ -121,7 +121,7 @@ The return value for a successful call to `getToken` is an `GetTokenResponse`, w ```js const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const accountId = ""; const accountDomain = ""; @@ -174,7 +174,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps Please take a look at the -[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples) +[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/samples) directory for detailed examples on how to use this library. ## Contributing @@ -206,4 +206,4 @@ build and test the code. [register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixed-reality-authentication%2FREADME.png) diff --git a/sdk/mixedreality/mixedreality-authentication/api-extractor.json b/sdk/mixedreality/mixed-reality-authentication/api-extractor.json similarity index 89% rename from sdk/mixedreality/mixedreality-authentication/api-extractor.json rename to sdk/mixedreality/mixed-reality-authentication/api-extractor.json index 643ca5ed1a56..5ca71b6aada1 100644 --- a/sdk/mixedreality/mixedreality-authentication/api-extractor.json +++ b/sdk/mixedreality/mixed-reality-authentication/api-extractor.json @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/mixedreality-authentication.d.ts" + "publicTrimmedFilePath": "./types/mixed-reality-authentication.d.ts" }, "messages": { "tsdocMessageReporting": { diff --git a/sdk/mixedreality/mixedreality-authentication/karma.conf.js b/sdk/mixedreality/mixed-reality-authentication/karma.conf.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/karma.conf.js rename to sdk/mixedreality/mixed-reality-authentication/karma.conf.js diff --git a/sdk/mixedreality/mixedreality-authentication/package.json b/sdk/mixedreality/mixed-reality-authentication/package.json similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/package.json rename to sdk/mixedreality/mixed-reality-authentication/package.json index 0686b4a5be8a..6928860e9f0b 100644 --- a/sdk/mixedreality/mixedreality-authentication/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/package.json @@ -1,5 +1,5 @@ { - "name": "@azure/mixedreality-authentication", + "name": "@azure/mixed-reality-authentication", "version": "1.0.0-beta.1", "description": "Azure client library for Mixed Reality authentication.", "sdk-type": "client", @@ -8,7 +8,7 @@ "browser": { "./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js" }, - "types": "types/mixedreality-authentication.d.ts", + "types": "types/mixed-reality-authentication.d.ts", "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", @@ -26,7 +26,7 @@ "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0", + "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixed-reality-authentication-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", @@ -40,14 +40,14 @@ "files": [ "dist/", "dist-esm/src/", - "types/mixedreality-authentication.d.ts", + "types/mixed-reality-authentication.d.ts", "README.md", "LICENSE" ], "repository": { "type": "git", "url": "github:Azure/azure-sdk-for-js", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "engines": { "node": ">=12.0.0" @@ -63,7 +63,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { diff --git a/sdk/mixedreality/mixedreality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json b/sdk/mixedreality/mixed-reality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json rename to sdk/mixedreality/mixed-reality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json diff --git a/sdk/mixedreality/mixedreality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js b/sdk/mixedreality/mixed-reality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js rename to sdk/mixedreality/mixed-reality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js diff --git a/sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md b/sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md rename to sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md index fbd87949da07..dae0897f348e 100644 --- a/sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md +++ b/sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md @@ -1,4 +1,4 @@ -## API Report File for "@azure/mixedreality-authentication" +## API Report File for "@azure/mixed-reality-authentication" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/sdk/mixedreality/mixedreality-authentication/rollup.config.js b/sdk/mixedreality/mixed-reality-authentication/rollup.config.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/rollup.config.js rename to sdk/mixedreality/mixed-reality-authentication/rollup.config.js diff --git a/sdk/mixedreality/mixedreality-authentication/sample.env b/sdk/mixedreality/mixed-reality-authentication/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/sample.env rename to sdk/mixedreality/mixed-reality-authentication/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts b/sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts rename to sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts index 82a8ff7ea6db..8ea1054675a7 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts +++ b/sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts @@ -7,7 +7,7 @@ */ import { AzureKeyCredential } from "@azure/core-auth"; -import { MixedRealityStsClient } from "@azure/mixedreality-authentication"; +import { MixedRealityStsClient } from "@azure/mixed-reality-authentication"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md index 5a46d70d4816..032d47e1e59f 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md @@ -6,7 +6,7 @@ products: - azure - azure-remote-rendering - azure-spatial-anchors -urlFragment: mixedreality-authentication-javascript +urlFragment: mixed-reality-authentication-javascript --- # Azure Mixed Reality Authentication client library samples for JavaScript @@ -63,10 +63,10 @@ npx cross-env MIXEDREALITY_ACCOUNT_DOMAIN="" MIXEDR Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js +[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js [apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ [createinstance_azureobjectanchorsaccount]: https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account [createinstance_azureremoterenderingaccount]: https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup [createinstance_azurespatialanchorsaccount]: https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/README.md diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js index 3a4c1ecb0f81..6c294aab24bc 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js @@ -7,7 +7,7 @@ */ const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); // Load the .env file if it exists const dotenv = require("dotenv"); diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json similarity index 74% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json index 94d306a779e4..d1690265db1a 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json @@ -1,5 +1,5 @@ { - "name": "azure-mixedreality-authentication-samples-js", + "name": "azure-mixed-reality-authentication-samples-js", "private": true, "version": "1.0.0", "description": "Azure Mixed Reality Authentication client library samples for JavaScript", @@ -9,7 +9,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "keywords": [ "azure", @@ -22,9 +22,9 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication", "dependencies": { - "@azure/mixedreality-authentication": "next", + "@azure/mixed-reality-authentication": "next", "dotenv": "latest", "@azure/core-auth": "^1.3.0" } diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/sample.env b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/sample.env rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md index 35945536cfad..1c60c6d7cff2 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md @@ -6,7 +6,7 @@ products: - azure - azure-remote-rendering - azure-spatial-anchors -urlFragment: mixedreality-authentication-typescript +urlFragment: mixed-reality-authentication-typescript --- # Azure Mixed Reality Authentication client library samples for TypeScript @@ -75,11 +75,11 @@ npx cross-env MIXEDREALITY_ACCOUNT_DOMAIN="" MIXEDR Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts +[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts [apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ [createinstance_azureobjectanchorsaccount]: https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account [createinstance_azureremoterenderingaccount]: https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup [createinstance_azurespatialanchorsaccount]: https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/README.md [typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json similarity index 77% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json index e0ead17f9494..45b4627cb0be 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "azure-mixedreality-authentication-samples-ts", + "name": "azure-mixed-reality-authentication-samples-ts", "private": true, "version": "1.0.0", "description": "Azure Mixed Reality Authentication client library samples for TypeScript", @@ -13,7 +13,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "keywords": [ "azure", @@ -26,9 +26,9 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication", "dependencies": { - "@azure/mixedreality-authentication": "next", + "@azure/mixed-reality-authentication": "next", "dotenv": "latest", "@azure/core-auth": "^1.3.0" }, diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/sample.env b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/sample.env rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts index 82a8ff7ea6db..8ea1054675a7 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts @@ -7,7 +7,7 @@ */ import { AzureKeyCredential } from "@azure/core-auth"; -import { MixedRealityStsClient } from "@azure/mixedreality-authentication"; +import { MixedRealityStsClient } from "@azure/mixed-reality-authentication"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/tsconfig.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/tsconfig.json similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/tsconfig.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/tsconfig.json diff --git a/sdk/mixedreality/mixedreality-authentication/snippets/prerequisites.md b/sdk/mixedreality/mixed-reality-authentication/snippets/prerequisites.md similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/snippets/prerequisites.md rename to sdk/mixedreality/mixed-reality-authentication/snippets/prerequisites.md diff --git a/sdk/mixedreality/mixedreality-authentication/src/constants.ts b/sdk/mixedreality/mixed-reality-authentication/src/constants.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/constants.ts rename to sdk/mixedreality/mixed-reality-authentication/src/constants.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClient.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClient.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClient.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts index 34754d0eb484..e2e0f8a7d4cc 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts @@ -9,7 +9,7 @@ import * as coreHttp from "@azure/core-http"; import { MixedRealityStsRestClientOptionalParams } from "./models"; -const packageName = "@azure/mixedreality-authentication"; +const packageName = "@azure/mixed-reality-authentication"; const packageVersion = "1.0.0"; /** @hidden */ diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/mappers.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/mappers.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/mappers.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/mappers.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/parameters.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/parameters.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/parameters.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/parameters.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/logger.ts b/sdk/mixedreality/mixed-reality-authentication/src/logger.ts similarity index 71% rename from sdk/mixedreality/mixedreality-authentication/src/logger.ts rename to sdk/mixedreality/mixed-reality-authentication/src/logger.ts index 918266dccda0..85e0b3e014b1 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/logger.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/logger.ts @@ -8,4 +8,4 @@ import { createClientLogger, AzureLogger } from "@azure/logger"; * * @internal */ -export const logger: AzureLogger = createClientLogger("mixedreality-authentication"); +export const logger: AzureLogger = createClientLogger("mixed-reality-authentication"); diff --git a/sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts b/sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts similarity index 98% rename from sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts rename to sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts index 40602413be32..943c765dd012 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts @@ -93,7 +93,7 @@ export class MixedRealityStsClient { options.customEndpointUrl || constructAuthenticationEndpointFromDomain(accountDomain); // The below code helps us set a proper User-Agent header on all requests - const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; + const libInfo = `azsdk-js-mixed-reality-authentication/${SDK_VERSION}`; if (!options.userAgentOptions) { options.userAgentOptions = {}; diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/auth.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/auth.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/auth.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/auth.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/mappers.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/mappers.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/mappers.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/mappers.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/options.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/options.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/options.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/options.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/tracing.ts b/sdk/mixedreality/mixed-reality-authentication/src/tracing.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/tracing.ts rename to sdk/mixedreality/mixed-reality-authentication/src/tracing.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/authenticationEndpoint.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/authenticationEndpoint.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/authenticationEndpoint.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/authenticationEndpoint.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/base64.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/base64.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/base64.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/base64.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/cv.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/cv.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/cv.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/cv.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/jwt.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/jwt.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/jwt.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/jwt.ts diff --git a/sdk/mixedreality/mixedreality-authentication/swagger/README.md b/sdk/mixedreality/mixed-reality-authentication/swagger/README.md similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/swagger/README.md rename to sdk/mixedreality/mixed-reality-authentication/swagger/README.md index 5bc7121db644..848b0e3f173c 100644 --- a/sdk/mixedreality/mixedreality-authentication/swagger/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/swagger/README.md @@ -7,7 +7,7 @@ Run `rushx generate:client` to generate code. ## Configuration ```yaml -package-name: "@azure/mixedreality-authentication" +package-name: "@azure/mixed-reality-authentication" title: MixedRealityStsRestClient description: Mixed Reality Authentication client generate-metadata: false diff --git a/sdk/mixedreality/mixedreality-authentication/test/authenticationEndpoint.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/authenticationEndpoint.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/authenticationEndpoint.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/authenticationEndpoint.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/jwt.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/jwt.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/jwt.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/jwt.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/mixedRealityStsClient.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/mixedRealityStsClient.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/mixedRealityStsClient.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/mixedRealityStsClient.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/env.browser.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/env.browser.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/env.browser.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/env.browser.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/env.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/env.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/env.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/env.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/recordedClient.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/recordedClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/recordedClient.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/recordedClient.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/tokenCredentialHelper.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/tokenCredentialHelper.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/tokenCredentialHelper.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/tokenCredentialHelper.ts diff --git a/sdk/mixedreality/mixedreality-authentication/tests.yml b/sdk/mixedreality/mixed-reality-authentication/tests.yml similarity index 81% rename from sdk/mixedreality/mixedreality-authentication/tests.yml rename to sdk/mixedreality/mixed-reality-authentication/tests.yml index 38fa41d3d7d5..d11bcfa759dd 100644 --- a/sdk/mixedreality/mixedreality-authentication/tests.yml +++ b/sdk/mixedreality/mixed-reality-authentication/tests.yml @@ -3,7 +3,7 @@ trigger: none stages: - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - PackageName: "@azure/mixedreality-authentication" + PackageName: "@azure/mixed-reality-authentication" ServiceDirectory: mixedreality Location: eastus2 MatrixFilters: diff --git a/sdk/mixedreality/mixedreality-authentication/tsconfig.json b/sdk/mixedreality/mixed-reality-authentication/tsconfig.json similarity index 78% rename from sdk/mixedreality/mixedreality-authentication/tsconfig.json rename to sdk/mixedreality/mixed-reality-authentication/tsconfig.json index 1735773d0ef6..6e3555ecac6e 100644 --- a/sdk/mixedreality/mixedreality-authentication/tsconfig.json +++ b/sdk/mixedreality/mixed-reality-authentication/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "./dist-esm", "declarationDir": "./types", "paths": { - "@azure/mixedreality-authentication": ["./src/index"] + "@azure/mixed-reality-authentication": ["./src/index"] } }, "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/README.md b/sdk/remoterendering/mixed-reality-remote-rendering/README.md index 41f9fcae6dd1..f51d937ccece 100644 --- a/sdk/remoterendering/mixed-reality-remote-rendering/README.md +++ b/sdk/remoterendering/mixed-reality-remote-rendering/README.md @@ -128,7 +128,7 @@ return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, cred #### Authenticating with a static access token You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the -[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication) +[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication) to be used with a Mixed Reality client library: ```typescript Snippet:CreateAClientWithStaticAccessToken diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/package.json b/sdk/remoterendering/mixed-reality-remote-rendering/package.json index 548f7594e8e6..eba3943debf0 100644 --- a/sdk/remoterendering/mixed-reality-remote-rendering/package.json +++ b/sdk/remoterendering/mixed-reality-remote-rendering/package.json @@ -80,7 +80,7 @@ "@azure/core-tracing": "1.0.0-preview.12", "@azure/logger": "^1.0.0", "tslib": "^2.2.0", - "@azure/mixedreality-authentication": "1.0.0-beta.1", + "@azure/mixed-reality-authentication": "1.0.0-beta.1", "@azure/core-lro": "^2.0.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.1.1", diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts index a826aed0070f..eb7f5477fbae 100644 --- a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts @@ -6,7 +6,7 @@ import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth" import { MixedRealityStsClient, MixedRealityStsClientOptions -} from "@azure/mixedreality-authentication"; +} from "@azure/mixed-reality-authentication"; /** * Represents a token credential that can be used to access a Mixed Reality service. From af47b82a69cfb1ff50bea9102378fbe51cbd2793 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Wed, 7 Jul 2021 17:05:17 +0100 Subject: [PATCH 166/166] Remove unneeded file --- .../mixedreality-remoterendering.api.md | 276 ------------------ 1 file changed, 276 deletions(-) delete mode 100644 sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md deleted file mode 100644 index 3b9ab75d7e45..000000000000 --- a/sdk/remoterendering/mixed-reality-remote-rendering/review/mixedreality-remoterendering.api.md +++ /dev/null @@ -1,276 +0,0 @@ -## API Report File for "@azure/mixed-reality-remote-rendering" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { AccessToken } from '@azure/core-auth'; -import { AzureKeyCredential } from '@azure/core-auth'; -import { CommonClientOptions } from '@azure/core-client'; -import { OperationOptions } from '@azure/core-client'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; -import { TokenCredential } from '@azure/core-auth'; - -// @public -export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; - -// @public -export interface AssetConversionBase { - conversionId: string; - createdOn: Date; - settings: AssetConversionSettings; -} - -// @public -export interface AssetConversionInputSettings { - blobPrefix?: string; - relativeInputAssetPath: string; - storageContainerReadListSas?: string; - storageContainerUrl: string; -} - -// @public -export interface AssetConversionOperationState extends PollOperationState { - latestResponse: AssetConversion; -} - -// @public -export interface AssetConversionOutput { - readonly outputAssetUrl?: string; -} - -// @public -export interface AssetConversionOutputSettings { - blobPrefix?: string; - outputAssetFilename?: string; - storageContainerUrl: string; - storageContainerWriteSas?: string; -} - -// @public -export type AssetConversionPollerLike = PollerLike; - -// @public -export interface AssetConversionPollerOptions { - intervalInMs?: number; -} - -// @public -export interface AssetConversionSettings { - inputSettings: AssetConversionInputSettings; - outputSettings: AssetConversionOutputSettings; -} - -// @public -export type AssetConversionStatus = string; - -// @public -export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; - -// @public -export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; - -// @public -export interface CancelledAssetConversion extends AssetConversionBase { - status: "Cancelled"; -} - -// @public -export type EndSessionOptions = OperationOptions; - -// @public -export interface ErrorRenderingSession extends RenderingSessionBase { - readonly error: RemoteRenderingServiceError; - partialProperties: PartialRenderingSessionProperties; - status: "Error"; -} - -// @public -export interface ExpiredRenderingSession extends RenderingSessionBase { - properties: RenderingSessionProperties; - status: "Expired"; -} - -// @public -export interface FailedAssetConversion extends AssetConversionBase { - error: RemoteRenderingServiceError; - status: "Failed"; -} - -// @public -export type GetConversionOptions = OperationOptions; - -// @public -export type GetSessionOptions = OperationOptions; - -// @public -export enum KnownAssetConversionStatus { - Cancelled = "Cancelled", - Failed = "Failed", - NotStarted = "NotStarted", - Running = "Running", - Succeeded = "Succeeded" -} - -// @public -export enum KnownRenderingServerSize { - Premium = "Premium", - Standard = "Standard" -} - -// @public -export enum KnownRenderingSessionStatus { - Error = "Error", - Expired = "Expired", - Ready = "Ready", - Starting = "Starting", - Stopped = "Stopped" -} - -// @public -export type ListConversionsOptions = OperationOptions; - -// @public -export type ListSessionsOptions = OperationOptions; - -// @public -export interface NonStartedAssetConversion extends AssetConversionBase { - status: "NotStarted"; -} - -// @public -export interface PartialRenderingSessionProperties { - readonly arrInspectorPort?: number; - readonly createdOn?: Date; - readonly elapsedTimeInMinutes?: number; - readonly handshakePort?: number; - readonly host?: string; - readonly teraflops?: number; -} - -// @public -export interface ReadyRenderingSession extends RenderingSessionBase { - properties: RenderingSessionProperties; - status: "Ready"; -} - -// @public -export class RemoteRenderingClient { - constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); - constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); - constructor(endpoint: string, accountId: string, credential: AccessToken, options?: RemoteRenderingClientOptions); - beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions): Promise; - beginConversion(options: ResumeBeginConversionOptions): Promise; - beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; - beginSession(options: ResumeBeginSessionOptions): Promise; - endSession(sessionId: string, options?: EndSessionOptions): Promise; - getConversion(conversionId: string, options?: GetConversionOptions): Promise; - getSession(sessionId: string, options?: GetSessionOptions): Promise; - listConversions(options?: ListConversionsOptions): PagedAsyncIterableIterator; - listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator; - updateSession(sessionId: string, settings: UpdateSessionSettings, options?: UpdateSessionOptions): Promise; -} - -// @public -export interface RemoteRenderingClientOptions extends CommonClientOptions { - authenticationEndpointUrl?: string; -} - -// @public -export class RemoteRenderingServiceError extends Error { - constructor(message: string, code: string); - code: string; - details?: RemoteRenderingServiceError[]; - innerError?: RemoteRenderingServiceError; - target?: string; -} - -// @public -export type RenderingServerSize = string; - -// @public -export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; - -// @public -export interface RenderingSessionBase { - maxLeaseTimeInMinutes: number; - sessionId: string; - size: RenderingServerSize; -} - -// @public -export interface RenderingSessionOperationState extends PollOperationState { - latestResponse: RenderingSession; -} - -// @public -export type RenderingSessionPollerLike = PollerLike; - -// @public -export interface RenderingSessionPollerOptions { - intervalInMs?: number; -} - -// @public -export interface RenderingSessionProperties { - readonly arrInspectorPort: number; - readonly createdOn: Date; - readonly elapsedTimeInMinutes: number; - readonly handshakePort: number; - readonly host: string; - readonly teraflops: number; -} - -// @public -export interface RenderingSessionSettings { - maxLeaseTimeInMinutes: number; - size: RenderingServerSize; -} - -// @public -export type ResumeBeginConversionOptions = BeginConversionOptions & { - resumeFrom: string; -}; - -// @public -export type ResumeBeginSessionOptions = BeginSessionOptions & { - resumeFrom: string; -}; - -// @public -export interface RunningAssetConversion extends AssetConversionBase { - status: "Running"; -} - -// @public -export interface StartingRenderingSession extends RenderingSessionBase { - partialProperties: PartialRenderingSessionProperties; - status: "Starting"; -} - -// @public -export interface StoppedRenderingSession extends RenderingSessionBase { - partialProperties: PartialRenderingSessionProperties; - status: "Stopped"; -} - -// @public -export interface SucceededAssetConversion extends AssetConversionBase { - readonly output: AssetConversionOutput; - status: "Succeeded"; -} - -// @public -export type UpdateSessionOptions = OperationOptions; - -// @public -export interface UpdateSessionSettings { - maxLeaseTimeInMinutes: number; -} - - -// (No @packageDocumentation comment for this package) - -```