@aouda/client 0.0.1
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/LICENSE +21 -0
- package/README.md +151 -0
- package/dist/cli/index.cjs +5906 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +52 -0
- package/dist/cli/index.d.ts +52 -0
- package/dist/cli/index.js +5875 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client-DXT2ZAeO.d.cts +3356 -0
- package/dist/client-DXT2ZAeO.d.ts +3356 -0
- package/dist/index.cjs +5535 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +196 -0
- package/dist/index.d.ts +196 -0
- package/dist/index.js +5460 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { T as Transport, B as BulkLoadOptions, a as BulkLoadJobHandle, R as ReplicationStatusResponse, b as TopologyResponse, C as CoverageResponse, H as HealthStatus, c as ReadinessResponse, D as DetailedHealthResponse, N as NodeInfoResponse, d as TriggerBackupRequest, e as TriggerBackupResponse, L as ListBackupsResponse, f as RestoreBackupResponse, g as BackupSchedule, J as JoinClusterRequest, h as JoinClusterResponse, i as LeaveClusterResponse, P as PromoteClusterResponse, F as FailoverClusterResponse, j as DrainClusterResponse, k as ClusterConfigResponse, l as ClusterConfigPatchRequest, S as SchemaLike, m as DefaultSchema, A as AoudaClient } from './client-DXT2ZAeO.cjs';
|
|
2
|
+
export { n as AOUDA_DATA_TYPES, o as AddColumnRequest, p as AdminApi, q as AdminBackupConfig, r as AdminBackupPatch, s as AdminConfigPatchRequest, t as AdminConfigResponse, u as AdminConfigSchemaResponse, v as AdminLoggingConfig, w as AdminLoggingPatch, x as AdminMemoryConfig, y as AdminMemoryPatch, z as AoudaClientOptions, E as AoudaDataType, G as AppAuthOptions, I as AuthClient, K as AuthResult, M as AuthUserInfo, O as AuthorizationMode, Q as BackupAdminApi, U as BackupMetrics, V as BackupSummary, W as BatchMutationResult, X as BatchOperationInput, Y as BloomFilterMetrics, Z as BranchInfo, _ as BranchesApi, $ as BulkLoadForceAbortRequest, a0 as BulkLoadForceAbortResponse, a1 as BulkLoadListResponse, a2 as BulkLoadProgress, a3 as BulkLoadReplicaProgress, a4 as BulkLoadReplicaProgressDto, a5 as BulkLoadStatusResponse, a6 as CircuitBreakerPolicy, a7 as ClusterAdminApi, a8 as ClusterMemberEntry, a9 as ClusterThisNodeEntry, aa as ColumnSchema, ab as ColumnSummaryForErd, ac as ColumnarResponse, ad as ComponentHealthEntry, ae as ComputedColumnDef, af as ConfigAdminApi, ag as CreateBranchRequest, ah as CreateColumnRequest, ai as CreateDatabaseOptions, aj as CreatePartitionGrantRequest, ak as CreateRlsResolverRequest, al as CreateTableRequest, am as DatabaseCoverageEntry, an as DatabaseInfo, ao as DatabaseMemoryMetrics, ap as DatabaseMemoryUsage, aq as DatabaseMetricsDto, ar as DatabaseOptionsInfo, as as DatabasesApi, at as DeleteOptions, au as DiffSummary, av as HealthAdminApi, aw as IndexInfo, ax as InsertResult, ay as IoMetrics, az as LatencyPercentiles, aA as MaterializedQueriesApi, aB as MaterializedQueryDefinition, aC as MaterializedQueryExecuteOptions, aD as MaterializedQueryExecuteResult, aE as MaterializedQueryMetrics, aF as MaterializedQueryRefreshOptions, aG as MaterializedQueryState, aH as MaterializedQueryStateNumber, aI as MaterializedQueryStatus, aJ as MaterializedQueryType, aK as MaterializedQueryTypeNumber, aL as MemberInfo, aM as MemoryMetrics, aN as MergeBranchOptions, aO as MergeConflict, aP as MergeExecutionResult, aQ as MergeResult, aR as MetricsAdminApi, aS as MetricsHistory, aT as MetricsHistoryOptions, aU as MetricsSnapshot, aV as MetricsSummary, aW as MutationResult, aX as NodeAdminApi, aY as NodeLogEntry, aZ as NodeLogLevel, a_ as NodeLogStreamOptions, a$ as NodeLogsQuery, b0 as NodeLogsResponse, b1 as OpenWriteStreamOptions, b2 as PageCacheMetrics, b3 as PartitionGrant, b4 as PartitionGrantsListResponse, b5 as PartitioningMetrics, b6 as PerDatabaseLagEntry, b7 as PerDatabaseMetrics, b8 as PerDatabaseStatusEntry, b9 as QueryMetrics, ba as QueryResult, bb as QueryStats, bc as ReferenceInfo, bd as RelationshipEndpoint, be as RelationshipInfo, bf as RenameColumnRequest, bg as RenameTableRequest, bh as ReplicationAdminApi, bi as ReplicationMetrics, bj as ResidencyConfig, bk as RetryPolicy, bl as RlsResolver, bm as RlsResolverRule, bn as RlsResolverRuleInput, bo as RlsResolversListResponse, bp as SchemaChange, bq as SchemaDiffResult, br as SchemaRelationshipsResponse, bs as SeedApplyResult, bt as SeedTableApplyResult, bu as ServerAdminApi, bv as ServerAuthOptions, bw as ServerMemoryResponse, bx as ServerMetricsResponse, by as ServiceInfo, bz as SimdMetrics, bA as SingleDatabaseMetricsResponse, bB as SortDirection, bC as StorageMetrics, bD as SubscribeOptions, bE as Subscription, bF as SubscriptionChangeEvent, bG as SubscriptionEvent, bH as SubscriptionInfo, bI as SubscriptionSnapshotEvent, bJ as TableCoverageEntry, bK as TableNameFromSchema, bL as TablePolicy, bM as TableQuery, bN as TableSchema, bO as TableSchemaResponse, bP as TableSummary, bQ as TableSummaryForErd, bR as TablesApi, bS as TimeSeriesMetrics, bT as TransactionMetrics, bU as TypeGenerationOptions, bV as UpdateOptions, bW as UpdateRlsResolverRequest, bX as UpdateTablePolicyRequest, bY as UserProfile, bZ as WhereGroupBuilder, b_ as WhereOperator, b$ as WriteStream, c0 as coerceColumnarValue, c1 as createAoudaClient } from './client-DXT2ZAeO.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @aouda/client error types.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for Aouda client errors.
|
|
9
|
+
*/
|
|
10
|
+
declare class AoudaError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Error thrown when connection to the Aouda server fails.
|
|
15
|
+
* This includes network errors, DNS failures, and connection refused.
|
|
16
|
+
*/
|
|
17
|
+
declare class AoudaConnectionError extends AoudaError {
|
|
18
|
+
readonly cause?: Error | undefined;
|
|
19
|
+
constructor(message: string, cause?: Error | undefined);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when a request times out.
|
|
23
|
+
*/
|
|
24
|
+
declare class AoudaTimeoutError extends AoudaError {
|
|
25
|
+
readonly timeoutMs: number;
|
|
26
|
+
constructor(message: string, timeoutMs: number);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error thrown when the server returns an unexpected response.
|
|
30
|
+
* Used when the error body cannot be parsed (no error code available).
|
|
31
|
+
*/
|
|
32
|
+
declare class AoudaResponseError extends AoudaError {
|
|
33
|
+
readonly statusCode: number;
|
|
34
|
+
readonly statusText: string;
|
|
35
|
+
constructor(message: string, statusCode: number, statusText: string);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base class for server-returned errors with a structured error code.
|
|
39
|
+
*/
|
|
40
|
+
declare class AoudaApiError extends AoudaError {
|
|
41
|
+
readonly code: string;
|
|
42
|
+
readonly statusCode: number;
|
|
43
|
+
readonly details?: string | undefined;
|
|
44
|
+
readonly requestId?: string | undefined;
|
|
45
|
+
constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Thrown for TABLE_NOT_FOUND, COLUMN_NOT_FOUND (404).
|
|
49
|
+
*/
|
|
50
|
+
declare class AoudaNotFoundError extends AoudaApiError {
|
|
51
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Thrown for TABLE_EXISTS, COLUMN_EXISTS (409).
|
|
55
|
+
*/
|
|
56
|
+
declare class AoudaConflictError extends AoudaApiError {
|
|
57
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Thrown for INVALID_REQUEST, INVALID_OPERATOR, etc. (400).
|
|
61
|
+
*/
|
|
62
|
+
declare class AoudaValidationError extends AoudaApiError {
|
|
63
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Thrown for INTERNAL_ERROR, SERVICE_UNAVAILABLE, etc. (5xx).
|
|
67
|
+
*/
|
|
68
|
+
declare class AoudaServerError extends AoudaApiError {
|
|
69
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Thrown for 401 authentication errors (AUTH_TOKEN_EXPIRED, AUTH_TOKEN_INVALID, etc.).
|
|
73
|
+
*/
|
|
74
|
+
declare class AoudaAuthenticationError extends AoudaApiError {
|
|
75
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Thrown when the circuit breaker is open and requests are rejected immediately.
|
|
79
|
+
* Use openedAt and retryAfter to know when the circuit will allow test requests again.
|
|
80
|
+
*/
|
|
81
|
+
declare class AoudaCircuitBreakerOpenError extends AoudaError {
|
|
82
|
+
readonly openedAt: Date;
|
|
83
|
+
readonly retryAfter: Date;
|
|
84
|
+
readonly cause?: Error | undefined;
|
|
85
|
+
constructor(message: string, openedAt: Date, retryAfter: Date, cause?: Error | undefined);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Bulk-load coordinator for @aouda/client.
|
|
90
|
+
* Implements the :begin / :append × N / :commit HTTP sequence.
|
|
91
|
+
* No Node-only dependencies — works in any fetch-capable runtime.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Coordinator for the bulk-load HTTP sequence.
|
|
96
|
+
*/
|
|
97
|
+
declare class BulkLoadCoordinator {
|
|
98
|
+
private readonly transport;
|
|
99
|
+
private readonly database;
|
|
100
|
+
constructor(transport: Transport, database: string);
|
|
101
|
+
run<T extends Record<string, unknown>>(tables: readonly string[], rows: Iterable<T> | AsyncIterable<T>, options?: BulkLoadOptions): Promise<BulkLoadJobHandle>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface McpToolSchema {
|
|
105
|
+
type: "object";
|
|
106
|
+
properties: Record<string, unknown>;
|
|
107
|
+
required?: string[];
|
|
108
|
+
additionalProperties?: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface McpToolDefinition<TInput, TOutput> {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
inputSchema: McpToolSchema;
|
|
114
|
+
execute: (input: TInput) => Promise<TOutput>;
|
|
115
|
+
}
|
|
116
|
+
interface ClusterStatusToolInput {
|
|
117
|
+
includeCoverage?: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface ClusterStatusToolOutput {
|
|
120
|
+
replicationStatus: ReplicationStatusResponse;
|
|
121
|
+
topology: TopologyResponse;
|
|
122
|
+
coverage?: CoverageResponse;
|
|
123
|
+
}
|
|
124
|
+
interface ClusterHealthToolInput {
|
|
125
|
+
includeDetailed?: boolean;
|
|
126
|
+
includeNodeInfo?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface ClusterHealthToolOutput {
|
|
129
|
+
health: HealthStatus;
|
|
130
|
+
readiness: ReadinessResponse;
|
|
131
|
+
replicationStatus: ReplicationStatusResponse;
|
|
132
|
+
detailed?: DetailedHealthResponse;
|
|
133
|
+
node?: NodeInfoResponse;
|
|
134
|
+
}
|
|
135
|
+
type BackupTriggerToolInput = TriggerBackupRequest;
|
|
136
|
+
interface BackupRestoreToolInput {
|
|
137
|
+
backupId: string;
|
|
138
|
+
}
|
|
139
|
+
type BackupSetScheduleToolInput = BackupSchedule;
|
|
140
|
+
interface ClusterDrainToolInput {
|
|
141
|
+
nodeAddress: string;
|
|
142
|
+
}
|
|
143
|
+
type ClusterPatchConfigToolInput = ClusterConfigPatchRequest;
|
|
144
|
+
declare class AoudaClusterMcpTools<S extends SchemaLike = DefaultSchema> {
|
|
145
|
+
private readonly client;
|
|
146
|
+
constructor(client: AoudaClient<S>);
|
|
147
|
+
clusterStatus(input?: ClusterStatusToolInput): Promise<ClusterStatusToolOutput>;
|
|
148
|
+
clusterHealth(input?: ClusterHealthToolInput): Promise<ClusterHealthToolOutput>;
|
|
149
|
+
backupTrigger(input?: BackupTriggerToolInput): Promise<TriggerBackupResponse>;
|
|
150
|
+
backupList(): Promise<ListBackupsResponse>;
|
|
151
|
+
backupRestore(input: BackupRestoreToolInput): Promise<RestoreBackupResponse>;
|
|
152
|
+
backupGetSchedule(): Promise<BackupSchedule>;
|
|
153
|
+
backupSetSchedule(input: BackupSetScheduleToolInput): Promise<BackupSchedule>;
|
|
154
|
+
clusterJoin(input: JoinClusterRequest): Promise<JoinClusterResponse>;
|
|
155
|
+
clusterLeave(): Promise<LeaveClusterResponse>;
|
|
156
|
+
clusterPromote(): Promise<PromoteClusterResponse>;
|
|
157
|
+
clusterFailover(): Promise<FailoverClusterResponse>;
|
|
158
|
+
clusterDrain(input: ClusterDrainToolInput): Promise<DrainClusterResponse>;
|
|
159
|
+
clusterGetConfig(): Promise<ClusterConfigResponse>;
|
|
160
|
+
clusterPatchConfig(input: ClusterPatchConfigToolInput): Promise<ClusterConfigResponse>;
|
|
161
|
+
}
|
|
162
|
+
interface AoudaClusterMcpToolSet {
|
|
163
|
+
aouda_cluster_status: McpToolDefinition<ClusterStatusToolInput, ClusterStatusToolOutput>;
|
|
164
|
+
aouda_cluster_health: McpToolDefinition<ClusterHealthToolInput, ClusterHealthToolOutput>;
|
|
165
|
+
aouda_backup_trigger: McpToolDefinition<BackupTriggerToolInput, TriggerBackupResponse>;
|
|
166
|
+
aouda_backup_list: McpToolDefinition<Record<string, never>, ListBackupsResponse>;
|
|
167
|
+
aouda_backup_restore: McpToolDefinition<BackupRestoreToolInput, RestoreBackupResponse>;
|
|
168
|
+
aouda_backup_get_schedule: McpToolDefinition<Record<string, never>, BackupSchedule>;
|
|
169
|
+
aouda_backup_set_schedule: McpToolDefinition<BackupSetScheduleToolInput, BackupSchedule>;
|
|
170
|
+
aouda_cluster_join: McpToolDefinition<JoinClusterRequest, JoinClusterResponse>;
|
|
171
|
+
aouda_cluster_leave: McpToolDefinition<Record<string, never>, LeaveClusterResponse>;
|
|
172
|
+
aouda_cluster_promote: McpToolDefinition<Record<string, never>, PromoteClusterResponse>;
|
|
173
|
+
aouda_cluster_failover: McpToolDefinition<Record<string, never>, FailoverClusterResponse>;
|
|
174
|
+
aouda_cluster_drain: McpToolDefinition<ClusterDrainToolInput, DrainClusterResponse>;
|
|
175
|
+
aouda_cluster_get_config: McpToolDefinition<Record<string, never>, ClusterConfigResponse>;
|
|
176
|
+
aouda_cluster_patch_config: McpToolDefinition<ClusterPatchConfigToolInput, ClusterConfigResponse>;
|
|
177
|
+
}
|
|
178
|
+
declare function createAoudaClusterMcpToolSet<S extends SchemaLike = DefaultSchema>(client: AoudaClient<S>): AoudaClusterMcpToolSet;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @aouda/client — Official TypeScript/JavaScript client for Aouda.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* import { AoudaClient } from "@aouda/client";
|
|
186
|
+
*
|
|
187
|
+
* const client = new AoudaClient({ serverUrl: "http://localhost:8080", database: "mydb" });
|
|
188
|
+
* await client.connect();
|
|
189
|
+
* const health = await client.health();
|
|
190
|
+
* console.log(health.isHealthy); // true
|
|
191
|
+
* await client.disconnect();
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
declare const version = "0.0.1";
|
|
195
|
+
|
|
196
|
+
export { AoudaApiError, AoudaAuthenticationError, AoudaCircuitBreakerOpenError, AoudaClient, type AoudaClusterMcpToolSet, AoudaClusterMcpTools, AoudaConflictError, AoudaConnectionError, AoudaError, AoudaNotFoundError, AoudaResponseError, AoudaServerError, AoudaTimeoutError, AoudaValidationError, type BackupRestoreToolInput, BackupSchedule, type BackupSetScheduleToolInput, type BackupTriggerToolInput, BulkLoadCoordinator, BulkLoadJobHandle, BulkLoadOptions, ClusterConfigPatchRequest, ClusterConfigResponse, type ClusterDrainToolInput, type ClusterHealthToolInput, type ClusterHealthToolOutput, type ClusterPatchConfigToolInput, type ClusterStatusToolInput, type ClusterStatusToolOutput, CoverageResponse, DefaultSchema, DetailedHealthResponse, DrainClusterResponse, FailoverClusterResponse, HealthStatus, JoinClusterRequest, JoinClusterResponse, LeaveClusterResponse, ListBackupsResponse, type McpToolDefinition, type McpToolSchema, NodeInfoResponse, PromoteClusterResponse, ReadinessResponse, ReplicationStatusResponse, RestoreBackupResponse, SchemaLike, TopologyResponse, TriggerBackupRequest, TriggerBackupResponse, createAoudaClusterMcpToolSet, version };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { T as Transport, B as BulkLoadOptions, a as BulkLoadJobHandle, R as ReplicationStatusResponse, b as TopologyResponse, C as CoverageResponse, H as HealthStatus, c as ReadinessResponse, D as DetailedHealthResponse, N as NodeInfoResponse, d as TriggerBackupRequest, e as TriggerBackupResponse, L as ListBackupsResponse, f as RestoreBackupResponse, g as BackupSchedule, J as JoinClusterRequest, h as JoinClusterResponse, i as LeaveClusterResponse, P as PromoteClusterResponse, F as FailoverClusterResponse, j as DrainClusterResponse, k as ClusterConfigResponse, l as ClusterConfigPatchRequest, S as SchemaLike, m as DefaultSchema, A as AoudaClient } from './client-DXT2ZAeO.js';
|
|
2
|
+
export { n as AOUDA_DATA_TYPES, o as AddColumnRequest, p as AdminApi, q as AdminBackupConfig, r as AdminBackupPatch, s as AdminConfigPatchRequest, t as AdminConfigResponse, u as AdminConfigSchemaResponse, v as AdminLoggingConfig, w as AdminLoggingPatch, x as AdminMemoryConfig, y as AdminMemoryPatch, z as AoudaClientOptions, E as AoudaDataType, G as AppAuthOptions, I as AuthClient, K as AuthResult, M as AuthUserInfo, O as AuthorizationMode, Q as BackupAdminApi, U as BackupMetrics, V as BackupSummary, W as BatchMutationResult, X as BatchOperationInput, Y as BloomFilterMetrics, Z as BranchInfo, _ as BranchesApi, $ as BulkLoadForceAbortRequest, a0 as BulkLoadForceAbortResponse, a1 as BulkLoadListResponse, a2 as BulkLoadProgress, a3 as BulkLoadReplicaProgress, a4 as BulkLoadReplicaProgressDto, a5 as BulkLoadStatusResponse, a6 as CircuitBreakerPolicy, a7 as ClusterAdminApi, a8 as ClusterMemberEntry, a9 as ClusterThisNodeEntry, aa as ColumnSchema, ab as ColumnSummaryForErd, ac as ColumnarResponse, ad as ComponentHealthEntry, ae as ComputedColumnDef, af as ConfigAdminApi, ag as CreateBranchRequest, ah as CreateColumnRequest, ai as CreateDatabaseOptions, aj as CreatePartitionGrantRequest, ak as CreateRlsResolverRequest, al as CreateTableRequest, am as DatabaseCoverageEntry, an as DatabaseInfo, ao as DatabaseMemoryMetrics, ap as DatabaseMemoryUsage, aq as DatabaseMetricsDto, ar as DatabaseOptionsInfo, as as DatabasesApi, at as DeleteOptions, au as DiffSummary, av as HealthAdminApi, aw as IndexInfo, ax as InsertResult, ay as IoMetrics, az as LatencyPercentiles, aA as MaterializedQueriesApi, aB as MaterializedQueryDefinition, aC as MaterializedQueryExecuteOptions, aD as MaterializedQueryExecuteResult, aE as MaterializedQueryMetrics, aF as MaterializedQueryRefreshOptions, aG as MaterializedQueryState, aH as MaterializedQueryStateNumber, aI as MaterializedQueryStatus, aJ as MaterializedQueryType, aK as MaterializedQueryTypeNumber, aL as MemberInfo, aM as MemoryMetrics, aN as MergeBranchOptions, aO as MergeConflict, aP as MergeExecutionResult, aQ as MergeResult, aR as MetricsAdminApi, aS as MetricsHistory, aT as MetricsHistoryOptions, aU as MetricsSnapshot, aV as MetricsSummary, aW as MutationResult, aX as NodeAdminApi, aY as NodeLogEntry, aZ as NodeLogLevel, a_ as NodeLogStreamOptions, a$ as NodeLogsQuery, b0 as NodeLogsResponse, b1 as OpenWriteStreamOptions, b2 as PageCacheMetrics, b3 as PartitionGrant, b4 as PartitionGrantsListResponse, b5 as PartitioningMetrics, b6 as PerDatabaseLagEntry, b7 as PerDatabaseMetrics, b8 as PerDatabaseStatusEntry, b9 as QueryMetrics, ba as QueryResult, bb as QueryStats, bc as ReferenceInfo, bd as RelationshipEndpoint, be as RelationshipInfo, bf as RenameColumnRequest, bg as RenameTableRequest, bh as ReplicationAdminApi, bi as ReplicationMetrics, bj as ResidencyConfig, bk as RetryPolicy, bl as RlsResolver, bm as RlsResolverRule, bn as RlsResolverRuleInput, bo as RlsResolversListResponse, bp as SchemaChange, bq as SchemaDiffResult, br as SchemaRelationshipsResponse, bs as SeedApplyResult, bt as SeedTableApplyResult, bu as ServerAdminApi, bv as ServerAuthOptions, bw as ServerMemoryResponse, bx as ServerMetricsResponse, by as ServiceInfo, bz as SimdMetrics, bA as SingleDatabaseMetricsResponse, bB as SortDirection, bC as StorageMetrics, bD as SubscribeOptions, bE as Subscription, bF as SubscriptionChangeEvent, bG as SubscriptionEvent, bH as SubscriptionInfo, bI as SubscriptionSnapshotEvent, bJ as TableCoverageEntry, bK as TableNameFromSchema, bL as TablePolicy, bM as TableQuery, bN as TableSchema, bO as TableSchemaResponse, bP as TableSummary, bQ as TableSummaryForErd, bR as TablesApi, bS as TimeSeriesMetrics, bT as TransactionMetrics, bU as TypeGenerationOptions, bV as UpdateOptions, bW as UpdateRlsResolverRequest, bX as UpdateTablePolicyRequest, bY as UserProfile, bZ as WhereGroupBuilder, b_ as WhereOperator, b$ as WriteStream, c0 as coerceColumnarValue, c1 as createAoudaClient } from './client-DXT2ZAeO.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @aouda/client error types.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error class for Aouda client errors.
|
|
9
|
+
*/
|
|
10
|
+
declare class AoudaError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Error thrown when connection to the Aouda server fails.
|
|
15
|
+
* This includes network errors, DNS failures, and connection refused.
|
|
16
|
+
*/
|
|
17
|
+
declare class AoudaConnectionError extends AoudaError {
|
|
18
|
+
readonly cause?: Error | undefined;
|
|
19
|
+
constructor(message: string, cause?: Error | undefined);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Error thrown when a request times out.
|
|
23
|
+
*/
|
|
24
|
+
declare class AoudaTimeoutError extends AoudaError {
|
|
25
|
+
readonly timeoutMs: number;
|
|
26
|
+
constructor(message: string, timeoutMs: number);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error thrown when the server returns an unexpected response.
|
|
30
|
+
* Used when the error body cannot be parsed (no error code available).
|
|
31
|
+
*/
|
|
32
|
+
declare class AoudaResponseError extends AoudaError {
|
|
33
|
+
readonly statusCode: number;
|
|
34
|
+
readonly statusText: string;
|
|
35
|
+
constructor(message: string, statusCode: number, statusText: string);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base class for server-returned errors with a structured error code.
|
|
39
|
+
*/
|
|
40
|
+
declare class AoudaApiError extends AoudaError {
|
|
41
|
+
readonly code: string;
|
|
42
|
+
readonly statusCode: number;
|
|
43
|
+
readonly details?: string | undefined;
|
|
44
|
+
readonly requestId?: string | undefined;
|
|
45
|
+
constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Thrown for TABLE_NOT_FOUND, COLUMN_NOT_FOUND (404).
|
|
49
|
+
*/
|
|
50
|
+
declare class AoudaNotFoundError extends AoudaApiError {
|
|
51
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Thrown for TABLE_EXISTS, COLUMN_EXISTS (409).
|
|
55
|
+
*/
|
|
56
|
+
declare class AoudaConflictError extends AoudaApiError {
|
|
57
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Thrown for INVALID_REQUEST, INVALID_OPERATOR, etc. (400).
|
|
61
|
+
*/
|
|
62
|
+
declare class AoudaValidationError extends AoudaApiError {
|
|
63
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Thrown for INTERNAL_ERROR, SERVICE_UNAVAILABLE, etc. (5xx).
|
|
67
|
+
*/
|
|
68
|
+
declare class AoudaServerError extends AoudaApiError {
|
|
69
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Thrown for 401 authentication errors (AUTH_TOKEN_EXPIRED, AUTH_TOKEN_INVALID, etc.).
|
|
73
|
+
*/
|
|
74
|
+
declare class AoudaAuthenticationError extends AoudaApiError {
|
|
75
|
+
constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Thrown when the circuit breaker is open and requests are rejected immediately.
|
|
79
|
+
* Use openedAt and retryAfter to know when the circuit will allow test requests again.
|
|
80
|
+
*/
|
|
81
|
+
declare class AoudaCircuitBreakerOpenError extends AoudaError {
|
|
82
|
+
readonly openedAt: Date;
|
|
83
|
+
readonly retryAfter: Date;
|
|
84
|
+
readonly cause?: Error | undefined;
|
|
85
|
+
constructor(message: string, openedAt: Date, retryAfter: Date, cause?: Error | undefined);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Bulk-load coordinator for @aouda/client.
|
|
90
|
+
* Implements the :begin / :append × N / :commit HTTP sequence.
|
|
91
|
+
* No Node-only dependencies — works in any fetch-capable runtime.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Coordinator for the bulk-load HTTP sequence.
|
|
96
|
+
*/
|
|
97
|
+
declare class BulkLoadCoordinator {
|
|
98
|
+
private readonly transport;
|
|
99
|
+
private readonly database;
|
|
100
|
+
constructor(transport: Transport, database: string);
|
|
101
|
+
run<T extends Record<string, unknown>>(tables: readonly string[], rows: Iterable<T> | AsyncIterable<T>, options?: BulkLoadOptions): Promise<BulkLoadJobHandle>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface McpToolSchema {
|
|
105
|
+
type: "object";
|
|
106
|
+
properties: Record<string, unknown>;
|
|
107
|
+
required?: string[];
|
|
108
|
+
additionalProperties?: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface McpToolDefinition<TInput, TOutput> {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
inputSchema: McpToolSchema;
|
|
114
|
+
execute: (input: TInput) => Promise<TOutput>;
|
|
115
|
+
}
|
|
116
|
+
interface ClusterStatusToolInput {
|
|
117
|
+
includeCoverage?: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface ClusterStatusToolOutput {
|
|
120
|
+
replicationStatus: ReplicationStatusResponse;
|
|
121
|
+
topology: TopologyResponse;
|
|
122
|
+
coverage?: CoverageResponse;
|
|
123
|
+
}
|
|
124
|
+
interface ClusterHealthToolInput {
|
|
125
|
+
includeDetailed?: boolean;
|
|
126
|
+
includeNodeInfo?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface ClusterHealthToolOutput {
|
|
129
|
+
health: HealthStatus;
|
|
130
|
+
readiness: ReadinessResponse;
|
|
131
|
+
replicationStatus: ReplicationStatusResponse;
|
|
132
|
+
detailed?: DetailedHealthResponse;
|
|
133
|
+
node?: NodeInfoResponse;
|
|
134
|
+
}
|
|
135
|
+
type BackupTriggerToolInput = TriggerBackupRequest;
|
|
136
|
+
interface BackupRestoreToolInput {
|
|
137
|
+
backupId: string;
|
|
138
|
+
}
|
|
139
|
+
type BackupSetScheduleToolInput = BackupSchedule;
|
|
140
|
+
interface ClusterDrainToolInput {
|
|
141
|
+
nodeAddress: string;
|
|
142
|
+
}
|
|
143
|
+
type ClusterPatchConfigToolInput = ClusterConfigPatchRequest;
|
|
144
|
+
declare class AoudaClusterMcpTools<S extends SchemaLike = DefaultSchema> {
|
|
145
|
+
private readonly client;
|
|
146
|
+
constructor(client: AoudaClient<S>);
|
|
147
|
+
clusterStatus(input?: ClusterStatusToolInput): Promise<ClusterStatusToolOutput>;
|
|
148
|
+
clusterHealth(input?: ClusterHealthToolInput): Promise<ClusterHealthToolOutput>;
|
|
149
|
+
backupTrigger(input?: BackupTriggerToolInput): Promise<TriggerBackupResponse>;
|
|
150
|
+
backupList(): Promise<ListBackupsResponse>;
|
|
151
|
+
backupRestore(input: BackupRestoreToolInput): Promise<RestoreBackupResponse>;
|
|
152
|
+
backupGetSchedule(): Promise<BackupSchedule>;
|
|
153
|
+
backupSetSchedule(input: BackupSetScheduleToolInput): Promise<BackupSchedule>;
|
|
154
|
+
clusterJoin(input: JoinClusterRequest): Promise<JoinClusterResponse>;
|
|
155
|
+
clusterLeave(): Promise<LeaveClusterResponse>;
|
|
156
|
+
clusterPromote(): Promise<PromoteClusterResponse>;
|
|
157
|
+
clusterFailover(): Promise<FailoverClusterResponse>;
|
|
158
|
+
clusterDrain(input: ClusterDrainToolInput): Promise<DrainClusterResponse>;
|
|
159
|
+
clusterGetConfig(): Promise<ClusterConfigResponse>;
|
|
160
|
+
clusterPatchConfig(input: ClusterPatchConfigToolInput): Promise<ClusterConfigResponse>;
|
|
161
|
+
}
|
|
162
|
+
interface AoudaClusterMcpToolSet {
|
|
163
|
+
aouda_cluster_status: McpToolDefinition<ClusterStatusToolInput, ClusterStatusToolOutput>;
|
|
164
|
+
aouda_cluster_health: McpToolDefinition<ClusterHealthToolInput, ClusterHealthToolOutput>;
|
|
165
|
+
aouda_backup_trigger: McpToolDefinition<BackupTriggerToolInput, TriggerBackupResponse>;
|
|
166
|
+
aouda_backup_list: McpToolDefinition<Record<string, never>, ListBackupsResponse>;
|
|
167
|
+
aouda_backup_restore: McpToolDefinition<BackupRestoreToolInput, RestoreBackupResponse>;
|
|
168
|
+
aouda_backup_get_schedule: McpToolDefinition<Record<string, never>, BackupSchedule>;
|
|
169
|
+
aouda_backup_set_schedule: McpToolDefinition<BackupSetScheduleToolInput, BackupSchedule>;
|
|
170
|
+
aouda_cluster_join: McpToolDefinition<JoinClusterRequest, JoinClusterResponse>;
|
|
171
|
+
aouda_cluster_leave: McpToolDefinition<Record<string, never>, LeaveClusterResponse>;
|
|
172
|
+
aouda_cluster_promote: McpToolDefinition<Record<string, never>, PromoteClusterResponse>;
|
|
173
|
+
aouda_cluster_failover: McpToolDefinition<Record<string, never>, FailoverClusterResponse>;
|
|
174
|
+
aouda_cluster_drain: McpToolDefinition<ClusterDrainToolInput, DrainClusterResponse>;
|
|
175
|
+
aouda_cluster_get_config: McpToolDefinition<Record<string, never>, ClusterConfigResponse>;
|
|
176
|
+
aouda_cluster_patch_config: McpToolDefinition<ClusterPatchConfigToolInput, ClusterConfigResponse>;
|
|
177
|
+
}
|
|
178
|
+
declare function createAoudaClusterMcpToolSet<S extends SchemaLike = DefaultSchema>(client: AoudaClient<S>): AoudaClusterMcpToolSet;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @aouda/client — Official TypeScript/JavaScript client for Aouda.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* import { AoudaClient } from "@aouda/client";
|
|
186
|
+
*
|
|
187
|
+
* const client = new AoudaClient({ serverUrl: "http://localhost:8080", database: "mydb" });
|
|
188
|
+
* await client.connect();
|
|
189
|
+
* const health = await client.health();
|
|
190
|
+
* console.log(health.isHealthy); // true
|
|
191
|
+
* await client.disconnect();
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
declare const version = "0.0.1";
|
|
195
|
+
|
|
196
|
+
export { AoudaApiError, AoudaAuthenticationError, AoudaCircuitBreakerOpenError, AoudaClient, type AoudaClusterMcpToolSet, AoudaClusterMcpTools, AoudaConflictError, AoudaConnectionError, AoudaError, AoudaNotFoundError, AoudaResponseError, AoudaServerError, AoudaTimeoutError, AoudaValidationError, type BackupRestoreToolInput, BackupSchedule, type BackupSetScheduleToolInput, type BackupTriggerToolInput, BulkLoadCoordinator, BulkLoadJobHandle, BulkLoadOptions, ClusterConfigPatchRequest, ClusterConfigResponse, type ClusterDrainToolInput, type ClusterHealthToolInput, type ClusterHealthToolOutput, type ClusterPatchConfigToolInput, type ClusterStatusToolInput, type ClusterStatusToolOutput, CoverageResponse, DefaultSchema, DetailedHealthResponse, DrainClusterResponse, FailoverClusterResponse, HealthStatus, JoinClusterRequest, JoinClusterResponse, LeaveClusterResponse, ListBackupsResponse, type McpToolDefinition, type McpToolSchema, NodeInfoResponse, PromoteClusterResponse, ReadinessResponse, ReplicationStatusResponse, RestoreBackupResponse, SchemaLike, TopologyResponse, TriggerBackupRequest, TriggerBackupResponse, createAoudaClusterMcpToolSet, version };
|