diff --git a/src/main/java/com/eactive/httpmockserver/client/controller/ApiClientController.java b/src/main/java/com/eactive/httpmockserver/client/controller/ApiClientController.java index 2bb014e..dfa242c 100644 --- a/src/main/java/com/eactive/httpmockserver/client/controller/ApiClientController.java +++ b/src/main/java/com/eactive/httpmockserver/client/controller/ApiClientController.java @@ -3,24 +3,33 @@ package com.eactive.httpmockserver.client.controller; import com.eactive.httpmockserver.client.dto.ApiRequestDTO; import com.eactive.httpmockserver.client.dto.ApiResponse; import com.eactive.httpmockserver.client.service.NettyApiClient; +import org.springframework.validation.BindingResult; +import org.springframework.validation.Validator; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import java.lang.reflect.InvocationTargetException; import java.util.concurrent.ExecutionException; @RestController public class ApiClientController { private final NettyApiClient nettyApiClient; + private final Validator validator; - public ApiClientController(NettyApiClient nettyApiClient) { + public ApiClientController(NettyApiClient nettyApiClient, Validator validator) { this.nettyApiClient = nettyApiClient; + this.validator = validator; } @PostMapping("/mgmt/api/test.do") - public ApiResponse handleApiRequest(@RequestBody ApiRequestDTO request) throws InterruptedException, ExecutionException, InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException { + public ApiResponse handleApiRequest(@RequestBody ApiRequestDTO request, BindingResult bindingResult) throws InterruptedException, ExecutionException { + + validator.validate(request, bindingResult); + + if (bindingResult.hasErrors()) { + throw new IllegalArgumentException(bindingResult.getAllErrors().get(0).getDefaultMessage()); + } return nettyApiClient.handleRequest(request).get(); } diff --git a/src/main/java/com/eactive/httpmockserver/client/controller/ApiScenarioMgmtController.java b/src/main/java/com/eactive/httpmockserver/client/controller/ApiScenarioMgmtController.java index 40bdec7..8951848 100644 --- a/src/main/java/com/eactive/httpmockserver/client/controller/ApiScenarioMgmtController.java +++ b/src/main/java/com/eactive/httpmockserver/client/controller/ApiScenarioMgmtController.java @@ -45,7 +45,7 @@ public class ApiScenarioMgmtController { } - @PutMapping("/update.do") + @PostMapping("/update.do") public ResponseEntity updateScenario(@RequestBody ApiScenarioDTO apiScenarioDto) { ApiScenario updatedApiScenario = apiScenarioMapper.map(apiScenarioDto); ApiScenario updatedScenario = apiScenarioMgmtService.updateApiScenario(apiScenarioDto.getId(), updatedApiScenario); diff --git a/src/main/java/com/eactive/httpmockserver/client/dto/ApiRequestDTO.java b/src/main/java/com/eactive/httpmockserver/client/dto/ApiRequestDTO.java index 77c6b96..367687f 100644 --- a/src/main/java/com/eactive/httpmockserver/client/dto/ApiRequestDTO.java +++ b/src/main/java/com/eactive/httpmockserver/client/dto/ApiRequestDTO.java @@ -1,5 +1,6 @@ package com.eactive.httpmockserver.client.dto; +import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; @@ -12,6 +13,7 @@ public class ApiRequestDTO { private String path; private String method; + @NotNull(message = "서버를 선택해주세요.") private Long server; private List headers = new ArrayList<>(); diff --git a/src/main/java/com/eactive/httpmockserver/client/service/NettyApiClient.java b/src/main/java/com/eactive/httpmockserver/client/service/NettyApiClient.java index d102905..4216440 100644 --- a/src/main/java/com/eactive/httpmockserver/client/service/NettyApiClient.java +++ b/src/main/java/com/eactive/httpmockserver/client/service/NettyApiClient.java @@ -20,14 +20,12 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.netty.util.CharsetUtil; -import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.net.ssl.SSLException; import java.lang.reflect.InvocationTargetException; -import java.nio.file.Paths; import java.util.concurrent.CompletableFuture; @Service @@ -36,7 +34,7 @@ public class NettyApiClient { @Autowired ServerRepository serverRepository; - public CompletableFuture handleRequest(ApiRequestDTO originalRequest) throws InterruptedException, InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException { + public CompletableFuture handleRequest(ApiRequestDTO originalRequest) { ApiRequestDTO apiRequest = originalRequest; Server server = serverRepository.findById(apiRequest.getServer()).orElseThrow(() -> new ServerNotFoundException("Server not found")); String host = server.getHostname(); @@ -73,7 +71,7 @@ public class NettyApiClient { content = Unpooled.EMPTY_BUFFER; } - String fullPath = server.getBasePath() + apiRequest.getPath(); + String fullPath = server.getBasePath() + apiRequest.getPath(); HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.valueOf(apiRequest.getMethod()), fullPath, content); diff --git a/src/main/java/com/eactive/httpmockserver/config/WebMvcConfig.java b/src/main/java/com/eactive/httpmockserver/config/WebMvcConfig.java index 44d1895..228d353 100644 --- a/src/main/java/com/eactive/httpmockserver/config/WebMvcConfig.java +++ b/src/main/java/com/eactive/httpmockserver/config/WebMvcConfig.java @@ -92,7 +92,6 @@ public class WebMvcConfig implements WebMvcConfigurer { registry.addResourceHandler("/img/**").addResourceLocations("/img/", "classpath:/static/img/").setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS)).resourceChain(true).addResolver(new PathResourceResolver()); registry.addResourceHandler("/js/**").addResourceLocations("/js/", "classpath:/static/js/").setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS)).resourceChain(true).addResolver(new PathResourceResolver()); registry.addResourceHandler("/plugins/**").addResourceLocations("/plugins/", "classpath:/static/plugins/").setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS)).resourceChain(true).addResolver(new PathResourceResolver()); - registry.addResourceHandler("/min-maps/**").addResourceLocations("/min-maps/", "classpath:/static/plugins/").setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS)).resourceChain(true).addResolver(new PathResourceResolver()); registry.addResourceHandler("/favicon.ico").addResourceLocations("/favicon.ico", "classpath:/static/favicon.ico").setCacheControl(CacheControl.maxAge(1, TimeUnit.DAYS)).resourceChain(true).addResolver(new PathResourceResolver()); } } diff --git a/src/main/resources/static/js/APIClient.js b/src/main/resources/static/js/APIClient.js index 52b5433..bf8f83d 100644 --- a/src/main/resources/static/js/APIClient.js +++ b/src/main/resources/static/js/APIClient.js @@ -11,14 +11,16 @@ class APIClient { window.globals = {}; this.globalVariables = window.globals; this.variables = {}; - this.currentAjaxRequest = null; this.abortController = null; } - async sendAPIRequest(model) { + async sendAPIRequest(model, callback) { try { const updatedModel = await this.executePreRequestScript(model); let processedRequest = this.replacePlaceholdersWithVariables(updatedModel); + if (callback){ + callback(processedRequest); + } return this.makeAjaxRequest(processedRequest, model); } catch (error) { throw error; @@ -45,14 +47,17 @@ class APIClient { body: JSON.stringify(processedRequest), signal: signal // pass the signal to the fetch }) - .then(response => response.json()) + .then(async response => { + const responseData = await response.json(); // Parse the JSON response + if (!response.ok) { + // If response is not OK, use the parsed error information + const errorMessage = responseData.error || 'Unknown error'; + throw new Error(`API 호출 중 오류가 발생했습니다. 사유[${errorMessage}]`); + } + return responseData; + }) .then(data => { try { - model.responseModel.status = data.status; - model.responseModel.body = data.body; - model.responseModel.headers = data.headers; - model.responseModel.size = data.size; - let response = {}; response.body = data.body; response.status = data.status; @@ -61,7 +66,8 @@ class APIClient { _.forEach(data.headers, (header) => { response.headers[header.key] = header.value; }); - return this.executePostRequestScript(model.postRequestScript, model.responseModel); + + return this.executePostRequestScript(model.postRequestScript, response); } catch (error) { console.log('error1') $('.toast-body').text(error); @@ -69,14 +75,7 @@ class APIClient { } }) .catch(error => { - console.log('error2') - console.log(error.name) - if (error.name === 'AbortError') { - console.log('Fetch aborted'); - } else { - // $('.toast-body').text(response.responseJSON.error); - // $('.toast').toast('show'); - } + throw error; }); } diff --git a/src/main/resources/static/js/APIScenario.js b/src/main/resources/static/js/APIScenario.js index 0bbb4df..9c9037b 100644 --- a/src/main/resources/static/js/APIScenario.js +++ b/src/main/resources/static/js/APIScenario.js @@ -2,13 +2,12 @@ require.config({paths: {'vs': '/plugins/vs'}}); class APIScenario { + constructor(apiTester) { this.scenarioList = []; - this.scenarioTab = []; this.currentIndex = -1; this.currentScenario = null; this.apiTester = apiTester; - this.dataflow = {drawflow: {Home: {data: {} }}}; } init() { @@ -31,14 +30,7 @@ class APIScenario { this.editor.force_first_input = true; this.editor.start(); - this.editor.on('connectionCreated', (connection) => { - console.log('Connection created'); - console.log(connection); - }); this.showOutput = true; - - - } loadScenarioList() { @@ -49,11 +41,24 @@ class APIScenario { contentType: 'application/json', success: function (data) { me.scenarioList = data; + let drawflowData = {drawflow: {Home: {data: {}}}}; data.forEach((scenario) => { - me.dataflow.drawflow[scenario.id] = {data : JSON.parse(scenario.scenario)}; + let scenarioData = null; + try { + scenarioData = JSON.parse(scenario.scenario) + } catch (e) { + scenarioData = {}; + } + drawflowData.drawflow[scenario.id] = {data: scenarioData}; }); - console.log(JSON.stringify(me.dataflow)); - me.editor.import(me.dataflow); + + me.editor.import(drawflowData); + // if (data.length === 0) { + me.editor.changeModule('Home'); + // } else { + // me.editor.changeModule(data[0].id); + // me.currentScenario = data[0].id; + // } }, error: function (response, textStatus, errorThrown) { me.hideLoadingOverlay(); @@ -74,46 +79,19 @@ class APIScenario { openScenario(event) { event.preventDefault(); let scenarioId = $(event.target).closest('li').data('id'); - var all = document.querySelectorAll(".api-scenario-list ul li"); - for (var i = 0; i < all.length; i++) { + let all = document.querySelectorAll(".api-scenario-list li"); + + for (let i = 0; i < all.length; i++) { all[i].classList.remove('selected'); } - event.target.classList.add('selected'); + event.target.closest('li').classList.add('selected'); + this.editor.changeModule(scenarioId); - } - - openTab(scenario) { - console.log('openTab'); - console.log(scenario); - // this.currentScenario = scenario; - // let openTab = this.scenarioTab.find((tab) => tab.id === scenario.id); - // if (openTab) { - // this.currentIndex = this.scenarioTab.indexOf(openTab); - // //$(`#api_scenario_tab_${id}`).tab('show'); // API request 탭 활성화 - // } else { - // this.scenarioTab.push(scenario); - // this.renderScenarioTab(scenario); - // } - } - - renderScenarioTab(scenario) { - this.renderTabHeader(scenario); - this.renderTabContent(scenario); - } - - renderTabHeader(scenario) { - console.log('renderTabHeader'); - - } - - renderTabContent(scenario) { - console.log('renderTabContent') - + this.currentScenario = scenarioId; } getScenario(scenarioId) { return this.getScenarioList().find((scenario) => scenario.id === scenarioId); - } showLoadingOverlay() { @@ -129,7 +107,7 @@ class APIScenario { $('#new_scenario_modal').modal('show'); } - saveScenario() { + createScenario() { const name = $('#new_scenario_name').val(); const me = this; me.showLoadingOverlay(); @@ -137,7 +115,7 @@ class APIScenario { url: '/mgmt/api_scenario/create.do', type: 'POST', contentType: 'application/json', - data: JSON.stringify({name: name, scenario: "", description: ""}), + data: JSON.stringify({name: name, scenario: "{}", description: ""}), error: function (response, textStatus, errorThrown) { me.hideLoadingOverlay(); $('.toast-body').text(response.responseJSON.error); @@ -151,8 +129,63 @@ class APIScenario { }); } - removeScenario(scenarioId) { + saveScenario() { + if (this.currentScenario !== null) { + let data = this.editor.export(); + console.log(data.drawflow[this.currentScenario].data); + let updatedScenario = this.getScenario(this.currentScenario); + updatedScenario.scenario = JSON.stringify(data.drawflow[this.currentScenario].data); + const me = this; + me.showLoadingOverlay(); + this.currentAjaxRequest = $.ajax({ + url: '/mgmt/api_scenario/update.do', + type: 'POST', + contentType: 'application/json', + data: JSON.stringify(updatedScenario), + error: function (response, textStatus, errorThrown) { + me.hideLoadingOverlay(); + $('.toast-body').text(response.responseJSON.error); + $('.toast').toast('show'); + }, + complete: function () { + me.hideLoadingOverlay(); + $('.toast-body').text('저장되었습니다.'); + $('.toast').toast('show'); + } + }); + } + } + + showDeleteModal(event) { + const id = $(event.currentTarget).closest('li').data('id'); + $('#confirm_delete_scenario_modal').find('.confirm_delete_scenario').data('id', id); + $('#confirm_delete_scenario_modal').modal('show'); + } + + removeScenario(event) { + const id = $(event.currentTarget).data('id'); + const me = this; + me.showLoadingOverlay(); + this.currentAjaxRequest = $.ajax({ + url: '/mgmt/api_scenario/delete.do', + type: 'POST', + contentType: 'application/json', + data: JSON.stringify({id: id}), + error: function (response, textStatus, errorThrown) { + me.hideLoadingOverlay(); + $('.toast-body').text(response.responseJSON.error); + $('.toast').toast('show'); + }, + complete: function () { + me.hideLoadingOverlay(); + $('#confirm_delete_scenario_modal').modal('hide'); + $('.toast-body').text('삭제되었습니다.'); + $('.toast').toast('show'); + me.editor.changeModule('Home'); + me.loadScenarioList(); + } + }); } toggleOutput() { @@ -204,16 +237,19 @@ class APIScenario { runScript() { console.log(this.editor.export().drawflow); - let graph = APIScenarioExecutor.extractGraphFromStart(this.editor.export().drawflow.Home.data); - this.executor = new APIScenarioExecutor(graph, this.apiTester); - this.outputEditor.setValue(JSON.stringify(graph, null, 4)); + let graph = APIScenarioExecutor.extractGraphFromStart(this.editor.export().drawflow[this.currentScenario].data); + this.executor = new APIScenarioExecutor(graph, this.apiTester, this.outputEditor); } runScenarioAll() { if (!this.executor) { this.runScript(); } - this.executor.executeAll(); + if (!this.executor.isDone) { + this.executor.executeAll(); + } else { + this.executor.reset(); + } } @@ -221,8 +257,13 @@ class APIScenario { if (!this.executor) { this.runScript(); } - this.executor.executeCurrentNode(); - this.executor.moveToNextNode(); + if (!this.executor.isDone) { + this.executor.executeCurrentNode(); + this.executor.moveToNextNode(); + } else { + this.executor.reset(); + } + } resetScenario() { @@ -234,9 +275,11 @@ class APIScenario { } stopScenario() { - + if (this.executor) + this.executor.reset(); } - addStart(){ + + addStart() { let start = `
Start
@@ -256,8 +299,12 @@ class APIScenario { {type: 'click', selector: '.pause_scenario', action: this.pauseScenario.bind(this)}, {type: 'click', selector: '.stop_scenario', action: this.stopScenario.bind(this)}, {type: 'click', selector: '#new_scenario', action: this.showNewScenarioModal.bind(this)}, + {type: 'click', selector: '.create_scenario', action: this.createScenario.bind(this)}, {type: 'click', selector: '.save_scenario', action: this.saveScenario.bind(this)}, {type: 'click', selector: '.add_start', action: this.addStart.bind(this)}, + {type: 'click', selector: '.delete_scenario', action: this.showDeleteModal.bind(this)}, + {type: 'click', selector: '.confirm_delete_scenario', action: this.removeScenario.bind(this)}, + {type: 'click', selector: '.stop_scenario', action: this.stopScenario.bind(this)} ]; for (let event of events) { @@ -296,6 +343,12 @@ class APIScenario { let scenarioList = this.getScenarioList(); let scenarioListHtml = scenarioList.map((scenario) => this.scenarioListTemplate(scenario)).join(''); $('.api-scenario-list').html(scenarioListHtml); + let nodes = document.querySelectorAll(".api-scenario-list li"); + nodes.forEach((node) => { + if ($(node).data('id') === this.currentScenario) { + node.classList.add('selected'); + } + }); } diff --git a/src/main/resources/static/js/APIScenarioExecutor.js b/src/main/resources/static/js/APIScenarioExecutor.js index 37f2087..4e55105 100644 --- a/src/main/resources/static/js/APIScenarioExecutor.js +++ b/src/main/resources/static/js/APIScenarioExecutor.js @@ -1,10 +1,10 @@ class APIScenarioExecutor { - constructor(graph, apiTester) { + constructor(graph, apiTester, outputEditor) { this.graph = graph; // The graph data - this.currentNodeId = this.findStartNodeId(); // Initialize at the 'start' node this.apiClient = new APIClient(); this.apiTester = apiTester; - this.visitedNodes = new Set(); // Keep track of visited nodes + this.outputEditor = outputEditor; + this.reset(); } // Helper method to find the start node ID @@ -17,38 +17,108 @@ class APIScenarioExecutor { return null; // Return null if no start node is found } + reset() { + this.currentNodeId = this.findStartNodeId(); // Initialize at the 'start' node + this.visitedNodes = new Set(); // Keep track of visited nodes + this.isRunning = false; + this.isDone = false; + + let allNodes = document.querySelector('#drawflow').querySelectorAll('.drawflow-node'); + allNodes.forEach(node => { + node.classList.remove('current-execution'); + node.classList.remove('result-success'); + node.classList.remove('result-error'); + node.classList.remove('result-abort'); + }); + } + // Method to execute the current node's API request if it's an 'api' node executeCurrentNode() { console.log(this.currentNodeId) + + let allNodes = document.querySelector('#drawflow').querySelectorAll('.drawflow-node'); + allNodes.forEach(node => { + node.classList.remove('current-execution'); + }); + if (!this.currentNodeId) { console.log('No current node to execute.'); return; } const currentNode = this.graph[this.currentNodeId]; - if (currentNode && currentNode.class === 'api') { - // get API model with currentNode.id - let model = this.apiTester.getApiRequestModel(currentNode.id); - this.apiClient.sendAPIRequest(model) - .then(response => { - console.log(response); - }) - .catch(error => { - console.log(error.name) - if (error.name === 'AbortError') { - console.log('Fetch aborted'); - } else { - console.log('error3') - } - }); - console.log(`Executing API request for node: ${currentNode.id} - ${currentNode.name}`); - } else { - console.log('Current node is not an API node or does not exist.'); - } - this.visitedNodes.add(this.currentNodeId); // Mark this node as visited + if (currentNode) { + this.isRunning = true; + + let nodeElement = document.querySelector('#drawflow').querySelector(`.drawflow-node[id="node-${this.currentNodeId}"]`); + if (nodeElement) { + nodeElement.classList.add('current-execution'); + } else { + console.error('Node with ID ' + this.currentNodeId + ' not found'); + } + + if (currentNode.class === 'api') { + let model = JSON.parse(JSON.stringify(this.apiTester.getApiRequestModel(currentNode.data.id))); + model.responseModel = {}; + this.apiClient.sendAPIRequest(model, this.logHttpRequest.bind(this)) + .then(response => { + this.isRunning = false; + this.logHttpResponse(response); + if (response.status === 200 || response.status === 201) { + nodeElement.classList.add('result-success'); + } else { + nodeElement.classList.add('result-error'); + } + + }) + .catch(error => { + nodeElement.classList.add('result-abort'); + $('.toast-body').text(error.message); + $('.toast').toast('show'); + this.appendLog(error.message); + }); + console.log(`Executing API request for node: ${currentNode.id} - ${currentNode.name}`); + } else if (currentNode.class === 'start') { + this.appendLog('Starting API scenario execution...'); + nodeElement.classList.add('result-success'); + } else { + console.log(`Executing script for node: ${currentNode.id} - ${currentNode.name}`); + } + this.visitedNodes.add(this.currentNodeId); // Mark this node as visited + } } + appendLog(text) { + var range = new monaco.Range(this.outputEditor.getModel().getLineCount(), 1, this.outputEditor.getModel().getLineCount(), 1); + var id = {major: 1, minor: 1}; + var op = {identifier: id, range: range, text: text + '\n', forceMoveMarkers: true}; + this.outputEditor.executeEdits("my-source", [op]); + } + + logHttpRequest(model) { + let log = `${model.method} ${model.path} HTTP/1.1\n${model.requestBody}`; + this.appendLog(log); + } + + logHttpResponse(response) { + let log = `HTTP/1.1 ${response.status}\n${this.parseHeaders(response.headers)}\nBody: ${response.body}`; + this.appendLog(log); + } + + parseHeaders(headers) { + //convert object to string with \n separation + //sort header by key + + let parsedHeaders = ''; + const sortedKeys = Object.keys(headers).sort(); // Sorting the keys alphabetically + sortedKeys.forEach(key => { + parsedHeaders += `${key}: ${headers[key]}\n`; + }); + return parsedHeaders; + } + + // Method to move to the next node moveToNextNode() { const currentNode = this.graph[this.currentNodeId]; @@ -59,7 +129,6 @@ class APIScenarioExecutor { const nextNode = currentNode.connections.find(nodeId => !this.visitedNodes.has(nodeId)); if (nextNode) { this.currentNodeId = nextNode; - console.log(`Moved to node: ${this.currentNodeId}`); } else { console.log('No more unvisited connections to move to.'); this.currentNodeId = null; // No more nodes to visit @@ -67,26 +136,36 @@ class APIScenarioExecutor { } else { console.log('Current node has no connections or does not exist.'); this.currentNodeId = null; // No more nodes to visit + this.isDone = true; } } // Method to execute the entire scenario from start to end - executeAll() { + async executeAll() { while (this.currentNodeId) { console.log(this.currentNodeId) this.executeCurrentNode(); - this.moveToNextNode(); + await this.moveToNextNodeWithDelay(500); } console.log('Completed execution of all API nodes.'); } - static extractGraphFromStart(homeData) { - console.log(homeData) + moveToNextNodeWithDelay(delay) { + return new Promise(resolve => { + setTimeout(() => { + this.moveToNextNode(); + resolve(); + }, delay); + }); + } + + static extractGraphFromStart(graphData) { + console.log(graphData) let graph = {}; // Helper function to recursively build the graph function buildGraph(nodeId) { - const node = homeData[nodeId]; + const node = graphData[nodeId]; if (!node || graph[nodeId]) { // If the node doesn't exist or has already been visited, stop the recursion return; @@ -97,6 +176,7 @@ class APIScenarioExecutor { id: node.id, name: node.name, class: node.class, + data: node.data, connections: [] }; @@ -112,8 +192,8 @@ class APIScenarioExecutor { } // Find the start node - for (let nodeId in homeData) { - if (homeData[nodeId].class === 'start') { + for (let nodeId in graphData) { + if (graphData[nodeId].class === 'start') { buildGraph(nodeId); // Start building the graph from the 'start' node break; // Assuming there's only one start node } diff --git a/src/main/resources/static/js/APITester.js b/src/main/resources/static/js/APITester.js index b5a5db8..383d4b1 100644 --- a/src/main/resources/static/js/APITester.js +++ b/src/main/resources/static/js/APITester.js @@ -288,14 +288,14 @@ class APITester { `; } - responseHeaderTemplate(header, index) { + responseHeaderTemplate(key, value) { return ` - + - + - + `; @@ -663,7 +663,6 @@ class APITester { } renderResponse(tabIndex) { - console.log('renderResponse: ' + tabIndex); let model = this.apiRequests[tabIndex]; let target = $('#api_request_' + model.id); target.find('.response_headers').empty(); @@ -677,9 +676,10 @@ class APITester { this.responseEditors[tabIndex].setValue(model.responseModel.body); } if (model.responseModel && model.responseModel.headers) { - for (let i = 0; i < model.responseModel.headers.length; i++) { - target.find('.response_headers').append(this.responseHeaderTemplate(model.responseModel.headers[i], i)); - } + const headers = model.responseModel.headers; + Object.entries(headers).forEach(([key, value]) => { + target.find('.response_headers').append(this.responseHeaderTemplate(key, value)); + }); } target.find(".response_status").text("status: " + model.responseModel.status); diff --git a/src/main/resources/static/js/navsample.js b/src/main/resources/static/js/navsample.js deleted file mode 100644 index a85cb1a..0000000 --- a/src/main/resources/static/js/navsample.js +++ /dev/null @@ -1,38 +0,0 @@ - if (document.location.search.match(/type=embed/gi)) { - window.parent.postMessage('resize', "*"); - } - __bindToLinks(); - - $(window).scroll(function() { - var navbarColor = "62,195,246";//color attr for rgba - var smallLogoHeight = $('.small-logo').height(); - var bigLogoHeight = $('.big-logo').height(); - var navbarHeight = $('.navbar').height(); - - var smallLogoEndPos = 0; - var smallSpeed = (smallLogoHeight / bigLogoHeight); - - var ySmall = ($(window).scrollTop() * smallSpeed); - - var smallPadding = navbarHeight - ySmall; - if (smallPadding > navbarHeight) { smallPadding = navbarHeight; } - if (smallPadding < smallLogoEndPos) { smallPadding = smallLogoEndPos; } - if (smallPadding < 0) { smallPadding = 0; } - - $('.small-logo-container ').css({ "padding-top": smallPadding}); - - var navOpacity = ySmall / smallLogoHeight; - if (navOpacity > 1) { navOpacity = 1; } - if (navOpacity < 0 ) { navOpacity = 0; } - var navBackColor = 'rgba(' + navbarColor + ',' + navOpacity + ')'; - $('.navbar').css({"background-color": navBackColor}); - - var shadowOpacity = navOpacity * 0.4; - if ( ySmall > 1) { - $('.navbar').css({"box-shadow": "0 2px 3px rgba(0,0,0," + shadowOpacity + ")"}); - } else { - $('.navbar').css({"box-shadow": "none"}); - } - -}); - \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.de.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.de.js.map deleted file mode 100644 index c0e5457..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.de.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.de.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.de\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.de.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.es.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.es.js.map deleted file mode 100644 index 014fad0..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.es.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.es.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.es\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.es.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.fr.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.fr.js.map deleted file mode 100644 index db1161d..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.fr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.fr.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.fr\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.fr.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.it.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.it.js.map deleted file mode 100644 index c51a3d7..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.it.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.it.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.it\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.it.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map deleted file mode 100644 index a749611..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ja.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ja\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.ja.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.js.map deleted file mode 100644 index 09a37d5..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\n/*---------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine(\"vs/base/common/worker/simpleWorker.nls\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\"\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAUA,OAAO,yCAA0C,CAChD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map deleted file mode 100644 index d3e2c94..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ko.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ko\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.ko.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ru.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ru.js.map deleted file mode 100644 index aabd82f..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.ru.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ru.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ru\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.ru.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map deleted file mode 100644 index d495199..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.zh-cn.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.zh-cn\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,+CAAgD,CACtD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.zh-cn.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map b/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map deleted file mode 100644 index a079371..0000000 --- a/src/main/resources/static/min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.zh-tw.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.zh-tw\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,+CAAgD,CACtD,0BAA2B,CAC1B,GACD,CACD,CAAC","names":[],"file":"simpleWorker.nls.zh-tw.js"} \ No newline at end of file diff --git a/src/main/resources/static/min-maps/vs/base/worker/workerMain.js.map b/src/main/resources/static/min-maps/vs/base/worker/workerMain.js.map deleted file mode 100644 index 81b3e9e..0000000 --- a/src/main/resources/static/min-maps/vs/base/worker/workerMain.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["out-editor/vs/base/worker/fake","out-editor/vs/base/worker/vs/loader.js","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/nls.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/worker/workerMain.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/arrays.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/cache.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/color.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/diff/diffChange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/errors.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/assert.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/functional.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/iterator.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/keyCodes.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lazy.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/lifecycle.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/linkedList.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/strings.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/hash.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/diff/diff.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/types.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/codicons.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/objects.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/uint.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/characterClassifier.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/lineRange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/offsetRange.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/position.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/range.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/selection.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/wordCharacterClassifier.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/core/wordHelper.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/algorithms/diffAlgorithm.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/algorithms/joinSequenceDiffs.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/algorithms/myersDiffAlgorithm.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/algorithms/utils.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/algorithms/dynamicProgrammingDiffing.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/linesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/smartLinesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/standardLinesDiffComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/diff/linesDiffComputers.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/defaultDocumentColorsComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/linkComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages/supports/inplaceReplaceSupport.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/prefixSumComputer.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/mirrorTextModel.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/model/textModelSearch.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/unicodeTextModelHighlighter.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/standalone/standaloneEnums.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/platform.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/process.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/path.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/stopwatch.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/event.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/cancellation.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/uri.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/worker/simpleWorker.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/tokenizationRegistry.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/languages.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/editorBaseApi.ts","out-editor/vs/base/worker/file:/mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/common/services/editorSimpleWorker.ts"],"sourcesContent":["}).call(this);","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n'use strict';\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/*---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\nconst _amdLoaderGlobal = this;\nconst _commonjsGlobal = typeof global === 'object' ? global : {};\nvar AMDLoader;\n(function (AMDLoader) {\n AMDLoader.global = _amdLoaderGlobal;\n class Environment {\n get isWindows() {\n this._detect();\n return this._isWindows;\n }\n get isNode() {\n this._detect();\n return this._isNode;\n }\n get isElectronRenderer() {\n this._detect();\n return this._isElectronRenderer;\n }\n get isWebWorker() {\n this._detect();\n return this._isWebWorker;\n }\n get isElectronNodeIntegrationWebWorker() {\n this._detect();\n return this._isElectronNodeIntegrationWebWorker;\n }\n constructor() {\n this._detected = false;\n this._isWindows = false;\n this._isNode = false;\n this._isElectronRenderer = false;\n this._isWebWorker = false;\n this._isElectronNodeIntegrationWebWorker = false;\n }\n _detect() {\n if (this._detected) {\n return;\n }\n this._detected = true;\n this._isWindows = Environment._isWindows();\n this._isNode = (typeof module !== 'undefined' && !!module.exports);\n this._isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n this._isWebWorker = (typeof AMDLoader.global.importScripts === 'function');\n this._isElectronNodeIntegrationWebWorker = this._isWebWorker && (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'worker');\n }\n static _isWindows() {\n if (typeof navigator !== 'undefined') {\n if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) {\n return true;\n }\n }\n if (typeof process !== 'undefined') {\n return (process.platform === 'win32');\n }\n return false;\n }\n }\n AMDLoader.Environment = Environment;\n})(AMDLoader || (AMDLoader = {}));\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n class LoaderEvent {\n constructor(type, detail, timestamp) {\n this.type = type;\n this.detail = detail;\n this.timestamp = timestamp;\n }\n }\n AMDLoader.LoaderEvent = LoaderEvent;\n class LoaderEventRecorder {\n constructor(loaderAvailableTimestamp) {\n this._events = [new LoaderEvent(1 /* LoaderEventType.LoaderAvailable */, '', loaderAvailableTimestamp)];\n }\n record(type, detail) {\n this._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp()));\n }\n getEvents() {\n return this._events;\n }\n }\n AMDLoader.LoaderEventRecorder = LoaderEventRecorder;\n class NullLoaderEventRecorder {\n record(type, detail) {\n // Nothing to do\n }\n getEvents() {\n return [];\n }\n }\n NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder();\n AMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder;\n})(AMDLoader || (AMDLoader = {}));\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n class Utilities {\n /**\n * This method does not take care of / vs \\\n */\n static fileUriToFilePath(isWindows, uri) {\n uri = decodeURI(uri).replace(/%23/g, '#');\n if (isWindows) {\n if (/^file:\\/\\/\\//.test(uri)) {\n // This is a URI without a hostname => return only the path segment\n return uri.substr(8);\n }\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(5);\n }\n }\n else {\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(7);\n }\n }\n // Not sure...\n return uri;\n }\n static startsWith(haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;\n }\n static endsWith(haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle;\n }\n // only check for \"?\" before \"#\" to ensure that there is a real Query-String\n static containsQueryString(url) {\n return /^[^\\#]*\\?/gi.test(url);\n }\n /**\n * Does `url` start with http:// or https:// or file:// or / ?\n */\n static isAbsolutePath(url) {\n return /^((http:\\/\\/)|(https:\\/\\/)|(file:\\/\\/)|(\\/))/.test(url);\n }\n static forEachProperty(obj, callback) {\n if (obj) {\n let key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n callback(key, obj[key]);\n }\n }\n }\n }\n static isEmpty(obj) {\n let isEmpty = true;\n Utilities.forEachProperty(obj, () => {\n isEmpty = false;\n });\n return isEmpty;\n }\n static recursiveClone(obj) {\n if (!obj || typeof obj !== 'object' || obj instanceof RegExp) {\n return obj;\n }\n if (!Array.isArray(obj) && Object.getPrototypeOf(obj) !== Object.prototype) {\n // only clone \"simple\" objects\n return obj;\n }\n let result = Array.isArray(obj) ? [] : {};\n Utilities.forEachProperty(obj, (key, value) => {\n if (value && typeof value === 'object') {\n result[key] = Utilities.recursiveClone(value);\n }\n else {\n result[key] = value;\n }\n });\n return result;\n }\n static generateAnonymousModule() {\n return '===anonymous' + (Utilities.NEXT_ANONYMOUS_ID++) + '===';\n }\n static isAnonymousModule(id) {\n return Utilities.startsWith(id, '===anonymous');\n }\n static getHighPerformanceTimestamp() {\n if (!this.PERFORMANCE_NOW_PROBED) {\n this.PERFORMANCE_NOW_PROBED = true;\n this.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function');\n }\n return (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now());\n }\n }\n Utilities.NEXT_ANONYMOUS_ID = 1;\n Utilities.PERFORMANCE_NOW_PROBED = false;\n Utilities.HAS_PERFORMANCE_NOW = false;\n AMDLoader.Utilities = Utilities;\n})(AMDLoader || (AMDLoader = {}));\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n function ensureError(err) {\n if (err instanceof Error) {\n return err;\n }\n const result = new Error(err.message || String(err) || 'Unknown Error');\n if (err.stack) {\n result.stack = err.stack;\n }\n return result;\n }\n AMDLoader.ensureError = ensureError;\n ;\n class ConfigurationOptionsUtil {\n /**\n * Ensure configuration options make sense\n */\n static validateConfigurationOptions(options) {\n function defaultOnError(err) {\n if (err.phase === 'loading') {\n console.error('Loading \"' + err.moduleId + '\" failed');\n console.error(err);\n console.error('Here are the modules that depend on it:');\n console.error(err.neededBy);\n return;\n }\n if (err.phase === 'factory') {\n console.error('The factory function of \"' + err.moduleId + '\" has thrown an exception');\n console.error(err);\n console.error('Here are the modules that depend on it:');\n console.error(err.neededBy);\n return;\n }\n }\n options = options || {};\n if (typeof options.baseUrl !== 'string') {\n options.baseUrl = '';\n }\n if (typeof options.isBuild !== 'boolean') {\n options.isBuild = false;\n }\n if (typeof options.paths !== 'object') {\n options.paths = {};\n }\n if (typeof options.config !== 'object') {\n options.config = {};\n }\n if (typeof options.catchError === 'undefined') {\n options.catchError = false;\n }\n if (typeof options.recordStats === 'undefined') {\n options.recordStats = false;\n }\n if (typeof options.urlArgs !== 'string') {\n options.urlArgs = '';\n }\n if (typeof options.onError !== 'function') {\n options.onError = defaultOnError;\n }\n if (!Array.isArray(options.ignoreDuplicateModules)) {\n options.ignoreDuplicateModules = [];\n }\n if (options.baseUrl.length > 0) {\n if (!AMDLoader.Utilities.endsWith(options.baseUrl, '/')) {\n options.baseUrl += '/';\n }\n }\n if (typeof options.cspNonce !== 'string') {\n options.cspNonce = '';\n }\n if (typeof options.preferScriptTags === 'undefined') {\n options.preferScriptTags = false;\n }\n if (options.nodeCachedData && typeof options.nodeCachedData === 'object') {\n if (typeof options.nodeCachedData.seed !== 'string') {\n options.nodeCachedData.seed = 'seed';\n }\n if (typeof options.nodeCachedData.writeDelay !== 'number' || options.nodeCachedData.writeDelay < 0) {\n options.nodeCachedData.writeDelay = 1000 * 7;\n }\n if (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== 'string') {\n const err = ensureError(new Error('INVALID cached data configuration, \\'path\\' MUST be set'));\n err.phase = 'configuration';\n options.onError(err);\n options.nodeCachedData = undefined;\n }\n }\n return options;\n }\n static mergeConfigurationOptions(overwrite = null, base = null) {\n let result = AMDLoader.Utilities.recursiveClone(base || {});\n // Merge known properties and overwrite the unknown ones\n AMDLoader.Utilities.forEachProperty(overwrite, (key, value) => {\n if (key === 'ignoreDuplicateModules' && typeof result.ignoreDuplicateModules !== 'undefined') {\n result.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value);\n }\n else if (key === 'paths' && typeof result.paths !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.paths[key2] = value2);\n }\n else if (key === 'config' && typeof result.config !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, (key2, value2) => result.config[key2] = value2);\n }\n else {\n result[key] = AMDLoader.Utilities.recursiveClone(value);\n }\n });\n return ConfigurationOptionsUtil.validateConfigurationOptions(result);\n }\n }\n AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil;\n class Configuration {\n constructor(env, options) {\n this._env = env;\n this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options);\n this._createIgnoreDuplicateModulesMap();\n this._createSortedPathsRules();\n if (this.options.baseUrl === '') {\n if (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) {\n let nodeMain = this.options.nodeRequire.main.filename;\n let dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n }\n }\n }\n _createIgnoreDuplicateModulesMap() {\n // Build a map out of the ignoreDuplicateModules array\n this.ignoreDuplicateModulesMap = {};\n for (let i = 0; i < this.options.ignoreDuplicateModules.length; i++) {\n this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true;\n }\n }\n _createSortedPathsRules() {\n // Create an array our of the paths rules, sorted descending by length to\n // result in a more specific -> less specific order\n this.sortedPathsRules = [];\n AMDLoader.Utilities.forEachProperty(this.options.paths, (from, to) => {\n if (!Array.isArray(to)) {\n this.sortedPathsRules.push({\n from: from,\n to: [to]\n });\n }\n else {\n this.sortedPathsRules.push({\n from: from,\n to: to\n });\n }\n });\n this.sortedPathsRules.sort((a, b) => {\n return b.from.length - a.from.length;\n });\n }\n /**\n * Clone current configuration and overwrite options selectively.\n * @param options The selective options to overwrite with.\n * @result A new configuration\n */\n cloneAndMerge(options) {\n return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options));\n }\n /**\n * Get current options bag. Useful for passing it forward to plugins.\n */\n getOptionsLiteral() {\n return this.options;\n }\n _applyPaths(moduleId) {\n let pathRule;\n for (let i = 0, len = this.sortedPathsRules.length; i < len; i++) {\n pathRule = this.sortedPathsRules[i];\n if (AMDLoader.Utilities.startsWith(moduleId, pathRule.from)) {\n let result = [];\n for (let j = 0, lenJ = pathRule.to.length; j < lenJ; j++) {\n result.push(pathRule.to[j] + moduleId.substr(pathRule.from.length));\n }\n return result;\n }\n }\n return [moduleId];\n }\n _addUrlArgsToUrl(url) {\n if (AMDLoader.Utilities.containsQueryString(url)) {\n return url + '&' + this.options.urlArgs;\n }\n else {\n return url + '?' + this.options.urlArgs;\n }\n }\n _addUrlArgsIfNecessaryToUrl(url) {\n if (this.options.urlArgs) {\n return this._addUrlArgsToUrl(url);\n }\n return url;\n }\n _addUrlArgsIfNecessaryToUrls(urls) {\n if (this.options.urlArgs) {\n for (let i = 0, len = urls.length; i < len; i++) {\n urls[i] = this._addUrlArgsToUrl(urls[i]);\n }\n }\n return urls;\n }\n /**\n * Transform a module id to a location. Appends .js to module ids\n */\n moduleIdToPaths(moduleId) {\n if (this._env.isNode) {\n const isNodeModule = (this.options.amdModulesPattern instanceof RegExp\n && !this.options.amdModulesPattern.test(moduleId));\n if (isNodeModule) {\n // This is a node module...\n if (this.isBuild()) {\n // ...and we are at build time, drop it\n return ['empty:'];\n }\n else {\n // ...and at runtime we create a `shortcut`-path\n return ['node|' + moduleId];\n }\n }\n }\n let result = moduleId;\n let results;\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.isAbsolutePath(result)) {\n results = this._applyPaths(result);\n for (let i = 0, len = results.length; i < len; i++) {\n if (this.isBuild() && results[i] === 'empty:') {\n continue;\n }\n if (!AMDLoader.Utilities.isAbsolutePath(results[i])) {\n results[i] = this.options.baseUrl + results[i];\n }\n if (!AMDLoader.Utilities.endsWith(results[i], '.js') && !AMDLoader.Utilities.containsQueryString(results[i])) {\n results[i] = results[i] + '.js';\n }\n }\n }\n else {\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.containsQueryString(result)) {\n result = result + '.js';\n }\n results = [result];\n }\n return this._addUrlArgsIfNecessaryToUrls(results);\n }\n /**\n * Transform a module id or url to a location.\n */\n requireToUrl(url) {\n let result = url;\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this._applyPaths(result)[0];\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this.options.baseUrl + result;\n }\n }\n return this._addUrlArgsIfNecessaryToUrl(result);\n }\n /**\n * Flag to indicate if current execution is as part of a build.\n */\n isBuild() {\n return this.options.isBuild;\n }\n shouldInvokeFactory(strModuleId) {\n if (!this.options.isBuild) {\n // outside of a build, all factories should be invoked\n return true;\n }\n // during a build, only explicitly marked or anonymous modules get their factories invoked\n if (AMDLoader.Utilities.isAnonymousModule(strModuleId)) {\n return true;\n }\n if (this.options.buildForceInvokeFactory && this.options.buildForceInvokeFactory[strModuleId]) {\n return true;\n }\n return false;\n }\n /**\n * Test if module `moduleId` is expected to be defined multiple times\n */\n isDuplicateMessageIgnoredFor(moduleId) {\n return this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId);\n }\n /**\n * Get the configuration settings for the provided module id\n */\n getConfigForModule(moduleId) {\n if (this.options.config) {\n return this.options.config[moduleId];\n }\n }\n /**\n * Should errors be caught when executing module factories?\n */\n shouldCatchError() {\n return this.options.catchError;\n }\n /**\n * Should statistics be recorded?\n */\n shouldRecordStats() {\n return this.options.recordStats;\n }\n /**\n * Forward an error to the error handler.\n */\n onError(err) {\n this.options.onError(err);\n }\n }\n AMDLoader.Configuration = Configuration;\n})(AMDLoader || (AMDLoader = {}));\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n /**\n * Load `scriptSrc` only once (avoid multiple
-