@nice2dev/ui-tools 1.0.10
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 +36 -0
- package/dist/access-control.d.ts +726 -0
- package/dist/access-control.d.ts.map +1 -0
- package/dist/accessibility-i18n.d.ts +1017 -0
- package/dist/accessibility-i18n.d.ts.map +1 -0
- package/dist/ai-assistant.d.ts +263 -0
- package/dist/ai-assistant.d.ts.map +1 -0
- package/dist/ai-playgrounds.d.ts +842 -0
- package/dist/ai-playgrounds.d.ts.map +1 -0
- package/dist/alerting-incidents.d.ts +558 -0
- package/dist/alerting-incidents.d.ts.map +1 -0
- package/dist/api-designer.d.ts +1568 -0
- package/dist/api-designer.d.ts.map +1 -0
- package/dist/api-testing.d.ts +1146 -0
- package/dist/api-testing.d.ts.map +1 -0
- package/dist/apm-profiling.d.ts +656 -0
- package/dist/apm-profiling.d.ts.map +1 -0
- package/dist/artifacts.d.ts +421 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/audit-compliance.d.ts +752 -0
- package/dist/audit-compliance.d.ts.map +1 -0
- package/dist/certificates.d.ts +256 -0
- package/dist/certificates.d.ts.map +1 -0
- package/dist/chart-builder.d.ts +1404 -0
- package/dist/chart-builder.d.ts.map +1 -0
- package/dist/cloud-instances.d.ts +169 -0
- package/dist/cloud-instances.d.ts.map +1 -0
- package/dist/config-management.d.ts +350 -0
- package/dist/config-management.d.ts.map +1 -0
- package/dist/containers.d.ts +256 -0
- package/dist/containers.d.ts.map +1 -0
- package/dist/dashboard-designer.d.ts +1238 -0
- package/dist/dashboard-designer.d.ts.map +1 -0
- package/dist/data-management.d.ts +496 -0
- package/dist/data-management.d.ts.map +1 -0
- package/dist/data-pipeline.d.ts +1105 -0
- package/dist/data-pipeline.d.ts.map +1 -0
- package/dist/data-warehouse.d.ts +1097 -0
- package/dist/data-warehouse.d.ts.map +1 -0
- package/dist/dataset-management.d.ts +782 -0
- package/dist/dataset-management.d.ts.map +1 -0
- package/dist/db-adapters.d.ts +704 -0
- package/dist/db-adapters.d.ts.map +1 -0
- package/dist/db-admin.d.ts +699 -0
- package/dist/db-admin.d.ts.map +1 -0
- package/dist/db-designer.d.ts +366 -0
- package/dist/db-designer.d.ts.map +1 -0
- package/dist/debugger.d.ts +356 -0
- package/dist/debugger.d.ts.map +1 -0
- package/dist/device-management.d.ts +871 -0
- package/dist/device-management.d.ts.map +1 -0
- package/dist/distributed-tracing.d.ts +427 -0
- package/dist/distributed-tracing.d.ts.map +1 -0
- package/dist/dns-management.d.ts +215 -0
- package/dist/dns-management.d.ts.map +1 -0
- package/dist/download-manager.d.ts +271 -0
- package/dist/download-manager.d.ts.map +1 -0
- package/dist/download-torrent.d.ts +1062 -0
- package/dist/download-torrent.d.ts.map +1 -0
- package/dist/edge-computing.d.ts +720 -0
- package/dist/edge-computing.d.ts.map +1 -0
- package/dist/education.d.ts +1135 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/email-template.d.ts +1141 -0
- package/dist/email-template.d.ts.map +1 -0
- package/dist/erp-enterprise.d.ts +1270 -0
- package/dist/erp-enterprise.d.ts.map +1 -0
- package/dist/form-builder.d.ts +1117 -0
- package/dist/form-builder.d.ts.map +1 -0
- package/dist/game-engine-advanced.d.ts +1049 -0
- package/dist/game-engine-advanced.d.ts.map +1 -0
- package/dist/git.d.ts +415 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/hardware-integration.d.ts +966 -0
- package/dist/hardware-integration.d.ts.map +1 -0
- package/dist/iac.d.ts +318 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/icon-tools.d.ts +1023 -0
- package/dist/icon-tools.d.ts.map +1 -0
- package/dist/ide.d.ts +322 -0
- package/dist/ide.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1887 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-platform.d.ts +857 -0
- package/dist/integration-platform.d.ts.map +1 -0
- package/dist/kubernetes.d.ts +278 -0
- package/dist/kubernetes.d.ts.map +1 -0
- package/dist/life-management.d.ts +1132 -0
- package/dist/life-management.d.ts.map +1 -0
- package/dist/log-management.d.ts +473 -0
- package/dist/log-management.d.ts.map +1 -0
- package/dist/mathematics.d.ts +870 -0
- package/dist/mathematics.d.ts.map +1 -0
- package/dist/message-queue.d.ts +1006 -0
- package/dist/message-queue.d.ts.map +1 -0
- package/dist/metrics-dashboard.d.ts +596 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/mobile-components.d.ts +766 -0
- package/dist/mobile-components.d.ts.map +1 -0
- package/dist/model-deployment.d.ts +787 -0
- package/dist/model-deployment.d.ts.map +1 -0
- package/dist/model-registry.d.ts +740 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-training.d.ts +706 -0
- package/dist/model-training.d.ts.map +1 -0
- package/dist/network-config.d.ts +334 -0
- package/dist/network-config.d.ts.map +1 -0
- package/dist/network-monitoring.d.ts +291 -0
- package/dist/network-monitoring.d.ts.map +1 -0
- package/dist/pdf-tools.d.ts +1003 -0
- package/dist/pdf-tools.d.ts.map +1 -0
- package/dist/pipelines.d.ts +250 -0
- package/dist/pipelines.d.ts.map +1 -0
- package/dist/remote-desktop.d.ts +207 -0
- package/dist/remote-desktop.d.ts.map +1 -0
- package/dist/report-designer.d.ts +1153 -0
- package/dist/report-designer.d.ts.map +1 -0
- package/dist/scada-industrial.d.ts +848 -0
- package/dist/scada-industrial.d.ts.map +1 -0
- package/dist/scientific-research.d.ts +1149 -0
- package/dist/scientific-research.d.ts.map +1 -0
- package/dist/secret-management.d.ts +617 -0
- package/dist/secret-management.d.ts.map +1 -0
- package/dist/security-scanning.d.ts +714 -0
- package/dist/security-scanning.d.ts.map +1 -0
- package/dist/self-service-analytics.d.ts +1208 -0
- package/dist/self-service-analytics.d.ts.map +1 -0
- package/dist/sensor-dashboard.d.ts +845 -0
- package/dist/sensor-dashboard.d.ts.map +1 -0
- package/dist/server-management.d.ts +331 -0
- package/dist/server-management.d.ts.map +1 -0
- package/dist/smart-home.d.ts +861 -0
- package/dist/smart-home.d.ts.map +1 -0
- package/dist/spreadsheet.d.ts +1043 -0
- package/dist/spreadsheet.d.ts.map +1 -0
- package/dist/sql-editor.d.ts +402 -0
- package/dist/sql-editor.d.ts.map +1 -0
- package/dist/terminal.d.ts +245 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/testing-qa.d.ts +1013 -0
- package/dist/testing-qa.d.ts.map +1 -0
- package/dist/torrent-client.d.ts +298 -0
- package/dist/torrent-client.d.ts.map +1 -0
- package/dist/traceless.d.ts +759 -0
- package/dist/traceless.d.ts.map +1 -0
- package/dist/virtual-machines.d.ts +199 -0
- package/dist/virtual-machines.d.ts.map +1 -0
- package/dist/visual-scripting.d.ts +381 -0
- package/dist/visual-scripting.d.ts.map +1 -0
- package/dist/word-processor.d.ts +1124 -0
- package/dist/word-processor.d.ts.map +1 -0
- package/dist/workspace.d.ts +333 -0
- package/dist/workspace.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file db-admin.ts
|
|
3
|
+
* @module @nice2dev/ui-tools/db-admin
|
|
4
|
+
* @description PRO-10.5 — Database Administration types
|
|
5
|
+
*
|
|
6
|
+
* Connection pool monitor, query monitor, lock detection, performance,
|
|
7
|
+
* backup/recovery, user management, audit logs.
|
|
8
|
+
*/
|
|
9
|
+
/** Connection pool statistics */
|
|
10
|
+
export interface ConnectionPoolStats {
|
|
11
|
+
readonly connectionId: string;
|
|
12
|
+
readonly poolName: string;
|
|
13
|
+
readonly minSize: number;
|
|
14
|
+
readonly maxSize: number;
|
|
15
|
+
readonly activeConnections: number;
|
|
16
|
+
readonly idleConnections: number;
|
|
17
|
+
readonly waitingRequests: number;
|
|
18
|
+
readonly totalConnectionsCreated: number;
|
|
19
|
+
readonly totalConnectionsClosed: number;
|
|
20
|
+
readonly averageAcquireTime: number;
|
|
21
|
+
readonly maxAcquireTime: number;
|
|
22
|
+
readonly averageUsageTime: number;
|
|
23
|
+
readonly lastUpdated: Date;
|
|
24
|
+
}
|
|
25
|
+
/** Individual pool connection */
|
|
26
|
+
export interface PoolConnection {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly state: 'active' | 'idle' | 'validating' | 'evicting';
|
|
29
|
+
readonly createdAt: Date;
|
|
30
|
+
readonly lastUsedAt: Date;
|
|
31
|
+
readonly lastValidatedAt?: Date;
|
|
32
|
+
readonly useCount: number;
|
|
33
|
+
readonly currentQuery?: string;
|
|
34
|
+
readonly clientInfo?: string;
|
|
35
|
+
readonly remoteAddress?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Pool health status */
|
|
38
|
+
export interface PoolHealthStatus {
|
|
39
|
+
readonly healthy: boolean;
|
|
40
|
+
readonly utilizationPercent: number;
|
|
41
|
+
readonly waitQueueLength: number;
|
|
42
|
+
readonly averageResponseTime: number;
|
|
43
|
+
readonly errorRate: number;
|
|
44
|
+
readonly issues: readonly PoolIssue[];
|
|
45
|
+
}
|
|
46
|
+
/** Pool issue */
|
|
47
|
+
export interface PoolIssue {
|
|
48
|
+
readonly severity: 'warning' | 'error' | 'critical';
|
|
49
|
+
readonly type: 'exhaustion' | 'leak' | 'slow_acquire' | 'connection_errors' | 'validation_failures';
|
|
50
|
+
readonly message: string;
|
|
51
|
+
readonly recommendation: string;
|
|
52
|
+
}
|
|
53
|
+
/** Active query */
|
|
54
|
+
export interface ActiveQuery {
|
|
55
|
+
readonly pid: number | string;
|
|
56
|
+
readonly queryId?: string;
|
|
57
|
+
readonly database: string;
|
|
58
|
+
readonly username: string;
|
|
59
|
+
readonly applicationName?: string;
|
|
60
|
+
readonly clientAddress?: string;
|
|
61
|
+
readonly clientPort?: number;
|
|
62
|
+
readonly state: QueryState;
|
|
63
|
+
readonly query: string;
|
|
64
|
+
readonly queryStart: Date;
|
|
65
|
+
readonly duration: number;
|
|
66
|
+
readonly waitEventType?: string;
|
|
67
|
+
readonly waitEvent?: string;
|
|
68
|
+
readonly transactionId?: string;
|
|
69
|
+
readonly blocker?: number | string;
|
|
70
|
+
readonly cpuTime?: number;
|
|
71
|
+
readonly memoryUsage?: number;
|
|
72
|
+
}
|
|
73
|
+
/** Query state */
|
|
74
|
+
export type QueryState = 'active' | 'idle' | 'idle_in_transaction' | 'idle_in_transaction_aborted' | 'fastpath_function_call' | 'disabled' | 'running' | 'sleeping' | 'suspended' | 'background';
|
|
75
|
+
/** Query statistics */
|
|
76
|
+
export interface QueryStatistics {
|
|
77
|
+
readonly queryHash: string;
|
|
78
|
+
readonly normalizedQuery: string;
|
|
79
|
+
readonly calls: number;
|
|
80
|
+
readonly totalTime: number;
|
|
81
|
+
readonly minTime: number;
|
|
82
|
+
readonly maxTime: number;
|
|
83
|
+
readonly meanTime: number;
|
|
84
|
+
readonly stddevTime: number;
|
|
85
|
+
readonly rows: number;
|
|
86
|
+
readonly sharedBlksHit?: number;
|
|
87
|
+
readonly sharedBlksRead?: number;
|
|
88
|
+
readonly sharedBlksDirtied?: number;
|
|
89
|
+
readonly sharedBlksWritten?: number;
|
|
90
|
+
readonly tempBlksRead?: number;
|
|
91
|
+
readonly tempBlksWritten?: number;
|
|
92
|
+
readonly blkReadTime?: number;
|
|
93
|
+
readonly blkWriteTime?: number;
|
|
94
|
+
}
|
|
95
|
+
/** Query kill options */
|
|
96
|
+
export interface QueryKillOptions {
|
|
97
|
+
readonly pid: number | string;
|
|
98
|
+
readonly signal: 'cancel' | 'terminate';
|
|
99
|
+
readonly cascade: boolean;
|
|
100
|
+
readonly reason?: string;
|
|
101
|
+
}
|
|
102
|
+
/** Database lock */
|
|
103
|
+
export interface DbLock {
|
|
104
|
+
readonly lockId: string;
|
|
105
|
+
readonly pid: number | string;
|
|
106
|
+
readonly database: string;
|
|
107
|
+
readonly schema?: string;
|
|
108
|
+
readonly relation?: string;
|
|
109
|
+
readonly lockType: LockType;
|
|
110
|
+
readonly lockMode: LockMode;
|
|
111
|
+
readonly granted: boolean;
|
|
112
|
+
readonly waitStart?: Date;
|
|
113
|
+
readonly duration?: number;
|
|
114
|
+
readonly query?: string;
|
|
115
|
+
readonly transactionId?: string;
|
|
116
|
+
readonly blockedBy?: readonly number[];
|
|
117
|
+
readonly blocking?: readonly number[];
|
|
118
|
+
}
|
|
119
|
+
/** Lock type */
|
|
120
|
+
export type LockType = 'relation' | 'extend' | 'frozenid' | 'page' | 'tuple' | 'transactionid' | 'virtualxid' | 'speculative_token' | 'object' | 'userlock' | 'advisory' | 'applytransaction';
|
|
121
|
+
/** Lock mode */
|
|
122
|
+
export type LockMode = 'AccessShareLock' | 'RowShareLock' | 'RowExclusiveLock' | 'ShareUpdateExclusiveLock' | 'ShareLock' | 'ShareRowExclusiveLock' | 'ExclusiveLock' | 'AccessExclusiveLock' | 'IS' | 'IX' | 'S' | 'U' | 'X';
|
|
123
|
+
/** Deadlock info */
|
|
124
|
+
export interface DeadlockInfo {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly detectedAt: Date;
|
|
127
|
+
readonly participants: readonly DeadlockParticipant[];
|
|
128
|
+
readonly victim: number | string;
|
|
129
|
+
readonly graph: DeadlockGraph;
|
|
130
|
+
}
|
|
131
|
+
/** Deadlock participant */
|
|
132
|
+
export interface DeadlockParticipant {
|
|
133
|
+
readonly pid: number | string;
|
|
134
|
+
readonly query: string;
|
|
135
|
+
readonly lockType: LockType;
|
|
136
|
+
readonly lockMode: LockMode;
|
|
137
|
+
readonly waitingFor: number | string;
|
|
138
|
+
readonly holdingLock?: string;
|
|
139
|
+
}
|
|
140
|
+
/** Deadlock graph */
|
|
141
|
+
export interface DeadlockGraph {
|
|
142
|
+
readonly nodes: readonly {
|
|
143
|
+
id: string;
|
|
144
|
+
label: string;
|
|
145
|
+
}[];
|
|
146
|
+
readonly edges: readonly {
|
|
147
|
+
from: string;
|
|
148
|
+
to: string;
|
|
149
|
+
label: string;
|
|
150
|
+
}[];
|
|
151
|
+
}
|
|
152
|
+
/** Lock conflict detection */
|
|
153
|
+
export interface LockConflict {
|
|
154
|
+
readonly blockerPid: number | string;
|
|
155
|
+
readonly blockerQuery: string;
|
|
156
|
+
readonly blockerStartTime: Date;
|
|
157
|
+
readonly blockedPid: number | string;
|
|
158
|
+
readonly blockedQuery: string;
|
|
159
|
+
readonly blockedWaitTime: number;
|
|
160
|
+
readonly lockType: LockType;
|
|
161
|
+
readonly lockMode: LockMode;
|
|
162
|
+
readonly relation?: string;
|
|
163
|
+
}
|
|
164
|
+
/** Slow query entry */
|
|
165
|
+
export interface SlowQueryEntry {
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly query: string;
|
|
168
|
+
readonly normalizedQuery: string;
|
|
169
|
+
readonly database: string;
|
|
170
|
+
readonly username: string;
|
|
171
|
+
readonly applicationName?: string;
|
|
172
|
+
readonly startTime: Date;
|
|
173
|
+
readonly duration: number;
|
|
174
|
+
readonly rowsAffected: number;
|
|
175
|
+
readonly rowsExamined?: number;
|
|
176
|
+
readonly bytesReceived?: number;
|
|
177
|
+
readonly bytesSent?: number;
|
|
178
|
+
readonly lockTime?: number;
|
|
179
|
+
readonly tmpTables?: number;
|
|
180
|
+
readonly tmpDiskTables?: number;
|
|
181
|
+
readonly fullScan: boolean;
|
|
182
|
+
readonly fullJoin: boolean;
|
|
183
|
+
readonly plan?: string;
|
|
184
|
+
readonly parameters?: readonly unknown[];
|
|
185
|
+
}
|
|
186
|
+
/** Slow query analysis */
|
|
187
|
+
export interface SlowQueryAnalysis {
|
|
188
|
+
readonly query: string;
|
|
189
|
+
readonly normalizedQuery: string;
|
|
190
|
+
readonly occurrences: number;
|
|
191
|
+
readonly totalDuration: number;
|
|
192
|
+
readonly avgDuration: number;
|
|
193
|
+
readonly maxDuration: number;
|
|
194
|
+
readonly minDuration: number;
|
|
195
|
+
readonly p50Duration: number;
|
|
196
|
+
readonly p95Duration: number;
|
|
197
|
+
readonly p99Duration: number;
|
|
198
|
+
readonly suggestions: readonly QueryOptimizationSuggestion[];
|
|
199
|
+
readonly samplePlan?: string;
|
|
200
|
+
}
|
|
201
|
+
/** Query optimization suggestion */
|
|
202
|
+
export interface QueryOptimizationSuggestion {
|
|
203
|
+
readonly type: 'index' | 'rewrite' | 'schema' | 'parameter' | 'hint';
|
|
204
|
+
readonly severity: 'low' | 'medium' | 'high';
|
|
205
|
+
readonly description: string;
|
|
206
|
+
readonly suggestedChange?: string;
|
|
207
|
+
readonly estimatedImprovement?: string;
|
|
208
|
+
}
|
|
209
|
+
/** Index recommendation */
|
|
210
|
+
export interface IndexRecommendation {
|
|
211
|
+
readonly id: string;
|
|
212
|
+
readonly tableName: string;
|
|
213
|
+
readonly schema: string;
|
|
214
|
+
readonly columns: readonly string[];
|
|
215
|
+
readonly indexType: 'btree' | 'hash' | 'gin' | 'gist' | 'brin' | 'fulltext';
|
|
216
|
+
readonly isUnique: boolean;
|
|
217
|
+
readonly includeColumns?: readonly string[];
|
|
218
|
+
readonly predicate?: string;
|
|
219
|
+
readonly reason: string;
|
|
220
|
+
readonly affectedQueries: readonly string[];
|
|
221
|
+
readonly estimatedImprovement: number;
|
|
222
|
+
readonly estimatedSize: number;
|
|
223
|
+
readonly createStatement: string;
|
|
224
|
+
readonly priority: 'low' | 'medium' | 'high' | 'critical';
|
|
225
|
+
}
|
|
226
|
+
/** Unused index */
|
|
227
|
+
export interface UnusedIndex {
|
|
228
|
+
readonly indexName: string;
|
|
229
|
+
readonly tableName: string;
|
|
230
|
+
readonly schema: string;
|
|
231
|
+
readonly columns: readonly string[];
|
|
232
|
+
readonly size: number;
|
|
233
|
+
readonly lastUsed?: Date;
|
|
234
|
+
readonly scanCount: number;
|
|
235
|
+
readonly fetchCount: number;
|
|
236
|
+
readonly readCount: number;
|
|
237
|
+
readonly recommendation: 'keep' | 'review' | 'drop';
|
|
238
|
+
readonly dropStatement: string;
|
|
239
|
+
}
|
|
240
|
+
/** Duplicate index */
|
|
241
|
+
export interface DuplicateIndex {
|
|
242
|
+
readonly indexes: readonly string[];
|
|
243
|
+
readonly tableName: string;
|
|
244
|
+
readonly schema: string;
|
|
245
|
+
readonly columns: readonly string[];
|
|
246
|
+
readonly reason: string;
|
|
247
|
+
readonly keepIndex: string;
|
|
248
|
+
readonly dropStatements: readonly string[];
|
|
249
|
+
}
|
|
250
|
+
/** Index fragmentation */
|
|
251
|
+
export interface IndexFragmentation {
|
|
252
|
+
readonly indexName: string;
|
|
253
|
+
readonly tableName: string;
|
|
254
|
+
readonly schema: string;
|
|
255
|
+
readonly fragmentationPercent: number;
|
|
256
|
+
readonly pageCount: number;
|
|
257
|
+
readonly avgPageDensity: number;
|
|
258
|
+
readonly recommendation: 'none' | 'reorganize' | 'rebuild';
|
|
259
|
+
readonly rebuildStatement: string;
|
|
260
|
+
}
|
|
261
|
+
/** Buffer cache statistics */
|
|
262
|
+
export interface BufferCacheStats {
|
|
263
|
+
readonly totalBuffers: number;
|
|
264
|
+
readonly usedBuffers: number;
|
|
265
|
+
readonly freeBuffers: number;
|
|
266
|
+
readonly dirtyBuffers: number;
|
|
267
|
+
readonly pinnedBuffers: number;
|
|
268
|
+
readonly hitRatio: number;
|
|
269
|
+
readonly readRate: number;
|
|
270
|
+
readonly writeRate: number;
|
|
271
|
+
readonly checkpointRate: number;
|
|
272
|
+
}
|
|
273
|
+
/** Buffer cache by table */
|
|
274
|
+
export interface TableBufferUsage {
|
|
275
|
+
readonly tableName: string;
|
|
276
|
+
readonly schema: string;
|
|
277
|
+
readonly buffersUsed: number;
|
|
278
|
+
readonly buffersPercent: number;
|
|
279
|
+
readonly heapBuffers: number;
|
|
280
|
+
readonly indexBuffers: number;
|
|
281
|
+
readonly toastBuffers: number;
|
|
282
|
+
readonly hitRatio: number;
|
|
283
|
+
}
|
|
284
|
+
/** Memory component stats */
|
|
285
|
+
export interface MemoryComponentStats {
|
|
286
|
+
readonly component: string;
|
|
287
|
+
readonly used: number;
|
|
288
|
+
readonly free: number;
|
|
289
|
+
readonly max: number;
|
|
290
|
+
readonly utilizationPercent: number;
|
|
291
|
+
}
|
|
292
|
+
/** Replication status */
|
|
293
|
+
export interface ReplicationStatus {
|
|
294
|
+
readonly role: 'primary' | 'standby' | 'master' | 'slave';
|
|
295
|
+
readonly state: 'streaming' | 'catchup' | 'backup' | 'disconnected' | 'potential';
|
|
296
|
+
readonly replicas: readonly ReplicaInfo[];
|
|
297
|
+
readonly lagWarningThreshold: number;
|
|
298
|
+
readonly lagCriticalThreshold: number;
|
|
299
|
+
}
|
|
300
|
+
/** Replica information */
|
|
301
|
+
export interface ReplicaInfo {
|
|
302
|
+
readonly name: string;
|
|
303
|
+
readonly host: string;
|
|
304
|
+
readonly port: number;
|
|
305
|
+
readonly state: 'streaming' | 'catchup' | 'backup' | 'disconnected';
|
|
306
|
+
readonly receivedLsn?: string;
|
|
307
|
+
readonly replayedLsn?: string;
|
|
308
|
+
readonly writeLag?: number;
|
|
309
|
+
readonly flushLag?: number;
|
|
310
|
+
readonly replayLag?: number;
|
|
311
|
+
readonly lagBytes?: number;
|
|
312
|
+
readonly lagSeconds?: number;
|
|
313
|
+
readonly syncState?: 'async' | 'sync' | 'potential' | 'quorum';
|
|
314
|
+
readonly replicationSlot?: string;
|
|
315
|
+
readonly connectedSince?: Date;
|
|
316
|
+
}
|
|
317
|
+
/** Replication slot */
|
|
318
|
+
export interface ReplicationSlot {
|
|
319
|
+
readonly name: string;
|
|
320
|
+
readonly plugin?: string;
|
|
321
|
+
readonly slotType: 'physical' | 'logical';
|
|
322
|
+
readonly database?: string;
|
|
323
|
+
readonly active: boolean;
|
|
324
|
+
readonly activePid?: number;
|
|
325
|
+
readonly restartLsn?: string;
|
|
326
|
+
readonly confirmedFlushLsn?: string;
|
|
327
|
+
readonly retainedWalBytes?: number;
|
|
328
|
+
readonly catalogXmin?: string;
|
|
329
|
+
readonly createdAt?: Date;
|
|
330
|
+
}
|
|
331
|
+
/** Backup schedule */
|
|
332
|
+
export interface BackupSchedule {
|
|
333
|
+
readonly id: string;
|
|
334
|
+
readonly name: string;
|
|
335
|
+
readonly enabled: boolean;
|
|
336
|
+
readonly type: BackupType;
|
|
337
|
+
readonly schedule: CronSchedule;
|
|
338
|
+
readonly retention: RetentionPolicy;
|
|
339
|
+
readonly destination: BackupDestination;
|
|
340
|
+
readonly options: BackupOptions;
|
|
341
|
+
readonly lastRun?: Date;
|
|
342
|
+
readonly lastStatus?: 'success' | 'failed' | 'running';
|
|
343
|
+
readonly nextRun?: Date;
|
|
344
|
+
}
|
|
345
|
+
/** Backup type */
|
|
346
|
+
export type BackupType = 'full' | 'incremental' | 'differential' | 'transaction_log' | 'snapshot';
|
|
347
|
+
/** Cron schedule */
|
|
348
|
+
export interface CronSchedule {
|
|
349
|
+
readonly expression: string;
|
|
350
|
+
readonly timezone: string;
|
|
351
|
+
readonly description?: string;
|
|
352
|
+
}
|
|
353
|
+
/** Retention policy */
|
|
354
|
+
export interface RetentionPolicy {
|
|
355
|
+
readonly type: 'count' | 'age' | 'size';
|
|
356
|
+
readonly value: number;
|
|
357
|
+
readonly unit?: 'days' | 'weeks' | 'months' | 'years' | 'gb';
|
|
358
|
+
readonly keepMonthly?: number;
|
|
359
|
+
readonly keepYearly?: number;
|
|
360
|
+
}
|
|
361
|
+
/** Backup destination */
|
|
362
|
+
export interface BackupDestination {
|
|
363
|
+
readonly type: 'local' | 's3' | 'azure' | 'gcs' | 'sftp' | 'nfs';
|
|
364
|
+
readonly path: string;
|
|
365
|
+
readonly bucket?: string;
|
|
366
|
+
readonly region?: string;
|
|
367
|
+
readonly credentials?: string;
|
|
368
|
+
readonly compression?: 'none' | 'gzip' | 'lz4' | 'zstd';
|
|
369
|
+
readonly encryption?: EncryptionConfig;
|
|
370
|
+
}
|
|
371
|
+
/** Encryption configuration */
|
|
372
|
+
export interface EncryptionConfig {
|
|
373
|
+
readonly algorithm: 'aes-256-cbc' | 'aes-256-gcm';
|
|
374
|
+
readonly keyId?: string;
|
|
375
|
+
readonly keyFile?: string;
|
|
376
|
+
}
|
|
377
|
+
/** Backup options */
|
|
378
|
+
export interface BackupOptions {
|
|
379
|
+
readonly parallel?: number;
|
|
380
|
+
readonly compressionLevel?: number;
|
|
381
|
+
readonly excludeTables?: readonly string[];
|
|
382
|
+
readonly includeTables?: readonly string[];
|
|
383
|
+
readonly excludeSchemas?: readonly string[];
|
|
384
|
+
readonly dataOnly?: boolean;
|
|
385
|
+
readonly schemaOnly?: boolean;
|
|
386
|
+
readonly noOwner?: boolean;
|
|
387
|
+
readonly noPrivileges?: boolean;
|
|
388
|
+
readonly format?: 'custom' | 'directory' | 'tar' | 'plain';
|
|
389
|
+
readonly checksum?: boolean;
|
|
390
|
+
readonly verify?: boolean;
|
|
391
|
+
}
|
|
392
|
+
/** Backup result */
|
|
393
|
+
export interface BackupResult {
|
|
394
|
+
readonly id: string;
|
|
395
|
+
readonly scheduleId?: string;
|
|
396
|
+
readonly type: BackupType;
|
|
397
|
+
readonly startTime: Date;
|
|
398
|
+
readonly endTime: Date;
|
|
399
|
+
readonly duration: number;
|
|
400
|
+
readonly status: 'success' | 'failed' | 'partial';
|
|
401
|
+
readonly size: number;
|
|
402
|
+
readonly compressedSize?: number;
|
|
403
|
+
readonly location: string;
|
|
404
|
+
readonly checksum?: string;
|
|
405
|
+
readonly error?: string;
|
|
406
|
+
readonly tablesBackedUp?: number;
|
|
407
|
+
readonly rowsBackedUp?: number;
|
|
408
|
+
}
|
|
409
|
+
/** Recovery point */
|
|
410
|
+
export interface RecoveryPoint {
|
|
411
|
+
readonly id: string;
|
|
412
|
+
readonly type: 'backup' | 'snapshot' | 'wal' | 'transaction_log';
|
|
413
|
+
readonly timestamp: Date;
|
|
414
|
+
readonly lsn?: string;
|
|
415
|
+
readonly backupId?: string;
|
|
416
|
+
readonly label?: string;
|
|
417
|
+
readonly isConsistent: boolean;
|
|
418
|
+
readonly databases?: readonly string[];
|
|
419
|
+
}
|
|
420
|
+
/** Recovery options */
|
|
421
|
+
export interface RecoveryOptions {
|
|
422
|
+
readonly targetTime?: Date;
|
|
423
|
+
readonly targetLsn?: string;
|
|
424
|
+
readonly targetTransactionId?: string;
|
|
425
|
+
readonly targetName?: string;
|
|
426
|
+
readonly inclusive?: boolean;
|
|
427
|
+
readonly targetDatabase?: string;
|
|
428
|
+
readonly restartAfterRecovery?: boolean;
|
|
429
|
+
readonly standbyMode?: boolean;
|
|
430
|
+
}
|
|
431
|
+
/** Recovery progress */
|
|
432
|
+
export interface RecoveryProgress {
|
|
433
|
+
readonly phase: 'preparing' | 'restoring' | 'replaying' | 'verifying' | 'complete' | 'failed';
|
|
434
|
+
readonly backupRestorePercent?: number;
|
|
435
|
+
readonly walReplayPercent?: number;
|
|
436
|
+
readonly currentLsn?: string;
|
|
437
|
+
readonly targetLsn?: string;
|
|
438
|
+
readonly estimatedTimeRemaining?: number;
|
|
439
|
+
readonly filesProcessed?: number;
|
|
440
|
+
readonly totalFiles?: number;
|
|
441
|
+
readonly bytesProcessed?: number;
|
|
442
|
+
readonly totalBytes?: number;
|
|
443
|
+
readonly errors: readonly string[];
|
|
444
|
+
}
|
|
445
|
+
/** Database user */
|
|
446
|
+
export interface DbUser {
|
|
447
|
+
readonly name: string;
|
|
448
|
+
readonly roles: readonly string[];
|
|
449
|
+
readonly defaultRole?: string;
|
|
450
|
+
readonly canLogin: boolean;
|
|
451
|
+
readonly isSuperuser: boolean;
|
|
452
|
+
readonly createDb: boolean;
|
|
453
|
+
readonly createRole: boolean;
|
|
454
|
+
readonly replication: boolean;
|
|
455
|
+
readonly bypassRls: boolean;
|
|
456
|
+
readonly connectionLimit: number;
|
|
457
|
+
readonly passwordExpiry?: Date;
|
|
458
|
+
readonly validUntil?: Date;
|
|
459
|
+
readonly config?: Record<string, string>;
|
|
460
|
+
readonly createdAt?: Date;
|
|
461
|
+
readonly lastLogin?: Date;
|
|
462
|
+
}
|
|
463
|
+
/** Database role */
|
|
464
|
+
export interface DbRole {
|
|
465
|
+
readonly name: string;
|
|
466
|
+
readonly inherits: boolean;
|
|
467
|
+
readonly members: readonly string[];
|
|
468
|
+
readonly memberOf: readonly string[];
|
|
469
|
+
readonly isSystem: boolean;
|
|
470
|
+
readonly createdAt?: Date;
|
|
471
|
+
readonly comment?: string;
|
|
472
|
+
}
|
|
473
|
+
/** User creation options */
|
|
474
|
+
export interface CreateUserOptions {
|
|
475
|
+
readonly name: string;
|
|
476
|
+
readonly password?: string;
|
|
477
|
+
readonly roles?: readonly string[];
|
|
478
|
+
readonly canLogin?: boolean;
|
|
479
|
+
readonly isSuperuser?: boolean;
|
|
480
|
+
readonly createDb?: boolean;
|
|
481
|
+
readonly createRole?: boolean;
|
|
482
|
+
readonly replication?: boolean;
|
|
483
|
+
readonly connectionLimit?: number;
|
|
484
|
+
readonly validUntil?: Date;
|
|
485
|
+
readonly config?: Record<string, string>;
|
|
486
|
+
}
|
|
487
|
+
/** Permission entry */
|
|
488
|
+
export interface PermissionEntry {
|
|
489
|
+
readonly grantee: string;
|
|
490
|
+
readonly granteeType: 'user' | 'role' | 'group' | 'public';
|
|
491
|
+
readonly objectType: PermissionObjectType;
|
|
492
|
+
readonly objectName: string;
|
|
493
|
+
readonly schema?: string;
|
|
494
|
+
readonly privileges: readonly Privilege[];
|
|
495
|
+
readonly withGrantOption: boolean;
|
|
496
|
+
readonly grantor: string;
|
|
497
|
+
}
|
|
498
|
+
/** Permission object type */
|
|
499
|
+
export type PermissionObjectType = 'database' | 'schema' | 'table' | 'view' | 'column' | 'sequence' | 'function' | 'procedure' | 'type' | 'domain' | 'tablespace';
|
|
500
|
+
/** Privilege type */
|
|
501
|
+
export type Privilege = 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' | 'TRUNCATE' | 'REFERENCES' | 'TRIGGER' | 'CREATE' | 'CONNECT' | 'TEMPORARY' | 'EXECUTE' | 'USAGE' | 'ALTER' | 'DROP' | 'ALL';
|
|
502
|
+
/** Permission matrix row */
|
|
503
|
+
export interface PermissionMatrixRow {
|
|
504
|
+
readonly objectName: string;
|
|
505
|
+
readonly objectType: PermissionObjectType;
|
|
506
|
+
readonly schema?: string;
|
|
507
|
+
readonly permissions: Record<string, readonly Privilege[]>;
|
|
508
|
+
}
|
|
509
|
+
/** Audit log entry */
|
|
510
|
+
export interface AuditLogEntry {
|
|
511
|
+
readonly id: string;
|
|
512
|
+
readonly timestamp: Date;
|
|
513
|
+
readonly username: string;
|
|
514
|
+
readonly database: string;
|
|
515
|
+
readonly clientAddress?: string;
|
|
516
|
+
readonly applicationName?: string;
|
|
517
|
+
readonly sessionId?: string;
|
|
518
|
+
readonly transactionId?: string;
|
|
519
|
+
readonly objectType?: string;
|
|
520
|
+
readonly objectName?: string;
|
|
521
|
+
readonly commandTag: string;
|
|
522
|
+
readonly statement?: string;
|
|
523
|
+
readonly parameters?: readonly unknown[];
|
|
524
|
+
readonly result: 'success' | 'error';
|
|
525
|
+
readonly errorMessage?: string;
|
|
526
|
+
readonly rowsAffected?: number;
|
|
527
|
+
readonly duration?: number;
|
|
528
|
+
}
|
|
529
|
+
/** Audit log filter */
|
|
530
|
+
export interface AuditLogFilter {
|
|
531
|
+
readonly startTime?: Date;
|
|
532
|
+
readonly endTime?: Date;
|
|
533
|
+
readonly usernames?: readonly string[];
|
|
534
|
+
readonly databases?: readonly string[];
|
|
535
|
+
readonly commandTags?: readonly string[];
|
|
536
|
+
readonly objectTypes?: readonly string[];
|
|
537
|
+
readonly objectNames?: readonly string[];
|
|
538
|
+
readonly resultFilter?: 'success' | 'error' | 'all';
|
|
539
|
+
readonly searchText?: string;
|
|
540
|
+
readonly limit?: number;
|
|
541
|
+
readonly offset?: number;
|
|
542
|
+
}
|
|
543
|
+
/** Audit summary */
|
|
544
|
+
export interface AuditSummary {
|
|
545
|
+
readonly period: {
|
|
546
|
+
start: Date;
|
|
547
|
+
end: Date;
|
|
548
|
+
};
|
|
549
|
+
readonly totalEvents: number;
|
|
550
|
+
readonly successCount: number;
|
|
551
|
+
readonly errorCount: number;
|
|
552
|
+
readonly uniqueUsers: number;
|
|
553
|
+
readonly topUsers: readonly {
|
|
554
|
+
user: string;
|
|
555
|
+
count: number;
|
|
556
|
+
}[];
|
|
557
|
+
readonly topCommands: readonly {
|
|
558
|
+
command: string;
|
|
559
|
+
count: number;
|
|
560
|
+
}[];
|
|
561
|
+
readonly topTables: readonly {
|
|
562
|
+
table: string;
|
|
563
|
+
accesses: number;
|
|
564
|
+
}[];
|
|
565
|
+
readonly errorsByType: readonly {
|
|
566
|
+
error: string;
|
|
567
|
+
count: number;
|
|
568
|
+
}[];
|
|
569
|
+
}
|
|
570
|
+
/** Performance metrics */
|
|
571
|
+
export interface PerformanceMetrics {
|
|
572
|
+
readonly timestamp: Date;
|
|
573
|
+
readonly cpu: CpuMetrics;
|
|
574
|
+
readonly memory: MemoryMetrics;
|
|
575
|
+
readonly disk: DiskMetrics;
|
|
576
|
+
readonly network: NetworkMetrics;
|
|
577
|
+
readonly database: DatabaseMetrics;
|
|
578
|
+
readonly queries: QueryMetrics;
|
|
579
|
+
}
|
|
580
|
+
/** CPU metrics */
|
|
581
|
+
export interface CpuMetrics {
|
|
582
|
+
readonly userPercent: number;
|
|
583
|
+
readonly systemPercent: number;
|
|
584
|
+
readonly idlePercent: number;
|
|
585
|
+
readonly iowaitPercent: number;
|
|
586
|
+
readonly loadAverage: {
|
|
587
|
+
one: number;
|
|
588
|
+
five: number;
|
|
589
|
+
fifteen: number;
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
/** Memory metrics */
|
|
593
|
+
export interface MemoryMetrics {
|
|
594
|
+
readonly totalBytes: number;
|
|
595
|
+
readonly usedBytes: number;
|
|
596
|
+
readonly freeBytes: number;
|
|
597
|
+
readonly cachedBytes: number;
|
|
598
|
+
readonly bufferedBytes: number;
|
|
599
|
+
readonly swapUsedBytes: number;
|
|
600
|
+
readonly swapFreeBytes: number;
|
|
601
|
+
}
|
|
602
|
+
/** Disk metrics */
|
|
603
|
+
export interface DiskMetrics {
|
|
604
|
+
readonly readBytesPerSec: number;
|
|
605
|
+
readonly writeBytesPerSec: number;
|
|
606
|
+
readonly readOpsPerSec: number;
|
|
607
|
+
readonly writeOpsPerSec: number;
|
|
608
|
+
readonly avgReadLatency: number;
|
|
609
|
+
readonly avgWriteLatency: number;
|
|
610
|
+
readonly queueLength: number;
|
|
611
|
+
readonly utilizationPercent: number;
|
|
612
|
+
}
|
|
613
|
+
/** Network metrics */
|
|
614
|
+
export interface NetworkMetrics {
|
|
615
|
+
readonly rxBytesPerSec: number;
|
|
616
|
+
readonly txBytesPerSec: number;
|
|
617
|
+
readonly rxPacketsPerSec: number;
|
|
618
|
+
readonly txPacketsPerSec: number;
|
|
619
|
+
readonly rxErrors: number;
|
|
620
|
+
readonly txErrors: number;
|
|
621
|
+
readonly connections: number;
|
|
622
|
+
}
|
|
623
|
+
/** Database-specific metrics */
|
|
624
|
+
export interface DatabaseMetrics {
|
|
625
|
+
readonly connections: number;
|
|
626
|
+
readonly maxConnections: number;
|
|
627
|
+
readonly activeQueries: number;
|
|
628
|
+
readonly transactionsPerSec: number;
|
|
629
|
+
readonly commitsPerSec: number;
|
|
630
|
+
readonly rollbacksPerSec: number;
|
|
631
|
+
readonly blocksRead: number;
|
|
632
|
+
readonly blocksHit: number;
|
|
633
|
+
readonly cacheHitRatio: number;
|
|
634
|
+
readonly tuplesReturned: number;
|
|
635
|
+
readonly tuplesInserted: number;
|
|
636
|
+
readonly tuplesUpdated: number;
|
|
637
|
+
readonly tuplesDeleted: number;
|
|
638
|
+
readonly deadlocks: number;
|
|
639
|
+
readonly conflicts: number;
|
|
640
|
+
readonly tempFiles: number;
|
|
641
|
+
readonly tempBytes: number;
|
|
642
|
+
}
|
|
643
|
+
/** Query metrics */
|
|
644
|
+
export interface QueryMetrics {
|
|
645
|
+
readonly queriesPerSec: number;
|
|
646
|
+
readonly avgQueryTime: number;
|
|
647
|
+
readonly slowQueries: number;
|
|
648
|
+
readonly failedQueries: number;
|
|
649
|
+
readonly waitingQueries: number;
|
|
650
|
+
}
|
|
651
|
+
/** Database space info */
|
|
652
|
+
export interface DatabaseSpaceInfo {
|
|
653
|
+
readonly name: string;
|
|
654
|
+
readonly size: number;
|
|
655
|
+
readonly dataSize: number;
|
|
656
|
+
readonly indexSize: number;
|
|
657
|
+
readonly freeSpace?: number;
|
|
658
|
+
readonly tableCount: number;
|
|
659
|
+
readonly growth: SpaceGrowth;
|
|
660
|
+
}
|
|
661
|
+
/** Table space info */
|
|
662
|
+
export interface TableSpaceInfo {
|
|
663
|
+
readonly name: string;
|
|
664
|
+
readonly schema: string;
|
|
665
|
+
readonly rowCount: number;
|
|
666
|
+
readonly totalSize: number;
|
|
667
|
+
readonly tableSize: number;
|
|
668
|
+
readonly indexSize: number;
|
|
669
|
+
readonly toastSize?: number;
|
|
670
|
+
readonly bloatPercent?: number;
|
|
671
|
+
readonly bloatBytes?: number;
|
|
672
|
+
readonly lastVacuum?: Date;
|
|
673
|
+
readonly lastAnalyze?: Date;
|
|
674
|
+
readonly lastAutoVacuum?: Date;
|
|
675
|
+
readonly deadTuples?: number;
|
|
676
|
+
readonly liveTuples?: number;
|
|
677
|
+
}
|
|
678
|
+
/** Space growth */
|
|
679
|
+
export interface SpaceGrowth {
|
|
680
|
+
readonly daily: number;
|
|
681
|
+
readonly weekly: number;
|
|
682
|
+
readonly monthly: number;
|
|
683
|
+
readonly trend: 'increasing' | 'stable' | 'decreasing';
|
|
684
|
+
readonly projectedSize30Days?: number;
|
|
685
|
+
readonly projectedSize90Days?: number;
|
|
686
|
+
}
|
|
687
|
+
/** Bloat analysis */
|
|
688
|
+
export interface BloatAnalysis {
|
|
689
|
+
readonly tableName: string;
|
|
690
|
+
readonly schema: string;
|
|
691
|
+
readonly actualSize: number;
|
|
692
|
+
readonly expectedSize: number;
|
|
693
|
+
readonly bloatSize: number;
|
|
694
|
+
readonly bloatPercent: number;
|
|
695
|
+
readonly wastedBytes: number;
|
|
696
|
+
readonly recommendation: 'none' | 'vacuum' | 'vacuum_full' | 'reindex';
|
|
697
|
+
readonly vacuumCommand: string;
|
|
698
|
+
}
|
|
699
|
+
//# sourceMappingURL=db-admin.d.ts.map
|