Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
deiteris committed May 5, 2021
1 parent a02015b commit 181d72e
Show file tree
Hide file tree
Showing 21 changed files with 1,646 additions and 423 deletions.
4 changes: 1 addition & 3 deletions api-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ Based on https://github.com/mulesoft/api-console

## Embedding the output into extension

1. Remove `sw.js` and `workbox-*.js` files.

1. Rename the javascript file that is formatted like `204c1d73.js` to `apic-build.js` and copy the folder contents (except `index.html`) to `../extension/assets/api-console/`.
Rename the javascript file that is formatted like `204c1d73.js` to `apic-build.js`, then copy this file and `vendor.js` to `../extension/assets/api-console/`.
45 changes: 15 additions & 30 deletions api-console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"api-console": "^6.4.9",
"fs-extra": "^9.1.0"
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@open-wc/building-rollup": "^1.10.0",
Expand All @@ -25,7 +25,7 @@
"lint-staged": "^10.5.4",
"postcss": "^8.2.13",
"rimraf": "^3.0.2",
"rollup": "^2.46.0",
"rollup": "^2.47.0",
"rollup-plugin-cpy": "^2.0.1",
"rollup-plugin-postcss": "^4.0.0",
"uglify-js": "^3.13.5"
Expand Down
20 changes: 20 additions & 0 deletions api-console/src/api-console-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { html } from 'lit-element';
import { ApiConsoleApp } from 'api-console/src/ApiConsoleApp.js';

/* This class overrides ApiConsoleApp methods to customize existing API Console features */
class CustomApiConsoleApp extends ApiConsoleApp {
/*
* Override _helpersTemplate() to remove redundant 'oauth-authorization'
* elements since they are already created in the 'api-request-editor' element somehow.
*/
_helpersTemplate() {
super._helpersTemplate();
return html`
<xhr-simple-request
.appendHeaders="${this.appendHeaders}"
.proxy="${this.proxy}"
.proxyEncodeUrl="${this.proxyEncodeUrl}"></xhr-simple-request>`;
}
}

window.customElements.define('api-console-app', CustomApiConsoleApp);
51 changes: 0 additions & 51 deletions api-console/src/apic-app.js

This file was deleted.

3 changes: 1 addition & 2 deletions api-console/src/apic-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './styles.css';
import './dark.css';
import 'api-console/api-console-app';
import './index.js';
import './api-console-app.js';
2 changes: 1 addition & 1 deletion api-console/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<body>
<script src="./vendor.js"></script>
<div id="console"></div>
<api-console-app app rearrangeEndpoints proxy="${webServerUri}/proxy?url=" proxyEncodeUrl redirectUri="${webServerUri}/oauth-callback"></api-console-app>
<script type="module" src="./apic-build.js"></script>
</body>

Expand Down
27 changes: 0 additions & 27 deletions api-console/src/index.js

This file was deleted.

31 changes: 31 additions & 0 deletions extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 1.2.0

### Features

#### The API Console "Try It" functionality

Now it is possible to use the Try It functionality in the opened API preview.

Note: the OAuth 2.0 `Authorization code (server flow)` response type will not work due to the VS Code webview API limitations.

### Changes

* An error message is shown in cases when a language server is not ready to execute commands that depend on it.

This prevents issues in the following cases:

* When `exchange.json` is deleted, the language server may be not ready to restart.

* When a command is executed and language server is not ready, erroneous or confusing behavior may occur.
For example, opening an API file preview when language server is restarting would result in empty API console without any notifications.

* Enhanced security of the preview tab by enforcing the [`Content-Security-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) rules.

### Fixes

* Eliminated a lag when opening an API file preview.

* Updated commands in README.

* When `exchange.json` is deleted, the extension will no longer wait for input to restart the language server.

## 1.1.0

### Features
Expand Down
7 changes: 4 additions & 3 deletions extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ See supported types of documents: https://github.com/aml-org/als#what-is-als

* `API Contractor: Restart language server` - Restarts the client and language server.
* `API Contractor: Preview current API file` - Opens current API file in the API console.
* `API Contractor: Set a root API file` - Writes the `exchange.json` file to workspace root with the path to the root API file.
* `API Contractor: Set current API file as root file` - Writes the `exchange.json` file to workspace root with the relative path to current API file.
* `API Contractor: Convert current API file` - Shows the option menus with available conversion formats and syntaxes and converts the current API file according to the selections.

## Available settings

Expand All @@ -42,7 +43,7 @@ can find currently supported features there.

##### Setting a root API file

The `API Contractor: Set a root API file` command allows setting the root API file for the current workspace.
The `API Contractor: Set current API file as root file` command allows setting the root API file for the current workspace.
As the result, the `exchange.json` file will be created in the workspace root and contain a relative path to the main API file.
This enables proper linking and validation for separate JSON/YAML files that are linked to the root API file.

Expand All @@ -59,7 +60,7 @@ You can configure this behavior by changing the `apiContractor.autoRenameRefs` o

##### API files preview

Currently opened API file can be previewed with the API Console. A command to invoke API file preview is `ALS: Preview current API file`.
Currently opened API file can be previewed and tried out with the API Console. A command to invoke API file preview is `ALS: Preview current API file`.

#### API format conversion

Expand Down
222 changes: 111 additions & 111 deletions extension/assets/api-console/apic-build.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion extension/assets/api-console/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion extension/assets/api-console/vendor.js

Large diffs are not rendered by default.

Loading

0 comments on commit 181d72e

Please sign in to comment.