@aouda/client 0.1.9 → 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/cli/index.cjs +203 -6
- 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 +203 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-CxP9Vnc8.d.cts → client-Dgenr-cE.d.cts} +92 -2
- package/dist/{client-CxP9Vnc8.d.ts → client-Dgenr-cE.d.ts} +92 -2
- package/dist/index.cjs +208 -5
- 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 +205 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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-
|
|
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
|
|
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.
|
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-
|
|
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
|
|
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.
|
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.
|
|
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",
|
|
@@ -1125,7 +1125,15 @@ var ERROR_CODE_MAP = {
|
|
|
1125
1125
|
AUTH_TOKEN_INVALID: AoudaAuthenticationError,
|
|
1126
1126
|
AUTH_TOKEN_REVOKED: AoudaAuthenticationError,
|
|
1127
1127
|
AUTH_API_KEY_INVALID: AoudaAuthenticationError,
|
|
1128
|
-
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
|
|
1129
1137
|
};
|
|
1130
1138
|
function createComposedAbortController(...signals) {
|
|
1131
1139
|
const controller = new AbortController();
|
|
@@ -2018,6 +2026,7 @@ var TableSubscription = class {
|
|
|
2018
2026
|
this._started = false;
|
|
2019
2027
|
this._startPromise = null;
|
|
2020
2028
|
this._lastVersion = 0;
|
|
2029
|
+
this._pendingSnapshotRows = [];
|
|
2021
2030
|
this.id = createStreamingId("sub");
|
|
2022
2031
|
this._transport = transport;
|
|
2023
2032
|
this._tableName = tableName;
|
|
@@ -2074,6 +2083,7 @@ var TableSubscription = class {
|
|
|
2074
2083
|
return;
|
|
2075
2084
|
}
|
|
2076
2085
|
try {
|
|
2086
|
+
this._pendingSnapshotRows = [];
|
|
2077
2087
|
const resumeFrom = this._lastVersion > 0 ? this._lastVersion : void 0;
|
|
2078
2088
|
await this._sendSubscribe(resumeFrom);
|
|
2079
2089
|
} catch (error) {
|
|
@@ -2102,7 +2112,13 @@ var TableSubscription = class {
|
|
|
2102
2112
|
}
|
|
2103
2113
|
switch (message.type) {
|
|
2104
2114
|
case "snapshot":
|
|
2105
|
-
this.
|
|
2115
|
+
this._handleSnapshotPage(message);
|
|
2116
|
+
return;
|
|
2117
|
+
case "snapshot_complete":
|
|
2118
|
+
this._handleSnapshotComplete(message);
|
|
2119
|
+
return;
|
|
2120
|
+
case "gap":
|
|
2121
|
+
void this._handleGap(message);
|
|
2106
2122
|
return;
|
|
2107
2123
|
case "change":
|
|
2108
2124
|
this._handleChange(message);
|
|
@@ -2114,9 +2130,13 @@ var TableSubscription = class {
|
|
|
2114
2130
|
return;
|
|
2115
2131
|
}
|
|
2116
2132
|
}
|
|
2117
|
-
|
|
2133
|
+
_handleSnapshotPage(message) {
|
|
2134
|
+
this._pendingSnapshotRows.push(...message.rows);
|
|
2135
|
+
}
|
|
2136
|
+
_handleSnapshotComplete(message) {
|
|
2118
2137
|
this._lastVersion = message.version;
|
|
2119
|
-
const rows =
|
|
2138
|
+
const rows = this._pendingSnapshotRows;
|
|
2139
|
+
this._pendingSnapshotRows = [];
|
|
2120
2140
|
this._onSnapshot?.(rows, message.version);
|
|
2121
2141
|
this._queue.push({
|
|
2122
2142
|
type: "snapshot",
|
|
@@ -2124,6 +2144,16 @@ var TableSubscription = class {
|
|
|
2124
2144
|
version: message.version
|
|
2125
2145
|
});
|
|
2126
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
|
+
}
|
|
2127
2157
|
_handleChange(message) {
|
|
2128
2158
|
this._lastVersion = message.version;
|
|
2129
2159
|
const event = {
|
|
@@ -2138,6 +2168,7 @@ var TableSubscription = class {
|
|
|
2138
2168
|
this._queue.push(event);
|
|
2139
2169
|
}
|
|
2140
2170
|
_handleServerError(message) {
|
|
2171
|
+
this._pendingSnapshotRows = [];
|
|
2141
2172
|
const error = new AoudaConnectionError(
|
|
2142
2173
|
`Subscription error (${message.code}): ${message.message}`
|
|
2143
2174
|
);
|
|
@@ -4576,6 +4607,147 @@ var MaterializedQueriesApi = class {
|
|
|
4576
4607
|
}
|
|
4577
4608
|
};
|
|
4578
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
|
+
|
|
4579
4751
|
// src/streaming/websocket-transport.ts
|
|
4580
4752
|
import { decode as decodeMessagePack, encode as encodeMessagePack } from "@msgpack/msgpack";
|
|
4581
4753
|
var DEFAULT_PING_INTERVAL_MS = 2e4;
|
|
@@ -5338,6 +5510,19 @@ var AoudaClient = class {
|
|
|
5338
5510
|
this.transport,
|
|
5339
5511
|
this.database
|
|
5340
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
|
+
);
|
|
5341
5526
|
}
|
|
5342
5527
|
/**
|
|
5343
5528
|
* Connects to the Aouda server.
|
|
@@ -5480,6 +5665,18 @@ var AoudaClient = class {
|
|
|
5480
5665
|
get materializedQueries() {
|
|
5481
5666
|
return this._materializedQueries;
|
|
5482
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
|
+
}
|
|
5483
5680
|
/**
|
|
5484
5681
|
* Access auth operations (signUp, signIn, signOut, refresh, me, changePassword).
|
|
5485
5682
|
* @returns The auth API.
|
|
@@ -5900,6 +6097,8 @@ export {
|
|
|
5900
6097
|
MaterializedQueryState,
|
|
5901
6098
|
MaterializedQueryType,
|
|
5902
6099
|
MetricsAdminApi,
|
|
6100
|
+
NamedMutationsApi,
|
|
6101
|
+
NamedQueriesApi,
|
|
5903
6102
|
NodeAdminApi,
|
|
5904
6103
|
ReplicationAdminApi,
|
|
5905
6104
|
RetryPolicy,
|
|
@@ -5910,6 +6109,7 @@ export {
|
|
|
5910
6109
|
WhereGroupBuilder,
|
|
5911
6110
|
applyLocalNetworkAccess,
|
|
5912
6111
|
coerceColumnarValue,
|
|
6112
|
+
columnarToRows,
|
|
5913
6113
|
createAoudaClient,
|
|
5914
6114
|
createAoudaClusterMcpToolSet,
|
|
5915
6115
|
installLocalNetworkFetch,
|