@acorex-platform/module-activity-insight-client 0.0.20

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.
@@ -0,0 +1,262 @@
1
+ const AXMActivityInsightMenuKeys = {
2
+ ActivityInsight: {
3
+ Root: 'ActivityInsight:Menu:Root',
4
+ Events: 'ActivityInsight:Menu:Events',
5
+ Timelines: 'ActivityInsight:Menu:Timelines',
6
+ Policies: 'ActivityInsight:Menu:Policies',
7
+ },
8
+ };
9
+
10
+ /**
11
+ * Insights & Reporting capabilities used by this module.
12
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
13
+ */
14
+ const AXPInsightsReportingPermissionKeys = {
15
+ Access: 'InsightsReporting:Permission:Access',
16
+ MaintainReports: 'InsightsReporting:Permission:MaintainReports',
17
+ MaintainData: 'InsightsReporting:Permission:MaintainData',
18
+ ViewActivityInsight: 'InsightsReporting:Permission:ViewActivityInsight',
19
+ ManageActivityInsight: 'InsightsReporting:Permission:ManageActivityInsight',
20
+ Setup: 'InsightsReporting:Permission:Setup',
21
+ };
22
+ /**
23
+ * @deprecated Prefer {@link AXPInsightsReportingPermissionKeys}.
24
+ * Legacy nested shape kept so existing imports compile during migration.
25
+ */
26
+ const AXMActivityInsightPermissionKeys = {
27
+ ActivityInsight: {
28
+ Events: { View: AXPInsightsReportingPermissionKeys.ViewActivityInsight },
29
+ Timelines: { View: AXPInsightsReportingPermissionKeys.ViewActivityInsight },
30
+ Policies: { Manage: AXPInsightsReportingPermissionKeys.ManageActivityInsight },
31
+ Admin: AXPInsightsReportingPermissionKeys.ManageActivityInsight,
32
+ Management: AXPInsightsReportingPermissionKeys.ManageActivityInsight,
33
+ },
34
+ };
35
+
36
+ var AXPActivityInsightSettings;
37
+ (function (AXPActivityInsightSettings) {
38
+ //#region ---- Tracking Settings ----
39
+ AXPActivityInsightSettings["Enabled"] = "ActivityInsight:Setting:Tracking.Enabled";
40
+ AXPActivityInsightSettings["FlushIntervalMs"] = "ActivityInsight:Setting:Buffer.FlushIntervalMs";
41
+ AXPActivityInsightSettings["MaxBatchSize"] = "ActivityInsight:Setting:Buffer.MaxBatchSize";
42
+ AXPActivityInsightSettings["MaxPayloadBytes"] = "ActivityInsight:Setting:Buffer.MaxPayloadBytes";
43
+ AXPActivityInsightSettings["MaxQueueSize"] = "ActivityInsight:Setting:Buffer.MaxQueueSize";
44
+ AXPActivityInsightSettings["FlushOnVisibilityHidden"] = "ActivityInsight:Setting:Buffer.FlushOnVisibilityHidden";
45
+ AXPActivityInsightSettings["UseBeaconForFinalFlush"] = "ActivityInsight:Setting:Buffer.UseBeaconForFinalFlush";
46
+ //#endregion
47
+ //#region ---- Privacy Settings ----
48
+ AXPActivityInsightSettings["MaskingEnabled"] = "ActivityInsight:Setting:Privacy.MaskingEnabled";
49
+ AXPActivityInsightSettings["SamplingEnabled"] = "ActivityInsight:Setting:Privacy.SamplingEnabled";
50
+ AXPActivityInsightSettings["TrackAiContent"] = "ActivityInsight:Setting:Privacy.TrackAiContent";
51
+ //#endregion
52
+ })(AXPActivityInsightSettings || (AXPActivityInsightSettings = {}));
53
+
54
+ //#region ---- Query Keys ----
55
+ const AXMActivityInsightQueryKeys = {
56
+ ActivityEvent: {
57
+ List: 'ActivityInsight:ActivityEvent:List',
58
+ GetOne: 'ActivityInsight:ActivityEvent:GetOne',
59
+ Aggregate: 'ActivityInsight:ActivityEvent:Aggregate',
60
+ },
61
+ ActivityTimeline: {
62
+ Session: 'ActivityInsight:ActivityTimeline:Session',
63
+ Journey: 'ActivityInsight:ActivityTimeline:Journey',
64
+ Entity: 'ActivityInsight:ActivityTimeline:Entity',
65
+ },
66
+ };
67
+ //#endregion
68
+
69
+ //#region ---- Command Keys ----
70
+ const AXMActivityInsightCommandKeys = {
71
+ ActivityEvent: {
72
+ Export: 'ActivityInsight:ActivityEvent:Export',
73
+ },
74
+ };
75
+ //#endregion
76
+
77
+ //#region ---- Activity insight transport keys ----
78
+ const AXMActivityInsightTransportKeys = {
79
+ Event: {
80
+ BulkIngest: 'ActivityInsight:Event:BulkIngest',
81
+ },
82
+ };
83
+ //#endregion
84
+
85
+ const config = {
86
+ i18n: 'activity-insight',
87
+ };
88
+ const RootConfig = {
89
+ config,
90
+ module: {
91
+ route: 'activity-insight',
92
+ module: 'ActivityInsight',
93
+ name: 'ActivityInsight',
94
+ title: '@activity-insight:module.title',
95
+ icon: 'fa-light fa-chart-network',
96
+ },
97
+ entities: {
98
+ activityEvent: {
99
+ name: 'ActivityEvent',
100
+ title: '@activity-insight:entities.activity-event.title',
101
+ titlePlural: '@activity-insight:entities.activity-event.plural',
102
+ icon: 'fa-light fa-wave-pulse',
103
+ },
104
+ trackingRule: {
105
+ name: 'TrackingRule',
106
+ title: '@activity-insight:entities.tracking-rule.title',
107
+ titlePlural: '@activity-insight:entities.tracking-rule.plural',
108
+ icon: 'fa-light fa-sliders',
109
+ },
110
+ activitySavedView: {
111
+ name: 'ActivitySavedView',
112
+ title: '@activity-insight:entities.saved-view.title',
113
+ titlePlural: '@activity-insight:entities.saved-view.plural',
114
+ icon: 'fa-light fa-bookmark',
115
+ },
116
+ retentionPolicy: {
117
+ name: 'RetentionPolicy',
118
+ title: '@activity-insight:entities.retention-policy.title',
119
+ titlePlural: '@activity-insight:entities.retention-policy.plural',
120
+ icon: 'fa-light fa-calendar-clock',
121
+ },
122
+ maskingPolicy: {
123
+ name: 'MaskingPolicy',
124
+ title: '@activity-insight:entities.masking-policy.title',
125
+ titlePlural: '@activity-insight:entities.masking-policy.plural',
126
+ icon: 'fa-light fa-eye-slash',
127
+ },
128
+ samplingPolicy: {
129
+ name: 'SamplingPolicy',
130
+ title: '@activity-insight:entities.sampling-policy.title',
131
+ titlePlural: '@activity-insight:entities.sampling-policy.plural',
132
+ icon: 'fa-light fa-percent',
133
+ },
134
+ activityDataSource: {
135
+ name: 'ActivityDataSource',
136
+ title: '@activity-insight:entities.data-source.title',
137
+ titlePlural: '@activity-insight:entities.data-source.plural',
138
+ icon: 'fa-light fa-database',
139
+ },
140
+ },
141
+ };
142
+
143
+ const AXMActivityEventNames = {
144
+ Page: {
145
+ Viewed: 'page.viewed',
146
+ },
147
+ Entity: {
148
+ ListOpened: 'entity.list.opened',
149
+ DetailOpened: 'entity.detail.opened',
150
+ FilterApplied: 'entity.filter.applied',
151
+ SearchApplied: 'entity.search.applied',
152
+ SortApplied: 'entity.sort.applied',
153
+ Created: 'entity.created',
154
+ Updated: 'entity.updated',
155
+ Deleted: 'entity.deleted',
156
+ },
157
+ Command: {
158
+ Executed: 'command.executed',
159
+ },
160
+ Query: {
161
+ Executed: 'query.executed',
162
+ },
163
+ Form: {
164
+ Submitted: 'form.submitted',
165
+ ValidationFailed: 'form.validation.failed',
166
+ FieldChanged: 'form.field.changed',
167
+ },
168
+ Ai: {
169
+ ChatStarted: 'ai.chat.started',
170
+ MessageSent: 'ai.message.sent',
171
+ GenerationStarted: 'ai.generation.started',
172
+ GenerationCompleted: 'ai.generation.completed',
173
+ GenerationStopped: 'ai.generation.stopped',
174
+ ImageGenerated: 'ai.image.generated',
175
+ },
176
+ Workflow: {
177
+ ActionOpened: 'workflow.action.opened',
178
+ StepTransitioned: 'workflow.step.transitioned',
179
+ },
180
+ Security: {
181
+ PermissionAdded: 'security.permission.added',
182
+ RoleUpdated: 'security.role.updated',
183
+ },
184
+ Error: {
185
+ Seen: 'error.seen',
186
+ },
187
+ Process: {
188
+ Abandoned: 'process.abandoned',
189
+ },
190
+ };
191
+
192
+ const AXM_DEFAULT_ACTIVITY_BUFFER_CONFIG = {
193
+ flushIntervalMs: 5000,
194
+ maxBatchSize: 50,
195
+ maxPayloadBytes: 48_000,
196
+ finalFlushMaxBytes: 32_000,
197
+ maxQueueSize: 1000,
198
+ retryLimit: 3,
199
+ retryBackoffMs: 1000,
200
+ maxPropertyBytes: 4000,
201
+ flushOnVisibilityHidden: true,
202
+ useBeaconForFinalFlush: true,
203
+ };
204
+
205
+ const AXM_DEFAULT_MASKING_DENYLIST = [
206
+ 'password',
207
+ 'token',
208
+ 'secret',
209
+ 'accessToken',
210
+ 'refreshToken',
211
+ 'authorization',
212
+ 'apiKey',
213
+ 'privateKey',
214
+ 'creditCard',
215
+ ];
216
+ const REDACTED = '***';
217
+ function shouldMaskKey(key, policy) {
218
+ if (!policy?.enabled && policy?.enabled !== undefined) {
219
+ return false;
220
+ }
221
+ const lower = key.toLowerCase();
222
+ if (policy?.allowlist?.length) {
223
+ return !policy.allowlist.some((k) => lower.includes(k.toLowerCase()));
224
+ }
225
+ const denylist = [...AXM_DEFAULT_MASKING_DENYLIST, ...(policy?.denylist ?? [])];
226
+ return denylist.some((k) => lower.includes(k.toLowerCase()));
227
+ }
228
+ function maskActivityProperties(value, policy, depth = 0) {
229
+ if (value == null || depth > 8) {
230
+ return value;
231
+ }
232
+ if (Array.isArray(value)) {
233
+ return value.map((item) => maskActivityProperties(item, policy, depth + 1));
234
+ }
235
+ if (typeof value === 'object') {
236
+ const out = {};
237
+ for (const [key, child] of Object.entries(value)) {
238
+ out[key] = shouldMaskKey(key, policy) ? REDACTED : maskActivityProperties(child, policy, depth + 1);
239
+ }
240
+ return out;
241
+ }
242
+ return value;
243
+ }
244
+ function truncateActivityProperties(properties, maxBytes) {
245
+ if (!properties) {
246
+ return properties;
247
+ }
248
+ const json = JSON.stringify(properties);
249
+ if (json.length <= maxBytes) {
250
+ return properties;
251
+ }
252
+ return { _truncated: true, preview: json.slice(0, maxBytes) };
253
+ }
254
+
255
+ //#region ---- Contracts barrel ----
256
+
257
+ /**
258
+ * Generated bundle index. Do not edit.
259
+ */
260
+
261
+ export { AXMActivityEventNames, AXMActivityInsightCommandKeys, AXMActivityInsightMenuKeys, AXMActivityInsightPermissionKeys, AXMActivityInsightQueryKeys, AXMActivityInsightTransportKeys, AXM_DEFAULT_ACTIVITY_BUFFER_CONFIG, AXM_DEFAULT_MASKING_DENYLIST, AXPActivityInsightSettings, AXPInsightsReportingPermissionKeys, RootConfig, maskActivityProperties, truncateActivityProperties };
262
+ //# sourceMappingURL=acorex-platform-module-activity-insight-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-activity-insight-client-contracts.mjs","sources":["../../../../libs/modules/activity-insight/contracts/src/menu.keys.ts","../../../../libs/modules/activity-insight/contracts/src/permission.keys.ts","../../../../libs/modules/activity-insight/contracts/src/settings.keys.ts","../../../../libs/modules/activity-insight/contracts/src/queries.keys.ts","../../../../libs/modules/activity-insight/contracts/src/commands.keys.ts","../../../../libs/modules/activity-insight/contracts/src/transport.keys.ts","../../../../libs/modules/activity-insight/contracts/src/root-config.ts","../../../../libs/modules/activity-insight/contracts/src/events/activity-event-names.ts","../../../../libs/modules/activity-insight/contracts/src/events/tracking-policy.types.ts","../../../../libs/modules/activity-insight/contracts/src/events/masking.util.ts","../../../../libs/modules/activity-insight/contracts/src/index.ts","../../../../libs/modules/activity-insight/contracts/src/acorex-platform-module-activity-insight-client-contracts.ts"],"sourcesContent":["export const AXMActivityInsightMenuKeys = {\n ActivityInsight: {\n Root: 'ActivityInsight:Menu:Root',\n Events: 'ActivityInsight:Menu:Events',\n Timelines: 'ActivityInsight:Menu:Timelines',\n Policies: 'ActivityInsight:Menu:Policies',\n },\n} as const;\n","/**\n * Insights & Reporting capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPInsightsReportingPermissionKeys = {\n Access: 'InsightsReporting:Permission:Access',\n MaintainReports: 'InsightsReporting:Permission:MaintainReports',\n MaintainData: 'InsightsReporting:Permission:MaintainData',\n ViewActivityInsight: 'InsightsReporting:Permission:ViewActivityInsight',\n ManageActivityInsight: 'InsightsReporting:Permission:ManageActivityInsight',\n Setup: 'InsightsReporting:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPInsightsReportingPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMActivityInsightPermissionKeys = {\n ActivityInsight: {\n Events: { View: AXPInsightsReportingPermissionKeys.ViewActivityInsight },\n Timelines: { View: AXPInsightsReportingPermissionKeys.ViewActivityInsight },\n Policies: { Manage: AXPInsightsReportingPermissionKeys.ManageActivityInsight },\n Admin: AXPInsightsReportingPermissionKeys.ManageActivityInsight,\n Management: AXPInsightsReportingPermissionKeys.ManageActivityInsight,\n },\n} as const;\n","export enum AXPActivityInsightSettings {\n //#region ---- Tracking Settings ----\n\n Enabled = 'ActivityInsight:Setting:Tracking.Enabled',\n FlushIntervalMs = 'ActivityInsight:Setting:Buffer.FlushIntervalMs',\n MaxBatchSize = 'ActivityInsight:Setting:Buffer.MaxBatchSize',\n MaxPayloadBytes = 'ActivityInsight:Setting:Buffer.MaxPayloadBytes',\n MaxQueueSize = 'ActivityInsight:Setting:Buffer.MaxQueueSize',\n FlushOnVisibilityHidden = 'ActivityInsight:Setting:Buffer.FlushOnVisibilityHidden',\n UseBeaconForFinalFlush = 'ActivityInsight:Setting:Buffer.UseBeaconForFinalFlush',\n\n //#endregion\n\n //#region ---- Privacy Settings ----\n\n MaskingEnabled = 'ActivityInsight:Setting:Privacy.MaskingEnabled',\n SamplingEnabled = 'ActivityInsight:Setting:Privacy.SamplingEnabled',\n TrackAiContent = 'ActivityInsight:Setting:Privacy.TrackAiContent',\n\n //#endregion\n}\n","//#region ---- Query Keys ----\n\nexport const AXMActivityInsightQueryKeys = {\n ActivityEvent: {\n List: 'ActivityInsight:ActivityEvent:List',\n GetOne: 'ActivityInsight:ActivityEvent:GetOne',\n Aggregate: 'ActivityInsight:ActivityEvent:Aggregate',\n },\n ActivityTimeline: {\n Session: 'ActivityInsight:ActivityTimeline:Session',\n Journey: 'ActivityInsight:ActivityTimeline:Journey',\n Entity: 'ActivityInsight:ActivityTimeline:Entity',\n },\n} as const;\n\n//#endregion\n","//#region ---- Command Keys ----\n\nexport const AXMActivityInsightCommandKeys = {\n ActivityEvent: {\n Export: 'ActivityInsight:ActivityEvent:Export',\n },\n} as const;\n\n//#endregion\n","//#region ---- Activity insight transport keys ----\n\nexport const AXMActivityInsightTransportKeys = {\n Event: {\n BulkIngest: 'ActivityInsight:Event:BulkIngest',\n },\n} as const;\n\n//#endregion\n","const config = {\n i18n: 'activity-insight',\n};\n\nexport const RootConfig = {\n config,\n module: {\n route: 'activity-insight',\n module: 'ActivityInsight',\n name: 'ActivityInsight',\n title: '@activity-insight:module.title',\n icon: 'fa-light fa-chart-network',\n },\n entities: {\n activityEvent: {\n name: 'ActivityEvent',\n title: '@activity-insight:entities.activity-event.title',\n titlePlural: '@activity-insight:entities.activity-event.plural',\n icon: 'fa-light fa-wave-pulse',\n },\n trackingRule: {\n name: 'TrackingRule',\n title: '@activity-insight:entities.tracking-rule.title',\n titlePlural: '@activity-insight:entities.tracking-rule.plural',\n icon: 'fa-light fa-sliders',\n },\n activitySavedView: {\n name: 'ActivitySavedView',\n title: '@activity-insight:entities.saved-view.title',\n titlePlural: '@activity-insight:entities.saved-view.plural',\n icon: 'fa-light fa-bookmark',\n },\n retentionPolicy: {\n name: 'RetentionPolicy',\n title: '@activity-insight:entities.retention-policy.title',\n titlePlural: '@activity-insight:entities.retention-policy.plural',\n icon: 'fa-light fa-calendar-clock',\n },\n maskingPolicy: {\n name: 'MaskingPolicy',\n title: '@activity-insight:entities.masking-policy.title',\n titlePlural: '@activity-insight:entities.masking-policy.plural',\n icon: 'fa-light fa-eye-slash',\n },\n samplingPolicy: {\n name: 'SamplingPolicy',\n title: '@activity-insight:entities.sampling-policy.title',\n titlePlural: '@activity-insight:entities.sampling-policy.plural',\n icon: 'fa-light fa-percent',\n },\n activityDataSource: {\n name: 'ActivityDataSource',\n title: '@activity-insight:entities.data-source.title',\n titlePlural: '@activity-insight:entities.data-source.plural',\n icon: 'fa-light fa-database',\n },\n },\n} as const;\n","export const AXMActivityEventNames = {\n Page: {\n Viewed: 'page.viewed',\n },\n Entity: {\n ListOpened: 'entity.list.opened',\n DetailOpened: 'entity.detail.opened',\n FilterApplied: 'entity.filter.applied',\n SearchApplied: 'entity.search.applied',\n SortApplied: 'entity.sort.applied',\n Created: 'entity.created',\n Updated: 'entity.updated',\n Deleted: 'entity.deleted',\n },\n Command: {\n Executed: 'command.executed',\n },\n Query: {\n Executed: 'query.executed',\n },\n Form: {\n Submitted: 'form.submitted',\n ValidationFailed: 'form.validation.failed',\n FieldChanged: 'form.field.changed',\n },\n Ai: {\n ChatStarted: 'ai.chat.started',\n MessageSent: 'ai.message.sent',\n GenerationStarted: 'ai.generation.started',\n GenerationCompleted: 'ai.generation.completed',\n GenerationStopped: 'ai.generation.stopped',\n ImageGenerated: 'ai.image.generated',\n },\n Workflow: {\n ActionOpened: 'workflow.action.opened',\n StepTransitioned: 'workflow.step.transitioned',\n },\n Security: {\n PermissionAdded: 'security.permission.added',\n RoleUpdated: 'security.role.updated',\n },\n Error: {\n Seen: 'error.seen',\n },\n Process: {\n Abandoned: 'process.abandoned',\n },\n} as const;\n","import type { AXMActivityEventPriority, AXMActivityEventSeverity } from './activity-event.types';\n\nexport interface AXMActivityTrackingPolicy {\n enabled?: boolean;\n list?: {\n open?: boolean;\n filterApply?: boolean;\n search?: boolean;\n sort?: boolean;\n export?: boolean;\n };\n detail?: {\n open?: boolean;\n tabChange?: boolean;\n };\n form?: {\n createStart?: boolean;\n updateStart?: boolean;\n submit?: boolean;\n validationError?: boolean;\n fieldChange?: {\n enabled?: boolean;\n include?: string[];\n exclude?: string[];\n };\n };\n commands?: Record<string, boolean | { enabled?: boolean; severity?: AXMActivityEventSeverity }>;\n queries?: Record<string, boolean>;\n masking?: {\n fields?: string[];\n };\n sampling?: Record<string, number>;\n}\n\nexport interface AXMActivityMaskingPolicy {\n enabled?: boolean;\n denylist?: string[];\n allowlist?: string[];\n maxPropertyBytes?: number;\n}\n\nexport interface AXMActivitySamplingPolicy {\n rates?: Record<string, number>;\n defaultRate?: number;\n}\n\nexport interface AXMActivityRetentionPolicy {\n enabled?: boolean;\n periodDays?: number;\n}\n\nexport interface AXMActivityProviderConfig {\n provider: 'noop' | 'console' | 'in-memory' | 'elasticsearch' | 'clickhouse' | 'posthog' | 'matomo' | 'custom-rest';\n options?: Record<string, unknown>;\n}\n\nexport interface AXMActivityBufferConfig {\n flushIntervalMs: number;\n maxBatchSize: number;\n maxPayloadBytes: number;\n finalFlushMaxBytes: number;\n maxQueueSize: number;\n retryLimit: number;\n retryBackoffMs: number;\n maxPropertyBytes: number;\n flushOnVisibilityHidden: boolean;\n useBeaconForFinalFlush: boolean;\n}\n\nexport const AXM_DEFAULT_ACTIVITY_BUFFER_CONFIG: AXMActivityBufferConfig = {\n flushIntervalMs: 5000,\n maxBatchSize: 50,\n maxPayloadBytes: 48_000,\n finalFlushMaxBytes: 32_000,\n maxQueueSize: 1000,\n retryLimit: 3,\n retryBackoffMs: 1000,\n maxPropertyBytes: 4000,\n flushOnVisibilityHidden: true,\n useBeaconForFinalFlush: true,\n};\n\nexport interface AXMActivityTrackingRule {\n source: string;\n eventName: string;\n category?: string;\n priority?: AXMActivityEventPriority;\n severity?: AXMActivityEventSeverity;\n samplingRate?: number;\n}\n","import type { AXMActivityMaskingPolicy } from './tracking-policy.types';\n\nexport const AXM_DEFAULT_MASKING_DENYLIST = [\n 'password',\n 'token',\n 'secret',\n 'accessToken',\n 'refreshToken',\n 'authorization',\n 'apiKey',\n 'privateKey',\n 'creditCard',\n] as const;\n\nconst REDACTED = '***';\n\nfunction shouldMaskKey(key: string, policy?: AXMActivityMaskingPolicy): boolean {\n if (!policy?.enabled && policy?.enabled !== undefined) {\n return false;\n }\n const lower = key.toLowerCase();\n if (policy?.allowlist?.length) {\n return !policy.allowlist.some((k) => lower.includes(k.toLowerCase()));\n }\n const denylist = [...AXM_DEFAULT_MASKING_DENYLIST, ...(policy?.denylist ?? [])];\n return denylist.some((k) => lower.includes(k.toLowerCase()));\n}\n\nexport function maskActivityProperties(\n value: unknown,\n policy?: AXMActivityMaskingPolicy,\n depth = 0,\n): unknown {\n if (value == null || depth > 8) {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map((item) => maskActivityProperties(item, policy, depth + 1));\n }\n if (typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n out[key] = shouldMaskKey(key, policy) ? REDACTED : maskActivityProperties(child, policy, depth + 1);\n }\n return out;\n }\n return value;\n}\n\nexport function truncateActivityProperties(\n properties: Record<string, unknown> | undefined,\n maxBytes: number,\n): Record<string, unknown> | undefined {\n if (!properties) {\n return properties;\n }\n const json = JSON.stringify(properties);\n if (json.length <= maxBytes) {\n return properties;\n }\n return { _truncated: true, preview: json.slice(0, maxBytes) };\n}\n","//#region ---- Contracts barrel ----\n\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\nexport * from './queries.keys';\nexport * from './commands.keys';\nexport * from './transport.keys';\nexport * from './dto';\nexport * from './root-config';\nexport * from './events/activity-event.types';\nexport * from './events/activity-event-names';\nexport * from './events/tracking-policy.types';\nexport * from './events/masking.util';\n\n//#endregion\n\n// Entity layout factories live in server; keep barrel as empty module for compatibility.\nexport {};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,0BAA0B,GAAG;AACxC,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,MAAM,EAAE,6BAA6B;AACrC,QAAA,SAAS,EAAE,gCAAgC;AAC3C,QAAA,QAAQ,EAAE,+BAA+B;AAC1C,KAAA;;;ACNH;;;AAGG;AACI,MAAM,kCAAkC,GAAG;AAChD,IAAA,MAAM,EAAE,qCAAqC;AAC7C,IAAA,eAAe,EAAE,8CAA8C;AAC/D,IAAA,YAAY,EAAE,2CAA2C;AACzD,IAAA,mBAAmB,EAAE,kDAAkD;AACvE,IAAA,qBAAqB,EAAE,oDAAoD;AAC3E,IAAA,KAAK,EAAE,oCAAoC;;AAG7C;;;AAGG;AACI,MAAM,gCAAgC,GAAG;AAC9C,IAAA,eAAe,EAAE;AACf,Q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