fiscalia_bo-nest-helpers 1.6.23 → 1.7.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/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/package-json.helper.d.ts +0 -1
- package/dist/helpers/package-json.helper.js +0 -7
- package/dist/helpers/package-json.helper.js.map +1 -1
- package/dist/helpers/swagger.helper.d.ts +13 -1
- package/dist/helpers/swagger.helper.js +8 -5
- package/dist/helpers/swagger.helper.js.map +1 -1
- package/package.json +1 -1
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./global-exception.filter"), exports);
|
18
18
|
__exportStar(require("./grpc-exception.filter"), exports);
|
19
|
-
__exportStar(require("./package-json.helper"), exports);
|
20
19
|
__exportStar(require("./regular-expressions"), exports);
|
21
20
|
__exportStar(require("./swagger.helper"), exports);
|
22
21
|
__exportStar(require("./cors.helpers"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,0DAAwC;AACxC,wDAAsC;AACtC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,0DAAwC;AACxC,wDAAsC;AACtC,mDAAiC;AACjC,iDAA+B"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const nameParsePresentation: (name: string) => string;
|
@@ -1,8 +1 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.nameParsePresentation = void 0;
|
4
|
-
const nameParsePresentation = (name) => {
|
5
|
-
return name.toUpperCase().replace(/-/g, ' ');
|
6
|
-
};
|
7
|
-
exports.nameParsePresentation = nameParsePresentation;
|
8
1
|
//# sourceMappingURL=package-json.helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"package-json.helper.js","sourceRoot":"","sources":["../../src/helpers/package-json.helper.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"package-json.helper.js","sourceRoot":"","sources":["../../src/helpers/package-json.helper.ts"],"names":[],"mappings":""}
|
@@ -1,6 +1,18 @@
|
|
1
1
|
import { INestApplication } from '@nestjs/common';
|
2
2
|
import { SwaggerCustomOptions } from '@nestjs/swagger';
|
3
|
-
|
3
|
+
export interface IPackageJson {
|
4
|
+
name: string;
|
5
|
+
version: string;
|
6
|
+
description: string;
|
7
|
+
author: string;
|
8
|
+
contact: {
|
9
|
+
name: string;
|
10
|
+
url: string;
|
11
|
+
email: string;
|
12
|
+
};
|
13
|
+
license: string;
|
14
|
+
}
|
15
|
+
export declare const nameParsePresentation: (name: string) => string;
|
4
16
|
export declare const configSwagger: (app: INestApplication, packageJson: IPackageJson, options?: SwaggerCustomOptions & {
|
5
17
|
nodeEnv?: string;
|
6
18
|
}) => void;
|
@@ -1,16 +1,19 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.printServerInitLog = exports.configSwagger = void 0;
|
3
|
+
exports.printServerInitLog = exports.configSwagger = exports.nameParsePresentation = void 0;
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
5
|
-
const package_json_helper_1 = require("./package-json.helper");
|
6
5
|
const chalk_1 = require("chalk");
|
7
6
|
const os = require("os");
|
7
|
+
const nameParsePresentation = (name) => {
|
8
|
+
return name.toUpperCase().replace(/-/g, ' ');
|
9
|
+
};
|
10
|
+
exports.nameParsePresentation = nameParsePresentation;
|
8
11
|
const configSwagger = (app, packageJson, options = {}) => {
|
9
12
|
var _a;
|
10
13
|
const nodeEnv = (_a = options === null || options === void 0 ? void 0 : options.nodeEnv) !== null && _a !== void 0 ? _a : process.env.NODE_ENV;
|
11
|
-
const envSufix =
|
14
|
+
const envSufix = nodeEnv ? `- (${nodeEnv})` : '';
|
12
15
|
const documentBuilder = new swagger_1.DocumentBuilder()
|
13
|
-
.setTitle(`${(0,
|
16
|
+
.setTitle(`${(0, exports.nameParsePresentation)(packageJson.name)} ${envSufix}`)
|
14
17
|
.setVersion(packageJson.version)
|
15
18
|
.setDescription(packageJson.description)
|
16
19
|
.setContact(packageJson.contact.name, '', packageJson.contact.email)
|
@@ -18,7 +21,7 @@ const configSwagger = (app, packageJson, options = {}) => {
|
|
18
21
|
.addBearerAuth()
|
19
22
|
.build();
|
20
23
|
const document = swagger_1.SwaggerModule.createDocument(app, documentBuilder);
|
21
|
-
swagger_1.SwaggerModule.setup('api', app, document, Object.assign({ customSiteTitle: (0,
|
24
|
+
swagger_1.SwaggerModule.setup('api', app, document, Object.assign({ customSiteTitle: (0, exports.nameParsePresentation)(packageJson.name), customfavIcon: '../assets/favicon.ico', customCss: `
|
22
25
|
.swagger-ui .topbar { display: none; }
|
23
26
|
.swagger-ui .info { margin: 20px 0;}
|
24
27
|
.swagger-ui .info hgroup.main { margin: 0 0 0;}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"swagger.helper.js","sourceRoot":"","sources":["../../src/helpers/swagger.helper.ts"],"names":[],"mappings":";;;AACA,6CAAuF;AACvF
|
1
|
+
{"version":3,"file":"swagger.helper.js","sourceRoot":"","sources":["../../src/helpers/swagger.helper.ts"],"names":[],"mappings":";;;AACA,6CAAuF;AACvF,iCAA6B;AAC7B,yBAAyB;AAoBlB,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAU,EAAE;IAC5D,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC,CAAC;AAFW,Q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