import { AddReplica, AddReplicaProp, Alias, BalanceShardUnique, ClusterProp, CreateOptions, DeleteReplica, DeleteReplicaProp, Migrate, RebalanceLeaders, Role, ShardOptions, SplitShard } from './types'; /** * Class representing a Collection that handles various collection-related operations. */ export declare class Collection { /** * @param {any[]} parameters - An array containing various parameters. Can include mixed types of data, such as strings, numbers, objects, etc. */ private parameters; /** * Initializes a new instance of the class. * * @return {Object} A new instance of the class with default values. */ constructor(); /** * Adds a parameter to the collection and returns the collection instance. * * @param {string} parameter - The parameter to be added to the collection. * @return {Collection} The collection instance with the new parameter added. */ set(parameter: string): Collection; /** * Creates a new collection with the specified options. * * @param {CreateOptions} options - The options to create the collection with. * @param {string} [options.name] - The name of the collection. * @param {string} [options.routerName] - The name of the router. * @param {number} [options.numShards] - The number of shards. * @param {string|string[]} [options.shards] - The shard names. * @param {number} [options.replicationFactor] - The replication factor. * @param {number} [options.maxShardsPerNode] - The maximum number of shards per node. * @param {string|string[]} [options.createNodeSet] - The node set to create the collection on. * @param {boolean} [options.createNodeSetShuffle] - Whether to shuffle the node set during creation. * @param {string} [options.collectionConfigName] - The configuration name for the collection. * @param {string} [options.routerField] - The router field. * @param {boolean} [options.autoAddReplicas] - Whether to automatically add replicas. * @param {string} [options.async] - Whether the creation is asynchronous. * * @return {Collection} The created collection. */ create(options: CreateOptions): Collection; /** * Reloads the collection with an optional name parameter. * * @param {string} name - The name of the collection to be reloaded. * @return {Collection} The current instance of the collection with updated parameters. */ reload(name: string): Collection; /** * Splits a shard within a collection based on given options. * * @param {Object} options - The options for splitting the shard. * @param {string} options.collection - The name of the collection to split. * @param {string} options.shard - The name of the shard to split. * @param {(string|string[])} [options.ranges] - Optional ranges to specify for the shard split. * @param {string} [options.splitKey] - The key at which to split the shard. * @param {boolean} [options.async] - Determines whether the split operation should be asynchronous. * @return {Collection} The current collection instance for method chaining. */ splitShard(options: SplitShard): Collection; /** * Method to create a shard with specified options. * * @param {ShardOptions} options - The configuration options for creating the shard. * @param {string} options.collection - The name of the collection. * @param {string} options.shard - The name of the shard. * * @return {Collection} The newly created shard as a Collection. */ createShard(options: ShardOptions): Collection; /** * Deletes a shard from the collection with specified options. * * @param {Object} options - The options for deleting the shard. * @param {string} options.collection - The name of the collection from which the shard should be deleted. * @param {string} options.shard - The identifier of the shard to be deleted. * @return {Object} The current instance of the Collection. */ deleteShard(options: ShardOptions): Collection; /** * Creates an alias for the given collection based on the provided options. * * @param {Alias} options - The alias configuration options. * @param {string} options.name - The name of the alias to be created. * @param {string|string[]} options.collections - The collection(s) to be aliased. * @return {Collection} Returns the updated collection instance with the alias created. */ createAlias(options: Alias): Collection; /** * Deletes an alias with the specified name. * * @param {string} name - The name of the alias to delete. * @return {Collection} The updated collection after the alias is deleted. */ deleteAlias(name: string): Collection; /** * Adds a delete action with an optional name parameter to the parameters list. * * @param {string} name - The name of the item to be deleted. * @return {Collection} The collection instance with updated parameters. */ delete(name: string): Collection; /** * Deletes a replica from the specified collection and shard with optional condition. * * @param {Object} options - The options to configure the deleteReplica action. * @param {string} options.collection - The name of the collection from which to delete the replica. * @param {string} options.shard - The name of the shard from which to delete the replica. * @param {string} options.replica - The identifier of the replica to delete. * @param {boolean} [options.onlyIfDown] - If set to true, the replica will be deleted only if it is down. * @return {Collection} The current instance of the Collection for chaining. */ deleteReplica(options: DeleteReplica): Collection; /** * Adds a replica to a Solr collection. * * @param {Object} options - The options for adding a replica. * @param {string} options.collection - The name of the collection to which the replica is to be added. * @param {string} options.shard - The name of the shard to which the replica is to be added. * @param {string} [options.route] - The route parameter for the request. * @param {string} [options.node] - The node to which the replica should be added. * @param {string} [options.async] - The request ID for this asynchronous request. * @return {Collection} Returns the collection instance with updated parameters. */ addReplica(options: AddReplica): Collection; /** * Configures cluster properties and updates the internal parameters accordingly. * * @param {Object} options - The configuration options for the cluster. * @param {string} options.name - The name of the cluster property to configure. * @param {any} options.val - The value to set for the specified cluster property. * @return {Collection} The current instance with updated parameters. */ clusterProp(options: ClusterProp): Collection; /** * Migrates data between collections based on the provided options. * * @param {Migrate} options - The migration options. * @param {string} options.collection - The source collection for migration. * @param {string} options.targetCollection - The target collection for migration. * @param {string} options.splitKey - The key used to split the data during migration. * @param {number} options.forwardTimeout - The timeout duration for forwarding operations. * @param {boolean} options.async - Whether the migration should be performed asynchronously. * @return {Collection} The updated collection after migration parameters have been set. */ migrate(options: Migrate): Collection; /** * Adds a role to the collection using the specified options. * * @param {Object} options - The options for adding the role. * @param {string} options.role - The role to be added. * @param {string} options.node - The node associated with the role. * @return {Collection} The updated collection with the new role. */ addRole(options: Role): Collection; /** * Removes a role from the current collection given specific options. * * @param {Object} options - The options for the role removal. * @param {string} options.role - The role to be removed. * @param {string} options.node - The node associated with the role to be removed. * @return {Collection} The current instance of the collection for method chaining. */ removeRole(options: Role): Collection; /** * Retrieves the status of the overseer job. * Adds 'action=OVERSEERSTATUS' to the list of parameters * and returns the current collection instance. * * @return {Collection} The current collection instance with the updated parameters. */ overseerStatus(): Collection; /** * Adds the 'action=CLUSTERSTATUS' parameter to the current instance's parameters * and returns the instance itself. * * @return {Collection} The current instance with the updated parameters. */ clusterStatus(): Collection; /** * Adds the status request action and request ID to the parameters list. * * @param {string} requestid - The ID of the request to check the status for. * @return {Collection} The updated Collection instance with added parameters. */ requestStatus(requestid: string): Collection; /** * Adds the 'action=LIST' parameter to the action list and returns the updated collection. * @return {Collection} The updated collection with the added 'action=LIST' parameter. */ list(): Collection; /** * Adds a replica property to the collection. * * @param {Object} options - The options for adding the replica property. * @param {string} options.collection - The name of the collection. * @param {string} options.shard - The name of the shard. * @param {string} options.replica - The name of the replica. * @param {string} options.property - The name of the property to add. * @param {*} options.propertyValue - The value of the property. * @param {boolean} [options.shardUnique] - Whether the property is shard unique. * @return {Collection} The current collection instance. */ addReplicaProp(options: AddReplicaProp): Collection; /** * Deletes a replica property from the specified collection and shard. * * @param {Object} options - The options for deleting the replica property. * @param {string} options.collection - The name of the collection. * @param {string} options.shard - The name of the shard. * @param {string} options.replica - The name of the replica. * @param {string} options.property - The name of the property to be deleted. * @return {Collection} The updated Collection object with the specified property removed from the replica. */ deleteReplicaProp(options: DeleteReplicaProp): Collection; /** * Balances the unique shards across the collection and applies the specified options. * * @param {Object} options - The options for balancing shards. * @param {string} options.collection - The name of the collection to balance. * @param {string} options.property - The property used for balancing the shards. * @param {boolean} options.onlyActiveNodes - Specify whether to balance only on active nodes. * @param {boolean} options.shardUnique - Flag to enforce shard uniqueness. * @return {Collection} Returns the modified Collection instance with balanced shards. */ balanceShardUnique(options: BalanceShardUnique): Collection; /** * Rebalances the leaders of the shards in a collection. * * @param {Object} options - Options for the rebalance operation. * @param {string} [options.collection] - The name of the collection to rebalance. * @param {number} [options.maxAtOnce] - Maximum number of leaders to rebalance at once. * @param {number} [options.maxWaitSeconds] - Maximum time in seconds to wait for each rebalance. * @return {Collection} The updated collection object. */ rebalanceLeaders(options: RebalanceLeaders): Collection; /** * Constructs a query string by joining the parameters with an '&' character. * * @return {string} The constructed query string. */ build(): string; }