@loopback/rest-explorer 2.2.2 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/rest-explorer.component.js +26 -31
- package/dist/rest-explorer.component.js.map +1 -1
- package/dist/rest-explorer.controller.js +73 -76
- package/dist/rest-explorer.controller.js.map +1 -1
- package/dist/rest-explorer.keys.d.ts +1 -1
- package/dist/rest-explorer.keys.js +3 -3
- package/dist/rest-explorer.keys.js.map +1 -1
- package/package.json +13 -14
- package/src/index.ts +1 -1
- package/src/rest-explorer.component.ts +9 -3
- package/src/rest-explorer.controller.ts +1 -1
- package/src/rest-explorer.keys.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.2.6](https://github.com/strongloop/loopback-next/compare/@loopback/rest-explorer@2.2.5...@loopback/rest-explorer@2.2.6) (2020-06-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/rest-explorer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.2.5](https://github.com/strongloop/loopback-next/compare/@loopback/rest-explorer@2.2.4...@loopback/rest-explorer@2.2.5) (2020-06-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* set node version to >=10.16 to support events.once ([e39da1c](https://github.com/strongloop/loopback-next/commit/e39da1ca47728eafaf83c10ce35b09b03b6a4edc))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [2.2.4](https://github.com/strongloop/loopback-next/compare/@loopback/rest-explorer@2.2.3...@loopback/rest-explorer@2.2.4) (2020-06-11)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @loopback/rest-explorer
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [2.2.3](https://github.com/strongloop/loopback-next/compare/@loopback/rest-explorer@2.2.2...@loopback/rest-explorer@2.2.3) (2020-05-28)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @loopback/rest-explorer
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [2.2.2](https://github.com/strongloop/loopback-next/compare/@loopback/rest-explorer@2.2.1...@loopback/rest-explorer@2.2.2) (2020-05-20)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @loopback/rest-explorer
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2018. All Rights Reserved.
|
|
2
|
+
// Copyright IBM Corp. 2018,2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/rest-explorer
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;AAEhE;;;;;;;;;GASG;AAEH,oEAA0C;AAC1C,+DAAqC;AACrC,gEAAsC"}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.RestExplorerComponent = void 0;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
const context_1 = require("@loopback/context");
|
|
11
9
|
const core_1 = require("@loopback/core");
|
|
12
10
|
const rest_1 = require("@loopback/rest");
|
|
13
11
|
const rest_explorer_controller_1 = require("./rest-explorer.controller");
|
|
@@ -16,35 +14,32 @@ const swaggerUI = require('swagger-ui-dist');
|
|
|
16
14
|
/**
|
|
17
15
|
* A component providing a self-hosted API Explorer.
|
|
18
16
|
*/
|
|
19
|
-
let RestExplorerComponent =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.registerControllerRoute('get', explorerPath + '/openapi.json', 'spec');
|
|
29
|
-
}
|
|
30
|
-
application.static(explorerPath, swaggerUI.getAbsoluteFSPath());
|
|
31
|
-
// Disable redirect to externally hosted API explorer
|
|
32
|
-
application.restServer.config.apiExplorer = { disabled: true };
|
|
17
|
+
let RestExplorerComponent = class RestExplorerComponent {
|
|
18
|
+
constructor(application, restExplorerConfig = {}) {
|
|
19
|
+
var _a;
|
|
20
|
+
this.application = application;
|
|
21
|
+
const explorerPath = (_a = restExplorerConfig.path) !== null && _a !== void 0 ? _a : '/explorer';
|
|
22
|
+
this.registerControllerRoute('get', explorerPath, 'indexRedirect');
|
|
23
|
+
this.registerControllerRoute('get', explorerPath + '/', 'index');
|
|
24
|
+
if (restExplorerConfig.useSelfHostedSpec !== false) {
|
|
25
|
+
this.registerControllerRoute('get', explorerPath + '/openapi.json', 'spec');
|
|
33
26
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
application.static(explorerPath, swaggerUI.getAbsoluteFSPath());
|
|
28
|
+
// Disable redirect to externally hosted API explorer
|
|
29
|
+
application.restServer.config.apiExplorer = { disabled: true };
|
|
30
|
+
}
|
|
31
|
+
registerControllerRoute(verb, path, methodName) {
|
|
32
|
+
this.application.route(verb, path, {
|
|
33
|
+
'x-visibility': 'undocumented',
|
|
34
|
+
responses: {},
|
|
35
|
+
}, rest_explorer_controller_1.ExplorerController, rest_1.createControllerFactoryForClass(rest_explorer_controller_1.ExplorerController), methodName);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
RestExplorerComponent = tslib_1.__decorate([
|
|
39
|
+
core_1.bind({ tags: { [core_1.ContextTags.KEY]: rest_explorer_keys_1.RestExplorerBindings.COMPONENT.key } }),
|
|
40
|
+
tslib_1.__param(0, core_1.inject(core_1.CoreBindings.APPLICATION_INSTANCE)),
|
|
41
|
+
tslib_1.__param(1, core_1.config()),
|
|
42
|
+
tslib_1.__metadata("design:paramtypes", [rest_1.RestApplication, Object])
|
|
43
|
+
], RestExplorerComponent);
|
|
49
44
|
exports.RestExplorerComponent = RestExplorerComponent;
|
|
50
45
|
//# sourceMappingURL=rest-explorer.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-explorer.component.js","sourceRoot":"","sources":["../src/rest-explorer.component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,
|
|
1
|
+
{"version":3,"file":"rest-explorer.component.js","sourceRoot":"","sources":["../src/rest-explorer.component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAQwB;AACxB,yCAAgF;AAChF,yEAA8D;AAC9D,6DAA0D;AAG1D,MAAM,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE7C;;GAEG;AAEH,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAChC,YAEU,WAA4B,EAEpC,qBAAyC,EAAE;;QAFnC,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orerController = void 0;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
const
|
|
10
|
+
const core_1 = require("@loopback/core");
|
|
11
11
|
const rest_1 = require("@loopback/rest");
|
|
12
12
|
const ejs_1 = tslib_1.__importDefault(require("ejs"));
|
|
13
13
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
@@ -17,86 +17,83 @@ const rest_explorer_keys_1 = require("./rest-explorer.keys");
|
|
|
17
17
|
const indexHtml = path_1.default.resolve(__dirname, '../templates/index.html.ejs');
|
|
18
18
|
const template = fs_1.default.readFileSync(indexHtml, 'utf-8');
|
|
19
19
|
const templateFn = ejs_1.default.compile(template);
|
|
20
|
-
let ExplorerController =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
let ExplorerController = class ExplorerController {
|
|
21
|
+
constructor(restConfig = {}, explorerConfig = {}, serverBasePath, restServer, requestContext) {
|
|
22
|
+
var _a;
|
|
23
|
+
this.serverBasePath = serverBasePath;
|
|
24
|
+
this.restServer = restServer;
|
|
25
|
+
this.requestContext = requestContext;
|
|
26
|
+
this.useSelfHostedSpec = explorerConfig.useSelfHostedSpec !== false;
|
|
27
|
+
this.openApiSpecUrl = this.getOpenApiSpecUrl(restConfig);
|
|
28
|
+
this.swaggerThemeFile = (_a = explorerConfig.swaggerThemeFile) !== null && _a !== void 0 ? _a : './swagger-ui.css';
|
|
29
|
+
}
|
|
30
|
+
indexRedirect() {
|
|
31
|
+
const { request, response } = this.requestContext;
|
|
32
|
+
let url = request.originalUrl || request.url;
|
|
33
|
+
// be safe against path-modifying reverse proxies by generating the redirect
|
|
34
|
+
// as a _relative_ URL
|
|
35
|
+
const lastSlash = url.lastIndexOf('/');
|
|
36
|
+
if (lastSlash >= 0) {
|
|
37
|
+
url = './' + url.substr(lastSlash + 1) + '/';
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
response.redirect(301, url);
|
|
40
|
+
}
|
|
41
|
+
index() {
|
|
42
|
+
const swaggerThemeFile = this.swaggerThemeFile;
|
|
43
|
+
let openApiSpecUrl = this.openApiSpecUrl;
|
|
44
|
+
// if using self-hosted openapi spec, then the path to use is always the
|
|
45
|
+
// exact relative path, and no base path logic needs to be applied
|
|
46
|
+
if (!this.useSelfHostedSpec) {
|
|
47
|
+
// baseURL is composed from mountPath and basePath
|
|
48
|
+
// OpenAPI endpoints ignore basePath but do honor mountPath
|
|
49
|
+
let rootPath = this.requestContext.request.baseUrl;
|
|
50
|
+
if (this.serverBasePath &&
|
|
51
|
+
this.serverBasePath !== '/' &&
|
|
52
|
+
rootPath.endsWith(this.serverBasePath)) {
|
|
53
|
+
rootPath = rootPath.slice(0, -this.serverBasePath.length);
|
|
39
54
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
index() {
|
|
43
|
-
const swaggerThemeFile = this.swaggerThemeFile;
|
|
44
|
-
let openApiSpecUrl = this.openApiSpecUrl;
|
|
45
|
-
// if using self-hosted openapi spec, then the path to use is always the
|
|
46
|
-
// exact relative path, and no base path logic needs to be applied
|
|
47
|
-
if (!this.useSelfHostedSpec) {
|
|
48
|
-
// baseURL is composed from mountPath and basePath
|
|
49
|
-
// OpenAPI endpoints ignore basePath but do honor mountPath
|
|
50
|
-
let rootPath = this.requestContext.request.baseUrl;
|
|
51
|
-
if (this.serverBasePath &&
|
|
52
|
-
this.serverBasePath !== '/' &&
|
|
53
|
-
rootPath.endsWith(this.serverBasePath)) {
|
|
54
|
-
rootPath = rootPath.slice(0, -this.serverBasePath.length);
|
|
55
|
-
}
|
|
56
|
-
if (rootPath && rootPath !== '/') {
|
|
57
|
-
openApiSpecUrl = rootPath + openApiSpecUrl;
|
|
58
|
-
}
|
|
55
|
+
if (rootPath && rootPath !== '/') {
|
|
56
|
+
openApiSpecUrl = rootPath + openApiSpecUrl;
|
|
59
57
|
}
|
|
60
|
-
const data = {
|
|
61
|
-
openApiSpecUrl,
|
|
62
|
-
swaggerThemeFile,
|
|
63
|
-
};
|
|
64
|
-
const homePage = templateFn(data);
|
|
65
|
-
this.requestContext.response
|
|
66
|
-
.status(200)
|
|
67
|
-
.contentType('text/html')
|
|
68
|
-
.send(homePage);
|
|
69
|
-
}
|
|
70
|
-
spec() {
|
|
71
|
-
return this.restServer.getApiSpec(this.requestContext);
|
|
72
58
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
59
|
+
const data = {
|
|
60
|
+
openApiSpecUrl,
|
|
61
|
+
swaggerThemeFile,
|
|
62
|
+
};
|
|
63
|
+
const homePage = templateFn(data);
|
|
64
|
+
this.requestContext.response
|
|
65
|
+
.status(200)
|
|
66
|
+
.contentType('text/html')
|
|
67
|
+
.send(homePage);
|
|
68
|
+
}
|
|
69
|
+
spec() {
|
|
70
|
+
return this.restServer.getApiSpec(this.requestContext);
|
|
71
|
+
}
|
|
72
|
+
getOpenApiSpecUrl(restConfig) {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
if (this.useSelfHostedSpec) {
|
|
75
|
+
return './' + ExplorerController.OPENAPI_RELATIVE_URL;
|
|
82
76
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
77
|
+
const openApiConfig = (_a = restConfig.openApiSpec) !== null && _a !== void 0 ? _a : {};
|
|
78
|
+
const endpointMapping = (_b = openApiConfig.endpointMapping) !== null && _b !== void 0 ? _b : {};
|
|
79
|
+
const endpoint = Object.keys(endpointMapping).find(k => isOpenApiV3Json(endpointMapping[k]));
|
|
80
|
+
return endpoint !== null && endpoint !== void 0 ? endpoint : '/openapi.json';
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
ExplorerController.OPENAPI_RELATIVE_URL = 'openapi.json';
|
|
84
|
+
ExplorerController.OPENAPI_FORM = Object.freeze({
|
|
85
|
+
version: '3.0.0',
|
|
86
|
+
format: 'json',
|
|
87
|
+
});
|
|
88
|
+
ExplorerController = tslib_1.__decorate([
|
|
89
|
+
tslib_1.__param(0, core_1.inject(rest_1.RestBindings.CONFIG, { optional: true })),
|
|
90
|
+
tslib_1.__param(1, core_1.config({ fromBinding: rest_explorer_keys_1.RestExplorerBindings.COMPONENT })),
|
|
91
|
+
tslib_1.__param(2, core_1.inject(rest_1.RestBindings.BASE_PATH)),
|
|
92
|
+
tslib_1.__param(3, core_1.inject(rest_1.RestBindings.SERVER)),
|
|
93
|
+
tslib_1.__param(4, core_1.inject(rest_1.RestBindings.Http.CONTEXT)),
|
|
94
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, String, rest_1.RestServer,
|
|
95
|
+
rest_1.RequestContext])
|
|
96
|
+
], ExplorerController);
|
|
100
97
|
exports.ExplorerController = ExplorerController;
|
|
101
98
|
function isOpenApiV3Json(mapping) {
|
|
102
99
|
return (mapping.version === ExplorerController.OPENAPI_FORM.version &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-explorer.controller.js","sourceRoot":"","sources":["../src/rest-explorer.controller.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,6DAA6D;AAC7D
|
|
1
|
+
{"version":3,"file":"rest-explorer.controller.js","sourceRoot":"","sources":["../src/rest-explorer.controller.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+C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
|
exports.RestExplorerBindings = void 0;
|
|
8
|
-
const
|
|
8
|
+
const core_1 = require("@loopback/core");
|
|
9
9
|
/**
|
|
10
10
|
* Binding keys used by this component.
|
|
11
11
|
*/
|
|
@@ -14,13 +14,13 @@ var RestExplorerBindings;
|
|
|
14
14
|
/**
|
|
15
15
|
* Binding key for RestExplorerComponent
|
|
16
16
|
*/
|
|
17
|
-
RestExplorerBindings.COMPONENT =
|
|
17
|
+
RestExplorerBindings.COMPONENT = core_1.BindingKey.create('components.RestExplorerComponent');
|
|
18
18
|
/**
|
|
19
19
|
* Binding key for configuration of RestExplorerComponent.
|
|
20
20
|
*
|
|
21
21
|
* We recommend `ctx.configure(RestExplorerBindings.COMPONENT)` to be used
|
|
22
22
|
* instead of `ctx.bind(RestExplorerBindings.CONFIG)`.
|
|
23
23
|
*/
|
|
24
|
-
RestExplorerBindings.CONFIG =
|
|
24
|
+
RestExplorerBindings.CONFIG = core_1.BindingKey.buildKeyForConfig(RestExplorerBindings.COMPONENT);
|
|
25
25
|
})(RestExplorerBindings = exports.RestExplorerBindings || (exports.RestExplorerBindings = {}));
|
|
26
26
|
//# sourceMappingURL=rest-explorer.keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-explorer.keys.js","sourceRoot":"","sources":["../src/rest-explorer.keys.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;AAEhE
|
|
1
|
+
{"version":3,"file":"rest-explorer.keys.js","sourceRoot":"","sources":["../src/rest-explorer.keys.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,yCAA0D;AAI1D;;GAEG;AACH,IAAiB,oBAAoB,CAgBpC;AAhBD,WAAiB,oBAAoB;IACnC;;OAEG;IACU,8BAAS,GAAG,iBAAU,CAAC,MAAM,CACxC,kCAAkC,CACnC,CAAC;IACF;;;;;OAKG;IACU,2BAAM,GAAuC,iBAAU,CAAC,iBAAiB,CAEpF,qBAAA,SAAS,CAAC,CAAC;AACf,CAAC,EAhBgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAgBpC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/rest-explorer",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "LoopBack's API Explorer",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=10"
|
|
8
|
+
"node": ">=10.16"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "lb-tsc",
|
|
@@ -17,21 +17,23 @@
|
|
|
17
17
|
"author": "IBM Corp.",
|
|
18
18
|
"copyright.owner": "IBM Corp.",
|
|
19
19
|
"license": "MIT",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
20
23
|
"dependencies": {
|
|
21
|
-
"@loopback/
|
|
22
|
-
"@loopback/
|
|
23
|
-
"@loopback/rest": "^5.0.1",
|
|
24
|
+
"@loopback/core": "^2.9.1",
|
|
25
|
+
"@loopback/rest": "^5.2.0",
|
|
24
26
|
"ejs": "^3.1.3",
|
|
25
|
-
"swagger-ui-dist": "^3.
|
|
27
|
+
"swagger-ui-dist": "^3.28.0",
|
|
26
28
|
"tslib": "^2.0.0"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
"@loopback/build": "^
|
|
30
|
-
"@loopback/eslint-config": "^
|
|
31
|
-
"@loopback/testlab": "^3.
|
|
31
|
+
"@loopback/build": "^6.1.0",
|
|
32
|
+
"@loopback/eslint-config": "^8.0.3",
|
|
33
|
+
"@loopback/testlab": "^3.2.0",
|
|
32
34
|
"@types/ejs": "^3.0.4",
|
|
33
35
|
"@types/express": "^4.17.6",
|
|
34
|
-
"@types/node": "^10.17.
|
|
36
|
+
"@types/node": "^10.17.26",
|
|
35
37
|
"express": "^4.17.1"
|
|
36
38
|
},
|
|
37
39
|
"keywords": [
|
|
@@ -46,13 +48,10 @@
|
|
|
46
48
|
"!*/__tests__",
|
|
47
49
|
"templates"
|
|
48
50
|
],
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"access": "public"
|
|
51
|
-
},
|
|
52
51
|
"repository": {
|
|
53
52
|
"type": "git",
|
|
54
53
|
"url": "https://github.com/strongloop/loopback-next.git",
|
|
55
54
|
"directory": "packages/rest-explorer"
|
|
56
55
|
},
|
|
57
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "b89db3d3b8be6a36e63e91c2331d217fda7538de"
|
|
58
57
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
bind,
|
|
8
|
+
Component,
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
config,
|
|
11
|
+
ContextTags,
|
|
12
|
+
CoreBindings,
|
|
13
|
+
inject,
|
|
14
|
+
} from '@loopback/core';
|
|
9
15
|
import {createControllerFactoryForClass, RestApplication} from '@loopback/rest';
|
|
10
16
|
import {ExplorerController} from './rest-explorer.controller';
|
|
11
17
|
import {RestExplorerBindings} from './rest-explorer.keys';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
import {config, inject} from '@loopback/
|
|
7
|
+
import {config, inject} from '@loopback/core';
|
|
8
8
|
import {
|
|
9
9
|
OpenApiSpecForm,
|
|
10
10
|
RequestContext,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
import {BindingAddress, BindingKey} from '@loopback/
|
|
6
|
+
import {BindingAddress, BindingKey} from '@loopback/core';
|
|
7
7
|
import {RestExplorerComponent} from './rest-explorer.component';
|
|
8
8
|
import {RestExplorerConfig} from './rest-explorer.types';
|
|
9
9
|
|