UNPKG

@vrspace/babylonjs

Version:

vrspace.org babylonjs client

438 lines (385 loc) 13.2 kB
/** * OpenAPI definition * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. * */ import {ApiClient} from "../ApiClient.js"; /** * RemoteBrowser service. * @module api/RemoteBrowserApi * @version v0 */ export class RemoteBrowserApi { /** * Constructs a new RemoteBrowserApi. * @alias module:api/RemoteBrowserApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || ApiClient.instance; } /** * TODO this needs to be moved in general capabilities controller * TODO this needs to be moved in general capabilities controller * @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Boolean} and HTTP response */ availableWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = 'Boolean'; return this.apiClient.callApi( '/vrspace/api/webbrowser/available', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * TODO this needs to be moved in general capabilities controller * TODO this needs to be moved in general capabilities controller * @return {Promise< Boolean >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Boolean} */ available() { return this.availableWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Navigate back * Navigate back * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ backWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/back', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Navigate back * Navigate back * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ back() { return this.backWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Click on a pixel on the screen. * Click on a pixel on the screen. This may do nothing or anything, including opening a new tab. * @param {Number} x position from left * @param {Number} y position from top * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ clickWithHttpInfo(x, y) { let postBody = null; // verify the required parameter 'x' is set if (x === undefined || x === null) { throw new Error("Missing the required parameter 'x' when calling click"); } // verify the required parameter 'y' is set if (y === undefined || y === null) { throw new Error("Missing the required parameter 'y' when calling click"); } let pathParams = { }; let queryParams = { 'x': x, 'y': y }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/click', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Click on a pixel on the screen. * Click on a pixel on the screen. This may do nothing or anything, including opening a new tab. * @param {Number} x position from left * @param {Number} y position from top * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ click(x, y) { return this.clickWithHttpInfo(x, y) .then(function(response_and_data) { return response_and_data.data; }); } /** * Close the browser window/tab. * Close the browser window/tab. Returns to previous tab if any, or returns no content (http 204 status). * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ closeWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/close', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Close the browser window/tab. * Close the browser window/tab. Returns to previous tab if any, or returns no content (http 204 status). * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ close() { return this.closeWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * @param {String} text * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ enterWithHttpInfo(text) { let postBody = null; // verify the required parameter 'text' is set if (text === undefined || text === null) { throw new Error("Missing the required parameter 'text' when calling enter"); } let pathParams = { }; let queryParams = { 'text': text }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/enter', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * @param {String} text * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ enter(text) { return this.enterWithHttpInfo(text) .then(function(response_and_data) { return response_and_data.data; }); } /** * Navigate forward * Navigate forward * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ forwardWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/forward', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Navigate forward * Navigate forward * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ forward() { return this.forwardWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Get a web page * Get a web page * @param {String} url web page to browse to * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ getWithHttpInfo(url) { let postBody = null; // verify the required parameter 'url' is set if (url === undefined || url === null) { throw new Error("Missing the required parameter 'url' when calling get"); } let pathParams = { }; let queryParams = { 'url': url }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/get', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Get a web page * Get a web page * @param {String} url web page to browse to * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ get(url) { return this.getWithHttpInfo(url) .then(function(response_and_data) { return response_and_data.data; }); } /** * Quit current browser * Quit current browser * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ quitWithHttpInfo() { let postBody = null; let pathParams = { }; let queryParams = { }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = []; let returnType = null; return this.apiClient.callApi( '/vrspace/api/webbrowser/quit', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Quit current browser * Quit current browser * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ quit() { return this.quitWithHttpInfo() .then(function(response_and_data) { return response_and_data.data; }); } /** * Scroll up or down by given number of pixels. * Scroll up or down by given number of pixels. * @param {Number} pixels positive down, or negative up * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Blob} and HTTP response */ scrollWithHttpInfo(pixels) { let postBody = null; // verify the required parameter 'pixels' is set if (pixels === undefined || pixels === null) { throw new Error("Missing the required parameter 'pixels' when calling scroll"); } let pathParams = { }; let queryParams = { 'pixels': pixels }; let headerParams = { }; let formParams = { }; let authNames = []; let contentTypes = []; let accepts = ['image/png']; let returnType = 'Blob'; return this.apiClient.callApi( '/vrspace/api/webbrowser/scroll', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null ); } /** * Scroll up or down by given number of pixels. * Scroll up or down by given number of pixels. * @param {Number} pixels positive down, or negative up * @return {Promise< Blob >} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Blob} */ scroll(pixels) { return this.scrollWithHttpInfo(pixels) .then(function(response_and_data) { return response_and_data.data; }); } }