@aouda/client 0.1.11 → 0.1.12
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 +126 -22
- 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 +126 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/{client-CT3GdrvA.d.cts → client-Q83x0Mz9.d.cts} +34 -4
- package/dist/{client-CT3GdrvA.d.ts → client-Q83x0Mz9.d.ts} +34 -4
- package/dist/index.cjs +126 -22
- 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 +126 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -833,12 +833,29 @@ interface ConditionalScalarExpr {
|
|
|
833
833
|
then: ScalarExprNode;
|
|
834
834
|
else: ScalarExprNode;
|
|
835
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* Bind-time parameter hole. The named-query binder substitutes a literal before eval.
|
|
838
|
+
* @internal
|
|
839
|
+
*/
|
|
840
|
+
interface ParamScalarExpr {
|
|
841
|
+
type: "param";
|
|
842
|
+
name: string;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Closed allowlist function call. fn is lowercase and case-sensitive.
|
|
846
|
+
* @internal
|
|
847
|
+
*/
|
|
848
|
+
interface CallScalarExpr {
|
|
849
|
+
type: "call";
|
|
850
|
+
fn: string;
|
|
851
|
+
args: ScalarExprNode[];
|
|
852
|
+
}
|
|
836
853
|
/**
|
|
837
854
|
* Discriminated union for scalar expression nodes in expression-based SET values.
|
|
838
855
|
* Named ScalarExprNode (not SetExprNode) to allow reuse for future SELECT projections.
|
|
839
856
|
* @internal
|
|
840
857
|
*/
|
|
841
|
-
type ScalarExprNode = LiteralScalarExpr | ColRefScalarExpr | ArithmeticScalarExpr | CoalesceScalarExpr | ConditionalScalarExpr;
|
|
858
|
+
type ScalarExprNode = LiteralScalarExpr | ColRefScalarExpr | ArithmeticScalarExpr | CoalesceScalarExpr | ConditionalScalarExpr | ParamScalarExpr | CallScalarExpr;
|
|
842
859
|
/**
|
|
843
860
|
* A single server-side computed column definition for SELECT projections.
|
|
844
861
|
* Plain JSON object; the polymorphism lives in ScalarExprNode.
|
|
@@ -2435,7 +2452,7 @@ interface ConflateOptions {
|
|
|
2435
2452
|
interface SubscribeMessage {
|
|
2436
2453
|
type: "subscribe";
|
|
2437
2454
|
id: string;
|
|
2438
|
-
target
|
|
2455
|
+
target?: string;
|
|
2439
2456
|
filter?: Record<string, unknown>;
|
|
2440
2457
|
resume_from?: number;
|
|
2441
2458
|
hash?: string;
|
|
@@ -2492,6 +2509,11 @@ interface SnapshotCompleteMessage {
|
|
|
2492
2509
|
id: string;
|
|
2493
2510
|
version: number;
|
|
2494
2511
|
row_count: number;
|
|
2512
|
+
warnings?: Array<{
|
|
2513
|
+
code: string;
|
|
2514
|
+
hash?: string;
|
|
2515
|
+
sunsetAt?: string;
|
|
2516
|
+
}>;
|
|
2495
2517
|
}
|
|
2496
2518
|
interface GapMessage {
|
|
2497
2519
|
type: "gap";
|
|
@@ -3615,6 +3637,12 @@ declare class MaterializedQueriesApi {
|
|
|
3615
3637
|
interface NamedQueryExecuteOptions {
|
|
3616
3638
|
signal?: AbortSignal;
|
|
3617
3639
|
}
|
|
3640
|
+
interface NamedQuerySubscribeOptions<T = Record<string, unknown>> {
|
|
3641
|
+
onSnapshot?: (rows: T[], version: number) => void;
|
|
3642
|
+
onChange?: (event: SubscriptionChangeEvent<T>) => void;
|
|
3643
|
+
onError?: (error: Error) => void;
|
|
3644
|
+
conflate?: ConflateOptions;
|
|
3645
|
+
}
|
|
3618
3646
|
interface NamedQueryBatchItem {
|
|
3619
3647
|
hash: string;
|
|
3620
3648
|
args?: Record<string, unknown>;
|
|
@@ -3636,9 +3664,11 @@ declare class NamedQueriesApi {
|
|
|
3636
3664
|
private readonly transport;
|
|
3637
3665
|
private readonly database;
|
|
3638
3666
|
private readonly onWarning;
|
|
3639
|
-
|
|
3667
|
+
private readonly getStreamingTransport;
|
|
3668
|
+
constructor(transport: Transport, database: string, onWarning: NamedArtifactWarningSink, getStreamingTransport: () => StreamingTransport);
|
|
3640
3669
|
execute<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQueryExecuteOptions): Promise<QueryResult<T>>;
|
|
3641
3670
|
batch<T = Record<string, unknown>>(items: NamedQueryBatchItem[], options?: NamedQueryExecuteOptions): Promise<NamedQueryBatchSlotResult<T>[]>;
|
|
3671
|
+
subscribe<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQuerySubscribeOptions<T>): Subscription<T>;
|
|
3642
3672
|
}
|
|
3643
3673
|
declare class NamedMutationsApi {
|
|
3644
3674
|
private readonly transport;
|
|
@@ -3900,4 +3930,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3900
3930
|
*/
|
|
3901
3931
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3902
3932
|
|
|
3903
|
-
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
|
|
3933
|
+
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 SubscriptionEvent as b$, type MetricsSummary as b0, type MutationResult as b1, type NamedArtifactWarning as b2, type NamedMutationResult as b3, NamedMutationsApi as b4, NamedQueriesApi as b5, type NamedQueryBatchItem as b6, type NamedQueryBatchSlotResult as b7, type NamedQueryExecuteOptions as b8, type NamedQuerySubscribeOptions as b9, ReplicationAdminApi as bA, type ReplicationMetrics as bB, type ResidencyConfig as bC, type ResultWarning as bD, RetryPolicy as bE, type RlsResolver as bF, type RlsResolverRule as bG, type RlsResolverRuleInput as bH, type RlsResolversListResponse as bI, type SchemaChange as bJ, type SchemaChangeType as bK, type SchemaDiffResult as bL, type SchemaRelationshipsResponse as bM, type SeedApplyResult as bN, type SeedTableApplyResult as bO, ServerAdminApi as bP, type ServerAuthOptions as bQ, type ServerMemoryResponse as bR, type ServerMetricsResponse as bS, type ServiceInfo as bT, type SimdMetrics as bU, type SingleDatabaseMetricsResponse as bV, type SortDirection as bW, type StorageMetrics as bX, type SubscribeOptions as bY, type Subscription as bZ, type SubscriptionChangeEvent as b_, NodeAdminApi as ba, type NodeLogEntry as bb, type NodeLogLevel as bc, type NodeLogStreamOptions as bd, type NodeLogsQuery as be, type NodeLogsResponse as bf, type OpenWriteStreamOptions as bg, type PageCacheMetrics as bh, type PartitionFunction as bi, type PartitionGrant as bj, type PartitionGrantsListResponse as bk, type PartitioningMetrics as bl, type PendingJobListResponse as bm, type PendingJobResponse as bn, type PerDatabaseLagEntry as bo, type PerDatabaseMetrics as bp, type PerDatabaseStatusEntry as bq, type QueryMetrics as br, type QueryResult as bs, type QueryStats as bt, type ReferenceInfo as bu, type RelationshipEndpoint as bv, type RelationshipInfo as bw, type RenameColumnRequest as bx, type RenameTableRequest as by, type ReorderColumnsRequest as bz, type ReadinessResponse as c, type SubscriptionInfo as c0, type SubscriptionSnapshotEvent as c1, TIME_BUCKET_FUNCTIONS as c2, type TableCoverageEntry as c3, type TableNameFromSchema as c4, type TablePolicy as c5, TableQuery as c6, type TableSchema as c7, type TableSchemaResponse as c8, type TableSummary as c9, type TableSummaryForErd as ca, TablesApi as cb, type TimeBucketFunction as cc, type TimeSeriesMetrics as cd, type TransactionMetrics as ce, type TypeGenerationOptions as cf, type UpdateOptions as cg, type UpdateRlsResolverRequest as ch, type UpdateTableOptionsRequest as ci, type UpdateTablePolicyRequest as cj, type UserProfile as ck, type WalMetrics as cl, WhereGroupBuilder as cm, type WhereOperator as cn, type WriteStream as co, coerceColumnarValue as cp, columnarToRows as cq, createAoudaClient as cr, 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 };
|
|
@@ -833,12 +833,29 @@ interface ConditionalScalarExpr {
|
|
|
833
833
|
then: ScalarExprNode;
|
|
834
834
|
else: ScalarExprNode;
|
|
835
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* Bind-time parameter hole. The named-query binder substitutes a literal before eval.
|
|
838
|
+
* @internal
|
|
839
|
+
*/
|
|
840
|
+
interface ParamScalarExpr {
|
|
841
|
+
type: "param";
|
|
842
|
+
name: string;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Closed allowlist function call. fn is lowercase and case-sensitive.
|
|
846
|
+
* @internal
|
|
847
|
+
*/
|
|
848
|
+
interface CallScalarExpr {
|
|
849
|
+
type: "call";
|
|
850
|
+
fn: string;
|
|
851
|
+
args: ScalarExprNode[];
|
|
852
|
+
}
|
|
836
853
|
/**
|
|
837
854
|
* Discriminated union for scalar expression nodes in expression-based SET values.
|
|
838
855
|
* Named ScalarExprNode (not SetExprNode) to allow reuse for future SELECT projections.
|
|
839
856
|
* @internal
|
|
840
857
|
*/
|
|
841
|
-
type ScalarExprNode = LiteralScalarExpr | ColRefScalarExpr | ArithmeticScalarExpr | CoalesceScalarExpr | ConditionalScalarExpr;
|
|
858
|
+
type ScalarExprNode = LiteralScalarExpr | ColRefScalarExpr | ArithmeticScalarExpr | CoalesceScalarExpr | ConditionalScalarExpr | ParamScalarExpr | CallScalarExpr;
|
|
842
859
|
/**
|
|
843
860
|
* A single server-side computed column definition for SELECT projections.
|
|
844
861
|
* Plain JSON object; the polymorphism lives in ScalarExprNode.
|
|
@@ -2435,7 +2452,7 @@ interface ConflateOptions {
|
|
|
2435
2452
|
interface SubscribeMessage {
|
|
2436
2453
|
type: "subscribe";
|
|
2437
2454
|
id: string;
|
|
2438
|
-
target
|
|
2455
|
+
target?: string;
|
|
2439
2456
|
filter?: Record<string, unknown>;
|
|
2440
2457
|
resume_from?: number;
|
|
2441
2458
|
hash?: string;
|
|
@@ -2492,6 +2509,11 @@ interface SnapshotCompleteMessage {
|
|
|
2492
2509
|
id: string;
|
|
2493
2510
|
version: number;
|
|
2494
2511
|
row_count: number;
|
|
2512
|
+
warnings?: Array<{
|
|
2513
|
+
code: string;
|
|
2514
|
+
hash?: string;
|
|
2515
|
+
sunsetAt?: string;
|
|
2516
|
+
}>;
|
|
2495
2517
|
}
|
|
2496
2518
|
interface GapMessage {
|
|
2497
2519
|
type: "gap";
|
|
@@ -3615,6 +3637,12 @@ declare class MaterializedQueriesApi {
|
|
|
3615
3637
|
interface NamedQueryExecuteOptions {
|
|
3616
3638
|
signal?: AbortSignal;
|
|
3617
3639
|
}
|
|
3640
|
+
interface NamedQuerySubscribeOptions<T = Record<string, unknown>> {
|
|
3641
|
+
onSnapshot?: (rows: T[], version: number) => void;
|
|
3642
|
+
onChange?: (event: SubscriptionChangeEvent<T>) => void;
|
|
3643
|
+
onError?: (error: Error) => void;
|
|
3644
|
+
conflate?: ConflateOptions;
|
|
3645
|
+
}
|
|
3618
3646
|
interface NamedQueryBatchItem {
|
|
3619
3647
|
hash: string;
|
|
3620
3648
|
args?: Record<string, unknown>;
|
|
@@ -3636,9 +3664,11 @@ declare class NamedQueriesApi {
|
|
|
3636
3664
|
private readonly transport;
|
|
3637
3665
|
private readonly database;
|
|
3638
3666
|
private readonly onWarning;
|
|
3639
|
-
|
|
3667
|
+
private readonly getStreamingTransport;
|
|
3668
|
+
constructor(transport: Transport, database: string, onWarning: NamedArtifactWarningSink, getStreamingTransport: () => StreamingTransport);
|
|
3640
3669
|
execute<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQueryExecuteOptions): Promise<QueryResult<T>>;
|
|
3641
3670
|
batch<T = Record<string, unknown>>(items: NamedQueryBatchItem[], options?: NamedQueryExecuteOptions): Promise<NamedQueryBatchSlotResult<T>[]>;
|
|
3671
|
+
subscribe<T = Record<string, unknown>>(hash: string, args?: Record<string, unknown>, options?: NamedQuerySubscribeOptions<T>): Subscription<T>;
|
|
3642
3672
|
}
|
|
3643
3673
|
declare class NamedMutationsApi {
|
|
3644
3674
|
private readonly transport;
|
|
@@ -3900,4 +3930,4 @@ declare class AoudaClient<S extends SchemaLike = DefaultSchema> {
|
|
|
3900
3930
|
*/
|
|
3901
3931
|
declare function createAoudaClient<S extends SchemaLike = DefaultSchema>(options: AoudaClientOptions): AoudaClient<S>;
|
|
3902
3932
|
|
|
3903
|
-
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
|
|
3933
|
+
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 SubscriptionEvent as b$, type MetricsSummary as b0, type MutationResult as b1, type NamedArtifactWarning as b2, type NamedMutationResult as b3, NamedMutationsApi as b4, NamedQueriesApi as b5, type NamedQueryBatchItem as b6, type NamedQueryBatchSlotResult as b7, type NamedQueryExecuteOptions as b8, type NamedQuerySubscribeOptions as b9, ReplicationAdminApi as bA, type ReplicationMetrics as bB, type ResidencyConfig as bC, type ResultWarning as bD, RetryPolicy as bE, type RlsResolver as bF, type RlsResolverRule as bG, type RlsResolverRuleInput as bH, type RlsResolversListResponse as bI, type SchemaChange as bJ, type SchemaChangeType as bK, type SchemaDiffResult as bL, type SchemaRelationshipsResponse as bM, type SeedApplyResult as bN, type SeedTableApplyResult as bO, ServerAdminApi as bP, type ServerAuthOptions as bQ, type ServerMemoryResponse as bR, type ServerMetricsResponse as bS, type ServiceInfo as bT, type SimdMetrics as bU, type SingleDatabaseMetricsResponse as bV, type SortDirection as bW, type StorageMetrics as bX, type SubscribeOptions as bY, type Subscription as bZ, type SubscriptionChangeEvent as b_, NodeAdminApi as ba, type NodeLogEntry as bb, type NodeLogLevel as bc, type NodeLogStreamOptions as bd, type NodeLogsQuery as be, type NodeLogsResponse as bf, type OpenWriteStreamOptions as bg, type PageCacheMetrics as bh, type PartitionFunction as bi, type PartitionGrant as bj, type PartitionGrantsListResponse as bk, type PartitioningMetrics as bl, type PendingJobListResponse as bm, type PendingJobResponse as bn, type PerDatabaseLagEntry as bo, type PerDatabaseMetrics as bp, type PerDatabaseStatusEntry as bq, type QueryMetrics as br, type QueryResult as bs, type QueryStats as bt, type ReferenceInfo as bu, type RelationshipEndpoint as bv, type RelationshipInfo as bw, type RenameColumnRequest as bx, type RenameTableRequest as by, type ReorderColumnsRequest as bz, type ReadinessResponse as c, type SubscriptionInfo as c0, type SubscriptionSnapshotEvent as c1, TIME_BUCKET_FUNCTIONS as c2, type TableCoverageEntry as c3, type TableNameFromSchema as c4, type TablePolicy as c5, TableQuery as c6, type TableSchema as c7, type TableSchemaResponse as c8, type TableSummary as c9, type TableSummaryForErd as ca, TablesApi as cb, type TimeBucketFunction as cc, type TimeSeriesMetrics as cd, type TransactionMetrics as ce, type TypeGenerationOptions as cf, type UpdateOptions as cg, type UpdateRlsResolverRequest as ch, type UpdateTableOptionsRequest as ci, type UpdateTablePolicyRequest as cj, type UserProfile as ck, type WalMetrics as cl, WhereGroupBuilder as cm, type WhereOperator as cn, type WriteStream as co, coerceColumnarValue as cp, columnarToRows as cq, createAoudaClient as cr, 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
|
@@ -86,7 +86,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
86
86
|
// package.json
|
|
87
87
|
var package_default = {
|
|
88
88
|
name: "@aouda/client",
|
|
89
|
-
version: "0.1.
|
|
89
|
+
version: "0.1.12",
|
|
90
90
|
description: "Official TypeScript/JavaScript client library for Aouda",
|
|
91
91
|
type: "module",
|
|
92
92
|
main: "./dist/index.cjs",
|
|
@@ -2112,7 +2112,7 @@ var AsyncEventQueue = class {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
2114
|
var TableSubscription = class {
|
|
2115
|
-
constructor(transport,
|
|
2115
|
+
constructor(transport, identity, options = {}, onWarnings) {
|
|
2116
2116
|
this._queue = new AsyncEventQueue();
|
|
2117
2117
|
this._active = true;
|
|
2118
2118
|
this._started = false;
|
|
@@ -2122,11 +2122,11 @@ var TableSubscription = class {
|
|
|
2122
2122
|
this._forceFreshSubscribe = false;
|
|
2123
2123
|
this.id = createStreamingId("sub");
|
|
2124
2124
|
this._transport = transport;
|
|
2125
|
-
this.
|
|
2126
|
-
this._baseFilter = baseFilter;
|
|
2125
|
+
this._identity = identity;
|
|
2127
2126
|
this._onSnapshot = options.onSnapshot;
|
|
2128
2127
|
this._onChange = options.onChange;
|
|
2129
2128
|
this._onError = options.onError;
|
|
2129
|
+
this._onWarnings = onWarnings;
|
|
2130
2130
|
this._conflate = options.conflate;
|
|
2131
2131
|
this._reconnectHandlerKey = `${this.id}::reconnect`;
|
|
2132
2132
|
}
|
|
@@ -2189,12 +2189,18 @@ var TableSubscription = class {
|
|
|
2189
2189
|
async _sendSubscribe(resumeFrom) {
|
|
2190
2190
|
const message = {
|
|
2191
2191
|
type: "subscribe",
|
|
2192
|
-
id: this.id
|
|
2193
|
-
target: this._tableName
|
|
2192
|
+
id: this.id
|
|
2194
2193
|
};
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2194
|
+
if (this._identity.kind === "named") {
|
|
2195
|
+
message.hash = this._identity.hash;
|
|
2196
|
+
if (this._identity.args !== void 0) {
|
|
2197
|
+
message.args = this._identity.args;
|
|
2198
|
+
}
|
|
2199
|
+
} else {
|
|
2200
|
+
message.target = this._identity.target;
|
|
2201
|
+
if (this._identity.filter !== void 0) {
|
|
2202
|
+
message.filter = this._identity.filter;
|
|
2203
|
+
}
|
|
2198
2204
|
}
|
|
2199
2205
|
if (resumeFrom !== void 0) {
|
|
2200
2206
|
message.resume_from = resumeFrom;
|
|
@@ -2233,6 +2239,9 @@ var TableSubscription = class {
|
|
|
2233
2239
|
}
|
|
2234
2240
|
_handleSnapshotComplete(message) {
|
|
2235
2241
|
this._lastVersion = message.version;
|
|
2242
|
+
if (message.warnings != null && message.warnings.length > 0) {
|
|
2243
|
+
this._onWarnings?.(message.warnings);
|
|
2244
|
+
}
|
|
2236
2245
|
const rows = this._pendingSnapshotRows;
|
|
2237
2246
|
this._pendingSnapshotRows = [];
|
|
2238
2247
|
this._onSnapshot?.(rows, message.version);
|
|
@@ -2982,17 +2991,16 @@ var TableQuery = class _TableQuery {
|
|
|
2982
2991
|
const whereClause = this.buildWhereClause();
|
|
2983
2992
|
const queryFilter = buildSubscriptionFilter(whereClause);
|
|
2984
2993
|
const mergedFilter = mergeFilterObjects(queryFilter, options.filter);
|
|
2985
|
-
const subscription = new TableSubscription(
|
|
2986
|
-
|
|
2987
|
-
this.tableName,
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
);
|
|
2994
|
+
const subscription = new TableSubscription(wsTransport, {
|
|
2995
|
+
kind: "table",
|
|
2996
|
+
target: this.tableName,
|
|
2997
|
+
filter: mergedFilter
|
|
2998
|
+
}, {
|
|
2999
|
+
onSnapshot: options.onSnapshot,
|
|
3000
|
+
onChange: options.onChange,
|
|
3001
|
+
onError: options.onError,
|
|
3002
|
+
conflate: options.conflate
|
|
3003
|
+
});
|
|
2996
3004
|
subscription.start();
|
|
2997
3005
|
return subscription;
|
|
2998
3006
|
}
|
|
@@ -3578,10 +3586,84 @@ function serializeUpdateValue(col, val) {
|
|
|
3578
3586
|
else: toNode(cond.else)
|
|
3579
3587
|
};
|
|
3580
3588
|
}
|
|
3589
|
+
if ("$upper" in val) {
|
|
3590
|
+
return { type: "call", fn: "upper", args: [unaryCallArg(col, val.$upper)] };
|
|
3591
|
+
}
|
|
3592
|
+
if ("$lower" in val) {
|
|
3593
|
+
return { type: "call", fn: "lower", args: [unaryCallArg(col, val.$lower)] };
|
|
3594
|
+
}
|
|
3595
|
+
if ("$trim" in val) {
|
|
3596
|
+
return { type: "call", fn: "trim", args: [unaryCallArg(col, val.$trim)] };
|
|
3597
|
+
}
|
|
3598
|
+
if ("$concat" in val) {
|
|
3599
|
+
const parts = val.$concat;
|
|
3600
|
+
return {
|
|
3601
|
+
type: "call",
|
|
3602
|
+
fn: "concat",
|
|
3603
|
+
args: parts.map((p) => valueToExprNode(p))
|
|
3604
|
+
};
|
|
3605
|
+
}
|
|
3606
|
+
if ("$substring" in val) {
|
|
3607
|
+
const spec = val.$substring;
|
|
3608
|
+
if (Array.isArray(spec)) {
|
|
3609
|
+
return {
|
|
3610
|
+
type: "call",
|
|
3611
|
+
fn: "substring",
|
|
3612
|
+
args: [{ type: "colRef", col }, ...spec.map((p) => valueToExprNode(p))]
|
|
3613
|
+
};
|
|
3614
|
+
}
|
|
3615
|
+
return {
|
|
3616
|
+
type: "call",
|
|
3617
|
+
fn: "substring",
|
|
3618
|
+
args: [{ type: "colRef", col }, { type: "literal", value: spec }]
|
|
3619
|
+
};
|
|
3620
|
+
}
|
|
3621
|
+
if ("$round" in val) {
|
|
3622
|
+
return {
|
|
3623
|
+
type: "call",
|
|
3624
|
+
fn: "round",
|
|
3625
|
+
args: [
|
|
3626
|
+
{ type: "colRef", col },
|
|
3627
|
+
{ type: "literal", value: val.$round }
|
|
3628
|
+
]
|
|
3629
|
+
};
|
|
3630
|
+
}
|
|
3631
|
+
if ("$roundTo" in val) {
|
|
3632
|
+
return {
|
|
3633
|
+
type: "call",
|
|
3634
|
+
fn: "roundTo",
|
|
3635
|
+
args: [
|
|
3636
|
+
{ type: "colRef", col },
|
|
3637
|
+
{ type: "literal", value: val.$roundTo }
|
|
3638
|
+
]
|
|
3639
|
+
};
|
|
3640
|
+
}
|
|
3641
|
+
if ("$cast" in val) {
|
|
3642
|
+
return {
|
|
3643
|
+
type: "call",
|
|
3644
|
+
fn: "cast",
|
|
3645
|
+
args: [
|
|
3646
|
+
{ type: "colRef", col },
|
|
3647
|
+
{ type: "literal", value: val.$cast }
|
|
3648
|
+
]
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3581
3651
|
throw new Error(
|
|
3582
3652
|
`Unknown expression operator in update() for column '${col}': ${JSON.stringify(val)}`
|
|
3583
3653
|
);
|
|
3584
3654
|
}
|
|
3655
|
+
function unaryCallArg(col, operand) {
|
|
3656
|
+
if (operand === true || operand === 1) {
|
|
3657
|
+
return { type: "colRef", col };
|
|
3658
|
+
}
|
|
3659
|
+
return valueToExprNode(operand);
|
|
3660
|
+
}
|
|
3661
|
+
function valueToExprNode(v) {
|
|
3662
|
+
if (typeof v === "string" && v.startsWith("$")) {
|
|
3663
|
+
return { type: "colRef", col: v.slice(1) };
|
|
3664
|
+
}
|
|
3665
|
+
return { type: "literal", value: v };
|
|
3666
|
+
}
|
|
3585
3667
|
|
|
3586
3668
|
// src/tables.ts
|
|
3587
3669
|
function validateNonEmptyString(value, name) {
|
|
@@ -4742,10 +4824,11 @@ function emptyStats() {
|
|
|
4742
4824
|
};
|
|
4743
4825
|
}
|
|
4744
4826
|
var NamedQueriesApi = class {
|
|
4745
|
-
constructor(transport, database, onWarning) {
|
|
4827
|
+
constructor(transport, database, onWarning, getStreamingTransport) {
|
|
4746
4828
|
this.transport = transport;
|
|
4747
4829
|
this.database = database;
|
|
4748
4830
|
this.onWarning = onWarning;
|
|
4831
|
+
this.getStreamingTransport = getStreamingTransport;
|
|
4749
4832
|
}
|
|
4750
4833
|
async execute(hash, args, options) {
|
|
4751
4834
|
if (typeof hash !== "string" || hash.trim().length === 0) {
|
|
@@ -4813,6 +4896,26 @@ var NamedQueriesApi = class {
|
|
|
4813
4896
|
return { isError: false, result };
|
|
4814
4897
|
});
|
|
4815
4898
|
}
|
|
4899
|
+
subscribe(hash, args, options = {}) {
|
|
4900
|
+
if (typeof hash !== "string" || hash.trim().length === 0) {
|
|
4901
|
+
throw new Error("Named query hash must be a non-empty string");
|
|
4902
|
+
}
|
|
4903
|
+
const subscription = new TableSubscription(
|
|
4904
|
+
this.getStreamingTransport(),
|
|
4905
|
+
{ kind: "named", hash, args },
|
|
4906
|
+
{
|
|
4907
|
+
onSnapshot: options.onSnapshot,
|
|
4908
|
+
onChange: options.onChange,
|
|
4909
|
+
onError: options.onError,
|
|
4910
|
+
conflate: options.conflate
|
|
4911
|
+
},
|
|
4912
|
+
(warnings) => {
|
|
4913
|
+
raiseDeprecationWarnings(this.onWarning, warnings);
|
|
4914
|
+
}
|
|
4915
|
+
);
|
|
4916
|
+
subscription.start();
|
|
4917
|
+
return subscription;
|
|
4918
|
+
}
|
|
4816
4919
|
};
|
|
4817
4920
|
var NamedMutationsApi = class {
|
|
4818
4921
|
constructor(transport, database, onWarning) {
|
|
@@ -5636,7 +5739,8 @@ var AoudaClient = class {
|
|
|
5636
5739
|
this._namedQueries = new NamedQueriesApi(
|
|
5637
5740
|
this.transport,
|
|
5638
5741
|
this.database,
|
|
5639
|
-
onNamedArtifactWarning
|
|
5742
|
+
onNamedArtifactWarning,
|
|
5743
|
+
() => this._getOrCreateWebSocketTransport()
|
|
5640
5744
|
);
|
|
5641
5745
|
this._namedMutations = new NamedMutationsApi(
|
|
5642
5746
|
this.transport,
|