Skip to content

Commit 189d5c5

Browse files
Release/6.2.1 (#644)
* feat: adding support for OAS' external documentation * chore: updating dev dependencies * chore: major upgrading dev dependencies * chore: deep-updating dependencies * build: bumping version * fix: fixing api-response event registration on the request panel * fix: updating component to dix diplicated headers issue * chore: updating dependencies * chore: adding types declaration files * chore: adding index.js file * chore: updating dependencies for authorization * fix: fixing passing the `amf` property in the request panel * chore(demo): add multi-server to element demo * fix: override base servers with operation servers * fix: tests, update deps * test: increase timeout to 25s * test: should be last test fixing * fix(server): set type before value * test: debugging SL tests * test: debugging SL tests * Revert "test: debugging SL tests" This reverts commit 532f6ed. * Revert "test: debugging SL tests" This reverts commit 4cfd9a7. * Revert "fix(server): set type before value" This reverts commit 9140820. * Revert "test: should be last test fixing" This reverts commit 26a1549. * Revert "test: increase timeout to 25s" This reverts commit 613c895. * chore: add .idea to .gitignore * test: increase timeout to 25s * test: should be last test fixing * fix(server): set type before value * fix(type-document): update to version 4.1.0 Fixes APIC-405 * test: change test to use custom instead of server * test: skip a server test Co-authored-by: Francisco Di Giandomenico <[email protected]>
1 parent 0ffcc85 commit 189d5c5

23 files changed

+4357
-1319
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ dist/
6161

6262
# AMF models
6363
demo/models/*.json
64+
65+
.idea/

api-console-app.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ApiConsoleApp } from './src/ApiConsoleApp';
2+
3+
declare global {
4+
interface HTMLElementTagNameMap {
5+
"api-console-app": ApiConsoleApp;
6+
}
7+
}

api-console-app.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/**
2-
@license
3-
Copyright 2018 The Advanced REST client authors <[email protected]>
4-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
5-
use this file except in compliance with the License. You may obtain a copy of
6-
the License at
7-
http://www.apache.org/licenses/LICENSE-2.0
8-
Unless required by applicable law or agreed to in writing, software
9-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11-
License for the specific language governing permissions and limitations under
12-
the License.
13-
*/
141
import { ApiConsoleApp } from './src/ApiConsoleApp.js';
2+
153
window.customElements.define('api-console-app', ApiConsoleApp);

api-console.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ApiConsole } from './src/ApiConsole';
2+
3+
declare global {
4+
interface HTMLElementTagNameMap {
5+
"api-console": ApiConsole;
6+
}
7+
}

api-console.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
/**
2-
@license
3-
Copyright 2018 The Advanced REST client authors <[email protected]>
4-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
5-
use this file except in compliance with the License. You may obtain a copy of
6-
the License at
7-
http://www.apache.org/licenses/LICENSE-2.0
8-
Unless required by applicable law or agreed to in writing, software
9-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11-
License for the specific language governing permissions and limitations under
12-
the License.
13-
*/
141
import { ApiConsole } from './src/ApiConsole.js';
2+
153
window.customElements.define('api-console', ApiConsole);

demo/demo-server/api/amf-service/amf-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class AmfService {
189189
}
190190
/**
191191
* Parses API data using AMF parser.
192-
* @param {?String} mainFile Main API file to use.
192+
* @param {String=} mainFile Main API file to use.
193193
* @return {Promise<Object>} A promise resolved to AMF model.
194194
*/
195195
async parse(mainFile) {

demo/demo-server/api/api-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AmfService } from './amf-service/amf-service.js';
22
import NodeCache from 'node-cache';
3-
import uuidv4 from 'uuid/v4.js';
3+
import { v4 as uuidv4 } from 'uuid';
44

55
export class ApiParser {
66
async parseFile(request) {
@@ -32,7 +32,7 @@ export class ApiParser {
3232
/**
3333
* Parses API data to AMF model.
3434
* @param {Buffer} buffer Buffer created from API file.
35-
* @param {Object} opts Processing options:
35+
* @param {Object=} opts Processing options:
3636
* - zip {Boolean} If true the buffer represents zipped file.
3737
* @return {Promise<Object>} Promise resolved to the AMF json-ld model
3838
*/

demo/element/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class ApicApplication extends DemoBase {
1818
['google-drive-api', 'Google Drive API'],
1919
['httpbin', 'HTTPbin API'],
2020
['data-type-fragment', 'RAML data type fragment'],
21-
['demo-api', 'Demo API']
21+
['demo-api', 'Demo API'],
22+
['multi-server', 'Multi Server API'],
2223
];
2324

2425
this.toggleConsoleMenu = this.toggleConsoleMenu.bind(this);

demo/models/multi-server/multi-server.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,6 @@ servers:
2929
- url: http://beta.api.openweathermap.org/data/2.5/
3030
description: Beta server
3131

32-
# Relative URL to external documentation
33-
externalDocs:
34-
url: /docs
35-
description: Find more info here
36-
37-
# Relative URLs to OAuth2 authorization and token URLs
38-
components:
39-
securitySchemes:
40-
oauth2:
41-
type: oauth2
42-
flows:
43-
authorizationCode:
44-
authorizationUrl: /oauth/dialog
45-
tokenUrl: /oauth/token
46-
scopes: {}
47-
4832
paths:
4933
/default:
5034
description: A default path to the API
@@ -53,6 +37,18 @@ paths:
5337
responses:
5438
200:
5539
description: Successful response
40+
/duplicated:
41+
description: Has some of the default servers
42+
servers:
43+
- url: https://api.openweathermap.org/data/2.5/
44+
description: Production server
45+
- url: http://beta.api.openweathermap.org/data/2.5/
46+
description: Beta server
47+
get:
48+
summary: "A get method"
49+
responses:
50+
200:
51+
description: Successful response
5652
/files:
5753
description: File upload and download operations
5854
servers:
@@ -81,4 +77,4 @@ paths:
8177
summary: "A post method"
8278
responses:
8379
201:
84-
description: Successful create
80+
description: Successful create

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { ApiConsole } from './src/ApiConsole';
2+
export { ApiConsoleApp } from './src/ApiConsoleApp';

0 commit comments

Comments
 (0)