@crowdin/app-project-module 0.100.2 → 0.100.3
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/out/modules/api/api.js
CHANGED
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.addSwagerApiDocumentation = exports.addDefaultApiEndpoints = exports.updateCrowdinContext = exports.getApiManifest = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const redoc_express_1 = __importDefault(require("redoc-express"));
|
|
9
8
|
const swagger_jsdoc_1 = __importDefault(require("swagger-jsdoc"));
|
|
10
9
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
11
10
|
const integration_credentials_1 = __importDefault(require("../../middlewares/integration-credentials"));
|
|
12
11
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
13
12
|
const api_call_1 = __importDefault(require("../../middlewares/api-call"));
|
|
13
|
+
const redoc_html_template_1 = __importDefault(require("./redoc-helper/redoc-html-template"));
|
|
14
14
|
const crowdin_file_progress_1 = __importDefault(require("../integration/handlers/crowdin-file-progress"));
|
|
15
15
|
const crowdin_files_1 = __importDefault(require("../integration/handlers/crowdin-files"));
|
|
16
16
|
const crowdin_update_1 = __importDefault(require("../integration/handlers/crowdin-update"));
|
|
@@ -659,6 +659,6 @@ function addSwagerApiDocumentation(app, config) {
|
|
|
659
659
|
swaggerSpec.tags = swaggerSpec.tags.filter((tag) => tag.name !== 'Login');
|
|
660
660
|
}
|
|
661
661
|
app.get('/api-docs/swagger.json', (req, res) => res.send(swaggerSpec));
|
|
662
|
-
app.use('/api-docs', (0,
|
|
662
|
+
app.use('/api-docs', (req, res) => res.send((0, redoc_html_template_1.default)({ title: `${config.name} Application API`, specUrl: '/api-docs/swagger.json' })));
|
|
663
663
|
}
|
|
664
664
|
exports.addSwagerApiDocumentation = addSwagerApiDocumentation;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const html = `<!DOCTYPE html>
|
|
4
|
+
<html>
|
|
5
|
+
<head>
|
|
6
|
+
<title>[[title]]</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
9
|
+
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet" />
|
|
10
|
+
<style>
|
|
11
|
+
body {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<div id="redoc-container"></div>
|
|
19
|
+
<script src="https://unpkg.com/redoc@^2.5.2/bundles/redoc.standalone.js"> </script>
|
|
20
|
+
</body>
|
|
21
|
+
<script>
|
|
22
|
+
Redoc.init("[[spec-url]]", {}, document.getElementById("redoc-container"));
|
|
23
|
+
</script>
|
|
24
|
+
</html>`;
|
|
25
|
+
function redocHtml(options) {
|
|
26
|
+
return html.replace('[[title]]', options.title).replace('[[spec-url]]', options.specUrl);
|
|
27
|
+
}
|
|
28
|
+
exports.default = redocHtml;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.3",
|
|
4
4
|
"description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"prettier": "prettier --config .prettierrc src/**/*.ts --write",
|
|
14
14
|
"lint-ci": "eslint \"{src,tests}/**/*.{js,ts}\"",
|
|
15
15
|
"test-coverage": "jest --ci --reporters=jest-junit --reporters=default --coverage --coverageReporters=cobertura --coverageReporters=html",
|
|
16
|
-
"test": "jest"
|
|
17
|
-
"postinstall": "patch-package"
|
|
16
|
+
"test": "jest"
|
|
18
17
|
},
|
|
19
18
|
"files": [
|
|
20
19
|
"out/**/*"
|
|
@@ -37,9 +36,7 @@
|
|
|
37
36
|
"minimatch": "^10.0.3",
|
|
38
37
|
"mysql2": "^3.12.0",
|
|
39
38
|
"node-cron": "^3.0.3",
|
|
40
|
-
"patch-package": "^8.0.1",
|
|
41
39
|
"pg": "^8.13.3",
|
|
42
|
-
"redoc-express": "^2.1.0",
|
|
43
40
|
"sqlite3": "^5.1.7",
|
|
44
41
|
"swagger-jsdoc": "^6.2.8",
|
|
45
42
|
"uuid": "^8.3.2"
|