@aouda/client 0.1.7 → 0.1.8
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 +97 -13
- 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 +97 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-BbyXG5AL.d.cts → client-TIOp5NUu.d.cts} +107 -8
- package/dist/{client-BbyXG5AL.d.ts → client-TIOp5NUu.d.ts} +107 -8
- package/dist/index.cjs +99 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +98 -13
- 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).
|
|
@@ -3021,14 +3067,31 @@ declare class TablesApi {
|
|
|
3021
3067
|
*/
|
|
3022
3068
|
addColumn(tableName: string, body: AddColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3023
3069
|
/**
|
|
3024
|
-
*
|
|
3070
|
+
* Alters a column (type, nullable, encoder, autoIncrement, references, and/or rename).
|
|
3071
|
+
* PATCH /api/databases/{db}/tables/{t}/columns/{c}.
|
|
3072
|
+
* Omit a property to leave it unchanged. For `references`, omit unchanged; `""` or `null` clears.
|
|
3025
3073
|
* @param tableName - Table name.
|
|
3026
3074
|
* @param columnName - Current column name.
|
|
3027
|
-
* @param body -
|
|
3075
|
+
* @param body - Fields to change. `database` is injected from the client scope when omitted.
|
|
3076
|
+
* @returns Updated column detail.
|
|
3077
|
+
*/
|
|
3078
|
+
alterColumn(tableName: string, columnName: string, body: AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3079
|
+
/**
|
|
3080
|
+
* Renames a column (convenience wrapper over {@link alterColumn}).
|
|
3081
|
+
* @param tableName - Table name.
|
|
3082
|
+
* @param columnName - Current column name.
|
|
3083
|
+
* @param body - Request body with newName (database optional; injected when omitted).
|
|
3028
3084
|
* @returns 200 response body (column detail).
|
|
3029
3085
|
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3030
3086
|
*/
|
|
3031
|
-
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3087
|
+
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest | AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3088
|
+
/**
|
|
3089
|
+
* Reorders columns in a table.
|
|
3090
|
+
* PUT /api/databases/{db}/tables/{t}/columns:order (204 No Content).
|
|
3091
|
+
* @param tableName - Table name.
|
|
3092
|
+
* @param columnsOrBody - Ordered column names, or a request body with `columns`.
|
|
3093
|
+
*/
|
|
3094
|
+
reorderColumns(tableName: string, columnsOrBody: string[] | ReorderColumnsRequest): Promise<void>;
|
|
3032
3095
|
/**
|
|
3033
3096
|
* Drops a column from a table.
|
|
3034
3097
|
* @param tableName - Table name.
|
|
@@ -3113,6 +3176,11 @@ declare class DatabasesApi {
|
|
|
3113
3176
|
* Uses server endpoints under /api/databases/{db}/schema.
|
|
3114
3177
|
*/
|
|
3115
3178
|
|
|
3179
|
+
/**
|
|
3180
|
+
* Schema change classification (matches server `SchemaChangeType` enum names).
|
|
3181
|
+
* Unknown future values may appear as plain strings at runtime.
|
|
3182
|
+
*/
|
|
3183
|
+
type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey";
|
|
3116
3184
|
/** Server diff result (matches SchemaDiffResult). */
|
|
3117
3185
|
interface SchemaDiffResult {
|
|
3118
3186
|
changes: SchemaChange[];
|
|
@@ -3120,7 +3188,7 @@ interface SchemaDiffResult {
|
|
|
3120
3188
|
warnings?: SchemaChangeWarning[];
|
|
3121
3189
|
}
|
|
3122
3190
|
interface SchemaChange {
|
|
3123
|
-
type: string;
|
|
3191
|
+
type: SchemaChangeType | (string & {});
|
|
3124
3192
|
tableName?: string | null;
|
|
3125
3193
|
columnName?: string | null;
|
|
3126
3194
|
isDestructive: boolean;
|
|
@@ -3155,7 +3223,7 @@ interface SchemaApplyResult {
|
|
|
3155
3223
|
summary: ApplyResultSummary;
|
|
3156
3224
|
}
|
|
3157
3225
|
interface ApplyResultEntry {
|
|
3158
|
-
changeType: string;
|
|
3226
|
+
changeType: SchemaChangeType | (string & {});
|
|
3159
3227
|
tableName?: string | null;
|
|
3160
3228
|
columnName?: string | null;
|
|
3161
3229
|
status: string;
|
|
@@ -3301,6 +3369,31 @@ declare class BranchesApi {
|
|
|
3301
3369
|
delete(name: string): Promise<void>;
|
|
3302
3370
|
}
|
|
3303
3371
|
|
|
3372
|
+
/**
|
|
3373
|
+
* Pending / background jobs API for @aouda/client.
|
|
3374
|
+
* Projects GET /api/databases/{db}/jobs from the server.
|
|
3375
|
+
*/
|
|
3376
|
+
|
|
3377
|
+
/**
|
|
3378
|
+
* API for listing and inspecting server background jobs (e.g. ColumnRewrite).
|
|
3379
|
+
* Access via `client.jobs`.
|
|
3380
|
+
*/
|
|
3381
|
+
declare class JobsApi {
|
|
3382
|
+
private readonly transport;
|
|
3383
|
+
private readonly database;
|
|
3384
|
+
constructor(transport: Transport, database: string);
|
|
3385
|
+
private get prefix();
|
|
3386
|
+
/**
|
|
3387
|
+
* Lists jobs whose params target this database.
|
|
3388
|
+
*/
|
|
3389
|
+
list(): Promise<PendingJobListResponse>;
|
|
3390
|
+
/**
|
|
3391
|
+
* Gets a single job by id when it belongs to this database.
|
|
3392
|
+
* @param jobId - Job GUID string.
|
|
3393
|
+
*/
|
|
3394
|
+
get(jobId: string): Promise<PendingJobResponse>;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3304
3397
|
/**
|
|
3305
3398
|
* Materialized query HTTP API (`/api/databases/{db}/materialized-queries`).
|
|
3306
3399
|
*/
|
|
@@ -3441,6 +3534,7 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3441
3534
|
private readonly database;
|
|
3442
3535
|
private connected;
|
|
3443
3536
|
private readonly _tables;
|
|
3537
|
+
private readonly _jobs;
|
|
3444
3538
|
private readonly _databases;
|
|
3445
3539
|
private readonly _schema;
|
|
3446
3540
|
private readonly _branches;
|
|
@@ -3524,6 +3618,11 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3524
3618
|
* @returns The tables API.
|
|
3525
3619
|
*/
|
|
3526
3620
|
get tables(): TablesApi;
|
|
3621
|
+
/**
|
|
3622
|
+
* Access pending/background jobs for the current database (e.g. ColumnRewrite).
|
|
3623
|
+
* @returns The jobs API.
|
|
3624
|
+
*/
|
|
3625
|
+
get jobs(): JobsApi;
|
|
3527
3626
|
/**
|
|
3528
3627
|
* Access server-level database operations (list, create, get, drop).
|
|
3529
3628
|
* @returns The databases API.
|
|
@@ -3648,4 +3747,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3648
3747
|
*/
|
|
3649
3748
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3650
3749
|
|
|
3651
|
-
export { type
|
|
3750
|
+
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, WhereGroupBuilder as cc, type WhereOperator as cd, type WriteStream as ce, coerceColumnarValue as cf, createAoudaClient as cg, 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).
|
|
@@ -3021,14 +3067,31 @@ declare class TablesApi {
|
|
|
3021
3067
|
*/
|
|
3022
3068
|
addColumn(tableName: string, body: AddColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3023
3069
|
/**
|
|
3024
|
-
*
|
|
3070
|
+
* Alters a column (type, nullable, encoder, autoIncrement, references, and/or rename).
|
|
3071
|
+
* PATCH /api/databases/{db}/tables/{t}/columns/{c}.
|
|
3072
|
+
* Omit a property to leave it unchanged. For `references`, omit unchanged; `""` or `null` clears.
|
|
3025
3073
|
* @param tableName - Table name.
|
|
3026
3074
|
* @param columnName - Current column name.
|
|
3027
|
-
* @param body -
|
|
3075
|
+
* @param body - Fields to change. `database` is injected from the client scope when omitted.
|
|
3076
|
+
* @returns Updated column detail.
|
|
3077
|
+
*/
|
|
3078
|
+
alterColumn(tableName: string, columnName: string, body: AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3079
|
+
/**
|
|
3080
|
+
* Renames a column (convenience wrapper over {@link alterColumn}).
|
|
3081
|
+
* @param tableName - Table name.
|
|
3082
|
+
* @param columnName - Current column name.
|
|
3083
|
+
* @param body - Request body with newName (database optional; injected when omitted).
|
|
3028
3084
|
* @returns 200 response body (column detail).
|
|
3029
3085
|
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3030
3086
|
*/
|
|
3031
|
-
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3087
|
+
renameColumn(tableName: string, columnName: string, body: RenameColumnRequest | AlterColumnRequest): Promise<ColumnSchema | undefined>;
|
|
3088
|
+
/**
|
|
3089
|
+
* Reorders columns in a table.
|
|
3090
|
+
* PUT /api/databases/{db}/tables/{t}/columns:order (204 No Content).
|
|
3091
|
+
* @param tableName - Table name.
|
|
3092
|
+
* @param columnsOrBody - Ordered column names, or a request body with `columns`.
|
|
3093
|
+
*/
|
|
3094
|
+
reorderColumns(tableName: string, columnsOrBody: string[] | ReorderColumnsRequest): Promise<void>;
|
|
3032
3095
|
/**
|
|
3033
3096
|
* Drops a column from a table.
|
|
3034
3097
|
* @param tableName - Table name.
|
|
@@ -3113,6 +3176,11 @@ declare class DatabasesApi {
|
|
|
3113
3176
|
* Uses server endpoints under /api/databases/{db}/schema.
|
|
3114
3177
|
*/
|
|
3115
3178
|
|
|
3179
|
+
/**
|
|
3180
|
+
* Schema change classification (matches server `SchemaChangeType` enum names).
|
|
3181
|
+
* Unknown future values may appear as plain strings at runtime.
|
|
3182
|
+
*/
|
|
3183
|
+
type SchemaChangeType = "CreateTable" | "DropTable" | "AddColumn" | "DropColumn" | "UpdatePolicy" | "UpdateDurability" | "UpdatePartitionLevelSecurity" | "UpdateAuthorizationOptions" | "UpdateTableCulture" | "UpdateSettings" | "UpdateColumnAutoIncrement" | "UpdateColumnType" | "UpdateColumnNullable" | "UpdateColumnEncoder" | "RenameColumn" | "ReorderColumns" | "UpdateColumnReferences" | "UpdateColumnDefault" | "UpdateColumnDescription" | "UpdateTablePrimaryKey";
|
|
3116
3184
|
/** Server diff result (matches SchemaDiffResult). */
|
|
3117
3185
|
interface SchemaDiffResult {
|
|
3118
3186
|
changes: SchemaChange[];
|
|
@@ -3120,7 +3188,7 @@ interface SchemaDiffResult {
|
|
|
3120
3188
|
warnings?: SchemaChangeWarning[];
|
|
3121
3189
|
}
|
|
3122
3190
|
interface SchemaChange {
|
|
3123
|
-
type: string;
|
|
3191
|
+
type: SchemaChangeType | (string & {});
|
|
3124
3192
|
tableName?: string | null;
|
|
3125
3193
|
columnName?: string | null;
|
|
3126
3194
|
isDestructive: boolean;
|
|
@@ -3155,7 +3223,7 @@ interface SchemaApplyResult {
|
|
|
3155
3223
|
summary: ApplyResultSummary;
|
|
3156
3224
|
}
|
|
3157
3225
|
interface ApplyResultEntry {
|
|
3158
|
-
changeType: string;
|
|
3226
|
+
changeType: SchemaChangeType | (string & {});
|
|
3159
3227
|
tableName?: string | null;
|
|
3160
3228
|
columnName?: string | null;
|
|
3161
3229
|
status: string;
|
|
@@ -3301,6 +3369,31 @@ declare class BranchesApi {
|
|
|
3301
3369
|
delete(name: string): Promise<void>;
|
|
3302
3370
|
}
|
|
3303
3371
|
|
|
3372
|
+
/**
|
|
3373
|
+
* Pending / background jobs API for @aouda/client.
|
|
3374
|
+
* Projects GET /api/databases/{db}/jobs from the server.
|
|
3375
|
+
*/
|
|
3376
|
+
|
|
3377
|
+
/**
|
|
3378
|
+
* API for listing and inspecting server background jobs (e.g. ColumnRewrite).
|
|
3379
|
+
* Access via `client.jobs`.
|
|
3380
|
+
*/
|
|
3381
|
+
declare class JobsApi {
|
|
3382
|
+
private readonly transport;
|
|
3383
|
+
private readonly database;
|
|
3384
|
+
constructor(transport: Transport, database: string);
|
|
3385
|
+
private get prefix();
|
|
3386
|
+
/**
|
|
3387
|
+
* Lists jobs whose params target this database.
|
|
3388
|
+
*/
|
|
3389
|
+
list(): Promise<PendingJobListResponse>;
|
|
3390
|
+
/**
|
|
3391
|
+
* Gets a single job by id when it belongs to this database.
|
|
3392
|
+
* @param jobId - Job GUID string.
|
|
3393
|
+
*/
|
|
3394
|
+
get(jobId: string): Promise<PendingJobResponse>;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3304
3397
|
/**
|
|
3305
3398
|
* Materialized query HTTP API (`/api/databases/{db}/materialized-queries`).
|
|
3306
3399
|
*/
|
|
@@ -3441,6 +3534,7 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3441
3534
|
private readonly database;
|
|
3442
3535
|
private connected;
|
|
3443
3536
|
private readonly _tables;
|
|
3537
|
+
private readonly _jobs;
|
|
3444
3538
|
private readonly _databases;
|
|
3445
3539
|
private readonly _schema;
|
|
3446
3540
|
private readonly _branches;
|
|
@@ -3524,6 +3618,11 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3524
3618
|
* @returns The tables API.
|
|
3525
3619
|
*/
|
|
3526
3620
|
get tables(): TablesApi;
|
|
3621
|
+
/**
|
|
3622
|
+
* Access pending/background jobs for the current database (e.g. ColumnRewrite).
|
|
3623
|
+
* @returns The jobs API.
|
|
3624
|
+
*/
|
|
3625
|
+
get jobs(): JobsApi;
|
|
3527
3626
|
/**
|
|
3528
3627
|
* Access server-level database operations (list, create, get, drop).
|
|
3529
3628
|
* @returns The databases API.
|
|
@@ -3648,4 +3747,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3648
3747
|
*/
|
|
3649
3748
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3650
3749
|
|
|
3651
|
-
export { type
|
|
3750
|
+
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, WhereGroupBuilder as cc, type WhereOperator as cd, type WriteStream as ce, coerceColumnarValue as cf, createAoudaClient as cg, 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 };
|
package/dist/index.cjs
CHANGED
|
@@ -56,6 +56,7 @@ __export(index_exports, {
|
|
|
56
56
|
DatabasesApi: () => DatabasesApi,
|
|
57
57
|
FILTER_OPERATORS: () => FILTER_OPERATORS,
|
|
58
58
|
HealthAdminApi: () => HealthAdminApi,
|
|
59
|
+
JobsApi: () => JobsApi,
|
|
59
60
|
MaterializedQueriesApi: () => MaterializedQueriesApi,
|
|
60
61
|
MaterializedQueryState: () => MaterializedQueryState,
|
|
61
62
|
MaterializedQueryType: () => MaterializedQueryType,
|
|
@@ -82,7 +83,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
82
83
|
// package.json
|
|
83
84
|
var package_default = {
|
|
84
85
|
name: "@aouda/client",
|
|
85
|
-
version: "0.1.
|
|
86
|
+
version: "0.1.8",
|
|
86
87
|
description: "Official TypeScript/JavaScript client library for Aouda",
|
|
87
88
|
type: "module",
|
|
88
89
|
main: "./dist/index.cjs",
|
|
@@ -3647,23 +3648,68 @@ var TablesApi = class {
|
|
|
3647
3648
|
);
|
|
3648
3649
|
}
|
|
3649
3650
|
/**
|
|
3650
|
-
*
|
|
3651
|
+
* Alters a column (type, nullable, encoder, autoIncrement, references, and/or rename).
|
|
3652
|
+
* PATCH /api/databases/{db}/tables/{t}/columns/{c}.
|
|
3653
|
+
* Omit a property to leave it unchanged. For `references`, omit unchanged; `""` or `null` clears.
|
|
3651
3654
|
* @param tableName - Table name.
|
|
3652
3655
|
* @param columnName - Current column name.
|
|
3653
|
-
* @param body -
|
|
3654
|
-
* @returns
|
|
3655
|
-
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3656
|
+
* @param body - Fields to change. `database` is injected from the client scope when omitted.
|
|
3657
|
+
* @returns Updated column detail.
|
|
3656
3658
|
*/
|
|
3657
|
-
async
|
|
3659
|
+
async alterColumn(tableName, columnName, body) {
|
|
3658
3660
|
validateNonEmptyString(tableName, "Table name");
|
|
3659
3661
|
validateNonEmptyString(columnName, "Column name");
|
|
3660
|
-
|
|
3662
|
+
const hasField = body.newName !== void 0 || body.type !== void 0 || body.nullable !== void 0 || body.encoder !== void 0 || body.autoIncrement !== void 0 || body.references !== void 0;
|
|
3663
|
+
if (!hasField) {
|
|
3664
|
+
throw new Error(
|
|
3665
|
+
"AlterColumnRequest must set at least one of: newName, type, nullable, encoder, autoIncrement, references"
|
|
3666
|
+
);
|
|
3667
|
+
}
|
|
3661
3668
|
const prefix = databasePath2(this.database);
|
|
3662
3669
|
const encodedTable = encodeURIComponent(tableName);
|
|
3663
3670
|
const encodedColumn = encodeURIComponent(columnName);
|
|
3671
|
+
const requestBody = {
|
|
3672
|
+
database: this.database,
|
|
3673
|
+
...body
|
|
3674
|
+
};
|
|
3664
3675
|
return this.transport.patch(
|
|
3665
3676
|
`${prefix}/tables/${encodedTable}/columns/${encodedColumn}`,
|
|
3666
|
-
|
|
3677
|
+
requestBody
|
|
3678
|
+
);
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3681
|
+
* Renames a column (convenience wrapper over {@link alterColumn}).
|
|
3682
|
+
* @param tableName - Table name.
|
|
3683
|
+
* @param columnName - Current column name.
|
|
3684
|
+
* @param body - Request body with newName (database optional; injected when omitted).
|
|
3685
|
+
* @returns 200 response body (column detail).
|
|
3686
|
+
* @throws AoudaNotFoundError if table or column does not exist; AoudaApiError for WRITE_NOT_ALLOWED, etc.
|
|
3687
|
+
*/
|
|
3688
|
+
async renameColumn(tableName, columnName, body) {
|
|
3689
|
+
validateNonEmptyString(body.newName ?? "", "New column name");
|
|
3690
|
+
return this.alterColumn(tableName, columnName, { newName: body.newName });
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* Reorders columns in a table.
|
|
3694
|
+
* PUT /api/databases/{db}/tables/{t}/columns:order (204 No Content).
|
|
3695
|
+
* @param tableName - Table name.
|
|
3696
|
+
* @param columnsOrBody - Ordered column names, or a request body with `columns`.
|
|
3697
|
+
*/
|
|
3698
|
+
async reorderColumns(tableName, columnsOrBody) {
|
|
3699
|
+
validateNonEmptyString(tableName, "Table name");
|
|
3700
|
+
const columns = Array.isArray(columnsOrBody) ? columnsOrBody : columnsOrBody.columns;
|
|
3701
|
+
if (!columns?.length) {
|
|
3702
|
+
throw new Error("columns array is required and must be non-empty");
|
|
3703
|
+
}
|
|
3704
|
+
const prefix = databasePath2(this.database);
|
|
3705
|
+
const encodedTable = encodeURIComponent(tableName);
|
|
3706
|
+
const requestBody = {
|
|
3707
|
+
database: this.database,
|
|
3708
|
+
columns
|
|
3709
|
+
};
|
|
3710
|
+
await this.transport.put(
|
|
3711
|
+
`${prefix}/tables/${encodedTable}/columns:order`,
|
|
3712
|
+
requestBody
|
|
3667
3713
|
);
|
|
3668
3714
|
}
|
|
3669
3715
|
/**
|
|
@@ -3903,6 +3949,37 @@ var BranchesApi = class {
|
|
|
3903
3949
|
}
|
|
3904
3950
|
};
|
|
3905
3951
|
|
|
3952
|
+
// src/jobs.ts
|
|
3953
|
+
function validateNonEmptyString2(value, name) {
|
|
3954
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
3955
|
+
throw new Error(`${name} must be a non-empty string`);
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
var JobsApi = class {
|
|
3959
|
+
constructor(transport, database) {
|
|
3960
|
+
this.transport = transport;
|
|
3961
|
+
this.database = database;
|
|
3962
|
+
}
|
|
3963
|
+
get prefix() {
|
|
3964
|
+
return `${databasePath2(this.database)}/jobs`;
|
|
3965
|
+
}
|
|
3966
|
+
/**
|
|
3967
|
+
* Lists jobs whose params target this database.
|
|
3968
|
+
*/
|
|
3969
|
+
async list() {
|
|
3970
|
+
return this.transport.get(this.prefix);
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Gets a single job by id when it belongs to this database.
|
|
3974
|
+
* @param jobId - Job GUID string.
|
|
3975
|
+
*/
|
|
3976
|
+
async get(jobId) {
|
|
3977
|
+
validateNonEmptyString2(jobId, "Job id");
|
|
3978
|
+
const encoded = encodeURIComponent(jobId);
|
|
3979
|
+
return this.transport.get(`${this.prefix}/${encoded}`);
|
|
3980
|
+
}
|
|
3981
|
+
};
|
|
3982
|
+
|
|
3906
3983
|
// src/admin/server.ts
|
|
3907
3984
|
var ServerAdminApi = class {
|
|
3908
3985
|
constructor(transport) {
|
|
@@ -5211,7 +5288,7 @@ var DEFAULT_TIMEOUT_MS = 3e4;
|
|
|
5211
5288
|
function normalizeBaseUrl(url) {
|
|
5212
5289
|
return url.replace(/\/+$/, "");
|
|
5213
5290
|
}
|
|
5214
|
-
function
|
|
5291
|
+
function validateNonEmptyString3(value, name) {
|
|
5215
5292
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
5216
5293
|
throw new Error(`${name} must be a non-empty string`);
|
|
5217
5294
|
}
|
|
@@ -5226,8 +5303,8 @@ var AoudaClient = class {
|
|
|
5226
5303
|
constructor(options) {
|
|
5227
5304
|
this.connected = false;
|
|
5228
5305
|
this._wsTransport = null;
|
|
5229
|
-
|
|
5230
|
-
|
|
5306
|
+
validateNonEmptyString3(options.serverUrl, "serverUrl");
|
|
5307
|
+
validateNonEmptyString3(options.database, "database");
|
|
5231
5308
|
this.baseUrl = normalizeBaseUrl(options.serverUrl);
|
|
5232
5309
|
this.timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
5233
5310
|
this.database = options.database.trim();
|
|
@@ -5309,6 +5386,7 @@ var AoudaClient = class {
|
|
|
5309
5386
|
this._authHandler = null;
|
|
5310
5387
|
}
|
|
5311
5388
|
this._tables = new TablesApi(this.transport, this.database);
|
|
5389
|
+
this._jobs = new JobsApi(this.transport, this.database);
|
|
5312
5390
|
this._databases = new DatabasesApi(this.transport);
|
|
5313
5391
|
this._schema = new SchemaApi(this.transport, this.database);
|
|
5314
5392
|
this._branches = new BranchesApi(this.transport, this.database);
|
|
@@ -5402,7 +5480,7 @@ var AoudaClient = class {
|
|
|
5402
5480
|
* ```
|
|
5403
5481
|
*/
|
|
5404
5482
|
table(name) {
|
|
5405
|
-
|
|
5483
|
+
validateNonEmptyString3(name, "Table name");
|
|
5406
5484
|
return new TableQuery(
|
|
5407
5485
|
this.transport,
|
|
5408
5486
|
name,
|
|
@@ -5418,6 +5496,13 @@ var AoudaClient = class {
|
|
|
5418
5496
|
get tables() {
|
|
5419
5497
|
return this._tables;
|
|
5420
5498
|
}
|
|
5499
|
+
/**
|
|
5500
|
+
* Access pending/background jobs for the current database (e.g. ColumnRewrite).
|
|
5501
|
+
* @returns The jobs API.
|
|
5502
|
+
*/
|
|
5503
|
+
get jobs() {
|
|
5504
|
+
return this._jobs;
|
|
5505
|
+
}
|
|
5421
5506
|
/**
|
|
5422
5507
|
* Access server-level database operations (list, create, get, drop).
|
|
5423
5508
|
* @returns The databases API.
|
|
@@ -5514,7 +5599,7 @@ var AoudaClient = class {
|
|
|
5514
5599
|
* ```
|
|
5515
5600
|
*/
|
|
5516
5601
|
bulkLoad(tableName, rows, options) {
|
|
5517
|
-
|
|
5602
|
+
validateNonEmptyString3(tableName, "tableName");
|
|
5518
5603
|
return new BulkLoadCoordinator(this.transport, this.database).run(
|
|
5519
5604
|
[tableName],
|
|
5520
5605
|
rows,
|
|
@@ -5868,6 +5953,7 @@ var version = package_default.version;
|
|
|
5868
5953
|
DatabasesApi,
|
|
5869
5954
|
FILTER_OPERATORS,
|
|
5870
5955
|
HealthAdminApi,
|
|
5956
|
+
JobsApi,
|
|
5871
5957
|
MaterializedQueriesApi,
|
|
5872
5958
|
MaterializedQueryState,
|
|
5873
5959
|
MaterializedQueryType,
|