-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff_types.patch
More file actions
152 lines (152 loc) · 7.07 KB
/
diff_types.patch
File metadata and controls
152 lines (152 loc) · 7.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
diff --git a/admin/src/lib/types.ts b/admin/src/lib/types.ts
index d4c940ea..9974b44a 100644
--- a/admin/src/lib/types.ts
+++ b/admin/src/lib/types.ts
@@ -736,4 +736,145 @@ export interface DashboardErrorsResponse {
unresolved_errors: number;
critical_errors: number;
};
-}
\ No newline at end of file
+}
+
+export interface UsageDto {
+ api_calls: number;
+ validations: number;
+ success_count: number;
+ failure_count: number;
+ period_start: string;
+ period_end: string;
+}
+
+export interface BillingPlanDto {
+ name: string;
+ quota: number;
+ used: number;
+ currency?: string;
+ renews_on?: string;
+}
+
+export type InvoiceStatus = 'paid' | 'due' | 'failed';
+
+export interface InvoiceDto {
+ id: string;
+ date: string;
+ amount: number;
+ status: InvoiceStatus;
+ download_url: string;
+ description?: string;
+}
+
+
+export type HttpMethod =
+ | 'GET'
+ | 'POST'
+ | 'PUT'
+ | 'DELETE'
+ | 'PATCH'
+ | 'OPTIONS'
+ | 'HEAD'
+ | 'TRACE'
+ | 'CONNECT';
+
+export type ValidationResult = 'pass' | 'fail';
+
+export interface ApiLogDto {
+ readonly id: string;
+ readonly timestamp: string;
+ readonly method: HttpMethod;
+ readonly endpoint: string;
+ readonly status_code: number;
+ readonly processing_time_ms: number;
+ readonly tenant_id?: string | null;
+ readonly api_key_id?: string | null;
+ readonly request_id?: string | null;
+ readonly ip_address?: string | null;
+ readonly user_agent?: string | null;
+ readonly error_message?: string | null;
+}
+
+export interface ValidationLogDto {
+ readonly id: string;
+ readonly timestamp: string;
+ readonly document_id: string;
+ readonly tenant_id?: string | null;
+ readonly result: ValidationResult;
+ readonly score: number;
+ readonly violations_count: number;
+ readonly rules_applied_count?: number;
+ readonly processing_time_ms: number;
+ readonly error_message?: string | null;
+}
+
+export type AuditActionType =
+ | 'CREATE'
+ | 'UPDATE'
+ | 'DELETE'
+ | 'LOGIN'
+ | 'LOGOUT'
+ | 'VALIDATE'
+ | 'EXPORT'
+ | 'IMPORT'
+ | 'BACKUP'
+ | 'RESTORE';
+
+export interface AuditLogDto {
+ readonly id: string;
+ readonly timestamp: string;
+ readonly action: AuditActionType;
+ readonly tenant_id?: string | null;
+ readonly user_id?: string | null;
+ readonly resource_type: string;
+ readonly resource_id?: string | null;
+ readonly description: string;
+ readonly ip_address?: string | null;
+ readonly user_agent?: string | null;
+}
+
+export interface LogsFilterParams {
+ start_date?: string;
+ end_date?: string;
+ status?: 'success' | 'failure' | 'pending' | 'timeout';
+ result?: ValidationResult;
+ action?: AuditActionType;
+ tenant_id?: string;
+ endpoint?: string;
+ min_status_code?: number;
+ max_status_code?: number;
+ page?: number;
+ per_page?: number;
+ sort_by?: string;
+ sort_order?: 'asc' | 'desc';
+}
+
+export interface LogsListResponse<T> {
+ logs: T[];
+ total: number;
+ page: number;
+ per_page: number;
+ has_next: boolean;
+ has_prev: boolean;
+}
+
+export interface LogsExportRequest {
+ format: 'csv' | 'json';
+ start_date?: string;
+ end_date?: string;
+ filters?: LogsFilterParams;
+}
+
+export interface LogsExportResponse {
+ download_url: string;
+ filename: string;
+ size_bytes: number;
+ expires_at: string;
+}
+
+// Docs & Playground types
+export interface ValidationResultDto {
+ id: string;
+ status: "pass" | "fail";
+ errors: string[];
+}