@acorex-platform/module-system-insight-client 0.0.32 → 0.0.37

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 (91) hide show
  1. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-alert-rule.mjs +163 -0
  2. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-alert-rule.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-audit-log.mjs +741 -0
  4. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-audit-log.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-dashboard-widget-config.mjs +161 -0
  6. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-dashboard-widget-config.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-error-event.mjs +365 -0
  8. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-error-event.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-http-request-log.mjs +439 -0
  10. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-http-request-log.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-job-execution-log.mjs +445 -0
  12. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-job-execution-log.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-log-entry.mjs +730 -0
  14. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-log-entry.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-metric-point.mjs +290 -0
  16. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-metric-point.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-observability-data-source.mjs +161 -0
  18. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-observability-data-source.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-retention-policy.mjs +182 -0
  20. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-retention-policy.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-saved-view.mjs +162 -0
  22. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-saved-view.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-slow-request.mjs +312 -0
  24. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-slow-request.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-trace-entry.mjs +539 -0
  26. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-trace-entry.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-trace-span.mjs +304 -0
  28. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entities-trace-span.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-acorex-platform-module-system-insight-client-contracts-entity-catalog-L_KQ_ZRS.mjs +135 -0
  30. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-acorex-platform-module-system-insight-client-contracts-entity-catalog-L_KQ_ZRS.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-alert-rule.entity-CVQ8zi2n.mjs +43 -0
  32. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-alert-rule.entity-CVQ8zi2n.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-audit-log.entity-DUUbh-K4.mjs +638 -0
  34. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-audit-log.entity-DUUbh-K4.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-commands.keys-yv865ABJ.mjs +20 -0
  36. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-commands.keys-yv865ABJ.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-dashboard-widget-config.entity-CQPGHj3-.mjs +58 -0
  38. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-dashboard-widget-config.entity-CQPGHj3-.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-error-event.entity-41bQET9n.mjs +203 -0
  40. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-error-event.entity-41bQET9n.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-http-request-log.entity-DuUG39be.mjs +277 -0
  42. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-http-request-log.entity-DuUG39be.mjs.map +1 -0
  43. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-job-execution-log.entity-DjScVny4.mjs +283 -0
  44. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-job-execution-log.entity-DjScVny4.mjs.map +1 -0
  45. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-log-entry.entity-KhwOnohn.mjs +533 -0
  46. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-log-entry.entity-KhwOnohn.mjs.map +1 -0
  47. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-metric-point.entity-kfxxSxvp.mjs +128 -0
  48. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-metric-point.entity-kfxxSxvp.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-observability-data-source.entity-BM0wTN3C.mjs +58 -0
  50. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-observability-data-source.entity-BM0wTN3C.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-queries.keys-C768fZe1.mjs +45 -0
  52. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-queries.keys-C768fZe1.mjs.map +1 -0
  53. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-retention-policy.entity-BU_FXy6_.mjs +79 -0
  54. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-retention-policy.entity-BU_FXy6_.mjs.map +1 -0
  55. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-saved-view.entity-BhhIVSRT.mjs +59 -0
  56. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-saved-view.entity-BhhIVSRT.mjs.map +1 -0
  57. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-settings.keys-CI-iHRBX.mjs +38 -0
  58. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-settings.keys-CI-iHRBX.mjs.map +1 -0
  59. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-slow-request.entity-CdQongZo.mjs +150 -0
  60. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-slow-request.entity-CdQongZo.mjs.map +1 -0
  61. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-trace-entry.entity-B_B8zT6c.mjs +342 -0
  62. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-trace-entry.entity-B_B8zT6c.mjs.map +1 -0
  63. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-trace-span.entity-BJGn3-6F.mjs +142 -0
  64. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog-trace-span.entity-BJGn3-6F.mjs.map +1 -0
  65. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog.mjs +2 -0
  66. package/fesm2022/acorex-platform-module-system-insight-client-contracts-entity-catalog.mjs.map +1 -0
  67. package/fesm2022/acorex-platform-module-system-insight-client-contracts.mjs.map +1 -1
  68. package/fesm2022/{acorex-platform-module-system-insight-client-index-D-Sy2f4K.mjs → acorex-platform-module-system-insight-client-index-CeO40uWE.mjs} +2 -2
  69. package/fesm2022/{acorex-platform-module-system-insight-client-index-D-Sy2f4K.mjs.map → acorex-platform-module-system-insight-client-index-CeO40uWE.mjs.map} +1 -1
  70. package/fesm2022/acorex-platform-module-system-insight-client-local-entities.mjs +42 -0
  71. package/fesm2022/acorex-platform-module-system-insight-client-local-entities.mjs.map +1 -0
  72. package/fesm2022/acorex-platform-module-system-insight-client-open-trace-timeline.command-DPbr-AYZ.mjs.map +1 -1
  73. package/fesm2022/acorex-platform-module-system-insight-client.mjs +2 -2
  74. package/fesm2022/acorex-platform-module-system-insight-client.mjs.map +1 -1
  75. package/package.json +65 -1
  76. package/types/acorex-platform-module-system-insight-client-contracts-entities-alert-rule.d.ts +5 -0
  77. package/types/acorex-platform-module-system-insight-client-contracts-entities-audit-log.d.ts +5 -0
  78. package/types/acorex-platform-module-system-insight-client-contracts-entities-dashboard-widget-config.d.ts +5 -0
  79. package/types/acorex-platform-module-system-insight-client-contracts-entities-error-event.d.ts +5 -0
  80. package/types/acorex-platform-module-system-insight-client-contracts-entities-http-request-log.d.ts +5 -0
  81. package/types/acorex-platform-module-system-insight-client-contracts-entities-job-execution-log.d.ts +5 -0
  82. package/types/acorex-platform-module-system-insight-client-contracts-entities-log-entry.d.ts +5 -0
  83. package/types/acorex-platform-module-system-insight-client-contracts-entities-metric-point.d.ts +5 -0
  84. package/types/acorex-platform-module-system-insight-client-contracts-entities-observability-data-source.d.ts +5 -0
  85. package/types/acorex-platform-module-system-insight-client-contracts-entities-retention-policy.d.ts +5 -0
  86. package/types/acorex-platform-module-system-insight-client-contracts-entities-saved-view.d.ts +5 -0
  87. package/types/acorex-platform-module-system-insight-client-contracts-entities-slow-request.d.ts +5 -0
  88. package/types/acorex-platform-module-system-insight-client-contracts-entities-trace-entry.d.ts +5 -0
  89. package/types/acorex-platform-module-system-insight-client-contracts-entities-trace-span.d.ts +5 -0
  90. package/types/acorex-platform-module-system-insight-client-contracts-entity-catalog.d.ts +10 -0
  91. package/types/acorex-platform-module-system-insight-client-local-entities.d.ts +12 -0
@@ -0,0 +1,730 @@
1
+ import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
2
+ import { AXPEntityCommandScope, AXPEntityQueryType, createAllQueryView, createQueryView } from '@acorex-platform/framework-shared/entity';
3
+
4
+ //#region ---- Command Keys ----
5
+ const AXMSystemInsightCommandKeys = {
6
+ LogEntry: {
7
+ Export: 'SystemInsight:LogEntry:Export',
8
+ Clear: 'SystemInsight:LogEntry:Clear',
9
+ },
10
+ AlertRule: {
11
+ CreateFromFilter: 'SystemInsight:AlertRule:CreateFromFilter',
12
+ },
13
+ Notification: {
14
+ SendAlert: 'SystemInsight:Notification:SendAlert',
15
+ },
16
+ Trace: {
17
+ OpenTimeline: 'SystemInsight:Trace:OpenTimeline',
18
+ },
19
+ };
20
+ //#endregion
21
+
22
+ /**
23
+ * Administration capabilities used by this module.
24
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
25
+ */
26
+ const AXPAdministrationPermissionKeys = {
27
+ Access: 'Administration:Permission:Access',
28
+ MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',
29
+ ManageSessions: 'Administration:Permission:ManageSessions',
30
+ MaintainPolicies: 'Administration:Permission:MaintainPolicies',
31
+ ViewIntegrations: 'Administration:Permission:ViewIntegrations',
32
+ MaintainConnections: 'Administration:Permission:MaintainConnections',
33
+ MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',
34
+ ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',
35
+ ViewRules: 'Administration:Permission:ViewRules',
36
+ MaintainRules: 'Administration:Permission:MaintainRules',
37
+ ManageRuleActions: 'Administration:Permission:ManageRuleActions',
38
+ MaintainAi: 'Administration:Permission:MaintainAi',
39
+ UseAiAssist: 'Administration:Permission:UseAiAssist',
40
+ MaintainDashboards: 'Administration:Permission:MaintainDashboards',
41
+ ViewJobs: 'Administration:Permission:ViewJobs',
42
+ ManageJobActions: 'Administration:Permission:ManageJobActions',
43
+ ViewObservability: 'Administration:Permission:ViewObservability',
44
+ MaintainObservability: 'Administration:Permission:MaintainObservability',
45
+ };
46
+ /**
47
+ * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.
48
+ * Legacy nested shape kept so existing imports compile during migration.
49
+ */
50
+ const AXMSystemInsightPermissionKeys = {
51
+ SystemInsight: {
52
+ Logs: { View: AXPAdministrationPermissionKeys.ViewObservability },
53
+ Traces: { View: AXPAdministrationPermissionKeys.ViewObservability },
54
+ Metrics: { View: AXPAdministrationPermissionKeys.ViewObservability },
55
+ Errors: { View: AXPAdministrationPermissionKeys.ViewObservability },
56
+ Alerts: { Manage: AXPAdministrationPermissionKeys.MaintainObservability },
57
+ SavedViews: { Manage: AXPAdministrationPermissionKeys.MaintainObservability },
58
+ Admin: AXPAdministrationPermissionKeys.MaintainObservability,
59
+ Management: AXPAdministrationPermissionKeys.MaintainObservability,
60
+ AuditLog: {
61
+ Management: AXPAdministrationPermissionKeys.MaintainObservability,
62
+ },
63
+ },
64
+ };
65
+
66
+ //#region ---- Query Keys ----
67
+ const AXMSystemInsightQueryKeys = {
68
+ LogEntry: {
69
+ List: 'SystemInsight:LogEntry:List',
70
+ GetOne: 'SystemInsight:LogEntry:GetOne',
71
+ Aggregate: 'SystemInsight:LogEntry:Aggregate',
72
+ },
73
+ HttpRequestLog: {
74
+ List: 'SystemInsight:HttpRequestLog:List',
75
+ GetOne: 'SystemInsight:HttpRequestLog:GetOne',
76
+ },
77
+ JobExecutionLog: {
78
+ List: 'SystemInsight:JobExecutionLog:List',
79
+ GetOne: 'SystemInsight:JobExecutionLog:GetOne',
80
+ },
81
+ TraceEntry: {
82
+ List: 'SystemInsight:TraceEntry:List',
83
+ GetOne: 'SystemInsight:TraceEntry:GetOne',
84
+ },
85
+ TraceSpan: {
86
+ List: 'SystemInsight:TraceSpan:List',
87
+ GetOne: 'SystemInsight:TraceSpan:GetOne',
88
+ },
89
+ TraceTimeline: {
90
+ Get: 'SystemInsight:TraceTimeline:Get',
91
+ },
92
+ ErrorEvent: {
93
+ List: 'SystemInsight:ErrorEvent:List',
94
+ GetOne: 'SystemInsight:ErrorEvent:GetOne',
95
+ Aggregate: 'SystemInsight:ErrorEvent:Aggregate',
96
+ },
97
+ SlowRequest: {
98
+ List: 'SystemInsight:SlowRequest:List',
99
+ GetOne: 'SystemInsight:SlowRequest:GetOne',
100
+ },
101
+ MetricPoint: {
102
+ List: 'SystemInsight:MetricPoint:List',
103
+ GetOne: 'SystemInsight:MetricPoint:GetOne',
104
+ Range: 'SystemInsight:MetricPoint:Range',
105
+ },
106
+ };
107
+ //#endregion
108
+
109
+ var AXPSystemInsightSettings;
110
+ (function (AXPSystemInsightSettings) {
111
+ //#region ---- Retention Settings ----
112
+ AXPSystemInsightSettings["RetentionEnabled"] = "SystemInsight:Setting:Retention.Enabled";
113
+ AXPSystemInsightSettings["RetentionPeriod"] = "SystemInsight:Setting:Retention.Period";
114
+ AXPSystemInsightSettings["RetentionBatchSize"] = "SystemInsight:Setting:Retention.BatchSize";
115
+ AXPSystemInsightSettings["RetentionPurgeCron"] = "SystemInsight:Setting:Retention.PurgeCron";
116
+ //#endregion
117
+ //#region ---- Critical Error File Fallback ----
118
+ AXPSystemInsightSettings["StorageLocation"] = "SystemInsight:Setting:Storage.Location";
119
+ AXPSystemInsightSettings["CriticalErrorFileEnabled"] = "SystemInsight:Setting:Storage.CriticalErrorFileEnabled";
120
+ //#endregion
121
+ //#region ---- Log Level Settings ----
122
+ AXPSystemInsightSettings["DefaultLogLevel"] = "SystemInsight:Setting:Level.Default";
123
+ //#endregion
124
+ //#region ---- Performance Settings ----
125
+ AXPSystemInsightSettings["AsyncLogging"] = "SystemInsight:Setting:Performance.AsyncEnabled";
126
+ AXPSystemInsightSettings["BatchSize"] = "SystemInsight:Setting:Performance.BatchSize";
127
+ AXPSystemInsightSettings["FlushInterval"] = "SystemInsight:Setting:Performance.FlushInterval";
128
+ AXPSystemInsightSettings["SlowRequestThresholdMs"] = "SystemInsight:Setting:Performance.SlowRequestThresholdMs";
129
+ //#endregion
130
+ })(AXPSystemInsightSettings || (AXPSystemInsightSettings = {}));
131
+ const AXP_SYSTEM_INSIGHT_SETTING_DEFAULTS = {
132
+ [AXPSystemInsightSettings.RetentionEnabled]: true,
133
+ [AXPSystemInsightSettings.RetentionPeriod]: 30,
134
+ [AXPSystemInsightSettings.RetentionBatchSize]: 500,
135
+ [AXPSystemInsightSettings.RetentionPurgeCron]: '0 4 * * *',
136
+ [AXPSystemInsightSettings.StorageLocation]: './logs/acorex',
137
+ [AXPSystemInsightSettings.CriticalErrorFileEnabled]: true,
138
+ [AXPSystemInsightSettings.DefaultLogLevel]: 'info',
139
+ [AXPSystemInsightSettings.AsyncLogging]: true,
140
+ [AXPSystemInsightSettings.BatchSize]: 100,
141
+ [AXPSystemInsightSettings.FlushInterval]: 5000,
142
+ [AXPSystemInsightSettings.SlowRequestThresholdMs]: 500,
143
+ };
144
+
145
+ const config = {
146
+ i18n: 'system-insight',
147
+ };
148
+ const RootConfig = {
149
+ config,
150
+ module: {
151
+ route: 'system-insight',
152
+ module: 'system-insight',
153
+ name: 'SystemInsight',
154
+ title: '@system-insight:module.title',
155
+ icon: 'fa-light fa-monitor-waveform',
156
+ },
157
+ entities: {
158
+ auditLog: {
159
+ name: 'AuditLog',
160
+ title: '@system-insight:logs.entities.audit-log.title',
161
+ titlePlural: '@system-insight:logs.entities.audit-log.plural',
162
+ icon: 'fa-light fa-file-code',
163
+ },
164
+ logEntry: {
165
+ name: 'LogEntry',
166
+ title: '@system-insight:entities.log-entry.title',
167
+ titlePlural: '@system-insight:entities.log-entry.plural',
168
+ icon: 'fa-light fa-file-lines',
169
+ },
170
+ httpRequestLog: {
171
+ name: 'HttpRequestLog',
172
+ title: '@system-insight:entities.http-request-log.title',
173
+ titlePlural: '@system-insight:entities.http-request-log.plural',
174
+ icon: 'fa-light fa-globe',
175
+ },
176
+ jobExecutionLog: {
177
+ name: 'JobExecutionLog',
178
+ title: '@system-insight:entities.job-execution-log.title',
179
+ titlePlural: '@system-insight:entities.job-execution-log.plural',
180
+ icon: 'fa-light fa-clock',
181
+ },
182
+ traceEntry: {
183
+ name: 'TraceEntry',
184
+ title: '@system-insight:entities.trace-entry.title',
185
+ titlePlural: '@system-insight:entities.trace-entry.plural',
186
+ icon: 'fa-light fa-route',
187
+ },
188
+ traceSpan: {
189
+ name: 'TraceSpan',
190
+ title: '@system-insight:entities.trace-span.title',
191
+ titlePlural: '@system-insight:entities.trace-span.plural',
192
+ icon: 'fa-light fa-diagram-project',
193
+ },
194
+ errorEvent: {
195
+ name: 'ErrorEvent',
196
+ title: '@system-insight:entities.error-event.title',
197
+ titlePlural: '@system-insight:entities.error-event.plural',
198
+ icon: 'fa-light fa-circle-exclamation',
199
+ },
200
+ slowRequest: {
201
+ name: 'SlowRequest',
202
+ title: '@system-insight:entities.slow-request.title',
203
+ titlePlural: '@system-insight:entities.slow-request.plural',
204
+ icon: 'fa-light fa-hourglass-half',
205
+ },
206
+ metricPoint: {
207
+ name: 'MetricPoint',
208
+ title: '@system-insight:entities.metric-point.title',
209
+ titlePlural: '@system-insight:entities.metric-point.plural',
210
+ icon: 'fa-light fa-chart-line',
211
+ },
212
+ savedView: {
213
+ name: 'SavedView',
214
+ title: '@system-insight:entities.saved-view.title',
215
+ titlePlural: '@system-insight:entities.saved-view.plural',
216
+ icon: 'fa-light fa-bookmark',
217
+ },
218
+ alertRule: {
219
+ name: 'AlertRule',
220
+ title: '@system-insight:entities.alert-rule.title',
221
+ titlePlural: '@system-insight:entities.alert-rule.plural',
222
+ icon: 'fa-light fa-bell',
223
+ },
224
+ observabilityDataSource: {
225
+ name: 'ObservabilityDataSource',
226
+ title: '@system-insight:entities.observability-data-source.title',
227
+ titlePlural: '@system-insight:entities.observability-data-source.plural',
228
+ icon: 'fa-light fa-database',
229
+ },
230
+ retentionPolicy: {
231
+ name: 'RetentionPolicy',
232
+ title: '@system-insight:entities.retention-policy.title',
233
+ titlePlural: '@system-insight:entities.retention-policy.plural',
234
+ icon: 'fa-light fa-calendar-clock',
235
+ },
236
+ dashboardWidgetConfig: {
237
+ name: 'DashboardWidgetConfig',
238
+ title: '@system-insight:entities.dashboard-widget-config.title',
239
+ titlePlural: '@system-insight:entities.dashboard-widget-config.plural',
240
+ icon: 'fa-light fa-grid-2',
241
+ },
242
+ },
243
+ };
244
+
245
+ const listFieldOptions = {
246
+ filter: { inline: { enabled: true }, advance: { enabled: true } },
247
+ sort: { enabled: true },
248
+ };
249
+ const logLevelDataSource = [
250
+ { id: 'error', title: '@system-insight:logs.settings.level.items.default.options.error' },
251
+ { id: 'warn', title: '@system-insight:logs.settings.level.items.default.options.warn' },
252
+ { id: 'info', title: '@system-insight:logs.settings.level.items.default.options.info' },
253
+ { id: 'debug', title: '@system-insight:logs.settings.level.items.default.options.debug' },
254
+ { id: 'trace', title: '@system-insight:logs.settings.level.items.default.options.trace' },
255
+ ];
256
+ const slowRequestThresholdMs = AXP_SYSTEM_INSIGHT_SETTING_DEFAULTS[AXPSystemInsightSettings.SlowRequestThresholdMs];
257
+ const readOnlyField = {
258
+ readonly: true,
259
+ nullable: true,
260
+ };
261
+ const readOnlyCrud = async () => {
262
+ throw new Error('Observability data is read-only');
263
+ };
264
+ const col = (name, colSpan = 6) => ({
265
+ name,
266
+ layout: { positions: { lg: { colSpan } } },
267
+ });
268
+ async function logEntryEntityFactory() {
269
+ const i18n = RootConfig.config.i18n;
270
+ const properties = [
271
+ {
272
+ name: 'id',
273
+ title: '@system-insight:fields.id',
274
+ groupId: 'event',
275
+ schema: {
276
+ dataType: 'string',
277
+ ...readOnlyField,
278
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
279
+ },
280
+ options: listFieldOptions,
281
+ },
282
+ {
283
+ name: 'timestamp',
284
+ title: '@system-insight:fields.timestamp',
285
+ groupId: 'event',
286
+ schema: {
287
+ dataType: 'datetime',
288
+ ...readOnlyField,
289
+ interface: {
290
+ type: AXPWidgetsList.Editors.DateTimeBox,
291
+ options: { type: 'datetime', readonly: true, disabled: true },
292
+ },
293
+ },
294
+ options: listFieldOptions,
295
+ },
296
+ {
297
+ name: 'level',
298
+ title: '@system-insight:fields.level',
299
+ groupId: 'event',
300
+ schema: {
301
+ dataType: 'string',
302
+ ...readOnlyField,
303
+ interface: {
304
+ type: AXPWidgetsList.Editors.SelectBox,
305
+ options: {
306
+ valueField: 'id',
307
+ textField: 'title',
308
+ dataSource: logLevelDataSource,
309
+ readonly: true,
310
+ disabled: true,
311
+ },
312
+ },
313
+ },
314
+ options: listFieldOptions,
315
+ },
316
+ {
317
+ name: 'severityNumber',
318
+ title: '@system-insight:fields.severity-number',
319
+ groupId: 'event',
320
+ schema: {
321
+ dataType: 'number',
322
+ ...readOnlyField,
323
+ visible: false,
324
+ interface: { type: AXPWidgetsList.Editors.NumberBox, options: { readonly: true, disabled: true } },
325
+ },
326
+ options: { filter: { inline: { enabled: false }, advance: { enabled: true } }, sort: { enabled: true } },
327
+ },
328
+ {
329
+ name: 'message',
330
+ title: '@system-insight:fields.message',
331
+ groupId: 'event',
332
+ schema: {
333
+ dataType: 'string',
334
+ ...readOnlyField,
335
+ interface: {
336
+ type: AXPWidgetsList.Editors.LargeTextBox,
337
+ options: { rows: 3, readonly: true, disabled: true },
338
+ },
339
+ },
340
+ options: listFieldOptions,
341
+ },
342
+ {
343
+ name: 'serviceName',
344
+ title: '@system-insight:fields.service-name',
345
+ groupId: 'event',
346
+ schema: {
347
+ dataType: 'string',
348
+ ...readOnlyField,
349
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
350
+ },
351
+ options: listFieldOptions,
352
+ },
353
+ {
354
+ name: 'source',
355
+ title: '@system-insight:fields.source',
356
+ groupId: 'event',
357
+ schema: {
358
+ dataType: 'string',
359
+ ...readOnlyField,
360
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
361
+ },
362
+ options: listFieldOptions,
363
+ },
364
+ {
365
+ name: 'method',
366
+ title: '@system-insight:fields.method',
367
+ groupId: 'http',
368
+ schema: {
369
+ dataType: 'string',
370
+ ...readOnlyField,
371
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
372
+ },
373
+ options: listFieldOptions,
374
+ },
375
+ {
376
+ name: 'url',
377
+ title: '@system-insight:fields.url',
378
+ groupId: 'http',
379
+ schema: {
380
+ dataType: 'string',
381
+ ...readOnlyField,
382
+ interface: {
383
+ type: AXPWidgetsList.Editors.LargeTextBox,
384
+ options: { rows: 2, readonly: true, disabled: true },
385
+ },
386
+ },
387
+ options: listFieldOptions,
388
+ },
389
+ {
390
+ name: 'statusCode',
391
+ title: '@system-insight:fields.status-code',
392
+ groupId: 'http',
393
+ schema: {
394
+ dataType: 'number',
395
+ ...readOnlyField,
396
+ interface: { type: AXPWidgetsList.Editors.NumberBox, options: { readonly: true, disabled: true } },
397
+ },
398
+ options: listFieldOptions,
399
+ },
400
+ {
401
+ name: 'duration',
402
+ title: '@system-insight:fields.duration',
403
+ groupId: 'http',
404
+ schema: {
405
+ dataType: 'number',
406
+ ...readOnlyField,
407
+ interface: { type: AXPWidgetsList.Editors.NumberBox, options: { readonly: true, disabled: true } },
408
+ },
409
+ options: listFieldOptions,
410
+ },
411
+ {
412
+ name: 'requestId',
413
+ title: '@system-insight:fields.request-id',
414
+ groupId: 'correlation',
415
+ schema: {
416
+ dataType: 'string',
417
+ ...readOnlyField,
418
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
419
+ },
420
+ options: listFieldOptions,
421
+ },
422
+ {
423
+ name: 'traceId',
424
+ title: '@system-insight:fields.trace-id',
425
+ groupId: 'correlation',
426
+ schema: {
427
+ dataType: 'string',
428
+ ...readOnlyField,
429
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
430
+ },
431
+ options: listFieldOptions,
432
+ },
433
+ {
434
+ name: 'spanId',
435
+ title: '@system-insight:fields.span-id',
436
+ groupId: 'correlation',
437
+ schema: {
438
+ dataType: 'string',
439
+ ...readOnlyField,
440
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
441
+ },
442
+ options: listFieldOptions,
443
+ },
444
+ {
445
+ name: 'userId',
446
+ title: '@system-insight:fields.user-id',
447
+ groupId: 'context',
448
+ schema: {
449
+ dataType: 'string',
450
+ ...readOnlyField,
451
+ interface: {
452
+ type: AXPWidgetsList.Editors.LookupBox,
453
+ options: {
454
+ entity: 'SecurityManagement.User',
455
+ textField: 'displayName',
456
+ valueField: 'id',
457
+ look: 'select',
458
+ readonly: true,
459
+ disabled: true,
460
+ expose: [
461
+ { source: 'id', target: 'user.id' },
462
+ { source: 'displayName', target: 'user.displayName' },
463
+ ],
464
+ },
465
+ },
466
+ },
467
+ options: listFieldOptions,
468
+ },
469
+ {
470
+ name: 'tenantId',
471
+ title: '@system-insight:fields.tenant-id',
472
+ groupId: 'context',
473
+ schema: {
474
+ dataType: 'string',
475
+ ...readOnlyField,
476
+ interface: {
477
+ type: AXPWidgetsList.Editors.LookupBox,
478
+ options: {
479
+ entity: 'TenantManagement.Tenant',
480
+ textField: 'title',
481
+ valueField: 'id',
482
+ look: 'select',
483
+ readonly: true,
484
+ disabled: true,
485
+ expose: [
486
+ { source: 'id', target: 'tenant.id' },
487
+ { source: 'title', target: 'tenant.title' },
488
+ ],
489
+ },
490
+ },
491
+ },
492
+ options: listFieldOptions,
493
+ },
494
+ {
495
+ name: 'applicationId',
496
+ title: '@system-insight:fields.application-id',
497
+ groupId: 'context',
498
+ schema: {
499
+ dataType: 'string',
500
+ ...readOnlyField,
501
+ interface: {
502
+ type: AXPWidgetsList.Editors.LookupBox,
503
+ options: {
504
+ entity: 'ApplicationManagement.Application',
505
+ textField: 'title',
506
+ valueField: 'id',
507
+ look: 'select',
508
+ readonly: true,
509
+ disabled: true,
510
+ expose: [
511
+ { source: 'id', target: 'application.id' },
512
+ { source: 'title', target: 'application.title' },
513
+ ],
514
+ },
515
+ },
516
+ },
517
+ options: listFieldOptions,
518
+ },
519
+ {
520
+ name: 'module',
521
+ title: '@system-insight:fields.module',
522
+ groupId: 'context',
523
+ schema: {
524
+ dataType: 'string',
525
+ ...readOnlyField,
526
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
527
+ },
528
+ options: listFieldOptions,
529
+ },
530
+ {
531
+ name: 'entity',
532
+ title: '@system-insight:fields.entity',
533
+ groupId: 'context',
534
+ schema: {
535
+ dataType: 'string',
536
+ ...readOnlyField,
537
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
538
+ },
539
+ options: listFieldOptions,
540
+ },
541
+ {
542
+ name: 'operation',
543
+ title: '@system-insight:fields.operation',
544
+ groupId: 'context',
545
+ schema: {
546
+ dataType: 'string',
547
+ ...readOnlyField,
548
+ interface: { type: AXPWidgetsList.Editors.TextBox, options: { readonly: true, disabled: true } },
549
+ },
550
+ options: listFieldOptions,
551
+ },
552
+ {
553
+ name: 'properties',
554
+ title: '@system-insight:fields.attributes',
555
+ groupId: 'attributes',
556
+ schema: {
557
+ dataType: 'object',
558
+ ...readOnlyField,
559
+ interface: {
560
+ type: AXPWidgetsList.Advanced.JsonViewer,
561
+ options: { disabled: true },
562
+ },
563
+ },
564
+ options: { filter: { inline: { enabled: false }, advance: { enabled: false } }, sort: { enabled: false } },
565
+ },
566
+ ];
567
+ const singleProperties = [
568
+ col('timestamp'),
569
+ col('level'),
570
+ col('serviceName'),
571
+ col('source'),
572
+ col('message', 12),
573
+ col('method'),
574
+ col('statusCode'),
575
+ col('duration'),
576
+ col('url', 12),
577
+ col('requestId'),
578
+ col('traceId'),
579
+ col('spanId', 12),
580
+ col('userId'),
581
+ col('tenantId'),
582
+ col('applicationId'),
583
+ col('module'),
584
+ col('entity'),
585
+ col('operation'),
586
+ col('id', 12),
587
+ col('properties', 12),
588
+ ];
589
+ return {
590
+ module: RootConfig.module.name,
591
+ name: RootConfig.entities.logEntry.name,
592
+ title: RootConfig.entities.logEntry.title,
593
+ icon: RootConfig.entities.logEntry.icon,
594
+ formats: {
595
+ individual: RootConfig.entities.logEntry.title,
596
+ plural: RootConfig.entities.logEntry.titlePlural,
597
+ searchResult: {
598
+ title: '{{ message }}',
599
+ description: '{{ method }} {{ url }}',
600
+ },
601
+ },
602
+ groups: [
603
+ { id: 'event', title: `@${i18n}:groups.event` },
604
+ { id: 'http', title: `@${i18n}:groups.http` },
605
+ { id: 'correlation', title: `@${i18n}:groups.correlation` },
606
+ { id: 'context', title: `@${i18n}:groups.context` },
607
+ { id: 'attributes', title: `@${i18n}:groups.attributes` },
608
+ ],
609
+ plugins: [
610
+ { name: 'trace', options: { enabled: false } },
611
+ { name: 'log', options: { enabled: false } },
612
+ ],
613
+ properties,
614
+ columns: [
615
+ { name: 'timestamp' },
616
+ { name: 'level' },
617
+ { name: 'method' },
618
+ { name: 'statusCode' },
619
+ { name: 'duration' },
620
+ { name: 'message' },
621
+ { name: 'url' },
622
+ { name: 'serviceName' },
623
+ ],
624
+ // list stays on EntityStore → insight Elasticsearch (full history).
625
+ // byKey uses REST so detail includes HTTP fields + attributes (properties).
626
+ queries: {
627
+ byKey: { execute: AXMSystemInsightQueryKeys.LogEntry.GetOne, type: AXPEntityQueryType.Single },
628
+ },
629
+ commands: {
630
+ create: { execute: readOnlyCrud },
631
+ update: { execute: readOnlyCrud },
632
+ delete: { execute: readOnlyCrud },
633
+ export: { execute: AXMSystemInsightCommandKeys.LogEntry.Export },
634
+ clear: {
635
+ execute: AXMSystemInsightCommandKeys.LogEntry.Clear,
636
+ permissions: [AXMSystemInsightPermissionKeys.SystemInsight.Admin],
637
+ },
638
+ createAlertFromFilter: { execute: AXMSystemInsightCommandKeys.AlertRule.CreateFromFilter },
639
+ },
640
+ interfaces: {
641
+ master: {
642
+ list: {
643
+ actions: [
644
+ {
645
+ title: '@general:actions.detail.title',
646
+ icon: 'fa-light fa-eye',
647
+ command: 'Entity:OpenDetails',
648
+ priority: 'primary',
649
+ type: 'view',
650
+ scope: AXPEntityCommandScope.Individual,
651
+ default: true,
652
+ },
653
+ {
654
+ title: `@${i18n}:actions.export.title`,
655
+ command: AXMSystemInsightCommandKeys.LogEntry.Export,
656
+ priority: 'secondary',
657
+ type: 'action',
658
+ scope: AXPEntityCommandScope.TypeLevel,
659
+ },
660
+ {
661
+ title: `@${i18n}:actions.clear-logs.title`,
662
+ command: AXMSystemInsightCommandKeys.LogEntry.Clear,
663
+ priority: 'secondary',
664
+ type: 'action',
665
+ scope: AXPEntityCommandScope.TypeLevel,
666
+ permissions: [AXMSystemInsightPermissionKeys.SystemInsight.Admin],
667
+ color: 'danger',
668
+ icon: 'fa-light fa-trash-can',
669
+ },
670
+ ],
671
+ views: [
672
+ createAllQueryView({
673
+ sorts: [{ name: 'timestamp', dir: 'desc' }],
674
+ }),
675
+ createQueryView('slow', `@${i18n}:entities.log-entry.views.slow.title`, true, {
676
+ conditions: [
677
+ {
678
+ name: 'duration',
679
+ operator: { type: 'greaterThanOrEqual' },
680
+ value: slowRequestThresholdMs,
681
+ },
682
+ ],
683
+ sorts: [{ name: 'timestamp', dir: 'desc' }],
684
+ }),
685
+ ],
686
+ },
687
+ single: {
688
+ title: '{{ message }}',
689
+ sections: [
690
+ { id: 'event' },
691
+ { id: 'http' },
692
+ { id: 'correlation' },
693
+ { id: 'context' },
694
+ { id: 'attributes' },
695
+ ],
696
+ properties: singleProperties,
697
+ actions: [
698
+ {
699
+ title: `@${i18n}:actions.create-alert.title`,
700
+ command: AXMSystemInsightCommandKeys.AlertRule.CreateFromFilter,
701
+ priority: 'secondary',
702
+ type: 'action',
703
+ scope: AXPEntityCommandScope.Individual,
704
+ },
705
+ {
706
+ title: `@${i18n}:actions.view-trace.title`,
707
+ command: AXMSystemInsightCommandKeys.Trace.OpenTimeline,
708
+ priority: 'secondary',
709
+ type: 'view',
710
+ scope: AXPEntityCommandScope.Individual,
711
+ hidden: `{{ !context.eval("traceId") }}`,
712
+ },
713
+ ],
714
+ },
715
+ // Empty update keeps the single page view-only (no editable fields).
716
+ update: {
717
+ sections: [],
718
+ properties: [],
719
+ },
720
+ },
721
+ },
722
+ };
723
+ }
724
+
725
+ /**
726
+ * Generated bundle index. Do not edit.
727
+ */
728
+
729
+ export { logEntryEntityFactory };
730
+ //# sourceMappingURL=acorex-platform-module-system-insight-client-contracts-entities-log-entry.mjs.map