@contractspec/module.audit-trail 1.57.0 → 1.59.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 (36) hide show
  1. package/dist/audit-trail.capability.d.ts +1 -6
  2. package/dist/audit-trail.capability.d.ts.map +1 -1
  3. package/dist/audit-trail.capability.js +17 -20
  4. package/dist/audit-trail.feature.d.ts +1 -6
  5. package/dist/audit-trail.feature.d.ts.map +1 -1
  6. package/dist/audit-trail.feature.js +31 -64
  7. package/dist/browser/audit-trail.capability.js +16 -0
  8. package/dist/browser/audit-trail.feature.js +32 -0
  9. package/dist/browser/contracts/index.js +241 -0
  10. package/dist/browser/entities/index.js +103 -0
  11. package/dist/browser/index.js +474 -0
  12. package/dist/browser/storage/index.js +101 -0
  13. package/dist/contracts/index.d.ts +549 -555
  14. package/dist/contracts/index.d.ts.map +1 -1
  15. package/dist/contracts/index.js +227 -355
  16. package/dist/entities/index.d.ts +70 -75
  17. package/dist/entities/index.d.ts.map +1 -1
  18. package/dist/entities/index.js +100 -122
  19. package/dist/index.d.ts +6 -6
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +474 -5
  22. package/dist/node/audit-trail.capability.js +16 -0
  23. package/dist/node/audit-trail.feature.js +32 -0
  24. package/dist/node/contracts/index.js +241 -0
  25. package/dist/node/entities/index.js +103 -0
  26. package/dist/node/index.js +474 -0
  27. package/dist/node/storage/index.js +101 -0
  28. package/dist/storage/index.d.ts +59 -63
  29. package/dist/storage/index.d.ts.map +1 -1
  30. package/dist/storage/index.js +100 -110
  31. package/package.json +86 -25
  32. package/dist/audit-trail.capability.js.map +0 -1
  33. package/dist/audit-trail.feature.js.map +0 -1
  34. package/dist/contracts/index.js.map +0 -1
  35. package/dist/entities/index.js.map +0 -1
  36. package/dist/storage/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contracts/index.ts"],"mappings":";;;;cAWa,aAAA,4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;;;;;;cAkBjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuB9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBhC,CAAC"}
@@ -1,370 +1,242 @@
1
- import { defineCommand, defineQuery, defineSchemaModel } from "@contractspec/lib.contracts";
1
+ // @bun
2
+ // src/contracts/index.ts
3
+ import {
4
+ defineCommand,
5
+ defineQuery,
6
+ defineSchemaModel
7
+ } from "@contractspec/lib.contracts";
2
8
  import { ScalarTypeEnum, defineEnum } from "@contractspec/lib.schema";
3
-
4
- //#region src/contracts/index.ts
5
- const OWNERS = ["platform.audit-trail"];
6
- const AuditLogModel = defineSchemaModel({
7
- name: "AuditLog",
8
- description: "Detailed audit log entry",
9
- fields: {
10
- id: {
11
- type: ScalarTypeEnum.String_unsecure(),
12
- isOptional: false
13
- },
14
- eventName: {
15
- type: ScalarTypeEnum.String_unsecure(),
16
- isOptional: false
17
- },
18
- eventVersion: {
19
- type: ScalarTypeEnum.String_unsecure(),
20
- isOptional: false
21
- },
22
- payload: {
23
- type: ScalarTypeEnum.JSONObject(),
24
- isOptional: false
25
- },
26
- actorId: {
27
- type: ScalarTypeEnum.String_unsecure(),
28
- isOptional: true
29
- },
30
- actorType: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: true
33
- },
34
- actorEmail: {
35
- type: ScalarTypeEnum.EmailAddress(),
36
- isOptional: true
37
- },
38
- targetId: {
39
- type: ScalarTypeEnum.String_unsecure(),
40
- isOptional: true
41
- },
42
- targetType: {
43
- type: ScalarTypeEnum.String_unsecure(),
44
- isOptional: true
45
- },
46
- orgId: {
47
- type: ScalarTypeEnum.String_unsecure(),
48
- isOptional: true
49
- },
50
- traceId: {
51
- type: ScalarTypeEnum.String_unsecure(),
52
- isOptional: true
53
- },
54
- clientIp: {
55
- type: ScalarTypeEnum.String_unsecure(),
56
- isOptional: true
57
- },
58
- occurredAt: {
59
- type: ScalarTypeEnum.DateTime(),
60
- isOptional: false
61
- },
62
- recordedAt: {
63
- type: ScalarTypeEnum.DateTime(),
64
- isOptional: false
65
- }
66
- }
9
+ var OWNERS = ["platform.audit-trail"];
10
+ var AuditLogModel = defineSchemaModel({
11
+ name: "AuditLog",
12
+ description: "Detailed audit log entry",
13
+ fields: {
14
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
16
+ eventVersion: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
17
+ payload: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
18
+ actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
19
+ actorType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
20
+ actorEmail: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },
21
+ targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
22
+ targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
23
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
24
+ traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ clientIp: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
26
+ occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
27
+ recordedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
28
+ }
67
29
  });
68
- const AuditQueryInputModel = defineSchemaModel({
69
- name: "AuditQueryInput",
70
- description: "Input for querying audit logs",
71
- fields: {
72
- eventName: {
73
- type: ScalarTypeEnum.String_unsecure(),
74
- isOptional: true
75
- },
76
- actorId: {
77
- type: ScalarTypeEnum.String_unsecure(),
78
- isOptional: true
79
- },
80
- targetId: {
81
- type: ScalarTypeEnum.String_unsecure(),
82
- isOptional: true
83
- },
84
- targetType: {
85
- type: ScalarTypeEnum.String_unsecure(),
86
- isOptional: true
87
- },
88
- orgId: {
89
- type: ScalarTypeEnum.String_unsecure(),
90
- isOptional: true
91
- },
92
- traceId: {
93
- type: ScalarTypeEnum.String_unsecure(),
94
- isOptional: true
95
- },
96
- from: {
97
- type: ScalarTypeEnum.DateTime(),
98
- isOptional: true
99
- },
100
- to: {
101
- type: ScalarTypeEnum.DateTime(),
102
- isOptional: true
103
- },
104
- limit: {
105
- type: ScalarTypeEnum.Int_unsecure(),
106
- isOptional: true,
107
- defaultValue: 100
108
- },
109
- offset: {
110
- type: ScalarTypeEnum.Int_unsecure(),
111
- isOptional: true,
112
- defaultValue: 0
113
- }
114
- }
30
+ var AuditQueryInputModel = defineSchemaModel({
31
+ name: "AuditQueryInput",
32
+ description: "Input for querying audit logs",
33
+ fields: {
34
+ eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
35
+ actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
36
+ targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
37
+ targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
38
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
39
+ traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
40
+ from: { type: ScalarTypeEnum.DateTime(), isOptional: true },
41
+ to: { type: ScalarTypeEnum.DateTime(), isOptional: true },
42
+ limit: {
43
+ type: ScalarTypeEnum.Int_unsecure(),
44
+ isOptional: true,
45
+ defaultValue: 100
46
+ },
47
+ offset: {
48
+ type: ScalarTypeEnum.Int_unsecure(),
49
+ isOptional: true,
50
+ defaultValue: 0
51
+ }
52
+ }
115
53
  });
116
- const AuditQueryOutputModel = defineSchemaModel({
117
- name: "AuditQueryOutput",
118
- description: "Output from querying audit logs",
119
- fields: {
120
- logs: {
121
- type: AuditLogModel,
122
- isArray: true,
123
- isOptional: false
124
- },
125
- total: {
126
- type: ScalarTypeEnum.Int_unsecure(),
127
- isOptional: false
128
- },
129
- hasMore: {
130
- type: ScalarTypeEnum.Boolean(),
131
- isOptional: false
132
- }
133
- }
54
+ var AuditQueryOutputModel = defineSchemaModel({
55
+ name: "AuditQueryOutput",
56
+ description: "Output from querying audit logs",
57
+ fields: {
58
+ logs: { type: AuditLogModel, isArray: true, isOptional: false },
59
+ total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
60
+ hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false }
61
+ }
134
62
  });
135
- const ExportFormatEnum = defineEnum("ExportFormat", [
136
- "json",
137
- "csv",
138
- "parquet"
63
+ var ExportFormatEnum = defineEnum("ExportFormat", [
64
+ "json",
65
+ "csv",
66
+ "parquet"
139
67
  ]);
140
- const AuditExportInputModel = defineSchemaModel({
141
- name: "AuditExportInput",
142
- description: "Input for exporting audit logs",
143
- fields: {
144
- orgId: {
145
- type: ScalarTypeEnum.String_unsecure(),
146
- isOptional: false
147
- },
148
- from: {
149
- type: ScalarTypeEnum.DateTime(),
150
- isOptional: false
151
- },
152
- to: {
153
- type: ScalarTypeEnum.DateTime(),
154
- isOptional: false
155
- },
156
- format: {
157
- type: ExportFormatEnum,
158
- isOptional: true,
159
- defaultValue: "json"
160
- },
161
- eventNames: {
162
- type: ScalarTypeEnum.String_unsecure(),
163
- isArray: true,
164
- isOptional: true
165
- }
166
- }
68
+ var AuditExportInputModel = defineSchemaModel({
69
+ name: "AuditExportInput",
70
+ description: "Input for exporting audit logs",
71
+ fields: {
72
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
73
+ from: { type: ScalarTypeEnum.DateTime(), isOptional: false },
74
+ to: { type: ScalarTypeEnum.DateTime(), isOptional: false },
75
+ format: { type: ExportFormatEnum, isOptional: true, defaultValue: "json" },
76
+ eventNames: {
77
+ type: ScalarTypeEnum.String_unsecure(),
78
+ isArray: true,
79
+ isOptional: true
80
+ }
81
+ }
167
82
  });
168
- const ExportStatusEnum = defineEnum("ExportStatus", [
169
- "pending",
170
- "processing",
171
- "completed",
172
- "failed"
83
+ var ExportStatusEnum = defineEnum("ExportStatus", [
84
+ "pending",
85
+ "processing",
86
+ "completed",
87
+ "failed"
173
88
  ]);
174
- const AuditExportOutputModel = defineSchemaModel({
175
- name: "AuditExportOutput",
176
- description: "Output from initiating an audit export",
177
- fields: {
178
- exportId: {
179
- type: ScalarTypeEnum.String_unsecure(),
180
- isOptional: false
181
- },
182
- status: {
183
- type: ExportStatusEnum,
184
- isOptional: false
185
- },
186
- downloadUrl: {
187
- type: ScalarTypeEnum.URL(),
188
- isOptional: true
189
- }
190
- }
89
+ var AuditExportOutputModel = defineSchemaModel({
90
+ name: "AuditExportOutput",
91
+ description: "Output from initiating an audit export",
92
+ fields: {
93
+ exportId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
94
+ status: { type: ExportStatusEnum, isOptional: false },
95
+ downloadUrl: { type: ScalarTypeEnum.URL(), isOptional: true }
96
+ }
191
97
  });
192
- const AuditStatsInputModel = defineSchemaModel({
193
- name: "AuditStatsInput",
194
- description: "Input for getting audit statistics",
195
- fields: {
196
- orgId: {
197
- type: ScalarTypeEnum.String_unsecure(),
198
- isOptional: true
199
- },
200
- from: {
201
- type: ScalarTypeEnum.DateTime(),
202
- isOptional: true
203
- },
204
- to: {
205
- type: ScalarTypeEnum.DateTime(),
206
- isOptional: true
207
- }
208
- }
98
+ var AuditStatsInputModel = defineSchemaModel({
99
+ name: "AuditStatsInput",
100
+ description: "Input for getting audit statistics",
101
+ fields: {
102
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
103
+ from: { type: ScalarTypeEnum.DateTime(), isOptional: true },
104
+ to: { type: ScalarTypeEnum.DateTime(), isOptional: true }
105
+ }
209
106
  });
210
- const AuditStatsOutputModel = defineSchemaModel({
211
- name: "AuditStatsOutput",
212
- description: "Audit log statistics",
213
- fields: {
214
- totalLogs: {
215
- type: ScalarTypeEnum.Int_unsecure(),
216
- isOptional: false
217
- },
218
- uniqueActors: {
219
- type: ScalarTypeEnum.Int_unsecure(),
220
- isOptional: false
221
- },
222
- uniqueTargets: {
223
- type: ScalarTypeEnum.Int_unsecure(),
224
- isOptional: false
225
- },
226
- eventCounts: {
227
- type: ScalarTypeEnum.JSONObject(),
228
- isOptional: false
229
- }
230
- }
107
+ var AuditStatsOutputModel = defineSchemaModel({
108
+ name: "AuditStatsOutput",
109
+ description: "Audit log statistics",
110
+ fields: {
111
+ totalLogs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
112
+ uniqueActors: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
113
+ uniqueTargets: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
114
+ eventCounts: { type: ScalarTypeEnum.JSONObject(), isOptional: false }
115
+ }
231
116
  });
232
- /**
233
- * Query audit logs.
234
- */
235
- const QueryAuditLogsContract = defineQuery({
236
- meta: {
237
- key: "audit.logs.query",
238
- version: "1.0.0",
239
- stability: "stable",
240
- owners: [...OWNERS],
241
- tags: [
242
- "audit",
243
- "logs",
244
- "query"
245
- ],
246
- description: "Query audit logs with filters.",
247
- goal: "Enable searching and filtering of audit history.",
248
- context: "Admin dashboard, compliance reporting, debugging."
249
- },
250
- io: {
251
- input: AuditQueryInputModel,
252
- output: AuditQueryOutputModel
253
- },
254
- policy: { auth: "admin" }
117
+ var QueryAuditLogsContract = defineQuery({
118
+ meta: {
119
+ key: "audit.logs.query",
120
+ version: "1.0.0",
121
+ stability: "stable",
122
+ owners: [...OWNERS],
123
+ tags: ["audit", "logs", "query"],
124
+ description: "Query audit logs with filters.",
125
+ goal: "Enable searching and filtering of audit history.",
126
+ context: "Admin dashboard, compliance reporting, debugging."
127
+ },
128
+ io: {
129
+ input: AuditQueryInputModel,
130
+ output: AuditQueryOutputModel
131
+ },
132
+ policy: {
133
+ auth: "admin"
134
+ }
255
135
  });
256
- /**
257
- * Get audit log by ID.
258
- */
259
- const GetAuditLogContract = defineQuery({
260
- meta: {
261
- key: "audit.logs.get",
262
- version: "1.0.0",
263
- stability: "stable",
264
- owners: [...OWNERS],
265
- tags: [
266
- "audit",
267
- "logs",
268
- "get"
269
- ],
270
- description: "Get a specific audit log by ID.",
271
- goal: "View detailed audit log entry.",
272
- context: "Log detail view."
273
- },
274
- io: {
275
- input: defineSchemaModel({
276
- name: "GetAuditLogInput",
277
- fields: { logId: {
278
- type: ScalarTypeEnum.String_unsecure(),
279
- isOptional: false
280
- } }
281
- }),
282
- output: AuditLogModel
283
- },
284
- policy: { auth: "admin" }
136
+ var GetAuditLogContract = defineQuery({
137
+ meta: {
138
+ key: "audit.logs.get",
139
+ version: "1.0.0",
140
+ stability: "stable",
141
+ owners: [...OWNERS],
142
+ tags: ["audit", "logs", "get"],
143
+ description: "Get a specific audit log by ID.",
144
+ goal: "View detailed audit log entry.",
145
+ context: "Log detail view."
146
+ },
147
+ io: {
148
+ input: defineSchemaModel({
149
+ name: "GetAuditLogInput",
150
+ fields: {
151
+ logId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
152
+ }
153
+ }),
154
+ output: AuditLogModel
155
+ },
156
+ policy: {
157
+ auth: "admin"
158
+ }
285
159
  });
286
- /**
287
- * Get audit logs by trace ID.
288
- */
289
- const GetAuditTraceContract = defineQuery({
290
- meta: {
291
- key: "audit.trace.get",
292
- version: "1.0.0",
293
- stability: "stable",
294
- owners: [...OWNERS],
295
- tags: [
296
- "audit",
297
- "trace",
298
- "get"
299
- ],
300
- description: "Get all audit logs for a trace.",
301
- goal: "View complete request trace for debugging.",
302
- context: "Request tracing, debugging."
303
- },
304
- io: {
305
- input: defineSchemaModel({
306
- name: "GetAuditTraceInput",
307
- fields: { traceId: {
308
- type: ScalarTypeEnum.String_unsecure(),
309
- isOptional: false
310
- } }
311
- }),
312
- output: defineSchemaModel({
313
- name: "GetAuditTraceOutput",
314
- fields: { logs: {
315
- type: AuditLogModel,
316
- isArray: true,
317
- isOptional: false
318
- } }
319
- })
320
- },
321
- policy: { auth: "admin" }
160
+ var GetAuditTraceContract = defineQuery({
161
+ meta: {
162
+ key: "audit.trace.get",
163
+ version: "1.0.0",
164
+ stability: "stable",
165
+ owners: [...OWNERS],
166
+ tags: ["audit", "trace", "get"],
167
+ description: "Get all audit logs for a trace.",
168
+ goal: "View complete request trace for debugging.",
169
+ context: "Request tracing, debugging."
170
+ },
171
+ io: {
172
+ input: defineSchemaModel({
173
+ name: "GetAuditTraceInput",
174
+ fields: {
175
+ traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
176
+ }
177
+ }),
178
+ output: defineSchemaModel({
179
+ name: "GetAuditTraceOutput",
180
+ fields: {
181
+ logs: { type: AuditLogModel, isArray: true, isOptional: false }
182
+ }
183
+ })
184
+ },
185
+ policy: {
186
+ auth: "admin"
187
+ }
322
188
  });
323
- /**
324
- * Export audit logs.
325
- */
326
- const ExportAuditLogsContract = defineCommand({
327
- meta: {
328
- key: "audit.logs.export",
329
- version: "1.0.0",
330
- stability: "stable",
331
- owners: [...OWNERS],
332
- tags: [
333
- "audit",
334
- "logs",
335
- "export"
336
- ],
337
- description: "Export audit logs for compliance reporting.",
338
- goal: "Generate audit reports for compliance.",
339
- context: "Compliance reporting, external audits."
340
- },
341
- io: {
342
- input: AuditExportInputModel,
343
- output: AuditExportOutputModel
344
- },
345
- policy: { auth: "admin" }
189
+ var ExportAuditLogsContract = defineCommand({
190
+ meta: {
191
+ key: "audit.logs.export",
192
+ version: "1.0.0",
193
+ stability: "stable",
194
+ owners: [...OWNERS],
195
+ tags: ["audit", "logs", "export"],
196
+ description: "Export audit logs for compliance reporting.",
197
+ goal: "Generate audit reports for compliance.",
198
+ context: "Compliance reporting, external audits."
199
+ },
200
+ io: {
201
+ input: AuditExportInputModel,
202
+ output: AuditExportOutputModel
203
+ },
204
+ policy: {
205
+ auth: "admin"
206
+ }
346
207
  });
347
- /**
348
- * Get audit statistics.
349
- */
350
- const GetAuditStatsContract = defineQuery({
351
- meta: {
352
- key: "audit.stats",
353
- version: "1.0.0",
354
- stability: "stable",
355
- owners: [...OWNERS],
356
- tags: ["audit", "stats"],
357
- description: "Get audit log statistics.",
358
- goal: "Monitor audit activity levels.",
359
- context: "Admin dashboard, monitoring."
360
- },
361
- io: {
362
- input: AuditStatsInputModel,
363
- output: AuditStatsOutputModel
364
- },
365
- policy: { auth: "admin" }
208
+ var GetAuditStatsContract = defineQuery({
209
+ meta: {
210
+ key: "audit.stats",
211
+ version: "1.0.0",
212
+ stability: "stable",
213
+ owners: [...OWNERS],
214
+ tags: ["audit", "stats"],
215
+ description: "Get audit log statistics.",
216
+ goal: "Monitor audit activity levels.",
217
+ context: "Admin dashboard, monitoring."
218
+ },
219
+ io: {
220
+ input: AuditStatsInputModel,
221
+ output: AuditStatsOutputModel
222
+ },
223
+ policy: {
224
+ auth: "admin"
225
+ }
366
226
  });
367
-
368
- //#endregion
369
- export { AuditExportInputModel, AuditExportOutputModel, AuditLogModel, AuditQueryInputModel, AuditQueryOutputModel, AuditStatsInputModel, AuditStatsOutputModel, ExportAuditLogsContract, ExportFormatEnum, ExportStatusEnum, GetAuditLogContract, GetAuditStatsContract, GetAuditTraceContract, QueryAuditLogsContract };
370
- //# sourceMappingURL=index.js.map
227
+ export {
228
+ QueryAuditLogsContract,
229
+ GetAuditTraceContract,
230
+ GetAuditStatsContract,
231
+ GetAuditLogContract,
232
+ ExportStatusEnum,
233
+ ExportFormatEnum,
234
+ ExportAuditLogsContract,
235
+ AuditStatsOutputModel,
236
+ AuditStatsInputModel,
237
+ AuditQueryOutputModel,
238
+ AuditQueryInputModel,
239
+ AuditLogModel,
240
+ AuditExportOutputModel,
241
+ AuditExportInputModel
242
+ };