@@ -10,7 +10,7 @@ import {
1010  WeaviateReplicationType , 
1111  WeaviateShardingState , 
1212}  from  '../../openapi/types.js' ; 
13- import  {  DeepRequired  }  from  '../types/internal .js' ; 
13+ import  {  DeepRequired  }  from  '../../utils/types .js' ; 
1414
1515export  type  Output  =  'minimal'  |  'verbose'  |  undefined ; 
1616
@@ -22,13 +22,11 @@ export type NodesOptions<O extends Output> = {
2222} ; 
2323
2424export  type  QueryShardingStateOptions  =  { 
25-   /** The name of the collection to query. */ 
26-   collection : string ; 
2725  /** The name of the shard to query. If not provided, all shards will be queried. */ 
2826  shard ?: string ; 
2927} ; 
3028
31- export  type  ReplicateArguments  =  { 
29+ export  type  ReplicateArgs  =  { 
3230  /** The name of the collection in which to replicate a shard. */ 
3331  collection : string ; 
3432  /** The name of the shard to replicate. */ 
@@ -56,6 +54,11 @@ export type QueryReplicationOpsOptions = {
5654  includeHistory ?: boolean ; 
5755} ; 
5856
57+ export  type  GetReplicationOpOptions  =  { 
58+   /** Whether to include the status history in the response. Defaults to false. */ 
59+   includeHistory ?: boolean ; 
60+ } ; 
61+ 
5962export  type  Node < O  extends  Output >  =  { 
6063  name : string ; 
6164  status : 'HEALTHY'  |  'UNHEALTHY'  |  'UNAVAILABLE' ; 
@@ -79,17 +82,17 @@ const cluster = (connection: IConnection) => {
7982        . get < NodesStatusResponse > ( `${ path }  ?${ params . toString ( ) }  ` ) 
8083        . then ( ( res )  =>  res . nodes  as  Node < O > [ ] ) ; 
8184    } , 
82-     queryShardingState : ( opts : QueryShardingStateOptions )  =>  { 
85+     queryShardingState : ( collection :  string ,   opts ? : QueryShardingStateOptions )  =>  { 
8386      const  params  =  new  URLSearchParams ( ) ; 
84-       params . append ( 'collection' ,  opts . collection ) ; 
85-       if  ( opts . shard )  { 
87+       params . append ( 'collection' ,  collection ) ; 
88+       if  ( opts ? .shard )  { 
8689        params . append ( 'shard' ,  opts . shard ) ; 
8790      } 
8891      return  connection 
8992        . get < ShardingState  |  undefined > ( `/replication/sharding-state?${ params . toString ( ) }  ` ) 
9093        . then ( ( res )  =>  res  as  ShardingState ) ; 
9194    } , 
92-     replicate : ( args : ReplicateArguments ) : Promise < string >  => 
95+     replicate : ( args : ReplicateArgs ) : Promise < string >  => 
9396      connection 
9497        . postReturn < WeaviateReplicateRequest ,  WeaviateReplicateResponse > ( 
9598          `/replication/replicate` , 
@@ -100,7 +103,7 @@ const cluster = (connection: IConnection) => {
100103      cancel : ( id : string )  =>  connection . postEmpty ( `/replication/replicate/${ id }  /cancel` ,  { } ) , 
101104      delete : ( id : string )  =>  connection . delete ( `/replication/replicate/${ id }  ` ,  { } ,  false ) , 
102105      deleteAll : ( )  =>  connection . delete ( `/replication/replicate` ,  { } ,  false ) , 
103-       get : ( id : string ,  opts ?: {   includeHistory ?:  boolean   } ) : Promise < ReplicationOperation  |  null >  => 
106+       get : ( id : string ,  opts ?: GetReplicationOpOptions ) : Promise < ReplicationOperation  |  null >  => 
104107        connection 
105108          . get < ReplicationOperation  |  undefined > ( 
106109            `/replication/replicate/${ id }  ?includeHistory=${  
@@ -142,24 +145,25 @@ export interface Cluster {
142145  /** 
143146   * Query the sharding state of a specific collection. 
144147   * 
145-    * @param  {QueryShardingStateOptions } opts The options for the request. 
148+    * @param  {string } collection The name of the collection to query. 
149+    * @param  {QueryShardingStateOptions } [opts] The options for the request. 
146150   * @returns  {Promise<ShardingState> } The sharding state of the collection. 
147151   */ 
148-   queryShardingState : ( opts : QueryShardingStateOptions )  =>  Promise < ShardingState > ; 
152+   queryShardingState : ( collection :  string ,   opts ? : QueryShardingStateOptions )  =>  Promise < ShardingState > ; 
149153  /** 
150154   * Replicate a shard from one node to another. 
151155   * 
152-    * @param  {ReplicateArguments } args The arguments for the replication request. 
156+    * @param  {ReplicateArgs } args The arguments for the replication request. 
153157   * @returns  {Promise<string> } The ID of the replication request. 
154158   */ 
155-   replicate : ( args : ReplicateArguments )  =>  Promise < string > ; 
159+   replicate : ( args : ReplicateArgs )  =>  Promise < string > ; 
156160  /** 
157161   * Access replication operations. 
158162   */ 
159-   replications : Replciations ; 
163+   replications : Replications ; 
160164} 
161165
162- export  interface  Replciations  { 
166+ export  interface  Replications  { 
163167  /** 
164168   * Cancel a replication operation. 
165169   * 
0 commit comments