@aouda/client 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
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-TIOp5NUu.cjs';
2
- export { n as AGGREGATE_FUNCTIONS, o as AOUDA_DATA_TYPES, p as AddColumnRequest, q as AdminApi, r as AdminBackupConfig, s as AdminBackupPatch, t as AdminConfigPatchRequest, u as AdminConfigResponse, v as AdminConfigSchemaResponse, w as AdminLoggingConfig, x as AdminLoggingPatch, y as AdminMemoryConfig, z as AdminMemoryPatch, E as AggregateFunctionName, G as AlterColumnRequest, I as AoudaClientOptions, K as AoudaDataType, M as AppAuthOptions, O as AuthClient, Q as AuthResult, U as AuthUserInfo, V as AuthorizationMode, W as BackupAdminApi, X as BackupMetrics, Y as BackupSummary, Z as BatchMutationResult, _ as BatchOperationInput, $ as BloomFilterMetrics, a0 as BranchInfo, a1 as BranchesApi, a2 as BulkLoadForceAbortRequest, a3 as BulkLoadForceAbortResponse, a4 as BulkLoadListResponse, a5 as BulkLoadProgress, a6 as BulkLoadReplicaProgress, a7 as BulkLoadReplicaProgressDto, a8 as BulkLoadStatusResponse, a9 as CircuitBreakerPolicy, aa as ClusterAdminApi, ab as ClusterMemberEntry, ac as ClusterThisNodeEntry, ad as ColumnSchema, ae as ColumnSummaryForErd, af as ColumnarResponse, ag as ComponentHealthEntry, ah as ComputedColumnDef, ai as ConfigAdminApi, aj as CreateBranchRequest, ak as CreateColumnRequest, al as CreateDatabaseOptions, am as CreatePartitionGrantRequest, an as CreateRlsResolverRequest, ao as CreateTableRequest, ap as DatabaseCoverageEntry, aq as DatabaseInfo, ar as DatabaseMemoryMetrics, as as DatabaseMemoryUsage, at as DatabaseMetricsDto, au as DatabaseOptionsInfo, av as DatabasesApi, aw as DeleteOptions, ax as DiffSummary, ay as FILTER_OPERATORS, az as FilterOperator, aA as HealthAdminApi, aB as IndexInfo, aC as InsertOptions, aD as InsertResult, aE as IoMetrics, aF as JobsApi, aG as LatencyPercentiles, aH as MaterializedQueriesApi, aI as MaterializedQueryDefinition, aJ as MaterializedQueryExecuteOptions, aK as MaterializedQueryExecuteResult, aL as MaterializedQueryMetrics, aM as MaterializedQueryRefreshOptions, aN as MaterializedQueryState, aO as MaterializedQueryStateNumber, aP as MaterializedQueryStatus, aQ as MaterializedQueryType, aR as MaterializedQueryTypeNumber, aS as MemberInfo, aT as MemoryMetrics, aU as MergeBranchOptions, aV as MergeConflict, aW as MergeExecutionResult, aX as MergeResult, aY as MetricsAdminApi, aZ as MetricsHistory, a_ as MetricsHistoryOptions, a$ as MetricsSnapshot, b0 as MetricsSummary, b1 as MutationResult, b2 as NodeAdminApi, b3 as NodeLogEntry, b4 as NodeLogLevel, b5 as NodeLogStreamOptions, b6 as NodeLogsQuery, b7 as NodeLogsResponse, b8 as OpenWriteStreamOptions, b9 as PageCacheMetrics, ba as PartitionFunction, bb as PartitionGrant, bc as PartitionGrantsListResponse, bd as PartitioningMetrics, be as PendingJobListResponse, bf as PendingJobResponse, bg as PerDatabaseLagEntry, bh as PerDatabaseMetrics, bi as PerDatabaseStatusEntry, bj as QueryMetrics, bk as QueryResult, bl as QueryStats, bm as ReferenceInfo, bn as RelationshipEndpoint, bo as RelationshipInfo, bp as RenameColumnRequest, bq as RenameTableRequest, br as ReorderColumnsRequest, bs as ReplicationAdminApi, bt as ReplicationMetrics, bu as ResidencyConfig, bv as RetryPolicy, bw as RlsResolver, bx as RlsResolverRule, by as RlsResolverRuleInput, bz as RlsResolversListResponse, bA as SchemaChange, bB as SchemaChangeType, bC as SchemaDiffResult, bD as SchemaRelationshipsResponse, bE as SeedApplyResult, bF as SeedTableApplyResult, bG as ServerAdminApi, bH as ServerAuthOptions, bI as ServerMemoryResponse, bJ as ServerMetricsResponse, bK as ServiceInfo, bL as SimdMetrics, bM as SingleDatabaseMetricsResponse, bN as SortDirection, bO as StorageMetrics, bP as SubscribeOptions, bQ as Subscription, bR as SubscriptionChangeEvent, bS as SubscriptionEvent, bT as SubscriptionInfo, bU as SubscriptionSnapshotEvent, bV as TIME_BUCKET_FUNCTIONS, bW as TableCoverageEntry, bX as TableNameFromSchema, bY as TablePolicy, bZ as TableQuery, b_ as TableSchema, b$ as TableSchemaResponse, c0 as TableSummary, c1 as TableSummaryForErd, c2 as TablesApi, c3 as TimeBucketFunction, c4 as TimeSeriesMetrics, c5 as TransactionMetrics, c6 as TypeGenerationOptions, c7 as UpdateOptions, c8 as UpdateRlsResolverRequest, c9 as UpdateTableOptionsRequest, ca as UpdateTablePolicyRequest, cb as UserProfile, cc as WhereGroupBuilder, cd as WhereOperator, ce as WriteStream, cf as coerceColumnarValue, cg as createAoudaClient } from './client-TIOp5NUu.cjs';
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-Dgenr-cE.cjs';
2
+ export { n as AGGREGATE_FUNCTIONS, o as AOUDA_DATA_TYPES, p as AddColumnRequest, q as AdminApi, r as AdminBackupConfig, s as AdminBackupPatch, t as AdminConfigPatchRequest, u as AdminConfigResponse, v as AdminConfigSchemaResponse, w as AdminLoggingConfig, x as AdminLoggingPatch, y as AdminMemoryConfig, z as AdminMemoryPatch, E as AggregateFunctionName, G as AlterColumnRequest, I as AoudaClientOptions, K as AoudaDataType, M as AppAuthOptions, O as AuthClient, Q as AuthResult, U as AuthUserInfo, V as AuthorizationMode, W as BackupAdminApi, X as BackupMetrics, Y as BackupSummary, Z as BatchMutationResult, _ as BatchOperationInput, $ as BloomFilterMetrics, a0 as BranchInfo, a1 as BranchesApi, a2 as BulkLoadForceAbortRequest, a3 as BulkLoadForceAbortResponse, a4 as BulkLoadListResponse, a5 as BulkLoadProgress, a6 as BulkLoadReplicaProgress, a7 as BulkLoadReplicaProgressDto, a8 as BulkLoadStatusResponse, a9 as CircuitBreakerPolicy, aa as ClusterAdminApi, ab as ClusterMemberEntry, ac as ClusterThisNodeEntry, ad as ColumnSchema, ae as ColumnSummaryForErd, af as ColumnarResponse, ag as ComponentHealthEntry, ah as ComputedColumnDef, ai as ConfigAdminApi, aj as CreateBranchRequest, ak as CreateColumnRequest, al as CreateDatabaseOptions, am as CreatePartitionGrantRequest, an as CreateRlsResolverRequest, ao as CreateTableRequest, ap as DatabaseCoverageEntry, aq as DatabaseInfo, ar as DatabaseMemoryMetrics, as as DatabaseMemoryUsage, at as DatabaseMetricsDto, au as DatabaseOptionsInfo, av as DatabasesApi, aw as DeleteOptions, ax as DiffSummary, ay as FILTER_OPERATORS, az as FilterOperator, aA as HealthAdminApi, aB as IndexInfo, aC as InsertOptions, aD as InsertResult, aE as IoMetrics, aF as JobsApi, aG as LatencyPercentiles, aH as MaterializedQueriesApi, aI as MaterializedQueryDefinition, aJ as MaterializedQueryExecuteOptions, aK as MaterializedQueryExecuteResult, aL as MaterializedQueryMetrics, aM as MaterializedQueryRefreshOptions, aN as MaterializedQueryState, aO as MaterializedQueryStateNumber, aP as MaterializedQueryStatus, aQ as MaterializedQueryType, aR as MaterializedQueryTypeNumber, aS as MemberInfo, aT as MemoryMetrics, aU as MergeBranchOptions, aV as MergeConflict, aW as MergeExecutionResult, aX as MergeResult, aY as MetricsAdminApi, aZ as MetricsHistory, a_ as MetricsHistoryOptions, a$ as MetricsSnapshot, b0 as MetricsSummary, b1 as MutationResult, b2 as NamedArtifactWarning, b3 as NamedMutationResult, b4 as NamedMutationsApi, b5 as NamedQueriesApi, b6 as NamedQueryBatchItem, b7 as NamedQueryBatchSlotResult, b8 as NamedQueryExecuteOptions, b9 as NodeAdminApi, ba as NodeLogEntry, bb as NodeLogLevel, bc as NodeLogStreamOptions, bd as NodeLogsQuery, be as NodeLogsResponse, bf as OpenWriteStreamOptions, bg as PageCacheMetrics, bh as PartitionFunction, bi as PartitionGrant, bj as PartitionGrantsListResponse, bk as PartitioningMetrics, bl as PendingJobListResponse, bm as PendingJobResponse, bn as PerDatabaseLagEntry, bo as PerDatabaseMetrics, bp as PerDatabaseStatusEntry, bq as QueryMetrics, br as QueryResult, bs as QueryStats, bt as ReferenceInfo, bu as RelationshipEndpoint, bv as RelationshipInfo, bw as RenameColumnRequest, bx as RenameTableRequest, by as ReorderColumnsRequest, bz as ReplicationAdminApi, bA as ReplicationMetrics, bB as ResidencyConfig, bC as ResultWarning, bD as RetryPolicy, bE as RlsResolver, bF as RlsResolverRule, bG as RlsResolverRuleInput, bH as RlsResolversListResponse, bI as SchemaChange, bJ as SchemaChangeType, bK as SchemaDiffResult, bL as SchemaRelationshipsResponse, bM as SeedApplyResult, bN as SeedTableApplyResult, bO as ServerAdminApi, bP as ServerAuthOptions, bQ as ServerMemoryResponse, bR as ServerMetricsResponse, bS as ServiceInfo, bT as SimdMetrics, bU as SingleDatabaseMetricsResponse, bV as SortDirection, bW as StorageMetrics, bX as SubscribeOptions, bY as Subscription, bZ as SubscriptionChangeEvent, b_ as SubscriptionEvent, b$ as SubscriptionInfo, c0 as SubscriptionSnapshotEvent, c1 as TIME_BUCKET_FUNCTIONS, c2 as TableCoverageEntry, c3 as TableNameFromSchema, c4 as TablePolicy, c5 as TableQuery, c6 as TableSchema, c7 as TableSchemaResponse, c8 as TableSummary, c9 as TableSummaryForErd, ca as TablesApi, cb as TimeBucketFunction, cc as TimeSeriesMetrics, cd as TransactionMetrics, ce as TypeGenerationOptions, cf as UpdateOptions, cg as UpdateRlsResolverRequest, ch as UpdateTableOptionsRequest, ci as UpdateTablePolicyRequest, cj as UserProfile, ck as WalMetrics, cl as WhereGroupBuilder, cm as WhereOperator, cn as WriteStream, co as coerceColumnarValue, cp as columnarToRows, cq as createAoudaClient } from './client-Dgenr-cE.cjs';
3
3
 
4
4
  /**
5
5
  * @aouda/client error types.
@@ -42,7 +42,8 @@ declare class AoudaApiError extends AoudaError {
42
42
  readonly statusCode: number;
43
43
  readonly details?: string | undefined;
44
44
  readonly requestId?: string | undefined;
45
- constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined);
45
+ readonly retryAfterSeconds?: number | undefined;
46
+ constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined, retryAfterSeconds?: number | undefined);
46
47
  }
47
48
  /**
48
49
  * Thrown for TABLE_NOT_FOUND, COLUMN_NOT_FOUND (404).
@@ -66,7 +67,7 @@ declare class AoudaValidationError extends AoudaApiError {
66
67
  * Thrown for INTERNAL_ERROR, SERVICE_UNAVAILABLE, etc. (5xx).
67
68
  */
68
69
  declare class AoudaServerError extends AoudaApiError {
69
- constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
70
+ constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string, retryAfterSeconds?: number);
70
71
  }
71
72
  /**
72
73
  * Thrown for 401 authentication errors (AUTH_TOKEN_EXPIRED, AUTH_TOKEN_INVALID, etc.).
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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-TIOp5NUu.js';
2
- export { n as AGGREGATE_FUNCTIONS, o as AOUDA_DATA_TYPES, p as AddColumnRequest, q as AdminApi, r as AdminBackupConfig, s as AdminBackupPatch, t as AdminConfigPatchRequest, u as AdminConfigResponse, v as AdminConfigSchemaResponse, w as AdminLoggingConfig, x as AdminLoggingPatch, y as AdminMemoryConfig, z as AdminMemoryPatch, E as AggregateFunctionName, G as AlterColumnRequest, I as AoudaClientOptions, K as AoudaDataType, M as AppAuthOptions, O as AuthClient, Q as AuthResult, U as AuthUserInfo, V as AuthorizationMode, W as BackupAdminApi, X as BackupMetrics, Y as BackupSummary, Z as BatchMutationResult, _ as BatchOperationInput, $ as BloomFilterMetrics, a0 as BranchInfo, a1 as BranchesApi, a2 as BulkLoadForceAbortRequest, a3 as BulkLoadForceAbortResponse, a4 as BulkLoadListResponse, a5 as BulkLoadProgress, a6 as BulkLoadReplicaProgress, a7 as BulkLoadReplicaProgressDto, a8 as BulkLoadStatusResponse, a9 as CircuitBreakerPolicy, aa as ClusterAdminApi, ab as ClusterMemberEntry, ac as ClusterThisNodeEntry, ad as ColumnSchema, ae as ColumnSummaryForErd, af as ColumnarResponse, ag as ComponentHealthEntry, ah as ComputedColumnDef, ai as ConfigAdminApi, aj as CreateBranchRequest, ak as CreateColumnRequest, al as CreateDatabaseOptions, am as CreatePartitionGrantRequest, an as CreateRlsResolverRequest, ao as CreateTableRequest, ap as DatabaseCoverageEntry, aq as DatabaseInfo, ar as DatabaseMemoryMetrics, as as DatabaseMemoryUsage, at as DatabaseMetricsDto, au as DatabaseOptionsInfo, av as DatabasesApi, aw as DeleteOptions, ax as DiffSummary, ay as FILTER_OPERATORS, az as FilterOperator, aA as HealthAdminApi, aB as IndexInfo, aC as InsertOptions, aD as InsertResult, aE as IoMetrics, aF as JobsApi, aG as LatencyPercentiles, aH as MaterializedQueriesApi, aI as MaterializedQueryDefinition, aJ as MaterializedQueryExecuteOptions, aK as MaterializedQueryExecuteResult, aL as MaterializedQueryMetrics, aM as MaterializedQueryRefreshOptions, aN as MaterializedQueryState, aO as MaterializedQueryStateNumber, aP as MaterializedQueryStatus, aQ as MaterializedQueryType, aR as MaterializedQueryTypeNumber, aS as MemberInfo, aT as MemoryMetrics, aU as MergeBranchOptions, aV as MergeConflict, aW as MergeExecutionResult, aX as MergeResult, aY as MetricsAdminApi, aZ as MetricsHistory, a_ as MetricsHistoryOptions, a$ as MetricsSnapshot, b0 as MetricsSummary, b1 as MutationResult, b2 as NodeAdminApi, b3 as NodeLogEntry, b4 as NodeLogLevel, b5 as NodeLogStreamOptions, b6 as NodeLogsQuery, b7 as NodeLogsResponse, b8 as OpenWriteStreamOptions, b9 as PageCacheMetrics, ba as PartitionFunction, bb as PartitionGrant, bc as PartitionGrantsListResponse, bd as PartitioningMetrics, be as PendingJobListResponse, bf as PendingJobResponse, bg as PerDatabaseLagEntry, bh as PerDatabaseMetrics, bi as PerDatabaseStatusEntry, bj as QueryMetrics, bk as QueryResult, bl as QueryStats, bm as ReferenceInfo, bn as RelationshipEndpoint, bo as RelationshipInfo, bp as RenameColumnRequest, bq as RenameTableRequest, br as ReorderColumnsRequest, bs as ReplicationAdminApi, bt as ReplicationMetrics, bu as ResidencyConfig, bv as RetryPolicy, bw as RlsResolver, bx as RlsResolverRule, by as RlsResolverRuleInput, bz as RlsResolversListResponse, bA as SchemaChange, bB as SchemaChangeType, bC as SchemaDiffResult, bD as SchemaRelationshipsResponse, bE as SeedApplyResult, bF as SeedTableApplyResult, bG as ServerAdminApi, bH as ServerAuthOptions, bI as ServerMemoryResponse, bJ as ServerMetricsResponse, bK as ServiceInfo, bL as SimdMetrics, bM as SingleDatabaseMetricsResponse, bN as SortDirection, bO as StorageMetrics, bP as SubscribeOptions, bQ as Subscription, bR as SubscriptionChangeEvent, bS as SubscriptionEvent, bT as SubscriptionInfo, bU as SubscriptionSnapshotEvent, bV as TIME_BUCKET_FUNCTIONS, bW as TableCoverageEntry, bX as TableNameFromSchema, bY as TablePolicy, bZ as TableQuery, b_ as TableSchema, b$ as TableSchemaResponse, c0 as TableSummary, c1 as TableSummaryForErd, c2 as TablesApi, c3 as TimeBucketFunction, c4 as TimeSeriesMetrics, c5 as TransactionMetrics, c6 as TypeGenerationOptions, c7 as UpdateOptions, c8 as UpdateRlsResolverRequest, c9 as UpdateTableOptionsRequest, ca as UpdateTablePolicyRequest, cb as UserProfile, cc as WhereGroupBuilder, cd as WhereOperator, ce as WriteStream, cf as coerceColumnarValue, cg as createAoudaClient } from './client-TIOp5NUu.js';
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-Dgenr-cE.js';
2
+ export { n as AGGREGATE_FUNCTIONS, o as AOUDA_DATA_TYPES, p as AddColumnRequest, q as AdminApi, r as AdminBackupConfig, s as AdminBackupPatch, t as AdminConfigPatchRequest, u as AdminConfigResponse, v as AdminConfigSchemaResponse, w as AdminLoggingConfig, x as AdminLoggingPatch, y as AdminMemoryConfig, z as AdminMemoryPatch, E as AggregateFunctionName, G as AlterColumnRequest, I as AoudaClientOptions, K as AoudaDataType, M as AppAuthOptions, O as AuthClient, Q as AuthResult, U as AuthUserInfo, V as AuthorizationMode, W as BackupAdminApi, X as BackupMetrics, Y as BackupSummary, Z as BatchMutationResult, _ as BatchOperationInput, $ as BloomFilterMetrics, a0 as BranchInfo, a1 as BranchesApi, a2 as BulkLoadForceAbortRequest, a3 as BulkLoadForceAbortResponse, a4 as BulkLoadListResponse, a5 as BulkLoadProgress, a6 as BulkLoadReplicaProgress, a7 as BulkLoadReplicaProgressDto, a8 as BulkLoadStatusResponse, a9 as CircuitBreakerPolicy, aa as ClusterAdminApi, ab as ClusterMemberEntry, ac as ClusterThisNodeEntry, ad as ColumnSchema, ae as ColumnSummaryForErd, af as ColumnarResponse, ag as ComponentHealthEntry, ah as ComputedColumnDef, ai as ConfigAdminApi, aj as CreateBranchRequest, ak as CreateColumnRequest, al as CreateDatabaseOptions, am as CreatePartitionGrantRequest, an as CreateRlsResolverRequest, ao as CreateTableRequest, ap as DatabaseCoverageEntry, aq as DatabaseInfo, ar as DatabaseMemoryMetrics, as as DatabaseMemoryUsage, at as DatabaseMetricsDto, au as DatabaseOptionsInfo, av as DatabasesApi, aw as DeleteOptions, ax as DiffSummary, ay as FILTER_OPERATORS, az as FilterOperator, aA as HealthAdminApi, aB as IndexInfo, aC as InsertOptions, aD as InsertResult, aE as IoMetrics, aF as JobsApi, aG as LatencyPercentiles, aH as MaterializedQueriesApi, aI as MaterializedQueryDefinition, aJ as MaterializedQueryExecuteOptions, aK as MaterializedQueryExecuteResult, aL as MaterializedQueryMetrics, aM as MaterializedQueryRefreshOptions, aN as MaterializedQueryState, aO as MaterializedQueryStateNumber, aP as MaterializedQueryStatus, aQ as MaterializedQueryType, aR as MaterializedQueryTypeNumber, aS as MemberInfo, aT as MemoryMetrics, aU as MergeBranchOptions, aV as MergeConflict, aW as MergeExecutionResult, aX as MergeResult, aY as MetricsAdminApi, aZ as MetricsHistory, a_ as MetricsHistoryOptions, a$ as MetricsSnapshot, b0 as MetricsSummary, b1 as MutationResult, b2 as NamedArtifactWarning, b3 as NamedMutationResult, b4 as NamedMutationsApi, b5 as NamedQueriesApi, b6 as NamedQueryBatchItem, b7 as NamedQueryBatchSlotResult, b8 as NamedQueryExecuteOptions, b9 as NodeAdminApi, ba as NodeLogEntry, bb as NodeLogLevel, bc as NodeLogStreamOptions, bd as NodeLogsQuery, be as NodeLogsResponse, bf as OpenWriteStreamOptions, bg as PageCacheMetrics, bh as PartitionFunction, bi as PartitionGrant, bj as PartitionGrantsListResponse, bk as PartitioningMetrics, bl as PendingJobListResponse, bm as PendingJobResponse, bn as PerDatabaseLagEntry, bo as PerDatabaseMetrics, bp as PerDatabaseStatusEntry, bq as QueryMetrics, br as QueryResult, bs as QueryStats, bt as ReferenceInfo, bu as RelationshipEndpoint, bv as RelationshipInfo, bw as RenameColumnRequest, bx as RenameTableRequest, by as ReorderColumnsRequest, bz as ReplicationAdminApi, bA as ReplicationMetrics, bB as ResidencyConfig, bC as ResultWarning, bD as RetryPolicy, bE as RlsResolver, bF as RlsResolverRule, bG as RlsResolverRuleInput, bH as RlsResolversListResponse, bI as SchemaChange, bJ as SchemaChangeType, bK as SchemaDiffResult, bL as SchemaRelationshipsResponse, bM as SeedApplyResult, bN as SeedTableApplyResult, bO as ServerAdminApi, bP as ServerAuthOptions, bQ as ServerMemoryResponse, bR as ServerMetricsResponse, bS as ServiceInfo, bT as SimdMetrics, bU as SingleDatabaseMetricsResponse, bV as SortDirection, bW as StorageMetrics, bX as SubscribeOptions, bY as Subscription, bZ as SubscriptionChangeEvent, b_ as SubscriptionEvent, b$ as SubscriptionInfo, c0 as SubscriptionSnapshotEvent, c1 as TIME_BUCKET_FUNCTIONS, c2 as TableCoverageEntry, c3 as TableNameFromSchema, c4 as TablePolicy, c5 as TableQuery, c6 as TableSchema, c7 as TableSchemaResponse, c8 as TableSummary, c9 as TableSummaryForErd, ca as TablesApi, cb as TimeBucketFunction, cc as TimeSeriesMetrics, cd as TransactionMetrics, ce as TypeGenerationOptions, cf as UpdateOptions, cg as UpdateRlsResolverRequest, ch as UpdateTableOptionsRequest, ci as UpdateTablePolicyRequest, cj as UserProfile, ck as WalMetrics, cl as WhereGroupBuilder, cm as WhereOperator, cn as WriteStream, co as coerceColumnarValue, cp as columnarToRows, cq as createAoudaClient } from './client-Dgenr-cE.js';
3
3
 
4
4
  /**
5
5
  * @aouda/client error types.
@@ -42,7 +42,8 @@ declare class AoudaApiError extends AoudaError {
42
42
  readonly statusCode: number;
43
43
  readonly details?: string | undefined;
44
44
  readonly requestId?: string | undefined;
45
- constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined);
45
+ readonly retryAfterSeconds?: number | undefined;
46
+ constructor(message: string, code: string, statusCode: number, details?: string | undefined, requestId?: string | undefined, retryAfterSeconds?: number | undefined);
46
47
  }
47
48
  /**
48
49
  * Thrown for TABLE_NOT_FOUND, COLUMN_NOT_FOUND (404).
@@ -66,7 +67,7 @@ declare class AoudaValidationError extends AoudaApiError {
66
67
  * Thrown for INTERNAL_ERROR, SERVICE_UNAVAILABLE, etc. (5xx).
67
68
  */
68
69
  declare class AoudaServerError extends AoudaApiError {
69
- constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string);
70
+ constructor(message: string, code: string, statusCode: number, details?: string, requestId?: string, retryAfterSeconds?: number);
70
71
  }
71
72
  /**
72
73
  * Thrown for 401 authentication errors (AUTH_TOKEN_EXPIRED, AUTH_TOKEN_INVALID, etc.).
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@aouda/client",
4
- version: "0.1.8",
4
+ version: "0.1.10",
5
5
  description: "Official TypeScript/JavaScript client library for Aouda",
6
6
  type: "module",
7
7
  main: "./dist/index.cjs",
@@ -133,12 +133,13 @@ var AoudaResponseError = class extends AoudaError {
133
133
  }
134
134
  };
135
135
  var AoudaApiError = class extends AoudaError {
136
- constructor(message, code, statusCode, details, requestId) {
136
+ constructor(message, code, statusCode, details, requestId, retryAfterSeconds) {
137
137
  super(message);
138
138
  this.code = code;
139
139
  this.statusCode = statusCode;
140
140
  this.details = details;
141
141
  this.requestId = requestId;
142
+ this.retryAfterSeconds = retryAfterSeconds;
142
143
  this.name = "AoudaApiError";
143
144
  }
144
145
  };
@@ -161,8 +162,8 @@ var AoudaValidationError = class extends AoudaApiError {
161
162
  }
162
163
  };
163
164
  var AoudaServerError = class extends AoudaApiError {
164
- constructor(message, code, statusCode, details, requestId) {
165
- super(message, code, statusCode, details, requestId);
165
+ constructor(message, code, statusCode, details, requestId, retryAfterSeconds) {
166
+ super(message, code, statusCode, details, requestId, retryAfterSeconds);
166
167
  this.name = "AoudaServerError";
167
168
  }
168
169
  };
@@ -1117,12 +1118,22 @@ var ERROR_CODE_MAP = {
1117
1118
  SERVICE_UNAVAILABLE: AoudaServerError,
1118
1119
  TIMEOUT: AoudaServerError,
1119
1120
  OVERLOADED: AoudaServerError,
1121
+ MEMORY_BUDGET_EXCEEDED: AoudaServerError,
1122
+ WAL_CAPACITY_EXCEEDED: AoudaServerError,
1120
1123
  AUTH_TOKEN_MISSING: AoudaAuthenticationError,
1121
1124
  AUTH_TOKEN_EXPIRED: AoudaAuthenticationError,
1122
1125
  AUTH_TOKEN_INVALID: AoudaAuthenticationError,
1123
1126
  AUTH_TOKEN_REVOKED: AoudaAuthenticationError,
1124
1127
  AUTH_API_KEY_INVALID: AoudaAuthenticationError,
1125
- AUTH_REQUIRED: AoudaAuthenticationError
1128
+ AUTH_REQUIRED: AoudaAuthenticationError,
1129
+ NAMED_QUERY_NOT_FOUND: AoudaNotFoundError,
1130
+ NAMED_MUTATION_NOT_FOUND: AoudaNotFoundError,
1131
+ NAMED_QUERY_BATCH_EMPTY: AoudaValidationError,
1132
+ NAMED_QUERY_BATCH_TOO_LARGE: AoudaValidationError,
1133
+ NAMED_QUERY_BATCH_MUTATION: AoudaValidationError,
1134
+ NAMED_QUERY_BIND_FAILED: AoudaValidationError,
1135
+ NAMED_QUERY_PARAM_REQUIRED: AoudaValidationError,
1136
+ NAMED_MUTATION_BIND_FAILED: AoudaValidationError
1126
1137
  };
1127
1138
  function createComposedAbortController(...signals) {
1128
1139
  const controller = new AbortController();
@@ -1144,13 +1155,22 @@ function createComposedAbortController(...signals) {
1144
1155
  }
1145
1156
  return controller;
1146
1157
  }
1147
- function createApiError(statusCode, statusText, body) {
1158
+ function parseRetryAfterSeconds(header) {
1159
+ if (header == null || header.trim() === "") return void 0;
1160
+ const trimmed = header.trim();
1161
+ if (!/^\d+$/.test(trimmed)) return void 0;
1162
+ const n = Number.parseInt(trimmed, 10);
1163
+ if (!Number.isFinite(n) || n < 0) return void 0;
1164
+ return n;
1165
+ }
1166
+ function createApiError(statusCode, statusText, body, retryAfterHeader) {
1148
1167
  const message = body.error ?? `${statusCode} ${statusText}`;
1149
1168
  const code = body.code ?? "UNKNOWN";
1150
1169
  const details = body.details;
1151
1170
  const requestId = body.requestId;
1171
+ const retryAfterSeconds = parseRetryAfterSeconds(retryAfterHeader ?? null);
1152
1172
  const Ctor = ERROR_CODE_MAP[code] ?? AoudaApiError;
1153
- return new Ctor(message, code, statusCode, details, requestId);
1173
+ return new Ctor(message, code, statusCode, details, requestId, retryAfterSeconds);
1154
1174
  }
1155
1175
  var HttpTransport = class {
1156
1176
  constructor(options) {
@@ -1243,7 +1263,8 @@ var HttpTransport = class {
1243
1263
  throw createApiError(
1244
1264
  response.status,
1245
1265
  response.statusText,
1246
- errorBody
1266
+ errorBody,
1267
+ response.headers.get("Retry-After")
1247
1268
  );
1248
1269
  }
1249
1270
  throw new AoudaResponseError(
@@ -1353,7 +1374,8 @@ var HttpTransport = class {
1353
1374
  throw createApiError(
1354
1375
  response.status,
1355
1376
  response.statusText,
1356
- errorBody
1377
+ errorBody,
1378
+ response.headers.get("Retry-After")
1357
1379
  );
1358
1380
  }
1359
1381
  throw new AoudaResponseError(
@@ -1699,6 +1721,17 @@ var CIRCUIT_BREAKER_POLICY_DISABLED = {
1699
1721
 
1700
1722
  // src/resilience/resilient-transport.ts
1701
1723
  var REQUEST_ID_HEADER3 = "X-Request-Id";
1724
+ function isCapacityBackPressure(error) {
1725
+ return error instanceof AoudaApiError && (error.code === "MEMORY_BUDGET_EXCEEDED" || error.code === "WAL_CAPACITY_EXCEEDED");
1726
+ }
1727
+ function retryDelayMs(retryPolicy, attempt, error) {
1728
+ const backoff = calculateDelay(retryPolicy, attempt);
1729
+ if (!isCapacityBackPressure(error) || !(error instanceof AoudaApiError)) {
1730
+ return backoff;
1731
+ }
1732
+ const headerMs = error.retryAfterSeconds != null ? error.retryAfterSeconds * 1e3 : 0;
1733
+ return Math.max(backoff, headerMs);
1734
+ }
1702
1735
  function delayMs(ms, signal) {
1703
1736
  if (ms <= 0) return Promise.resolve();
1704
1737
  return new Promise((resolve, reject) => {
@@ -1753,7 +1786,7 @@ var ResilientTransport = class {
1753
1786
  } catch (error) {
1754
1787
  lastError = error;
1755
1788
  const retryable = isRetryable(error);
1756
- if (retryable) {
1789
+ if (retryable && !isCapacityBackPressure(error)) {
1757
1790
  this.circuitBreaker.recordFailure(error);
1758
1791
  }
1759
1792
  if (!retryable) {
@@ -1763,7 +1796,7 @@ var ResilientTransport = class {
1763
1796
  if (attempt > this.retryPolicy.maxRetries) {
1764
1797
  throw error;
1765
1798
  }
1766
- const delay = calculateDelay(this.retryPolicy, attempt);
1799
+ const delay = retryDelayMs(this.retryPolicy, attempt, error);
1767
1800
  try {
1768
1801
  await delayMs(delay, config.signal);
1769
1802
  } catch {
@@ -1799,7 +1832,7 @@ var ResilientTransport = class {
1799
1832
  } catch (error) {
1800
1833
  lastError = error;
1801
1834
  const retryable = isRetryable(error);
1802
- if (retryable) {
1835
+ if (retryable && !isCapacityBackPressure(error)) {
1803
1836
  this.circuitBreaker.recordFailure(error);
1804
1837
  }
1805
1838
  if (!retryable) {
@@ -1809,7 +1842,7 @@ var ResilientTransport = class {
1809
1842
  if (attempt > this.retryPolicy.maxRetries) {
1810
1843
  throw error;
1811
1844
  }
1812
- const delay = calculateDelay(this.retryPolicy, attempt);
1845
+ const delay = retryDelayMs(this.retryPolicy, attempt, error);
1813
1846
  try {
1814
1847
  await delayMs(delay, config.signal);
1815
1848
  } catch {
@@ -1993,6 +2026,7 @@ var TableSubscription = class {
1993
2026
  this._started = false;
1994
2027
  this._startPromise = null;
1995
2028
  this._lastVersion = 0;
2029
+ this._pendingSnapshotRows = [];
1996
2030
  this.id = createStreamingId("sub");
1997
2031
  this._transport = transport;
1998
2032
  this._tableName = tableName;
@@ -2049,6 +2083,7 @@ var TableSubscription = class {
2049
2083
  return;
2050
2084
  }
2051
2085
  try {
2086
+ this._pendingSnapshotRows = [];
2052
2087
  const resumeFrom = this._lastVersion > 0 ? this._lastVersion : void 0;
2053
2088
  await this._sendSubscribe(resumeFrom);
2054
2089
  } catch (error) {
@@ -2077,7 +2112,13 @@ var TableSubscription = class {
2077
2112
  }
2078
2113
  switch (message.type) {
2079
2114
  case "snapshot":
2080
- this._handleSnapshot(message);
2115
+ this._handleSnapshotPage(message);
2116
+ return;
2117
+ case "snapshot_complete":
2118
+ this._handleSnapshotComplete(message);
2119
+ return;
2120
+ case "gap":
2121
+ void this._handleGap(message);
2081
2122
  return;
2082
2123
  case "change":
2083
2124
  this._handleChange(message);
@@ -2089,9 +2130,13 @@ var TableSubscription = class {
2089
2130
  return;
2090
2131
  }
2091
2132
  }
2092
- _handleSnapshot(message) {
2133
+ _handleSnapshotPage(message) {
2134
+ this._pendingSnapshotRows.push(...message.rows);
2135
+ }
2136
+ _handleSnapshotComplete(message) {
2093
2137
  this._lastVersion = message.version;
2094
- const rows = message.rows;
2138
+ const rows = this._pendingSnapshotRows;
2139
+ this._pendingSnapshotRows = [];
2095
2140
  this._onSnapshot?.(rows, message.version);
2096
2141
  this._queue.push({
2097
2142
  type: "snapshot",
@@ -2099,6 +2144,16 @@ var TableSubscription = class {
2099
2144
  version: message.version
2100
2145
  });
2101
2146
  }
2147
+ async _handleGap(message) {
2148
+ this._pendingSnapshotRows = [];
2149
+ this._lastVersion = message.last_seq;
2150
+ try {
2151
+ await this._sendSubscribe(message.last_seq);
2152
+ } catch (error) {
2153
+ const wrapped = error instanceof Error ? error : new AoudaConnectionError("Subscription gap resume failed");
2154
+ this._notifyError(wrapped);
2155
+ }
2156
+ }
2102
2157
  _handleChange(message) {
2103
2158
  this._lastVersion = message.version;
2104
2159
  const event = {
@@ -2113,6 +2168,7 @@ var TableSubscription = class {
2113
2168
  this._queue.push(event);
2114
2169
  }
2115
2170
  _handleServerError(message) {
2171
+ this._pendingSnapshotRows = [];
2116
2172
  const error = new AoudaConnectionError(
2117
2173
  `Subscription error (${message.code}): ${message.message}`
2118
2174
  );
@@ -4551,6 +4607,147 @@ var MaterializedQueriesApi = class {
4551
4607
  }
4552
4608
  };
4553
4609
 
4610
+ // src/named-queries.ts
4611
+ var MAX_NAMED_QUERY_BATCH_SIZE = 32;
4612
+ function raiseDeprecationWarnings(sink, warnings) {
4613
+ if (warnings == null) return;
4614
+ for (const warning of warnings) {
4615
+ if (warning.code !== "NAMED_QUERY_DEPRECATED" && warning.code !== "NAMED_MUTATION_DEPRECATED") {
4616
+ continue;
4617
+ }
4618
+ const sunset = warning.sunsetAt != null ? ` sunsetAt=${warning.sunsetAt}` : "";
4619
+ const hash = warning.hash != null && warning.hash.length > 0 ? ` hash=${warning.hash}` : "";
4620
+ sink({
4621
+ code: warning.code,
4622
+ hash: warning.hash,
4623
+ sunsetAt: warning.sunsetAt,
4624
+ message: `${warning.code}:${hash}${sunset}`.trim()
4625
+ });
4626
+ }
4627
+ }
4628
+ function emptyStats() {
4629
+ return {
4630
+ rowsScanned: 0,
4631
+ rowsReturned: 0,
4632
+ segmentsAccessed: 0,
4633
+ executionMs: 0
4634
+ };
4635
+ }
4636
+ var NamedQueriesApi = class {
4637
+ constructor(transport, database, onWarning) {
4638
+ this.transport = transport;
4639
+ this.database = database;
4640
+ this.onWarning = onWarning;
4641
+ }
4642
+ async execute(hash, args, options) {
4643
+ if (typeof hash !== "string" || hash.trim().length === 0) {
4644
+ throw new Error("Named query hash must be a non-empty string");
4645
+ }
4646
+ const prefix = databasePath2(this.database);
4647
+ const path = `${prefix}/named-queries/${encodeURIComponent(hash)}/query?format=columnar`;
4648
+ const response = await this.transport.post(
4649
+ path,
4650
+ { args: args ?? {} },
4651
+ { signal: options?.signal }
4652
+ );
4653
+ const rows = columnarToRows(response);
4654
+ raiseDeprecationWarnings(this.onWarning, response.warnings);
4655
+ return {
4656
+ rows,
4657
+ stats: response.stats,
4658
+ warnings: response.warnings
4659
+ };
4660
+ }
4661
+ async batch(items, options) {
4662
+ if (items.length === 0) {
4663
+ throw new AoudaValidationError(
4664
+ "Named query batch requires a non-empty queries array.",
4665
+ "NAMED_QUERY_BATCH_EMPTY",
4666
+ 400
4667
+ );
4668
+ }
4669
+ if (items.length > MAX_NAMED_QUERY_BATCH_SIZE) {
4670
+ throw new AoudaValidationError(
4671
+ `Named query batch exceeds ${MAX_NAMED_QUERY_BATCH_SIZE} elements.`,
4672
+ "NAMED_QUERY_BATCH_TOO_LARGE",
4673
+ 400
4674
+ );
4675
+ }
4676
+ const prefix = databasePath2(this.database);
4677
+ const path = `${prefix}/named-queries/batch?format=columnar`;
4678
+ const envelope = await this.transport.post(
4679
+ path,
4680
+ { queries: items },
4681
+ { signal: options?.signal }
4682
+ );
4683
+ return (envelope.results ?? []).map((slot) => {
4684
+ if (slot.code != null && slot.code.length > 0) {
4685
+ return {
4686
+ isError: true,
4687
+ code: slot.code,
4688
+ error: slot.error
4689
+ };
4690
+ }
4691
+ const columnar = {
4692
+ columns: slot.columns ?? [],
4693
+ types: slot.types ?? [],
4694
+ data: slot.data ?? [],
4695
+ rowCount: slot.rowCount ?? 0,
4696
+ stats: slot.stats ?? emptyStats(),
4697
+ warnings: slot.warnings
4698
+ };
4699
+ const result = {
4700
+ rows: columnarToRows(columnar),
4701
+ stats: columnar.stats,
4702
+ warnings: slot.warnings
4703
+ };
4704
+ raiseDeprecationWarnings(this.onWarning, slot.warnings);
4705
+ return { isError: false, result };
4706
+ });
4707
+ }
4708
+ };
4709
+ var NamedMutationsApi = class {
4710
+ constructor(transport, database, onWarning) {
4711
+ this.transport = transport;
4712
+ this.database = database;
4713
+ this.onWarning = onWarning;
4714
+ }
4715
+ async execute(hash, args) {
4716
+ if (typeof hash !== "string" || hash.trim().length === 0) {
4717
+ throw new Error("Named mutation hash must be a non-empty string");
4718
+ }
4719
+ const prefix = databasePath2(this.database);
4720
+ const path = `${prefix}/named-mutations/${encodeURIComponent(hash)}/execute`;
4721
+ const wire = await this.transport.post(path, {
4722
+ args: args ?? {}
4723
+ });
4724
+ let op = "unknown";
4725
+ let rowsAffected = 0;
4726
+ if (wire.rowsInserted != null) {
4727
+ op = "insert";
4728
+ rowsAffected = wire.rowsInserted;
4729
+ } else if (wire.rowsUpdated != null) {
4730
+ op = "update";
4731
+ rowsAffected = wire.rowsUpdated;
4732
+ } else if (wire.rowsDeleted != null) {
4733
+ op = "delete";
4734
+ rowsAffected = wire.rowsDeleted;
4735
+ }
4736
+ raiseDeprecationWarnings(this.onWarning, wire.warnings);
4737
+ const returning = wire.rows == null ? void 0 : {
4738
+ rows: columnarToRows(wire.rows),
4739
+ stats: wire.rows.stats,
4740
+ warnings: wire.rows.warnings
4741
+ };
4742
+ return {
4743
+ op,
4744
+ rowsAffected,
4745
+ returning,
4746
+ warnings: wire.warnings
4747
+ };
4748
+ }
4749
+ };
4750
+
4554
4751
  // src/streaming/websocket-transport.ts
4555
4752
  import { decode as decodeMessagePack, encode as encodeMessagePack } from "@msgpack/msgpack";
4556
4753
  var DEFAULT_PING_INTERVAL_MS = 2e4;
@@ -5313,6 +5510,19 @@ var AoudaClient = class {
5313
5510
  this.transport,
5314
5511
  this.database
5315
5512
  );
5513
+ const onNamedArtifactWarning = options.onNamedArtifactWarning ?? ((warning) => {
5514
+ console.warn(warning.message);
5515
+ });
5516
+ this._namedQueries = new NamedQueriesApi(
5517
+ this.transport,
5518
+ this.database,
5519
+ onNamedArtifactWarning
5520
+ );
5521
+ this._namedMutations = new NamedMutationsApi(
5522
+ this.transport,
5523
+ this.database,
5524
+ onNamedArtifactWarning
5525
+ );
5316
5526
  }
5317
5527
  /**
5318
5528
  * Connects to the Aouda server.
@@ -5455,6 +5665,18 @@ var AoudaClient = class {
5455
5665
  get materializedQueries() {
5456
5666
  return this._materializedQueries;
5457
5667
  }
5668
+ /**
5669
+ * Hash-only named-query execute and batch. Names are codegen aliases (D-5).
5670
+ */
5671
+ get namedQueries() {
5672
+ return this._namedQueries;
5673
+ }
5674
+ /**
5675
+ * Hash-only named-mutation execute. No batch.
5676
+ */
5677
+ get namedMutations() {
5678
+ return this._namedMutations;
5679
+ }
5458
5680
  /**
5459
5681
  * Access auth operations (signUp, signIn, signOut, refresh, me, changePassword).
5460
5682
  * @returns The auth API.
@@ -5875,6 +6097,8 @@ export {
5875
6097
  MaterializedQueryState,
5876
6098
  MaterializedQueryType,
5877
6099
  MetricsAdminApi,
6100
+ NamedMutationsApi,
6101
+ NamedQueriesApi,
5878
6102
  NodeAdminApi,
5879
6103
  ReplicationAdminApi,
5880
6104
  RetryPolicy,
@@ -5885,6 +6109,7 @@ export {
5885
6109
  WhereGroupBuilder,
5886
6110
  applyLocalNetworkAccess,
5887
6111
  coerceColumnarValue,
6112
+ columnarToRows,
5888
6113
  createAoudaClient,
5889
6114
  createAoudaClusterMcpToolSet,
5890
6115
  installLocalNetworkFetch,