@acorex-platform/module-report-management-server 0.0.18 → 2.0.0-beta.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/contracts/src/commands.keys.d.ts +13 -0
- package/contracts/src/commands.keys.js +19 -0
- package/contracts/src/commands.keys.js.map +1 -0
- package/contracts/src/entities/index.d.ts +1 -0
- package/contracts/src/entities/index.js +1 -0
- package/contracts/src/entities/index.js.map +1 -1
- package/contracts/src/entities/report/index.d.ts +1 -1
- package/contracts/src/entities/report/index.js +1 -1
- package/contracts/src/entities/report/index.js.map +1 -1
- package/contracts/src/entities/report/report.entity.js +180 -12
- package/contracts/src/entities/report/report.entity.js.map +1 -1
- package/contracts/src/entities/report-category/index.d.ts +1 -1
- package/contracts/src/entities/report-category/index.js +0 -2
- package/contracts/src/entities/report-category/index.js.map +1 -1
- package/contracts/src/entities/report-category/report-category.entity.js +14 -1
- package/contracts/src/entities/report-category/report-category.entity.js.map +1 -1
- package/contracts/src/entities/report-generation-request/index.d.ts +1 -0
- package/contracts/src/entities/report-generation-request/index.js +5 -0
- package/contracts/src/entities/report-generation-request/index.js.map +1 -0
- package/contracts/src/entities/report-generation-request/report-generation-request.entity.d.ts +2 -0
- package/contracts/src/entities/report-generation-request/report-generation-request.entity.js +208 -0
- package/contracts/src/entities/report-generation-request/report-generation-request.entity.js.map +1 -0
- package/contracts/src/entity-catalog.d.ts +7 -0
- package/contracts/src/entity-catalog.js +22 -0
- package/contracts/src/entity-catalog.js.map +1 -0
- package/contracts/src/entity-entry.report-category.d.ts +1 -0
- package/contracts/src/entity-entry.report-category.js +6 -0
- package/contracts/src/entity-entry.report-category.js.map +1 -0
- package/contracts/src/entity-entry.report-generation-request.d.ts +1 -0
- package/contracts/src/entity-entry.report-generation-request.js +6 -0
- package/contracts/src/entity-entry.report-generation-request.js.map +1 -0
- package/contracts/src/entity-entry.report.d.ts +1 -0
- package/contracts/src/entity-entry.report.js +6 -0
- package/contracts/src/entity-entry.report.js.map +1 -0
- package/contracts/src/index.d.ts +18 -1
- package/contracts/src/index.js +18 -1
- package/contracts/src/index.js.map +1 -1
- package/contracts/src/manifest.d.ts +6 -0
- package/contracts/src/manifest.js +24 -0
- package/contracts/src/manifest.js.map +1 -0
- package/contracts/src/permission.keys.d.ts +30 -14
- package/contracts/src/permission.keys.js +28 -12
- package/contracts/src/permission.keys.js.map +1 -1
- package/contracts/src/query-cache-targets.d.ts +5 -0
- package/contracts/src/query-cache-targets.js +113 -0
- package/contracts/src/query-cache-targets.js.map +1 -0
- package/contracts/src/report-filter-form.util.d.ts +20 -0
- package/contracts/src/report-filter-form.util.js +121 -0
- package/contracts/src/report-filter-form.util.js.map +1 -0
- package/contracts/src/report-generation.types.d.ts +97 -0
- package/contracts/src/report-generation.types.js +14 -0
- package/contracts/src/report-generation.types.js.map +1 -0
- package/contracts/src/report-interchange.projection.d.ts +22 -0
- package/contracts/src/report-interchange.projection.js +171 -0
- package/contracts/src/report-interchange.projection.js.map +1 -0
- package/contracts/src/report-interchange.snapshot.d.ts +12 -0
- package/contracts/src/report-interchange.snapshot.js +34 -0
- package/contracts/src/report-interchange.snapshot.js.map +1 -0
- package/contracts/src/report-interchange.types.d.ts +38 -0
- package/contracts/src/report-interchange.types.js +4 -0
- package/contracts/src/report-interchange.types.js.map +1 -0
- package/contracts/src/report-layout-field-schema.d.ts +64 -0
- package/contracts/src/report-layout-field-schema.js +294 -0
- package/contracts/src/report-layout-field-schema.js.map +1 -0
- package/contracts/src/report-layout-form.util.d.ts +67 -0
- package/contracts/src/report-layout-form.util.js +578 -0
- package/contracts/src/report-layout-form.util.js.map +1 -0
- package/contracts/src/report-layout-json-sections.d.ts +15 -0
- package/contracts/src/report-layout-json-sections.js +38 -0
- package/contracts/src/report-layout-json-sections.js.map +1 -0
- package/contracts/src/report-layout-sections.mapper.d.ts +37 -0
- package/contracts/src/report-layout-sections.mapper.js +306 -0
- package/contracts/src/report-layout-sections.mapper.js.map +1 -0
- package/contracts/src/report-layout-starter.d.ts +15 -0
- package/contracts/src/report-layout-starter.js +93 -0
- package/contracts/src/report-layout-starter.js.map +1 -0
- package/contracts/src/report-layout.presets.d.ts +17 -0
- package/contracts/src/report-layout.presets.js +72 -0
- package/contracts/src/report-layout.presets.js.map +1 -0
- package/contracts/src/report-parameter-binding.util.d.ts +8 -0
- package/contracts/src/report-parameter-binding.util.js +29 -0
- package/contracts/src/report-parameter-binding.util.js.map +1 -0
- package/contracts/src/report.types.d.ts +125 -107
- package/contracts/src/report.types.js.map +1 -1
- package/contracts/src/root-config.d.ts +9 -2
- package/contracts/src/root-config.js +9 -2
- package/contracts/src/root-config.js.map +1 -1
- package/contracts/src/runtime.keys.d.ts +14 -0
- package/contracts/src/runtime.keys.js +20 -0
- package/contracts/src/runtime.keys.js.map +1 -0
- package/contracts/src/settings.keys.d.ts +11 -0
- package/contracts/src/settings.keys.js +17 -0
- package/contracts/src/settings.keys.js.map +1 -0
- package/package.json +9 -7
- package/server/src/index.d.ts +4 -4
- package/server/src/index.js +9 -8
- package/server/src/index.js.map +1 -1
- package/server/src/lib/entities/index.d.ts +1 -0
- package/server/src/lib/entities/index.js +5 -0
- package/server/src/lib/entities/index.js.map +1 -0
- package/server/src/lib/entities/report-management.entity-catalog.d.ts +1 -0
- package/server/src/lib/entities/report-management.entity-catalog.js +12 -0
- package/server/src/lib/entities/report-management.entity-catalog.js.map +1 -0
- package/server/src/lib/interchange/report-interchange-definition.service.d.ts +18 -0
- package/server/src/lib/interchange/report-interchange-definition.service.js +94 -0
- package/server/src/lib/interchange/report-interchange-definition.service.js.map +1 -0
- package/server/src/lib/interchange/report-interchange-export-data-source.d.ts +16 -0
- package/server/src/lib/interchange/report-interchange-export-data-source.js +72 -0
- package/server/src/lib/interchange/report-interchange-export-data-source.js.map +1 -0
- package/server/src/lib/interchange/report-interchange-export-query.util.d.ts +10 -0
- package/server/src/lib/interchange/report-interchange-export-query.util.js +22 -0
- package/server/src/lib/interchange/report-interchange-export-query.util.js.map +1 -0
- package/server/src/lib/interchange/report-interchange-export.command.d.ts +31 -0
- package/server/src/lib/interchange/report-interchange-export.command.js +268 -0
- package/server/src/lib/interchange/report-interchange-export.command.js.map +1 -0
- package/server/src/lib/report-browse.service.js +32 -13
- package/server/src/lib/report-browse.service.js.map +1 -1
- package/server/src/lib/report-browse.types.d.ts +27 -12
- package/server/src/lib/report-browse.types.js +0 -1
- package/server/src/lib/report-browse.types.js.map +1 -1
- package/server/src/lib/report-definition.seed-provider.d.ts +15 -0
- package/server/src/lib/report-definition.seed-provider.js +63 -0
- package/server/src/lib/report-definition.seed-provider.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-create.command.d.ts +17 -0
- package/server/src/lib/report-generation/report-generation-create.command.js +177 -0
- package/server/src/lib/report-generation/report-generation-create.command.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-enqueue.service.d.ts +21 -0
- package/server/src/lib/report-generation/report-generation-enqueue.service.js +58 -0
- package/server/src/lib/report-generation/report-generation-enqueue.service.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-execute.command.d.ts +10 -0
- package/server/src/lib/report-generation/report-generation-execute.command.js +49 -0
- package/server/src/lib/report-generation/report-generation-execute.command.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-execute.service.d.ts +23 -0
- package/server/src/lib/report-generation/report-generation-execute.service.js +226 -0
- package/server/src/lib/report-generation/report-generation-execute.service.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-job-presentation.util.d.ts +8 -0
- package/server/src/lib/report-generation/report-generation-job-presentation.util.js +43 -0
- package/server/src/lib/report-generation/report-generation-job-presentation.util.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-notify.service.d.ts +23 -0
- package/server/src/lib/report-generation/report-generation-notify.service.js +159 -0
- package/server/src/lib/report-generation/report-generation-notify.service.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-policy.util.d.ts +39 -0
- package/server/src/lib/report-generation/report-generation-policy.util.js +95 -0
- package/server/src/lib/report-generation/report-generation-policy.util.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-progress.util.d.ts +14 -0
- package/server/src/lib/report-generation/report-generation-progress.util.js +51 -0
- package/server/src/lib/report-generation/report-generation-progress.util.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-release-inline-watch.command.d.ts +10 -0
- package/server/src/lib/report-generation/report-generation-release-inline-watch.command.js +55 -0
- package/server/src/lib/report-generation/report-generation-release-inline-watch.command.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-runtime.handlers.d.ts +27 -0
- package/server/src/lib/report-generation/report-generation-runtime.handlers.js +136 -0
- package/server/src/lib/report-generation/report-generation-runtime.handlers.js.map +1 -0
- package/server/src/lib/report-generation/report-generation-settings.service.d.ts +12 -0
- package/server/src/lib/report-generation/report-generation-settings.service.js +49 -0
- package/server/src/lib/report-generation/report-generation-settings.service.js.map +1 -0
- package/server/src/lib/report-generation/report-generation.constants.d.ts +16 -0
- package/server/src/lib/report-generation/report-generation.constants.js +24 -0
- package/server/src/lib/report-generation/report-generation.constants.js.map +1 -0
- package/server/src/lib/report-generation/report-generation.store.d.ts +25 -0
- package/server/src/lib/report-generation/report-generation.store.js +145 -0
- package/server/src/lib/report-generation/report-generation.store.js.map +1 -0
- package/server/src/lib/report-generation/report-generation.util.d.ts +8 -0
- package/server/src/lib/report-generation/report-generation.util.js +131 -0
- package/server/src/lib/report-generation/report-generation.util.js.map +1 -0
- package/server/src/lib/report-management-runtime.handlers.d.ts +32 -0
- package/server/src/lib/report-management-runtime.handlers.js +78 -0
- package/server/src/lib/report-management-runtime.handlers.js.map +1 -0
- package/server/src/lib/report-management-server.module.js +55 -9
- package/server/src/lib/report-management-server.module.js.map +1 -1
- package/server/src/lib/report-management.controller.d.ts +1 -4
- package/server/src/lib/report-management.controller.js +2 -16
- package/server/src/lib/report-management.controller.js.map +1 -1
- package/server/src/lib/seed/index.d.ts +0 -19
- package/server/src/lib/seed/index.js +0 -21
- package/server/src/lib/seed/index.js.map +0 -1
- package/server/src/lib/seed/report-management-seed.provider.d.ts +0 -4
- package/server/src/lib/seed/report-management-seed.provider.js +0 -18
- package/server/src/lib/seed/report-management-seed.provider.js.map +0 -1
- package/server/src/lib/seed/report-management-seed.tokens.d.ts +0 -1
- package/server/src/lib/seed/report-management-seed.tokens.js +0 -7
- package/server/src/lib/seed/report-management-seed.tokens.js.map +0 -1
- package/server/src/lib/seed/report-management.seed-catalog.d.ts +0 -2
- package/server/src/lib/seed/report-management.seed-catalog.js +0 -10
- package/server/src/lib/seed/report-management.seed-catalog.js.map +0 -1
- package/server/src/lib/seed/samples/employee-report.mock.d.ts +0 -9
- package/server/src/lib/seed/samples/employee-report.mock.js +0 -322
- package/server/src/lib/seed/samples/employee-report.mock.js.map +0 -1
- package/server/src/lib/seed/samples/index.d.ts +0 -2
- package/server/src/lib/seed/samples/index.js +0 -6
- package/server/src/lib/seed/samples/index.js.map +0 -1
- package/server/src/lib/seed/samples/location-report.mock.d.ts +0 -9
- package/server/src/lib/seed/samples/location-report.mock.js +0 -339
- package/server/src/lib/seed/samples/location-report.mock.js.map +0 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveEffectiveDedupe = resolveEffectiveDedupe;
|
|
4
|
+
exports.isDedupePolicyActive = isDedupePolicyActive;
|
|
5
|
+
exports.buildReportGenerationFingerprint = buildReportGenerationFingerprint;
|
|
6
|
+
exports.matchesReportGenerationFingerprint = matchesReportGenerationFingerprint;
|
|
7
|
+
exports.findDedupeMatch = findDedupeMatch;
|
|
8
|
+
const node_crypto_1 = require("node:crypto");
|
|
9
|
+
const report_generation_util_1 = require("./report-generation.util");
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ----- Policy resolution -----
|
|
12
|
+
function resolveEffectiveDedupe(reportDedupe, platform) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return {
|
|
15
|
+
policy: (_a = reportDedupe === null || reportDedupe === void 0 ? void 0 : reportDedupe.policy) !== null && _a !== void 0 ? _a : platform.dedupePolicy,
|
|
16
|
+
cooldownMs: (_b = reportDedupe === null || reportDedupe === void 0 ? void 0 : reportDedupe.cooldownMs) !== null && _b !== void 0 ? _b : platform.dedupeCooldownMs,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function isDedupePolicyActive(dedupe, trigger) {
|
|
20
|
+
if (trigger === 'schedule') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return dedupe.policy !== 'none';
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ----- Fingerprint -----
|
|
27
|
+
function buildReportGenerationFingerprint(input) {
|
|
28
|
+
var _a;
|
|
29
|
+
const layoutIds = normalizeLayoutIds(input.layoutIds, input.layoutId);
|
|
30
|
+
const parameters = stableJson((0, report_generation_util_1.convertParametersToFilterClause)((_a = input.parameters) !== null && _a !== void 0 ? _a : {}));
|
|
31
|
+
const payload = stableJson({
|
|
32
|
+
reportId: input.reportId.trim(),
|
|
33
|
+
layoutIds,
|
|
34
|
+
parameters,
|
|
35
|
+
});
|
|
36
|
+
return (0, node_crypto_1.createHash)('sha256').update(payload).digest('hex');
|
|
37
|
+
}
|
|
38
|
+
function normalizeLayoutIds(layoutIds, layoutId) {
|
|
39
|
+
const ids = (layoutIds === null || layoutIds === void 0 ? void 0 : layoutIds.length) ? layoutIds : layoutId ? [layoutId] : [];
|
|
40
|
+
return ids.map((id) => id.trim()).filter(Boolean).sort();
|
|
41
|
+
}
|
|
42
|
+
function stableJson(value) {
|
|
43
|
+
return JSON.stringify(sortValue(value));
|
|
44
|
+
}
|
|
45
|
+
function sortValue(value) {
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
return value.map((item) => sortValue(item));
|
|
48
|
+
}
|
|
49
|
+
if (value && typeof value === 'object') {
|
|
50
|
+
const record = value;
|
|
51
|
+
const sorted = {};
|
|
52
|
+
for (const key of Object.keys(record).sort()) {
|
|
53
|
+
sorted[key] = sortValue(record[key]);
|
|
54
|
+
}
|
|
55
|
+
return sorted;
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
function matchesReportGenerationFingerprint(candidate, fingerprint) {
|
|
60
|
+
return buildReportGenerationFingerprint(candidate) === fingerprint;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region ----- Dedupe matching -----
|
|
64
|
+
function findDedupeMatch(input) {
|
|
65
|
+
var _a;
|
|
66
|
+
const now = (_a = input.now) !== null && _a !== void 0 ? _a : new Date();
|
|
67
|
+
const activeStatuses = new Set(['queued', 'running']);
|
|
68
|
+
for (const candidate of input.candidates) {
|
|
69
|
+
if (!matchesReportGenerationFingerprint(candidate, input.fingerprint)) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (activeStatuses.has(candidate.status)) {
|
|
73
|
+
if (input.dedupe.policy === 'in-flight' || input.dedupe.policy === 'in-flight-or-cooldown') {
|
|
74
|
+
return { id: candidate.id, jobId: candidate.jobId, status: candidate.status };
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (input.dedupe.policy !== 'in-flight-or-cooldown' || input.dedupe.cooldownMs <= 0) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (candidate.status !== 'completed' || !candidate.completedAt) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const completedAt = Date.parse(candidate.completedAt);
|
|
85
|
+
if (!Number.isFinite(completedAt)) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (now.getTime() - completedAt <= input.dedupe.cooldownMs) {
|
|
89
|
+
return { id: candidate.id, jobId: candidate.jobId, status: candidate.status };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//# sourceMappingURL=report-generation-policy.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation-policy.util.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-policy.util.ts"],"names":[],"mappings":";;AAoBA,wDAQC;AAED,oDAQC;AAMD,4EAcC;AA0BD,gFAUC;AAMD,0CAiDC;AArJD,6CAAyC;AAOzC,qEAA2E;AAS3E,YAAY;AAEZ,uCAAuC;AAEvC,SAAgB,sBAAsB,CACpC,YAA0D,EAC1D,QAAqF;;IAErF,OAAO;QACL,MAAM,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,mCAAI,QAAQ,CAAC,YAAY;QACrD,UAAU,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,mCAAI,QAAQ,CAAC,gBAAgB;KAClE,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAClC,MAAuC,EACvC,OAAyC;IAEzC,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAClC,CAAC;AAED,YAAY;AAEZ,iCAAiC;AAEjC,SAAgB,gCAAgC,CAAC,KAKhD;;IACC,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,UAAU,CAAC,IAAA,wDAA+B,EAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,CAAC;IACvF,MAAM,OAAO,GAAG,UAAU,CAAC;QACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE;QAC/B,SAAS;QACT,UAAU;KACX,CAAC,CAAC;IACH,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC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AAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3D,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;QAChF,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,YAAY"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ReportGenerationProgressReporter {
|
|
2
|
+
reportProgress(progress: number, statusText?: string, currentStep?: string): Promise<void>;
|
|
3
|
+
heartbeat?(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Advances tray progress in steps while a demo/report simulate delay runs.
|
|
7
|
+
* Keeps the footer task bar moving instead of freezing on the first loading milestone.
|
|
8
|
+
*/
|
|
9
|
+
export declare function simulateReportGenerationProgressDelay(progress: ReportGenerationProgressReporter | undefined, delayMs: number, options: {
|
|
10
|
+
fromProgress: number;
|
|
11
|
+
toProgress: number;
|
|
12
|
+
statusText: string;
|
|
13
|
+
stepIntervalMs?: number;
|
|
14
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ----- Types -----
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.simulateReportGenerationProgressDelay = simulateReportGenerationProgressDelay;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ----- Constants -----
|
|
8
|
+
const DEFAULT_SIMULATE_STEP_MS = 500;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ----- Simulated progress -----
|
|
11
|
+
/**
|
|
12
|
+
* Advances tray progress in steps while a demo/report simulate delay runs.
|
|
13
|
+
* Keeps the footer task bar moving instead of freezing on the first loading milestone.
|
|
14
|
+
*/
|
|
15
|
+
function simulateReportGenerationProgressDelay(progress, delayMs, options) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
if (delayMs <= 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!progress) {
|
|
22
|
+
yield sleep(delayMs);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const stepIntervalMs = Math.max(100, (_a = options.stepIntervalMs) !== null && _a !== void 0 ? _a : DEFAULT_SIMULATE_STEP_MS);
|
|
26
|
+
const fromProgress = options.fromProgress;
|
|
27
|
+
const toProgress = options.toProgress;
|
|
28
|
+
const startedAt = Date.now();
|
|
29
|
+
while (true) {
|
|
30
|
+
const elapsedMs = Date.now() - startedAt;
|
|
31
|
+
if (elapsedMs >= delayMs) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
const ratio = elapsedMs / delayMs;
|
|
35
|
+
const value = Math.round(fromProgress + (toProgress - fromProgress) * ratio);
|
|
36
|
+
yield progress.reportProgress(value, options.statusText);
|
|
37
|
+
yield ((_b = progress.heartbeat) === null || _b === void 0 ? void 0 : _b.call(progress));
|
|
38
|
+
const waitMs = Math.min(stepIntervalMs, delayMs - elapsedMs);
|
|
39
|
+
yield sleep(waitMs);
|
|
40
|
+
}
|
|
41
|
+
yield progress.reportProgress(toProgress, options.statusText);
|
|
42
|
+
yield ((_c = progress.heartbeat) === null || _c === void 0 ? void 0 : _c.call(progress));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function sleep(ms) {
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
setTimeout(resolve, ms);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//# sourceMappingURL=report-generation-progress.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation-progress.util.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-progress.util.ts"],"names":[],"mappings":";AAAA,2BAA2B;;AAqB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M,QAAQ,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9D,MAAM,CAAA,MAAA,QAAQ,CAAC,SAAS,wDAAI,CAAA,CAAC;IAC/B,CAAC;CAAA;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,YAAY"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BackendSessionService } from '@acorex-platform/framework-server/security';
|
|
2
|
+
import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
3
|
+
import { type AXPReportGenerationReleaseInlineWatchInput } from '@acorex-platform/module-report-management-client/contracts';
|
|
4
|
+
import { ReportGenerationStore } from './report-generation.store';
|
|
5
|
+
export declare class ReportGenerationReleaseInlineWatchCommand implements AXPCommand<AXPReportGenerationReleaseInlineWatchInput, void> {
|
|
6
|
+
private readonly store;
|
|
7
|
+
private readonly session;
|
|
8
|
+
constructor(store: ReportGenerationStore, session: BackendSessionService);
|
|
9
|
+
execute(input: AXPReportGenerationReleaseInlineWatchInput): AXPCommandExecuteResultPromise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportGenerationReleaseInlineWatchCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
7
|
+
const security_1 = require("@acorex-platform/framework-server/security");
|
|
8
|
+
const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
|
|
9
|
+
const report_generation_constants_1 = require("./report-generation.constants");
|
|
10
|
+
const report_generation_store_1 = require("./report-generation.store");
|
|
11
|
+
//#region ----- Release inline watch -----
|
|
12
|
+
let ReportGenerationReleaseInlineWatchCommand = class ReportGenerationReleaseInlineWatchCommand {
|
|
13
|
+
constructor(store, session) {
|
|
14
|
+
this.store = store;
|
|
15
|
+
this.session = session;
|
|
16
|
+
}
|
|
17
|
+
execute(input) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a;
|
|
20
|
+
const session = this.session.getSession();
|
|
21
|
+
if (!(session === null || session === void 0 ? void 0 : session.userId)) {
|
|
22
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
|
|
23
|
+
}
|
|
24
|
+
const id = (_a = input.id) === null || _a === void 0 ? void 0 : _a.trim();
|
|
25
|
+
if (!id) {
|
|
26
|
+
return { success: true, kind: 'value', data: undefined };
|
|
27
|
+
}
|
|
28
|
+
const row = yield this.store.getById(id);
|
|
29
|
+
if (!row || row.requestedBy !== session.userId) {
|
|
30
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
|
|
31
|
+
}
|
|
32
|
+
if (row.status !== 'queued' && row.status !== 'running') {
|
|
33
|
+
return { success: true, kind: 'value', data: undefined };
|
|
34
|
+
}
|
|
35
|
+
if (row.suppressNotificationOnComplete !== true) {
|
|
36
|
+
return { success: true, kind: 'value', data: undefined };
|
|
37
|
+
}
|
|
38
|
+
yield this.store.patchAsEngine(id, { suppressNotificationOnComplete: false });
|
|
39
|
+
return { success: true, kind: 'value', data: undefined };
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.ReportGenerationReleaseInlineWatchCommand = ReportGenerationReleaseInlineWatchCommand;
|
|
44
|
+
exports.ReportGenerationReleaseInlineWatchCommand = ReportGenerationReleaseInlineWatchCommand = tslib_1.__decorate([
|
|
45
|
+
(0, abstract_1.ServerHandler)({
|
|
46
|
+
key: module_report_management_contracts_1.AXMReportManagementCommandKeys.ReportGeneration.ReleaseInlineWatch,
|
|
47
|
+
auth: 'session',
|
|
48
|
+
permissions: [module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.Access],
|
|
49
|
+
}),
|
|
50
|
+
(0, common_1.Injectable)(),
|
|
51
|
+
tslib_1.__metadata("design:paramtypes", [report_generation_store_1.ReportGenerationStore,
|
|
52
|
+
security_1.BackendSessionService])
|
|
53
|
+
], ReportGenerationReleaseInlineWatchCommand);
|
|
54
|
+
//#endregion
|
|
55
|
+
//# sourceMappingURL=report-generation-release-inline-watch.command.js.map
|
package/server/src/lib/report-generation/report-generation-release-inline-watch.command.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation-release-inline-watch.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-release-inline-watch.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,gFAAkF;AAClF,yEAAmF;AAEnF,4GAI6D;AAC7D,+EAAkF;AAClF,uEAAkE;AAElE,0CAA0C;AAQnC,IAAM,yCAAyC,GAA/C,MAAM,yCAAyC;IAGpD,YACmB,KAA4B,EAC5B,OAA8B;QAD9B,UAAK,GAAL,KAAK,CAAuB;QAC5B,YAAO,GAAP,OAAO,CAAuB;IAC9C,CAAC;IAEE,OAAO,CACX,KAAiD;;;YAEjD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAC1C,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE,CAAC;gBACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,+DAAiC,EAAE,EAAE,CAAC;YAClF,CAAC;YAED,MAAM,EAAE,GAAG,MAAA,KAAK,CAAC,EAAE,0CAAE,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,EAAE,EA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;QACnB,gCAAqB;GALtC,yCAAyC,CAqCrD;AAED,YAAY"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AXPServerQueryHandler } from '@acorex-platform/framework-server/domain/abstract';
|
|
2
|
+
import { FileStorageFacadeService } from '@acorex-platform/framework-server/file-storage/http';
|
|
3
|
+
import { BackendSessionService, RuntimePermissionService } from '@acorex-platform/framework-server/security';
|
|
4
|
+
import type { AXPQueryFetchResultPromise } from '@acorex-platform/framework-shared/runtime';
|
|
5
|
+
import { type AXPReportGenerationGetInput, type AXPReportGenerationGetViewerFreezeInput, type AXPReportGenerationListMineInput, type AXPReportViewerFreeze, type AXMReportGenerationRequest } from '@acorex-platform/module-report-management-client/contracts';
|
|
6
|
+
import { ReportGenerationStore } from './report-generation.store';
|
|
7
|
+
export declare class ReportGenerationGetQuery implements AXPServerQueryHandler<AXPReportGenerationGetInput, AXMReportGenerationRequest> {
|
|
8
|
+
private readonly store;
|
|
9
|
+
private readonly session;
|
|
10
|
+
private readonly permissions;
|
|
11
|
+
constructor(store: ReportGenerationStore, session: BackendSessionService, permissions: RuntimePermissionService);
|
|
12
|
+
execute(input: AXPReportGenerationGetInput): AXPQueryFetchResultPromise<AXMReportGenerationRequest>;
|
|
13
|
+
}
|
|
14
|
+
export declare class ReportGenerationListMineQuery implements AXPServerQueryHandler<AXPReportGenerationListMineInput, AXMReportGenerationRequest> {
|
|
15
|
+
private readonly store;
|
|
16
|
+
private readonly session;
|
|
17
|
+
constructor(store: ReportGenerationStore, session: BackendSessionService);
|
|
18
|
+
execute(input?: AXPReportGenerationListMineInput): AXPQueryFetchResultPromise<AXMReportGenerationRequest>;
|
|
19
|
+
}
|
|
20
|
+
export declare class ReportGenerationGetViewerFreezeQuery implements AXPServerQueryHandler<AXPReportGenerationGetViewerFreezeInput, AXPReportViewerFreeze> {
|
|
21
|
+
private readonly store;
|
|
22
|
+
private readonly session;
|
|
23
|
+
private readonly fileStorage;
|
|
24
|
+
private readonly permissions;
|
|
25
|
+
constructor(store: ReportGenerationStore, session: BackendSessionService, fileStorage: FileStorageFacadeService, permissions: RuntimePermissionService);
|
|
26
|
+
execute(input: AXPReportGenerationGetViewerFreezeInput): AXPQueryFetchResultPromise<AXPReportViewerFreeze>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ---- Imports ----
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ReportGenerationGetViewerFreezeQuery = exports.ReportGenerationListMineQuery = exports.ReportGenerationGetQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
|
|
8
|
+
const http_1 = require("@acorex-platform/framework-server/file-storage/http");
|
|
9
|
+
const security_1 = require("@acorex-platform/framework-server/security");
|
|
10
|
+
const core_1 = require("@acorex-platform/framework-shared/core");
|
|
11
|
+
const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
|
|
12
|
+
const report_generation_constants_1 = require("./report-generation.constants");
|
|
13
|
+
const report_generation_store_1 = require("./report-generation.store");
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ---- Access ----
|
|
16
|
+
function canReadRequest(request, userId, canMaintain) {
|
|
17
|
+
if (canMaintain) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return Boolean(userId && request.requestedBy === userId);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ---- Queries ----
|
|
24
|
+
let ReportGenerationGetQuery = class ReportGenerationGetQuery {
|
|
25
|
+
constructor(store, session, permissions) {
|
|
26
|
+
this.store = store;
|
|
27
|
+
this.session = session;
|
|
28
|
+
this.permissions = permissions;
|
|
29
|
+
}
|
|
30
|
+
execute(input) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
const request = yield this.store.getById((_b = (_a = input.id) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '');
|
|
34
|
+
if (!request) {
|
|
35
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_NOT_FOUND_ERROR } };
|
|
36
|
+
}
|
|
37
|
+
const userId = (_c = this.session.getSession()) === null || _c === void 0 ? void 0 : _c.userId;
|
|
38
|
+
const canMaintain = yield this.permissions.authorize(userId, module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.MaintainReports);
|
|
39
|
+
if (!canReadRequest(request, userId, canMaintain)) {
|
|
40
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
|
|
41
|
+
}
|
|
42
|
+
return (0, core_1.runtimeQuerySuccessObject)(request);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.ReportGenerationGetQuery = ReportGenerationGetQuery;
|
|
47
|
+
exports.ReportGenerationGetQuery = ReportGenerationGetQuery = tslib_1.__decorate([
|
|
48
|
+
(0, abstract_1.ServerQueryHandler)({
|
|
49
|
+
key: module_report_management_contracts_1.AXMReportManagementQueryKeys.ReportGeneration.Get,
|
|
50
|
+
auth: 'session',
|
|
51
|
+
permissions: [module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.Access],
|
|
52
|
+
}),
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [report_generation_store_1.ReportGenerationStore,
|
|
55
|
+
security_1.BackendSessionService,
|
|
56
|
+
security_1.RuntimePermissionService])
|
|
57
|
+
], ReportGenerationGetQuery);
|
|
58
|
+
let ReportGenerationListMineQuery = class ReportGenerationListMineQuery {
|
|
59
|
+
constructor(store, session) {
|
|
60
|
+
this.store = store;
|
|
61
|
+
this.session = session;
|
|
62
|
+
}
|
|
63
|
+
execute() {
|
|
64
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
|
|
65
|
+
var _a;
|
|
66
|
+
const userId = (_a = this.session.getSession()) === null || _a === void 0 ? void 0 : _a.userId;
|
|
67
|
+
if (!userId) {
|
|
68
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
|
|
69
|
+
}
|
|
70
|
+
const page = yield this.store.listMine({
|
|
71
|
+
userId,
|
|
72
|
+
skip: input.skip,
|
|
73
|
+
take: input.take,
|
|
74
|
+
});
|
|
75
|
+
return (0, core_1.runtimeQuerySuccessCollection)({ items: page.items, total: page.total });
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.ReportGenerationListMineQuery = ReportGenerationListMineQuery;
|
|
80
|
+
exports.ReportGenerationListMineQuery = ReportGenerationListMineQuery = tslib_1.__decorate([
|
|
81
|
+
(0, abstract_1.ServerQueryHandler)({
|
|
82
|
+
key: module_report_management_contracts_1.AXMReportManagementQueryKeys.ReportGeneration.ListMine,
|
|
83
|
+
auth: 'session',
|
|
84
|
+
permissions: [module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.Access],
|
|
85
|
+
}),
|
|
86
|
+
(0, common_1.Injectable)(),
|
|
87
|
+
tslib_1.__metadata("design:paramtypes", [report_generation_store_1.ReportGenerationStore,
|
|
88
|
+
security_1.BackendSessionService])
|
|
89
|
+
], ReportGenerationListMineQuery);
|
|
90
|
+
let ReportGenerationGetViewerFreezeQuery = class ReportGenerationGetViewerFreezeQuery {
|
|
91
|
+
constructor(store, session, fileStorage, permissions) {
|
|
92
|
+
this.store = store;
|
|
93
|
+
this.session = session;
|
|
94
|
+
this.fileStorage = fileStorage;
|
|
95
|
+
this.permissions = permissions;
|
|
96
|
+
}
|
|
97
|
+
execute(input) {
|
|
98
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
var _a, _b, _c, _d;
|
|
100
|
+
const request = yield this.store.getById((_b = (_a = input.id) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '');
|
|
101
|
+
if (!request) {
|
|
102
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_NOT_FOUND_ERROR } };
|
|
103
|
+
}
|
|
104
|
+
const userId = (_c = this.session.getSession()) === null || _c === void 0 ? void 0 : _c.userId;
|
|
105
|
+
const canMaintain = yield this.permissions.authorize(userId, module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.MaintainReports);
|
|
106
|
+
if (!canReadRequest(request, userId, canMaintain)) {
|
|
107
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
|
|
108
|
+
}
|
|
109
|
+
const viewer = (_d = request.artifacts) === null || _d === void 0 ? void 0 : _d.find((artifact) => artifact.kind === 'viewer' && artifact.fileId);
|
|
110
|
+
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.fileId)) {
|
|
111
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_NOT_FOUND_ERROR } };
|
|
112
|
+
}
|
|
113
|
+
const file = yield this.fileStorage.readBinary(viewer.fileId);
|
|
114
|
+
const freeze = JSON.parse(file.buffer.toString('utf8'));
|
|
115
|
+
if (!freeze || freeze.version !== 1) {
|
|
116
|
+
return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_NOT_FOUND_ERROR } };
|
|
117
|
+
}
|
|
118
|
+
return (0, core_1.runtimeQuerySuccessObject)(freeze);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
exports.ReportGenerationGetViewerFreezeQuery = ReportGenerationGetViewerFreezeQuery;
|
|
123
|
+
exports.ReportGenerationGetViewerFreezeQuery = ReportGenerationGetViewerFreezeQuery = tslib_1.__decorate([
|
|
124
|
+
(0, abstract_1.ServerQueryHandler)({
|
|
125
|
+
key: module_report_management_contracts_1.AXMReportManagementQueryKeys.ReportGeneration.GetViewerFreeze,
|
|
126
|
+
auth: 'session',
|
|
127
|
+
permissions: [module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.Access],
|
|
128
|
+
}),
|
|
129
|
+
(0, common_1.Injectable)(),
|
|
130
|
+
tslib_1.__metadata("design:paramtypes", [report_generation_store_1.ReportGenerationStore,
|
|
131
|
+
security_1.BackendSessionService,
|
|
132
|
+
http_1.FileStorageFacadeService,
|
|
133
|
+
security_1.RuntimePermissionService])
|
|
134
|
+
], ReportGenerationGetViewerFreezeQuery);
|
|
135
|
+
//#endregion
|
|
136
|
+
//# sourceMappingURL=report-generation-runtime.handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation-runtime.handlers.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-runtime.handlers.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;;AAE3B,2CAA4C;AAC5C,gFAAmH;AACnH,8EAA+F;AAC/F,yEAA6G;AAC7G,iEAGgD;AAEhD,4GAQ6D;AAC7D,+EAGuC;AACvC,uEAAkE;AAElE,YAAY;AAEZ,0BAA0B;AAE1B,SAAS,cAAc,CACrB,OAAmC,EACnC,MAA0B,EAC1B,WAAoB;IAEpB,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,YAAY;AAEZ,2BAA2B;AAQpB,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAGnC,YACmB,KAA4B,EAC5B,OAA8B,EAC9B,WAAqC;QAFrC,UAAK,GAAL,KAAK,CAAuB;QAC5B,YAAO,GAAP,OAAO,CAAuB;QAC9B,gBAAW,GAAX,WAAW,CAA0B;IACrD,CAAC;IAEE,OAAO,CAAC,KAAkC;;;YAC9C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAA,MAAA,KAAK,CAAC,EAAE,0CAAE,IAAI,EAAE,mC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3C,CAAC;KAAA;CACF,CAAA;AAtCY,oFAAoC;+CAApC,oCAAoC;IANhD,IAAA,6BAAkB,EAAC;QAClB,GAAG,EAAE,iEAA4B,CAAC,gBAAgB,CAAC,eAAe;QAClE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,uEAAkC,CAAC,MAAM,CAAC;KACzD,CAAC;IACD,IAAA,mBAAU,GAAE;6CAKe,+CAAqB;QACnB,gCAAqB;QACjB,+BAAwB;QACxB,mCAAwB;GAP7C,oCAAoC,CAsChD;AAED,YAAY"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SettingsManagementStoreService } from '@acorex-platform/module-settings-management-server';
|
|
2
|
+
import { type AXPReportGenerationDedupePolicy } from '@acorex-platform/module-report-management-client/contracts';
|
|
3
|
+
export interface ReportGenerationPlatformSettings {
|
|
4
|
+
dedupePolicy: AXPReportGenerationDedupePolicy;
|
|
5
|
+
dedupeCooldownMs: number;
|
|
6
|
+
maxConcurrentPerUser: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class ReportGenerationSettingsService {
|
|
9
|
+
private readonly settingsStore;
|
|
10
|
+
constructor(settingsStore: SettingsManagementStoreService);
|
|
11
|
+
resolvePlatformSettings(): Promise<ReportGenerationPlatformSettings>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportGenerationSettingsService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const module_settings_management_server_1 = require("@acorex-platform/module-settings-management-server");
|
|
7
|
+
const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region ----- Settings service -----
|
|
10
|
+
let ReportGenerationSettingsService = class ReportGenerationSettingsService {
|
|
11
|
+
constructor(settingsStore) {
|
|
12
|
+
this.settingsStore = settingsStore;
|
|
13
|
+
}
|
|
14
|
+
resolvePlatformSettings() {
|
|
15
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
var _a;
|
|
17
|
+
const document = yield this.settingsStore.findByPartition({ scope: 'P', documentId: 'P' });
|
|
18
|
+
const platform = (_a = document === null || document === void 0 ? void 0 : document.values) !== null && _a !== void 0 ? _a : {};
|
|
19
|
+
const defaults = module_report_management_contracts_1.AXP_REPORT_MANAGEMENT_GENERATION_SETTING_DEFAULTS;
|
|
20
|
+
const dedupePolicy = coerceDedupePolicy(platform[module_report_management_contracts_1.AXPReportManagementSettings.GenerationDedupePolicy], defaults[module_report_management_contracts_1.AXPReportManagementSettings.GenerationDedupePolicy]);
|
|
21
|
+
const cooldownMinutes = coerceNonNegativeInt(platform[module_report_management_contracts_1.AXPReportManagementSettings.GenerationDedupeCooldownMinutes], defaults[module_report_management_contracts_1.AXPReportManagementSettings.GenerationDedupeCooldownMinutes]);
|
|
22
|
+
return {
|
|
23
|
+
dedupePolicy,
|
|
24
|
+
dedupeCooldownMs: cooldownMinutes * 60000,
|
|
25
|
+
maxConcurrentPerUser: coerceNonNegativeInt(platform[module_report_management_contracts_1.AXPReportManagementSettings.GenerationMaxConcurrentPerUser], defaults[module_report_management_contracts_1.AXPReportManagementSettings.GenerationMaxConcurrentPerUser]),
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.ReportGenerationSettingsService = ReportGenerationSettingsService;
|
|
31
|
+
exports.ReportGenerationSettingsService = ReportGenerationSettingsService = tslib_1.__decorate([
|
|
32
|
+
(0, common_1.Injectable)(),
|
|
33
|
+
tslib_1.__metadata("design:paramtypes", [module_settings_management_server_1.SettingsManagementStoreService])
|
|
34
|
+
], ReportGenerationSettingsService);
|
|
35
|
+
function coerceDedupePolicy(value, fallback) {
|
|
36
|
+
if (value === 'none' || value === 'in-flight' || value === 'in-flight-or-cooldown') {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return fallback;
|
|
40
|
+
}
|
|
41
|
+
function coerceNonNegativeInt(value, fallback) {
|
|
42
|
+
const parsed = typeof value === 'number' ? value : Number(value);
|
|
43
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
44
|
+
return fallback;
|
|
45
|
+
}
|
|
46
|
+
return Math.floor(parsed);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//# sourceMappingURL=report-generation-settings.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation-settings.service.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-settings.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,0GAAoG;AACpG,4GAI6D;AAU7D,YAAY;AAEZ,sCAAsC;AAG/B,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC1C,YAA6B,aAA6C;QAA7C,kBAAa,GAAb,aAAa,CAAgC;IAAG,CAAC;IAExE,uBAAuB;;;YAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;YAC3F,MAAM,QAAQ,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,mCAAI,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,sFAAiD,CAAC;YAEnE,MAAM,YAAY,GAAG,kBAAkB,CACrC,QAAQ,CAAC,gEAA2B,CAAC,sBAAsB,CAAC,EAC5D,QAAQ,CAAC,gEAA2B,CAAC,sBAAsB,CAAC,CAC7D,CAAC;YACF,MAAM,eAAe,GAAG,oBAAoB,CAC1C,QAAQ,CAAC,gEAA2B,CAAC,+BAA+B,CAAC,EACrE,QAAQ,CAAC,gEAA2B,CAAC,+BAA+B,CAAC,CACtE,CAAC;YAEF,OAAO;gBACL,YAAY;gBACZ,gBAAgB,EAAE,eAAe,GAAG,KAAM;gBAC1C,oBAAoB,EAAE,oBAAoB,CACxC,QAAQ,CAAC,gEAA2B,CAAC,8BAA8B,CAAC,EACpE,QAAQ,CAAC,gEAA2B,CAAC,8BAA8B,CAAC,CACrE;aACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAA;AA1BY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,mBAAU,GAAE;6CAEiC,kEAA8B;GAD/D,+BAA+B,CA0B3C;AAED,SAAS,kBAAkB,CAAC,KAAc,EAAE,QAAyC;IACnF,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,uBAAuB,EAAE,CAAC;QACnF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED,YAAY"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const REPORT_GENERATION_REQUEST_ENTITY: `${string}.ReportGenerationRequest`;
|
|
2
|
+
export declare const REPORT_GENERATION_JOB_PROVIDER_KEY = "report-management";
|
|
3
|
+
export declare const REPORT_GENERATION_FILE_REF_TYPE: `${string}.ReportGenerationRequest`;
|
|
4
|
+
export declare const REPORT_GENERATION_FILE_CATEGORY = "report-generation-freeze";
|
|
5
|
+
export declare const REPORT_GENERATION_DEFAULT_RETENTION_DAYS = 30;
|
|
6
|
+
export declare const REPORT_GENERATION_DEFAULT_TIMEOUT_MS: number;
|
|
7
|
+
export declare const REPORT_GENERATION_FREEZE_TAKE = 10000;
|
|
8
|
+
export declare const REPORT_GENERATION_NOTIFICATION_DEFINITION_KEY = "ReportManagement:ReportGeneration";
|
|
9
|
+
export { REPORT_GENERATION_OPEN_FROZEN_COMMAND } from '@acorex-platform/module-report-management-client/contracts';
|
|
10
|
+
export declare const REPORT_GENERATION_UNSUPPORTED_SOURCE_ERROR = "@report-management:report-generation.errors.unsupported-data-source";
|
|
11
|
+
export declare const REPORT_GENERATION_NOT_FOUND_ERROR = "@report-management:report-generation.errors.not-found";
|
|
12
|
+
export declare const REPORT_GENERATION_FORBIDDEN_ERROR = "@report-management:report-generation.errors.forbidden";
|
|
13
|
+
export declare const REPORT_GENERATION_REPORT_NOT_FOUND_ERROR = "@report-management:report-generation.errors.report-not-found";
|
|
14
|
+
export declare const REPORT_GENERATION_QUERY_FAILED_ERROR = "@report-management:report-generation.errors.query-failed";
|
|
15
|
+
export declare const REPORT_GENERATION_MAX_CONCURRENT_ERROR = "@report-management:report-generation.errors.max-concurrent";
|
|
16
|
+
export declare const REPORT_GENERATION_SCHEDULE_ALREADY_RUNNING_ERROR = "@report-management:report-generation.errors.schedule-already-running";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REPORT_GENERATION_SCHEDULE_ALREADY_RUNNING_ERROR = exports.REPORT_GENERATION_MAX_CONCURRENT_ERROR = exports.REPORT_GENERATION_QUERY_FAILED_ERROR = exports.REPORT_GENERATION_REPORT_NOT_FOUND_ERROR = exports.REPORT_GENERATION_FORBIDDEN_ERROR = exports.REPORT_GENERATION_NOT_FOUND_ERROR = exports.REPORT_GENERATION_UNSUPPORTED_SOURCE_ERROR = exports.REPORT_GENERATION_OPEN_FROZEN_COMMAND = exports.REPORT_GENERATION_NOTIFICATION_DEFINITION_KEY = exports.REPORT_GENERATION_FREEZE_TAKE = exports.REPORT_GENERATION_DEFAULT_TIMEOUT_MS = exports.REPORT_GENERATION_DEFAULT_RETENTION_DAYS = exports.REPORT_GENERATION_FILE_CATEGORY = exports.REPORT_GENERATION_FILE_REF_TYPE = exports.REPORT_GENERATION_JOB_PROVIDER_KEY = exports.REPORT_GENERATION_REQUEST_ENTITY = void 0;
|
|
4
|
+
const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
|
|
5
|
+
//#region ----- Constants -----
|
|
6
|
+
exports.REPORT_GENERATION_REQUEST_ENTITY = module_report_management_contracts_1.RootConfig.entities.reportGenerationRequest.fullName;
|
|
7
|
+
exports.REPORT_GENERATION_JOB_PROVIDER_KEY = 'report-management';
|
|
8
|
+
exports.REPORT_GENERATION_FILE_REF_TYPE = module_report_management_contracts_1.RootConfig.entities.reportGenerationRequest.fullName;
|
|
9
|
+
exports.REPORT_GENERATION_FILE_CATEGORY = 'report-generation-freeze';
|
|
10
|
+
exports.REPORT_GENERATION_DEFAULT_RETENTION_DAYS = 30;
|
|
11
|
+
exports.REPORT_GENERATION_DEFAULT_TIMEOUT_MS = 30 * 60 * 1000;
|
|
12
|
+
exports.REPORT_GENERATION_FREEZE_TAKE = 10000;
|
|
13
|
+
exports.REPORT_GENERATION_NOTIFICATION_DEFINITION_KEY = 'ReportManagement:ReportGeneration';
|
|
14
|
+
var module_report_management_contracts_2 = require("@acorex-platform/module-report-management-client/contracts");
|
|
15
|
+
Object.defineProperty(exports, "REPORT_GENERATION_OPEN_FROZEN_COMMAND", { enumerable: true, get: function () { return module_report_management_contracts_2.REPORT_GENERATION_OPEN_FROZEN_COMMAND; } });
|
|
16
|
+
exports.REPORT_GENERATION_UNSUPPORTED_SOURCE_ERROR = '@report-management:report-generation.errors.unsupported-data-source';
|
|
17
|
+
exports.REPORT_GENERATION_NOT_FOUND_ERROR = '@report-management:report-generation.errors.not-found';
|
|
18
|
+
exports.REPORT_GENERATION_FORBIDDEN_ERROR = '@report-management:report-generation.errors.forbidden';
|
|
19
|
+
exports.REPORT_GENERATION_REPORT_NOT_FOUND_ERROR = '@report-management:report-generation.errors.report-not-found';
|
|
20
|
+
exports.REPORT_GENERATION_QUERY_FAILED_ERROR = '@report-management:report-generation.errors.query-failed';
|
|
21
|
+
exports.REPORT_GENERATION_MAX_CONCURRENT_ERROR = '@report-management:report-generation.errors.max-concurrent';
|
|
22
|
+
exports.REPORT_GENERATION_SCHEDULE_ALREADY_RUNNING_ERROR = '@report-management:report-generation.errors.schedule-already-running';
|
|
23
|
+
//#endregion
|
|
24
|
+
//# sourceMappingURL=report-generation.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generation.constants.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation.constants.ts"],"names":[],"mappings":";;;AAAA,4GAAiF;AAEjF,+BAA+B;AAElB,QAAA,gCAAgC,GAAG,+CAAU,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC;AAExF,QAAA,kCAAkC,GAAG,mBAAmB,CAAC;AAEzD,QAAA,+BAA+B,GAAG,+CAAU,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC;AAEvF,QAAA,+BAA+B,GAAG,0BAA0B,CAAC;AAE7D,QAAA,wCAAwC,GAAG,EAAE,CAAC;AAE9C,QAAA,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtD,QAAA,6BAA6B,GAAG,KAAK,CAAC;AAEtC,QAAA,6CAA6C,GAAG,mCAAmC,CAAC;AAEjG,0GAA4G;AAAnG,2JAAA,qCAAqC,OAAA;AAEjC,QAAA,0CAA0C,GACrD,qEAAqE,CAAC;AAE3D,QAAA,iCAAiC,GAAG,uDAAuD,CAAC;AAE5F,QAAA,iCAAiC,GAAG,uDAAuD,CAAC;AAE5F,QAAA,wCAAwC,GACnD,8DAA8D,CAAC;AAEpD,QAAA,oCAAoC,GAC/C,0DAA0D,CAAC;AAEhD,QAAA,sCAAsC,GACjD,4DAA4D,CAAC;AAElD,QAAA,gDAAgD,GAC3D,sEAAsE,CAAC;AAEzE,YAAY"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
|
|
2
|
+
import type { AXMReportGenerationRequest } from '@acorex-platform/module-report-management-client/contracts';
|
|
3
|
+
export declare class ReportGenerationStore {
|
|
4
|
+
private readonly storage;
|
|
5
|
+
constructor(storage: EntityStorageMiddlewareService);
|
|
6
|
+
insert(row: AXMReportGenerationRequest): Promise<string>;
|
|
7
|
+
getById(id: string): Promise<AXMReportGenerationRequest | null>;
|
|
8
|
+
patchAsEngine(id: string, patch: Partial<AXMReportGenerationRequest>): Promise<void>;
|
|
9
|
+
listMine(input: {
|
|
10
|
+
userId: string;
|
|
11
|
+
skip?: number;
|
|
12
|
+
take?: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
items: AXMReportGenerationRequest[];
|
|
15
|
+
total: number;
|
|
16
|
+
}>;
|
|
17
|
+
countActiveManualByUser(userId: string): Promise<number>;
|
|
18
|
+
findActiveByScheduleId(scheduleId: string): Promise<AXMReportGenerationRequest | null>;
|
|
19
|
+
listActiveByUserAndReport(userId: string, reportId: string): Promise<AXMReportGenerationRequest[]>;
|
|
20
|
+
listCompletedSinceByUserAndReport(input: {
|
|
21
|
+
userId: string;
|
|
22
|
+
reportId: string;
|
|
23
|
+
sinceIso: string;
|
|
24
|
+
}): Promise<AXMReportGenerationRequest[]>;
|
|
25
|
+
}
|