@acorex-platform/module-report-management-server 0.0.15 → 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.
Files changed (194) hide show
  1. package/contracts/src/commands.keys.d.ts +13 -0
  2. package/contracts/src/commands.keys.js +19 -0
  3. package/contracts/src/commands.keys.js.map +1 -0
  4. package/contracts/src/entities/index.d.ts +1 -0
  5. package/contracts/src/entities/index.js +1 -0
  6. package/contracts/src/entities/index.js.map +1 -1
  7. package/contracts/src/entities/report/index.d.ts +1 -1
  8. package/contracts/src/entities/report/index.js +1 -1
  9. package/contracts/src/entities/report/index.js.map +1 -1
  10. package/contracts/src/entities/report/report.entity.js +180 -12
  11. package/contracts/src/entities/report/report.entity.js.map +1 -1
  12. package/contracts/src/entities/report-category/index.d.ts +1 -1
  13. package/contracts/src/entities/report-category/index.js +0 -2
  14. package/contracts/src/entities/report-category/index.js.map +1 -1
  15. package/contracts/src/entities/report-category/report-category.entity.js +14 -1
  16. package/contracts/src/entities/report-category/report-category.entity.js.map +1 -1
  17. package/contracts/src/entities/report-generation-request/index.d.ts +1 -0
  18. package/contracts/src/entities/report-generation-request/index.js +5 -0
  19. package/contracts/src/entities/report-generation-request/index.js.map +1 -0
  20. package/contracts/src/entities/report-generation-request/report-generation-request.entity.d.ts +2 -0
  21. package/contracts/src/entities/report-generation-request/report-generation-request.entity.js +208 -0
  22. package/contracts/src/entities/report-generation-request/report-generation-request.entity.js.map +1 -0
  23. package/contracts/src/entity-catalog.d.ts +7 -0
  24. package/contracts/src/entity-catalog.js +22 -0
  25. package/contracts/src/entity-catalog.js.map +1 -0
  26. package/contracts/src/entity-entry.report-category.d.ts +1 -0
  27. package/contracts/src/entity-entry.report-category.js +6 -0
  28. package/contracts/src/entity-entry.report-category.js.map +1 -0
  29. package/contracts/src/entity-entry.report-generation-request.d.ts +1 -0
  30. package/contracts/src/entity-entry.report-generation-request.js +6 -0
  31. package/contracts/src/entity-entry.report-generation-request.js.map +1 -0
  32. package/contracts/src/entity-entry.report.d.ts +1 -0
  33. package/contracts/src/entity-entry.report.js +6 -0
  34. package/contracts/src/entity-entry.report.js.map +1 -0
  35. package/contracts/src/index.d.ts +18 -1
  36. package/contracts/src/index.js +18 -1
  37. package/contracts/src/index.js.map +1 -1
  38. package/contracts/src/manifest.d.ts +6 -0
  39. package/contracts/src/manifest.js +24 -0
  40. package/contracts/src/manifest.js.map +1 -0
  41. package/contracts/src/permission.keys.d.ts +30 -14
  42. package/contracts/src/permission.keys.js +28 -12
  43. package/contracts/src/permission.keys.js.map +1 -1
  44. package/contracts/src/query-cache-targets.d.ts +5 -0
  45. package/contracts/src/query-cache-targets.js +113 -0
  46. package/contracts/src/query-cache-targets.js.map +1 -0
  47. package/contracts/src/report-filter-form.util.d.ts +20 -0
  48. package/contracts/src/report-filter-form.util.js +121 -0
  49. package/contracts/src/report-filter-form.util.js.map +1 -0
  50. package/contracts/src/report-generation.types.d.ts +97 -0
  51. package/contracts/src/report-generation.types.js +14 -0
  52. package/contracts/src/report-generation.types.js.map +1 -0
  53. package/contracts/src/report-interchange.projection.d.ts +22 -0
  54. package/contracts/src/report-interchange.projection.js +171 -0
  55. package/contracts/src/report-interchange.projection.js.map +1 -0
  56. package/contracts/src/report-interchange.snapshot.d.ts +12 -0
  57. package/contracts/src/report-interchange.snapshot.js +34 -0
  58. package/contracts/src/report-interchange.snapshot.js.map +1 -0
  59. package/contracts/src/report-interchange.types.d.ts +38 -0
  60. package/contracts/src/report-interchange.types.js +4 -0
  61. package/contracts/src/report-interchange.types.js.map +1 -0
  62. package/contracts/src/report-layout-field-schema.d.ts +64 -0
  63. package/contracts/src/report-layout-field-schema.js +294 -0
  64. package/contracts/src/report-layout-field-schema.js.map +1 -0
  65. package/contracts/src/report-layout-form.util.d.ts +67 -0
  66. package/contracts/src/report-layout-form.util.js +578 -0
  67. package/contracts/src/report-layout-form.util.js.map +1 -0
  68. package/contracts/src/report-layout-json-sections.d.ts +15 -0
  69. package/contracts/src/report-layout-json-sections.js +38 -0
  70. package/contracts/src/report-layout-json-sections.js.map +1 -0
  71. package/contracts/src/report-layout-sections.mapper.d.ts +37 -0
  72. package/contracts/src/report-layout-sections.mapper.js +306 -0
  73. package/contracts/src/report-layout-sections.mapper.js.map +1 -0
  74. package/contracts/src/report-layout-starter.d.ts +15 -0
  75. package/contracts/src/report-layout-starter.js +93 -0
  76. package/contracts/src/report-layout-starter.js.map +1 -0
  77. package/contracts/src/report-layout.presets.d.ts +17 -0
  78. package/contracts/src/report-layout.presets.js +72 -0
  79. package/contracts/src/report-layout.presets.js.map +1 -0
  80. package/contracts/src/report-parameter-binding.util.d.ts +8 -0
  81. package/contracts/src/report-parameter-binding.util.js +29 -0
  82. package/contracts/src/report-parameter-binding.util.js.map +1 -0
  83. package/contracts/src/report.types.d.ts +125 -107
  84. package/contracts/src/report.types.js.map +1 -1
  85. package/contracts/src/root-config.d.ts +9 -2
  86. package/contracts/src/root-config.js +9 -2
  87. package/contracts/src/root-config.js.map +1 -1
  88. package/contracts/src/runtime.keys.d.ts +14 -0
  89. package/contracts/src/runtime.keys.js +20 -0
  90. package/contracts/src/runtime.keys.js.map +1 -0
  91. package/contracts/src/settings.keys.d.ts +11 -0
  92. package/contracts/src/settings.keys.js +17 -0
  93. package/contracts/src/settings.keys.js.map +1 -0
  94. package/package.json +9 -7
  95. package/server/src/index.d.ts +4 -4
  96. package/server/src/index.js +9 -8
  97. package/server/src/index.js.map +1 -1
  98. package/server/src/lib/entities/index.d.ts +1 -0
  99. package/server/src/lib/entities/index.js +5 -0
  100. package/server/src/lib/entities/index.js.map +1 -0
  101. package/server/src/lib/entities/report-management.entity-catalog.d.ts +1 -0
  102. package/server/src/lib/entities/report-management.entity-catalog.js +12 -0
  103. package/server/src/lib/entities/report-management.entity-catalog.js.map +1 -0
  104. package/server/src/lib/interchange/report-interchange-definition.service.d.ts +18 -0
  105. package/server/src/lib/interchange/report-interchange-definition.service.js +94 -0
  106. package/server/src/lib/interchange/report-interchange-definition.service.js.map +1 -0
  107. package/server/src/lib/interchange/report-interchange-export-data-source.d.ts +16 -0
  108. package/server/src/lib/interchange/report-interchange-export-data-source.js +72 -0
  109. package/server/src/lib/interchange/report-interchange-export-data-source.js.map +1 -0
  110. package/server/src/lib/interchange/report-interchange-export-query.util.d.ts +10 -0
  111. package/server/src/lib/interchange/report-interchange-export-query.util.js +22 -0
  112. package/server/src/lib/interchange/report-interchange-export-query.util.js.map +1 -0
  113. package/server/src/lib/interchange/report-interchange-export.command.d.ts +31 -0
  114. package/server/src/lib/interchange/report-interchange-export.command.js +268 -0
  115. package/server/src/lib/interchange/report-interchange-export.command.js.map +1 -0
  116. package/server/src/lib/report-browse.service.js +32 -13
  117. package/server/src/lib/report-browse.service.js.map +1 -1
  118. package/server/src/lib/report-browse.types.d.ts +27 -12
  119. package/server/src/lib/report-browse.types.js +0 -1
  120. package/server/src/lib/report-browse.types.js.map +1 -1
  121. package/server/src/lib/report-definition.seed-provider.d.ts +15 -0
  122. package/server/src/lib/report-definition.seed-provider.js +63 -0
  123. package/server/src/lib/report-definition.seed-provider.js.map +1 -0
  124. package/server/src/lib/report-generation/report-generation-create.command.d.ts +17 -0
  125. package/server/src/lib/report-generation/report-generation-create.command.js +177 -0
  126. package/server/src/lib/report-generation/report-generation-create.command.js.map +1 -0
  127. package/server/src/lib/report-generation/report-generation-enqueue.service.d.ts +21 -0
  128. package/server/src/lib/report-generation/report-generation-enqueue.service.js +58 -0
  129. package/server/src/lib/report-generation/report-generation-enqueue.service.js.map +1 -0
  130. package/server/src/lib/report-generation/report-generation-execute.command.d.ts +10 -0
  131. package/server/src/lib/report-generation/report-generation-execute.command.js +49 -0
  132. package/server/src/lib/report-generation/report-generation-execute.command.js.map +1 -0
  133. package/server/src/lib/report-generation/report-generation-execute.service.d.ts +23 -0
  134. package/server/src/lib/report-generation/report-generation-execute.service.js +226 -0
  135. package/server/src/lib/report-generation/report-generation-execute.service.js.map +1 -0
  136. package/server/src/lib/report-generation/report-generation-job-presentation.util.d.ts +8 -0
  137. package/server/src/lib/report-generation/report-generation-job-presentation.util.js +43 -0
  138. package/server/src/lib/report-generation/report-generation-job-presentation.util.js.map +1 -0
  139. package/server/src/lib/report-generation/report-generation-notify.service.d.ts +23 -0
  140. package/server/src/lib/report-generation/report-generation-notify.service.js +159 -0
  141. package/server/src/lib/report-generation/report-generation-notify.service.js.map +1 -0
  142. package/server/src/lib/report-generation/report-generation-policy.util.d.ts +39 -0
  143. package/server/src/lib/report-generation/report-generation-policy.util.js +95 -0
  144. package/server/src/lib/report-generation/report-generation-policy.util.js.map +1 -0
  145. package/server/src/lib/report-generation/report-generation-progress.util.d.ts +14 -0
  146. package/server/src/lib/report-generation/report-generation-progress.util.js +51 -0
  147. package/server/src/lib/report-generation/report-generation-progress.util.js.map +1 -0
  148. package/server/src/lib/report-generation/report-generation-release-inline-watch.command.d.ts +10 -0
  149. package/server/src/lib/report-generation/report-generation-release-inline-watch.command.js +55 -0
  150. package/server/src/lib/report-generation/report-generation-release-inline-watch.command.js.map +1 -0
  151. package/server/src/lib/report-generation/report-generation-runtime.handlers.d.ts +27 -0
  152. package/server/src/lib/report-generation/report-generation-runtime.handlers.js +136 -0
  153. package/server/src/lib/report-generation/report-generation-runtime.handlers.js.map +1 -0
  154. package/server/src/lib/report-generation/report-generation-settings.service.d.ts +12 -0
  155. package/server/src/lib/report-generation/report-generation-settings.service.js +49 -0
  156. package/server/src/lib/report-generation/report-generation-settings.service.js.map +1 -0
  157. package/server/src/lib/report-generation/report-generation.constants.d.ts +16 -0
  158. package/server/src/lib/report-generation/report-generation.constants.js +24 -0
  159. package/server/src/lib/report-generation/report-generation.constants.js.map +1 -0
  160. package/server/src/lib/report-generation/report-generation.store.d.ts +25 -0
  161. package/server/src/lib/report-generation/report-generation.store.js +145 -0
  162. package/server/src/lib/report-generation/report-generation.store.js.map +1 -0
  163. package/server/src/lib/report-generation/report-generation.util.d.ts +8 -0
  164. package/server/src/lib/report-generation/report-generation.util.js +131 -0
  165. package/server/src/lib/report-generation/report-generation.util.js.map +1 -0
  166. package/server/src/lib/report-management-runtime.handlers.d.ts +32 -0
  167. package/server/src/lib/report-management-runtime.handlers.js +78 -0
  168. package/server/src/lib/report-management-runtime.handlers.js.map +1 -0
  169. package/server/src/lib/report-management-server.module.js +55 -9
  170. package/server/src/lib/report-management-server.module.js.map +1 -1
  171. package/server/src/lib/report-management.controller.d.ts +1 -4
  172. package/server/src/lib/report-management.controller.js +2 -16
  173. package/server/src/lib/report-management.controller.js.map +1 -1
  174. package/server/src/lib/seed/index.d.ts +0 -19
  175. package/server/src/lib/seed/index.js +0 -21
  176. package/server/src/lib/seed/index.js.map +0 -1
  177. package/server/src/lib/seed/report-management-seed.provider.d.ts +0 -4
  178. package/server/src/lib/seed/report-management-seed.provider.js +0 -18
  179. package/server/src/lib/seed/report-management-seed.provider.js.map +0 -1
  180. package/server/src/lib/seed/report-management-seed.tokens.d.ts +0 -1
  181. package/server/src/lib/seed/report-management-seed.tokens.js +0 -7
  182. package/server/src/lib/seed/report-management-seed.tokens.js.map +0 -1
  183. package/server/src/lib/seed/report-management.seed-catalog.d.ts +0 -2
  184. package/server/src/lib/seed/report-management.seed-catalog.js +0 -10
  185. package/server/src/lib/seed/report-management.seed-catalog.js.map +0 -1
  186. package/server/src/lib/seed/samples/employee-report.mock.d.ts +0 -9
  187. package/server/src/lib/seed/samples/employee-report.mock.js +0 -322
  188. package/server/src/lib/seed/samples/employee-report.mock.js.map +0 -1
  189. package/server/src/lib/seed/samples/index.d.ts +0 -2
  190. package/server/src/lib/seed/samples/index.js +0 -6
  191. package/server/src/lib/seed/samples/index.js.map +0 -1
  192. package/server/src/lib/seed/samples/location-report.mock.d.ts +0 -9
  193. package/server/src/lib/seed/samples/location-report.mock.js +0 -339
  194. package/server/src/lib/seed/samples/location-report.mock.js.map +0 -1
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
6
  const core_1 = require("@acorex-platform/framework-server/core");
7
7
  const report_1 = require("@acorex-platform/framework-server/report");
8
+ const core_2 = require("@acorex-platform/framework-shared/core");
8
9
  //#region ---- Report browse service ----
9
10
  let ReportBrowseService = class ReportBrowseService {
10
11
  constructor(storage) {
@@ -32,7 +33,7 @@ let ReportBrowseService = class ReportBrowseService {
32
33
  }
33
34
  getReportDefinition(reportId) {
34
35
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- const report = (yield this.storage.getOne(report_1.REPORT_ENTITY, reportId));
36
+ const report = yield (0, report_1.loadReportDefinitionById)(this.storage, reportId);
36
37
  if (!report) {
37
38
  throw new common_1.NotFoundException(`Report with ID ${reportId} not found`);
38
39
  }
@@ -44,11 +45,12 @@ let ReportBrowseService = class ReportBrowseService {
44
45
  var _a, _b;
45
46
  const [categoriesResult, reportsResult] = yield Promise.all([
46
47
  this.storage.query(report_1.REPORT_CATEGORY_ENTITY, { skip: 0, take: 10000 }),
47
- this.storage.query(report_1.REPORT_ENTITY, { skip: 0, take: 10000 })
48
+ this.storage.query(report_1.REPORT_ENTITY, { skip: 0, take: 10000 }),
48
49
  ]);
49
50
  return {
50
- categories: ((_a = categoriesResult.items) !== null && _a !== void 0 ? _a : []),
51
- reports: ((_b = reportsResult.items) !== null && _b !== void 0 ? _b : []),
51
+ // Defense: bootstrap used to insert duplicate business ids; keep one per id.
52
+ categories: dedupeById(((_a = categoriesResult.items) !== null && _a !== void 0 ? _a : [])),
53
+ reports: dedupeById(((_b = reportsResult.items) !== null && _b !== void 0 ? _b : [])),
52
54
  };
53
55
  });
54
56
  }
@@ -89,10 +91,11 @@ let ReportBrowseService = class ReportBrowseService {
89
91
  };
90
92
  }
91
93
  mapReportToApiResponse(report) {
92
- var _a, _b, _c, _d, _e, _f, _g;
93
- const title = String((_a = report['title']) !== null && _a !== void 0 ? _a : '');
94
- const parameterGroups = (_b = report['parameterGroups']) !== null && _b !== void 0 ? _b : [];
95
- const layouts = ((_c = report['layouts']) !== null && _c !== void 0 ? _c : []).map((layout) => (Object.assign(Object.assign({}, layout), { dataSource: layout.dataSource
94
+ var _a, _b, _c, _d, _e, _f;
95
+ const title = asCatalogText(report['title']);
96
+ const description = asCatalogText(report['description']);
97
+ const parameterGroups = (_a = report['parameterGroups']) !== null && _a !== void 0 ? _a : [];
98
+ const layouts = ((_b = report['layouts']) !== null && _b !== void 0 ? _b : []).map((layout) => (Object.assign(Object.assign({}, layout), { dataSource: layout.dataSource
96
99
  ? {
97
100
  type: layout.dataSource.type,
98
101
  name: layout.dataSource.name,
@@ -102,14 +105,15 @@ let ReportBrowseService = class ReportBrowseService {
102
105
  }
103
106
  : undefined })));
104
107
  return {
105
- id: String((_d = report['id']) !== null && _d !== void 0 ? _d : ''),
108
+ id: String((_c = report['id']) !== null && _c !== void 0 ? _c : ''),
106
109
  name: toApiName(title),
107
110
  title,
108
- description: (_e = report['description']) !== null && _e !== void 0 ? _e : null,
109
- categoryIds: (_f = report['categoryIds']) !== null && _f !== void 0 ? _f : [],
111
+ description: description === '' ? null : description,
112
+ categoryIds: (_d = report['categoryIds']) !== null && _d !== void 0 ? _d : [],
110
113
  parameterGroups,
111
114
  layouts,
112
- defaultLayoutId: String((_g = report['defaultLayoutId']) !== null && _g !== void 0 ? _g : ''),
115
+ defaultLayoutId: String((_e = report['defaultLayoutId']) !== null && _e !== void 0 ? _e : ''),
116
+ generation: (_f = report['generation']) !== null && _f !== void 0 ? _f : undefined,
113
117
  };
114
118
  }
115
119
  };
@@ -118,11 +122,26 @@ exports.ReportBrowseService = ReportBrowseService = tslib_1.__decorate([
118
122
  (0, common_1.Injectable)(),
119
123
  tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService])
120
124
  ], ReportBrowseService);
125
+ function asCatalogText(value) {
126
+ return (0, core_2.coerceUnknownToMultiLanguageString)(value);
127
+ }
121
128
  function toApiName(title) {
122
- return title
129
+ return (0, report_1.resolveDisplayTitle)(title)
123
130
  .toLowerCase()
124
131
  .replace(/[^a-z0-9]+/g, '_')
125
132
  .replace(/^_|_$/g, '');
126
133
  }
134
+ function dedupeById(items) {
135
+ const seen = new Set();
136
+ const result = [];
137
+ for (const item of items) {
138
+ if (!(item === null || item === void 0 ? void 0 : item.id) || seen.has(item.id)) {
139
+ continue;
140
+ }
141
+ seen.add(item.id);
142
+ result.push(item);
143
+ }
144
+ return result;
145
+ }
127
146
  //#endregion
128
147
  //# sourceMappingURL=report-browse.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-browse.service.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA+D;AAC/D,iEAAwF;AACxF,qEAAiG;AAUjG,yCAAyC;AAGlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,OAAuC;QAAvC,YAAO,GAAP,OAAO,CAAgC;IAAG,CAAC;IAElE,kBAAkB;qEAAC,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI;YAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;YAE7C,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACnC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CACrF,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;QAC7C,CAAC;KAAA;IAEK,eAAe,CAAC,UAAkB;;YACtC,MAA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U;oBACxC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU;iBACzC;gBACH,CAAC,CAAC,SAAS,IACb,CACH,CAAC;QAEF,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,MAAA,MAAM,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;YAC9B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC;YACtB,KAAK;YACL,WAAW,EAAE,MAAC,MAAM,CAAC,aAAa,CAAwB,mCAAI,IAAI;YAClE,WAAW,EAAE,MAAC,MAAM,CAAC,aAAa,CAAc,mCAAI,EAAE;YACtD,eAAe;YACf,OAAO;YACP,eAAe,EAAE,MAAM,CAAC,MAAA,MAAM,CAAC,iBAAiB,CAAC,mCAAI,EAAE,CAAC;SACzD,CAAC;IACJ,CAAC;CACF,CAAA;AAhIY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;6CAE2B,qCAA8B;GADzD,mBAAmB,CAgI/B;AAsBD,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,YAAY"}
1
+ {"version":3,"file":"report-browse.service.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA+D;AAC/D,iEAAwF;AACxF,qEAKkD;AAClD,iEAGgD;AAUhD,yCAAyC;AAGlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,OAAuC;QAAvC,YAAO,GAAP,OAAO,CAAgC;IAAG,CAAC;IAElE,kBAAkB;qEAAC,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI;YAC5C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;YACrD,MA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B,IAAA,mBAAU,GAAE;6CAE2B,qCAA8B;GADzD,mBAAmB,CAoI/B;AAsBD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,IAAA,yCAAkC,EAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,IAAA,4BAAmB,EAAC,KAAK,CAAC;SAC9B,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,UAAU,CAA2B,KAAU;IACtD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACnC,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,YAAY"}
@@ -1,3 +1,4 @@
1
+ import type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';
1
2
  export interface ReportCategoryApiResponse {
2
3
  totalCount: number;
3
4
  items: ReportCategoryApiItem[];
@@ -5,8 +6,8 @@ export interface ReportCategoryApiResponse {
5
6
  export interface ReportCategoryApiItem {
6
7
  id: string;
7
8
  name: string;
8
- title: string;
9
- description: string | null;
9
+ title: AXPMultiLanguageString;
10
+ description: AXPMultiLanguageString | null;
10
11
  reportCategoryParentId: string | null;
11
12
  folderCount: number;
12
13
  itemCount: number;
@@ -17,31 +18,44 @@ export interface ReportCategoryApiItem {
17
18
  export interface ReportDefinitionApiItem {
18
19
  id: string;
19
20
  name: string;
20
- title: string;
21
- description: string | null;
21
+ title: AXPMultiLanguageString;
22
+ description: AXPMultiLanguageString | null;
22
23
  categoryIds: string[];
23
24
  isArchived: boolean;
24
25
  }
25
26
  export interface ReportDefinitionApiResponse {
26
27
  id: string;
27
28
  name: string;
28
- title: string;
29
- description: string | null;
29
+ title: AXPMultiLanguageString;
30
+ description: AXPMultiLanguageString | null;
30
31
  categoryIds: string[];
31
32
  parameterGroups: ReportParameterGroupApi[];
32
33
  layouts: ReportLayoutDefinitionApi[];
33
34
  defaultLayoutId: string;
35
+ generation?: {
36
+ mode?: 'interactive' | 'background' | 'choose';
37
+ formats?: Array<'viewer' | 'pdf' | 'excel' | 'csv'>;
38
+ executionTimeoutMs?: number;
39
+ retentionDays?: number;
40
+ freezeLayouts?: 'current' | 'all';
41
+ pinDefinition?: boolean;
42
+ };
34
43
  }
35
44
  export interface ReportParameterGroupApi {
36
45
  name: string;
37
- title: string;
38
- description?: string;
46
+ title: AXPMultiLanguageString;
47
+ description?: AXPMultiLanguageString;
39
48
  parameters: ReportParameterApi[];
40
49
  }
41
50
  export interface ReportParameterApi {
42
51
  path: string;
43
- title: string;
44
- description?: string;
52
+ title: AXPMultiLanguageString;
53
+ description?: AXPMultiLanguageString;
54
+ /**
55
+ * Boolean or expression (e.g. `{{ permission.check("…") }}`).
56
+ * Evaluated by the Report Viewer / layout renderer.
57
+ */
58
+ visible?: boolean | string;
45
59
  widget: {
46
60
  type: string;
47
61
  path?: string | null;
@@ -51,8 +65,9 @@ export interface ReportParameterApi {
51
65
  }
52
66
  export interface ReportLayoutDefinitionApi {
53
67
  id: string;
54
- title: string;
55
- description?: string;
68
+ title: AXPMultiLanguageString;
69
+ description?: AXPMultiLanguageString;
70
+ icon?: string;
56
71
  layout: unknown;
57
72
  dataSource?: {
58
73
  type: string;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- //#region ---- Report browse API DTOs (connectivity/api contract) ----
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  //#endregion
5
4
  //# sourceMappingURL=report-browse.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-browse.types.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.types.ts"],"names":[],"mappings":";AAAA,sEAAsE;;AA2EtE,YAAY"}
1
+ {"version":3,"file":"report-browse.types.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-browse.types.ts"],"names":[],"mappings":";;AA2FA,YAAY"}
@@ -0,0 +1,15 @@
1
+ import type { JqlSeedEntityTarget, JqlSeedProvider, JqlSeedResolveContext } from '@acorex-platform/framework-server/jql/seed';
2
+ import { BackendReportDefinitionRegistry } from '@acorex-platform/framework-server/report';
3
+ /**
4
+ * Seeds built-in report categories and definitions in the JQL `data` phase,
5
+ * after entity schemas are registered — same pipeline as other entity catalogs.
6
+ */
7
+ export declare class ReportDefinitionSeedProvider implements JqlSeedProvider {
8
+ private readonly registry;
9
+ readonly name = "report-definitions";
10
+ readonly phase: "data";
11
+ readonly moduleName = "report-management";
12
+ readonly tags: string[];
13
+ constructor(registry: BackendReportDefinitionRegistry);
14
+ resolve(_context: JqlSeedResolveContext): Promise<readonly JqlSeedEntityTarget[]>;
15
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportDefinitionSeedProvider = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const report_1 = require("@acorex-platform/framework-server/report");
7
+ //#region ----- Report definition JQL seed -----
8
+ /**
9
+ * Seeds built-in report categories and definitions in the JQL `data` phase,
10
+ * after entity schemas are registered — same pipeline as other entity catalogs.
11
+ */
12
+ let ReportDefinitionSeedProvider = class ReportDefinitionSeedProvider {
13
+ constructor(registry) {
14
+ this.registry = registry;
15
+ this.name = 'report-definitions';
16
+ this.phase = 'data';
17
+ this.moduleName = 'report-management';
18
+ this.tags = ['pack', 'core', 'reports'];
19
+ }
20
+ resolve(_context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const { categories, definitions } = this.registry.collectSeedRows();
23
+ return [
24
+ {
25
+ key: 'report-management/ReportCategoryDataSeeder',
26
+ name: 'ReportCategoryDataSeeder',
27
+ moduleName: this.moduleName,
28
+ providerName: this.name,
29
+ phase: 'data',
30
+ kind: 'entity',
31
+ jqlInstance: 'storage',
32
+ target: report_1.REPORT_CATEGORY_ENTITY,
33
+ records: categories,
34
+ mergeType: 'merge',
35
+ uniqueKeys: ['id'],
36
+ tags: [...this.tags],
37
+ },
38
+ {
39
+ key: 'report-management/ReportDataSeeder',
40
+ name: 'ReportDataSeeder',
41
+ moduleName: this.moduleName,
42
+ providerName: this.name,
43
+ phase: 'data',
44
+ kind: 'entity',
45
+ jqlInstance: 'storage',
46
+ target: report_1.REPORT_ENTITY,
47
+ records: definitions,
48
+ mergeType: 'merge',
49
+ uniqueKeys: ['id'],
50
+ tags: [...this.tags],
51
+ dependsOn: ['report-management/ReportCategoryDataSeeder'],
52
+ },
53
+ ];
54
+ });
55
+ }
56
+ };
57
+ exports.ReportDefinitionSeedProvider = ReportDefinitionSeedProvider;
58
+ exports.ReportDefinitionSeedProvider = ReportDefinitionSeedProvider = tslib_1.__decorate([
59
+ (0, common_1.Injectable)(),
60
+ tslib_1.__metadata("design:paramtypes", [report_1.BackendReportDefinitionRegistry])
61
+ ], ReportDefinitionSeedProvider);
62
+ //#endregion
63
+ //# sourceMappingURL=report-definition.seed-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-definition.seed-provider.js","sourceRoot":"","sources":["../../../../../../libs/modules/report-management/server/src/lib/report-definition.seed-provider.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAM5C,qEAIkD;AAElD,gDAAgD;AAEhD;;;GAGG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAMvC,YAA6B,QAAyC;Q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B;IADxC,IAAA,mBAAU,GAAE;6CAO4B,wCAA+B;GAN3D,4BAA4B,CA2CxC;AAED,YAAY"}
@@ -0,0 +1,17 @@
1
+ import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
2
+ import { BackendSessionService, RuntimePermissionService } from '@acorex-platform/framework-server/security';
3
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
4
+ import { type AXPReportGenerationCreateInput, type AXPReportGenerationCreateResult } from '@acorex-platform/module-report-management-client/contracts';
5
+ import { ReportGenerationEnqueueService } from './report-generation-enqueue.service';
6
+ import { ReportGenerationStore } from './report-generation.store';
7
+ import { ReportGenerationSettingsService } from './report-generation-settings.service';
8
+ export declare class ReportGenerationCreateCommand implements AXPCommand<AXPReportGenerationCreateInput, AXPReportGenerationCreateResult> {
9
+ private readonly store;
10
+ private readonly enqueue;
11
+ private readonly session;
12
+ private readonly storage;
13
+ private readonly permissions;
14
+ private readonly generationSettings;
15
+ constructor(store: ReportGenerationStore, enqueue: ReportGenerationEnqueueService, session: BackendSessionService, storage: EntityStorageMiddlewareService, permissions: RuntimePermissionService, generationSettings: ReportGenerationSettingsService);
16
+ execute(input: AXPReportGenerationCreateInput): AXPCommandExecuteResultPromise<AXPReportGenerationCreateResult>;
17
+ }
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportGenerationCreateCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const common_1 = require("@nestjs/common");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const report_1 = require("@acorex-platform/framework-server/report");
9
+ const core_1 = require("@acorex-platform/framework-server/core");
10
+ const security_1 = require("@acorex-platform/framework-server/security");
11
+ const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
12
+ const report_generation_enqueue_service_1 = require("./report-generation-enqueue.service");
13
+ const report_generation_store_1 = require("./report-generation.store");
14
+ const report_generation_constants_1 = require("./report-generation.constants");
15
+ const report_generation_policy_util_1 = require("./report-generation-policy.util");
16
+ const report_generation_settings_service_1 = require("./report-generation-settings.service");
17
+ const report_generation_job_presentation_util_1 = require("./report-generation-job-presentation.util");
18
+ const report_generation_util_1 = require("./report-generation.util");
19
+ function resolveKeepInTrayAfterComplete(generation, mode) {
20
+ if (typeof (generation === null || generation === void 0 ? void 0 : generation.keepInTray) === 'boolean') {
21
+ return generation.keepInTray;
22
+ }
23
+ return mode === 'background' || mode === 'choose';
24
+ }
25
+ //#region ----- Create command -----
26
+ let ReportGenerationCreateCommand = class ReportGenerationCreateCommand {
27
+ constructor(store, enqueue, session, storage, permissions, generationSettings) {
28
+ this.store = store;
29
+ this.enqueue = enqueue;
30
+ this.session = session;
31
+ this.storage = storage;
32
+ this.permissions = permissions;
33
+ this.generationSettings = generationSettings;
34
+ }
35
+ execute(input) {
36
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
38
+ const session = this.session.getSession();
39
+ const tenantId = (_a = session === null || session === void 0 ? void 0 : session.tenantId) === null || _a === void 0 ? void 0 : _a.trim();
40
+ if (!(session === null || session === void 0 ? void 0 : session.userId) || !tenantId) {
41
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
42
+ }
43
+ const reportId = (_b = input.reportId) === null || _b === void 0 ? void 0 : _b.trim();
44
+ if (!reportId) {
45
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_REPORT_NOT_FOUND_ERROR } };
46
+ }
47
+ const reportRow = yield (0, report_1.loadReportDefinitionById)(this.storage, reportId);
48
+ if (!reportRow) {
49
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_REPORT_NOT_FOUND_ERROR } };
50
+ }
51
+ const report = reportRow;
52
+ const reportPermissions = (_c = report.permissions) !== null && _c !== void 0 ? _c : [];
53
+ if (reportPermissions.length > 0) {
54
+ const allowed = yield this.permissions.authorize(session.userId, ...reportPermissions);
55
+ if (!allowed) {
56
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_FORBIDDEN_ERROR } };
57
+ }
58
+ }
59
+ const trigger = (_d = input.trigger) !== null && _d !== void 0 ? _d : 'manual';
60
+ const platformSettings = yield this.generationSettings.resolvePlatformSettings();
61
+ const generation = (0, report_generation_util_1.resolveGenerationOptions)(report.generation);
62
+ const formats = ((_e = input.formats) === null || _e === void 0 ? void 0 : _e.length) ? input.formats : generation.formats;
63
+ const layoutIds = (_f = input.layoutIds) === null || _f === void 0 ? void 0 : _f.map((id) => id.trim()).filter(Boolean);
64
+ const layoutId = ((_g = input.layoutId) === null || _g === void 0 ? void 0 : _g.trim()) || (layoutIds === null || layoutIds === void 0 ? void 0 : layoutIds[0]) || undefined;
65
+ if (trigger === 'schedule' && ((_h = input.scheduleId) === null || _h === void 0 ? void 0 : _h.trim())) {
66
+ const activeScheduleRun = yield this.store.findActiveByScheduleId(input.scheduleId.trim());
67
+ if (activeScheduleRun) {
68
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_SCHEDULE_ALREADY_RUNNING_ERROR } };
69
+ }
70
+ }
71
+ if (trigger === 'manual') {
72
+ const maxConcurrent = platformSettings.maxConcurrentPerUser;
73
+ if (maxConcurrent > 0) {
74
+ const activeCount = yield this.store.countActiveManualByUser(session.userId);
75
+ if (activeCount >= maxConcurrent) {
76
+ return { success: false, message: { text: report_generation_constants_1.REPORT_GENERATION_MAX_CONCURRENT_ERROR } };
77
+ }
78
+ }
79
+ }
80
+ const effectiveDedupe = (0, report_generation_policy_util_1.resolveEffectiveDedupe)((_j = report.generation) === null || _j === void 0 ? void 0 : _j.dedupe, platformSettings);
81
+ const fingerprint = (0, report_generation_policy_util_1.buildReportGenerationFingerprint)({
82
+ reportId,
83
+ layoutIds,
84
+ layoutId,
85
+ parameters: (_k = input.parameters) !== null && _k !== void 0 ? _k : {},
86
+ });
87
+ if ((0, report_generation_policy_util_1.isDedupePolicyActive)(effectiveDedupe, trigger)) {
88
+ const activeCandidates = yield this.store.listActiveByUserAndReport(session.userId, reportId);
89
+ let dedupeCandidates = activeCandidates;
90
+ if (effectiveDedupe.policy === 'in-flight-or-cooldown' && effectiveDedupe.cooldownMs > 0) {
91
+ const sinceIso = new Date(Date.now() - effectiveDedupe.cooldownMs).toISOString();
92
+ const completedCandidates = yield this.store.listCompletedSinceByUserAndReport({
93
+ userId: session.userId,
94
+ reportId,
95
+ sinceIso,
96
+ });
97
+ dedupeCandidates = [...activeCandidates, ...completedCandidates];
98
+ }
99
+ const dedupeMatch = (0, report_generation_policy_util_1.findDedupeMatch)({
100
+ fingerprint,
101
+ dedupe: effectiveDedupe,
102
+ candidates: dedupeCandidates,
103
+ });
104
+ if (dedupeMatch) {
105
+ if (input.suppressNotificationOnComplete === true &&
106
+ (dedupeMatch.status === 'queued' || dedupeMatch.status === 'running')) {
107
+ yield this.store.patchAsEngine(dedupeMatch.id, { suppressNotificationOnComplete: true });
108
+ }
109
+ return {
110
+ success: true,
111
+ kind: 'object',
112
+ data: {
113
+ id: dedupeMatch.id,
114
+ jobId: dedupeMatch.jobId,
115
+ status: dedupeMatch.status,
116
+ deduplicated: true,
117
+ },
118
+ };
119
+ }
120
+ }
121
+ const id = (0, node_crypto_1.randomUUID)();
122
+ const row = {
123
+ id,
124
+ reportId,
125
+ layoutId,
126
+ layoutIds: (layoutIds === null || layoutIds === void 0 ? void 0 : layoutIds.length) ? layoutIds : undefined,
127
+ parameters: (_l = input.parameters) !== null && _l !== void 0 ? _l : {},
128
+ formats,
129
+ trigger,
130
+ status: 'queued',
131
+ requestedBy: session.userId,
132
+ scheduleId: input.scheduleId,
133
+ scheduledOccurrence: input.scheduledOccurrence,
134
+ sourceRequestId: input.sourceRequestId,
135
+ suppressNotificationOnComplete: input.suppressNotificationOnComplete === true ? true : undefined,
136
+ artifacts: [],
137
+ };
138
+ yield this.store.insert(row);
139
+ const presentation = (0, report_generation_job_presentation_util_1.buildReportGenerationJobPresentation)(report, layoutId, layoutIds);
140
+ const job = yield this.enqueue.enqueue({
141
+ reportRequestId: id,
142
+ tenantId,
143
+ applicationId: ((_m = session.applicationId) === null || _m === void 0 ? void 0 : _m.trim()) || undefined,
144
+ userId: session.userId,
145
+ trigger: trigger === 'schedule' ? 'schedule' : 'manual',
146
+ executionTimeoutMs: generation.executionTimeoutMs,
147
+ title: presentation.title,
148
+ statusText: presentation.statusText,
149
+ currentStep: presentation.currentStep,
150
+ keepInTrayAfterComplete: resolveKeepInTrayAfterComplete(report.generation, generation.mode),
151
+ });
152
+ yield this.store.patchAsEngine(id, { jobId: job.jobId });
153
+ return {
154
+ success: true,
155
+ kind: 'object',
156
+ data: { id, jobId: job.jobId, status: 'queued', deduplicated: false },
157
+ };
158
+ });
159
+ }
160
+ };
161
+ exports.ReportGenerationCreateCommand = ReportGenerationCreateCommand;
162
+ exports.ReportGenerationCreateCommand = ReportGenerationCreateCommand = tslib_1.__decorate([
163
+ (0, abstract_1.ServerHandler)({
164
+ key: module_report_management_contracts_1.AXMReportManagementCommandKeys.ReportGeneration.Create,
165
+ auth: 'session',
166
+ permissions: [module_report_management_contracts_1.AXPInsightsReportingPermissionKeys.Access],
167
+ }),
168
+ (0, common_1.Injectable)(),
169
+ tslib_1.__metadata("design:paramtypes", [report_generation_store_1.ReportGenerationStore,
170
+ report_generation_enqueue_service_1.ReportGenerationEnqueueService,
171
+ security_1.BackendSessionService,
172
+ core_1.EntityStorageMiddlewareService,
173
+ security_1.RuntimePermissionService,
174
+ report_generation_settings_service_1.ReportGenerationSettingsService])
175
+ ], ReportGenerationCreateCommand);
176
+ //#endregion
177
+ //# sourceMappingURL=report-generation-create.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-generation-create.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-create.command.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC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Trigger } from '@acorex-platform/framework-shared/background-job';
3
+ export declare class ReportGenerationEnqueueService {
4
+ private readonly backgroundJobs;
5
+ constructor(backgroundJobs: BackgroundJobService);
6
+ enqueue(input: {
7
+ reportRequestId: string;
8
+ tenantId: string;
9
+ applicationId?: string;
10
+ userId?: string;
11
+ trigger: Extract<AXPBackgroundJobTrigger, 'manual' | 'schedule' | 'system'>;
12
+ executionTimeoutMs?: number;
13
+ title?: string;
14
+ statusText?: string;
15
+ currentStep?: string;
16
+ keepInTrayAfterComplete?: boolean;
17
+ }): Promise<{
18
+ jobId: string;
19
+ deduplicated?: boolean;
20
+ }>;
21
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportGenerationEnqueueService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const background_job_1 = require("@acorex-platform/framework-server/background-job");
7
+ const module_report_management_contracts_1 = require("@acorex-platform/module-report-management-client/contracts");
8
+ const report_generation_constants_1 = require("./report-generation.constants");
9
+ //#region ----- Enqueue -----
10
+ let ReportGenerationEnqueueService = class ReportGenerationEnqueueService {
11
+ constructor(backgroundJobs) {
12
+ this.backgroundJobs = backgroundJobs;
13
+ }
14
+ enqueue(input) {
15
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ var _a, _b;
17
+ const executionTimeoutMs = (_a = input.executionTimeoutMs) !== null && _a !== void 0 ? _a : report_generation_constants_1.REPORT_GENERATION_DEFAULT_TIMEOUT_MS;
18
+ const title = ((_b = input.title) === null || _b === void 0 ? void 0 : _b.trim()) || 'Generate Report';
19
+ const result = yield this.backgroundJobs.createJob({
20
+ command: {
21
+ key: module_report_management_contracts_1.AXMReportManagementCommandKeys.ReportGeneration.Execute,
22
+ title,
23
+ payload: { reportRequestId: input.reportRequestId },
24
+ },
25
+ providerKey: report_generation_constants_1.REPORT_GENERATION_JOB_PROVIDER_KEY,
26
+ title,
27
+ trigger: input.trigger,
28
+ tenantId: input.tenantId,
29
+ applicationId: input.applicationId,
30
+ userId: input.userId,
31
+ idempotencyKey: `report-generation:${input.reportRequestId}`,
32
+ visibility: 'initiator',
33
+ executionTimeoutMs,
34
+ progress: 0,
35
+ statusText: input.statusText,
36
+ currentStep: input.currentStep,
37
+ capabilities: {
38
+ clickable: true,
39
+ // ReportGenerationNotifyService owns inbox copy (report name + Open Report).
40
+ notifyOnComplete: false,
41
+ notifyOnFailed: false,
42
+ supportsCooperativeCancellation: true,
43
+ supportsProgress: true,
44
+ supportsEstimate: true,
45
+ keepInTrayAfterComplete: input.keepInTrayAfterComplete !== false,
46
+ },
47
+ });
48
+ return { jobId: result.jobId, deduplicated: result.deduplicated };
49
+ });
50
+ }
51
+ };
52
+ exports.ReportGenerationEnqueueService = ReportGenerationEnqueueService;
53
+ exports.ReportGenerationEnqueueService = ReportGenerationEnqueueService = tslib_1.__decorate([
54
+ (0, common_1.Injectable)(),
55
+ tslib_1.__metadata("design:paramtypes", [background_job_1.BackgroundJobService])
56
+ ], ReportGenerationEnqueueService);
57
+ //#endregion
58
+ //# sourceMappingURL=report-generation-enqueue.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-generation-enqueue.service.js","sourceRoot":"","sources":["../../../../../../../libs/modules/report-management/server/src/lib/report-generation/report-generation-enqueue.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,qFAAwF;AAExF,4GAAqG;AACrG,+EAGuC;AAGvC,6BAA6B;AAGtB,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YAA6B,cAAoC;QAApC,mBAAc,GAAd,cAAc,CAAsB;IAAG,CAAC;IAE/D,OAAO,CAAC,KAWb;;;YACC,MAAM,kBAAkB,GAAG,MAAA,KAAK,CAAC,kBAAkB,mCAAI,kEAAoC,CAAC;YAC5F,MAAM,KAAK,GAAG,CAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,IAAI,EAAE,KAAI,iBAAiB,CAAC;YACvD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;gBACjD,OAAO,EAAE;oBACP,GAAG,EAAE,mEAA8B,CAAC,gBAAgB,CAAC,OAAO;oBAC5D,KAAK;oBACL,OAAO,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE;iBACpD;gBACD,WAAW,EAAE,gEAAkC;gBAC/C,KAAK;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,cAAc,EAAE,qBAAqB,KAAK,CAAC,eAAe,EAAE;gBAC5D,UAAU,EAAE,WAAW;gBACvB,kBAAkB;gBAClB,QAAQ,EAAE,CAAC;gBACX,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,YAAY,EAAE;oBACZ,SAAS,EAAE,IAAI;oBACf,6EAA6E;oBAC7E,gBAAgB,EAAE,KAAK;oBACvB,cAAc,EAAE,KAAK;oBACrB,+BAA+B,EAAE,IAAI;oBACrC,gBAAgB,EAAE,IAAI;oBACtB,gBAAgB,EAAE,IAAI;oBACtB,uBAAuB,EAAE,KAAK,CAAC,uBAAuB,KAAK,KAAK;iBACjE;aACF,CAAC,CAAC;YAEH,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;QACpE,CAAC;KAAA;CACF,CAAA;AAjDY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,GAAE;6CAEkC,qCAAoB;GADtD,8BAA8B,CAiD1C;AAED,YAAY"}
@@ -0,0 +1,10 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXPReportGenerationExecuteInput, type AXPReportGenerationExecuteResult } from '@acorex-platform/module-report-management-client/contracts';
3
+ import { ReportGenerationExecuteService } from './report-generation-execute.service';
4
+ import { ReportGenerationStore } from './report-generation.store';
5
+ export declare class ReportGenerationExecuteCommand implements AXPCommand<AXPReportGenerationExecuteInput, AXPReportGenerationExecuteResult> {
6
+ private readonly store;
7
+ private readonly executeService;
8
+ constructor(store: ReportGenerationStore, executeService: ReportGenerationExecuteService);
9
+ execute(input: AXPReportGenerationExecuteInput): AXPCommandExecuteResultPromise<AXPReportGenerationExecuteResult>;
10
+ }