eservices-back-core 1.0.79 → 1.0.82
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,MAAM,WAAW,CAAC;AAO/B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,MAAM,WAAW,CAAC;AAO/B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,MAAM,EAAE,MAAM,QAmG/C"}
|
package/dist/router/index.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
15
|
const body_parser_1 = __importDefault(require("body-parser"));
|
|
7
16
|
const express_1 = __importDefault(require("express"));
|
|
17
|
+
const path_1 = __importDefault(require("path"));
|
|
8
18
|
const close_1 = __importDefault(require("./close"));
|
|
9
19
|
const auth_middleware_1 = __importDefault(require("../middleware/auth-middleware"));
|
|
10
20
|
const user_middleware_1 = __importDefault(require("../middleware/user-middleware"));
|
|
11
|
-
const default_error_1 = __importDefault(require("../errors/default-error"));
|
|
12
21
|
const cors_1 = __importDefault(require("cors"));
|
|
13
22
|
function useRouter(server) {
|
|
14
23
|
const app = server.app;
|
|
@@ -18,10 +27,17 @@ function useRouter(server) {
|
|
|
18
27
|
app.use((0, auth_middleware_1.default)(server));
|
|
19
28
|
app.use(user_middleware_1.default);
|
|
20
29
|
app.use("/close-api", (0, close_1.default)(server));
|
|
21
|
-
app.
|
|
22
|
-
|
|
30
|
+
app.get("/test-page", (req, res) => {
|
|
31
|
+
const user = req.oidc.user;
|
|
32
|
+
const userId = Number(user['AppRegister.Claim.PersonId']);
|
|
33
|
+
res.send(`hello <b>${req.oidc.user.name}</b>, ${req.oidc.user.sub}, ${userId}`);
|
|
23
34
|
});
|
|
35
|
+
app.get("/main*", (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const filePath = path_1.default.join(server.options.frontendDir, `${server.options.type}-main.html`);
|
|
37
|
+
res.sendFile(filePath);
|
|
38
|
+
}));
|
|
24
39
|
app.use((err, req, res, next) => {
|
|
40
|
+
console.log(err);
|
|
25
41
|
res.status(500).json(Object.assign({ success: false }, err));
|
|
26
42
|
});
|
|
27
43
|
return;
|
package/dist/router/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8DAAsC;AACtC,sDAA+B;AAC/B,gDAA0B;AAE1B,oDAAkC;AAGlC,oFAA4D;AAG5D,oFAA2D;AAM3D,gDAAuB;AAGvB,SAAwB,SAAS,CAAC,MAAc;IAE/C,MAAM,GA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