Skip to content

Commit

Permalink
chore: upgrading dependencies (preview)
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Psztyc <[email protected]>
  • Loading branch information
jarrodek committed Jan 11, 2021
1 parent 84eb7c2 commit 13370a4
Show file tree
Hide file tree
Showing 9 changed files with 2,243 additions and 863 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"Apic",
"RAML's",
"Tyit",
"apip",
"apiserverchanged",
"tryit"
"chromeos",
"monostate",
"rearrangeendpoints",
"smartylighting",
"someid",
"tryit",
"webapi"
]
}
2,808 changes: 2,109 additions & 699 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "api-console",
"description": "The API Console to automatically generate API documentation from RAML and OAS files.",
"version": "6.3.6",
"version": "6.4.0",
"license": "CPAL-1.0",
"main": "index.js",
"module": "index.js",
Expand Down Expand Up @@ -36,12 +36,11 @@
"@advanced-rest-client/oauth-authorization": "^5.0.3",
"@advanced-rest-client/xhr-simple-request": "^3.0.0",
"@anypoint-web-components/anypoint-button": "^1.1.1",
"@api-components/amf-helper-mixin": "^4.3.2",
"@api-components/amf-helper-mixin": "^4.3.3",
"@api-components/api-console-ext-comm": "^3.0.0",
"@api-components/api-documentation": "^5.1.2",
"@api-components/api-documentation": "^6.0.0-preview",
"@api-components/api-navigation": "^4.1.1",
"@api-components/api-request-panel": "^5.0.2",
"@api-components/raml-aware": "^3.0.0",
"@api-components/api-request": "^0.1.0",
"@polymer/app-layout": "^3.1.0",
"@polymer/iron-media-query": "^3.0.0",
"@polymer/paper-toast": "^3.0.0",
Expand All @@ -58,11 +57,11 @@
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@open-wc/building-rollup": "^1.2.6",
"@open-wc/testing": "^2.5.16",
"@open-wc/eslint-config": "^4.2.0",
"@open-wc/testing": "^2.5.16",
"@polymer/iron-test-helpers": "^3.0.0",
"@web/test-runner": "^0.11.7",
"@web/test-runner-playwright": "^0.7.2",
"@web/test-runner": "^0.12.1",
"@web/test-runner-playwright": "^0.8.0",
"amf-client-js": "^4.5.1",
"body-parser": "^1.19.0",
"deepmerge": "^4.2.1",
Expand All @@ -72,16 +71,16 @@
"esm": "^3.2.25",
"express": "^4.17.1",
"fs-extra": "^9.0.0",
"husky": "^4.3.6",
"husky": "^4.3.7",
"lint-staged": "^10.2.2",
"multer": "^1.4.2",
"node-cache": "^5.1.0",
"postcss": "^8.2.2",
"postcss": "^8.2.4",
"rimraf": "^3.0.1",
"rollup": "^2.35.1",
"rollup": "^2.36.1",
"rollup-plugin-cpy": "^2.0.1",
"rollup-plugin-postcss": "^4.0.0",
"sinon": "^9.2.2",
"sinon": "^9.2.3",
"tmp": "^0.2.1",
"typescript": "^4.1.3",
"typescript-lit-html-plugin": "^0.9.0",
Expand All @@ -90,7 +89,6 @@
"uuid": "^8.0.0"
},
"scripts": {
"update-types": "NODE_OPTIONS=--max_old_space_size=2048 gen-typescript-declarations --deleteExisting --outDir .",
"generate-model": "npm run build:models",
"start": "node demo/index.js",
"start:server": "node --inspect demo/parsing-server/main.js",
Expand Down
8 changes: 2 additions & 6 deletions src/ApiConsole.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { TemplateResult, CSSResult, LitElement } from 'lit-element';
import { AmfHelperMixin } from '@api-components/amf-helper-mixin/amf-helper-mixin.js';

export const isChrome: boolean;

export declare class ApiConsole {
static styles: CSSResult|CSSResult[];
/**
Expand Down Expand Up @@ -380,12 +382,6 @@ export declare class ApiConsole {
*/
_computeMethodName(selected: string, webApi: object): string|undefined;

/**
* Handler for the `api-changed` event on the RAML aware element.
* Sets `amf` property to the detail value.
*/
_apiChanged(e: CustomEvent): void;

/**
* A handler for the `api-console-extension-installed` event dispatched by the
* component that is responsible for communication with the browser extension
Expand Down
62 changes: 22 additions & 40 deletions src/ApiConsole.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable lit-a11y/click-events-have-key-events */
/**
@license
Copyright 2018 The Advanced REST client authors <[email protected]>
Expand All @@ -13,15 +14,14 @@ the License.
*/
import { html, LitElement } from 'lit-element';
import { AmfHelperMixin } from '@api-components/amf-helper-mixin/amf-helper-mixin.js';
import '@api-components/raml-aware/raml-aware.js';
import '@api-components/api-navigation/api-navigation.js';
import '@api-components/api-documentation/api-documentation.js';
import '@api-components/api-request-panel/api-request-panel.js';
import '@api-components/api-request/api-request-panel.js';
import '@anypoint-web-components/anypoint-button/anypoint-button.js';
import '@polymer/paper-toast/paper-toast.js';
import '@api-components/api-console-ext-comm/api-console-ext-comm.js';
import attributionTpl from './attribution-template.js';
import { close } from '@advanced-rest-client/arc-icons/ArcIcons.js';
import '@advanced-rest-client/arc-icons/arc-icon.js';
import styles from './ApiConsoleStyles.js';

export const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
Expand Down Expand Up @@ -111,7 +111,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
* request through Chrome extension's sandbox and eliminates CORS.
*
* When this is set it enables this feature and renders installation banner
* when currrent browser profile does not have extension installed.
* when current browser profile does not have extension installed.
*/
allowExtensionBanner: { type: Boolean },
/**
Expand All @@ -130,7 +130,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
* If set then the API console hide the "try it" button from the
* method documentation view. The request and response panels still will
* be available, but to enter this section you'll have to do it
* programatically.
* programmatically.
*/
noTryIt: { type: Boolean },
/**
Expand All @@ -145,7 +145,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
redirectUri: { type: String },
/**
* Hides the URL editor from the view.
* Note that the editor is still in the DOM. This property just hiddes
* Note that the editor is still in the DOM. This property just hides
* it.
*/
noUrlEditor: { type: Boolean },
Expand Down Expand Up @@ -233,7 +233,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
* of endpoints based on the `path` value of the endpoint, keeping the order
* of which endpoint was first in the list, relative to each other.
*
* **This is an experimental option and may dissapear without warning.**
* **This is an experimental option and may disappear without warning.**
*/
rearrangeEndpoints: { type: Boolean },
/**
Expand Down Expand Up @@ -320,7 +320,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
return;
}
this._oauth2clientId = value;
// No need to pass the valu via binding system because the auth method
// No need to pass the value via binding system because the auth method
// uses session storage to restore user values between the screens
sessionStorage.setItem('auth.methods.latest.client_id', value);
}
Expand All @@ -340,7 +340,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
}

/**
* This can be overriten by child classes to decide whether to render the server
* This can be overwritten by child classes to decide whether to render the server
* selector or not.
* @return {boolean} The final value of `noServerSelector`.
*/
Expand Down Expand Up @@ -416,7 +416,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
}

/**
* On Firefix the navigation hidding animation runs when the app is first rendered,
* On Firefox, the animation that is hiding the navigation runs when the app is first rendered,
* even if the navigation wasn't initially rendered. This to be called
* after initial render has been made (DOM is constructed) to add the `animatable`
* class on the navigation to enable animation effects.
Expand Down Expand Up @@ -447,10 +447,11 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
if (!amf) {
return;
}
if (amf instanceof Array) {
amf = amf[0];
if (Array.isArray(amf)) {
[amf] = amf;
}
const webApi = this.webApi = this._computeApi(amf);
const webApi = this._computeApi(amf);
this.webApi = webApi;
this.methodName = this._computeMethodName(this.selectedShape, webApi);
if (!this._isWebAPI(amf)) {
this._noTryItValue = true;
Expand Down Expand Up @@ -583,23 +584,23 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
/**
* Computes method name for not-wide view, where the request panel
* has close button.
* @param {String} selected Curerently selected AMF shape (@id).
* @param {String} selected Currently selected AMF shape (@id).
* @param {Object} webApi Computed AMF WebAPI model.
* @return {String|undefined} Name of current method (verb) as RAML's
* `displayName` property or name of the HTTP method.
*/
_computeMethodName(selected, webApi) {
if (!selected || !webApi) {
return;
return undefined;
}
let method;
try {
method = this._computeMethodModel(webApi, selected);
} catch (_) {
return;
return undefined;
}
if (!method) {
return;
return undefined;
}
let name = /** @type string */ (this._getValue(method, this.ns.aml.vocabularies.core.name));
if (!name) {
Expand All @@ -608,15 +609,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
return name;
}

/**
* Handler for the `api-changed` event on the RAML aware element.
* Sets `amf` property to the detail value.
* @param {CustomEvent} e
*/
_apiChanged(e) {
this.amf = e.detail.value;
}

/**
* A handler for the `api-console-extension-installed` event dispatched by the
* component that is responsible for communication with the browser extension
Expand Down Expand Up @@ -658,9 +650,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
}

render() {
const { aware } = this;
return html`
${aware ? html`<raml-aware .scope="${aware}" @api-changed="${this._apiChanged}"></raml-aware>` : ''}
${this._mainContentTemplate()}
${this._helpersTemplate()}
`;
Expand Down Expand Up @@ -699,7 +689,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
aria-label="Activate to close the message"
@click="${this.dismissExtensionBanner}"
>
<span class="icon">${close}</span>
<arc-icon icon="close"></arc-icon>
</anypoint-icon-button>
</div>`;
}
Expand Down Expand Up @@ -737,16 +727,13 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
outlined,
amf,
selectedShape,
narrow,
noUrlEditor,
scrollTarget,
allowCustom,
allowDisableParams,
allowHideOptional,
redirectUri,
eventsTarget,
baseUri,
noDocs,
serverValue,
serverType,
noServerSelector,
Expand All @@ -755,19 +742,16 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
return html`<api-request-panel
.amf="${amf}"
.selected="${selectedShape}"
?narrow="${narrow}"
?outlined="${outlined}"
?compatibility="${compatibility}"
?noServerSelector="${noServerSelector}"
?allowCustomBaseUri="${allowCustomBaseUri}"
.noUrlEditor="${noUrlEditor}"
.redirectUri="${redirectUri}"
.scrollTarget="${scrollTarget}"
.allowCustom="${allowCustom}"
.allowDisableParams="${allowDisableParams}"
.allowHideOptional="${allowHideOptional}"
.baseUri="${baseUri}"
.noDocs="${noDocs}"
.serverValue="${serverValue}"
.serverType="${serverType}"
.eventsTarget="${eventsTarget}"
Expand Down Expand Up @@ -796,7 +780,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
serverType,
_noServerSelector,
allowCustomBaseUri,
rearrangeEndpoints,
} = this;

return html`<api-documentation
Expand All @@ -815,7 +798,6 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
.scrollTarget="${scrollTarget}"
.serverValue="${serverValue}"
.serverType="${serverType}"
?rearrangeEndpoints="${rearrangeEndpoints}"
@api-navigation-selection-changed="${this._apiNavigationOcurred}"
>
${this._documentationBaseSlot()}
Expand All @@ -824,7 +806,7 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {

/**
* Renders the `<slot>` element in the `<api-documentation>` only when
* ther request panel is not rendered. When it is rendered then it
* the request panel is not rendered. When it is rendered then it
* is the target for slots.
* @return {TemplateResult|string} Template for a slot to be used in the api documentation
*/
Expand All @@ -844,8 +826,8 @@ export class ApiConsole extends AmfHelperMixin(LitElement) {
<api-navigation
.amf="${amf}"
summary
endpointsopened
?rearrangeendpoints="${rearrangeEndpoints}"
endpointsOpened
?rearrangeEndpoints="${rearrangeEndpoints}"
@api-navigation-selection-changed="${this._apiNavigationOcurred}"></api-navigation>
${noAttribution ? '' : attributionTpl}
</div>`;
Expand Down
Loading

0 comments on commit 13370a4

Please sign in to comment.