@loopback/rest-explorer 3.3.1 → 4.0.0

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/README.md CHANGED
@@ -44,6 +44,23 @@ this.bind(RestExplorerBindings.CONFIG).to({
44
44
  });
45
45
  ```
46
46
 
47
+ Similarly, the index page title for the explorer can be customized via
48
+ RestExplorer configuration as follows:
49
+
50
+ ```ts
51
+ this.configure(RestExplorerBindings.COMPONENT).to({
52
+ indexTitle: 'My LoopBack API Explorer',
53
+ });
54
+ ```
55
+
56
+ Or:
57
+
58
+ ```ts
59
+ this.bind(RestExplorerBindings.CONFIG).to({
60
+ indexTitle: 'My LoopBack API Explorer',
61
+ });
62
+ ```
63
+
47
64
  ### Advanced Configuration and Reverse Proxies
48
65
 
49
66
  By default, the component will add an additional OpenAPI spec endpoint, in the
@@ -138,7 +155,7 @@ The Explorer UI’s visual style can be customized by configuring the
138
155
 
139
156
  First, provide your own Swagger-UI theme file in a public folder. For example,
140
157
  in the
141
- [Todo example](https://github.com/strongloop/loopback-next/tree/master/examples/todo)
158
+ [Todo example](https://github.com/loopbackio/loopback-next/tree/master/examples/todo)
142
159
  application:
143
160
 
144
161
  Its `/public` folder is set up as the default home page with url `/`. Copy a
@@ -181,7 +198,7 @@ customization of
181
198
  `indexTemplatePath` should be an absolute path to a .html.ejs template.
182
199
 
183
200
  To get started,
184
- [download the default index.html.ejs](https://github.com/strongloop/loopback-next/blob/master/packages/rest-explorer/templates/index.html.ejs),
201
+ [download the default index.html.ejs](https://github.com/loopbackio/loopback-next/blob/master/packages/rest-explorer/templates/index.html.ejs),
185
202
  add /explorer/index.html.ejs to your project, and update the configuration:
186
203
 
187
204
  ```ts
@@ -194,8 +211,8 @@ this.configure(RestExplorerBindings.COMPONENT).to({
194
211
 
195
212
  ## Contributions
196
213
 
197
- - [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md)
198
- - [Join the team](https://github.com/strongloop/loopback-next/issues/110)
214
+ - [Guidelines](https://github.com/loopbackio/loopback-next/blob/master/docs/CONTRIBUTING.md)
215
+ - [Join the team](https://github.com/loopbackio/loopback-next/issues/110)
199
216
 
200
217
  ## Tests
201
218
 
@@ -204,7 +221,7 @@ Run `npm test` from the root folder.
204
221
  ## Contributors
205
222
 
206
223
  See
207
- [all contributors](https://github.com/strongloop/loopback-next/graphs/contributors).
224
+ [all contributors](https://github.com/loopbackio/loopback-next/graphs/contributors).
208
225
 
209
226
  ## License
210
227
 
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ const tslib_1 = require("tslib");
15
15
  *
16
16
  * @packageDocumentation
17
17
  */
18
- tslib_1.__exportStar(require("./rest-explorer.component"), exports);
19
- tslib_1.__exportStar(require("./rest-explorer.keys"), exports);
20
- tslib_1.__exportStar(require("./rest-explorer.types"), exports);
18
+ (0, tslib_1.__exportStar)(require("./rest-explorer.component"), exports);
19
+ (0, tslib_1.__exportStar)(require("./rest-explorer.keys"), exports);
20
+ (0, tslib_1.__exportStar)(require("./rest-explorer.types"), exports);
21
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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"}
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,yEAA0C;AAC1C,oEAAqC;AACrC,qEAAsC"}
@@ -32,14 +32,14 @@ let RestExplorerComponent = class RestExplorerComponent {
32
32
  this.application.route(verb, path, {
33
33
  'x-visibility': 'undocumented',
34
34
  responses: {},
35
- }, rest_explorer_controller_1.ExplorerController, rest_1.createControllerFactoryForClass(rest_explorer_controller_1.ExplorerController), methodName);
35
+ }, rest_explorer_controller_1.ExplorerController, (0, rest_1.createControllerFactoryForClass)(rest_explorer_controller_1.ExplorerController), methodName);
36
36
  }
37
37
  };
38
- RestExplorerComponent = tslib_1.__decorate([
39
- core_1.injectable({ 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])
38
+ RestExplorerComponent = (0, tslib_1.__decorate)([
39
+ (0, core_1.injectable)({ tags: { [core_1.ContextTags.KEY]: rest_explorer_keys_1.RestExplorerBindings.COMPONENT.key } }),
40
+ (0, tslib_1.__param)(0, (0, core_1.inject)(core_1.CoreBindings.APPLICATION_INSTANCE)),
41
+ (0, tslib_1.__param)(1, (0, core_1.config)()),
42
+ (0, tslib_1.__metadata)("design:paramtypes", [rest_1.RestApplication, Object])
43
43
  ], RestExplorerComponent);
44
44
  exports.RestExplorerComponent = RestExplorerComponent;
45
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,yCAOwB;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,gBAAW,GAAX,WAAW,CAAiB;QAIpC,MAAM,YAAY,GAAG,MAAA,kBAAkB,CAAC,IAAI,mCAAI,W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,CAAC;IAGvE,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,oBAAoB,CAAC,CAAA;IAEzC,wBAAA,IAAA,aAAM,GAAE,CAAA;kDADY,sBAAe;GAH3B,qBAAqB,CA0CjC;AA1CY,sDAAqB"}
@@ -10,6 +10,7 @@ export declare class ExplorerController {
10
10
  private useSelfHostedSpec;
11
11
  private swaggerThemeFile;
12
12
  private indexTemplatePath;
13
+ private indexTemplateTitle;
13
14
  constructor(restConfig: RestServerConfig | undefined, explorerConfig: RestExplorerConfig | undefined, serverBasePath: string, restServer: RestServer, requestContext: RequestContext);
14
15
  indexRedirect(): void;
15
16
  index(): void;
@@ -8,15 +8,15 @@ exports.ExplorerController = void 0;
8
8
  const tslib_1 = require("tslib");
9
9
  const core_1 = require("@loopback/core");
10
10
  const rest_1 = require("@loopback/rest");
11
- const ejs_1 = tslib_1.__importDefault(require("ejs"));
12
- const fs_1 = tslib_1.__importDefault(require("fs"));
13
- const path_1 = tslib_1.__importDefault(require("path"));
11
+ const ejs_1 = (0, tslib_1.__importDefault)(require("ejs"));
12
+ const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
13
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
14
14
  const rest_explorer_keys_1 = require("./rest-explorer.keys");
15
15
  let prevIndexTemplatePath;
16
16
  let templateFn;
17
17
  let ExplorerController = class ExplorerController {
18
18
  constructor(restConfig = {}, explorerConfig = {}, serverBasePath, restServer, requestContext) {
19
- var _a, _b;
19
+ var _a, _b, _c;
20
20
  this.serverBasePath = serverBasePath;
21
21
  this.restServer = restServer;
22
22
  this.requestContext = requestContext;
@@ -26,6 +26,8 @@ let ExplorerController = class ExplorerController {
26
26
  (_a = explorerConfig.swaggerThemeFile) !== null && _a !== void 0 ? _a : './swagger-ui.css';
27
27
  this.indexTemplatePath =
28
28
  (_b = explorerConfig.indexTemplatePath) !== null && _b !== void 0 ? _b : path_1.default.resolve(__dirname, '../templates/index.html.ejs');
29
+ this.indexTemplateTitle =
30
+ (_c = explorerConfig === null || explorerConfig === void 0 ? void 0 : explorerConfig.indexTitle) !== null && _c !== void 0 ? _c : 'LoopBack API Explorer';
29
31
  }
30
32
  indexRedirect() {
31
33
  const { request, response } = this.requestContext;
@@ -41,6 +43,7 @@ let ExplorerController = class ExplorerController {
41
43
  index() {
42
44
  const swaggerThemeFile = this.swaggerThemeFile;
43
45
  let openApiSpecUrl = this.openApiSpecUrl;
46
+ const indexTemplateTitle = this.indexTemplateTitle;
44
47
  // if using self-hosted openapi spec, then the path to use is always the
45
48
  // exact relative path, and no base path logic needs to be applied
46
49
  if (!this.useSelfHostedSpec) {
@@ -59,6 +62,7 @@ let ExplorerController = class ExplorerController {
59
62
  const data = {
60
63
  openApiSpecUrl,
61
64
  swaggerThemeFile,
65
+ indexTemplateTitle,
62
66
  };
63
67
  if (prevIndexTemplatePath !== this.indexTemplatePath) {
64
68
  const template = fs_1.default.readFileSync(this.indexTemplatePath, 'utf-8');
@@ -90,13 +94,13 @@ ExplorerController.OPENAPI_FORM = Object.freeze({
90
94
  version: '3.0.0',
91
95
  format: 'json',
92
96
  });
93
- ExplorerController = tslib_1.__decorate([
94
- tslib_1.__param(0, core_1.inject(rest_1.RestBindings.CONFIG, { optional: true })),
95
- tslib_1.__param(1, core_1.config({ fromBinding: rest_explorer_keys_1.RestExplorerBindings.COMPONENT })),
96
- tslib_1.__param(2, core_1.inject(rest_1.RestBindings.BASE_PATH)),
97
- tslib_1.__param(3, core_1.inject(rest_1.RestBindings.SERVER)),
98
- tslib_1.__param(4, core_1.inject(rest_1.RestBindings.Http.CONTEXT)),
99
- tslib_1.__metadata("design:paramtypes", [Object, Object, String, rest_1.RestServer,
97
+ ExplorerController = (0, tslib_1.__decorate)([
98
+ (0, tslib_1.__param)(0, (0, core_1.inject)(rest_1.RestBindings.CONFIG, { optional: true })),
99
+ (0, tslib_1.__param)(1, (0, core_1.config)({ fromBinding: rest_explorer_keys_1.RestExplorerBindings.COMPONENT })),
100
+ (0, tslib_1.__param)(2, (0, core_1.inject)(rest_1.RestBindings.BASE_PATH)),
101
+ (0, tslib_1.__param)(3, (0, core_1.inject)(rest_1.RestBindings.SERVER)),
102
+ (0, tslib_1.__param)(4, (0, core_1.inject)(rest_1.RestBindings.Http.CONTEXT)),
103
+ (0, tslib_1.__metadata)("design:paramtypes", [Object, Object, String, rest_1.RestServer,
100
104
  rest_1.RequestContext])
101
105
  ], ExplorerController);
102
106
  exports.ExplorerController = ExplorerController;
@@ -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,yCAA8C;AAC9C,yCAMwB;AACxB,sDAAsB;AACtB,oDAAoB;AACpB,wDAAwB;AACxB,6DAA0D;AAG1D,IAAI,qBAA6B,CAAC;AAClC,IAAI,UAAgC,CAAC;AAErC,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAY7B,YAEE,aAA+B,EAAE,EAEjC,iBAAqC,EAAE,EACC,cAAsB,EACzB,UAAsB,EAChB,cAA8B;;QAFjC,mBAAc,GAAd,cAAc,CAAQ;QACzB,eAAU,GAAV,UAAU,CAAY;QAChB,mBAAc,GAAd,cAAc,CAAgB;QAEzE,IAAI,CAAC,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,KAAK,KAAK,CAAC;QACpE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,gBAAgB;YACnB,MAAA,cAAc,CAAC,gBAAgB,mCAAI,kBAAkB,CAAC;QACxD,IAAI,CAAC,iBAAiB;YACpB,MAAA,cAAc,CAAC,iBAAiB,mCAChC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;IAC3D,CAAC;IAED,aAAa;QACX,MAAM,EAAC,OAAO,EAAE,QAAQ,EA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C;QACF,OAAO,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,eAAe,CAAC;IACrC,CAAC;CACF,CAAA;AArGiB,uCAAoB,GAAG,cAAe,CAAA;AACtC,+BAAY,GAAoB,MAAM,CAAC,MAAM,CAAC;IAC5D,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM;CACf,CAAE,CAAA;AALQ,kBAAkB;IAc1B,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;IAE7C,wBAAA,IAAA,aAAM,EAAC,EAAC,WAAW,EAAE,yCAAoB,CAAC,SAAS,EAAC,CAAC,CAAA;IAErD,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,SAAS,CAAC,CAAA;IAC9B,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,MAAM,CAAC,CAAA;IAC3B,wBAAA,IAAA,aAAM,EAAC,mBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;0EADe,iBAAU;QACA,qBAAc;GApBhE,kBAAkB,CAsG9B;AAtGY,gDAAkB;AAwG/B,SAAS,eAAe,CAAC,OAAwB;IAC/C,OAAO,CACL,OAAO,CAAC,OAAO,KAAK,kBAAkB,CAAC,YAAY,CAAC,OAAO;QAC3D,OAAO,CAAC,MAAM,KAAK,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAC1D,CAAC;AACJ,CAAC"}
@@ -25,4 +25,5 @@ export declare type RestExplorerConfig = {
25
25
  useSelfHostedSpec?: false;
26
26
  swaggerThemeFile?: string;
27
27
  indexTemplatePath?: string;
28
+ indexTitle?: string;
28
29
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loopback/rest-explorer",
3
3
  "description": "LoopBack's API Explorer",
4
- "version": "3.3.1",
4
+ "version": "4.0.0",
5
5
  "keywords": [
6
6
  "LoopBack",
7
7
  "Explorer",
@@ -14,11 +14,11 @@
14
14
  "copyright.owner": "IBM Corp.",
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/strongloop/loopback-next.git",
17
+ "url": "https://github.com/loopbackio/loopback-next.git",
18
18
  "directory": "packages/rest-explorer"
19
19
  },
20
20
  "engines": {
21
- "node": "^10.16 || 12 || 14 || 16"
21
+ "node": "12 || 14 || 16 || 17"
22
22
  },
23
23
  "scripts": {
24
24
  "build": "lb-tsc",
@@ -38,24 +38,24 @@
38
38
  "templates"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@loopback/core": "^2.16.1",
42
- "@loopback/rest": "^9.3.1"
41
+ "@loopback/core": "^3.0.0",
42
+ "@loopback/rest": "^11.0.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "ejs": "^3.1.6",
46
- "swagger-ui-dist": "3.50.0",
47
- "tslib": "^2.2.0"
46
+ "swagger-ui-dist": "3.52.5",
47
+ "tslib": "^2.3.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@loopback/build": "^6.4.1",
51
- "@loopback/core": "^2.16.1",
52
- "@loopback/eslint-config": "^10.2.1",
53
- "@loopback/rest": "^9.3.1",
54
- "@loopback/testlab": "^3.4.1",
55
- "@types/ejs": "^3.0.6",
56
- "@types/express": "^4.17.12",
50
+ "@loopback/build": "^8.0.0",
51
+ "@loopback/core": "^3.0.0",
52
+ "@loopback/eslint-config": "^12.0.0",
53
+ "@loopback/rest": "^11.0.0",
54
+ "@loopback/testlab": "^4.0.0",
55
+ "@types/ejs": "^3.1.0",
56
+ "@types/express": "^4.17.13",
57
57
  "@types/node": "^10.17.60",
58
58
  "express": "^4.17.1"
59
59
  },
60
- "gitHead": "2a3b684ec76fa299d80b099abbf101358538cb75"
60
+ "gitHead": "00a62f630c19341ce399cec3a45563b1ead6e3b8"
61
61
  }
@@ -31,6 +31,7 @@ export class ExplorerController {
31
31
  private useSelfHostedSpec: boolean;
32
32
  private swaggerThemeFile: string;
33
33
  private indexTemplatePath: string;
34
+ private indexTemplateTitle: string;
34
35
 
35
36
  constructor(
36
37
  @inject(RestBindings.CONFIG, {optional: true})
@@ -48,6 +49,8 @@ export class ExplorerController {
48
49
  this.indexTemplatePath =
49
50
  explorerConfig.indexTemplatePath ??
50
51
  path.resolve(__dirname, '../templates/index.html.ejs');
52
+ this.indexTemplateTitle =
53
+ explorerConfig?.indexTitle ?? 'LoopBack API Explorer';
51
54
  }
52
55
 
53
56
  indexRedirect() {
@@ -65,6 +68,7 @@ export class ExplorerController {
65
68
  index() {
66
69
  const swaggerThemeFile = this.swaggerThemeFile;
67
70
  let openApiSpecUrl = this.openApiSpecUrl;
71
+ const indexTemplateTitle = this.indexTemplateTitle;
68
72
 
69
73
  // if using self-hosted openapi spec, then the path to use is always the
70
74
  // exact relative path, and no base path logic needs to be applied
@@ -87,6 +91,7 @@ export class ExplorerController {
87
91
  const data = {
88
92
  openApiSpecUrl,
89
93
  swaggerThemeFile,
94
+ indexTemplateTitle,
90
95
  };
91
96
 
92
97
  if (prevIndexTemplatePath !== this.indexTemplatePath) {
@@ -37,4 +37,7 @@ export type RestExplorerConfig = {
37
37
  templates/index.html.ejs
38
38
  */
39
39
  indexTemplatePath?: string;
40
+
41
+ // Index page title
42
+ indexTitle?: string;
40
43
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  <head>
6
6
  <meta charset="UTF-8">
7
- <title>LoopBack API Explorer</title>
7
+ <title><%- indexTemplateTitle %></title>
8
8
  <link rel="stylesheet" type="text/css" href="<%- swaggerThemeFile %>">
9
9
  <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
10
10
  <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />