@contractspec/module.audit-trail 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit-trail.capability.d.ts +1 -6
- package/dist/audit-trail.capability.d.ts.map +1 -1
- package/dist/audit-trail.capability.js +17 -20
- package/dist/audit-trail.feature.d.ts +1 -6
- package/dist/audit-trail.feature.d.ts.map +1 -1
- package/dist/audit-trail.feature.js +31 -64
- package/dist/browser/audit-trail.capability.js +16 -0
- package/dist/browser/audit-trail.feature.js +32 -0
- package/dist/browser/contracts/index.js +241 -0
- package/dist/browser/entities/index.js +103 -0
- package/dist/browser/index.js +474 -0
- package/dist/browser/storage/index.js +101 -0
- package/dist/contracts/index.d.ts +549 -555
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +227 -355
- package/dist/entities/index.d.ts +70 -75
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +100 -122
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +474 -5
- package/dist/node/audit-trail.capability.js +16 -0
- package/dist/node/audit-trail.feature.js +32 -0
- package/dist/node/contracts/index.js +241 -0
- package/dist/node/entities/index.js +103 -0
- package/dist/node/index.js +474 -0
- package/dist/node/storage/index.js +101 -0
- package/dist/storage/index.d.ts +59 -63
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +100 -110
- package/package.json +86 -25
- package/dist/audit-trail.capability.js.map +0 -1
- package/dist/audit-trail.feature.js.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/storage/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBxB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuB/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAC;AAEH,eAAO,MAAM,gBAAgB,uEAI3B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;EAchC,CAAC;AAEH,eAAO,MAAM,gBAAgB,+EAK3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EAQjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;EAShC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -1,370 +1,242 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
63
|
+
var ExportFormatEnum = defineEnum("ExportFormat", [
|
|
64
|
+
"json",
|
|
65
|
+
"csv",
|
|
66
|
+
"parquet"
|
|
139
67
|
]);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
83
|
+
var ExportStatusEnum = defineEnum("ExportStatus", [
|
|
84
|
+
"pending",
|
|
85
|
+
"processing",
|
|
86
|
+
"completed",
|
|
87
|
+
"failed"
|
|
173
88
|
]);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
|
|
369
|
-
|
|
370
|
-
|
|
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
|
+
};
|