eservices-back-core 1.2.93 → 1.2.94
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/controller/close-api/1.d.ts +1 -0
- package/dist/controller/close-api/1.d.ts.map +1 -0
- package/dist/controller/close-api/1.js +1 -0
- package/dist/controller/close-api/1.js.map +1 -0
- package/dist/controller/close-api/document-builder-controller.d.ts +5 -0
- package/dist/controller/close-api/document-builder-controller.d.ts.map +1 -0
- package/dist/controller/close-api/document-builder-controller.js +33 -0
- package/dist/controller/close-api/document-builder-controller.js.map +1 -0
- package/dist/controller/close-api/executors-controller.d.ts.map +1 -1
- package/dist/controller/close-api/executors-controller.js +19 -7
- package/dist/controller/close-api/executors-controller.js.map +1 -1
- package/dist/services/document-builder-service.d.ts +6 -0
- package/dist/services/document-builder-service.d.ts.map +1 -0
- package/dist/services/document-builder-service.js +33 -0
- package/dist/services/document-builder-service.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1.d.ts","sourceRoot":"","sources":["../../../src/controller/close-api/1.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1.js","sourceRoot":"","sources":["../../../src/controller/close-api/1.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-builder-controller.d.ts","sourceRoot":"","sources":["../../../src/controller/close-api/document-builder-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAG1C,MAAM,CAAC,OAAO,OAAO,yBAAyB;WAChC,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,KAAA;CAiBlD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const document_builder_service_1 = require("../../services/document-builder-service");
|
|
13
|
+
class DocumentBuilderController {
|
|
14
|
+
static get(req, res, next) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
const { id } = req.body;
|
|
18
|
+
const { entity } = req.params;
|
|
19
|
+
const { type } = req.query;
|
|
20
|
+
const dbs = new document_builder_service_1.DocumentBuilderService(req.__token);
|
|
21
|
+
const output = yield dbs.get(entity, Number(id), type);
|
|
22
|
+
res.contentType('application/pdf');
|
|
23
|
+
res.send(output);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.log(e);
|
|
27
|
+
next(e);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = DocumentBuilderController;
|
|
33
|
+
//# sourceMappingURL=document-builder-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-builder-controller.js","sourceRoot":"","sources":["../../../src/controller/close-api/document-builder-controller.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sFAA+E;AAE/E,MAAqB,yBAAyB;IAC7C,MAAM,CAAO,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAI;;YACjD,IAAI;gBACH,MAAM,EAAC,EAAE,EAAC,GAAG,GAAG,CAAC,IAAI,CAAC;gBACtB,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAC,MAAM,CAAC;gBAC5B,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAC,KAAK,CAAC;gBAEzB,MAAM,GAAG,GAAG,IAAI,iDAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAEpD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,IAAc,CAAC,CAAA;gBAEhE,GAAG,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;gBACnC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACjB;YAAC,OAAO,CAAC,EAAE;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACf,IAAI,CAAC,CAAC,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAlBD,4CAkBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executors-controller.d.ts","sourceRoot":"","sources":["../../../src/controller/close-api/executors-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"executors-controller.d.ts","sourceRoot":"","sources":["../../../src/controller/close-api/executors-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AASzC,MAAM,CAAC,OAAO,OAAO,mBAAmB;WAC1B,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,KAAA;WAYvD,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,KAAA;WAkCxD,4BAA4B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,KAAA;CA2B3E"}
|
|
@@ -14,17 +14,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const get_usage_context_1 = __importDefault(require("../../utils/get-usage-context"));
|
|
16
16
|
const data_service_1 = __importDefault(require("../../services/data-service"));
|
|
17
|
+
const criterion_service_1 = __importDefault(require("../../services/criterion-service"));
|
|
18
|
+
const get_criterion_preset_1 = __importDefault(require("../../utils/get-criterion-preset"));
|
|
19
|
+
const Store_1 = __importDefault(require("../../store/Store"));
|
|
20
|
+
const add_criterion_to_header_1 = __importDefault(require("../../utils/add-criterion-to-header"));
|
|
17
21
|
class ExecutorsController {
|
|
18
22
|
static checkDIPSerialNumbers(req, res, next) {
|
|
19
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
24
|
try {
|
|
21
25
|
const { data } = req.body;
|
|
22
26
|
const reg = /\s*;|\.|,| \s*/;
|
|
23
|
-
|
|
24
|
-
const store = new
|
|
25
|
-
|
|
26
|
-
parsedSerialNumbers = [...store.keys()];
|
|
27
|
-
res.json(parsedSerialNumbers.map(str => ({ number: str.trim() })));
|
|
27
|
+
const parsedSerialNumbers = data.trim().split(reg).filter(a => a.length);
|
|
28
|
+
const store = new Set(parsedSerialNumbers);
|
|
29
|
+
res.json([...store.values()].map(str => ({ number: str.trim() })));
|
|
28
30
|
}
|
|
29
31
|
catch (e) {
|
|
30
32
|
next(e);
|
|
@@ -32,17 +34,27 @@ class ExecutorsController {
|
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
static uploadDIPSerialNumbers(req, res, next) {
|
|
37
|
+
var _a;
|
|
35
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
39
|
try {
|
|
37
40
|
const { data, applicationId } = req.body;
|
|
38
41
|
const context = (0, get_usage_context_1.default)(req.headers.referer);
|
|
39
42
|
const ds = new data_service_1.default(req.__token);
|
|
43
|
+
const entity = 'DIPApplicationSerialNumber';
|
|
44
|
+
const criterionService = new criterion_service_1.default(req.__token);
|
|
45
|
+
const rules = yield criterionService.get({
|
|
46
|
+
entity,
|
|
47
|
+
preset: (0, get_criterion_preset_1.default)(req),
|
|
48
|
+
masterEntities: [["Application", Number.parseInt(applicationId, 10)]],
|
|
49
|
+
criterion: ((_a = Store_1.default.getMetadataSettingsForEntity(entity)) === null || _a === void 0 ? void 0 : _a.criterion) || []
|
|
50
|
+
});
|
|
51
|
+
(0, add_criterion_to_header_1.default)(res, rules);
|
|
40
52
|
for (const SerialNumber of data) {
|
|
41
|
-
yield ds.create(
|
|
53
|
+
yield ds.create(entity, {
|
|
42
54
|
SerialNumber,
|
|
43
55
|
ApplicationId: applicationId,
|
|
44
56
|
OperationCode: 'A'
|
|
45
|
-
}, context);
|
|
57
|
+
}, context, rules);
|
|
46
58
|
}
|
|
47
59
|
res.json({});
|
|
48
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executors-controller.js","sourceRoot":"","sources":["../../../src/controller/close-api/executors-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,sFAA4D;AAC5D,+EAAsD;
|
|
1
|
+
{"version":3,"file":"executors-controller.js","sourceRoot":"","sources":["../../../src/controller/close-api/executors-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,sFAA4D;AAC5D,+EAAsD;AACtD,yFAAgE;AAChE,4FAAkE;AAElE,8DAAsC;AACtC,kGAAuE;AAEvE,MAAqB,mBAAmB;IACvC,MAAM,CAAO,qBAAqB,CAAC,GAAY,EAAE,GAAa,EAAE,IAAI;;YACnE,IAAI;gBACH,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAC,IAAsB,CAAC;gBAC1C,MAAM,GAAG,GAAG,gBAAgB,CAAA;gBAC5B,MAAM,mBAAmB,GAAG,IAA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|
|
2
|
+
import { IHistoryResponse } from "../types/main";
|
|
3
|
+
export declare class DocumentBuilderService extends InterfaceAuthService {
|
|
4
|
+
get(entity: string, Id: number, type?: string): Promise<IHistoryResponse>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=document-builder-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-builder-service.d.ts","sourceRoot":"","sources":["../../src/services/document-builder-service.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,qBAAa,sBAAuB,SAAQ,oBAAoB;IAC/D,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,MAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAmBhF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DocumentBuilderService = void 0;
|
|
7
|
+
const interface_auth_service_1 = __importDefault(require("./interface-auth-service"));
|
|
8
|
+
const nodeFetch_1 = __importDefault(require("../utils/nodeFetch"));
|
|
9
|
+
const api_error_1 = __importDefault(require("../errors/api-error"));
|
|
10
|
+
const Server_1 = __importDefault(require("../Server"));
|
|
11
|
+
class DocumentBuilderService extends interface_auth_service_1.default {
|
|
12
|
+
get(entity, Id, type = 'pdf') {
|
|
13
|
+
const server = Server_1.default.getServer();
|
|
14
|
+
const url = `${server.apiUrl}/api/DocumentBuilder/Template/${entity}/${type}`;
|
|
15
|
+
return (0, nodeFetch_1.default)(url, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
authorization: this.token
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify({
|
|
22
|
+
Id
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
.then(response => {
|
|
26
|
+
if (!response.ok)
|
|
27
|
+
throw api_error_1.default.AppServerError();
|
|
28
|
+
return response.blob();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.DocumentBuilderService = DocumentBuilderService;
|
|
33
|
+
//# sourceMappingURL=document-builder-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-builder-service.js","sourceRoot":"","sources":["../../src/services/document-builder-service.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA4D;AAC5D,mEAA2C;AAC3C,oEAA2C;AAC3C,uDAA+B;AAG/B,MAAa,sBAAuB,SAAQ,gCAAoB;IAC/D,GAAG,CAAC,MAAc,EAAE,EAAU,EAAE,OAAe,KAAK;QACnD,MAAM,MAAM,GAAG,gBAAM,CAAC,SAAS,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,iCAAiC,MAAM,IAAI,IAAI,EAAE,CAAC;QAE9E,OAAO,IAAA,mBAAS,EAAC,GAAG,EAAE;YACrB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACR,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,IAAI,CAAC,KAAK;aACzB;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACpB,EAAE;aACF,CAAC;SACF,CAAC;aACD,IAAI,CAAC,QAAQ,CAAC,EAAE;YAChB,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAAE,MAAM,mBAAQ,CAAC,cAAc,EAAE,CAAA;YACjD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;QACvB,CAAC,CAAC,CAAA;IACH,CAAC;CACD;AApBD,wDAoBC"}
|