@datum-cloud/activity-ui 0.1.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/README.md +334 -0
- package/dist/api/client.d.ts +264 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/components/ActionMultiSelect.d.ts +25 -0
- package/dist/components/ActionMultiSelect.d.ts.map +1 -0
- package/dist/components/ActionToggle.d.ts +16 -0
- package/dist/components/ActionToggle.d.ts.map +1 -0
- package/dist/components/ActivityExpandedDetails.d.ts +21 -0
- package/dist/components/ActivityExpandedDetails.d.ts.map +1 -0
- package/dist/components/ActivityFeed.d.ts +60 -0
- package/dist/components/ActivityFeed.d.ts.map +1 -0
- package/dist/components/ActivityFeedFilters.d.ts +26 -0
- package/dist/components/ActivityFeedFilters.d.ts.map +1 -0
- package/dist/components/ActivityFeedItem.d.ts +39 -0
- package/dist/components/ActivityFeedItem.d.ts.map +1 -0
- package/dist/components/ActivityFeedItemSkeleton.d.ts +11 -0
- package/dist/components/ActivityFeedItemSkeleton.d.ts.map +1 -0
- package/dist/components/ActivityFeedSummary.d.ts +23 -0
- package/dist/components/ActivityFeedSummary.d.ts.map +1 -0
- package/dist/components/ApiErrorAlert.d.ts +10 -0
- package/dist/components/ApiErrorAlert.d.ts.map +1 -0
- package/dist/components/AuditEventViewer.d.ts +14 -0
- package/dist/components/AuditEventViewer.d.ts.map +1 -0
- package/dist/components/AuditLogExpandedDetails.d.ts +20 -0
- package/dist/components/AuditLogExpandedDetails.d.ts.map +1 -0
- package/dist/components/AuditLogFeedItem.d.ts +22 -0
- package/dist/components/AuditLogFeedItem.d.ts.map +1 -0
- package/dist/components/AuditLogFilters.d.ts +50 -0
- package/dist/components/AuditLogFilters.d.ts.map +1 -0
- package/dist/components/AuditLogQueryComponent.d.ts +18 -0
- package/dist/components/AuditLogQueryComponent.d.ts.map +1 -0
- package/dist/components/CelEditor.d.ts +31 -0
- package/dist/components/CelEditor.d.ts.map +1 -0
- package/dist/components/ChangeSourceToggle.d.ts +17 -0
- package/dist/components/ChangeSourceToggle.d.ts.map +1 -0
- package/dist/components/DateTimeRangePicker.d.ts +15 -0
- package/dist/components/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/components/EventExpandedDetails.d.ts +17 -0
- package/dist/components/EventExpandedDetails.d.ts.map +1 -0
- package/dist/components/EventFeedItem.d.ts +29 -0
- package/dist/components/EventFeedItem.d.ts.map +1 -0
- package/dist/components/EventFeedItemSkeleton.d.ts +11 -0
- package/dist/components/EventFeedItemSkeleton.d.ts.map +1 -0
- package/dist/components/EventTypeToggle.d.ts +17 -0
- package/dist/components/EventTypeToggle.d.ts.map +1 -0
- package/dist/components/EventsFeed.d.ts +51 -0
- package/dist/components/EventsFeed.d.ts.map +1 -0
- package/dist/components/EventsFeedFilters.d.ts +28 -0
- package/dist/components/EventsFeedFilters.d.ts.map +1 -0
- package/dist/components/FilterBuilder.d.ts +12 -0
- package/dist/components/FilterBuilder.d.ts.map +1 -0
- package/dist/components/FilterBuilderWithAutocomplete.d.ts +12 -0
- package/dist/components/FilterBuilderWithAutocomplete.d.ts.map +1 -0
- package/dist/components/PolicyActivityView.d.ts +25 -0
- package/dist/components/PolicyActivityView.d.ts.map +1 -0
- package/dist/components/PolicyActivityViewSkeleton.d.ts +9 -0
- package/dist/components/PolicyActivityViewSkeleton.d.ts.map +1 -0
- package/dist/components/PolicyDetailView.d.ts +22 -0
- package/dist/components/PolicyDetailView.d.ts.map +1 -0
- package/dist/components/PolicyEditView.d.ts +22 -0
- package/dist/components/PolicyEditView.d.ts.map +1 -0
- package/dist/components/PolicyEditor.d.ts +24 -0
- package/dist/components/PolicyEditor.d.ts.map +1 -0
- package/dist/components/PolicyList.d.ts +23 -0
- package/dist/components/PolicyList.d.ts.map +1 -0
- package/dist/components/PolicyPreviewPanel.d.ts +23 -0
- package/dist/components/PolicyPreviewPanel.d.ts.map +1 -0
- package/dist/components/PolicyPreviewResult.d.ts +17 -0
- package/dist/components/PolicyPreviewResult.d.ts.map +1 -0
- package/dist/components/PolicyResourceForm.d.ts +19 -0
- package/dist/components/PolicyResourceForm.d.ts.map +1 -0
- package/dist/components/PolicyRuleEditor.d.ts +22 -0
- package/dist/components/PolicyRuleEditor.d.ts.map +1 -0
- package/dist/components/PolicyRuleEditorDialog.d.ts +30 -0
- package/dist/components/PolicyRuleEditorDialog.d.ts.map +1 -0
- package/dist/components/PolicyRuleList.d.ts +26 -0
- package/dist/components/PolicyRuleList.d.ts.map +1 -0
- package/dist/components/PolicyRuleListItem.d.ts +29 -0
- package/dist/components/PolicyRuleListItem.d.ts.map +1 -0
- package/dist/components/ReindexJobCreate.d.ts +21 -0
- package/dist/components/ReindexJobCreate.d.ts.map +1 -0
- package/dist/components/ReindexJobDetailView.d.ts +21 -0
- package/dist/components/ReindexJobDetailView.d.ts.map +1 -0
- package/dist/components/ReindexJobDialog.d.ts +21 -0
- package/dist/components/ReindexJobDialog.d.ts.map +1 -0
- package/dist/components/ReindexJobList.d.ts +21 -0
- package/dist/components/ReindexJobList.d.ts.map +1 -0
- package/dist/components/ResourceHistoryView.d.ts +54 -0
- package/dist/components/ResourceHistoryView.d.ts.map +1 -0
- package/dist/components/RulePreviewPanel.d.ts +23 -0
- package/dist/components/RulePreviewPanel.d.ts.map +1 -0
- package/dist/components/SampleInputTemplates.d.ts +26 -0
- package/dist/components/SampleInputTemplates.d.ts.map +1 -0
- package/dist/components/SimpleQueryBuilder.d.ts +12 -0
- package/dist/components/SimpleQueryBuilder.d.ts.map +1 -0
- package/dist/components/TenantBadge.d.ts +17 -0
- package/dist/components/TenantBadge.d.ts.map +1 -0
- package/dist/components/UserSelect.d.ts +24 -0
- package/dist/components/UserSelect.d.ts.map +1 -0
- package/dist/components/VerbToggle.d.ts +16 -0
- package/dist/components/VerbToggle.d.ts.map +1 -0
- package/dist/components/ui/add-filter-dropdown.d.ts +26 -0
- package/dist/components/ui/add-filter-dropdown.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/combobox.d.ts +27 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/filter-chip.d.ts +37 -0
- package/dist/components/ui/filter-chip.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +8 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/multi-combobox.d.ts +24 -0
- package/dist/components/ui/multi-combobox.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +23 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/time-range-dropdown.d.ts +29 -0
- package/dist/components/ui/time-range-dropdown.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/hooks/useActivityFeed.d.ts +101 -0
- package/dist/hooks/useActivityFeed.d.ts.map +1 -0
- package/dist/hooks/useAuditLogFacets.d.ts +33 -0
- package/dist/hooks/useAuditLogFacets.d.ts.map +1 -0
- package/dist/hooks/useAuditLogQuery.d.ts +21 -0
- package/dist/hooks/useAuditLogQuery.d.ts.map +1 -0
- package/dist/hooks/useEventFacets.d.ts +30 -0
- package/dist/hooks/useEventFacets.d.ts.map +1 -0
- package/dist/hooks/useEventsFeed.d.ts +93 -0
- package/dist/hooks/useEventsFeed.d.ts.map +1 -0
- package/dist/hooks/useFacets.d.ts +29 -0
- package/dist/hooks/useFacets.d.ts.map +1 -0
- package/dist/hooks/usePolicyEditor.d.ts +71 -0
- package/dist/hooks/usePolicyEditor.d.ts.map +1 -0
- package/dist/hooks/usePolicyList.d.ts +35 -0
- package/dist/hooks/usePolicyList.d.ts.map +1 -0
- package/dist/hooks/usePolicyPreview.d.ts +72 -0
- package/dist/hooks/usePolicyPreview.d.ts.map +1 -0
- package/dist/hooks/useReindexJobs.d.ts +37 -0
- package/dist/hooks/useReindexJobs.d.ts.map +1 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +16224 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +16377 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/errors.d.ts +50 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/extractFieldPaths.d.ts +33 -0
- package/dist/lib/extractFieldPaths.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/types/activity.d.ts +366 -0
- package/dist/types/activity.d.ts.map +1 -0
- package/dist/types/index.d.ts +117 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/k8s-event.d.ts +224 -0
- package/dist/types/k8s-event.d.ts.map +1 -0
- package/dist/types/policy.d.ts +333 -0
- package/dist/types/policy.d.ts.map +1 -0
- package/dist/types/reindex.d.ts +102 -0
- package/dist/types/reindex.d.ts.map +1 -0
- package/package.json +87 -0
package/README.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# Activity UI - React Components for Kubernetes Audit Logs
|
|
2
|
+
|
|
3
|
+
React component library for querying and visualizing Kubernetes audit logs via Activity (`activity.miloapis.com/v1alpha1`).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🔍 **FilterBuilder** - Interactive CEL expression builder for audit log queries
|
|
8
|
+
- 📊 **AuditEventViewer** - Rich visualization of audit events with expandable details
|
|
9
|
+
- 🎯 **AuditLogQueryComponent** - Complete query interface combining filter builder and results viewer
|
|
10
|
+
- ⚡ **useAuditLogQuery Hook** - React hook for programmatic query execution
|
|
11
|
+
- 🔌 **ActivityApiClient** - Typed API client for Activity
|
|
12
|
+
- 📦 **TypeScript Types** - Full type definitions matching the Kubernetes API schema
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @miloapis/activity-ui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import {
|
|
24
|
+
AuditLogQueryComponent,
|
|
25
|
+
ActivityApiClient,
|
|
26
|
+
} from '@miloapis/activity-ui';
|
|
27
|
+
import '@miloapis/activity-ui/dist/styles.css';
|
|
28
|
+
|
|
29
|
+
function App() {
|
|
30
|
+
const client = new ActivityApiClient({
|
|
31
|
+
baseUrl: 'https://your-activity-api-server.com',
|
|
32
|
+
token: 'your-bearer-token', // Optional
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<AuditLogQueryComponent
|
|
37
|
+
client={client}
|
|
38
|
+
initialFilter='verb == "delete" && ns == "production"'
|
|
39
|
+
initialLimit={100}
|
|
40
|
+
onEventSelect={(event) => console.log('Selected:', event)}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Components
|
|
47
|
+
|
|
48
|
+
### AuditLogQueryComponent
|
|
49
|
+
|
|
50
|
+
Complete query interface with filter builder and results viewer.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<AuditLogQueryComponent
|
|
54
|
+
client={client}
|
|
55
|
+
initialFilter='resource == "secrets"'
|
|
56
|
+
initialLimit={50}
|
|
57
|
+
onEventSelect={(event) => {
|
|
58
|
+
console.log('Event selected:', event);
|
|
59
|
+
}}
|
|
60
|
+
className="custom-class"
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Props:**
|
|
65
|
+
- `client`: ActivityApiClient instance (required)
|
|
66
|
+
- `initialFilter`: Initial CEL filter expression (optional)
|
|
67
|
+
- `initialLimit`: Initial result limit (optional, default: 100)
|
|
68
|
+
- `onEventSelect`: Callback when an event is clicked (optional)
|
|
69
|
+
- `className`: Custom CSS class (optional)
|
|
70
|
+
|
|
71
|
+
### FilterBuilder
|
|
72
|
+
|
|
73
|
+
Interactive builder for CEL filter expressions.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<FilterBuilder
|
|
77
|
+
onFilterChange={(spec) => console.log('Filter:', spec)}
|
|
78
|
+
initialFilter='verb == "delete"'
|
|
79
|
+
initialLimit={100}
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Props:**
|
|
84
|
+
- `onFilterChange`: Callback when filter/limit changes (required)
|
|
85
|
+
- `initialFilter`: Initial filter expression (optional)
|
|
86
|
+
- `initialLimit`: Initial limit value (optional)
|
|
87
|
+
- `className`: Custom CSS class (optional)
|
|
88
|
+
|
|
89
|
+
### AuditEventViewer
|
|
90
|
+
|
|
91
|
+
Display and interact with audit events.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<AuditEventViewer
|
|
95
|
+
events={auditEvents}
|
|
96
|
+
onEventSelect={(event) => console.log(event)}
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Props:**
|
|
101
|
+
- `events`: Array of audit events to display (required)
|
|
102
|
+
- `onEventSelect`: Callback when an event is clicked (optional)
|
|
103
|
+
- `className`: Custom CSS class (optional)
|
|
104
|
+
|
|
105
|
+
## Hooks
|
|
106
|
+
|
|
107
|
+
### useAuditLogQuery
|
|
108
|
+
|
|
109
|
+
React hook for executing queries programmatically.
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { useAuditLogQuery, ActivityApiClient } from '@miloapis/activity-ui';
|
|
113
|
+
|
|
114
|
+
function MyComponent() {
|
|
115
|
+
const client = new ActivityApiClient({ baseUrl: '...' });
|
|
116
|
+
|
|
117
|
+
const {
|
|
118
|
+
query,
|
|
119
|
+
events,
|
|
120
|
+
isLoading,
|
|
121
|
+
error,
|
|
122
|
+
hasMore,
|
|
123
|
+
executeQuery,
|
|
124
|
+
loadMore,
|
|
125
|
+
reset,
|
|
126
|
+
} = useAuditLogQuery({ client });
|
|
127
|
+
|
|
128
|
+
const handleSearch = async () => {
|
|
129
|
+
await executeQuery({
|
|
130
|
+
filter: 'verb == "delete"',
|
|
131
|
+
limit: 50,
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<div>
|
|
137
|
+
<button onClick={handleSearch} disabled={isLoading}>
|
|
138
|
+
Search
|
|
139
|
+
</button>
|
|
140
|
+
|
|
141
|
+
{events.map((event) => (
|
|
142
|
+
<div key={event.auditID}>{event.verb} - {event.objectRef?.resource}</div>
|
|
143
|
+
))}
|
|
144
|
+
|
|
145
|
+
{hasMore && (
|
|
146
|
+
<button onClick={loadMore} disabled={isLoading}>
|
|
147
|
+
Load More
|
|
148
|
+
</button>
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## API Client
|
|
156
|
+
|
|
157
|
+
### ActivityApiClient
|
|
158
|
+
|
|
159
|
+
Client for interacting with the Activity API server.
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
import { ActivityApiClient } from '@miloapis/activity-ui';
|
|
163
|
+
|
|
164
|
+
const client = new ActivityApiClient({
|
|
165
|
+
baseUrl: 'https://activity-api.example.com',
|
|
166
|
+
token: 'your-token', // Optional
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// Create a query
|
|
170
|
+
const query = await client.createQuery('my-query', {
|
|
171
|
+
filter: 'verb == "delete" && ns == "production"',
|
|
172
|
+
limit: 100,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Get query results
|
|
176
|
+
const result = await client.getQuery('my-query');
|
|
177
|
+
console.log(result.status.results);
|
|
178
|
+
|
|
179
|
+
// Paginated query execution
|
|
180
|
+
for await (const page of client.executeQueryPaginated({
|
|
181
|
+
filter: 'resource == "secrets"',
|
|
182
|
+
limit: 100,
|
|
183
|
+
})) {
|
|
184
|
+
console.log(`Page with ${page.status?.results?.length} events`);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## CEL Filter Examples
|
|
189
|
+
|
|
190
|
+
The filter field accepts CEL (Common Expression Language) expressions:
|
|
191
|
+
|
|
192
|
+
```javascript
|
|
193
|
+
// Find all delete operations
|
|
194
|
+
filter: 'verb == "delete"'
|
|
195
|
+
|
|
196
|
+
// Find operations in specific namespaces
|
|
197
|
+
filter: 'ns in ["production", "staging"]'
|
|
198
|
+
|
|
199
|
+
// Find secret access
|
|
200
|
+
filter: 'resource == "secrets" && verb in ["get", "list"]'
|
|
201
|
+
|
|
202
|
+
// Find operations by user
|
|
203
|
+
filter: 'user.startsWith("system:") && verb == "delete"'
|
|
204
|
+
|
|
205
|
+
// Time range filtering
|
|
206
|
+
filter: 'timestamp >= timestamp("2024-01-01T00:00:00Z") && timestamp <= timestamp("2024-12-31T23:59:59Z")'
|
|
207
|
+
|
|
208
|
+
// Complex queries
|
|
209
|
+
filter: 'verb == "delete" && resource in ["secrets", "configmaps"] && ns == "production" && stage == "ResponseComplete"'
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Available Filter Fields
|
|
213
|
+
|
|
214
|
+
- `timestamp` - Event timestamp (time.Time)
|
|
215
|
+
- `ns` - Kubernetes namespace (string)
|
|
216
|
+
- `verb` - HTTP verb (get, list, create, update, delete, etc.)
|
|
217
|
+
- `resource` - Resource type (pods, deployments, etc.)
|
|
218
|
+
- `user` - Username who performed the action
|
|
219
|
+
- `level` - Audit level (Metadata, Request, RequestResponse)
|
|
220
|
+
- `stage` - Event stage (RequestReceived, ResponseStarted, ResponseComplete, Panic)
|
|
221
|
+
- `uid` - Event UID
|
|
222
|
+
- `requestURI` - The request URI
|
|
223
|
+
- `sourceIPs` - Source IP addresses (array)
|
|
224
|
+
|
|
225
|
+
## Development
|
|
226
|
+
|
|
227
|
+
### Prerequisites
|
|
228
|
+
|
|
229
|
+
- Node.js 18+
|
|
230
|
+
- npm or yarn
|
|
231
|
+
|
|
232
|
+
### Building the Library
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Install dependencies
|
|
236
|
+
task ui:install
|
|
237
|
+
|
|
238
|
+
# Build the library
|
|
239
|
+
task ui:build
|
|
240
|
+
|
|
241
|
+
# Watch mode for development
|
|
242
|
+
task ui:dev
|
|
243
|
+
|
|
244
|
+
# Run type checking
|
|
245
|
+
task ui:type-check
|
|
246
|
+
|
|
247
|
+
# Run linter
|
|
248
|
+
task ui:lint
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Running the Example App
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Start the example application
|
|
255
|
+
task ui:start
|
|
256
|
+
|
|
257
|
+
# Or use the full command
|
|
258
|
+
task ui:example:dev
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
The example app will start at [http://localhost:3000](http://localhost:3000).
|
|
262
|
+
|
|
263
|
+
### Available Tasks
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
task ui:install # Install dependencies
|
|
267
|
+
task ui:build # Build component library
|
|
268
|
+
task ui:dev # Build in watch mode
|
|
269
|
+
task ui:lint # Lint code
|
|
270
|
+
task ui:type-check # Type check
|
|
271
|
+
task ui:clean # Clean build artifacts
|
|
272
|
+
|
|
273
|
+
# Example app
|
|
274
|
+
task ui:start # Start example app (alias for example:dev)
|
|
275
|
+
task ui:example:dev # Start example in dev mode
|
|
276
|
+
task ui:example:build # Build example for production
|
|
277
|
+
task ui:example:preview # Preview production build
|
|
278
|
+
|
|
279
|
+
# Combined
|
|
280
|
+
task ui:test # Run lint + type-check
|
|
281
|
+
task ui:all # Build library and example
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## TypeScript Support
|
|
285
|
+
|
|
286
|
+
Full TypeScript support with exported types:
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import type {
|
|
290
|
+
Event,
|
|
291
|
+
AuditLogQuery,
|
|
292
|
+
AuditLogQuerySpec,
|
|
293
|
+
QueryPhase,
|
|
294
|
+
FilterField,
|
|
295
|
+
} from '@miloapis/activity-ui';
|
|
296
|
+
|
|
297
|
+
const spec: AuditLogQuerySpec = {
|
|
298
|
+
filter: 'verb == "delete"',
|
|
299
|
+
limit: 100,
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const handleEvent = (event: Event) => {
|
|
303
|
+
console.log(event.verb, event.objectRef?.resource);
|
|
304
|
+
};
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Styling
|
|
308
|
+
|
|
309
|
+
Import the default styles:
|
|
310
|
+
|
|
311
|
+
```tsx
|
|
312
|
+
import '@miloapis/activity-ui/dist/styles.css';
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Or customize by overriding CSS variables and classes. See the source CSS for available class names.
|
|
316
|
+
|
|
317
|
+
## Contributing
|
|
318
|
+
|
|
319
|
+
1. Fork the repository
|
|
320
|
+
2. Create a feature branch
|
|
321
|
+
3. Make your changes
|
|
322
|
+
4. Add tests if applicable
|
|
323
|
+
5. Run `task ui:test` to verify
|
|
324
|
+
6. Submit a pull request
|
|
325
|
+
|
|
326
|
+
## License
|
|
327
|
+
|
|
328
|
+
Apache-2.0
|
|
329
|
+
|
|
330
|
+
## Support
|
|
331
|
+
|
|
332
|
+
For issues and questions:
|
|
333
|
+
- GitHub Issues: https://github.com/datum-cloud/activity/issues
|
|
334
|
+
- Documentation: See the main [Activity README](../README.md)
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import type { AuditLogQuery, AuditLogQuerySpec } from '../types';
|
|
2
|
+
import type { Activity, ActivityList, ActivityListParams, ActivityQuery, ActivityQuerySpec, ActivityFacetQuery, ActivityFacetQuerySpec, AuditLogFacetsQuery, AuditLogFacetsQuerySpec, WatchEvent } from '../types/activity';
|
|
3
|
+
import type { ActivityPolicy, ActivityPolicySpec, ActivityPolicyList, PolicyPreview, PolicyPreviewSpec } from '../types/policy';
|
|
4
|
+
import type { K8sEvent, K8sEventList, K8sEventListParams, EventFacetQuery, EventFacetQuerySpec, EventQuery, EventQuerySpec } from '../types/k8s-event';
|
|
5
|
+
import type { ReindexJob, ReindexJobListResource, ReindexJobSpec } from '../types/reindex';
|
|
6
|
+
/**
|
|
7
|
+
* API Group information from Kubernetes discovery
|
|
8
|
+
*/
|
|
9
|
+
export interface APIGroup {
|
|
10
|
+
name: string;
|
|
11
|
+
versions: {
|
|
12
|
+
groupVersion: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}[];
|
|
15
|
+
preferredVersion?: {
|
|
16
|
+
groupVersion: string;
|
|
17
|
+
version: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* API Resource information from Kubernetes discovery
|
|
22
|
+
*/
|
|
23
|
+
export interface APIResource {
|
|
24
|
+
name: string;
|
|
25
|
+
singularName: string;
|
|
26
|
+
namespaced: boolean;
|
|
27
|
+
kind: string;
|
|
28
|
+
verbs: string[];
|
|
29
|
+
shortNames?: string[];
|
|
30
|
+
categories?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface ApiClientConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Base URL of the Activity API server
|
|
35
|
+
* Example: 'https://api.example.com'
|
|
36
|
+
*/
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional bearer token for authentication
|
|
40
|
+
*/
|
|
41
|
+
token?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom fetch implementation (useful for testing)
|
|
44
|
+
*/
|
|
45
|
+
fetch?: typeof fetch;
|
|
46
|
+
/**
|
|
47
|
+
* Optional response transformer for proxies that wrap API responses.
|
|
48
|
+
* Called with the parsed JSON response, should return the unwrapped data.
|
|
49
|
+
*
|
|
50
|
+
* Example for a proxy that wraps responses in {code, data, ...}:
|
|
51
|
+
* ```
|
|
52
|
+
* responseTransformer: (response) => response.data
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
responseTransformer?: (response: unknown) => unknown;
|
|
56
|
+
}
|
|
57
|
+
export declare class ActivityApiClient {
|
|
58
|
+
private config;
|
|
59
|
+
constructor(config: ApiClientConfig);
|
|
60
|
+
/**
|
|
61
|
+
* Create a new AuditLogQuery
|
|
62
|
+
*/
|
|
63
|
+
createQuery(name: string, spec: AuditLogQuerySpec): Promise<AuditLogQuery>;
|
|
64
|
+
/**
|
|
65
|
+
* Execute a query and get results with automatic pagination
|
|
66
|
+
*/
|
|
67
|
+
executeQueryPaginated(spec: AuditLogQuerySpec, options?: {
|
|
68
|
+
maxPages?: number;
|
|
69
|
+
queryNamePrefix?: string;
|
|
70
|
+
}): AsyncGenerator<AuditLogQuery>;
|
|
71
|
+
/**
|
|
72
|
+
* Create an ActivityQuery to search historical activities.
|
|
73
|
+
* This is the preferred method for loading activity history with filters.
|
|
74
|
+
*/
|
|
75
|
+
createActivityQuery(spec: ActivityQuerySpec): Promise<ActivityQuery>;
|
|
76
|
+
/**
|
|
77
|
+
* List activities with optional filtering and pagination
|
|
78
|
+
*/
|
|
79
|
+
listActivities(params?: ActivityListParams): Promise<ActivityList>;
|
|
80
|
+
/**
|
|
81
|
+
* Get a specific activity by name
|
|
82
|
+
*/
|
|
83
|
+
getActivity(namespace: string, name: string): Promise<Activity>;
|
|
84
|
+
/**
|
|
85
|
+
* Query facets for filtering UI (autocomplete, distinct values)
|
|
86
|
+
*/
|
|
87
|
+
queryFacets(spec: ActivityFacetQuerySpec): Promise<ActivityFacetQuery>;
|
|
88
|
+
/**
|
|
89
|
+
* List activities with automatic pagination using async generator
|
|
90
|
+
*/
|
|
91
|
+
listActivitiesPaginated(params?: ActivityListParams, options?: {
|
|
92
|
+
maxPages?: number;
|
|
93
|
+
}): AsyncGenerator<ActivityList>;
|
|
94
|
+
/**
|
|
95
|
+
* Watch activities in real-time using the Kubernetes watch API.
|
|
96
|
+
* Returns an async generator that yields watch events as they arrive.
|
|
97
|
+
*
|
|
98
|
+
* @param params - Query parameters (filter, start, end, etc.)
|
|
99
|
+
* @param options - Watch options
|
|
100
|
+
* @returns AsyncGenerator of watch events and an abort function
|
|
101
|
+
*/
|
|
102
|
+
watchActivities(params?: Omit<ActivityListParams, 'watch'>, options?: {
|
|
103
|
+
/** Resource version to start watching from */
|
|
104
|
+
resourceVersion?: string;
|
|
105
|
+
/** Callback when an event is received */
|
|
106
|
+
onEvent?: (event: WatchEvent<Activity>) => void;
|
|
107
|
+
/** Callback when an error occurs */
|
|
108
|
+
onError?: (error: Error) => void;
|
|
109
|
+
/** Callback when the connection closes */
|
|
110
|
+
onClose?: () => void;
|
|
111
|
+
}): {
|
|
112
|
+
stop: () => void;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Watch activities using an async generator pattern.
|
|
116
|
+
* This is an alternative API that yields events as they arrive.
|
|
117
|
+
*
|
|
118
|
+
* @param params - Query parameters (filter, start, end, etc.)
|
|
119
|
+
* @param resourceVersion - Resource version to start watching from
|
|
120
|
+
* @returns AsyncGenerator of watch events
|
|
121
|
+
*/
|
|
122
|
+
watchActivitiesGenerator(params?: Omit<ActivityListParams, 'watch'>, resourceVersion?: string): AsyncGenerator<WatchEvent<Activity>>;
|
|
123
|
+
/**
|
|
124
|
+
* List all ActivityPolicies
|
|
125
|
+
*/
|
|
126
|
+
listPolicies(): Promise<ActivityPolicyList>;
|
|
127
|
+
/**
|
|
128
|
+
* Get a specific ActivityPolicy by name
|
|
129
|
+
*/
|
|
130
|
+
getPolicy(name: string): Promise<ActivityPolicy>;
|
|
131
|
+
/**
|
|
132
|
+
* Create a new ActivityPolicy
|
|
133
|
+
* @param name Policy name
|
|
134
|
+
* @param spec Policy specification
|
|
135
|
+
* @param dryRun If true, validate without persisting
|
|
136
|
+
*/
|
|
137
|
+
createPolicy(name: string, spec: ActivityPolicySpec, dryRun?: boolean): Promise<ActivityPolicy>;
|
|
138
|
+
/**
|
|
139
|
+
* Update an existing ActivityPolicy
|
|
140
|
+
* @param name Policy name
|
|
141
|
+
* @param spec Policy specification
|
|
142
|
+
* @param dryRun If true, validate without persisting
|
|
143
|
+
* @param resourceVersion Optional resource version for optimistic concurrency
|
|
144
|
+
*/
|
|
145
|
+
updatePolicy(name: string, spec: ActivityPolicySpec, dryRun?: boolean, resourceVersion?: string): Promise<ActivityPolicy>;
|
|
146
|
+
/**
|
|
147
|
+
* Delete an ActivityPolicy by name
|
|
148
|
+
*/
|
|
149
|
+
deletePolicy(name: string): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Discover all API groups available in the cluster
|
|
152
|
+
*/
|
|
153
|
+
discoverAPIGroups(): Promise<{
|
|
154
|
+
groups: APIGroup[];
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Discover resources for a specific API group
|
|
158
|
+
*/
|
|
159
|
+
discoverAPIResources(group: string, version?: string): Promise<{
|
|
160
|
+
resources: APIResource[];
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Query facets from audit logs (API groups, resources, verbs, etc.)
|
|
164
|
+
* This is an ephemeral resource that executes immediately and returns results.
|
|
165
|
+
*/
|
|
166
|
+
queryAuditLogFacets(spec: AuditLogFacetsQuerySpec): Promise<AuditLogFacetsQuery>;
|
|
167
|
+
/**
|
|
168
|
+
* Get all API groups that have audit log data
|
|
169
|
+
* Uses the AuditLogFacetsQuery API to discover API groups from actual audit logs.
|
|
170
|
+
*/
|
|
171
|
+
getAuditedAPIGroups(): Promise<string[]>;
|
|
172
|
+
/**
|
|
173
|
+
* Get resource types for an API group that have audit log data
|
|
174
|
+
* Uses the AuditLogFacetsQuery API to discover resources from actual audit logs.
|
|
175
|
+
*/
|
|
176
|
+
getAuditedResources(apiGroup: string): Promise<string[]>;
|
|
177
|
+
/**
|
|
178
|
+
* Create a PolicyPreview to test a policy against sample input
|
|
179
|
+
* This is a virtual resource that executes immediately and returns results
|
|
180
|
+
*/
|
|
181
|
+
createPolicyPreview(spec: PolicyPreviewSpec): Promise<PolicyPreview>;
|
|
182
|
+
/**
|
|
183
|
+
* List Kubernetes events with optional filtering and pagination
|
|
184
|
+
*/
|
|
185
|
+
listEvents(params?: K8sEventListParams): Promise<K8sEventList>;
|
|
186
|
+
/**
|
|
187
|
+
* Query event facets for filtering UI (autocomplete, distinct values)
|
|
188
|
+
*/
|
|
189
|
+
queryEventFacets(spec: EventFacetQuerySpec): Promise<EventFacetQuery>;
|
|
190
|
+
/**
|
|
191
|
+
* Create an EventQuery to search historical events from ClickHouse.
|
|
192
|
+
* Unlike the live events API (limited to 24 hours), EventQuery supports up to 60 days of history.
|
|
193
|
+
*
|
|
194
|
+
* Returns EventRecord objects with event data nested under the `.event` field.
|
|
195
|
+
*
|
|
196
|
+
* @param spec - Query specification with time range and filters
|
|
197
|
+
* @returns EventQuery with results in status.results as EventRecord[]
|
|
198
|
+
*/
|
|
199
|
+
createEventQuery(spec: EventQuerySpec): Promise<EventQuery>;
|
|
200
|
+
/**
|
|
201
|
+
* Watch events in real-time using the Kubernetes watch API.
|
|
202
|
+
* Returns a stop function and provides callbacks for handling events.
|
|
203
|
+
*
|
|
204
|
+
* @param params - Query parameters (fieldSelector, namespace, etc.)
|
|
205
|
+
* @param options - Watch options
|
|
206
|
+
* @returns Object with stop function
|
|
207
|
+
*/
|
|
208
|
+
watchEvents(params?: Omit<K8sEventListParams, 'watch'>, options?: {
|
|
209
|
+
/** Resource version to start watching from */
|
|
210
|
+
resourceVersion?: string;
|
|
211
|
+
/** Callback when an event is received */
|
|
212
|
+
onEvent?: (event: WatchEvent<K8sEvent>) => void;
|
|
213
|
+
/** Callback when an error occurs */
|
|
214
|
+
onError?: (error: Error) => void;
|
|
215
|
+
/** Callback when the connection closes */
|
|
216
|
+
onClose?: () => void;
|
|
217
|
+
}): {
|
|
218
|
+
stop: () => void;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* List all ReindexJobs
|
|
222
|
+
*/
|
|
223
|
+
listReindexJobs(): Promise<ReindexJobListResource>;
|
|
224
|
+
/**
|
|
225
|
+
* Get a specific ReindexJob by name
|
|
226
|
+
*/
|
|
227
|
+
getReindexJob(name: string): Promise<ReindexJob>;
|
|
228
|
+
/**
|
|
229
|
+
* Create a new ReindexJob
|
|
230
|
+
* @param name Job name
|
|
231
|
+
* @param spec Job specification
|
|
232
|
+
*/
|
|
233
|
+
createReindexJob(name: string, spec: ReindexJobSpec): Promise<ReindexJob>;
|
|
234
|
+
/**
|
|
235
|
+
* Delete a ReindexJob by name
|
|
236
|
+
*/
|
|
237
|
+
deleteReindexJob(name: string): Promise<void>;
|
|
238
|
+
/**
|
|
239
|
+
* Watch ReindexJobs in real-time using the Kubernetes watch API.
|
|
240
|
+
* Returns a stop function and provides callbacks for handling events.
|
|
241
|
+
*
|
|
242
|
+
* @param options - Watch options
|
|
243
|
+
* @returns Object with stop function
|
|
244
|
+
*/
|
|
245
|
+
watchReindexJobs(options?: {
|
|
246
|
+
/** Resource version to start watching from */
|
|
247
|
+
resourceVersion?: string;
|
|
248
|
+
/** Callback when an event is received */
|
|
249
|
+
onEvent?: (event: WatchEvent<ReindexJob>) => void;
|
|
250
|
+
/** Callback when an error occurs */
|
|
251
|
+
onError?: (error: Error) => void;
|
|
252
|
+
/** Callback when the connection closes */
|
|
253
|
+
onClose?: () => void;
|
|
254
|
+
}): {
|
|
255
|
+
stop: () => void;
|
|
256
|
+
};
|
|
257
|
+
private fetch;
|
|
258
|
+
/**
|
|
259
|
+
* Parse JSON response and apply optional transformer.
|
|
260
|
+
* Use this instead of response.json() to support proxy response unwrapping.
|
|
261
|
+
*/
|
|
262
|
+
private parseJson;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,gBAAgB,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,C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AAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;QAChD,oCAAoC;QACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,0CAA0C;QAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,GACA;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;IA+FvB;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAOxD;;OAEG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAOtD;;;;OAIG;IACG,gBAAgB,CACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,CAAC;IAmBtB;;OAEG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnD;;;;;;OAMG;IACH,gBAAgB,CACd,OAAO,CAAC,EAAE;QACR,8CAA8C;QAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,yCAAyC;QACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QAClD,oCAAoC;QACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,0CAA0C;QAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,GACA;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;YAoFT,KAAK;IAwCnB;;;OAGG;YACW,SAAS;CAUxB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ActionMultiSelectOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
count?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ActionMultiSelectProps {
|
|
7
|
+
/** Current selected verbs */
|
|
8
|
+
value: string[];
|
|
9
|
+
/** Handler called when selection changes */
|
|
10
|
+
onChange: (verbs: string[]) => void;
|
|
11
|
+
/** Additional CSS class */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Whether the select is disabled */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Available action options with counts */
|
|
16
|
+
options: ActionMultiSelectOption[];
|
|
17
|
+
/** Whether facets are still loading */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ActionMultiSelect provides a compact multi-select dropdown for filtering by action/verb.
|
|
22
|
+
* Uses checkboxes for multiple selection and displays counts from facet queries.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ActionMultiSelect({ value, onChange, className, disabled, options, isLoading, }: ActionMultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=ActionMultiSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMultiSelect.d.ts","sourceRoot":"","sources":["../../src/components/ActionMultiSelect.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACnC,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,SAAc,EACd,QAAgB,EAChB,OAAO,EACP,SAAiB,GAClB,EAAE,sBAAsB,2CAoFxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ActionOption = 'all' | 'create' | 'update' | 'delete' | 'get' | 'list' | 'watch';
|
|
2
|
+
export interface ActionToggleProps {
|
|
3
|
+
/** Current selected value */
|
|
4
|
+
value: ActionOption;
|
|
5
|
+
/** Handler called when selection changes */
|
|
6
|
+
onChange: (value: ActionOption) => void;
|
|
7
|
+
/** Additional CSS class */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Whether the toggle is disabled */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* ActionToggle provides a segmented control for filtering by action/verb
|
|
14
|
+
*/
|
|
15
|
+
export declare function ActionToggle({ value, onChange, className, disabled, }: ActionToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=ActionToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionToggle.d.ts","sourceRoot":"","sources":["../../src/components/ActionToggle.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7F,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,KAAK,EAAE,YAAY,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2CD;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,SAAc,EACd,QAAgB,GACjB,EAAE,iBAAiB,2CA6BnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Activity, TenantLinkResolver } from '../types/activity';
|
|
2
|
+
export interface ActivityExpandedDetailsProps {
|
|
3
|
+
/** The activity to display details for */
|
|
4
|
+
activity: Activity;
|
|
5
|
+
/** Optional resolver function to make tenant badges clickable */
|
|
6
|
+
tenantLinkResolver?: TenantLinkResolver;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* ActivityExpandedDetails renders the expanded details section for an activity.
|
|
10
|
+
* Used by both feed and timeline variants of ActivityFeedItem for consistent UX.
|
|
11
|
+
*
|
|
12
|
+
* Section order (most to least relevant for investigation):
|
|
13
|
+
* 1. Changes - what changed (most actionable)
|
|
14
|
+
* 2. Timestamp - when it happened
|
|
15
|
+
* 3. Tenant - scope of the activity
|
|
16
|
+
* 4. Actor - who made the change
|
|
17
|
+
* 5. Resource - what resource was affected
|
|
18
|
+
* 6. Origin - correlation to audit logs
|
|
19
|
+
*/
|
|
20
|
+
export declare function ActivityExpandedDetails({ activity, tenantLinkResolver }: ActivityExpandedDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=ActivityExpandedDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityExpandedDetails.d.ts","sourceRoot":"","sources":["../../src/components/ActivityExpandedDetails.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAStE,MAAM,WAAW,4BAA4B;IAC3C,0CAA0C;IAC1C,QAAQ,EAAE,QAAQ,CAAC;IACnB,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,4BAA4B,2CA2IrG"}
|