@aouda/client 0.1.7 → 0.1.9
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/dist/cli/index.cjs +133 -24
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +133 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-BbyXG5AL.d.cts → client-CxP9Vnc8.d.cts} +154 -8
- package/dist/{client-BbyXG5AL.d.ts → client-CxP9Vnc8.d.ts} +154 -8
- package/dist/index.cjs +135 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +134 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -566,6 +566,8 @@ interface ColumnSchema {
|
|
|
566
566
|
clusterOrder?: number;
|
|
567
567
|
/** Reference to another table's column (for relationship navigation). */
|
|
568
568
|
reference?: ReferenceInfo;
|
|
569
|
+
/** Preferred encoder name when non-default (e.g. String_Dict). */
|
|
570
|
+
encoder?: string;
|
|
569
571
|
}
|
|
570
572
|
/**
|
|
571
573
|
* Storage policy for a table.
|
|
@@ -924,11 +926,55 @@ interface AddColumnRequest {
|
|
|
924
926
|
type: string;
|
|
925
927
|
}
|
|
926
928
|
/**
|
|
927
|
-
* Request body for
|
|
929
|
+
* Request body for altering a column
|
|
930
|
+
* (PATCH /api/databases/{db}/tables/{name}/columns/{columnName}).
|
|
931
|
+
* Omit a property to leave it unchanged. For `references`, omit to leave unchanged;
|
|
932
|
+
* pass `""` or `null` to clear.
|
|
928
933
|
*/
|
|
929
|
-
interface
|
|
934
|
+
interface AlterColumnRequest {
|
|
935
|
+
database?: string;
|
|
936
|
+
newName?: string;
|
|
937
|
+
type?: string;
|
|
938
|
+
nullable?: boolean;
|
|
939
|
+
encoder?: string;
|
|
940
|
+
autoIncrement?: boolean;
|
|
941
|
+
references?: string | null;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* @deprecated Use {@link AlterColumnRequest} with `newName`. Kept for rename-only callers.
|
|
945
|
+
*/
|
|
946
|
+
type RenameColumnRequest = Pick<AlterColumnRequest, "database" | "newName"> & {
|
|
930
947
|
database: string;
|
|
931
948
|
newName: string;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* Request body for reordering columns
|
|
952
|
+
* (PUT /api/databases/{db}/tables/{name}/columns:order).
|
|
953
|
+
*/
|
|
954
|
+
interface ReorderColumnsRequest {
|
|
955
|
+
database?: string;
|
|
956
|
+
columns: string[];
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Single pending-job projection (GET /api/databases/{db}/jobs).
|
|
960
|
+
*/
|
|
961
|
+
interface PendingJobResponse {
|
|
962
|
+
id: string;
|
|
963
|
+
type: string;
|
|
964
|
+
state: string;
|
|
965
|
+
createdAt: string;
|
|
966
|
+
startedAt?: string | null;
|
|
967
|
+
completedAt?: string | null;
|
|
968
|
+
error?: string | null;
|
|
969
|
+
/** Parsed params object when ParamsJson is JSON; otherwise a string. */
|
|
970
|
+
params?: unknown;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* List response for GET /api/databases/{db}/jobs.
|
|
974
|
+
*/
|
|
975
|
+
interface PendingJobListResponse {
|
|
976
|
+
database: string;
|
|
977
|
+
jobs: PendingJobResponse[];
|
|
932
978
|
}
|
|
933
979
|
/**
|
|
934
980
|
* Request body for updating a table's storage policy (PUT /api/databases/{db}/tables/{name}/policy).
|
|
@@ -1164,6 +1210,21 @@ interface ServerMemoryResponse {
|
|
|
1164
1210
|
databaseCount: number;
|
|
1165
1211
|
perDatabaseUsage: Record<string, DatabaseMemoryUsage>;
|
|
1166
1212
|
timestamp: string;
|
|
1213
|
+
rssBytes?: number;
|
|
1214
|
+
reservedBytes?: number;
|
|
1215
|
+
governedBudgetBytes?: number;
|
|
1216
|
+
rssDriftBytes?: number;
|
|
1217
|
+
tighteningActive?: boolean;
|
|
1218
|
+
budgetTargetBytes?: number;
|
|
1219
|
+
budgetEffectiveBytes?: number;
|
|
1220
|
+
resizeStatus?: string;
|
|
1221
|
+
admissionDenials?: number;
|
|
1222
|
+
admissionThrottles?: number;
|
|
1223
|
+
walBytesOnDisk?: number;
|
|
1224
|
+
walBytesReclaimable?: number;
|
|
1225
|
+
walRecoveryPortions?: number;
|
|
1226
|
+
walRecoveryCursorWrites?: number;
|
|
1227
|
+
quarantinedDatabases?: number;
|
|
1167
1228
|
}
|
|
1168
1229
|
/** Per-database metrics DTO in server metrics response. */
|
|
1169
1230
|
interface DatabaseMetricsDto {
|
|
@@ -1397,8 +1458,29 @@ interface MemoryMetrics {
|
|
|
1397
1458
|
hotBytes: number;
|
|
1398
1459
|
cacheBytes: number;
|
|
1399
1460
|
evictions: number;
|
|
1461
|
+
rssBytes?: number;
|
|
1462
|
+
reservedBytes?: number;
|
|
1463
|
+
governedBudgetBytes?: number;
|
|
1464
|
+
rssDriftBytes?: number;
|
|
1465
|
+
tighteningActive?: boolean;
|
|
1466
|
+
budgetTargetBytes?: number;
|
|
1467
|
+
budgetEffectiveBytes?: number;
|
|
1468
|
+
resizeStatus?: string;
|
|
1469
|
+
admissionDenials?: number;
|
|
1470
|
+
admissionThrottles?: number;
|
|
1400
1471
|
perDatabase?: Record<string, DatabaseMemoryMetrics>;
|
|
1401
1472
|
}
|
|
1473
|
+
/** Bounded-WAL inventory (GET /api/admin/metrics/wal). */
|
|
1474
|
+
interface WalMetrics {
|
|
1475
|
+
bytesOnDisk: number;
|
|
1476
|
+
bytesReclaimable: number;
|
|
1477
|
+
recoveryPortions: number;
|
|
1478
|
+
recoveryCursorWrites: number;
|
|
1479
|
+
corruptFramesStopped: number;
|
|
1480
|
+
ladderThrottleTotal: number;
|
|
1481
|
+
ladderRefuseTotal: number;
|
|
1482
|
+
quarantinedTotal: number;
|
|
1483
|
+
}
|
|
1402
1484
|
/** I/O operation metrics. */
|
|
1403
1485
|
interface IoMetrics {
|
|
1404
1486
|
totalMs: number;
|
|
@@ -1446,6 +1528,7 @@ interface MetricsSnapshot {
|
|
|
1446
1528
|
bloomFilters: BloomFilterMetrics;
|
|
1447
1529
|
transactions: TransactionMetrics;
|
|
1448
1530
|
memory: MemoryMetrics;
|
|
1531
|
+
wal?: WalMetrics;
|
|
1449
1532
|
io: IoMetrics;
|
|
1450
1533
|
simd: SimdMetrics;
|
|
1451
1534
|
databases?: Record<string, PerDatabaseMetrics>;
|
|
@@ -1462,6 +1545,11 @@ interface MetricsSummary {
|
|
|
1462
1545
|
activeConnections: number;
|
|
1463
1546
|
activeMaterializedQueries: number;
|
|
1464
1547
|
databaseCount: number;
|
|
1548
|
+
rssBytes?: number;
|
|
1549
|
+
governedBudgetBytes?: number;
|
|
1550
|
+
admissionDenials?: number;
|
|
1551
|
+
walBytesReclaimable?: number;
|
|
1552
|
+
quarantinedDatabases?: number;
|
|
1465
1553
|
}
|
|
1466
1554
|
/** Historical metrics from GET /api/admin/metrics/history. */
|
|
1467
1555
|
interface MetricsHistory {
|
|
@@ -1794,6 +1882,11 @@ interface AdminMemoryConfig {
|
|
|
1794
1882
|
maxTotalRamBytes: number;
|
|
1795
1883
|
maxHotBytes: number;
|
|
1796
1884
|
maxPageCacheBytes: number;
|
|
1885
|
+
budgetTargetBytes?: number;
|
|
1886
|
+
budgetEffectiveBytes?: number;
|
|
1887
|
+
resizeStatus?: string;
|
|
1888
|
+
lastResizeError?: string | null;
|
|
1889
|
+
lastResizeCommittedBytes?: number | null;
|
|
1797
1890
|
}
|
|
1798
1891
|
interface AdminBackupConfig {
|
|
1799
1892
|
cronExpression?: string | null;
|
|
@@ -3021,14 +3114,31 @@ declare class TablesApi {
|
|
|
3021
3114
|
*/
|
|
3022
3115
|
addColumn(tableName: string, body: AddColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3023
3116
|
/**
|
|
3024
|
-
*
|
|
3117
|
+
* Alters a column (type, nullable, encoder, autoIncrement, references, and/or rename).
|
|
3118
|
+
* PATCH /api/databases/{db}/tables/{t}/columns/{c}.
|
|
3119
|
+
* Omit a property to leave it unchanged. For `references`, omit unchanged; `""` or `null` clears.
|
|
3025
3120
|
* @param tableName - Table name.
|
|
3026
3121
|
* @param columnName - Current column name.
|
|
3027
|
-
* @param body -
|
|
3122
|
+
* @param body - Fields to change. `database` is injected from the client scope when omitted.
|
|
3123
|
+
* @returns Updated column detail.
|
|
3124
|
+
*/
|
|
3125
|
+
alterColumn(tableName: string, columnName: string, body: AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3126
|
+
/**
|
|
3127
|
+
* Renames a column (convenience wrapper over {@link alterColumn}).
|
|
3128
|
+
* @param tableName - Table name.
|
|
3129
|
+
* @param columnName - Current column name.
|
|
3130
|
+
* @param body - Request body with newName (database optional; injected when omitted).
|
|
3028
3131
|
* @returns 200 response body (column detail).
|
|
3029
3132
|
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3030
3133
|
*/
|
|
3031
|
-
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3134
|
+
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest | AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3135
|
+
/**
|
|
3136
|
+
* Reorders columns in a table.
|
|
3137
|
+
* PUT /api/databases/{db}/tables/{t}/columns:order (204 No Content).
|
|
3138
|
+
* @param tableName - Table name.
|
|
3139
|
+
* @param columnsOrBody - Ordered column names, or a request body with `columns`.
|
|
3140
|
+
*/
|
|
3141
|
+
reorderColumns(tableName: string, columnsOrBody: string[] | ReorderColumnsRequest): Promise<void>;
|
|
3032
3142
|
/**
|
|
3033
3143
|
* Drops a column from a table.
|
|
3034
3144
|
* @param tableName - Table name.
|
|
@@ -3113,6 +3223,11 @@ declare class DatabasesApi {
|
|
|
3113
3223
|
* Uses server endpoints under /api/databases/{db}/schema.
|
|
3114
3224
|
*/
|
|
3115
3225
|
|
|
3226
|
+
/**
|
|
3227
|
+
* Schema change classification (matches server `SchemaChangeType` enum names).
|
|
3228
|
+
* Unknown future values may appear as plain strings at runtime.
|
|
3229
|
+
*/
|
|
3230
|
+
type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey";
|
|
3116
3231
|
/** Server diff result (matches SchemaDiffResult). */
|
|
3117
3232
|
interface SchemaDiffResult {
|
|
3118
3233
|
changes: SchemaChange[];
|
|
@@ -3120,7 +3235,7 @@ interface SchemaDiffResult {
|
|
|
3120
3235
|
warnings?: SchemaChangeWarning[];
|
|
3121
3236
|
}
|
|
3122
3237
|
interface SchemaChange {
|
|
3123
|
-
type: string;
|
|
3238
|
+
type: SchemaChangeType | (string & {});
|
|
3124
3239
|
tableName?: string | null;
|
|
3125
3240
|
columnName?: string | null;
|
|
3126
3241
|
isDestructive: boolean;
|
|
@@ -3155,7 +3270,7 @@ interface SchemaApplyResult {
|
|
|
3155
3270
|
summary: ApplyResultSummary;
|
|
3156
3271
|
}
|
|
3157
3272
|
interface ApplyResultEntry {
|
|
3158
|
-
changeType: string;
|
|
3273
|
+
changeType: SchemaChangeType | (string & {});
|
|
3159
3274
|
tableName?: string | null;
|
|
3160
3275
|
columnName?: string | null;
|
|
3161
3276
|
status: string;
|
|
@@ -3301,6 +3416,31 @@ declare class BranchesApi {
|
|
|
3301
3416
|
delete(name: string): Promise<void>;
|
|
3302
3417
|
}
|
|
3303
3418
|
|
|
3419
|
+
/**
|
|
3420
|
+
* Pending / background jobs API for @aouda/client.
|
|
3421
|
+
* Projects GET /api/databases/{db}/jobs from the server.
|
|
3422
|
+
*/
|
|
3423
|
+
|
|
3424
|
+
/**
|
|
3425
|
+
* API for listing and inspecting server background jobs (e.g. ColumnRewrite).
|
|
3426
|
+
* Access via `client.jobs`.
|
|
3427
|
+
*/
|
|
3428
|
+
declare class JobsApi {
|
|
3429
|
+
private readonly transport;
|
|
3430
|
+
private readonly database;
|
|
3431
|
+
constructor(transport: Transport, database: string);
|
|
3432
|
+
private get prefix();
|
|
3433
|
+
/**
|
|
3434
|
+
* Lists jobs whose params target this database.
|
|
3435
|
+
*/
|
|
3436
|
+
list(): Promise<PendingJobListResponse>;
|
|
3437
|
+
/**
|
|
3438
|
+
* Gets a single job by id when it belongs to this database.
|
|
3439
|
+
* @param jobId - Job GUID string.
|
|
3440
|
+
*/
|
|
3441
|
+
get(jobId: string): Promise<PendingJobResponse>;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3304
3444
|
/**
|
|
3305
3445
|
* Materialized query HTTP API (`/api/databases/{db}/materialized-queries`).
|
|
3306
3446
|
*/
|
|
@@ -3441,6 +3581,7 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3441
3581
|
private readonly database;
|
|
3442
3582
|
private connected;
|
|
3443
3583
|
private readonly _tables;
|
|
3584
|
+
private readonly _jobs;
|
|
3444
3585
|
private readonly _databases;
|
|
3445
3586
|
private readonly _schema;
|
|
3446
3587
|
private readonly _branches;
|
|
@@ -3524,6 +3665,11 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3524
3665
|
* @returns The tables API.
|
|
3525
3666
|
*/
|
|
3526
3667
|
get tables(): TablesApi;
|
|
3668
|
+
/**
|
|
3669
|
+
* Access pending/background jobs for the current database (e.g. ColumnRewrite).
|
|
3670
|
+
* @returns The jobs API.
|
|
3671
|
+
*/
|
|
3672
|
+
get jobs(): JobsApi;
|
|
3527
3673
|
/**
|
|
3528
3674
|
* Access server-level database operations (list, create, get, drop).
|
|
3529
3675
|
* @returns The databases API.
|
|
@@ -3648,4 +3794,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3648
3794
|
*/
|
|
3649
3795
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3650
3796
|
|
|
3651
|
-
export { type
|
|
3797
|
+
export { type BloomFilterMetrics as $, AoudaClient as A, type BulkLoadOptions as B, type CoverageResponse as C, type DetailedHealthResponse as D, type AggregateFunctionName as E, type FailoverClusterResponse as F, type AlterColumnRequest as G, type HealthStatus as H, type AoudaClientOptions as I, type JoinClusterRequest as J, type AoudaDataType as K, type ListBackupsResponse as L, type AppAuthOptions as M, type NodeInfoResponse as N, AuthClient as O, type PromoteClusterResponse as P, type AuthResult as Q, type ReplicationStatusResponse as R, type SchemaLike as S, type Transport as T, type AuthUserInfo as U, type AuthorizationMode as V, BackupAdminApi as W, type BackupMetrics as X, type BackupSummary as Y, type BatchMutationResult as Z, type BatchOperationInput as _, type BulkLoadJobHandle as a, type MetricsSnapshot as a$, type BranchInfo as a0, BranchesApi as a1, type BulkLoadForceAbortRequest as a2, type BulkLoadForceAbortResponse as a3, type BulkLoadListResponse as a4, type BulkLoadProgress as a5, type BulkLoadReplicaProgress as a6, type BulkLoadReplicaProgressDto as a7, type BulkLoadStatusResponse as a8, CircuitBreakerPolicy as a9, HealthAdminApi as aA, type IndexInfo as aB, type InsertOptions as aC, type InsertResult as aD, type IoMetrics as aE, JobsApi as aF, type LatencyPercentiles as aG, MaterializedQueriesApi as aH, type MaterializedQueryDefinition as aI, type MaterializedQueryExecuteOptions as aJ, type MaterializedQueryExecuteResult as aK, type MaterializedQueryMetrics as aL, type MaterializedQueryRefreshOptions as aM, MaterializedQueryState as aN, type MaterializedQueryStateNumber as aO, type MaterializedQueryStatus as aP, MaterializedQueryType as aQ, type MaterializedQueryTypeNumber as aR, type MemberInfo as aS, type MemoryMetrics as aT, type MergeBranchOptions as aU, type MergeConflict as aV, type MergeExecutionResult as aW, type MergeResult as aX, MetricsAdminApi as aY, type MetricsHistory as aZ, type MetricsHistoryOptions as a_, ClusterAdminApi as aa, type ClusterMemberEntry as ab, type ClusterThisNodeEntry as ac, type ColumnSchema as ad, type ColumnSummaryForErd as ae, type ColumnarResponse as af, type ComponentHealthEntry as ag, type ComputedColumnDef as ah, ConfigAdminApi as ai, type CreateBranchRequest as aj, type CreateColumnRequest as ak, type CreateDatabaseOptions as al, type CreatePartitionGrantRequest as am, type CreateRlsResolverRequest as an, type CreateTableRequest as ao, type DatabaseCoverageEntry as ap, type DatabaseInfo as aq, type DatabaseMemoryMetrics as ar, type DatabaseMemoryUsage as as, type DatabaseMetricsDto as at, type DatabaseOptionsInfo as au, DatabasesApi as av, type DeleteOptions as aw, type DiffSummary as ax, FILTER_OPERATORS as ay, type FilterOperator as az, type TopologyResponse as b, type TableSchemaResponse as b$, type MetricsSummary as b0, type MutationResult as b1, NodeAdminApi as b2, type NodeLogEntry as b3, type NodeLogLevel as b4, type NodeLogStreamOptions as b5, type NodeLogsQuery as b6, type NodeLogsResponse as b7, type OpenWriteStreamOptions as b8, type PageCacheMetrics as b9, type SchemaChange as bA, type SchemaChangeType as bB, type SchemaDiffResult as bC, type SchemaRelationshipsResponse as bD, type SeedApplyResult as bE, type SeedTableApplyResult as bF, ServerAdminApi as bG, type ServerAuthOptions as bH, type ServerMemoryResponse as bI, type ServerMetricsResponse as bJ, type ServiceInfo as bK, type SimdMetrics as bL, type SingleDatabaseMetricsResponse as bM, type SortDirection as bN, type StorageMetrics as bO, type SubscribeOptions as bP, type Subscription as bQ, type SubscriptionChangeEvent as bR, type SubscriptionEvent as bS, type SubscriptionInfo as bT, type SubscriptionSnapshotEvent as bU, TIME_BUCKET_FUNCTIONS as bV, type TableCoverageEntry as bW, type TableNameFromSchema as bX, type TablePolicy as bY, TableQuery as bZ, type TableSchema as b_, type PartitionFunction as ba, type PartitionGrant as bb, type PartitionGrantsListResponse as bc, type PartitioningMetrics as bd, type PendingJobListResponse as be, type PendingJobResponse as bf, type PerDatabaseLagEntry as bg, type PerDatabaseMetrics as bh, type PerDatabaseStatusEntry as bi, type QueryMetrics as bj, type QueryResult as bk, type QueryStats as bl, type ReferenceInfo as bm, type RelationshipEndpoint as bn, type RelationshipInfo as bo, type RenameColumnRequest as bp, type RenameTableRequest as bq, type ReorderColumnsRequest as br, ReplicationAdminApi as bs, type ReplicationMetrics as bt, type ResidencyConfig as bu, RetryPolicy as bv, type RlsResolver as bw, type RlsResolverRule as bx, type RlsResolverRuleInput as by, type RlsResolversListResponse as bz, type ReadinessResponse as c, type TableSummary as c0, type TableSummaryForErd as c1, TablesApi as c2, type TimeBucketFunction as c3, type TimeSeriesMetrics as c4, type TransactionMetrics as c5, type TypeGenerationOptions as c6, type UpdateOptions as c7, type UpdateRlsResolverRequest as c8, type UpdateTableOptionsRequest as c9, type UpdateTablePolicyRequest as ca, type UserProfile as cb, type WalMetrics as cc, WhereGroupBuilder as cd, type WhereOperator as ce, type WriteStream as cf, coerceColumnarValue as cg, createAoudaClient as ch, type TriggerBackupRequest as d, type TriggerBackupResponse as e, type RestoreBackupResponse as f, type BackupSchedule as g, type JoinClusterResponse as h, type LeaveClusterResponse as i, type DrainClusterResponse as j, type ClusterConfigResponse as k, type ClusterConfigPatchRequest as l, type DefaultSchema as m, AGGREGATE_FUNCTIONS as n, AOUDA_DATA_TYPES as o, type AddColumnRequest as p, AdminApi as q, type AdminBackupConfig as r, type AdminBackupPatch as s, type AdminConfigPatchRequest as t, type AdminConfigResponse as u, type AdminConfigSchemaResponse as v, type AdminLoggingConfig as w, type AdminLoggingPatch as x, type AdminMemoryConfig as y, type AdminMemoryPatch as z };
|
|
@@ -566,6 +566,8 @@ interface ColumnSchema {
|
|
|
566
566
|
clusterOrder?: number;
|
|
567
567
|
/** Reference to another table's column (for relationship navigation). */
|
|
568
568
|
reference?: ReferenceInfo;
|
|
569
|
+
/** Preferred encoder name when non-default (e.g. String_Dict). */
|
|
570
|
+
encoder?: string;
|
|
569
571
|
}
|
|
570
572
|
/**
|
|
571
573
|
* Storage policy for a table.
|
|
@@ -924,11 +926,55 @@ interface AddColumnRequest {
|
|
|
924
926
|
type: string;
|
|
925
927
|
}
|
|
926
928
|
/**
|
|
927
|
-
* Request body for
|
|
929
|
+
* Request body for altering a column
|
|
930
|
+
* (PATCH /api/databases/{db}/tables/{name}/columns/{columnName}).
|
|
931
|
+
* Omit a property to leave it unchanged. For `references`, omit to leave unchanged;
|
|
932
|
+
* pass `""` or `null` to clear.
|
|
928
933
|
*/
|
|
929
|
-
interface
|
|
934
|
+
interface AlterColumnRequest {
|
|
935
|
+
database?: string;
|
|
936
|
+
newName?: string;
|
|
937
|
+
type?: string;
|
|
938
|
+
nullable?: boolean;
|
|
939
|
+
encoder?: string;
|
|
940
|
+
autoIncrement?: boolean;
|
|
941
|
+
references?: string | null;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* @deprecated Use {@link AlterColumnRequest} with `newName`. Kept for rename-only callers.
|
|
945
|
+
*/
|
|
946
|
+
type RenameColumnRequest = Pick<AlterColumnRequest, "database" | "newName"> & {
|
|
930
947
|
database: string;
|
|
931
948
|
newName: string;
|
|
949
|
+
};
|
|
950
|
+
/**
|
|
951
|
+
* Request body for reordering columns
|
|
952
|
+
* (PUT /api/databases/{db}/tables/{name}/columns:order).
|
|
953
|
+
*/
|
|
954
|
+
interface ReorderColumnsRequest {
|
|
955
|
+
database?: string;
|
|
956
|
+
columns: string[];
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Single pending-job projection (GET /api/databases/{db}/jobs).
|
|
960
|
+
*/
|
|
961
|
+
interface PendingJobResponse {
|
|
962
|
+
id: string;
|
|
963
|
+
type: string;
|
|
964
|
+
state: string;
|
|
965
|
+
createdAt: string;
|
|
966
|
+
startedAt?: string | null;
|
|
967
|
+
completedAt?: string | null;
|
|
968
|
+
error?: string | null;
|
|
969
|
+
/** Parsed params object when ParamsJson is JSON; otherwise a string. */
|
|
970
|
+
params?: unknown;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* List response for GET /api/databases/{db}/jobs.
|
|
974
|
+
*/
|
|
975
|
+
interface PendingJobListResponse {
|
|
976
|
+
database: string;
|
|
977
|
+
jobs: PendingJobResponse[];
|
|
932
978
|
}
|
|
933
979
|
/**
|
|
934
980
|
* Request body for updating a table's storage policy (PUT /api/databases/{db}/tables/{name}/policy).
|
|
@@ -1164,6 +1210,21 @@ interface ServerMemoryResponse {
|
|
|
1164
1210
|
databaseCount: number;
|
|
1165
1211
|
perDatabaseUsage: Record<string, DatabaseMemoryUsage>;
|
|
1166
1212
|
timestamp: string;
|
|
1213
|
+
rssBytes?: number;
|
|
1214
|
+
reservedBytes?: number;
|
|
1215
|
+
governedBudgetBytes?: number;
|
|
1216
|
+
rssDriftBytes?: number;
|
|
1217
|
+
tighteningActive?: boolean;
|
|
1218
|
+
budgetTargetBytes?: number;
|
|
1219
|
+
budgetEffectiveBytes?: number;
|
|
1220
|
+
resizeStatus?: string;
|
|
1221
|
+
admissionDenials?: number;
|
|
1222
|
+
admissionThrottles?: number;
|
|
1223
|
+
walBytesOnDisk?: number;
|
|
1224
|
+
walBytesReclaimable?: number;
|
|
1225
|
+
walRecoveryPortions?: number;
|
|
1226
|
+
walRecoveryCursorWrites?: number;
|
|
1227
|
+
quarantinedDatabases?: number;
|
|
1167
1228
|
}
|
|
1168
1229
|
/** Per-database metrics DTO in server metrics response. */
|
|
1169
1230
|
interface DatabaseMetricsDto {
|
|
@@ -1397,8 +1458,29 @@ interface MemoryMetrics {
|
|
|
1397
1458
|
hotBytes: number;
|
|
1398
1459
|
cacheBytes: number;
|
|
1399
1460
|
evictions: number;
|
|
1461
|
+
rssBytes?: number;
|
|
1462
|
+
reservedBytes?: number;
|
|
1463
|
+
governedBudgetBytes?: number;
|
|
1464
|
+
rssDriftBytes?: number;
|
|
1465
|
+
tighteningActive?: boolean;
|
|
1466
|
+
budgetTargetBytes?: number;
|
|
1467
|
+
budgetEffectiveBytes?: number;
|
|
1468
|
+
resizeStatus?: string;
|
|
1469
|
+
admissionDenials?: number;
|
|
1470
|
+
admissionThrottles?: number;
|
|
1400
1471
|
perDatabase?: Record<string, DatabaseMemoryMetrics>;
|
|
1401
1472
|
}
|
|
1473
|
+
/** Bounded-WAL inventory (GET /api/admin/metrics/wal). */
|
|
1474
|
+
interface WalMetrics {
|
|
1475
|
+
bytesOnDisk: number;
|
|
1476
|
+
bytesReclaimable: number;
|
|
1477
|
+
recoveryPortions: number;
|
|
1478
|
+
recoveryCursorWrites: number;
|
|
1479
|
+
corruptFramesStopped: number;
|
|
1480
|
+
ladderThrottleTotal: number;
|
|
1481
|
+
ladderRefuseTotal: number;
|
|
1482
|
+
quarantinedTotal: number;
|
|
1483
|
+
}
|
|
1402
1484
|
/** I/O operation metrics. */
|
|
1403
1485
|
interface IoMetrics {
|
|
1404
1486
|
totalMs: number;
|
|
@@ -1446,6 +1528,7 @@ interface MetricsSnapshot {
|
|
|
1446
1528
|
bloomFilters: BloomFilterMetrics;
|
|
1447
1529
|
transactions: TransactionMetrics;
|
|
1448
1530
|
memory: MemoryMetrics;
|
|
1531
|
+
wal?: WalMetrics;
|
|
1449
1532
|
io: IoMetrics;
|
|
1450
1533
|
simd: SimdMetrics;
|
|
1451
1534
|
databases?: Record<string, PerDatabaseMetrics>;
|
|
@@ -1462,6 +1545,11 @@ interface MetricsSummary {
|
|
|
1462
1545
|
activeConnections: number;
|
|
1463
1546
|
activeMaterializedQueries: number;
|
|
1464
1547
|
databaseCount: number;
|
|
1548
|
+
rssBytes?: number;
|
|
1549
|
+
governedBudgetBytes?: number;
|
|
1550
|
+
admissionDenials?: number;
|
|
1551
|
+
walBytesReclaimable?: number;
|
|
1552
|
+
quarantinedDatabases?: number;
|
|
1465
1553
|
}
|
|
1466
1554
|
/** Historical metrics from GET /api/admin/metrics/history. */
|
|
1467
1555
|
interface MetricsHistory {
|
|
@@ -1794,6 +1882,11 @@ interface AdminMemoryConfig {
|
|
|
1794
1882
|
maxTotalRamBytes: number;
|
|
1795
1883
|
maxHotBytes: number;
|
|
1796
1884
|
maxPageCacheBytes: number;
|
|
1885
|
+
budgetTargetBytes?: number;
|
|
1886
|
+
budgetEffectiveBytes?: number;
|
|
1887
|
+
resizeStatus?: string;
|
|
1888
|
+
lastResizeError?: string | null;
|
|
1889
|
+
lastResizeCommittedBytes?: number | null;
|
|
1797
1890
|
}
|
|
1798
1891
|
interface AdminBackupConfig {
|
|
1799
1892
|
cronExpression?: string | null;
|
|
@@ -3021,14 +3114,31 @@ declare class TablesApi {
|
|
|
3021
3114
|
*/
|
|
3022
3115
|
addColumn(tableName: string, body: AddColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3023
3116
|
/**
|
|
3024
|
-
*
|
|
3117
|
+
* Alters a column (type, nullable, encoder, autoIncrement, references, and/or rename).
|
|
3118
|
+
* PATCH /api/databases/{db}/tables/{t}/columns/{c}.
|
|
3119
|
+
* Omit a property to leave it unchanged. For `references`, omit unchanged; `""` or `null` clears.
|
|
3025
3120
|
* @param tableName - Table name.
|
|
3026
3121
|
* @param columnName - Current column name.
|
|
3027
|
-
* @param body -
|
|
3122
|
+
* @param body - Fields to change. `database` is injected from the client scope when omitted.
|
|
3123
|
+
* @returns Updated column detail.
|
|
3124
|
+
*/
|
|
3125
|
+
alterColumn(tableName: string, columnName: string, body: AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3126
|
+
/**
|
|
3127
|
+
* Renames a column (convenience wrapper over {@link alterColumn}).
|
|
3128
|
+
* @param tableName - Table name.
|
|
3129
|
+
* @param columnName - Current column name.
|
|
3130
|
+
* @param body - Request body with newName (database optional; injected when omitted).
|
|
3028
3131
|
* @returns 200 response body (column detail).
|
|
3029
3132
|
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3030
3133
|
*/
|
|
3031
|
-
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3134
|
+
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest | AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3135
|
+
/**
|
|
3136
|
+
* Reorders columns in a table.
|
|
3137
|
+
* PUT /api/databases/{db}/tables/{t}/columns:order (204 No Content).
|
|
3138
|
+
* @param tableName - Table name.
|
|
3139
|
+
* @param columnsOrBody - Ordered column names, or a request body with `columns`.
|
|
3140
|
+
*/
|
|
3141
|
+
reorderColumns(tableName: string, columnsOrBody: string[] | ReorderColumnsRequest): Promise<void>;
|
|
3032
3142
|
/**
|
|
3033
3143
|
* Drops a column from a table.
|
|
3034
3144
|
* @param tableName - Table name.
|
|
@@ -3113,6 +3223,11 @@ declare class DatabasesApi {
|
|
|
3113
3223
|
* Uses server endpoints under /api/databases/{db}/schema.
|
|
3114
3224
|
*/
|
|
3115
3225
|
|
|
3226
|
+
/**
|
|
3227
|
+
* Schema change classification (matches server `SchemaChangeType` enum names).
|
|
3228
|
+
* Unknown future values may appear as plain strings at runtime.
|
|
3229
|
+
*/
|
|
3230
|
+
type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey";
|
|
3116
3231
|
/** Server diff result (matches SchemaDiffResult). */
|
|
3117
3232
|
interface SchemaDiffResult {
|
|
3118
3233
|
changes: SchemaChange[];
|
|
@@ -3120,7 +3235,7 @@ interface SchemaDiffResult {
|
|
|
3120
3235
|
warnings?: SchemaChangeWarning[];
|
|
3121
3236
|
}
|
|
3122
3237
|
interface SchemaChange {
|
|
3123
|
-
type: string;
|
|
3238
|
+
type: SchemaChangeType | (string & {});
|
|
3124
3239
|
tableName?: string | null;
|
|
3125
3240
|
columnName?: string | null;
|
|
3126
3241
|
isDestructive: boolean;
|
|
@@ -3155,7 +3270,7 @@ interface SchemaApplyResult {
|
|
|
3155
3270
|
summary: ApplyResultSummary;
|
|
3156
3271
|
}
|
|
3157
3272
|
interface ApplyResultEntry {
|
|
3158
|
-
changeType: string;
|
|
3273
|
+
changeType: SchemaChangeType | (string & {});
|
|
3159
3274
|
tableName?: string | null;
|
|
3160
3275
|
columnName?: string | null;
|
|
3161
3276
|
status: string;
|
|
@@ -3301,6 +3416,31 @@ declare class BranchesApi {
|
|
|
3301
3416
|
delete(name: string): Promise<void>;
|
|
3302
3417
|
}
|
|
3303
3418
|
|
|
3419
|
+
/**
|
|
3420
|
+
* Pending / background jobs API for @aouda/client.
|
|
3421
|
+
* Projects GET /api/databases/{db}/jobs from the server.
|
|
3422
|
+
*/
|
|
3423
|
+
|
|
3424
|
+
/**
|
|
3425
|
+
* API for listing and inspecting server background jobs (e.g. ColumnRewrite).
|
|
3426
|
+
* Access via `client.jobs`.
|
|
3427
|
+
*/
|
|
3428
|
+
declare class JobsApi {
|
|
3429
|
+
private readonly transport;
|
|
3430
|
+
private readonly database;
|
|
3431
|
+
constructor(transport: Transport, database: string);
|
|
3432
|
+
private get prefix();
|
|
3433
|
+
/**
|
|
3434
|
+
* Lists jobs whose params target this database.
|
|
3435
|
+
*/
|
|
3436
|
+
list(): Promise<PendingJobListResponse>;
|
|
3437
|
+
/**
|
|
3438
|
+
* Gets a single job by id when it belongs to this database.
|
|
3439
|
+
* @param jobId - Job GUID string.
|
|
3440
|
+
*/
|
|
3441
|
+
get(jobId: string): Promise<PendingJobResponse>;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3304
3444
|
/**
|
|
3305
3445
|
* Materialized query HTTP API (`/api/databases/{db}/materialized-queries`).
|
|
3306
3446
|
*/
|
|
@@ -3441,6 +3581,7 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3441
3581
|
private readonly database;
|
|
3442
3582
|
private connected;
|
|
3443
3583
|
private readonly _tables;
|
|
3584
|
+
private readonly _jobs;
|
|
3444
3585
|
private readonly _databases;
|
|
3445
3586
|
private readonly _schema;
|
|
3446
3587
|
private readonly _branches;
|
|
@@ -3524,6 +3665,11 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3524
3665
|
* @returns The tables API.
|
|
3525
3666
|
*/
|
|
3526
3667
|
get tables(): TablesApi;
|
|
3668
|
+
/**
|
|
3669
|
+
* Access pending/background jobs for the current database (e.g. ColumnRewrite).
|
|
3670
|
+
* @returns The jobs API.
|
|
3671
|
+
*/
|
|
3672
|
+
get jobs(): JobsApi;
|
|
3527
3673
|
/**
|
|
3528
3674
|
* Access server-level database operations (list, create, get, drop).
|
|
3529
3675
|
* @returns The databases API.
|
|
@@ -3648,4 +3794,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3648
3794
|
*/
|
|
3649
3795
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3650
3796
|
|
|
3651
|
-
export { type
|
|
3797
|
+
export { type BloomFilterMetrics as $, AoudaClient as A, type BulkLoadOptions as B, type CoverageResponse as C, type DetailedHealthResponse as D, type AggregateFunctionName as E, type FailoverClusterResponse as F, type AlterColumnRequest as G, type HealthStatus as H, type AoudaClientOptions as I, type JoinClusterRequest as J, type AoudaDataType as K, type ListBackupsResponse as L, type AppAuthOptions as M, type NodeInfoResponse as N, AuthClient as O, type PromoteClusterResponse as P, type AuthResult as Q, type ReplicationStatusResponse as R, type SchemaLike as S, type Transport as T, type AuthUserInfo as U, type AuthorizationMode as V, BackupAdminApi as W, type BackupMetrics as X, type BackupSummary as Y, type BatchMutationResult as Z, type BatchOperationInput as _, type BulkLoadJobHandle as a, type MetricsSnapshot as a$, type BranchInfo as a0, BranchesApi as a1, type BulkLoadForceAbortRequest as a2, type BulkLoadForceAbortResponse as a3, type BulkLoadListResponse as a4, type BulkLoadProgress as a5, type BulkLoadReplicaProgress as a6, type BulkLoadReplicaProgressDto as a7, type BulkLoadStatusResponse as a8, CircuitBreakerPolicy as a9, HealthAdminApi as aA, type IndexInfo as aB, type InsertOptions as aC, type InsertResult as aD, type IoMetrics as aE, JobsApi as aF, type LatencyPercentiles as aG, MaterializedQueriesApi as aH, type MaterializedQueryDefinition as aI, type MaterializedQueryExecuteOptions as aJ, type MaterializedQueryExecuteResult as aK, type MaterializedQueryMetrics as aL, type MaterializedQueryRefreshOptions as aM, MaterializedQueryState as aN, type MaterializedQueryStateNumber as aO, type MaterializedQueryStatus as aP, MaterializedQueryType as aQ, type MaterializedQueryTypeNumber as aR, type MemberInfo as aS, type MemoryMetrics as aT, type MergeBranchOptions as aU, type MergeConflict as aV, type MergeExecutionResult as aW, type MergeResult as aX, MetricsAdminApi as aY, type MetricsHistory as aZ, type MetricsHistoryOptions as a_, ClusterAdminApi as aa, type ClusterMemberEntry as ab, type ClusterThisNodeEntry as ac, type ColumnSchema as ad, type ColumnSummaryForErd as ae, type ColumnarResponse as af, type ComponentHealthEntry as ag, type ComputedColumnDef as ah, ConfigAdminApi as ai, type CreateBranchRequest as aj, type CreateColumnRequest as ak, type CreateDatabaseOptions as al, type CreatePartitionGrantRequest as am, type CreateRlsResolverRequest as an, type CreateTableRequest as ao, type DatabaseCoverageEntry as ap, type DatabaseInfo as aq, type DatabaseMemoryMetrics as ar, type DatabaseMemoryUsage as as, type DatabaseMetricsDto as at, type DatabaseOptionsInfo as au, DatabasesApi as av, type DeleteOptions as aw, type DiffSummary as ax, FILTER_OPERATORS as ay, type FilterOperator as az, type TopologyResponse as b, type TableSchemaResponse as b$, type MetricsSummary as b0, type MutationResult as b1, NodeAdminApi as b2, type NodeLogEntry as b3, type NodeLogLevel as b4, type NodeLogStreamOptions as b5, type NodeLogsQuery as b6, type NodeLogsResponse as b7, type OpenWriteStreamOptions as b8, type PageCacheMetrics as b9, type SchemaChange as bA, type SchemaChangeType as bB, type SchemaDiffResult as bC, type SchemaRelationshipsResponse as bD, type SeedApplyResult as bE, type SeedTableApplyResult as bF, ServerAdminApi as bG, type ServerAuthOptions as bH, type ServerMemoryResponse as bI, type ServerMetricsResponse as bJ, type ServiceInfo as bK, type SimdMetrics as bL, type SingleDatabaseMetricsResponse as bM, type SortDirection as bN, type StorageMetrics as bO, type SubscribeOptions as bP, type Subscription as bQ, type SubscriptionChangeEvent as bR, type SubscriptionEvent as bS, type SubscriptionInfo as bT, type SubscriptionSnapshotEvent as bU, TIME_BUCKET_FUNCTIONS as bV, type TableCoverageEntry as bW, type TableNameFromSchema as bX, type TablePolicy as bY, TableQuery as bZ, type TableSchema as b_, type PartitionFunction as ba, type PartitionGrant as bb, type PartitionGrantsListResponse as bc, type PartitioningMetrics as bd, type PendingJobListResponse as be, type PendingJobResponse as bf, type PerDatabaseLagEntry as bg, type PerDatabaseMetrics as bh, type PerDatabaseStatusEntry as bi, type QueryMetrics as bj, type QueryResult as bk, type QueryStats as bl, type ReferenceInfo as bm, type RelationshipEndpoint as bn, type RelationshipInfo as bo, type RenameColumnRequest as bp, type RenameTableRequest as bq, type ReorderColumnsRequest as br, ReplicationAdminApi as bs, type ReplicationMetrics as bt, type ResidencyConfig as bu, RetryPolicy as bv, type RlsResolver as bw, type RlsResolverRule as bx, type RlsResolverRuleInput as by, type RlsResolversListResponse as bz, type ReadinessResponse as c, type TableSummary as c0, type TableSummaryForErd as c1, TablesApi as c2, type TimeBucketFunction as c3, type TimeSeriesMetrics as c4, type TransactionMetrics as c5, type TypeGenerationOptions as c6, type UpdateOptions as c7, type UpdateRlsResolverRequest as c8, type UpdateTableOptionsRequest as c9, type UpdateTablePolicyRequest as ca, type UserProfile as cb, type WalMetrics as cc, WhereGroupBuilder as cd, type WhereOperator as ce, type WriteStream as cf, coerceColumnarValue as cg, createAoudaClient as ch, type TriggerBackupRequest as d, type TriggerBackupResponse as e, type RestoreBackupResponse as f, type BackupSchedule as g, type JoinClusterResponse as h, type LeaveClusterResponse as i, type DrainClusterResponse as j, type ClusterConfigResponse as k, type ClusterConfigPatchRequest as l, type DefaultSchema as m, AGGREGATE_FUNCTIONS as n, AOUDA_DATA_TYPES as o, type AddColumnRequest as p, AdminApi as q, type AdminBackupConfig as r, type AdminBackupPatch as s, type AdminConfigPatchRequest as t, type AdminConfigResponse as u, type AdminConfigSchemaResponse as v, type AdminLoggingConfig as w, type AdminLoggingPatch as x, type AdminMemoryConfig as y, type AdminMemoryPatch as z };
|