@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
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript types for Kubernetes Events (core/v1.Event)
|
|
3
|
+
* Exposed via the Activity API (activity.miloapis.com/v1alpha1)
|
|
4
|
+
*/
|
|
5
|
+
import type { ObjectMeta } from './index';
|
|
6
|
+
import type { FacetSpec, FacetResult } from './activity';
|
|
7
|
+
/**
|
|
8
|
+
* Event types in Kubernetes
|
|
9
|
+
*/
|
|
10
|
+
export type K8sEventType = 'Normal' | 'Warning';
|
|
11
|
+
/**
|
|
12
|
+
* Object reference for the regarding/related object
|
|
13
|
+
*/
|
|
14
|
+
export interface ObjectReference {
|
|
15
|
+
apiVersion?: string;
|
|
16
|
+
kind?: string;
|
|
17
|
+
namespace?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
uid?: string;
|
|
20
|
+
resourceVersion?: string;
|
|
21
|
+
fieldPath?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Event series information (for aggregated events)
|
|
25
|
+
*/
|
|
26
|
+
export interface EventSeries {
|
|
27
|
+
/** Number of occurrences in this series */
|
|
28
|
+
count?: number;
|
|
29
|
+
/** Time of the last occurrence observed */
|
|
30
|
+
lastObservedTime?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Kubernetes Event (events.k8s.io/v1)
|
|
34
|
+
* This is the newer events API that replaces core/v1.Event
|
|
35
|
+
*/
|
|
36
|
+
export interface K8sEvent {
|
|
37
|
+
apiVersion: 'events.k8s.io/v1';
|
|
38
|
+
kind: 'Event';
|
|
39
|
+
metadata: ObjectMeta;
|
|
40
|
+
/** Object this event is about (was involvedObject in core/v1) */
|
|
41
|
+
regarding: ObjectReference;
|
|
42
|
+
/** Optional secondary object for more complex actions */
|
|
43
|
+
related?: ObjectReference;
|
|
44
|
+
/** Short, machine-understandable string that gives the reason for the event */
|
|
45
|
+
reason?: string;
|
|
46
|
+
/** Human-readable description of the event (was message in core/v1) */
|
|
47
|
+
note?: string;
|
|
48
|
+
/** Type of this event (Normal, Warning) */
|
|
49
|
+
type?: K8sEventType;
|
|
50
|
+
/** Time when this Event was first observed (replaces firstTimestamp) */
|
|
51
|
+
eventTime?: string;
|
|
52
|
+
/** What action was taken/failed regarding the object */
|
|
53
|
+
action?: string;
|
|
54
|
+
/** Name of the controller that emitted this event (was source.component in core/v1) */
|
|
55
|
+
reportingController?: string;
|
|
56
|
+
/** ID of the controller instance (was source.host in core/v1) */
|
|
57
|
+
reportingInstance?: string;
|
|
58
|
+
/** Data about the Event series this event represents (was count/firstTimestamp/lastTimestamp) */
|
|
59
|
+
series?: EventSeries;
|
|
60
|
+
/** @deprecated Use regarding instead */
|
|
61
|
+
involvedObject?: ObjectReference;
|
|
62
|
+
/** @deprecated Use note instead */
|
|
63
|
+
message?: string;
|
|
64
|
+
/** @deprecated Use reportingController instead */
|
|
65
|
+
source?: {
|
|
66
|
+
component?: string;
|
|
67
|
+
host?: string;
|
|
68
|
+
};
|
|
69
|
+
/** @deprecated Use series.count instead */
|
|
70
|
+
count?: number;
|
|
71
|
+
deprecatedCount?: number;
|
|
72
|
+
/** @deprecated Use eventTime instead */
|
|
73
|
+
firstTimestamp?: string;
|
|
74
|
+
deprecatedFirstTimestamp?: string;
|
|
75
|
+
/** @deprecated Use series.lastObservedTime instead */
|
|
76
|
+
lastTimestamp?: string;
|
|
77
|
+
deprecatedLastTimestamp?: string;
|
|
78
|
+
/** @deprecated Use reportingController instead */
|
|
79
|
+
reportingComponent?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* EventRecord represents a Kubernetes Event returned in EventQuery results.
|
|
83
|
+
* This is a wrapper type that embeds the events.k8s.io/v1 Event to avoid
|
|
84
|
+
* OpenAPI GVK conflicts while preserving full event data.
|
|
85
|
+
*/
|
|
86
|
+
export interface EventRecord {
|
|
87
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
88
|
+
kind: 'EventRecord';
|
|
89
|
+
metadata: ObjectMeta;
|
|
90
|
+
/** Event contains the full Kubernetes Event data in events.k8s.io/v1 format */
|
|
91
|
+
event: K8sEvent;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Kubernetes Event list response with pagination
|
|
95
|
+
*/
|
|
96
|
+
export interface K8sEventList {
|
|
97
|
+
apiVersion: 'v1';
|
|
98
|
+
kind: 'EventList';
|
|
99
|
+
metadata?: {
|
|
100
|
+
continue?: string;
|
|
101
|
+
resourceVersion?: string;
|
|
102
|
+
};
|
|
103
|
+
items: K8sEvent[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Query parameters for listing Kubernetes Events
|
|
107
|
+
*/
|
|
108
|
+
export interface K8sEventListParams {
|
|
109
|
+
/** Namespace to list events from (empty for all namespaces) */
|
|
110
|
+
namespace?: string;
|
|
111
|
+
/** Field selector for filtering (e.g., "regarding.name=my-pod") */
|
|
112
|
+
fieldSelector?: string;
|
|
113
|
+
/** Label selector for filtering */
|
|
114
|
+
labelSelector?: string;
|
|
115
|
+
/** Maximum results per page */
|
|
116
|
+
limit?: number;
|
|
117
|
+
/** Pagination cursor */
|
|
118
|
+
continue?: string;
|
|
119
|
+
/** Watch for changes */
|
|
120
|
+
watch?: boolean;
|
|
121
|
+
/** Start Watch from this version */
|
|
122
|
+
resourceVersion?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Event facet query request spec
|
|
126
|
+
*/
|
|
127
|
+
export interface EventFacetQuerySpec {
|
|
128
|
+
/** Time range for the facet query */
|
|
129
|
+
timeRange?: {
|
|
130
|
+
start?: string;
|
|
131
|
+
end?: string;
|
|
132
|
+
};
|
|
133
|
+
/** List of facets to query (1-10 facets) */
|
|
134
|
+
facets: FacetSpec[];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Event facet query status with results
|
|
138
|
+
*/
|
|
139
|
+
export interface EventFacetQueryStatus {
|
|
140
|
+
facets: FacetResult[];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Event facet query resource
|
|
144
|
+
* Used to discover available filter values from actual event data
|
|
145
|
+
*/
|
|
146
|
+
export interface EventFacetQuery {
|
|
147
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
148
|
+
kind: 'EventFacetQuery';
|
|
149
|
+
spec: EventFacetQuerySpec;
|
|
150
|
+
status?: EventFacetQueryStatus;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Event filter field definition for autocomplete and help
|
|
154
|
+
*/
|
|
155
|
+
export interface EventFilterField {
|
|
156
|
+
name: string;
|
|
157
|
+
type: 'string' | 'enum';
|
|
158
|
+
description: string;
|
|
159
|
+
enumValues?: string[];
|
|
160
|
+
examples?: string[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Available filter fields for Kubernetes Events
|
|
164
|
+
* These map to field selectors supported by the API (events.k8s.io/v1)
|
|
165
|
+
*/
|
|
166
|
+
export declare const EVENT_FILTER_FIELDS: EventFilterField[];
|
|
167
|
+
/**
|
|
168
|
+
* Event facet fields available for querying
|
|
169
|
+
* These are the fields supported by EventFacetQuery (events.k8s.io/v1)
|
|
170
|
+
*/
|
|
171
|
+
export declare const EVENT_FACET_FIELDS: readonly ["regarding.kind", "regarding.namespace", "reason", "type", "source.component", "metadata.namespace"];
|
|
172
|
+
export type EventFacetField = typeof EVENT_FACET_FIELDS[number];
|
|
173
|
+
/**
|
|
174
|
+
* Extract K8sEvent from EventRecord or pass through if already a K8sEvent.
|
|
175
|
+
* Use this helper when you need to handle both EventRecord (from EventQuery)
|
|
176
|
+
* and K8sEvent (from live events API).
|
|
177
|
+
*/
|
|
178
|
+
export declare function extractEvent(eventOrRecord: K8sEvent | EventRecord): K8sEvent;
|
|
179
|
+
/**
|
|
180
|
+
* Check if an object is an EventRecord (vs a plain K8sEvent)
|
|
181
|
+
*/
|
|
182
|
+
export declare function isEventRecord(obj: K8sEvent | EventRecord): obj is EventRecord;
|
|
183
|
+
/**
|
|
184
|
+
* EventQuery request spec for querying historical events from ClickHouse
|
|
185
|
+
*/
|
|
186
|
+
export interface EventQuerySpec {
|
|
187
|
+
/** Start of time range (RFC3339 or relative like "now-7d") */
|
|
188
|
+
startTime: string;
|
|
189
|
+
/** End of time range (RFC3339 or relative, default: now) */
|
|
190
|
+
endTime: string;
|
|
191
|
+
/** Namespace to filter events (optional) */
|
|
192
|
+
namespace?: string;
|
|
193
|
+
/** Field selector for filtering (standard Kubernetes syntax) */
|
|
194
|
+
fieldSelector?: string;
|
|
195
|
+
/** Maximum results per page (default: 100, max: 1000) */
|
|
196
|
+
limit?: number;
|
|
197
|
+
/** Pagination cursor */
|
|
198
|
+
continue?: string;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* EventQuery status with results
|
|
202
|
+
*/
|
|
203
|
+
export interface EventQueryStatus {
|
|
204
|
+
/** Matching events as EventRecord objects */
|
|
205
|
+
results: EventRecord[];
|
|
206
|
+
/** Pagination cursor for next page */
|
|
207
|
+
continue?: string;
|
|
208
|
+
/** Actual start time used (RFC3339) */
|
|
209
|
+
effectiveStartTime?: string;
|
|
210
|
+
/** Actual end time used (RFC3339) */
|
|
211
|
+
effectiveEndTime?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* EventQuery resource for querying historical events
|
|
215
|
+
* Unlike the live events API (limited to 24h), EventQuery supports up to 60 days of history
|
|
216
|
+
*/
|
|
217
|
+
export interface EventQuery {
|
|
218
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
219
|
+
kind: 'EventQuery';
|
|
220
|
+
metadata?: ObjectMeta;
|
|
221
|
+
spec: EventQuerySpec;
|
|
222
|
+
status?: EventQueryStatus;
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=k8s-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"k8s-event.d.ts","sourceRoot":"","sources":["../../src/types/k8s-event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAA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G,WAAW,GAAG,GAAG,IAAI,WAAW,CAE7E;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,gCAAgC,CAAC;IAC7C,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript types for ActivityPolicy management and preview
|
|
3
|
+
* Based on the Activity Policy system for translating audit events/K8s events into activities
|
|
4
|
+
*/
|
|
5
|
+
import type { ObjectMeta, Event } from './index';
|
|
6
|
+
import type { ActivityLink } from './activity';
|
|
7
|
+
/**
|
|
8
|
+
* Resource specification for an ActivityPolicy
|
|
9
|
+
* Identifies which API group/kind this policy applies to
|
|
10
|
+
*/
|
|
11
|
+
export interface ActivityPolicyResource {
|
|
12
|
+
/** API group (e.g., "networking.datumapis.com") */
|
|
13
|
+
apiGroup: string;
|
|
14
|
+
/** Resource kind (e.g., "HTTPProxy") */
|
|
15
|
+
kind: string;
|
|
16
|
+
/** Optional human-readable label (defaults to kind) */
|
|
17
|
+
kindLabel?: string;
|
|
18
|
+
/** Optional plural label (defaults to kindLabel + "s") */
|
|
19
|
+
kindLabelPlural?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A single rule in an ActivityPolicy
|
|
23
|
+
* Matches events and generates summaries
|
|
24
|
+
*/
|
|
25
|
+
export interface ActivityPolicyRule {
|
|
26
|
+
/** Unique name for this rule within the policy */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Optional human-readable description of what this rule does */
|
|
29
|
+
description?: string;
|
|
30
|
+
/**
|
|
31
|
+
* CEL expression to match events
|
|
32
|
+
* For audit rules: use `audit.*` fields (e.g., `audit.verb == "create"`, `audit.objectRef.namespace == "default"`)
|
|
33
|
+
* For event rules: access via `event.*` (e.g., `event.reason == "Ready"`)
|
|
34
|
+
*/
|
|
35
|
+
match: string;
|
|
36
|
+
/**
|
|
37
|
+
* CEL expression to generate the activity summary
|
|
38
|
+
* Can use {{ }} interpolation for embedded expressions
|
|
39
|
+
* Example: "{{ actor.name }} created {{ kindLabel }} {{ resource.name }}"
|
|
40
|
+
*/
|
|
41
|
+
summary: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Specification for an ActivityPolicy
|
|
45
|
+
*/
|
|
46
|
+
export interface ActivityPolicySpec {
|
|
47
|
+
/** The resource this policy applies to */
|
|
48
|
+
resource: ActivityPolicyResource;
|
|
49
|
+
/** Rules for matching and translating Kubernetes audit events */
|
|
50
|
+
auditRules?: ActivityPolicyRule[];
|
|
51
|
+
/** Rules for matching and translating Kubernetes events */
|
|
52
|
+
eventRules?: ActivityPolicyRule[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Standard Kubernetes condition (from metav1.Condition)
|
|
56
|
+
*/
|
|
57
|
+
export interface Condition {
|
|
58
|
+
/** Type of condition (e.g., "Ready") */
|
|
59
|
+
type: string;
|
|
60
|
+
/** Status of the condition: "True", "False", or "Unknown" */
|
|
61
|
+
status: 'True' | 'False' | 'Unknown';
|
|
62
|
+
/** Last time the condition transitioned */
|
|
63
|
+
lastTransitionTime?: string;
|
|
64
|
+
/** Machine-readable reason for the condition's current status */
|
|
65
|
+
reason?: string;
|
|
66
|
+
/** Human-readable message with details */
|
|
67
|
+
message?: string;
|
|
68
|
+
/** Generation the condition was set based on */
|
|
69
|
+
observedGeneration?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Status of an ActivityPolicy
|
|
73
|
+
*/
|
|
74
|
+
export interface ActivityPolicyStatus {
|
|
75
|
+
/** Conditions represent the current state of the policy.
|
|
76
|
+
* The "Ready" condition indicates whether all rules compile successfully.
|
|
77
|
+
*/
|
|
78
|
+
conditions?: Condition[];
|
|
79
|
+
/** Generation last processed by the controller */
|
|
80
|
+
observedGeneration?: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* ActivityPolicy resource for translating audit events and K8s events into activities
|
|
84
|
+
*/
|
|
85
|
+
export interface ActivityPolicy {
|
|
86
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
87
|
+
kind: 'ActivityPolicy';
|
|
88
|
+
metadata: ObjectMeta;
|
|
89
|
+
spec: ActivityPolicySpec;
|
|
90
|
+
status?: ActivityPolicyStatus;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* List of ActivityPolicy resources
|
|
94
|
+
*/
|
|
95
|
+
export interface ActivityPolicyList {
|
|
96
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
97
|
+
kind: 'ActivityPolicyList';
|
|
98
|
+
metadata?: {
|
|
99
|
+
continue?: string;
|
|
100
|
+
resourceVersion?: string;
|
|
101
|
+
};
|
|
102
|
+
items: ActivityPolicy[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Input type for policy preview
|
|
106
|
+
*/
|
|
107
|
+
export type PolicyPreviewInputType = 'audit' | 'event';
|
|
108
|
+
/**
|
|
109
|
+
* Kubernetes Event for policy preview
|
|
110
|
+
* Simplified version focused on fields used in policy matching
|
|
111
|
+
* Supports both eventsv1 (new) and corev1 (deprecated) field names
|
|
112
|
+
*/
|
|
113
|
+
export interface KubernetesEvent {
|
|
114
|
+
/** Event type: "Normal" or "Warning" */
|
|
115
|
+
type?: string;
|
|
116
|
+
/** Short reason for the event (e.g., "Created", "Ready", "Failed") */
|
|
117
|
+
reason?: string;
|
|
118
|
+
/** Human-readable description (eventsv1 field name) */
|
|
119
|
+
note?: string;
|
|
120
|
+
/** @deprecated Use note instead (corev1 field name) */
|
|
121
|
+
message?: string;
|
|
122
|
+
/** Object this event is about (eventsv1 field name) */
|
|
123
|
+
regarding?: {
|
|
124
|
+
apiVersion?: string;
|
|
125
|
+
kind?: string;
|
|
126
|
+
name?: string;
|
|
127
|
+
namespace?: string;
|
|
128
|
+
uid?: string;
|
|
129
|
+
resourceVersion?: string;
|
|
130
|
+
};
|
|
131
|
+
/** @deprecated Use regarding instead (corev1 field name) */
|
|
132
|
+
involvedObject?: {
|
|
133
|
+
apiVersion?: string;
|
|
134
|
+
kind?: string;
|
|
135
|
+
name?: string;
|
|
136
|
+
namespace?: string;
|
|
137
|
+
uid?: string;
|
|
138
|
+
resourceVersion?: string;
|
|
139
|
+
};
|
|
140
|
+
/** Controller that emitted this event (eventsv1 field name) */
|
|
141
|
+
reportingController?: string;
|
|
142
|
+
/** ID of the controller instance (eventsv1 field name) */
|
|
143
|
+
reportingInstance?: string;
|
|
144
|
+
/** @deprecated Use reportingController instead (corev1 field name) */
|
|
145
|
+
source?: {
|
|
146
|
+
component?: string;
|
|
147
|
+
host?: string;
|
|
148
|
+
};
|
|
149
|
+
/** Time when this event was first observed (eventsv1 field name) */
|
|
150
|
+
eventTime?: string;
|
|
151
|
+
/** Event series data (eventsv1 field name) */
|
|
152
|
+
series?: {
|
|
153
|
+
count?: number;
|
|
154
|
+
lastObservedTime?: string;
|
|
155
|
+
};
|
|
156
|
+
/** @deprecated Use eventTime instead (corev1 field name) */
|
|
157
|
+
firstTimestamp?: string;
|
|
158
|
+
/** @deprecated Use series.lastObservedTime instead (corev1 field name) */
|
|
159
|
+
lastTimestamp?: string;
|
|
160
|
+
/** @deprecated Use series.count instead (corev1 field name) */
|
|
161
|
+
count?: number;
|
|
162
|
+
/** Metadata about the event */
|
|
163
|
+
metadata?: ObjectMeta;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Input for policy preview - either an audit event or K8s event
|
|
167
|
+
*/
|
|
168
|
+
export interface PolicyPreviewInput {
|
|
169
|
+
/** Type of input */
|
|
170
|
+
type: PolicyPreviewInputType;
|
|
171
|
+
/** Audit event (when type is "audit") */
|
|
172
|
+
audit?: Event;
|
|
173
|
+
/** Kubernetes event (when type is "event") */
|
|
174
|
+
event?: KubernetesEvent;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The policy spec to test in a preview (subset of ActivityPolicySpec)
|
|
178
|
+
*/
|
|
179
|
+
export interface PolicyPreviewPolicySpec {
|
|
180
|
+
/** Resource specification */
|
|
181
|
+
resource: ActivityPolicyResource;
|
|
182
|
+
/** Audit rules to test */
|
|
183
|
+
auditRules?: ActivityPolicyRule[];
|
|
184
|
+
/** Event rules to test */
|
|
185
|
+
eventRules?: ActivityPolicyRule[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Auto-fetch configuration for PolicyPreview
|
|
189
|
+
* Mutually exclusive with manual inputs
|
|
190
|
+
*/
|
|
191
|
+
export interface AutoFetchSpec {
|
|
192
|
+
/** Maximum samples to fetch (default: 10, max: 50) */
|
|
193
|
+
limit?: number;
|
|
194
|
+
/** Time range to search (e.g., "1h", "24h", "7d") - default: "24h" */
|
|
195
|
+
timeRange?: string;
|
|
196
|
+
/** What to fetch: "audit", "events", or "both" - default: "both" */
|
|
197
|
+
sources?: 'audit' | 'events' | 'both';
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Specification for a PolicyPreview request
|
|
201
|
+
*/
|
|
202
|
+
export interface PolicyPreviewSpec {
|
|
203
|
+
/** The policy to test */
|
|
204
|
+
policy: PolicyPreviewPolicySpec;
|
|
205
|
+
/** The inputs to test against (supports multiple) - optional if autoFetch is set */
|
|
206
|
+
inputs?: PolicyPreviewInput[];
|
|
207
|
+
/** Auto-fetch spec - mutually exclusive with inputs */
|
|
208
|
+
autoFetch?: AutoFetchSpec;
|
|
209
|
+
/** Optional kind label override */
|
|
210
|
+
kindLabel?: string;
|
|
211
|
+
/** Optional kind label plural override */
|
|
212
|
+
kindLabelPlural?: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Result for a single input in the preview
|
|
216
|
+
*/
|
|
217
|
+
export interface PolicyPreviewInputResult {
|
|
218
|
+
/** Index of this input in spec.inputs (0-based) */
|
|
219
|
+
inputIndex: number;
|
|
220
|
+
/** Whether any rule matched this input */
|
|
221
|
+
matched: boolean;
|
|
222
|
+
/** Index of the matched rule (0-based), -1 if no match */
|
|
223
|
+
matchedRuleIndex: number;
|
|
224
|
+
/** Type of rule that matched ("audit" or "event") */
|
|
225
|
+
matchedRuleType?: PolicyPreviewInputType;
|
|
226
|
+
/** Error message if evaluating this input failed */
|
|
227
|
+
error?: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Preview Activity - simplified activity for preview display
|
|
231
|
+
*/
|
|
232
|
+
export interface PreviewActivity {
|
|
233
|
+
/** Activity metadata */
|
|
234
|
+
metadata?: ObjectMeta;
|
|
235
|
+
/** Activity spec */
|
|
236
|
+
spec: {
|
|
237
|
+
/** Human-readable summary */
|
|
238
|
+
summary: string;
|
|
239
|
+
/** Change source: "human" or "system" */
|
|
240
|
+
changeSource: string;
|
|
241
|
+
/** Actor who performed the action */
|
|
242
|
+
actor: {
|
|
243
|
+
type: string;
|
|
244
|
+
name: string;
|
|
245
|
+
uid?: string;
|
|
246
|
+
email?: string;
|
|
247
|
+
};
|
|
248
|
+
/** Resource that was affected */
|
|
249
|
+
resource: {
|
|
250
|
+
apiGroup?: string;
|
|
251
|
+
apiVersion?: string;
|
|
252
|
+
kind?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
namespace?: string;
|
|
255
|
+
uid?: string;
|
|
256
|
+
};
|
|
257
|
+
/** Links in the summary */
|
|
258
|
+
links?: ActivityLink[];
|
|
259
|
+
/** Origin of this activity */
|
|
260
|
+
origin: {
|
|
261
|
+
type: string;
|
|
262
|
+
id: string;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Status of a PolicyPreview showing the results
|
|
268
|
+
*/
|
|
269
|
+
export interface PolicyPreviewStatus {
|
|
270
|
+
/** Rendered Activity objects for inputs that matched */
|
|
271
|
+
activities?: PreviewActivity[];
|
|
272
|
+
/** Per-input results in the same order as spec.inputs */
|
|
273
|
+
results?: PolicyPreviewInputResult[];
|
|
274
|
+
/** General error message if preview failed entirely */
|
|
275
|
+
error?: string;
|
|
276
|
+
/** Auto-fetched inputs (populated when autoFetch is used) */
|
|
277
|
+
fetchedInputs?: PolicyPreviewInput[];
|
|
278
|
+
/** @deprecated Use results[].matched */
|
|
279
|
+
matched?: boolean;
|
|
280
|
+
/** @deprecated Use results[].matchedRuleIndex */
|
|
281
|
+
matchedRuleIndex?: number;
|
|
282
|
+
/** @deprecated Use results[].matchedRuleType */
|
|
283
|
+
matchedRuleType?: PolicyPreviewInputType;
|
|
284
|
+
/** @deprecated Use activities[0].spec.summary */
|
|
285
|
+
generatedSummary?: string;
|
|
286
|
+
/** @deprecated Use activities[0].spec.links */
|
|
287
|
+
generatedLinks?: ActivityLink[];
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* PolicyPreview resource for testing policies before deployment
|
|
291
|
+
*/
|
|
292
|
+
export interface PolicyPreview {
|
|
293
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
294
|
+
kind: 'PolicyPreview';
|
|
295
|
+
metadata?: ObjectMeta;
|
|
296
|
+
spec: PolicyPreviewSpec;
|
|
297
|
+
status?: PolicyPreviewStatus;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Grouped policies by API group for display
|
|
301
|
+
*/
|
|
302
|
+
export interface PolicyGroup {
|
|
303
|
+
apiGroup: string;
|
|
304
|
+
policies: ActivityPolicy[];
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Sample input template for quick-fill
|
|
308
|
+
*/
|
|
309
|
+
export interface SampleInputTemplate {
|
|
310
|
+
/** Display name for the template */
|
|
311
|
+
name: string;
|
|
312
|
+
/** Description of what this template represents */
|
|
313
|
+
description: string;
|
|
314
|
+
/** The input type */
|
|
315
|
+
type: PolicyPreviewInputType;
|
|
316
|
+
/** The sample input data */
|
|
317
|
+
input: PolicyPreviewInput;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Filter fields available for policy listing
|
|
321
|
+
*/
|
|
322
|
+
export interface PolicyFilterField {
|
|
323
|
+
name: string;
|
|
324
|
+
type: 'string' | 'enum';
|
|
325
|
+
description: string;
|
|
326
|
+
enumValues?: string[];
|
|
327
|
+
examples?: string[];
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Available filter fields for policies
|
|
331
|
+
*/
|
|
332
|
+
export declare const POLICY_FILTER_FIELDS: PolicyFilterField[];
|
|
333
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/types/policy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,mD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KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EA4BnD,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript types for ReindexJob management
|
|
3
|
+
* Based on the ReindexJob API (activity.miloapis.com/v1alpha1)
|
|
4
|
+
*/
|
|
5
|
+
import type { ObjectMeta } from './index';
|
|
6
|
+
/**
|
|
7
|
+
* Phase represents the lifecycle phase of a ReindexJob
|
|
8
|
+
*/
|
|
9
|
+
export type ReindexJobPhase = 'Pending' | 'Running' | 'Succeeded' | 'Failed';
|
|
10
|
+
/**
|
|
11
|
+
* Time range for reindexing
|
|
12
|
+
*/
|
|
13
|
+
export interface ReindexTimeRange {
|
|
14
|
+
/**
|
|
15
|
+
* Start time (relative like "now-7d" or absolute ISO 8601)
|
|
16
|
+
* Relative: "now-30d", "now-2h", "now-30m" (units: s, m, h, d, w)
|
|
17
|
+
* Absolute: "2026-02-01T00:00:00Z"
|
|
18
|
+
*/
|
|
19
|
+
startTime: string;
|
|
20
|
+
/**
|
|
21
|
+
* End time (defaults to "now" if omitted)
|
|
22
|
+
* Uses same formats as startTime
|
|
23
|
+
*/
|
|
24
|
+
endTime?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Selector for which policies to reindex
|
|
28
|
+
*/
|
|
29
|
+
export interface ReindexPolicySelector {
|
|
30
|
+
/** List of ActivityPolicy names (mutually exclusive with matchLabels) */
|
|
31
|
+
names?: string[];
|
|
32
|
+
/** Label selector (mutually exclusive with names) */
|
|
33
|
+
matchLabels?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Specification for a ReindexJob
|
|
37
|
+
*/
|
|
38
|
+
export interface ReindexJobSpec {
|
|
39
|
+
/** Time window of events to re-index */
|
|
40
|
+
timeRange: ReindexTimeRange;
|
|
41
|
+
/** Optional selector for specific policies */
|
|
42
|
+
policySelector?: ReindexPolicySelector;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Status of a ReindexJob
|
|
46
|
+
*/
|
|
47
|
+
export interface ReindexJobStatus {
|
|
48
|
+
/** Current lifecycle phase */
|
|
49
|
+
phase?: ReindexJobPhase;
|
|
50
|
+
/** Human-readable description of the current state */
|
|
51
|
+
message?: string;
|
|
52
|
+
/** When processing began */
|
|
53
|
+
startedAt?: string;
|
|
54
|
+
/** When processing finished (success or failure) */
|
|
55
|
+
completedAt?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* ReindexJob resource for re-processing historical audit logs and events
|
|
59
|
+
*/
|
|
60
|
+
export interface ReindexJob {
|
|
61
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
62
|
+
kind: 'ReindexJob';
|
|
63
|
+
metadata: ObjectMeta;
|
|
64
|
+
spec: ReindexJobSpec;
|
|
65
|
+
status?: ReindexJobStatus;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* List of ReindexJob resources (Kubernetes list type)
|
|
69
|
+
*/
|
|
70
|
+
export interface ReindexJobListResource {
|
|
71
|
+
apiVersion: 'activity.miloapis.com/v1alpha1';
|
|
72
|
+
kind: 'ReindexJobList';
|
|
73
|
+
metadata?: {
|
|
74
|
+
continue?: string;
|
|
75
|
+
resourceVersion?: string;
|
|
76
|
+
};
|
|
77
|
+
items: ReindexJob[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Helper type for creating a new ReindexJob
|
|
81
|
+
*/
|
|
82
|
+
export interface CreateReindexJobParams {
|
|
83
|
+
name: string;
|
|
84
|
+
spec: ReindexJobSpec;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Check if a ReindexJob is in a terminal state
|
|
88
|
+
*/
|
|
89
|
+
export declare function isReindexJobTerminal(job: ReindexJob): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Check if a ReindexJob is currently running
|
|
92
|
+
*/
|
|
93
|
+
export declare function isReindexJobRunning(job: ReindexJob): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Get a human-readable status message
|
|
96
|
+
*/
|
|
97
|
+
export declare function getReindexJobStatusMessage(job: ReindexJob): string;
|
|
98
|
+
/**
|
|
99
|
+
* Get duration of a ReindexJob
|
|
100
|
+
*/
|
|
101
|
+
export declare function getReindexJobDuration(job: ReindexJob): string | null;
|
|
102
|
+
//# sourceMappingURL=reindex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reindex.d.ts","sourceRoot":"","sources":["../../src/types/reindex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,8CAA8C;IAC9C,cAAc,CAAC,EAAE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