diff --git a/README.md b/README.md index ee3cce68..170e1b56 100644 --- a/README.md +++ b/README.md @@ -883,6 +883,37 @@ console.log("Agent response:", llmResponse); if (llmResponse.status === "Done") console.log("Conversation finished.") ``` +#### Stream a Conversation Response +Stream the agent's response in real-time to provide immediate feedback to users. + +```javascript +const chat = store.ai.conversation(agent.identifier, "Performers/", { + parameters: {country: "France"} +}); + +// Register action handler +chat.handle("store-performer-details", async (req, performer) => { + const session = store.openSession(); + await session.store(performer); + await session.saveChanges(); + session.dispose(); + return {success: true}; +}); + +chat.setUserPrompt("Find the employee with largest profit and suggest rewards"); + +// Stream the "suggestedReward" property +let chunkedText = ""; +const answer = await chat.stream("suggestedReward", async (chunk) => { + // Called for each streamed chunk + chunkedText += chunk; +}); + +console.log("chunkedText", chunkedText); + +console.log("Final answer:", answer); +``` + ## Attachments #### Store attachments diff --git a/src/Documents/Operations/AI/Agents/AiAgentToolQuery.ts b/src/Documents/Operations/AI/Agents/AiAgentToolQuery.ts index 806edbf3..b6459fda 100644 --- a/src/Documents/Operations/AI/Agents/AiAgentToolQuery.ts +++ b/src/Documents/Operations/AI/Agents/AiAgentToolQuery.ts @@ -1,7 +1,10 @@ +import type { AiAgentToolQueryOptions } from "./AiAgentToolQueryOptions.js"; + export interface AiAgentToolQuery { name: string; description: string; query: string; parametersSampleObject?: string; // JSON example of parameters parametersSchema?: string; // JSON schema for parameters + options?: AiAgentToolQueryOptions; } diff --git a/src/Documents/Operations/AI/Agents/AiAgentToolQueryOptions.ts b/src/Documents/Operations/AI/Agents/AiAgentToolQueryOptions.ts new file mode 100644 index 00000000..268373bb --- /dev/null +++ b/src/Documents/Operations/AI/Agents/AiAgentToolQueryOptions.ts @@ -0,0 +1,25 @@ +/** + * Options for controlling when and how query tools are executed in AI agent conversations. + */ +export interface AiAgentToolQueryOptions { + /** + * When true, the model is allowed to execute this query on demand based on its own judgment. + * When false, the model cannot call this query (unless executed as part of initial context). + * When null/undefined, server-side defaults apply. + */ + allowModelQueries?: boolean; + + /** + * When true, the query will be executed during the initial context build and its results provided to the model. + * When false, the query will not be executed for the initial context. + * When null/undefined, server-side defaults apply. + * + * Notes: + * - The query must not require model-supplied parameters (it may use agent-scope parameters). + * - If only addToInitialContext is true and allowModelQueries is false, the query runs only + * during the initial context and is not callable by the model afterward. + * - If both addToInitialContext and allowModelQueries are true, the query will run during + * the initial context and may also be invoked later by the model (e.g., to fetch fresh data). + */ + addToInitialContext?: boolean; +} diff --git a/src/Documents/Operations/AI/Agents/RunConversationOperation.ts b/src/Documents/Operations/AI/Agents/RunConversationOperation.ts index 9cdb8e79..8b766e45 100644 --- a/src/Documents/Operations/AI/Agents/RunConversationOperation.ts +++ b/src/Documents/Operations/AI/Agents/RunConversationOperation.ts @@ -1,8 +1,10 @@ import { IMaintenanceOperation, OperationResultType } from "../../OperationAbstractions.js"; -import { Stream } from "node:stream"; +import { Readable, Stream } from "node:stream"; +import { createInterface } from "node:readline"; import type { AiAgentActionResponse } from "./AiAgentActionResponse.js"; import type { AiConversationCreationOptions } from "./AiConversationCreationOptions.js"; import type { ConversationResult } from "./ConversationResult.js"; +import type { AiStreamCallback } from "../AiStreamCallback.js"; import { RavenCommand } from "../../../../Http/RavenCommand.js"; import { DocumentConventions } from "../../../Conventions/DocumentConventions.js"; import { IRaftCommand } from "../../../../Http/IRaftCommand.js"; @@ -21,6 +23,8 @@ export class RunConversationOperation implements IMaintenanceOperation< private readonly _actionResponses?: AiAgentActionResponse[]; private readonly _options?: AiConversationCreationOptions; private readonly _changeVector?: string; + private readonly _streamPropertyPath?: string; + private readonly _streamCallback?: AiStreamCallback; public constructor( agentId: string, @@ -28,7 +32,9 @@ export class RunConversationOperation implements IMaintenanceOperation< userPrompt?: string, actionResponses?: AiAgentActionResponse[], options?: AiConversationCreationOptions, - changeVector?: string + changeVector?: string, + streamPropertyPath?: string, + streamCallback?: AiStreamCallback ) { if (StringUtil.isNullOrEmpty(agentId)) { throwError("InvalidArgumentException", "agentId cannot be null or empty."); @@ -36,12 +42,20 @@ export class RunConversationOperation implements IMaintenanceOperation< if (StringUtil.isNullOrEmpty(conversationId)) { throwError("InvalidArgumentException", "conversationId cannot be null or empty."); } + + // Both streamPropertyPath and streamCallback must be specified together or neither + if ((streamPropertyPath != null) !== (streamCallback != null)) { + throwError("InvalidOperationException", "Both streamPropertyPath and streamCallback must be specified together or neither."); + } + this._agentId = agentId; this._conversationId = conversationId; this._userPrompt = userPrompt; this._actionResponses = actionResponses; this._options = options; this._changeVector = changeVector; + this._streamPropertyPath = streamPropertyPath; + this._streamCallback = streamCallback; } public get resultType(): OperationResultType { @@ -56,7 +70,9 @@ export class RunConversationOperation implements IMaintenanceOperation< this._actionResponses, this._options, this._changeVector, - conventions + conventions, + this._streamPropertyPath, + this._streamCallback ); } } @@ -70,6 +86,8 @@ class RunConversationCommand private readonly _actionResponses?: AiAgentActionResponse[]; private readonly _options?: AiConversationCreationOptions; private readonly _changeVector?: string; + private readonly _streamPropertyPath?: string; + private readonly _streamCallback?: AiStreamCallback; private _raftId: string; public constructor( @@ -79,7 +97,9 @@ class RunConversationCommand actionResponses: AiAgentActionResponse[] | undefined, options: AiConversationCreationOptions | undefined, changeVector: string | undefined, - conventions: DocumentConventions + conventions: DocumentConventions, + streamPropertyPath?: string, + streamCallback?: AiStreamCallback ) { super(); this._conversationId = conversationId; @@ -88,6 +108,13 @@ class RunConversationCommand this._actionResponses = actionResponses; this._options = options; this._changeVector = changeVector; + this._streamPropertyPath = streamPropertyPath; + this._streamCallback = streamCallback; + + // When streaming is enabled, we need to handle raw response + if (this._streamPropertyPath && this._streamCallback) { + this._responseType = "Raw"; + } if (this._conversationId && this._conversationId.endsWith("|")) { this._raftId = RaftIdGenerator.newId(); @@ -112,12 +139,17 @@ class RunConversationCommand uriParams.append("changeVector", this._changeVector); } + if (this._streamPropertyPath) { + uriParams.append("streaming", "true"); + uriParams.append("streamPropertyPath", this._streamPropertyPath); + } + const uri = `${node.url}/databases/${node.database}/ai/agent?${uriParams}`; const bodyObj = { ActionResponses: this._actionResponses, UserPrompt: this._prompt, - CreationOptions: this._options + CreationOptions: this._options ?? {} }; const headers = this._headers().typeAppJson().build(); @@ -144,6 +176,43 @@ class RunConversationCommand this._throwInvalidResponse(); } - return this._parseResponseDefaultAsync(bodyStream) + if (this._streamPropertyPath && this._streamCallback) { + return await this._processStreamingResponse(bodyStream as Readable); + } + + return await this._parseResponseDefaultAsync(bodyStream); + } + + private async _processStreamingResponse(bodyStream: Readable): Promise { + const rl = createInterface({ + input: bodyStream, + crlfDelay: Infinity + }); + + for await (const line of rl) { + if (!line || line.trim().length === 0) { + continue; + } + + if (line.startsWith("{")) { + const jsonStream = Readable.from([line]); + let body: string = null; + this.result = await this._defaultPipeline(_ => body = _).process(jsonStream); + return body; + } + + try { + const unescaped = JSON.parse(line); + await this._streamCallback!(unescaped); + } catch (err) { + await this._streamCallback!(line); + } + } + + if (!this.result) { + throwError("InvalidOperationException", "No final result received in streaming response"); + } + + return null; } } \ No newline at end of file diff --git a/src/Documents/Operations/AI/Agents/index.ts b/src/Documents/Operations/AI/Agents/index.ts index f2049b77..36d7c65b 100644 --- a/src/Documents/Operations/AI/Agents/index.ts +++ b/src/Documents/Operations/AI/Agents/index.ts @@ -1,4 +1,5 @@ export * from "./GetAiAgentsOperation.js"; export * from "./AddOrUpdateAiAgentOperation.js"; export * from "./DeleteAiAgentOperation.js"; -export * from "./RunConversationOperation.js"; \ No newline at end of file +export * from "./RunConversationOperation.js"; +export * from "./AiAgentToolQueryOptions.js"; \ No newline at end of file diff --git a/src/Documents/Operations/AI/AiConversation.ts b/src/Documents/Operations/AI/AiConversation.ts index 16a0a81f..1bf43c71 100644 --- a/src/Documents/Operations/AI/AiConversation.ts +++ b/src/Documents/Operations/AI/AiConversation.ts @@ -4,7 +4,9 @@ import type { AiAgentActionResponse } from "./Agents/AiAgentActionResponse.js"; import type { AiConversationCreationOptions } from "./Agents/AiConversationCreationOptions.js"; import type { ConversationResult } from "./Agents/ConversationResult.js"; import type { AiAnswer } from "./AiAnswer.js"; +import type { AiStreamCallback } from "./AiStreamCallback.js"; import type { IDocumentStore } from "../../IDocumentStore.js"; +import type { UnhandledActionEventArgs } from "./UnhandledActionEventArgs.js"; import { throwError } from "../../../Exceptions/index.js"; import { StringUtil } from "../../../Utility/StringUtil.js"; @@ -26,6 +28,8 @@ export class AiConversation { private _userPrompt?: string; private readonly _invocations: Map = new Map(); + public onUnhandledAction?: (args: UnhandledActionEventArgs) => Promise | void; + public constructor(store: IDocumentStore, databaseName: string, agentId: string, conversationId: string, options?: AiConversationCreationOptions, changeVector?: string) { if (!store) throwError("InvalidArgumentException", "store is required"); if (StringUtil.isNullOrEmpty(databaseName)) throwError("InvalidArgumentException", "databaseName is required"); @@ -76,9 +80,43 @@ export class AiConversation { this._userPrompt = userPrompt; } - public handle(actionName: string, action: (request: AiAgentActionRequest, args: TArgs) => Promise | object, aiHandleError: AiHandleErrorStrategy = AiHandleErrorStrategy.SendErrorsToModel): void { + public handle( + actionName: string, + action: (args: TArgs) => Promise, + aiHandleError?: AiHandleErrorStrategy + ): void; + + public handle( + actionName: string, + action: (args: TArgs) => object, + aiHandleError?: AiHandleErrorStrategy + ): void; + + public handle( + actionName: string, + action: (request: AiAgentActionRequest, args: TArgs) => Promise, + aiHandleError?: AiHandleErrorStrategy + ): void; + + public handle( + actionName: string, + action: (request: AiAgentActionRequest, args: TArgs) => object, + aiHandleError?: AiHandleErrorStrategy + ): void + + public handle( + actionName: string, + action: ((args: TArgs) => Promise | object) | + ((request: AiAgentActionRequest, args: TArgs) => Promise | object), + aiHandleError: AiHandleErrorStrategy = AiHandleErrorStrategy.SendErrorsToModel + ) { + const wrappedAction = action.length === 1 + ? (_request: AiAgentActionRequest, args: TArgs) => + (action as (args: TArgs) => Promise | object)(args) + : action as (request: AiAgentActionRequest, args: TArgs) => Promise | object; + this.receive(actionName, async (req, args) => { - const result = await action(req, args); + const result = await wrappedAction(req, args); this.addActionResponse(req.toolId, result as any); }, aiHandleError); } @@ -118,6 +156,16 @@ export class AiConversation { const invocation = this._invocations.get(action.name); if (invocation) { await invocation(action); + } else if (this.onUnhandledAction) { + await this.onUnhandledAction({ + sender: this, + action: action + }); + } else { + throwError("InvalidOperationException", + `There is no action defined for action '${action.name}' on agent '${this._agentId}' (${this._conversationId}), ` + + `but it was invoked by the model with: ${action.arguments}. ` + + `Did you forget to call receive() or handle()? You can also handle unexpected action invocations using the onUnhandledAction event.`); } } @@ -127,7 +175,64 @@ export class AiConversation { } } - private async _runInternal(): Promise> { + /** + * Executes one "turn" of the conversation with streaming enabled. + * Streams the specified property's value in real-time by invoking the callback with each chunk. + * + * @param streamPropertyPath - The property path of the answer to stream (e.g., "suggestedReward") + * @param streamCallback - Callback invoked with each streamed chunk + * @returns A promise that resolves to the full answer after streaming completes + * + * @example + * ```typescript + * const answer = await chat.stream("propertyName", async (chunk) => { + * console.log("Received chunk:", chunk); + * }); + * ``` + */ + public async stream(streamPropertyPath: string, streamCallback: AiStreamCallback): Promise> { + if (StringUtil.isNullOrEmpty(streamPropertyPath)) { + throwError("InvalidArgumentException", "streamPropertyPath cannot be empty"); + } + if (!streamCallback) { + throwError("InvalidArgumentException", "streamCallback cannot be null"); + } + + // eslint-disable-next-line no-constant-condition + while (true) { + const r = await this._runInternal(streamPropertyPath, streamCallback); + if (r.status === "Done") { + return r; + } + + if (!this._actionRequests || this._actionRequests.length === 0) { + throwError("InvalidOperationException", `There are no action requests to process, but Status was ${r.status}, should not be possible.`); + } + + for (const action of this._actionRequests) { + const invocation = this._invocations.get(action.name); + if (invocation) { + await invocation(action); + } else if (this.onUnhandledAction) { + await this.onUnhandledAction({ + sender: this, + action: action + }); + } else { + throwError("InvalidOperationException", + `There is no action defined for action '${action.name}' on agent '${this._agentId}' (${this._conversationId}), ` + + `but it was invoked by the model with: ${action.arguments}. ` + + `Did you forget to call receive() or handle()? You can also handle unexpected action invocations using the onUnhandledAction event.`); + } + } + + if (this._actionResponses.length === 0) { + return r; // ActionsRequired, nothing to send back yet + } + } + } + + private async _runInternal(streamPropertyPath?: string, streamCallback?: AiStreamCallback): Promise> { if (this._actionRequests != null && !this._userPrompt && this._actionResponses.length === 0) { return {status: "Done" as const} as AiAnswer; } @@ -138,14 +243,17 @@ export class AiConversation { this._userPrompt, this._actionResponses, this._options, - this._changeVector + this._changeVector, + streamPropertyPath, + streamCallback ); try { - const res = await this._store.maintenance.forDatabase(this._databaseName).send(op) as unknown as ConversationResult; + const res = await this._store.maintenance.send(op); + this._changeVector = res.changeVector; this._conversationId = res.conversationId; - this._actionRequests = res.actionRequests ?? []; + this._actionRequests = res.actionRequests; return { answer: res.response, diff --git a/src/Documents/Operations/AI/AiStreamCallback.ts b/src/Documents/Operations/AI/AiStreamCallback.ts new file mode 100644 index 00000000..9a2f11d9 --- /dev/null +++ b/src/Documents/Operations/AI/AiStreamCallback.ts @@ -0,0 +1,8 @@ +/** + * Callback invoked with each streamed chunk from the AI agent response. + * The callback can be synchronous or asynchronous. + * + * @param chunk - The streamed text chunk from the specified property + * @returns A promise (for async callbacks) or void (for sync callbacks) + */ +export type AiStreamCallback = (chunk: string) => Promise | void; diff --git a/src/Documents/Operations/AI/ConnectionStrings/AiConnectionString.ts b/src/Documents/Operations/AI/ConnectionStrings/AiConnectionString.ts new file mode 100644 index 00000000..a45af657 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/AiConnectionString.ts @@ -0,0 +1,214 @@ +import { ConnectionString, ConnectionStringType } from "../../Etl/ConnectionString.js"; +import { AiConnectorType } from "./AiConnectorType.js"; +import { AiModelType } from "./AiModelType.js"; +import { AiSettingsCompareDifferences } from "./AiSettingsCompareDifferences.js"; +import { OpenAiSettings } from "./Settings/OpenAiSettings.js"; +import { AzureOpenAiSettings } from "./Settings/AzureOpenAiSettings.js"; +import { OllamaSettings } from "./Settings/OllamaSettings.js"; +import { EmbeddedSettings } from "./Settings/EmbeddedSettings.js"; +import { GoogleSettings } from "./Settings/GoogleSettings.js"; +import { HuggingFaceSettings } from "./Settings/HuggingFaceSettings.js"; +import { MistralAiSettings } from "./Settings/MistralAiSettings.js"; +import { VertexSettings } from "./Settings/VertexSettings.js"; + + +const PROVIDER_KEYS = [ + "openAiSettings", + "azureOpenAiSettings", + "ollamaSettings", + "embeddedSettings", + "googleSettings", + "huggingFaceSettings", + "mistralAiSettings", + "vertexSettings" +] as const; + +/** + * Represents an AI service connection string configuration. + * Supports multiple AI providers (OpenAI, Azure OpenAI, Ollama, Google, HuggingFace, Mistral AI, Vertex AI, Embedded). + * Only one provider can be configured per connection string. + */ +export class AiConnectionString extends ConnectionString { + public identifier?: string; + public openAiSettings?: OpenAiSettings; + public azureOpenAiSettings?: AzureOpenAiSettings; + public ollamaSettings?: OllamaSettings; + public embeddedSettings?: EmbeddedSettings; + public googleSettings?: GoogleSettings; + public huggingFaceSettings?: HuggingFaceSettings; + public mistralAiSettings?: MistralAiSettings; + public vertexSettings?: VertexSettings; + public modelType?: AiModelType; + public type: ConnectionStringType = "Ai" + + /** + * Validates the connection string configuration. + * Ensures exactly one AI provider is configured and all provider-specific fields are valid. + * @returns Array of validation error messages (empty if valid) + */ + public validate(): string[] { + const errors: string[] = []; + + const allSettings = PROVIDER_KEYS + .map(key => this[key]) + .filter(Boolean); + + for (const setting of allSettings) { + setting.validate(errors); + } + + if (allSettings.length === 0) { + errors.push(`At least one of the following settings must be set: ${PROVIDER_KEYS.join(", ")}`); + } else if (allSettings.length > 1) { + const configuredSettingsNames = PROVIDER_KEYS.filter( + key => Boolean(this[key]) + ); + errors.push(`Only one of the following settings can be set: ${configuredSettingsNames.join(", ")}`); + } + + return errors; + } + + /** + * Gets the type of the active AI provider. + * @returns The connector type of the configured provider, or "None" if none configured + */ + public getActiveProvider(): AiConnectorType { + if (this.openAiSettings) return "OpenAi"; + if (this.azureOpenAiSettings) return "AzureOpenAi"; + if (this.ollamaSettings) return "Ollama"; + if (this.embeddedSettings) return "Embedded"; + if (this.googleSettings) return "Google"; + if (this.huggingFaceSettings) return "HuggingFace"; + if (this.mistralAiSettings) return "MistralAi"; + if (this.vertexSettings) return "Vertex"; + return "None"; + } + + /** + * Gets the active provider settings instance. + * @returns The configured provider settings, or undefined if none configured + */ + public getActiveProviderInstance() { + return this.openAiSettings ?? + this.azureOpenAiSettings ?? + this.ollamaSettings ?? + this.embeddedSettings ?? + this.googleSettings ?? + this.huggingFaceSettings ?? + this.mistralAiSettings ?? + this.vertexSettings; + } + + /** + * Compares this connection string with another to detect differences. + * @param newConnectionString The connection string to compare with + * @returns Flags indicating which settings differ + */ + public compare(newConnectionString: AiConnectionString | null | undefined): AiSettingsCompareDifferences { + if (!newConnectionString) { + return AiSettingsCompareDifferences.All; + } + + let result = AiSettingsCompareDifferences.None; + + if (this.identifier !== newConnectionString.identifier) { + result |= AiSettingsCompareDifferences.Identifier; + } + + if (this.modelType !== newConnectionString.modelType) { + result |= AiSettingsCompareDifferences.ModelArchitecture; + } + + const oldProvider = this.getActiveProvider(); + const newProvider = newConnectionString.getActiveProvider(); + + if (oldProvider !== newProvider) { + return AiSettingsCompareDifferences.All; + } + + const oldInstance = this.getActiveProviderInstance(); + const newInstance = newConnectionString.getActiveProviderInstance(); + + if (!oldInstance || !newInstance) { + return AiSettingsCompareDifferences.All; + } + + result |= oldInstance.compare(newInstance); + + return result; + } + + /** + * Checks if this connection string is equal to another. + * @param connectionString The connection string to compare with + * @returns true if the connection strings are equal, false otherwise + */ + public isEqual(connectionString: ConnectionString): boolean { + if (!(connectionString instanceof AiConnectionString)) { + return false; + } + + if (this.name !== connectionString.name) { + return false; + } + + if (this.identifier !== connectionString.identifier) { + return false; + } + + if (this.modelType !== connectionString.modelType) { + return false; + } + + const activeProvider = this.getActiveProvider(); + const otherActiveProvider = connectionString.getActiveProvider(); + + if (activeProvider !== otherActiveProvider) { + return false; + } + + return this.compare(connectionString) === AiSettingsCompareDifferences.None; + } + + /** + * Checks if the connection uses an encrypted communication channel (HTTPS). + * @returns true if the connection is encrypted, false otherwise + */ + public usingEncryptedCommunicationChannel(): boolean { + const aiConnectorType = this.getActiveProvider(); + + switch (aiConnectorType) { + case "Ollama": + return this.ollamaSettings?.uri?.startsWith("https") ?? false; + case "OpenAi": + return this.openAiSettings?.endpoint?.startsWith("https") ?? false; + case "AzureOpenAi": + return this.azureOpenAiSettings?.endpoint?.startsWith("https") ?? false; + case "MistralAi": + return this.mistralAiSettings?.endpoint?.startsWith("https") ?? false; + case "HuggingFace": + // Endpoint is optional for HuggingFace, default endpoint is HTTPS + return !this.huggingFaceSettings?.endpoint || + this.huggingFaceSettings.endpoint.startsWith("https"); + case "Embedded": + case "Google": + case "Vertex": + return true; + default: + throw new Error(`Unknown AI connector type: ${aiConnectorType}`); + } + } + + /** + * Gets the maximum number of concurrent query embedding batches for this connection. + * @param globalQueryEmbeddingsMaxConcurrentBatches The global default value + * @returns The connection-specific value, or the global default if not set + */ + public getQueryEmbeddingsMaxConcurrentBatches( + globalQueryEmbeddingsMaxConcurrentBatches: number + ): number { + const provider = this.getActiveProviderInstance(); + return provider?.embeddingsMaxConcurrentBatches ?? globalQueryEmbeddingsMaxConcurrentBatches; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/AiConnectorType.ts b/src/Documents/Operations/AI/ConnectionStrings/AiConnectorType.ts new file mode 100644 index 00000000..312dfe9d --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/AiConnectorType.ts @@ -0,0 +1,10 @@ +export type AiConnectorType = + | "None" + | "OpenAi" + | "AzureOpenAi" + | "Ollama" + | "Embedded" + | "Google" + | "HuggingFace" + | "MistralAi" + | "Vertex"; diff --git a/src/Documents/Operations/AI/ConnectionStrings/AiModelType.ts b/src/Documents/Operations/AI/ConnectionStrings/AiModelType.ts new file mode 100644 index 00000000..8a1456e0 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/AiModelType.ts @@ -0,0 +1,3 @@ +export type AiModelType = + | "TextEmbeddings" + | "Chat"; diff --git a/src/Documents/Operations/AI/ConnectionStrings/AiSettingsCompareDifferences.ts b/src/Documents/Operations/AI/ConnectionStrings/AiSettingsCompareDifferences.ts new file mode 100644 index 00000000..159c2272 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/AiSettingsCompareDifferences.ts @@ -0,0 +1,14 @@ +/** + * Flags enum for detecting differences between AI settings configurations. + * Uses bitwise operations for combining multiple differences. + */ +export enum AiSettingsCompareDifferences { + None = 0, + AuthenticationSettings = 1 << 0, // 1 + EndpointConfiguration = 1 << 1, // 2 + ModelArchitecture = 1 << 2, // 4 + EmbeddingDimensions = 1 << 3, // 8 + DeploymentConfiguration = 1 << 4, // 16 + Identifier = 1 << 5, // 32 + All = ~(~0 << 6) // 63 (all bits set) +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/AbstractAiSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/AbstractAiSettings.ts new file mode 100644 index 00000000..5a0f00b7 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/AbstractAiSettings.ts @@ -0,0 +1,25 @@ +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; + +/** + * Base class for all AI provider settings. + */ +export abstract class AbstractAiSettings { + /** + * Maximum number of query embedding batches that can be processed concurrently. + * Allows users to override the database global value. + */ + public embeddingsMaxConcurrentBatches?: number; + + /** + * Validates the settings fields and adds any errors to the provided array. + * @param errors Array to collect validation error messages + */ + public abstract validate(errors: string[]): void; + + /** + * Compares this settings instance with another to detect differences. + * @param other The other settings instance to compare with + * @returns Flags indicating which settings differ + */ + public abstract compare(other: AbstractAiSettings): AiSettingsCompareDifferences; +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/AzureOpenAiSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/AzureOpenAiSettings.ts new file mode 100644 index 00000000..1180fe66 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/AzureOpenAiSettings.ts @@ -0,0 +1,43 @@ +import { OpenAiBaseSettings } from "./OpenAiBaseSettings.js"; +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +export class AzureOpenAiSettings extends OpenAiBaseSettings { + /** + * Azure OpenAI deployment name. + * Learn more: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource + */ + public constructor( + apiKey: string, + endpoint: string, + model: string, + public deploymentName: string, + dimensions?: number, + temperature?: number + ) { + super(apiKey, endpoint, model, dimensions, temperature); + } + + public validate(errors: string[]): void { + super.validate(errors); + + if (StringUtil.isNullOrEmpty(this.deploymentName?.trim())) { + errors.push("Value for 'deploymentName' field cannot be empty."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof AzureOpenAiSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = super.compare(other); + + if (this.deploymentName !== other.deploymentName) { + differences |= AiSettingsCompareDifferences.DeploymentConfiguration; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/EmbeddedSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/EmbeddedSettings.ts new file mode 100644 index 00000000..3e7943e6 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/EmbeddedSettings.ts @@ -0,0 +1,19 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; + +/** + * Settings for embedded AI models (placeholder for future implementation). + */ +export class EmbeddedSettings extends AbstractAiSettings { + public validate(errors: string[]): void { + // nothing to validate. + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (other instanceof EmbeddedSettings) { + return AiSettingsCompareDifferences.None; + } + + return AiSettingsCompareDifferences.All; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/GoogleSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/GoogleSettings.ts new file mode 100644 index 00000000..088149e0 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/GoogleSettings.ts @@ -0,0 +1,84 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * Represents the version of the Google AI API. + */ +export type GoogleAIVersion = + | "V1" + | "V1_Beta"; + +/** + * Settings for Google AI service. + */ +export class GoogleSettings extends AbstractAiSettings { + /** + * The model that should be used. + */ + public model: string; + + /** + * The API key to use to authenticate with the service. + */ + public apiKey: string; + + /** + * The version of Google AI to use. + */ + public aiVersion?: GoogleAIVersion; + + /** + * The number of dimensions that the model should use. + */ + public dimensions?: number; + + public constructor( + model: string, + apiKey: string, + aiVersion?: GoogleAIVersion, + dimensions?: number + ) { + super(); + this.model = model; + this.apiKey = apiKey; + this.aiVersion = aiVersion; + this.dimensions = dimensions; + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.apiKey)) { + errors.push("Value of 'apiKey' field cannot be empty."); + } + + if (this.dimensions != null && this.dimensions <= 0) { + errors.push("Value of 'dimensions' field must be positive."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof GoogleSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.model !== other.model || this.aiVersion !== other.aiVersion) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.apiKey !== other.apiKey) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + if (this.dimensions !== other.dimensions) { + differences |= AiSettingsCompareDifferences.EmbeddingDimensions; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/HuggingFaceSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/HuggingFaceSettings.ts new file mode 100644 index 00000000..6395b630 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/HuggingFaceSettings.ts @@ -0,0 +1,62 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * Settings for HuggingFace service. + */ +export class HuggingFaceSettings extends AbstractAiSettings { + /** + * The name of the Hugging Face model. + */ + public model: string; + + /** + * The endpoint for the text embedding generation service. If not specified, the default endpoint will be used. + */ + public endpoint?: string; + + /** + * The API key required for accessing the Hugging Face service. + */ + public apiKey: string; + + public constructor(apiKey: string, model: string, endpoint?: string) { + super(); + this.model = model; + this.endpoint = endpoint; + this.apiKey = apiKey; + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.apiKey)) { + errors.push("Value of 'apiKey' field cannot be empty."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof HuggingFaceSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.model !== other.model) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.endpoint !== other.endpoint) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + if (this.apiKey !== other.apiKey) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/IAiSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/IAiSettings.ts new file mode 100644 index 00000000..9e1bf676 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/IAiSettings.ts @@ -0,0 +1,9 @@ +/** + * Interface for AI settings with common properties across providers. + */ +export interface IAiSettings { + apiKey?: string; + model: string; + endpoint?: string; + getBaseEndpointUri(): string; +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/MistralAiSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/MistralAiSettings.ts new file mode 100644 index 00000000..bbe7c780 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/MistralAiSettings.ts @@ -0,0 +1,66 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * Settings for Mistral AI service. + */ +export class MistralAiSettings extends AbstractAiSettings { + /** + * The model ID for the Mistral AI service. + */ + public model: string; + + /** + * The endpoint for the Mistral AI service. + */ + public endpoint: string; + + /** + * The API key required for accessing the Mistral AI service. + */ + public apiKey: string; + + public constructor(model: string, apiKey: string, endpoint: string) { + super(); + this.model = model; + this.endpoint = endpoint; + this.apiKey = apiKey; + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.endpoint)) { + errors.push("Value of 'endpoint' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.apiKey)) { + errors.push("Value of 'apiKey' field cannot be empty."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof MistralAiSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.model !== other.model) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.endpoint !== other.endpoint) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + if (this.apiKey !== other.apiKey) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/OllamaSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/OllamaSettings.ts new file mode 100644 index 00000000..3dd3c019 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/OllamaSettings.ts @@ -0,0 +1,85 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * The configuration for the Ollama API client. + */ +export class OllamaSettings extends AbstractAiSettings { + /** + * The URI of the Ollama API. + */ + public uri: string; + + /** + * The model that should be used. + */ + public model: string; + + /** + * Controls whether thinking models engage their reasoning process before responding. + * When true, thinking models will perform their internal reasoning process (uses more tokens, slower, better quality for complex tasks). + * When false, thinking models skip the reasoning process and respond directly (fewer tokens, faster, may reduce quality for complex reasoning). + * When undefined, the parameter is not sent (backwards compatible). + * Disable thinking for speed/efficiency in simple tasks, enable for complex tasks requiring reasoning. + */ + public think?: boolean; + + /** + * Controls randomness of the model output. Range typically [0.0, 2.0]. + * Higher values (e.g., 1.0+) make output more creative and diverse; lower values (e.g., 0.2) make it more deterministic. + * When undefined, the parameter is not sent. + */ + public temperature?: number; + + public constructor(uri: string, model: string) { + super(); + this.uri = uri; + this.model = model; + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.uri)) { + errors.push("Value of 'uri' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (this.temperature != null && this.temperature < 0) { + errors.push("Value of 'temperature' field must be non-negative."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof OllamaSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.model !== other.model) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.uri !== other.uri) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + if (this.think !== other.think) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + const hasTemperature = this.temperature != null; + const otherHasTemperature = other.temperature != null; + + if (hasTemperature !== otherHasTemperature || + (hasTemperature && otherHasTemperature && + Math.abs(this.temperature - other.temperature) > 0.0001)) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiBaseSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiBaseSettings.ts new file mode 100644 index 00000000..b48de2de --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiBaseSettings.ts @@ -0,0 +1,117 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { IAiSettings } from "./IAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * Base settings for OpenAI-compatible providers. + */ +export abstract class OpenAiBaseSettings extends AbstractAiSettings implements IAiSettings { + /** + * The API key to use to authenticate with the service. + */ + public apiKey: string; + + /** + * The service endpoint that the client will send requests to. + */ + public endpoint: string; + + /** + * The model that should be used. + */ + public model: string; + + /** + * The number of dimensions that the model should use. + */ + public dimensions?: number; + + /** + * Controls randomness of the model output. Range typically [0.0, 2.0]. + * Higher values (e.g., 1.0+) make output more creative and diverse; + * lower values (e.g., 0.2) make it more deterministic. + * When undefined, the parameter is not sent. + */ + public temperature?: number; + + protected constructor( + apiKey: string, + endpoint: string, + model: string, + dimensions?: number, + temperature?: number + ) { + super(); + this.apiKey = apiKey; + this.endpoint = endpoint; + this.model = model; + this.dimensions = dimensions; + this.temperature = temperature; + } + + public getBaseEndpointUri(): string { + let endpoint = this.endpoint; + if (!endpoint.endsWith("/")) { + endpoint += "/"; + } + return endpoint; + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.apiKey)) { + errors.push("Value of 'apiKey' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.endpoint)) { + errors.push("Value of 'endpoint' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (this.dimensions != null && this.dimensions <= 0) { + errors.push("Value of 'dimensions' field must be positive."); + } + + if (this.temperature != null && this.temperature < 0) { + errors.push("Value of 'temperature' field must be non-negative."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof OpenAiBaseSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.apiKey !== other.apiKey) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + if (this.endpoint !== other.endpoint) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + if (this.model !== other.model) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.dimensions !== other.dimensions) { + differences |= AiSettingsCompareDifferences.EmbeddingDimensions; + } + + const hasTemperature = this.temperature != null; + const otherHasTemperature = other.temperature != null; + + if (hasTemperature !== otherHasTemperature || + (hasTemperature && otherHasTemperature && + Math.abs(this.temperature - other.temperature) > 0.0001)) { + differences |= AiSettingsCompareDifferences.EndpointConfiguration; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiSettings.ts new file mode 100644 index 00000000..0aefc181 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/OpenAiSettings.ts @@ -0,0 +1,66 @@ +import { OpenAiBaseSettings } from "./OpenAiBaseSettings.js"; +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; + +/** + * The configuration for the OpenAI API client. + */ +export class OpenAiSettings extends OpenAiBaseSettings { + /** + * The value to use for the OpenAI-Organization request header. Users who belong to multiple organizations + * can set this value to specify which organization is used for an API request. Usage from these API requests will + * count against the specified organization's quota. If not set, the header will be omitted, and the default + * organization will be billed. You can change your default organization in your user settings. + * Learn more: https://platform.openai.com/docs/guides/production-best-practices/setting-up-your-organization + */ + public organizationId?: string; + + /** + * The value to use for the OpenAI-Project request header. Users who are accessing their projects through + * their legacy user API key can set this value to specify which project is used for an API request. Usage from + * these API requests will count as usage for the specified project. If not set, the header will be omitted, and + * the default project will be accessed. + */ + public projectId?: string; + + private static readonly OPENAI_BASE_URI = "https://api.openai.com/"; + + public constructor( + apiKey: string, + endpoint: string, + model: string, + organizationId?: string, + projectId?: string, + dimensions?: number, + temperature?: number + ) { + super(apiKey, endpoint, model, dimensions, temperature); + this.organizationId = organizationId; + this.projectId = projectId; + } + + public getBaseEndpointUri(): string { + const uri = super.getBaseEndpointUri(); + + if (uri === OpenAiSettings.OPENAI_BASE_URI) { + return uri + "v1/"; + } + + return uri; + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof OpenAiSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = super.compare(other); + + if (this.organizationId !== other.organizationId || + this.projectId !== other.projectId) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/Settings/VertexSettings.ts b/src/Documents/Operations/AI/ConnectionStrings/Settings/VertexSettings.ts new file mode 100644 index 00000000..18819e8f --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/Settings/VertexSettings.ts @@ -0,0 +1,116 @@ +import { AbstractAiSettings } from "./AbstractAiSettings.js"; +import { AiSettingsCompareDifferences } from "../AiSettingsCompareDifferences.js"; +import { throwError } from "../../../../../Exceptions/index.js"; +import { StringUtil } from "../../../../../Utility/StringUtil.js"; + +/** + * Represents the version of the Vertex AI API. + */ +export type VertexAIVersion = + | "V1" + | "V1_Beta"; + +/** + * Settings for Google Vertex AI service. + */ +export class VertexSettings extends AbstractAiSettings { + /** + * The model ID for the Vertex AI service. + */ + public model: string; + + /** + * The Google Cloud service account credentials in JSON format. + */ + public googleCredentialsJson: string; + + /** + * The version of Vertex AI to use. + */ + public aiVersion?: VertexAIVersion; + + /** + * The Google Cloud region/location for the Vertex AI service. + */ + public location: string; + + public constructor( + model: string, + googleCredentialsJson: string, + location: string, + aiVersion?: VertexAIVersion + ) { + super(); + this.model = model; + this.googleCredentialsJson = googleCredentialsJson; + this.location = location; + this.aiVersion = aiVersion; + } + + /** + * Extracts the project ID from the Google credentials JSON. + */ + public getProjectId(): string { + try { + const credentials = JSON.parse(this.googleCredentialsJson); + const projectId = credentials.project_id; + + if (!projectId) { + throwError("InvalidArgumentException", + "Couldn't find project_id in the provided googleCredentialsJson."); + } + + return projectId; + } catch (e) { + if (e.name === "InvalidArgumentException") { + throw e; + } + throwError("InvalidArgumentException", + `Failed to parse googleCredentialsJson: ${e.message}`); + } + } + + public validate(errors: string[]): void { + if (StringUtil.isNullOrWhitespace(this.model)) { + errors.push("Value of 'model' field cannot be empty."); + } + + if (StringUtil.isNullOrWhitespace(this.googleCredentialsJson)) { + errors.push("Value of 'googleCredentialsJson' field cannot be empty."); + } else { + try { + if (StringUtil.isNullOrWhitespace(this.getProjectId())) { + errors.push("Value of 'project_id' field in 'googleCredentialsJson' cannot be empty."); + } + } catch (e) { + errors.push(`Invalid 'googleCredentialsJson': ${e.message}`); + } + } + + if (StringUtil.isNullOrWhitespace(this.location)) { + errors.push("Value of 'location' field cannot be empty."); + } + } + + public compare(other: AbstractAiSettings): AiSettingsCompareDifferences { + if (!(other instanceof VertexSettings)) { + return AiSettingsCompareDifferences.All; + } + + let differences = AiSettingsCompareDifferences.None; + + if (this.model !== other.model || this.aiVersion !== other.aiVersion) { + differences |= AiSettingsCompareDifferences.ModelArchitecture; + } + + if (this.googleCredentialsJson !== other.googleCredentialsJson) { + differences |= AiSettingsCompareDifferences.AuthenticationSettings; + } + + if (this.location !== other.location) { + differences |= AiSettingsCompareDifferences.DeploymentConfiguration; + } + + return differences; + } +} diff --git a/src/Documents/Operations/AI/ConnectionStrings/index.ts b/src/Documents/Operations/AI/ConnectionStrings/index.ts new file mode 100644 index 00000000..c6a29490 --- /dev/null +++ b/src/Documents/Operations/AI/ConnectionStrings/index.ts @@ -0,0 +1,15 @@ +export * from "./AiConnectionString.js"; +export * from "./AiConnectorType.js"; +export * from "./AiModelType.js"; +export * from "./AiSettingsCompareDifferences.js"; +export * from "./Settings/AbstractAiSettings.js"; +export * from "./Settings/IAiSettings.js"; +export * from "./Settings/OpenAiBaseSettings.js"; +export * from "./Settings/OpenAiSettings.js"; +export * from "./Settings/AzureOpenAiSettings.js"; +export * from "./Settings/OllamaSettings.js"; +export * from "./Settings/GoogleSettings.js"; +export * from "./Settings/HuggingFaceSettings.js"; +export * from "./Settings/MistralAiSettings.js"; +export * from "./Settings/VertexSettings.js"; +export * from "./Settings/EmbeddedSettings.js"; diff --git a/src/Documents/Operations/AI/UnhandledActionEventArgs.ts b/src/Documents/Operations/AI/UnhandledActionEventArgs.ts new file mode 100644 index 00000000..4f58c050 --- /dev/null +++ b/src/Documents/Operations/AI/UnhandledActionEventArgs.ts @@ -0,0 +1,7 @@ +import type { AiConversation } from "./AiConversation.js"; +import type { AiAgentActionRequest } from "./Agents/AiAgentActionRequest.js"; + +export interface UnhandledActionEventArgs { + sender: AiConversation; + action: AiAgentActionRequest; +} diff --git a/src/Documents/Operations/AI/index.ts b/src/Documents/Operations/AI/index.ts new file mode 100644 index 00000000..21f7188c --- /dev/null +++ b/src/Documents/Operations/AI/index.ts @@ -0,0 +1,7 @@ +export * from "./AiConversation.js"; +export * from "./AiConversationResult.js"; +export * from "./AiAnswer.js" +export * from "./AiOperations.js" +export * from "./AiStreamCallback.js"; +export * from "./UnhandledActionEventArgs.js"; +export * from "./ConnectionStrings/index.js"; diff --git a/src/Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.ts b/src/Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.ts index c2451406..7e5a10ed 100644 --- a/src/Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.ts +++ b/src/Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.ts @@ -6,6 +6,7 @@ import { RavenConnectionString, OlapConnectionString, ElasticSearchConnectionString, QueueConnectionString } from "../Etl/ConnectionString.js"; +import { AiConnectionString } from "../AI/ConnectionStrings/AiConnectionString.js"; import { DocumentConventions } from "../../Conventions/DocumentConventions.js"; import { OperationResultType, IMaintenanceOperation } from "../OperationAbstractions.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; @@ -17,6 +18,7 @@ export interface GetConnectionStringsResult { olapConnectionStrings: Record; elasticSearchConnectionStrings: Record; queueConnectionStrings: Record; + aiConnectionStrings: Record; } export class GetConnectionStringsOperation implements IMaintenanceOperation { @@ -114,6 +116,14 @@ export class GetConnectionStringCommand extends RavenCommand); } + if (this.result.aiConnectionStrings) { + this.result.aiConnectionStrings = Object.entries(this.result.aiConnectionStrings) + .reduce(((previousValue, currentValue) => { + previousValue[currentValue[0]] = Object.assign(new AiConnectionString(), currentValue[1]); + return previousValue; + }), {} as Record); + } + return body; } } diff --git a/src/Documents/Operations/Etl/ConnectionString.ts b/src/Documents/Operations/Etl/ConnectionString.ts index 7474b893..0dbb06e4 100644 --- a/src/Documents/Operations/Etl/ConnectionString.ts +++ b/src/Documents/Operations/Etl/ConnectionString.ts @@ -13,7 +13,8 @@ export type ConnectionStringType = | "Sql" | "Olap" | "ElasticSearch" - | "Queue"; + | "Queue" + | "Ai"; export type QueueBrokerType = "None" diff --git a/src/ServerWide/Operations/DatabaseRecordBuilder.ts b/src/ServerWide/Operations/DatabaseRecordBuilder.ts index 789583cc..bd09765d 100644 --- a/src/ServerWide/Operations/DatabaseRecordBuilder.ts +++ b/src/ServerWide/Operations/DatabaseRecordBuilder.ts @@ -43,6 +43,7 @@ import { TypeUtil } from "../../Utility/TypeUtil.js"; import { ShardingConfiguration } from "../Sharding/ShardingConfiguration.js"; import { IShardTopologyConfigurationBuilder } from "./Builder/IShardTopologyConfigurationBuilder.js"; import { ITopologyConfigurationBuilder } from "./Builder/ITopologyConfigurationBuilder.js"; +import { AiConnectionString } from "../../Documents/Operations/AI/index.js"; export class DatabaseRecordBuilder implements IDatabaseRecordBuilderInitializer, IDatabaseRecordBuilder, @@ -128,6 +129,16 @@ export class DatabaseRecordBuilder implements IDatabaseRecordBuilderInitializer, return this; } + addAiConnectionString(connectionString: AiConnectionString): this { + if (!connectionString) { + throw new Error("ConnectionString cannot be null"); + } + + this._databaseRecord.aiConnectionStrings ??= {}; + this._databaseRecord.aiConnectionStrings[connectionString.name] = connectionString; + return this; + } + regular(databaseName: string): IDatabaseRecordBuilder { this._withName(databaseName); return this; diff --git a/src/ServerWide/index.ts b/src/ServerWide/index.ts index 42dddd2f..0c32ad41 100644 --- a/src/ServerWide/index.ts +++ b/src/ServerWide/index.ts @@ -33,6 +33,7 @@ import { QueueEtlConfiguration } from "../Documents/Operations/Etl/Queue/QueueEt import { DataArchivalConfiguration } from "../Documents/Operations/DataArchival/DataArchivalConfiguration.js"; import { QueueSinkConfiguration } from "../Documents/Operations/QueueSink/QueueSinkConfiguration.js"; import { ShardingConfiguration } from "./Sharding/ShardingConfiguration.js"; +import { AiConnectionString } from "../Documents/Operations/AI/index.js"; export interface ScriptResolver { script: string; @@ -79,6 +80,7 @@ export interface DatabaseRecord { olapConnectionStrings?: { [key: string]: OlapConnectionString }; elasticSearchConnectionStrings?: { [key: string]: ElasticSearchConnectionString }; queueConnectionStrings?: { [key: string]: QueueConnectionString }; + aiConnectionStrings?: { [key: string]: AiConnectionString }; ravenEtls?: RavenEtlConfiguration[]; sqlEtls?: SqlEtlConfiguration[]; elasticSearchEtls?: ElasticSearchEtlConfiguration[]; diff --git a/src/index.ts b/src/index.ts index 74833f8c..815b76aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,798 +1,799 @@ -export { DocumentConventions } from "./Documents/Conventions/DocumentConventions.js"; -export { BulkInsertConventions } from "./Documents/Conventions/BulkInsertConventions.js"; -export type { RavenErrorType } from "./Exceptions/index.js"; -export * from "./Types/index.js"; - -// HTTP -export * from "./Http/AggressiveCacheOptions.js"; -export * from "./Http/ClusterRequestExecutor.js"; -export * from "./Http/ClusterTopology.js"; -export * from "./Http/CurrentIndexAndNode.js"; -export * from "./Http/CurrentIndexAndNodeAndEtag.js"; -export * from "./Http/IBroadcast.js"; -export * from "./Http/IRaftCommand.js"; -export * from "./Http/NodeSelector.js"; -export * from "./Http/LoadBalanceBehavior.js"; -export * from "./Http/HttpCompressionAlgorithm.js"; -export * from "./Http/RavenCommand.js"; -export * from "./Http/ReadBalanceBehavior.js"; -export * from "./Http/RequestExecutor.js"; -export * from "./Http/ServerNode.js"; -export * from "./Http/StatusCode.js"; -export * from "./Http/Topology.js"; -export * from "./Http/UriUtility.js"; -export * from "./Http/UpdateTopologyParameters.js"; - -export * from "./Utility/ObjectUtil.js"; - -// SERVERWIDE -export * from "./ServerWide/index.js"; -export * from "./ServerWide/CompactSettings.js"; -export * from "./ServerWide/Tcp/LicensedFeatures.js"; -export * from "./Documents/Operations/Etl/ConnectionString.js"; -export * from "./ServerWide/ModifyOnGoingTaskResult.js"; -export * from "./ServerWide/DocumentsCompressionConfiguration.js"; -export * from "./ServerWide/DeletionInProgressStatus.js"; -export * from "./ServerWide/IDatabaseTaskStatus.js"; -export * from "./ServerWide/Operations/BuildNumber.js"; -export * from "./ServerWide/Operations/Builder/IBackupConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IConnectionStringConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilder.js"; -export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilderBase.js"; -export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilderInitializer.js"; -export * from "./ServerWide/Operations/Builder/IEtlConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IIntegrationConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IOrchestratorTopologyConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IReplicationConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IShardedDatabaseRecordBuilder.js"; -export * from "./ServerWide/Operations/Builder/IShardedTopologyConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/IShardTopologyConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/ITopologyConfigurationBuilder.js"; -export * from "./ServerWide/Operations/Builder/ITopologyConfigurationBuilderBase.js"; -export * from "./ServerWide/Operations/DatabaseRecordBuilder.js"; - -export * from "./ServerWide/Operations/GetBuildNumberOperation.js"; -export * from "./ServerWide/Operations/ReorderDatabaseMembersOperation.js"; -export * from "./ServerWide/Operations/ConfigureRevisionsForConflictsOperation.js"; -export * from "./ServerWide/Operations/UpdateDatabaseOperation.js"; -export * from "./ServerWide/Operations/Configuration/GetServerWideBackupConfigurationOperation.js"; -export * from "./ServerWide/Operations/SetDatabaseDynamicDistributionOperation.js"; -export * from "./ServerWide/Operations/UpdateUnusedDatabasesOperation.js"; - -// SERVERWIDE OPERATIONS -export * from "./ServerWide/Operations/index.js"; -export * from "./ServerWide/Operations/DeleteDatabasesOperation.js"; -export * from "./ServerWide/Operations/GetDatabaseNamesOperation.js"; -export * from "./ServerWide/Operations/GetServerWideOperationStateOperation.js"; -export * from "./ServerWide/Operations/ServerWideOperationCompletionAwaiter.js"; -export * from "./ServerWide/Operations/Certificates/CertificateMetadata.js"; -export * from "./ServerWide/Operations/Certificates/EditClientCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/ReplaceClusterCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/GetCertificateMetadataOperation.js"; -export * from "./ServerWide/Operations/Certificates/GetCertificatesMetadataOperation.js"; -export * from "./ServerWide/Operations/Configuration/GetServerWideClientConfigurationOperation.js"; -export * from "./ServerWide/Operations/Configuration/PutServerWideClientConfigurationOperation.js"; -export * from "./ServerWide/Operations/Logs/GetLogsConfigurationResult.js"; -export * from "./ServerWide/Operations/Logs/GetLogsConfigurationOperation.js"; -export * from "./ServerWide/Operations/Logs/LogMode.js"; -export * from "./ServerWide/Operations/Logs/SetLogsConfigurationOperation.js"; -export * from "./ServerWide/Operations/Configuration/GetServerWideClientConfigurationOperation.js"; -export * from "./ServerWide/Operations/Configuration/GetServerWideBackupConfigurationsOperation.js"; -export * from "./ServerWide/Operations/Configuration/PutServerWideBackupConfigurationOperation.js"; -export * from "./ServerWide/Operations/Configuration/ServerWideBackupConfiguration.js"; -export * from "./ServerWide/Operations/Configuration/DatabaseSettings.js"; -export * from "./ServerWide/Operations/Configuration/GetDatabaseSettingsOperation.js"; -export * from "./ServerWide/Operations/Configuration/PutDatabaseSettingsOperation.js"; - -export type { OrchestratorTopology } from "./ServerWide/OrchestratorTopology.js"; -export { GetDatabaseTopologyCommand } from "./ServerWide/Commands/GetDatabaseTopologyCommand.js"; -export { GetClusterTopologyCommand } from "./ServerWide/Commands/GetClusterTopologyCommand.js"; -export { GetTcpInfoCommand } from "./ServerWide/Commands/GetTcpInfoCommand.js"; -export type { NodeInfo } from "./ServerWide/Commands/NodeInfo.js"; -export { GetNodeInfoCommand } from "./ServerWide/Commands/GetNodeInfoCommand.js"; -export { AddClusterNodeCommand } from "./ServerWide/Commands/Cluster/AddClusterNodeCommand.js"; -export { CreateDatabaseOperation } from "./ServerWide/Operations/CreateDatabaseOperation.js"; -export type { DatabaseRecord, ConflictSolver, ScriptResolver } from "./ServerWide/index.js"; -export * from "./ServerWide/Operations/ModifyConflictSolverOperation.js"; -export * from "./Documents/Operations/Etl/ConnectionString.js"; - -// OPERATIONS AND COMMANDS -export { BulkInsertOperation } from "./Documents/BulkInsertOperation.js"; -export type { IAttachmentsBulkInsert, ICountersBulkInsert, ITimeSeriesBulkInsert, ITypedTimeSeriesBulkInsert } from "./Documents/BulkInsertOperation.js"; -export * from "./Documents/BulkInsert/BulkInsertOptions.js"; -export type { BulkInsertProgress } from "./Documents/Operations/BulkInsertProgress.js"; -export type { CollectionDetails } from "./Documents/Operations/CollectionDetails.js"; -export * from "./Documents/Operations/Backups/BackupConfiguration.js"; -export * from "./Documents/Operations/Backups/DelayBackupOperation.js"; -export * from "./Documents/Operations/Backups/BackupTaskType.js"; -export { DatabaseHealthCheckOperation } from "./Documents/Operations/DatabaseHealthCheckOperation.js"; -export type { DetailedCollectionStatistics } from "./Documents/Operations/DetailedCollectionStatistics.js"; -export { GetEssentialStatisticsOperation } from "./Documents/Operations/GetEssentialStatisticsOperation.js"; -export { GetDetailedCollectionStatisticsOperation } from "./Documents/Operations/GetDetailedCollectionStatisticsOperation.js"; -export * from "./Documents/Operations/OperationAbstractions.js"; -export { CompactDatabaseOperation } from "./Documents/Operations/CompactDatabaseOperation.js"; -export { PutConnectionStringOperation } from "./Documents/Operations/ConnectionStrings/PutConnectionStringOperation.js"; -export type { PutConnectionStringResult } from "./Documents/Operations/ConnectionStrings/PutConnectionStringOperation.js"; -export { PatchOperation } from "./Documents/Operations/PatchOperation.js"; -export { DeleteSorterOperation } from "./Documents/Operations/Sorters/DeleteSorterOperation.js"; -export { PutSortersOperation } from "./Documents/Operations/Sorters/PutSortersOperation.js"; -export { PatchByQueryOperation } from "./Documents/Operations/PatchByQueryOperation.js"; -export { - PutCompareExchangeValueOperation -} - from "./Documents/Operations/CompareExchange/PutCompareExchangeValueOperation.js"; -export { - GetCompareExchangeValueOperation -} - from "./Documents/Operations/CompareExchange/GetCompareExchangeValueOperation.js"; -export { - CompareExchangeResult -} - from "./Documents/Operations/CompareExchange/CompareExchangeResult.js"; -export { - CompareExchangeValue -} - from "./Documents/Operations/CompareExchange/CompareExchangeValue.js"; -export { - CompareExchangeValueResultParser -} - from "./Documents/Operations/CompareExchange/CompareExchangeValueResultParser.js"; -export { GetCompareExchangeValuesOperation } from "./Documents/Operations/CompareExchange/GetCompareExchangeValuesOperation.js"; -export type { GetCompareExchangeValuesParameters } from "./Documents/Operations/CompareExchange/GetCompareExchangeValuesOperation.js"; -export { - DeleteCompareExchangeValueOperation -} - from "./Documents/Operations/CompareExchange/DeleteCompareExchangeValueOperation.js"; -export { - CompareExchangeSessionValue -} - from "./Documents/Operations/CompareExchange/CompareExchangeSessionValue.js"; -export { - CompareExchangeValueJsonConverter -} - from "./Documents/Operations/CompareExchange/CompareExchangeValueJsonConverter.js"; -export type { - CompareExchangeValueState -} - from "./Documents/Operations/CompareExchange/CompareExchangeValueState.js"; -export type { - ICompareExchangeValue -} - from "./Documents/Operations/CompareExchange/ICompareExchangeValue.js"; -export { DeleteByQueryOperation } from "./Documents/Operations/DeleteByQueryOperation.js"; -export { GetCollectionStatisticsOperation } from "./Documents/Operations/GetCollectionStatisticsOperation.js"; -export type { CollectionStatistics } from "./Documents/Operations/CollectionStatistics.js"; -export type { GetServerWideExternalReplicationsResponse } from "./Documents/Operations/GetServerWideExternalReplicationsResponse.js"; -export { CreateSubscriptionCommand } from "./Documents/Commands/CreateSubscriptionCommand.js"; -export { SingleNodeBatchCommand } from "./Documents/Commands/Batches/SingleNodeBatchCommand.js"; -export { GetNextOperationIdCommand } from "./Documents/Commands/GetNextOperationIdCommand.js"; -export { KillOperationCommand } from "./Documents/Commands/KillOperationCommand.js"; -export { DeleteDocumentCommand } from "./Documents/Commands/DeleteDocumentCommand.js"; -export { NextIdentityForCommand } from "./Documents/Commands/NextIdentityForCommand.js"; -export { SeedIdentityForCommand } from "./Documents/Commands/SeedIdentityForCommand.js"; -export { ExplainQueryCommand } from "./Documents/Commands/ExplainQueryCommand.js"; -export { GetIdentitiesOperation } from "./Documents/Operations/Identities/GetIdentitiesOperation.js"; -export { GetStatisticsOperation, GetStatisticsCommand } from "./Documents/Operations/GetStatisticsOperation.js"; -export type { DatabaseStatistics } from "./Documents/Operations/DatabaseStatistics.js"; -export { GetOperationStateOperation } from "./Documents/Operations/GetOperationStateOperation.js"; -export type { IndexInformation } from "./Documents/Operations/IndexInformation.js"; -export type { IndexOptimizeResult } from "./Documents/Operations/IndexOptimizeResult.js"; -export { PatchResultBase } from "./Documents/Operations/PatchResultBase.js"; -export { MaintenanceOperationExecutor } from "./Documents/Operations/MaintenanceOperationExecutor.js"; -export { OperationCompletionAwaiter } from "./Documents/Operations/OperationCompletionAwaiter.js"; -export type { ClientConfiguration } from "./Documents/Operations/Configuration/ClientConfiguration.js"; -export { GetClientConfigurationOperation } from "./Documents/Operations/Configuration/GetClientConfigurationOperation.js"; -export { PutClientConfigurationOperation } from "./Documents/Operations/Configuration/PutClientConfigurationOperation.js"; -export { PutDocumentCommand } from "./Documents/Commands/PutDocumentCommand.js"; -export { GetIndexNamesOperation } from "./Documents/Operations/Indexes/GetIndexNamesOperation.js"; -export { DeleteIndexErrorsOperation } from "./Documents/Operations/Indexes/DeleteIndexErrorsOperation.js"; -export { DisableIndexOperation } from "./Documents/Operations/Indexes/DisableIndexOperation.js"; -export { EnableIndexOperation } from "./Documents/Operations/Indexes/EnableIndexOperation.js"; -export { GetIndexingStatusOperation } from "./Documents/Operations/Indexes/GetIndexingStatusOperation.js"; -export { GetIndexesStatisticsOperation } from "./Documents/Operations/Indexes/GetIndexesStatisticsOperation.js"; -export { GetIndexStatisticsOperation } from "./Documents/Operations/Indexes/GetIndexStatisticsOperation.js"; -export { GetIndexesOperation } from "./Documents/Operations/Indexes/GetIndexesOperation.js"; -export { GetTermsOperation } from "./Documents/Operations/Indexes/GetTermsOperation.js"; -export { IndexHasChangedOperation } from "./Documents/Operations/Indexes/IndexHasChangedOperation.js"; -export { PutIndexesOperation } from "./Documents/Operations/Indexes/PutIndexesOperation.js"; -export { StopIndexingOperation } from "./Documents/Operations/Indexes/StopIndexingOperation.js"; -export { StartIndexingOperation } from "./Documents/Operations/Indexes/StartIndexingOperation.js"; -export { StopIndexOperation } from "./Documents/Operations/Indexes/StopIndexOperation.js"; -export { StartIndexOperation } from "./Documents/Operations/Indexes/StartIndexOperation.js"; -export { ResetIndexOperation } from "./Documents/Operations/Indexes/ResetIndexOperation.js"; -export { DeleteIndexOperation } from "./Documents/Operations/Indexes/DeleteIndexOperation.js"; -export type { GetServerWideBackupConfigurationsResponse } from "./Documents/Operations/GetServerWideBackupConfigurationsResponse.js"; -export { NextIdentityForOperation } from "./Documents/Operations/Identities/NextIdentityForOperation.js"; -export { SeedIdentityForOperation } from "./Documents/Operations/Identities/SeedIdentityForOperation.js"; -export type { IOperationProgress } from "./Documents/Operations/IOperationProgress.js"; -export type { IOperationResult } from "./Documents/Operations/IOperationResult.js"; -export { - UpdateExternalReplicationOperation -} - from "./Documents/Operations/Replication/UpdateExternalReplicationOperation.js"; -export type { - PullReplicationDefinitionAndCurrentConnections -} from "./Documents/Operations/Replication/PullReplicationDefinitionAndCurrentConnections.js"; -export { - PutPullReplicationAsHubOperation -} from "./Documents/Operations/Replication/PutPullReplicationAsHubOperation.js"; -export * from "./Documents/Operations/Replication/DetailedReplicationHubAccess.js"; -export * from "./Documents/Operations/Replication/GetReplicationHubAccessOperation.js"; -export * from "./Documents/Operations/Replication/IExternalReplication.js"; -export * from "./Documents/Operations/Replication/PreventDeletionsMode.js"; -export * from "./Documents/Operations/Replication/PullReplicationMode.js"; -export * from "./Documents/Operations/Replication/RegisterReplicationHubAccessOperation.js"; -export * from "./Documents/Operations/Replication/ReplicationHubAccess.js"; -export * from "./Documents/Operations/Replication/ReplicationHubAccessResult.js"; -export * from "./Documents/Operations/Replication/ReplicationHubAccessResponse.js"; -export * from "./Documents/Operations/Replication/UnregisterReplicationHubAccessOperation.js"; -export { - UpdatePullReplicationAsSinkOperation -} from "./Documents/Operations/Replication/UpdatePullReplicationAsSinkOperation.js"; -export { GetConflictsCommand } from "./Documents/Commands/GetConflictsCommand.js"; -export { SetIndexesLockOperation } from "./Documents/Operations/Indexes/SetIndexesLockOperation.js"; -export type { SetIndexesLockOperationParameters } from "./Documents/Operations/Indexes/SetIndexesLockOperation.js"; -export { SetIndexesPriorityOperation } from "./Documents/Operations/Indexes/SetIndexesPriorityOperation.js"; -export type { SetIndexesPriorityOperationParameters } from "./Documents/Operations/Indexes/SetIndexesPriorityOperation.js"; -export * from "./Documents/Operations/PatchRequest.js"; -export * from "./Documents/Operations/GetDetailedStatisticsOperation.js"; -export * from "./Documents/Commands/Batches/BatchOptions.js"; -export * from "./Documents/Commands/Batches/DeleteAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/PatchCommandData.js"; -export * from "./Documents/Commands/Batches/PutAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/PutAttachmentCommandHelper.js"; -export * from "./Documents/Commands/CommandData.js"; -export * from "./ServerWide/Operations/GetDatabaseRecordOperation.js"; -export * from "./Documents/SetupDocumentBase.js"; -export * from "./Documents/Commands/StreamResultResponse.js"; -export * from "./Documents/Commands/StreamResult.js"; -export * from "./Documents/Session/Operations/BatchOperation.js"; -export * from "./Documents/Session/Operations/GetRevisionOperation.js"; -export * from "./Documents/Session/Operations/GetRevisionsCountOperation.js"; -export * from "./Documents/Lazy.js"; -export * from "./Documents/Session/Operations/Lazy/IEagerSessionOperations.js"; -export * from "./Documents/Session/Operations/Lazy/ILazyOperation.js"; -export * from "./Documents/Session/Operations/Lazy/ILazySessionOperations.js"; -export * from "./Documents/Session/Operations/Lazy/LazyAggregationQueryOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyLoadOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyQueryOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazySessionOperations.js"; -export * from "./Documents/Session/Operations/Lazy/LazyStartsWithOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazySuggestionQueryOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyClusterTransactionOperations.js"; -export * from "./Documents/Session/Operations/Lazy/LazyGetCompareExchangeValueOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyGetCompareExchangeValuesOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyConditionalLoadOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyRevisionOperation.js"; -export * from "./Documents/Session/Operations/Lazy/LazyRevisionOperations.js"; -export * from "./Documents/Session/Operations/LoadOperation.js"; -export * from "./Documents/Session/Operations/LoadStartingWithOperation.js"; -export * from "./Documents/Session/Operations/MultiGetOperation.js"; -export * from "./Documents/Session/Operations/QueryOperation.js"; -export * from "./Documents/Session/Operations/StreamOperation.js"; -export * from "./Documents/Operations/DataArchival/DataArchivalConfiguration.js"; -export * from "./Documents/Operations/DataArchival/ConfigureDataArchivalOperation.js"; -export * from "./Documents/Operations/DataArchival/ConfigureDataArchivalOperationResult.js"; -export * from "./Documents/Operations/Attachments/DeleteAttachmentOperation.js"; -export * from "./Documents/Operations/Attachments/PutAttachmentOperation.js"; -export * from "./Documents/Operations/PatchResult.js"; -export * from "./Documents/Operations/PatchStatus.js"; -export * from "./Documents/Operations/Revisions/ConfigureRevisionsOperation.js"; -export * from "./Documents/Operations/Revisions/GetRevisionsOperation.js"; -export * from "./Documents/Operations/Revisions/RevisionsResult.js"; -export * from "./Documents/Operations/RevisionsCollectionConfiguration.js"; -export * from "./Documents/Operations/RevisionsConfiguration.js"; -export * from "./Documents/Operations/DetailedDatabaseStatistics.js"; -export * from "./Documents/Operations/SessionOperationExecutor.js"; -export * from "./Documents/Operations/Configuration/StudioConfiguration.js"; -export * from "./Documents/Operations/Configuration/StudioEnvironment.js"; -export * from "./Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.js"; -export * from "./Documents/Operations/ConnectionStrings/RemoveConnectionStringOperation.js"; -export * from "./Documents/Operations/QueueSink/QueueSinkConfiguration.js"; -export * from "./Documents/Operations/QueueSink/AddQueueSinkOperation.js"; -export * from "./Documents/Operations/QueueSink/QueueSinkScript.js"; -export * from "./Documents/Operations/QueueSink/UpdateQueueSinkOperation.js"; -export * from "./Documents/Operations/QueueSink/AddQueueSinkOperationResult.js"; -export * from "./Documents/Operations/Etl/Queue/EtlQueue.js"; -export * from "./Documents/Operations/Etl/Queue/QueueEtlConfiguration.js"; -export * from "./Documents/Operations/Etl/Queue/KafkaConnectionSettings.js"; -export * from "./Documents/Operations/Etl/Queue/RabbitMqConnectionSettings.js"; -export * from "./Documents/Operations/Etl/ElasticSearch/ElasticSearchIndex.js"; -export * from "./Documents/Operations/Etl/ElasticSearch/ElasticSearchEtlConfiguration.js"; -export * from "./Documents/Operations/Etl/EtlConfiguration.js"; -export * from "./Documents/Operations/Etl/RavenEtlConfiguration.js"; -export * from "./Documents/Operations/Etl/Sql/SqlEtlConfiguration.js"; -export * from "./Documents/Operations/Etl/Sql/SqlEtlTable.js"; -export * from "./Documents/Operations/Etl/Olap/OlapEtlConfiguration.js"; -export * from "./Documents/Operations/Etl/Olap/OlapEtlFileFormat.js"; -export * from "./Documents/Operations/Etl/Olap/OlapEtlTable.js"; -export * from "./Documents/Operations/Etl/Transformation.js"; -export * from "./Documents/Operations/Expiration/ExpirationConfiguration.js"; -export * from "./Documents/Operations/Replication/PullReplicationAsSink.js"; -export * from "./Documents/Operations/Replication/PullReplicationDefinition.js"; -export * from "./Documents/Operations/Etl/AddEtlOperation.js"; -export * from "./Documents/Operations/Etl/UpdateEtlOperation.js"; -export * from "./Documents/Operations/Etl/ResetEtlOperation.js"; -export * from "./Documents/Operations/DisableDatabaseToggleResult.js"; -export * from "./Documents/Operations/Expiration/ConfigureExpirationOperation.js"; -export * from "./Documents/Operations/OngoingTasks/DeleteOngoingTaskOperation.js"; -export * from "./Documents/Operations/OngoingTasks/GetPullReplicationHubTasksInfoOperation.js"; -export * from "./Documents/Operations/OngoingTasks/OngoingTaskPullReplicationAsSink.js"; -export * from "./Documents/Operations/OngoingTasks/OngoingTaskPullReplicationAsHub.js"; -export * from "./Documents/Operations/OngoingTasks/OngoingTaskType.js"; -export * from "./Documents/Operations/OngoingTasks/RunningBackup.js"; -export * from "./Documents/Operations/OngoingTasks/OngoingTask.js"; -export * from "./Documents/Operations/OngoingTasks/NextBackup.js"; -export * from "./Documents/Operations/GetOngoingTaskInfoOperation.js"; -export * from "./Documents/Operations/OngoingTasks/ToggleOngoingTaskStateOperation.js"; -export * from "./Documents/Operations/Refresh/ConfigureRefreshOperation.js"; -export * from "./Documents/Operations/Refresh/RefreshConfiguration.js"; -export * from "./Documents/Operations/Refresh/ConfigureRefreshOperationResult.js"; -export * from "./Documents/Operations/ToggleDatabasesStateOperation.js"; -export * from "./Documents/Operations/TransactionsRecording/StartTransactionsRecordingOperation.js"; -export * from "./Documents/Operations/TransactionsRecording/StopTransactionsRecordingOperation.js"; - -// AI -export * from "./Documents/Operations/AI/Agents/index.js"; - -// BACKUP -export * from "./Documents/Operations/Backups/AmazonSettings.js"; -export * from "./Documents/Operations/Backups/AzureSettings.js"; -export * from "./Documents/Operations/Backups/BackupEncryptionSettings.js"; -export * from "./Documents/Operations/Backups/BackupEncryptionSettings.js"; -export * from "./Documents/Operations/Backups/Enums.js"; -export * from "./Documents/Operations/Backups/FtpSettings.js"; -export * from "./Documents/Operations/Backups/GlacierSettings.js"; -export * from "./Documents/Operations/Backups/LocalSettings.js"; -export * from "./Documents/Operations/Backups/PeriodicBackupConfiguration.js"; -export * from "./Documents/Operations/Backups/S3Settings.js"; -export * from "./Documents/Operations/Backups/BackupSettings.js"; -export * from "./Documents/Operations/Backups/BackupStatus.js"; -export * from "./Documents/Operations/Backups/GetPeriodicBackupStatusOperation.js"; -export * from "./Documents/Operations/Backups/GetPeriodicBackupStatusOperationResult.js"; -export * from "./Documents/Operations/Backups/LastRaftIndex.js"; -export * from "./Documents/Operations/Backups/PeriodicBackupStatus.js"; -export * from "./Documents/Operations/Backups/RestoreBackupConfiguration.js"; -export * from "./Documents/Operations/Backups/RestoreBackupOperation.js"; -export * from "./Documents/Operations/Backups/StartBackupOperation.js"; -export * from "./Documents/Operations/Backups/StartBackupOperationResult.js"; -export * from "./Documents/Operations/Backups/UpdatePeriodicBackupOperation.js"; -export * from "./Documents/Operations/Backups/UpdatePeriodicBackupOperationResult.js"; -export * from "./Documents/Operations/Backups/UploadProgress.js"; -export * from "./Documents/Operations/Backups/UploadState.js"; -export * from "./Documents/Operations/Backups/CompressionLevel.js"; -export * from "./Documents/Operations/Backups/GetBackupConfigurationScript.js"; -export * from "./Documents/Operations/Backups/GoogleCloudSettings.js"; -export * from "./Documents/Operations/Backups/RestoreBackupConfigurationBase.js"; -export * from "./Documents/Operations/Backups/RestoreFromAzureConfiguration.js"; -export * from "./Documents/Operations/Backups/RestoreFromGoogleCloudConfiguration.js"; -export * from "./Documents/Operations/Backups/RestoreFromS3Configuration.js"; -export * from "./Documents/Operations/Backups/RestoreType.js"; -export * from "./Documents/Operations/Backups/RetentionPolicy.js"; -export * from "./Documents/Operations/Backups/Sharding/GetShardedPeriodicBackupStatusOperation.js"; -export * from "./Documents/Operations/Backups/Sharding/ShardedRestoreSettings.js"; -export * from "./Documents/Operations/Backups/Sharding/SingleShardRestoreSetting.js"; - -// INDEXES -export { GetIndexOperation } from "./Documents/Operations/Indexes/GetIndexOperation.js"; -export { GetIndexErrorsOperation } from "./Documents/Operations/Indexes/GetIndexErrorsOperation.js"; -export * from "./Documents/Indexes/Enums.js"; -export * from "./Documents/Indexes/IndexDeploymentMode.js"; -export * from "./Documents/Indexes/IndexDefinition.js"; -export * from "./Documents/Indexes/AbstractCommonApiForIndexes.js"; -export * from "./Documents/Indexes/AbstractIndexDefinitionBuilder.js"; -export * from "./Documents/Indexes/IAbstractIndexCreationTask.js"; -export * from "./Documents/Indexes/IndexCreation.js"; -export * from "./Documents/Indexes/Errors.js"; -export * from "./Documents/Indexes/LuceneIndexInputType.js"; -export * from "./Documents/Indexes/AdditionalAssembly.js"; -export * from "./Documents/Indexes/IndexDefinitionHelper.js"; -export * from "./Documents/Indexes/IndexFieldOptions.js"; -export * from "./Documents/Indexes/Spatial.js"; -export * from "./Documents/Indexes/IndexingStatus.js"; -export * from "./Documents/Indexes/RollingIndex.js"; -export * from "./Documents/Indexes/RollingIndexDeployment.js"; -export * from "./Documents/Indexes/RollingIndexState.js"; -export * from "./Documents/Indexes/IndexStats.js"; -export * from "./Documents/Indexes/IndexSourceType.js"; -export * from "./Documents/Indexes/index.js"; -export * from "./Documents/Indexes/StronglyTyped.js"; -export * from "./Documents/Indexes/IndexDefinitionBase.js"; -export * from "./Documents/Indexes/Analysis/AnalyzerDefinition.js"; -export * from "./Documents/Indexes/AbstractCsharpIndexCreationTask.js"; -export * from "./Documents/Indexes/AbstractCsharpMultiMapIndexCreationTask.js"; -export * from "./Documents/Indexes/AbstractJavaScriptIndexCreationTask.js"; -export * from "./Documents/Indexes/BaseJavaScriptIndexCreationTask.js"; -export * from "./Documents/Indexes/AbstractJavaScriptMultiMapIndexCreationTask.js"; -export * from "./Documents/Indexes/AbstractRawJavaScriptIndexCreationTask.js"; -export * from "./Documents/Indexes/AutoIndexDefinition.js"; -export * from "./Documents/Indexes/AutoIndexFieldOptions.js"; -export * from "./Documents/Indexes/Spatial/AutoSpatialOptions.js"; -export * from "./Documents/Indexes/Counters/AbstractGenericCountersIndexCreationTask.js"; -export * from "./Documents/Indexes/Counters/AbstractCsharpCountersIndexCreationTask.js"; -export * from "./Documents/Indexes/Counters/AbstractMultiMapCountersIndexCreationTask.js"; -export * from "./Documents/Indexes/Counters/AbstractRawJavaScriptCountersIndexCreationTask.js"; -export * from "./Documents/Indexes/Counters/CountersIndexDefinition.js"; -export * from "./Documents/Indexes/Counters/CountersIndexDefinitionBuilder.js"; -export * from "./Documents/Indexes/TimeSeries/AbstractGenericTimeSeriesIndexCreationTask.js"; -export * from "./Documents/Indexes/TimeSeries/AbstractMultiMapTimeSeriesIndexCreationTask.js"; -export * from "./Documents/Indexes/TimeSeries/AbstractCsharpTimeSeriesIndexCreationTask.js"; -export * from "./Documents/Indexes/TimeSeries/AbstractRawJavaScriptTimeSeriesIndexCreationTask.js"; -export * from "./Documents/Indexes/TimeSeries/TimeSeriesIndexDefinition.js"; -export * from "./Documents/Indexes/TimeSeries/TimeSeriesIndexDefinitionBuilder.js"; -// VECTOR SEARCH -export * from "./Documents/Queries/VectorSearch/VectorQuantizer.js" -export * from "./Utility/VectorSearchUtil.js" - -// REPLICATION -export * from "./Documents/Replication/ExternalReplication.js"; -export * from "./Documents/Replication/ReplicationNode.js"; -export * from "./Documents/Replication/ExternalReplicationBase.js"; - -// STORE -export * from "./Documents/DocumentAbstractions.js"; -export * from "./Documents/DocumentStore.js"; -export * from "./Documents/DocumentStoreBase.js"; -export * from "./Documents/IDocumentStore.js"; -export * from "./Documents/IdTypeAndName.js"; - -// SUBSCRIPTIONS -export * from "./Documents/Subscriptions/SubscriptionBatchBase.js"; -export * from "./Documents/Subscriptions/SubscriptionBatch.js"; -export * from "./Documents/Subscriptions/DocumentSubscriptions.js"; -export * from "./Documents/Subscriptions/SubscriptionWorker.js"; -export * from "./Documents/Subscriptions/SubscriptionWorkerOptions.js"; -export * from "./Documents/Subscriptions/SubscriptionCreationOptions.js"; -export * from "./Documents/Subscriptions/Revision.js"; -export * from "./Documents/Subscriptions/SubscriptionState.js"; -export * from "./Documents/Subscriptions/SubscriptionCreationOptions.js"; -export * from "./Documents/Subscriptions/UpdateSubscriptionResult.js"; -export * from "./Documents/Subscriptions/SubscriptionOpeningStrategy.js"; -export * from "./Documents/Subscriptions/SubscriptionUpdateOptions.js"; - -// SESSION -export * from "./Documents/Session/AbstractDocumentQuery.js"; -export * from "./Documents/Session/CmpXchg.js"; -export * from "./Documents/Session/DocumentInfo.js"; -export * from "./Documents/Session/DocumentQuery.js"; -export * from "./Documents/Session/DocumentQueryHelper.js"; -export * from "./Documents/Session/DocumentsById.js"; -export * from "./Documents/Session/DocumentsChanges.js"; -export * from "./Documents/Session/DocumentSession.js"; -export * from "./Documents/Session/EntityToJson.js"; -export * from "./Documents/Session/ForceRevisionStrategy.js"; -export * from "./Documents/Session/GroupByDocumentQuery.js"; -export * from "./Documents/Session/GroupByField.js"; -export * from "./Documents/Session/IAbstractDocumentQuery.js"; -export * from "./Documents/Session/ISessionDocumentIncrementalTimeSeries.js"; -export * from "./Documents/Session/ISessionDocumentTypedIncrementalTimeSeries.js"; -export * from "./Documents/Session/IAbstractDocumentQueryImpl.js"; -export * from "./Documents/Session/ILazyRevisionsOperations.js"; -export * from "./Documents/Session/IAdvancedSessionOperations.js"; -export * from "./Documents/Session/IDocumentQuery.js"; -export * from "./Documents/Session/IDocumentQueryBase.js"; -export * from "./Documents/Session/IDocumentQueryBuilder.js"; -export * from "./Documents/Session/IDocumentQueryBaseSingle.js"; -export * from "./Documents/Session/IDocumentSession.js"; -export * from "./Documents/Session/IEnumerableQuery.js"; -export * from "./Documents/Session/IFilterDocumentQueryBase.js"; -export * from "./Documents/Session/IGroupByDocumentQuery.js"; -export * from "./Documents/Session/IncludesUtil.js"; -export * from "./Documents/Session/InMemoryDocumentSessionOperations.js"; -export * from "./Documents/Session/IQueryBase.js"; -export * from "./Documents/Session/IRawDocumentQuery.js"; -export * from "./Documents/Session/MethodCall.js"; -export * from "./Documents/Session/OrderingType.js"; -export * from "./Documents/Session/QueryEvents.js"; -export * from "./Documents/Session/QueryOptions.js"; -export * from "./Documents/Session/QueryStatistics.js"; -export * from "./Documents/Session/StreamQueryStatistics.js"; -export * from "./Documents/Session/RawDocumentQuery.js"; -export * from "./Documents/Session/SessionEvents.js"; -export * from "./Documents/Session/WhereParams.js"; -export * from "./Documents/Session/ILazyClusterTransactionOperations.js"; -export * from "./Documents/Session/ISessionDocumentAppendTimeSeriesBase.js"; -export * from "./Documents/Session/ISessionDocumentDeleteTimeSeriesBase.js"; -export * from "./Documents/Session/ISessionDocumentRollupTypedAppendTimeSeriesBase.js"; -export * from "./Documents/Session/ISessionDocumentRollupTypedTimeSeries.js"; -export * from "./Documents/Session/ISessionDocumentTimeSeries.js"; -export * from "./Documents/Session/ISessionDocumentTypedAppendTimeSeriesBase.js"; -export * from "./Documents/Session/ISessionDocumentTypedTimeSeries.js"; -export * from "./Documents/Session/JavaScriptMap.js"; -export * from "./Documents/Session/IMetadataDictionary.js"; -export type { MetadataAsDictionary } from "./Mapping/MetadataAsDictionary.js"; -export * from "./Documents/Session/DocumentResultStream.js"; -export * from "./Documents/Session/SessionDocumentRollupTypedTimeSeries.js"; -export * from "./Documents/Session/SessionDocumentTimeSeries.js"; -export * from "./Documents/Session/SessionDocumentTypedTimeSeries.js"; -export * from "./Documents/Session/SessionTimeSeriesBase.js"; -export * from "./Documents/Session/Loaders/ICounterIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IAbstractTimeSeriesIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/ICompareExchangeValueIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IDocumentIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IGenericIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IGenericRevisionIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IGenericTimeSeriesIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/ISubscriptionIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/ISubscriptionTimeSeriesIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/TimeSeriesIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/SubscriptionIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/ILazyLoaderWithInclude.js"; -export * from "./Documents/Session/Loaders/ILoaderWithInclude.js"; -export * from "./Documents/Session/Loaders/ITimeSeriesIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/LazyMultiLoaderWithInclude.js"; -export * from "./Documents/Session/Loaders/MultiLoaderWithInclude.js"; -export * from "./Documents/Session/DocumentQueryCustomization.js"; -export * from "./Documents/Session/DocumentSessionAttachments.js"; -export * from "./Documents/Session/DocumentSessionAttachmentsBase.js"; -export * from "./Documents/Session/DocumentSessionRevisions.js"; -export * from "./Documents/Session/DocumentSessionRevisionsBase.js"; -export * from "./Documents/Session/IAttachmentsSessionOperations.js"; -export * from "./Documents/Session/IDocumentQueryCustomization.js"; -export * from "./Documents/Session/IRevisionsSessionOperations.js"; -export * from "./Documents/Session/ResponseTimeInformation.js"; -export * from "./Documents/Session/MetadataObject.js"; -export * from "./Documents/Session/TransactionMode.js"; -export * from "./Documents/Session/ConditionalLoadResult.js"; -export * from "./Documents/Session/IClusterTransactionOperations.js"; -export * from "./Documents/Session/ISessionDocumentCounters.js"; -export * from "./Documents/Session/ClusterTransactionOperations.js"; -export * from "./Documents/Session/CounterInternalTypes.js"; -export * from "./Documents/Session/Loaders/IIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IncludeBuilder.js"; -export * from "./Documents/Session/Loaders/IncludeBuilderBase.js"; -export * from "./Documents/Session/Loaders/IQueryIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/QueryIncludeBuilder.js"; -export * from "./Documents/Session/Loaders/QueryIncludeBuilder.js"; -export * from "./Documents/Session/Operations/BatchCommandResult.js"; -export * from "./Documents/Session/SessionDocumentCounters.js"; -export * from "./Documents/Session/TimeSeries/TimeSeriesEntry.js"; -export * from "./Documents/Session/TimeSeries/TimeSeriesValue.js"; -export * from "./Documents/Session/TimeSeries/TimeSeriesValuesHelper.js"; -export * from "./Documents/Session/TimeSeries/TypedTimeSeriesEntry.js"; -export * from "./Documents/Session/TimeSeries/TypedTimeSeriesRollupEntry.js"; -export * from "./Documents/TimeSeries/TimeSeriesOperations.js"; - -// BATCH -export * from "./Documents/Commands/StreamResult.js"; -export * from "./Documents/Session/SessionOptions.js"; -export * from "./Documents/Commands/CommandData.js"; -export * from "./Documents/Commands/GetRevisionsBinEntryCommand.js"; -export * from "./Documents/Commands/GetDocumentsCommand.js"; -export * from "./Documents/Commands/Batches/CopyAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/DeleteAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/MoveAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/PutAttachmentCommandData.js"; -export * from "./Documents/Commands/Batches/BatchPatchCommandData.js"; -export * from "./Documents/Commands/Batches/CountersBatchCommandData.js"; -export * from "./Documents/Commands/Batches/PatchCommandData.js"; -export * from "./Documents/Commands/Batches/PutCompareExchangeCommandData.js"; -export * from "./Documents/Commands/Batches/DeleteCompareExchangeCommandData.js"; - -export * from "./Documents/Lazy.js"; - -// COUNTERS -export { CounterBatch } from "./Documents/Operations/Counters/CounterBatch.js"; -export { GetCountersOperation } from "./Documents/Operations/Counters/GetCountersOperation.js"; -export { CounterBatchOperation } from "./Documents/Operations/Counters/CounterBatchOperation.js"; -export type { CounterOperationType } from "./Documents/Operations/Counters/CounterOperationType.js"; -export { CounterOperation } from "./Documents/Operations/Counters/CounterOperation.js"; -export { DocumentCountersOperation } from "./Documents/Operations/Counters/DocumentCountersOperation.js"; -export * from "./Documents/Operations/Counters/CounterDetail.js"; -export * from "./Documents/Operations/Counters/CountersDetail.js"; - -// TIME SERIES -export type { AggregationType } from "./Documents/Operations/TimeSeries/AggregationType.js"; -export { TIME_SERIES_ROLLUP_SEPARATOR } from "./Documents/Operations/TimeSeries/RawTimeSeriesTypes.js"; -export { ConfigureRawTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/ConfigureRawTimeSeriesPolicyOperation.js"; -export { ConfigureTimeSeriesOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesOperation.js"; -export type { ConfigureTimeSeriesOperationResult } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesOperationResult.js"; -export { ConfigureTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesPolicyOperation.js"; -export { ConfigureTimeSeriesValueNamesOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesValueNamesOperation.js"; -export { GetMultipleTimeSeriesOperation, GetMultipleTimeSeriesCommand } from "./Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.js"; -export { GetTimeSeriesOperation } from "./Documents/Operations/TimeSeries/GetTimeSeriesOperation.js"; -export { GetTimeSeriesStatisticsOperation } from "./Documents/Operations/TimeSeries/GetTimeSeriesStatisticsOperation.js"; -export { RawTimeSeriesPolicy } from "./Documents/Operations/TimeSeries/RawTimeSeriesPolicy.js"; -export { RemoveTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/RemoveTimeSeriesPolicyOperation.js"; -export { TimeSeriesBatchOperation } from "./Documents/Operations/TimeSeries/TimeSeriesBatchOperation.js"; -export { TimeSeriesCollectionConfiguration } from "./Documents/Operations/TimeSeries/TimeSeriesCollectionConfiguration.js"; -export { TimeSeriesConfiguration } from "./Documents/Operations/TimeSeries/TimeSeriesConfiguration.js"; -export { TimeSeriesDetails } from "./Documents/Operations/TimeSeries/TimeSeriesDetails.js"; -export type { TimeSeriesItemDetail } from "./Documents/Operations/TimeSeries/TimeSeriesItemDetail.js"; -export * from "./Documents/Operations/TimeSeries/TimeSeriesOperation.js"; -export { TimeSeriesPolicy } from "./Documents/Operations/TimeSeries/TimeSeriesPolicy.js"; -export type { TimeSeriesRange } from "./Documents/Operations/TimeSeries/TimeSeriesRange.js"; -export type { TimeSeriesCountRange } from "./Documents/Operations/TimeSeries/TimeSeriesCountRange.js"; -export type { TimeSeriesRangeType } from "./Documents/Operations/TimeSeries/TimeSeriesRangeType.js"; -export type { TimeSeriesTimeRange } from "./Documents/Operations/TimeSeries/TimeSeriesTimeRange.js"; -export { TimeSeriesRangeResult } from "./Documents/Operations/TimeSeries/TimeSeriesRangeResult.js"; -export type { TimeSeriesStatistics } from "./Documents/Operations/TimeSeries/TimeSeriesStatistics.js"; -export type { AbstractTimeSeriesRange } from "./Documents/Operations/TimeSeries/AbstractTimeSeriesRange.js"; -export { TimeValue } from "./Primitives/TimeValue.js"; -// AUTH -export * from "./Auth/AuthOptions.js"; - -// TYPES -export * from "./Types/Callbacks.js"; -export * from "./Types/Contracts.js"; -export * from "./Types/index.js"; - -// QUERIES -export * from "./Documents/Queries/IndexQuery.js"; -export * from "./Documents/Queries/GroupBy.js"; -export * from "./Documents/Queries/QueryOperator.js"; -export * from "./Documents/Queries/SearchOperator.js"; -export * from "./Documents/Queries/IIndexQuery.js"; -export * from "./Documents/Queries/FilterFactory.js"; -export * from "./Documents/Queries/IFilterFactory.js"; -export * from "./Documents/Queries/GroupByMethod.js"; -export * from "./Documents/Queries/ProjectionBehavior.js"; -export * from "./Documents/Queries/Spatial/SpatialCriteriaFactory.js"; -export * from "./Documents/Queries/Spatial/SpatialCriteria.js"; -export * from "./Documents/Queries/Spatial/CircleCriteria.js"; -export * from "./Documents/Queries/Spatial/DynamicSpatialField.js"; -export * from "./Documents/Queries/Spatial/WktCriteria.js"; -export * from "./Documents/Queries/Spatial/PointField.js"; -export * from "./Documents/Queries/Spatial/WktField.js"; -export * from "./Documents/Queries/Facets/RangeBuilder.js"; -export * from "./Documents/Queries/Facets/FacetBuilder.js"; -export * from "./Documents/Queries/Facets/FacetAggregationField.js"; -export * from "./Documents/Queries/Facets/Facet.js"; -export * from "./Documents/Queries/Facets/RangeFacet.js"; -export * from "./Documents/Queries/Facets/FacetBase.js"; -export * from "./Documents/Queries/Facets/FacetSetup.js"; -export * from "./Documents/Queries/Facets/index.js"; -export * from "./Documents/Queries/Facets/AggregationRawDocumentQuery.js"; -export * from "./Documents/Queries/QueryData.js"; -export * from "./Documents/Queries/QueryOperationOptions.js"; -export * from "./Documents/Queries/QueryResult.js"; -export * from "./Documents/Queries/Highlighting/HighlightingOptions.js"; -export * from "./Documents/Queries/Highlighting/HighlightingParameters.js"; -export * from "./Documents/Queries/Highlighting/Hightlightings.js"; -export * from "./Documents/Queries/Timings/QueryTimings.js"; -export * from "./Documents/Queries/Facets/AggregationDocumentQuery.js"; -export * from "./Documents/Queries/Facets/AggregationQueryBase.js"; -export * from "./Documents/Queries/Facets/GenericRangeFacet.js"; -export * from "./Documents/Queries/Facets/IAggregationDocumentQuery.js"; -export * from "./Documents/Queries/Facets/IFacetBuilder.js"; -export * from "./Documents/Queries/Facets/IFacetOperations.js"; -export * from "./Documents/Queries/Explanation/ExplanationOptions.js"; -export * from "./Documents/Queries/Explanation/Explanations.js"; -export * from "./Documents/Queries/Highlighting/QueryHighlightings.js"; -export * from "./Documents/Queries/Sorting/SorterDefinition.js"; -export * from "./Documents/Queries/TimeSeries/ITimeSeriesQueryBuilder.js"; -export * from "./Documents/Queries/TimeSeries/TimeSeriesAggregationResult.js"; -export * from "./Documents/Queries/TimeSeries/TimeSeriesQueryBuilder.js"; -export * from "./Documents/Queries/TimeSeries/TimeSeriesQueryResult.js"; -export * from "./Documents/Queries/TimeSeries/TimeSeriesRangeAggregation.js"; -export * from "./Documents/Queries/TimeSeries/TimeSeriesRawResult.js"; -export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesAggregationResult.js"; -export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesRangeAggregation.js"; -export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesRawResult.js"; - -// MORE LIKE THIS -export * from "./Documents/Queries/MoreLikeThis/IMoreLikeThisBuilderBase.js"; -export * from "./Documents/Queries/MoreLikeThis/IMoreLikeThisOperations.js"; -export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisBase.js"; -export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisBuilder.js"; -export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisOptions.js"; -export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisStopWords.js"; - -// SUGGESTIONS -export * from "./Documents/Queries/Suggestions/ISuggestionBuilder.js"; -export * from "./Documents/Queries/Suggestions/ISuggestionDocumentQuery.js"; -export * from "./Documents/Queries/Suggestions/ISuggestionOperations.js"; -export * from "./Documents/Queries/Suggestions/StringDistanceTypes.js"; -export * from "./Documents/Queries/Suggestions/SuggestionBuilder.js"; -export * from "./Documents/Queries/Suggestions/SuggestionDocumentQuery.js"; -export * from "./Documents/Queries/Suggestions/SuggestionOptions.js"; -export * from "./Documents/Queries/Suggestions/SuggestionBase.js"; -export * from "./Documents/Queries/Suggestions/SuggestionResult.js"; -export * from "./Documents/Queries/Suggestions/SuggestionSortMode.js"; - -// ATTACHMENTS -export * from "./Documents/Attachments/index.js"; -export * from "./Documents/Operations/Attachments/GetAttachmentOperation.js"; -export * from "./Documents/Operations/Attachments/AttachmentRequest.js"; - -// ANALYZERS -export * from "./Documents/Operations/Analyzers/DeleteAnalyzerOperation.js"; -export * from "./Documents/Operations/Analyzers/PutAnalyzersOperation.js"; - -// CHANGES -export * from "./Documents/Changes/IndexChange.js"; -export * from "./Documents/Changes/AggressiveCacheChange.js"; -export * from "./Documents/Changes/ChangesSupportedFeatures.js"; -export * from "./Documents/Changes/DatabaseChangesOptions.js"; -export * from "./Documents/Changes/DocumentChange.js"; -export * from "./Documents/Changes/TimeSeriesChange.js"; -export * from "./Documents/Changes/CounterChange.js"; -export * from "./Documents/Changes/IDatabaseChanges.js"; -export * from "./Documents/Changes/DatabaseChange.js"; -export * from "./Documents/Changes/OperationStatusChange.js"; -export * from "./Documents/Changes/IDatabaseChanges.js"; -export * from "./Documents/Changes/DatabaseChanges.js"; -export * from "./Documents/Changes/IConnectableChanges.js"; -export * from "./Documents/Changes/IChangesObservable.js"; -export * from "./Documents/Changes/ChangesObservable.js"; -export * from "./Documents/Changes/DatabaseConnectionState.js"; -export * from "./Documents/Changes/IChangesConnectionState.js"; - -// HiLo -export * from "./Documents/Identity/HiloIdGenerator.js"; -export * from "./Documents/Identity/MultiDatabaseHiLoIdGenerator.js"; -export * from "./Documents/Identity/MultiTypeHiLoIdGenerator.js"; -export * from "./Documents/Identity/HiloRangeValue.js"; -export * from "./Documents/Identity/MultiDatabaseHiLoIdGenerator.js"; - -// Smuggler -export * from "./Documents/Smuggler/DatabaseItemType.js"; -export * from "./Documents/Smuggler/ExportCompressionAlgorithm.js"; -export * from "./Documents/Smuggler/DatabaseRecordItemType.js"; -export * from "./Documents/Smuggler/DatabaseSmuggler.js"; -export * from "./Documents/Smuggler/DatabaseSmugglerExportOptions.js"; -export * from "./Documents/Smuggler/IDatabaseSmugglerExportOptions.js"; -export * from "./Documents/Smuggler/DatabaseSmugglerImportOptions.js"; -export * from "./Documents/Smuggler/IDatabaseSmugglerImportOptions.js"; -export * from "./Documents/Smuggler/DatabaseSmugglerOptions.js"; -export * from "./Documents/Smuggler/IDatabaseSmugglerOptions.js"; - -// Certificates -export * from "./ServerWide/Operations/Certificates/CertificateDefinition.js"; -export * from "./ServerWide/Operations/Certificates/CertificateRawData.js"; -export * from "./ServerWide/Operations/Certificates/CreateClientCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/DatabaseAccess.js"; -export * from "./ServerWide/Operations/Certificates/DeleteCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/GetCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/GetCertificatesOperation.js"; -export * from "./ServerWide/Operations/Certificates/GetCertificatesResponse.js"; -export * from "./ServerWide/Operations/Certificates/PutClientCertificateOperation.js"; -export * from "./ServerWide/Operations/Certificates/SecurityClearance.js"; -export * from "./ServerWide/Operations/AddDatabaseNodeOperation.js"; -export * from "./ServerWide/Operations/PromoteDatabaseNodeOperation.js"; -export * from "./ServerWide/Operations/Analyzers/DeleteServerWideAnalyzerOperation.js"; -export * from "./ServerWide/Operations/Analyzers/PutServerWideAnalyzersOperation.js"; -export * from "./ServerWide/Operations/DocumentsCompression/DocumentCompressionConfigurationResult.js"; -export * from "./ServerWide/Operations/DocumentsCompression/UpdateDocumentsCompressionConfigurationOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/IServerWideTask.js"; -export * from "./ServerWide/Operations/OngoingTasks/DeleteServerWideTaskOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/SetDatabasesLockOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/ToggleServerWideTaskStateOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/GetServerWideExternalReplicationOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/PutServerWideExternalReplicationOperation.js"; -export * from "./ServerWide/Operations/OngoingTasks/ServerWideTaskResponse.js"; -export * from "./ServerWide/Operations/OngoingTasks/ServerWideExternalReplication.js"; -export * from "./ServerWide/Operations/Sorters/DeleteServerWideSorterOperation.js"; -export * from "./ServerWide/Operations/Sorters/PutServerWideSortersOperation.js"; - -// integrations -export * from "./ServerWide/Operations/Integrations/PostgreSql/IntegrationConfigurations.js"; -export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlAuthenticationConfiguration.js"; -export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlUser.js"; -export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlConfiguration.js"; - - -export * from "./ServerWide/Operations/ModifyDatabaseTopologyOperation.js"; -export * from "./ServerWide/Operations/ModifyDatabaseTopologyResult.js"; - -export * from "./ServerWide/Sharding/AddDatabaseShardOperation.js"; -export * from "./ServerWide/Sharding/AddNodeToOrchestratorTopologyOperation.js"; -export * from "./ServerWide/Sharding/MigrationStatus.js"; -export * from "./ServerWide/Sharding/OrchestratorConfiguration.js"; -export * from "./ServerWide/Sharding/PrefixedShardingSetting.js"; -export * from "./ServerWide/Sharding/RemoveNodeFromOrchestratorTopologyOperation.js"; -export * from "./ServerWide/Sharding/ShardBucketMigration.js"; -export * from "./ServerWide/Sharding/ShardingConfiguration.js"; - -// MAPPING -export { TypesAwareObjectMapper } from "./Mapping/ObjectMapper.js"; -export type { ITypesAwareObjectMapper, TypeInfo } from "./Mapping/ObjectMapper.js"; -export { camelCaseReviver, pascalCaseReviver, camelCaseReplacer, pascalCaseReplacer } from "./Mapping/Json/index.js"; - -export { DateUtil } from "./Utility/DateUtil.js"; - -// CONSTANTS -export { CONSTANTS } from "./Constants.js"; - -export * as Json from "./Mapping/Json/index.js"; +export { DocumentConventions } from "./Documents/Conventions/DocumentConventions.js"; +export { BulkInsertConventions } from "./Documents/Conventions/BulkInsertConventions.js"; +export type { RavenErrorType } from "./Exceptions/index.js"; +export * from "./Types/index.js"; + +// HTTP +export * from "./Http/AggressiveCacheOptions.js"; +export * from "./Http/ClusterRequestExecutor.js"; +export * from "./Http/ClusterTopology.js"; +export * from "./Http/CurrentIndexAndNode.js"; +export * from "./Http/CurrentIndexAndNodeAndEtag.js"; +export * from "./Http/IBroadcast.js"; +export * from "./Http/IRaftCommand.js"; +export * from "./Http/NodeSelector.js"; +export * from "./Http/LoadBalanceBehavior.js"; +export * from "./Http/HttpCompressionAlgorithm.js"; +export * from "./Http/RavenCommand.js"; +export * from "./Http/ReadBalanceBehavior.js"; +export * from "./Http/RequestExecutor.js"; +export * from "./Http/ServerNode.js"; +export * from "./Http/StatusCode.js"; +export * from "./Http/Topology.js"; +export * from "./Http/UriUtility.js"; +export * from "./Http/UpdateTopologyParameters.js"; + +export * from "./Utility/ObjectUtil.js"; + +// SERVERWIDE +export * from "./ServerWide/index.js"; +export * from "./ServerWide/CompactSettings.js"; +export * from "./ServerWide/Tcp/LicensedFeatures.js"; +export * from "./Documents/Operations/Etl/ConnectionString.js"; +export * from "./ServerWide/ModifyOnGoingTaskResult.js"; +export * from "./ServerWide/DocumentsCompressionConfiguration.js"; +export * from "./ServerWide/DeletionInProgressStatus.js"; +export * from "./ServerWide/IDatabaseTaskStatus.js"; +export * from "./ServerWide/Operations/BuildNumber.js"; +export * from "./ServerWide/Operations/Builder/IBackupConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IConnectionStringConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilder.js"; +export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilderBase.js"; +export * from "./ServerWide/Operations/Builder/IDatabaseRecordBuilderInitializer.js"; +export * from "./ServerWide/Operations/Builder/IEtlConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IIntegrationConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IOrchestratorTopologyConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IReplicationConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IShardedDatabaseRecordBuilder.js"; +export * from "./ServerWide/Operations/Builder/IShardedTopologyConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/IShardTopologyConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/ITopologyConfigurationBuilder.js"; +export * from "./ServerWide/Operations/Builder/ITopologyConfigurationBuilderBase.js"; +export * from "./ServerWide/Operations/DatabaseRecordBuilder.js"; + +export * from "./ServerWide/Operations/GetBuildNumberOperation.js"; +export * from "./ServerWide/Operations/ReorderDatabaseMembersOperation.js"; +export * from "./ServerWide/Operations/ConfigureRevisionsForConflictsOperation.js"; +export * from "./ServerWide/Operations/UpdateDatabaseOperation.js"; +export * from "./ServerWide/Operations/Configuration/GetServerWideBackupConfigurationOperation.js"; +export * from "./ServerWide/Operations/SetDatabaseDynamicDistributionOperation.js"; +export * from "./ServerWide/Operations/UpdateUnusedDatabasesOperation.js"; + +// SERVERWIDE OPERATIONS +export * from "./ServerWide/Operations/index.js"; +export * from "./ServerWide/Operations/DeleteDatabasesOperation.js"; +export * from "./ServerWide/Operations/GetDatabaseNamesOperation.js"; +export * from "./ServerWide/Operations/GetServerWideOperationStateOperation.js"; +export * from "./ServerWide/Operations/ServerWideOperationCompletionAwaiter.js"; +export * from "./ServerWide/Operations/Certificates/CertificateMetadata.js"; +export * from "./ServerWide/Operations/Certificates/EditClientCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/ReplaceClusterCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/GetCertificateMetadataOperation.js"; +export * from "./ServerWide/Operations/Certificates/GetCertificatesMetadataOperation.js"; +export * from "./ServerWide/Operations/Configuration/GetServerWideClientConfigurationOperation.js"; +export * from "./ServerWide/Operations/Configuration/PutServerWideClientConfigurationOperation.js"; +export * from "./ServerWide/Operations/Logs/GetLogsConfigurationResult.js"; +export * from "./ServerWide/Operations/Logs/GetLogsConfigurationOperation.js"; +export * from "./ServerWide/Operations/Logs/LogMode.js"; +export * from "./ServerWide/Operations/Logs/SetLogsConfigurationOperation.js"; +export * from "./ServerWide/Operations/Configuration/GetServerWideClientConfigurationOperation.js"; +export * from "./ServerWide/Operations/Configuration/GetServerWideBackupConfigurationsOperation.js"; +export * from "./ServerWide/Operations/Configuration/PutServerWideBackupConfigurationOperation.js"; +export * from "./ServerWide/Operations/Configuration/ServerWideBackupConfiguration.js"; +export * from "./ServerWide/Operations/Configuration/DatabaseSettings.js"; +export * from "./ServerWide/Operations/Configuration/GetDatabaseSettingsOperation.js"; +export * from "./ServerWide/Operations/Configuration/PutDatabaseSettingsOperation.js"; + +export type { OrchestratorTopology } from "./ServerWide/OrchestratorTopology.js"; +export { GetDatabaseTopologyCommand } from "./ServerWide/Commands/GetDatabaseTopologyCommand.js"; +export { GetClusterTopologyCommand } from "./ServerWide/Commands/GetClusterTopologyCommand.js"; +export { GetTcpInfoCommand } from "./ServerWide/Commands/GetTcpInfoCommand.js"; +export type { NodeInfo } from "./ServerWide/Commands/NodeInfo.js"; +export { GetNodeInfoCommand } from "./ServerWide/Commands/GetNodeInfoCommand.js"; +export { AddClusterNodeCommand } from "./ServerWide/Commands/Cluster/AddClusterNodeCommand.js"; +export { CreateDatabaseOperation } from "./ServerWide/Operations/CreateDatabaseOperation.js"; +export type { DatabaseRecord, ConflictSolver, ScriptResolver } from "./ServerWide/index.js"; +export * from "./ServerWide/Operations/ModifyConflictSolverOperation.js"; +export * from "./Documents/Operations/Etl/ConnectionString.js"; + +// OPERATIONS AND COMMANDS +export { BulkInsertOperation } from "./Documents/BulkInsertOperation.js"; +export type { IAttachmentsBulkInsert, ICountersBulkInsert, ITimeSeriesBulkInsert, ITypedTimeSeriesBulkInsert } from "./Documents/BulkInsertOperation.js"; +export * from "./Documents/BulkInsert/BulkInsertOptions.js"; +export type { BulkInsertProgress } from "./Documents/Operations/BulkInsertProgress.js"; +export type { CollectionDetails } from "./Documents/Operations/CollectionDetails.js"; +export * from "./Documents/Operations/Backups/BackupConfiguration.js"; +export * from "./Documents/Operations/Backups/DelayBackupOperation.js"; +export * from "./Documents/Operations/Backups/BackupTaskType.js"; +export { DatabaseHealthCheckOperation } from "./Documents/Operations/DatabaseHealthCheckOperation.js"; +export type { DetailedCollectionStatistics } from "./Documents/Operations/DetailedCollectionStatistics.js"; +export { GetEssentialStatisticsOperation } from "./Documents/Operations/GetEssentialStatisticsOperation.js"; +export { GetDetailedCollectionStatisticsOperation } from "./Documents/Operations/GetDetailedCollectionStatisticsOperation.js"; +export * from "./Documents/Operations/OperationAbstractions.js"; +export { CompactDatabaseOperation } from "./Documents/Operations/CompactDatabaseOperation.js"; +export { PutConnectionStringOperation } from "./Documents/Operations/ConnectionStrings/PutConnectionStringOperation.js"; +export type { PutConnectionStringResult } from "./Documents/Operations/ConnectionStrings/PutConnectionStringOperation.js"; +export { PatchOperation } from "./Documents/Operations/PatchOperation.js"; +export { DeleteSorterOperation } from "./Documents/Operations/Sorters/DeleteSorterOperation.js"; +export { PutSortersOperation } from "./Documents/Operations/Sorters/PutSortersOperation.js"; +export { PatchByQueryOperation } from "./Documents/Operations/PatchByQueryOperation.js"; +export { + PutCompareExchangeValueOperation +} + from "./Documents/Operations/CompareExchange/PutCompareExchangeValueOperation.js"; +export { + GetCompareExchangeValueOperation +} + from "./Documents/Operations/CompareExchange/GetCompareExchangeValueOperation.js"; +export { + CompareExchangeResult +} + from "./Documents/Operations/CompareExchange/CompareExchangeResult.js"; +export { + CompareExchangeValue +} + from "./Documents/Operations/CompareExchange/CompareExchangeValue.js"; +export { + CompareExchangeValueResultParser +} + from "./Documents/Operations/CompareExchange/CompareExchangeValueResultParser.js"; +export { GetCompareExchangeValuesOperation } from "./Documents/Operations/CompareExchange/GetCompareExchangeValuesOperation.js"; +export type { GetCompareExchangeValuesParameters } from "./Documents/Operations/CompareExchange/GetCompareExchangeValuesOperation.js"; +export { + DeleteCompareExchangeValueOperation +} + from "./Documents/Operations/CompareExchange/DeleteCompareExchangeValueOperation.js"; +export { + CompareExchangeSessionValue +} + from "./Documents/Operations/CompareExchange/CompareExchangeSessionValue.js"; +export { + CompareExchangeValueJsonConverter +} + from "./Documents/Operations/CompareExchange/CompareExchangeValueJsonConverter.js"; +export type { + CompareExchangeValueState +} + from "./Documents/Operations/CompareExchange/CompareExchangeValueState.js"; +export type { + ICompareExchangeValue +} + from "./Documents/Operations/CompareExchange/ICompareExchangeValue.js"; +export { DeleteByQueryOperation } from "./Documents/Operations/DeleteByQueryOperation.js"; +export { GetCollectionStatisticsOperation } from "./Documents/Operations/GetCollectionStatisticsOperation.js"; +export type { CollectionStatistics } from "./Documents/Operations/CollectionStatistics.js"; +export type { GetServerWideExternalReplicationsResponse } from "./Documents/Operations/GetServerWideExternalReplicationsResponse.js"; +export { CreateSubscriptionCommand } from "./Documents/Commands/CreateSubscriptionCommand.js"; +export { SingleNodeBatchCommand } from "./Documents/Commands/Batches/SingleNodeBatchCommand.js"; +export { GetNextOperationIdCommand } from "./Documents/Commands/GetNextOperationIdCommand.js"; +export { KillOperationCommand } from "./Documents/Commands/KillOperationCommand.js"; +export { DeleteDocumentCommand } from "./Documents/Commands/DeleteDocumentCommand.js"; +export { NextIdentityForCommand } from "./Documents/Commands/NextIdentityForCommand.js"; +export { SeedIdentityForCommand } from "./Documents/Commands/SeedIdentityForCommand.js"; +export { ExplainQueryCommand } from "./Documents/Commands/ExplainQueryCommand.js"; +export { GetIdentitiesOperation } from "./Documents/Operations/Identities/GetIdentitiesOperation.js"; +export { GetStatisticsOperation, GetStatisticsCommand } from "./Documents/Operations/GetStatisticsOperation.js"; +export type { DatabaseStatistics } from "./Documents/Operations/DatabaseStatistics.js"; +export { GetOperationStateOperation } from "./Documents/Operations/GetOperationStateOperation.js"; +export type { IndexInformation } from "./Documents/Operations/IndexInformation.js"; +export type { IndexOptimizeResult } from "./Documents/Operations/IndexOptimizeResult.js"; +export { PatchResultBase } from "./Documents/Operations/PatchResultBase.js"; +export { MaintenanceOperationExecutor } from "./Documents/Operations/MaintenanceOperationExecutor.js"; +export { OperationCompletionAwaiter } from "./Documents/Operations/OperationCompletionAwaiter.js"; +export type { ClientConfiguration } from "./Documents/Operations/Configuration/ClientConfiguration.js"; +export { GetClientConfigurationOperation } from "./Documents/Operations/Configuration/GetClientConfigurationOperation.js"; +export { PutClientConfigurationOperation } from "./Documents/Operations/Configuration/PutClientConfigurationOperation.js"; +export { PutDocumentCommand } from "./Documents/Commands/PutDocumentCommand.js"; +export { GetIndexNamesOperation } from "./Documents/Operations/Indexes/GetIndexNamesOperation.js"; +export { DeleteIndexErrorsOperation } from "./Documents/Operations/Indexes/DeleteIndexErrorsOperation.js"; +export { DisableIndexOperation } from "./Documents/Operations/Indexes/DisableIndexOperation.js"; +export { EnableIndexOperation } from "./Documents/Operations/Indexes/EnableIndexOperation.js"; +export { GetIndexingStatusOperation } from "./Documents/Operations/Indexes/GetIndexingStatusOperation.js"; +export { GetIndexesStatisticsOperation } from "./Documents/Operations/Indexes/GetIndexesStatisticsOperation.js"; +export { GetIndexStatisticsOperation } from "./Documents/Operations/Indexes/GetIndexStatisticsOperation.js"; +export { GetIndexesOperation } from "./Documents/Operations/Indexes/GetIndexesOperation.js"; +export { GetTermsOperation } from "./Documents/Operations/Indexes/GetTermsOperation.js"; +export { IndexHasChangedOperation } from "./Documents/Operations/Indexes/IndexHasChangedOperation.js"; +export { PutIndexesOperation } from "./Documents/Operations/Indexes/PutIndexesOperation.js"; +export { StopIndexingOperation } from "./Documents/Operations/Indexes/StopIndexingOperation.js"; +export { StartIndexingOperation } from "./Documents/Operations/Indexes/StartIndexingOperation.js"; +export { StopIndexOperation } from "./Documents/Operations/Indexes/StopIndexOperation.js"; +export { StartIndexOperation } from "./Documents/Operations/Indexes/StartIndexOperation.js"; +export { ResetIndexOperation } from "./Documents/Operations/Indexes/ResetIndexOperation.js"; +export { DeleteIndexOperation } from "./Documents/Operations/Indexes/DeleteIndexOperation.js"; +export type { GetServerWideBackupConfigurationsResponse } from "./Documents/Operations/GetServerWideBackupConfigurationsResponse.js"; +export { NextIdentityForOperation } from "./Documents/Operations/Identities/NextIdentityForOperation.js"; +export { SeedIdentityForOperation } from "./Documents/Operations/Identities/SeedIdentityForOperation.js"; +export type { IOperationProgress } from "./Documents/Operations/IOperationProgress.js"; +export type { IOperationResult } from "./Documents/Operations/IOperationResult.js"; +export { + UpdateExternalReplicationOperation +} + from "./Documents/Operations/Replication/UpdateExternalReplicationOperation.js"; +export type { + PullReplicationDefinitionAndCurrentConnections +} from "./Documents/Operations/Replication/PullReplicationDefinitionAndCurrentConnections.js"; +export { + PutPullReplicationAsHubOperation +} from "./Documents/Operations/Replication/PutPullReplicationAsHubOperation.js"; +export * from "./Documents/Operations/Replication/DetailedReplicationHubAccess.js"; +export * from "./Documents/Operations/Replication/GetReplicationHubAccessOperation.js"; +export * from "./Documents/Operations/Replication/IExternalReplication.js"; +export * from "./Documents/Operations/Replication/PreventDeletionsMode.js"; +export * from "./Documents/Operations/Replication/PullReplicationMode.js"; +export * from "./Documents/Operations/Replication/RegisterReplicationHubAccessOperation.js"; +export * from "./Documents/Operations/Replication/ReplicationHubAccess.js"; +export * from "./Documents/Operations/Replication/ReplicationHubAccessResult.js"; +export * from "./Documents/Operations/Replication/ReplicationHubAccessResponse.js"; +export * from "./Documents/Operations/Replication/UnregisterReplicationHubAccessOperation.js"; +export { + UpdatePullReplicationAsSinkOperation +} from "./Documents/Operations/Replication/UpdatePullReplicationAsSinkOperation.js"; +export { GetConflictsCommand } from "./Documents/Commands/GetConflictsCommand.js"; +export { SetIndexesLockOperation } from "./Documents/Operations/Indexes/SetIndexesLockOperation.js"; +export type { SetIndexesLockOperationParameters } from "./Documents/Operations/Indexes/SetIndexesLockOperation.js"; +export { SetIndexesPriorityOperation } from "./Documents/Operations/Indexes/SetIndexesPriorityOperation.js"; +export type { SetIndexesPriorityOperationParameters } from "./Documents/Operations/Indexes/SetIndexesPriorityOperation.js"; +export * from "./Documents/Operations/PatchRequest.js"; +export * from "./Documents/Operations/GetDetailedStatisticsOperation.js"; +export * from "./Documents/Commands/Batches/BatchOptions.js"; +export * from "./Documents/Commands/Batches/DeleteAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/PatchCommandData.js"; +export * from "./Documents/Commands/Batches/PutAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/PutAttachmentCommandHelper.js"; +export * from "./Documents/Commands/CommandData.js"; +export * from "./ServerWide/Operations/GetDatabaseRecordOperation.js"; +export * from "./Documents/SetupDocumentBase.js"; +export * from "./Documents/Commands/StreamResultResponse.js"; +export * from "./Documents/Commands/StreamResult.js"; +export * from "./Documents/Session/Operations/BatchOperation.js"; +export * from "./Documents/Session/Operations/GetRevisionOperation.js"; +export * from "./Documents/Session/Operations/GetRevisionsCountOperation.js"; +export * from "./Documents/Lazy.js"; +export * from "./Documents/Session/Operations/Lazy/IEagerSessionOperations.js"; +export * from "./Documents/Session/Operations/Lazy/ILazyOperation.js"; +export * from "./Documents/Session/Operations/Lazy/ILazySessionOperations.js"; +export * from "./Documents/Session/Operations/Lazy/LazyAggregationQueryOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyLoadOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyQueryOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazySessionOperations.js"; +export * from "./Documents/Session/Operations/Lazy/LazyStartsWithOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazySuggestionQueryOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyClusterTransactionOperations.js"; +export * from "./Documents/Session/Operations/Lazy/LazyGetCompareExchangeValueOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyGetCompareExchangeValuesOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyConditionalLoadOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyRevisionOperation.js"; +export * from "./Documents/Session/Operations/Lazy/LazyRevisionOperations.js"; +export * from "./Documents/Session/Operations/LoadOperation.js"; +export * from "./Documents/Session/Operations/LoadStartingWithOperation.js"; +export * from "./Documents/Session/Operations/MultiGetOperation.js"; +export * from "./Documents/Session/Operations/QueryOperation.js"; +export * from "./Documents/Session/Operations/StreamOperation.js"; +export * from "./Documents/Operations/DataArchival/DataArchivalConfiguration.js"; +export * from "./Documents/Operations/DataArchival/ConfigureDataArchivalOperation.js"; +export * from "./Documents/Operations/DataArchival/ConfigureDataArchivalOperationResult.js"; +export * from "./Documents/Operations/Attachments/DeleteAttachmentOperation.js"; +export * from "./Documents/Operations/Attachments/PutAttachmentOperation.js"; +export * from "./Documents/Operations/PatchResult.js"; +export * from "./Documents/Operations/PatchStatus.js"; +export * from "./Documents/Operations/Revisions/ConfigureRevisionsOperation.js"; +export * from "./Documents/Operations/Revisions/GetRevisionsOperation.js"; +export * from "./Documents/Operations/Revisions/RevisionsResult.js"; +export * from "./Documents/Operations/RevisionsCollectionConfiguration.js"; +export * from "./Documents/Operations/RevisionsConfiguration.js"; +export * from "./Documents/Operations/DetailedDatabaseStatistics.js"; +export * from "./Documents/Operations/SessionOperationExecutor.js"; +export * from "./Documents/Operations/Configuration/StudioConfiguration.js"; +export * from "./Documents/Operations/Configuration/StudioEnvironment.js"; +export * from "./Documents/Operations/ConnectionStrings/GetConnectionStringsOperation.js"; +export * from "./Documents/Operations/ConnectionStrings/RemoveConnectionStringOperation.js"; +export * from "./Documents/Operations/QueueSink/QueueSinkConfiguration.js"; +export * from "./Documents/Operations/QueueSink/AddQueueSinkOperation.js"; +export * from "./Documents/Operations/QueueSink/QueueSinkScript.js"; +export * from "./Documents/Operations/QueueSink/UpdateQueueSinkOperation.js"; +export * from "./Documents/Operations/QueueSink/AddQueueSinkOperationResult.js"; +export * from "./Documents/Operations/Etl/Queue/EtlQueue.js"; +export * from "./Documents/Operations/Etl/Queue/QueueEtlConfiguration.js"; +export * from "./Documents/Operations/Etl/Queue/KafkaConnectionSettings.js"; +export * from "./Documents/Operations/Etl/Queue/RabbitMqConnectionSettings.js"; +export * from "./Documents/Operations/Etl/ElasticSearch/ElasticSearchIndex.js"; +export * from "./Documents/Operations/Etl/ElasticSearch/ElasticSearchEtlConfiguration.js"; +export * from "./Documents/Operations/Etl/EtlConfiguration.js"; +export * from "./Documents/Operations/Etl/RavenEtlConfiguration.js"; +export * from "./Documents/Operations/Etl/Sql/SqlEtlConfiguration.js"; +export * from "./Documents/Operations/Etl/Sql/SqlEtlTable.js"; +export * from "./Documents/Operations/Etl/Olap/OlapEtlConfiguration.js"; +export * from "./Documents/Operations/Etl/Olap/OlapEtlFileFormat.js"; +export * from "./Documents/Operations/Etl/Olap/OlapEtlTable.js"; +export * from "./Documents/Operations/Etl/Transformation.js"; +export * from "./Documents/Operations/Expiration/ExpirationConfiguration.js"; +export * from "./Documents/Operations/Replication/PullReplicationAsSink.js"; +export * from "./Documents/Operations/Replication/PullReplicationDefinition.js"; +export * from "./Documents/Operations/Etl/AddEtlOperation.js"; +export * from "./Documents/Operations/Etl/UpdateEtlOperation.js"; +export * from "./Documents/Operations/Etl/ResetEtlOperation.js"; +export * from "./Documents/Operations/DisableDatabaseToggleResult.js"; +export * from "./Documents/Operations/Expiration/ConfigureExpirationOperation.js"; +export * from "./Documents/Operations/OngoingTasks/DeleteOngoingTaskOperation.js"; +export * from "./Documents/Operations/OngoingTasks/GetPullReplicationHubTasksInfoOperation.js"; +export * from "./Documents/Operations/OngoingTasks/OngoingTaskPullReplicationAsSink.js"; +export * from "./Documents/Operations/OngoingTasks/OngoingTaskPullReplicationAsHub.js"; +export * from "./Documents/Operations/OngoingTasks/OngoingTaskType.js"; +export * from "./Documents/Operations/OngoingTasks/RunningBackup.js"; +export * from "./Documents/Operations/OngoingTasks/OngoingTask.js"; +export * from "./Documents/Operations/OngoingTasks/NextBackup.js"; +export * from "./Documents/Operations/GetOngoingTaskInfoOperation.js"; +export * from "./Documents/Operations/OngoingTasks/ToggleOngoingTaskStateOperation.js"; +export * from "./Documents/Operations/Refresh/ConfigureRefreshOperation.js"; +export * from "./Documents/Operations/Refresh/RefreshConfiguration.js"; +export * from "./Documents/Operations/Refresh/ConfigureRefreshOperationResult.js"; +export * from "./Documents/Operations/ToggleDatabasesStateOperation.js"; +export * from "./Documents/Operations/TransactionsRecording/StartTransactionsRecordingOperation.js"; +export * from "./Documents/Operations/TransactionsRecording/StopTransactionsRecordingOperation.js"; + +// AI +export * from "./Documents/Operations/AI/Agents/index.js"; +export * from "./Documents/Operations/AI/index.js" + +// BACKUP +export * from "./Documents/Operations/Backups/AmazonSettings.js"; +export * from "./Documents/Operations/Backups/AzureSettings.js"; +export * from "./Documents/Operations/Backups/BackupEncryptionSettings.js"; +export * from "./Documents/Operations/Backups/BackupEncryptionSettings.js"; +export * from "./Documents/Operations/Backups/Enums.js"; +export * from "./Documents/Operations/Backups/FtpSettings.js"; +export * from "./Documents/Operations/Backups/GlacierSettings.js"; +export * from "./Documents/Operations/Backups/LocalSettings.js"; +export * from "./Documents/Operations/Backups/PeriodicBackupConfiguration.js"; +export * from "./Documents/Operations/Backups/S3Settings.js"; +export * from "./Documents/Operations/Backups/BackupSettings.js"; +export * from "./Documents/Operations/Backups/BackupStatus.js"; +export * from "./Documents/Operations/Backups/GetPeriodicBackupStatusOperation.js"; +export * from "./Documents/Operations/Backups/GetPeriodicBackupStatusOperationResult.js"; +export * from "./Documents/Operations/Backups/LastRaftIndex.js"; +export * from "./Documents/Operations/Backups/PeriodicBackupStatus.js"; +export * from "./Documents/Operations/Backups/RestoreBackupConfiguration.js"; +export * from "./Documents/Operations/Backups/RestoreBackupOperation.js"; +export * from "./Documents/Operations/Backups/StartBackupOperation.js"; +export * from "./Documents/Operations/Backups/StartBackupOperationResult.js"; +export * from "./Documents/Operations/Backups/UpdatePeriodicBackupOperation.js"; +export * from "./Documents/Operations/Backups/UpdatePeriodicBackupOperationResult.js"; +export * from "./Documents/Operations/Backups/UploadProgress.js"; +export * from "./Documents/Operations/Backups/UploadState.js"; +export * from "./Documents/Operations/Backups/CompressionLevel.js"; +export * from "./Documents/Operations/Backups/GetBackupConfigurationScript.js"; +export * from "./Documents/Operations/Backups/GoogleCloudSettings.js"; +export * from "./Documents/Operations/Backups/RestoreBackupConfigurationBase.js"; +export * from "./Documents/Operations/Backups/RestoreFromAzureConfiguration.js"; +export * from "./Documents/Operations/Backups/RestoreFromGoogleCloudConfiguration.js"; +export * from "./Documents/Operations/Backups/RestoreFromS3Configuration.js"; +export * from "./Documents/Operations/Backups/RestoreType.js"; +export * from "./Documents/Operations/Backups/RetentionPolicy.js"; +export * from "./Documents/Operations/Backups/Sharding/GetShardedPeriodicBackupStatusOperation.js"; +export * from "./Documents/Operations/Backups/Sharding/ShardedRestoreSettings.js"; +export * from "./Documents/Operations/Backups/Sharding/SingleShardRestoreSetting.js"; + +// INDEXES +export { GetIndexOperation } from "./Documents/Operations/Indexes/GetIndexOperation.js"; +export { GetIndexErrorsOperation } from "./Documents/Operations/Indexes/GetIndexErrorsOperation.js"; +export * from "./Documents/Indexes/Enums.js"; +export * from "./Documents/Indexes/IndexDeploymentMode.js"; +export * from "./Documents/Indexes/IndexDefinition.js"; +export * from "./Documents/Indexes/AbstractCommonApiForIndexes.js"; +export * from "./Documents/Indexes/AbstractIndexDefinitionBuilder.js"; +export * from "./Documents/Indexes/IAbstractIndexCreationTask.js"; +export * from "./Documents/Indexes/IndexCreation.js"; +export * from "./Documents/Indexes/Errors.js"; +export * from "./Documents/Indexes/LuceneIndexInputType.js"; +export * from "./Documents/Indexes/AdditionalAssembly.js"; +export * from "./Documents/Indexes/IndexDefinitionHelper.js"; +export * from "./Documents/Indexes/IndexFieldOptions.js"; +export * from "./Documents/Indexes/Spatial.js"; +export * from "./Documents/Indexes/IndexingStatus.js"; +export * from "./Documents/Indexes/RollingIndex.js"; +export * from "./Documents/Indexes/RollingIndexDeployment.js"; +export * from "./Documents/Indexes/RollingIndexState.js"; +export * from "./Documents/Indexes/IndexStats.js"; +export * from "./Documents/Indexes/IndexSourceType.js"; +export * from "./Documents/Indexes/index.js"; +export * from "./Documents/Indexes/StronglyTyped.js"; +export * from "./Documents/Indexes/IndexDefinitionBase.js"; +export * from "./Documents/Indexes/Analysis/AnalyzerDefinition.js"; +export * from "./Documents/Indexes/AbstractCsharpIndexCreationTask.js"; +export * from "./Documents/Indexes/AbstractCsharpMultiMapIndexCreationTask.js"; +export * from "./Documents/Indexes/AbstractJavaScriptIndexCreationTask.js"; +export * from "./Documents/Indexes/BaseJavaScriptIndexCreationTask.js"; +export * from "./Documents/Indexes/AbstractJavaScriptMultiMapIndexCreationTask.js"; +export * from "./Documents/Indexes/AbstractRawJavaScriptIndexCreationTask.js"; +export * from "./Documents/Indexes/AutoIndexDefinition.js"; +export * from "./Documents/Indexes/AutoIndexFieldOptions.js"; +export * from "./Documents/Indexes/Spatial/AutoSpatialOptions.js"; +export * from "./Documents/Indexes/Counters/AbstractGenericCountersIndexCreationTask.js"; +export * from "./Documents/Indexes/Counters/AbstractCsharpCountersIndexCreationTask.js"; +export * from "./Documents/Indexes/Counters/AbstractMultiMapCountersIndexCreationTask.js"; +export * from "./Documents/Indexes/Counters/AbstractRawJavaScriptCountersIndexCreationTask.js"; +export * from "./Documents/Indexes/Counters/CountersIndexDefinition.js"; +export * from "./Documents/Indexes/Counters/CountersIndexDefinitionBuilder.js"; +export * from "./Documents/Indexes/TimeSeries/AbstractGenericTimeSeriesIndexCreationTask.js"; +export * from "./Documents/Indexes/TimeSeries/AbstractMultiMapTimeSeriesIndexCreationTask.js"; +export * from "./Documents/Indexes/TimeSeries/AbstractCsharpTimeSeriesIndexCreationTask.js"; +export * from "./Documents/Indexes/TimeSeries/AbstractRawJavaScriptTimeSeriesIndexCreationTask.js"; +export * from "./Documents/Indexes/TimeSeries/TimeSeriesIndexDefinition.js"; +export * from "./Documents/Indexes/TimeSeries/TimeSeriesIndexDefinitionBuilder.js"; +// VECTOR SEARCH +export * from "./Documents/Queries/VectorSearch/VectorQuantizer.js" +export * from "./Utility/VectorSearchUtil.js" + +// REPLICATION +export * from "./Documents/Replication/ExternalReplication.js"; +export * from "./Documents/Replication/ReplicationNode.js"; +export * from "./Documents/Replication/ExternalReplicationBase.js"; + +// STORE +export * from "./Documents/DocumentAbstractions.js"; +export * from "./Documents/DocumentStore.js"; +export * from "./Documents/DocumentStoreBase.js"; +export * from "./Documents/IDocumentStore.js"; +export * from "./Documents/IdTypeAndName.js"; + +// SUBSCRIPTIONS +export * from "./Documents/Subscriptions/SubscriptionBatchBase.js"; +export * from "./Documents/Subscriptions/SubscriptionBatch.js"; +export * from "./Documents/Subscriptions/DocumentSubscriptions.js"; +export * from "./Documents/Subscriptions/SubscriptionWorker.js"; +export * from "./Documents/Subscriptions/SubscriptionWorkerOptions.js"; +export * from "./Documents/Subscriptions/SubscriptionCreationOptions.js"; +export * from "./Documents/Subscriptions/Revision.js"; +export * from "./Documents/Subscriptions/SubscriptionState.js"; +export * from "./Documents/Subscriptions/SubscriptionCreationOptions.js"; +export * from "./Documents/Subscriptions/UpdateSubscriptionResult.js"; +export * from "./Documents/Subscriptions/SubscriptionOpeningStrategy.js"; +export * from "./Documents/Subscriptions/SubscriptionUpdateOptions.js"; + +// SESSION +export * from "./Documents/Session/AbstractDocumentQuery.js"; +export * from "./Documents/Session/CmpXchg.js"; +export * from "./Documents/Session/DocumentInfo.js"; +export * from "./Documents/Session/DocumentQuery.js"; +export * from "./Documents/Session/DocumentQueryHelper.js"; +export * from "./Documents/Session/DocumentsById.js"; +export * from "./Documents/Session/DocumentsChanges.js"; +export * from "./Documents/Session/DocumentSession.js"; +export * from "./Documents/Session/EntityToJson.js"; +export * from "./Documents/Session/ForceRevisionStrategy.js"; +export * from "./Documents/Session/GroupByDocumentQuery.js"; +export * from "./Documents/Session/GroupByField.js"; +export * from "./Documents/Session/IAbstractDocumentQuery.js"; +export * from "./Documents/Session/ISessionDocumentIncrementalTimeSeries.js"; +export * from "./Documents/Session/ISessionDocumentTypedIncrementalTimeSeries.js"; +export * from "./Documents/Session/IAbstractDocumentQueryImpl.js"; +export * from "./Documents/Session/ILazyRevisionsOperations.js"; +export * from "./Documents/Session/IAdvancedSessionOperations.js"; +export * from "./Documents/Session/IDocumentQuery.js"; +export * from "./Documents/Session/IDocumentQueryBase.js"; +export * from "./Documents/Session/IDocumentQueryBuilder.js"; +export * from "./Documents/Session/IDocumentQueryBaseSingle.js"; +export * from "./Documents/Session/IDocumentSession.js"; +export * from "./Documents/Session/IEnumerableQuery.js"; +export * from "./Documents/Session/IFilterDocumentQueryBase.js"; +export * from "./Documents/Session/IGroupByDocumentQuery.js"; +export * from "./Documents/Session/IncludesUtil.js"; +export * from "./Documents/Session/InMemoryDocumentSessionOperations.js"; +export * from "./Documents/Session/IQueryBase.js"; +export * from "./Documents/Session/IRawDocumentQuery.js"; +export * from "./Documents/Session/MethodCall.js"; +export * from "./Documents/Session/OrderingType.js"; +export * from "./Documents/Session/QueryEvents.js"; +export * from "./Documents/Session/QueryOptions.js"; +export * from "./Documents/Session/QueryStatistics.js"; +export * from "./Documents/Session/StreamQueryStatistics.js"; +export * from "./Documents/Session/RawDocumentQuery.js"; +export * from "./Documents/Session/SessionEvents.js"; +export * from "./Documents/Session/WhereParams.js"; +export * from "./Documents/Session/ILazyClusterTransactionOperations.js"; +export * from "./Documents/Session/ISessionDocumentAppendTimeSeriesBase.js"; +export * from "./Documents/Session/ISessionDocumentDeleteTimeSeriesBase.js"; +export * from "./Documents/Session/ISessionDocumentRollupTypedAppendTimeSeriesBase.js"; +export * from "./Documents/Session/ISessionDocumentRollupTypedTimeSeries.js"; +export * from "./Documents/Session/ISessionDocumentTimeSeries.js"; +export * from "./Documents/Session/ISessionDocumentTypedAppendTimeSeriesBase.js"; +export * from "./Documents/Session/ISessionDocumentTypedTimeSeries.js"; +export * from "./Documents/Session/JavaScriptMap.js"; +export * from "./Documents/Session/IMetadataDictionary.js"; +export type { MetadataAsDictionary } from "./Mapping/MetadataAsDictionary.js"; +export * from "./Documents/Session/DocumentResultStream.js"; +export * from "./Documents/Session/SessionDocumentRollupTypedTimeSeries.js"; +export * from "./Documents/Session/SessionDocumentTimeSeries.js"; +export * from "./Documents/Session/SessionDocumentTypedTimeSeries.js"; +export * from "./Documents/Session/SessionTimeSeriesBase.js"; +export * from "./Documents/Session/Loaders/ICounterIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IAbstractTimeSeriesIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/ICompareExchangeValueIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IDocumentIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IGenericIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IGenericRevisionIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IGenericTimeSeriesIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/ISubscriptionIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/ISubscriptionTimeSeriesIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/TimeSeriesIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/SubscriptionIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/ILazyLoaderWithInclude.js"; +export * from "./Documents/Session/Loaders/ILoaderWithInclude.js"; +export * from "./Documents/Session/Loaders/ITimeSeriesIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/LazyMultiLoaderWithInclude.js"; +export * from "./Documents/Session/Loaders/MultiLoaderWithInclude.js"; +export * from "./Documents/Session/DocumentQueryCustomization.js"; +export * from "./Documents/Session/DocumentSessionAttachments.js"; +export * from "./Documents/Session/DocumentSessionAttachmentsBase.js"; +export * from "./Documents/Session/DocumentSessionRevisions.js"; +export * from "./Documents/Session/DocumentSessionRevisionsBase.js"; +export * from "./Documents/Session/IAttachmentsSessionOperations.js"; +export * from "./Documents/Session/IDocumentQueryCustomization.js"; +export * from "./Documents/Session/IRevisionsSessionOperations.js"; +export * from "./Documents/Session/ResponseTimeInformation.js"; +export * from "./Documents/Session/MetadataObject.js"; +export * from "./Documents/Session/TransactionMode.js"; +export * from "./Documents/Session/ConditionalLoadResult.js"; +export * from "./Documents/Session/IClusterTransactionOperations.js"; +export * from "./Documents/Session/ISessionDocumentCounters.js"; +export * from "./Documents/Session/ClusterTransactionOperations.js"; +export * from "./Documents/Session/CounterInternalTypes.js"; +export * from "./Documents/Session/Loaders/IIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IncludeBuilder.js"; +export * from "./Documents/Session/Loaders/IncludeBuilderBase.js"; +export * from "./Documents/Session/Loaders/IQueryIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/QueryIncludeBuilder.js"; +export * from "./Documents/Session/Loaders/QueryIncludeBuilder.js"; +export * from "./Documents/Session/Operations/BatchCommandResult.js"; +export * from "./Documents/Session/SessionDocumentCounters.js"; +export * from "./Documents/Session/TimeSeries/TimeSeriesEntry.js"; +export * from "./Documents/Session/TimeSeries/TimeSeriesValue.js"; +export * from "./Documents/Session/TimeSeries/TimeSeriesValuesHelper.js"; +export * from "./Documents/Session/TimeSeries/TypedTimeSeriesEntry.js"; +export * from "./Documents/Session/TimeSeries/TypedTimeSeriesRollupEntry.js"; +export * from "./Documents/TimeSeries/TimeSeriesOperations.js"; + +// BATCH +export * from "./Documents/Commands/StreamResult.js"; +export * from "./Documents/Session/SessionOptions.js"; +export * from "./Documents/Commands/CommandData.js"; +export * from "./Documents/Commands/GetRevisionsBinEntryCommand.js"; +export * from "./Documents/Commands/GetDocumentsCommand.js"; +export * from "./Documents/Commands/Batches/CopyAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/DeleteAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/MoveAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/PutAttachmentCommandData.js"; +export * from "./Documents/Commands/Batches/BatchPatchCommandData.js"; +export * from "./Documents/Commands/Batches/CountersBatchCommandData.js"; +export * from "./Documents/Commands/Batches/PatchCommandData.js"; +export * from "./Documents/Commands/Batches/PutCompareExchangeCommandData.js"; +export * from "./Documents/Commands/Batches/DeleteCompareExchangeCommandData.js"; + +export * from "./Documents/Lazy.js"; + +// COUNTERS +export { CounterBatch } from "./Documents/Operations/Counters/CounterBatch.js"; +export { GetCountersOperation } from "./Documents/Operations/Counters/GetCountersOperation.js"; +export { CounterBatchOperation } from "./Documents/Operations/Counters/CounterBatchOperation.js"; +export type { CounterOperationType } from "./Documents/Operations/Counters/CounterOperationType.js"; +export { CounterOperation } from "./Documents/Operations/Counters/CounterOperation.js"; +export { DocumentCountersOperation } from "./Documents/Operations/Counters/DocumentCountersOperation.js"; +export * from "./Documents/Operations/Counters/CounterDetail.js"; +export * from "./Documents/Operations/Counters/CountersDetail.js"; + +// TIME SERIES +export type { AggregationType } from "./Documents/Operations/TimeSeries/AggregationType.js"; +export { TIME_SERIES_ROLLUP_SEPARATOR } from "./Documents/Operations/TimeSeries/RawTimeSeriesTypes.js"; +export { ConfigureRawTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/ConfigureRawTimeSeriesPolicyOperation.js"; +export { ConfigureTimeSeriesOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesOperation.js"; +export type { ConfigureTimeSeriesOperationResult } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesOperationResult.js"; +export { ConfigureTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesPolicyOperation.js"; +export { ConfigureTimeSeriesValueNamesOperation } from "./Documents/Operations/TimeSeries/ConfigureTimeSeriesValueNamesOperation.js"; +export { GetMultipleTimeSeriesOperation, GetMultipleTimeSeriesCommand } from "./Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.js"; +export { GetTimeSeriesOperation } from "./Documents/Operations/TimeSeries/GetTimeSeriesOperation.js"; +export { GetTimeSeriesStatisticsOperation } from "./Documents/Operations/TimeSeries/GetTimeSeriesStatisticsOperation.js"; +export { RawTimeSeriesPolicy } from "./Documents/Operations/TimeSeries/RawTimeSeriesPolicy.js"; +export { RemoveTimeSeriesPolicyOperation } from "./Documents/Operations/TimeSeries/RemoveTimeSeriesPolicyOperation.js"; +export { TimeSeriesBatchOperation } from "./Documents/Operations/TimeSeries/TimeSeriesBatchOperation.js"; +export { TimeSeriesCollectionConfiguration } from "./Documents/Operations/TimeSeries/TimeSeriesCollectionConfiguration.js"; +export { TimeSeriesConfiguration } from "./Documents/Operations/TimeSeries/TimeSeriesConfiguration.js"; +export { TimeSeriesDetails } from "./Documents/Operations/TimeSeries/TimeSeriesDetails.js"; +export type { TimeSeriesItemDetail } from "./Documents/Operations/TimeSeries/TimeSeriesItemDetail.js"; +export * from "./Documents/Operations/TimeSeries/TimeSeriesOperation.js"; +export { TimeSeriesPolicy } from "./Documents/Operations/TimeSeries/TimeSeriesPolicy.js"; +export type { TimeSeriesRange } from "./Documents/Operations/TimeSeries/TimeSeriesRange.js"; +export type { TimeSeriesCountRange } from "./Documents/Operations/TimeSeries/TimeSeriesCountRange.js"; +export type { TimeSeriesRangeType } from "./Documents/Operations/TimeSeries/TimeSeriesRangeType.js"; +export type { TimeSeriesTimeRange } from "./Documents/Operations/TimeSeries/TimeSeriesTimeRange.js"; +export { TimeSeriesRangeResult } from "./Documents/Operations/TimeSeries/TimeSeriesRangeResult.js"; +export type { TimeSeriesStatistics } from "./Documents/Operations/TimeSeries/TimeSeriesStatistics.js"; +export type { AbstractTimeSeriesRange } from "./Documents/Operations/TimeSeries/AbstractTimeSeriesRange.js"; +export { TimeValue } from "./Primitives/TimeValue.js"; +// AUTH +export * from "./Auth/AuthOptions.js"; + +// TYPES +export * from "./Types/Callbacks.js"; +export * from "./Types/Contracts.js"; +export * from "./Types/index.js"; + +// QUERIES +export * from "./Documents/Queries/IndexQuery.js"; +export * from "./Documents/Queries/GroupBy.js"; +export * from "./Documents/Queries/QueryOperator.js"; +export * from "./Documents/Queries/SearchOperator.js"; +export * from "./Documents/Queries/IIndexQuery.js"; +export * from "./Documents/Queries/FilterFactory.js"; +export * from "./Documents/Queries/IFilterFactory.js"; +export * from "./Documents/Queries/GroupByMethod.js"; +export * from "./Documents/Queries/ProjectionBehavior.js"; +export * from "./Documents/Queries/Spatial/SpatialCriteriaFactory.js"; +export * from "./Documents/Queries/Spatial/SpatialCriteria.js"; +export * from "./Documents/Queries/Spatial/CircleCriteria.js"; +export * from "./Documents/Queries/Spatial/DynamicSpatialField.js"; +export * from "./Documents/Queries/Spatial/WktCriteria.js"; +export * from "./Documents/Queries/Spatial/PointField.js"; +export * from "./Documents/Queries/Spatial/WktField.js"; +export * from "./Documents/Queries/Facets/RangeBuilder.js"; +export * from "./Documents/Queries/Facets/FacetBuilder.js"; +export * from "./Documents/Queries/Facets/FacetAggregationField.js"; +export * from "./Documents/Queries/Facets/Facet.js"; +export * from "./Documents/Queries/Facets/RangeFacet.js"; +export * from "./Documents/Queries/Facets/FacetBase.js"; +export * from "./Documents/Queries/Facets/FacetSetup.js"; +export * from "./Documents/Queries/Facets/index.js"; +export * from "./Documents/Queries/Facets/AggregationRawDocumentQuery.js"; +export * from "./Documents/Queries/QueryData.js"; +export * from "./Documents/Queries/QueryOperationOptions.js"; +export * from "./Documents/Queries/QueryResult.js"; +export * from "./Documents/Queries/Highlighting/HighlightingOptions.js"; +export * from "./Documents/Queries/Highlighting/HighlightingParameters.js"; +export * from "./Documents/Queries/Highlighting/Hightlightings.js"; +export * from "./Documents/Queries/Timings/QueryTimings.js"; +export * from "./Documents/Queries/Facets/AggregationDocumentQuery.js"; +export * from "./Documents/Queries/Facets/AggregationQueryBase.js"; +export * from "./Documents/Queries/Facets/GenericRangeFacet.js"; +export * from "./Documents/Queries/Facets/IAggregationDocumentQuery.js"; +export * from "./Documents/Queries/Facets/IFacetBuilder.js"; +export * from "./Documents/Queries/Facets/IFacetOperations.js"; +export * from "./Documents/Queries/Explanation/ExplanationOptions.js"; +export * from "./Documents/Queries/Explanation/Explanations.js"; +export * from "./Documents/Queries/Highlighting/QueryHighlightings.js"; +export * from "./Documents/Queries/Sorting/SorterDefinition.js"; +export * from "./Documents/Queries/TimeSeries/ITimeSeriesQueryBuilder.js"; +export * from "./Documents/Queries/TimeSeries/TimeSeriesAggregationResult.js"; +export * from "./Documents/Queries/TimeSeries/TimeSeriesQueryBuilder.js"; +export * from "./Documents/Queries/TimeSeries/TimeSeriesQueryResult.js"; +export * from "./Documents/Queries/TimeSeries/TimeSeriesRangeAggregation.js"; +export * from "./Documents/Queries/TimeSeries/TimeSeriesRawResult.js"; +export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesAggregationResult.js"; +export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesRangeAggregation.js"; +export * from "./Documents/Queries/TimeSeries/TypedTimeSeriesRawResult.js"; + +// MORE LIKE THIS +export * from "./Documents/Queries/MoreLikeThis/IMoreLikeThisBuilderBase.js"; +export * from "./Documents/Queries/MoreLikeThis/IMoreLikeThisOperations.js"; +export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisBase.js"; +export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisBuilder.js"; +export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisOptions.js"; +export * from "./Documents/Queries/MoreLikeThis/MoreLikeThisStopWords.js"; + +// SUGGESTIONS +export * from "./Documents/Queries/Suggestions/ISuggestionBuilder.js"; +export * from "./Documents/Queries/Suggestions/ISuggestionDocumentQuery.js"; +export * from "./Documents/Queries/Suggestions/ISuggestionOperations.js"; +export * from "./Documents/Queries/Suggestions/StringDistanceTypes.js"; +export * from "./Documents/Queries/Suggestions/SuggestionBuilder.js"; +export * from "./Documents/Queries/Suggestions/SuggestionDocumentQuery.js"; +export * from "./Documents/Queries/Suggestions/SuggestionOptions.js"; +export * from "./Documents/Queries/Suggestions/SuggestionBase.js"; +export * from "./Documents/Queries/Suggestions/SuggestionResult.js"; +export * from "./Documents/Queries/Suggestions/SuggestionSortMode.js"; + +// ATTACHMENTS +export * from "./Documents/Attachments/index.js"; +export * from "./Documents/Operations/Attachments/GetAttachmentOperation.js"; +export * from "./Documents/Operations/Attachments/AttachmentRequest.js"; + +// ANALYZERS +export * from "./Documents/Operations/Analyzers/DeleteAnalyzerOperation.js"; +export * from "./Documents/Operations/Analyzers/PutAnalyzersOperation.js"; + +// CHANGES +export * from "./Documents/Changes/IndexChange.js"; +export * from "./Documents/Changes/AggressiveCacheChange.js"; +export * from "./Documents/Changes/ChangesSupportedFeatures.js"; +export * from "./Documents/Changes/DatabaseChangesOptions.js"; +export * from "./Documents/Changes/DocumentChange.js"; +export * from "./Documents/Changes/TimeSeriesChange.js"; +export * from "./Documents/Changes/CounterChange.js"; +export * from "./Documents/Changes/IDatabaseChanges.js"; +export * from "./Documents/Changes/DatabaseChange.js"; +export * from "./Documents/Changes/OperationStatusChange.js"; +export * from "./Documents/Changes/IDatabaseChanges.js"; +export * from "./Documents/Changes/DatabaseChanges.js"; +export * from "./Documents/Changes/IConnectableChanges.js"; +export * from "./Documents/Changes/IChangesObservable.js"; +export * from "./Documents/Changes/ChangesObservable.js"; +export * from "./Documents/Changes/DatabaseConnectionState.js"; +export * from "./Documents/Changes/IChangesConnectionState.js"; + +// HiLo +export * from "./Documents/Identity/HiloIdGenerator.js"; +export * from "./Documents/Identity/MultiDatabaseHiLoIdGenerator.js"; +export * from "./Documents/Identity/MultiTypeHiLoIdGenerator.js"; +export * from "./Documents/Identity/HiloRangeValue.js"; +export * from "./Documents/Identity/MultiDatabaseHiLoIdGenerator.js"; + +// Smuggler +export * from "./Documents/Smuggler/DatabaseItemType.js"; +export * from "./Documents/Smuggler/ExportCompressionAlgorithm.js"; +export * from "./Documents/Smuggler/DatabaseRecordItemType.js"; +export * from "./Documents/Smuggler/DatabaseSmuggler.js"; +export * from "./Documents/Smuggler/DatabaseSmugglerExportOptions.js"; +export * from "./Documents/Smuggler/IDatabaseSmugglerExportOptions.js"; +export * from "./Documents/Smuggler/DatabaseSmugglerImportOptions.js"; +export * from "./Documents/Smuggler/IDatabaseSmugglerImportOptions.js"; +export * from "./Documents/Smuggler/DatabaseSmugglerOptions.js"; +export * from "./Documents/Smuggler/IDatabaseSmugglerOptions.js"; + +// Certificates +export * from "./ServerWide/Operations/Certificates/CertificateDefinition.js"; +export * from "./ServerWide/Operations/Certificates/CertificateRawData.js"; +export * from "./ServerWide/Operations/Certificates/CreateClientCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/DatabaseAccess.js"; +export * from "./ServerWide/Operations/Certificates/DeleteCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/GetCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/GetCertificatesOperation.js"; +export * from "./ServerWide/Operations/Certificates/GetCertificatesResponse.js"; +export * from "./ServerWide/Operations/Certificates/PutClientCertificateOperation.js"; +export * from "./ServerWide/Operations/Certificates/SecurityClearance.js"; +export * from "./ServerWide/Operations/AddDatabaseNodeOperation.js"; +export * from "./ServerWide/Operations/PromoteDatabaseNodeOperation.js"; +export * from "./ServerWide/Operations/Analyzers/DeleteServerWideAnalyzerOperation.js"; +export * from "./ServerWide/Operations/Analyzers/PutServerWideAnalyzersOperation.js"; +export * from "./ServerWide/Operations/DocumentsCompression/DocumentCompressionConfigurationResult.js"; +export * from "./ServerWide/Operations/DocumentsCompression/UpdateDocumentsCompressionConfigurationOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/IServerWideTask.js"; +export * from "./ServerWide/Operations/OngoingTasks/DeleteServerWideTaskOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/SetDatabasesLockOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/ToggleServerWideTaskStateOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/GetServerWideExternalReplicationOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/PutServerWideExternalReplicationOperation.js"; +export * from "./ServerWide/Operations/OngoingTasks/ServerWideTaskResponse.js"; +export * from "./ServerWide/Operations/OngoingTasks/ServerWideExternalReplication.js"; +export * from "./ServerWide/Operations/Sorters/DeleteServerWideSorterOperation.js"; +export * from "./ServerWide/Operations/Sorters/PutServerWideSortersOperation.js"; + +// integrations +export * from "./ServerWide/Operations/Integrations/PostgreSql/IntegrationConfigurations.js"; +export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlAuthenticationConfiguration.js"; +export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlUser.js"; +export * from "./ServerWide/Operations/Integrations/PostgreSql/PostgreSqlConfiguration.js"; + + +export * from "./ServerWide/Operations/ModifyDatabaseTopologyOperation.js"; +export * from "./ServerWide/Operations/ModifyDatabaseTopologyResult.js"; + +export * from "./ServerWide/Sharding/AddDatabaseShardOperation.js"; +export * from "./ServerWide/Sharding/AddNodeToOrchestratorTopologyOperation.js"; +export * from "./ServerWide/Sharding/MigrationStatus.js"; +export * from "./ServerWide/Sharding/OrchestratorConfiguration.js"; +export * from "./ServerWide/Sharding/PrefixedShardingSetting.js"; +export * from "./ServerWide/Sharding/RemoveNodeFromOrchestratorTopologyOperation.js"; +export * from "./ServerWide/Sharding/ShardBucketMigration.js"; +export * from "./ServerWide/Sharding/ShardingConfiguration.js"; + +// MAPPING +export { TypesAwareObjectMapper } from "./Mapping/ObjectMapper.js"; +export type { ITypesAwareObjectMapper, TypeInfo } from "./Mapping/ObjectMapper.js"; +export { camelCaseReviver, pascalCaseReviver, camelCaseReplacer, pascalCaseReplacer } from "./Mapping/Json/index.js"; + +export { DateUtil } from "./Utility/DateUtil.js"; + +// CONSTANTS +export { CONSTANTS } from "./Constants.js"; + +export * as Json from "./Mapping/Json/index.js"; export { DocumentStore as default } from "./Documents/DocumentStore.js"; \ No newline at end of file diff --git a/test/Issues/RDBC-941.ts b/test/Issues/RDBC-941.ts new file mode 100644 index 00000000..9097a33a --- /dev/null +++ b/test/Issues/RDBC-941.ts @@ -0,0 +1,580 @@ +import { + AiConnectionString, + AiSettingsCompareDifferences, + AzureOpenAiSettings, + GetConnectionStringsOperation, + GoogleSettings, + HuggingFaceSettings, + IDocumentStore, + MistralAiSettings, + OllamaSettings, + OpenAiSettings, + PutConnectionStringOperation, + RemoveConnectionStringOperation, + VertexSettings +} from "../../src/index.js"; +import {disposeTestDocumentStore, RavenTestContext, testContext} from "../Utils/TestUtil.js"; +import {assertThat} from "../Utils/AssertExtensions.js"; + +(RavenTestContext.isRavenDbServerVersion("7.1") ? describe : describe.skip)("RDBC-941 - AI Connection Strings", () => { + + let store: IDocumentStore; + + beforeEach(async function () { + store = await testContext.getDocumentStore(); + }); + + afterEach(async () => + await disposeTestDocumentStore(store)); + + it("canCreateGetAndDeleteOpenAiConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "openai1", + type: "Ai", + modelType: "TextEmbeddings", + openAiSettings: new OpenAiSettings( + "test-api-key", + "https://api.openai.com/", + "text-embedding-ada-002", + "org-123", + "proj-456", + 1536 + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + assertThat(connectionStrings.aiConnectionStrings) + .isNotNull() + .hasSize(1); + assertThat(connectionStrings.aiConnectionStrings["openai1"] instanceof AiConnectionString) + .isTrue(); + + const retrieved = connectionStrings.aiConnectionStrings["openai1"]; + assertThat(retrieved.name) + .isEqualTo("openai1"); + assertThat(retrieved.modelType) + .isEqualTo("TextEmbeddings"); + assertThat(retrieved.openAiSettings) + .isNotNull(); + assertThat(retrieved.openAiSettings!.apiKey) + .isEqualTo("test-api-key"); + assertThat(retrieved.openAiSettings!.model) + .isEqualTo("text-embedding-ada-002"); + assertThat(retrieved.openAiSettings!.organizationId) + .isEqualTo("org-123"); + assertThat(retrieved.openAiSettings!.projectId) + .isEqualTo("proj-456"); + + await store.maintenance.send(new RemoveConnectionStringOperation(aiConnectionString)); + + const afterDelete = await store.maintenance.send(new GetConnectionStringsOperation()); + assertThat(afterDelete.aiConnectionStrings) + .hasSize(0); + }); + + it("canCreateAzureOpenAiConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "azure1", + modelType: "Chat", + azureOpenAiSettings: new AzureOpenAiSettings( + "azure-key", + "https://myresource.openai.azure.com/", + "gpt-4", + "my-deployment", + undefined, + 0.7 + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["azure1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.azureOpenAiSettings) + .isNotNull(); + assertThat(retrieved.azureOpenAiSettings!.deploymentName) + .isEqualTo("my-deployment"); + assertThat(retrieved.azureOpenAiSettings!.temperature) + .isEqualTo(0.7); + }); + + it("canCreateOllamaConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "ollama1", + modelType: "Chat", + ollamaSettings: Object.assign(new OllamaSettings("http://localhost:11434", "llama2"), { + think: true, + temperature: 0.8 + }) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["ollama1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.ollamaSettings) + .isNotNull(); + assertThat(retrieved.ollamaSettings!.uri) + .isEqualTo("http://localhost:11434"); + assertThat(retrieved.ollamaSettings!.model) + .isEqualTo("llama2"); + assertThat(retrieved.ollamaSettings!.think) + .isTrue(); + assertThat(retrieved.ollamaSettings!.temperature) + .isEqualTo(0.8); + }); + + it("canCreateGoogleConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "google1", + modelType: "TextEmbeddings", + googleSettings: new GoogleSettings( + "text-embedding-004", + "google-api-key", + "V1", + 768 + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["google1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.googleSettings) + .isNotNull(); + assertThat(retrieved.googleSettings!.model) + .isEqualTo("text-embedding-004"); + assertThat(retrieved.googleSettings!.aiVersion) + .isEqualTo("V1"); + assertThat(retrieved.googleSettings!.dimensions) + .isEqualTo(768); + }); + + it("canCreateHuggingFaceConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "huggingface1", + modelType: "TextEmbeddings", + huggingFaceSettings: new HuggingFaceSettings( + "hf-api-key", + "sentence-transformers/all-MiniLM-L6-v2", + "https://api-inference.huggingface.co" + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["huggingface1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.huggingFaceSettings) + .isNotNull(); + assertThat(retrieved.huggingFaceSettings!.model) + .isEqualTo("sentence-transformers/all-MiniLM-L6-v2"); + assertThat(retrieved.huggingFaceSettings!.endpoint) + .isEqualTo("https://api-inference.huggingface.co"); + }); + + it("canCreateMistralAiConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "mistral1", + modelType: "Chat", + mistralAiSettings: new MistralAiSettings( + "mistral-large-latest", + "mistral-api-key", + "https://api.mistral.ai" + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["mistral1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.mistralAiSettings) + .isNotNull(); + assertThat(retrieved.mistralAiSettings!.model) + .isEqualTo("mistral-large-latest"); + assertThat(retrieved.mistralAiSettings!.endpoint) + .isEqualTo("https://api.mistral.ai"); + }); + + it("canCreateVertexConnectionString", async () => { + const credentialsJson = { + type: "service_account", + project_id: "my-project-123", + private_key_id: "key-id", + private_key: "-----BEGIN PRIVATE KEY-----\ntest\n-----END PRIVATE KEY-----\n", + client_email: "test@my-project.iam.gserviceaccount.com", + client_id: "123456", + auth_uri: "https://accounts.google.com/o/oauth2/auth", + token_uri: "https://oauth2.googleapis.com/token" + }; + + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "vertex1", + modelType: "TextEmbeddings", + vertexSettings: new VertexSettings( + "text-embedding-004", + JSON.stringify(credentialsJson), + "us-central1", + "V1" + ) + }); + + const putResult = await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + assertThat(putResult.raftCommandIndex) + .isGreaterThan(0); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["vertex1"]; + + assertThat(retrieved) + .isNotNull(); + assertThat(retrieved.vertexSettings) + .isNotNull(); + assertThat(retrieved.vertexSettings!.model) + .isEqualTo("text-embedding-004"); + assertThat(retrieved.vertexSettings!.location) + .isEqualTo("us-central1"); + assertThat(retrieved.vertexSettings!.aiVersion) + .isEqualTo("V1"); + }); + + it("canGetMultipleAiConnectionStrings", async () => { + const openAiCs = Object.assign(new AiConnectionString(), { + name: "openai", + openAiSettings: new OpenAiSettings("key1", "https://api.openai.com/", "model1") + }); + + const ollamaCs = Object.assign(new AiConnectionString(), { + name: "ollama", + ollamaSettings: new OllamaSettings("http://localhost:11434", "llama2") + }); + + await store.maintenance.send(new PutConnectionStringOperation(openAiCs)); + await store.maintenance.send(new PutConnectionStringOperation(ollamaCs)); + + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + assertThat(connectionStrings.aiConnectionStrings) + .hasSize(2); + assertThat(connectionStrings.aiConnectionStrings["openai"]) + .isNotNull(); + assertThat(connectionStrings.aiConnectionStrings["ollama"]) + .isNotNull(); + }); + + it("canGetSpecificAiConnectionString", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "specific", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + + const result = await store.maintenance.send(new GetConnectionStringsOperation("specific", "Ai")); + assertThat(result.aiConnectionStrings) + .hasSize(1); + assertThat(result.aiConnectionStrings["specific"]) + .isNotNull(); + }); + + it("validationFailsWhenNoProviderConfigured", () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "invalid" + }); + + const errors = aiConnectionString.validate(); + assertThat(errors) + .isNotEmpty(); + assertThat(errors[0]) + .contains("At least one of the following settings must be set"); + }); + + it("validationFailsWhenMultipleProvidersConfigured", () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "invalid", + openAiSettings: new OpenAiSettings("key1", "https://api.openai.com/", "model1"), + ollamaSettings: new OllamaSettings("http://localhost:11434", "llama2") + }); + + const errors = aiConnectionString.validate(); + assertThat(errors) + .isNotEmpty(); + assertThat(errors[0]) + .contains("Only one of the following settings can be set"); + }); + + it("validationFailsWhenRequiredFieldsMissing", () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "invalid", + openAiSettings: new OpenAiSettings("", "", "") + }); + + const errors = aiConnectionString.validate(); + assertThat(errors.length) + .isGreaterThan(0); + assertThat(errors.some(e => e.includes("apiKey"))) + .isTrue(); + assertThat(errors.some(e => e.includes("endpoint"))) + .isTrue(); + assertThat(errors.some(e => e.includes("model"))) + .isTrue(); + }); + + it("getActiveProviderReturnsCorrectType", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + assertThat(cs1.getActiveProvider()) + .isEqualTo("OpenAi"); + + const cs2 = Object.assign(new AiConnectionString(), { + azureOpenAiSettings: new AzureOpenAiSettings("key", "endpoint", "model", "deployment") + }); + assertThat(cs2.getActiveProvider()) + .isEqualTo("AzureOpenAi"); + + const cs3 = Object.assign(new AiConnectionString(), { + ollamaSettings: new OllamaSettings("http://localhost:11434", "llama2") + }); + assertThat(cs3.getActiveProvider()) + .isEqualTo("Ollama"); + + const cs4 = new AiConnectionString(); + assertThat(cs4.getActiveProvider()) + .isEqualTo("None"); + }); + + it("compareDetectsModelChanges", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model1") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model2") + }); + + const diff = cs1.compare(cs2); + assertThat(diff & AiSettingsCompareDifferences.ModelArchitecture) + .isNotEqualTo(0); + }); + + it("compareDetectsEndpointChanges", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api1.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api2.openai.com/", "model") + }); + + const diff = cs1.compare(cs2); + assertThat(diff & AiSettingsCompareDifferences.EndpointConfiguration) + .isNotEqualTo(0); + }); + + it("compareDetectsAuthenticationChanges", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key1", "https://api.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key2", "https://api.openai.com/", "model") + }); + + const diff = cs1.compare(cs2); + assertThat(diff & AiSettingsCompareDifferences.AuthenticationSettings) + .isNotEqualTo(0); + }); + + it("compareDetectsProviderChange", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + ollamaSettings: new OllamaSettings("http://localhost:11434", "llama2") + }); + + const diff = cs1.compare(cs2); + assertThat(diff) + .isEqualTo(AiSettingsCompareDifferences.All); + }); + + it("compareReturnsNoneWhenIdentical", () => { + const cs1 = Object.assign(new AiConnectionString(), { + identifier: "id1", + modelType: "Chat", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + identifier: "id1", + modelType: "Chat", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + const diff = cs1.compare(cs2); + assertThat(diff) + .isEqualTo(AiSettingsCompareDifferences.None); + }); + + it("isEqualReturnsTrueForIdenticalConnectionStrings", () => { + const cs1 = Object.assign(new AiConnectionString(), { + name: "test", + identifier: "id1", + modelType: "Chat", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + name: "test", + identifier: "id1", + modelType: "Chat", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + assertThat(cs1.isEqual(cs2)) + .isTrue(); + }); + + it("isEqualReturnsFalseForDifferentNames", () => { + const cs1 = Object.assign(new AiConnectionString(), { + name: "test1", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + const cs2 = Object.assign(new AiConnectionString(), { + name: "test2", + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + assertThat(cs1.isEqual(cs2)) + .isFalse(); + }); + + it("usingEncryptedCommunicationChannelDetectsHttps", () => { + const cs1 = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + assertThat(cs1.usingEncryptedCommunicationChannel()) + .isTrue(); + + const cs2 = Object.assign(new AiConnectionString(), { + ollamaSettings: new OllamaSettings("http://localhost:11434", "llama2") + }); + assertThat(cs2.usingEncryptedCommunicationChannel()) + .isFalse(); + + const cs3 = Object.assign(new AiConnectionString(), { + ollamaSettings: new OllamaSettings("https://secure-ollama.com", "llama2") + }); + assertThat(cs3.usingEncryptedCommunicationChannel()) + .isTrue(); + }); + + it("getQueryEmbeddingsMaxConcurrentBatchesUsesProviderValue", () => { + const settings = new OpenAiSettings("key", "https://api.openai.com/", "model"); + settings.embeddingsMaxConcurrentBatches = 5; + + const cs = Object.assign(new AiConnectionString(), { + openAiSettings: settings + }); + + assertThat(cs.getQueryEmbeddingsMaxConcurrentBatches(10)) + .isEqualTo(5); + }); + + it("getQueryEmbeddingsMaxConcurrentBatchesUsesGlobalValueWhenNotSet", () => { + const cs = Object.assign(new AiConnectionString(), { + openAiSettings: new OpenAiSettings("key", "https://api.openai.com/", "model") + }); + + assertThat(cs.getQueryEmbeddingsMaxConcurrentBatches(10)) + .isEqualTo(10); + }); + + it("temperatureParameterSerializedCorrectly", async () => { + const aiConnectionString = Object.assign(new AiConnectionString(), { + name: "temp-test", + openAiSettings: Object.assign( + new OpenAiSettings("key", "https://api.openai.com/", "model"), + {temperature: 1.5} + ) + }); + + await store.maintenance.send(new PutConnectionStringOperation(aiConnectionString)); + const connectionStrings = await store.maintenance.send(new GetConnectionStringsOperation()); + const retrieved = connectionStrings.aiConnectionStrings["temp-test"]; + + assertThat(retrieved.openAiSettings!.temperature) + .isEqualTo(1.5); + }); + + it("vertexSettingsCanExtractProjectId", () => { + const credentialsJson = JSON.stringify({ + type: "service_account", + project_id: "my-test-project", + private_key_id: "key-id", + private_key: "test-key" + }); + + const settings = new VertexSettings( + "text-embedding-004", + credentialsJson, + "us-central1" + ); + + assertThat(settings.getProjectId()) + .isEqualTo("my-test-project"); + }); + + it("vertexSettingsThrowsWhenProjectIdMissing", () => { + const credentialsJson = JSON.stringify({ + type: "service_account", + private_key_id: "key-id" + }); + + const settings = new VertexSettings( + "text-embedding-004", + credentialsJson, + "us-central1" + ); + + let errorThrown = false; + try { + settings.getProjectId(); + } catch (e) { + errorThrown = true; + } + assertThat(errorThrown) + .isTrue(); + }); +}); diff --git a/test/Ported/Documents/Operations/AiConversationTest.ts b/test/Ported/Documents/Operations/AiConversationTest.ts index b2f1c0e5..a6008770 100644 --- a/test/Ported/Documents/Operations/AiConversationTest.ts +++ b/test/Ported/Documents/Operations/AiConversationTest.ts @@ -79,4 +79,205 @@ import { AiHandleErrorStrategy } from "../../../../src/Documents/Operations/AI/A // We cannot access private invocation map to trigger the call; this test ensures registration with strategies does not throw. // The actual bubbling behavior is covered indirectly by implementation; the important part here is that API accepts strategies. }); + + it("onUnhandledAction event is called when action has no handler", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/7|") as any; + + let eventFired = false; + let capturedAction: any = null; + let capturedSender: any = null; + + conv.onUnhandledAction = async (args: any) => { + eventFired = true; + capturedAction = args.action; + capturedSender = args.sender; + }; + + conv._actionRequests = [{ + name: "unhandled-action", + toolId: "tool-123", + arguments: '{"param":"value"}' + }]; + + assertThat(conv.onUnhandledAction).isNotNull(); + + await conv.onUnhandledAction({ + sender: conv, + action: {name: "test", toolId: "t1", arguments: "{}"} + }); + + assertThat(eventFired).isTrue(); + assertThat(capturedSender).isSameAs(conv); + assertThat(capturedAction).isNotNull(); + }); + + it("error thrown when action undefined and no onUnhandledAction event", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/8|") as any; + + conv._actionRequests = [{ + name: "unhandled-action", + toolId: "tool-456", + arguments: '{"test":"data"}' + }]; + + conv._userPrompt = "test prompt"; + + assertThat(conv.onUnhandledAction).isEqualTo(undefined); + }); + + it("onUnhandledAction receives correct event args structure", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/9|") as any; + + let receivedArgs: any = null; + + conv.onUnhandledAction = async (args: any) => { + receivedArgs = args; + }; + + const testAction = { + name: "custom-action", + toolId: "tool-789", + arguments: '{"key":"value"}' + }; + + await conv.onUnhandledAction({ + sender: conv, + action: testAction + }); + + assertThat(receivedArgs).isNotNull(); + assertThat(receivedArgs.sender).isSameAs(conv); + assertThat(receivedArgs.action).isSameAs(testAction); + assertThat(receivedArgs.action.name).isSameAs("custom-action"); + assertThat(receivedArgs.action.toolId).isSameAs("tool-789"); + }); + + it("handle method works without request parameter (backward compat, async)", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/12|") as any; + + let handlerCalled = false; + let capturedArgs: any = null; + + // Register handler without request parameter (single arg) + conv.handle("simple-action", async (args: any) => { + handlerCalled = true; + capturedArgs = args; + return { result: "success", data: args.value }; + }); + + // Verify handler was registered + assertThat(conv._invocations.has("simple-action")).isTrue(); + + // Simulate calling the handler via the internal invocation + const invocation = conv._invocations.get("simple-action"); + await invocation({ + name: "simple-action", + toolId: "tool-100", + arguments: '{"value":"test-data"}' + }); + + assertThat(handlerCalled).isTrue(); + assertThat(capturedArgs).isNotNull(); + assertThat(capturedArgs.value).isSameAs("test-data"); + + // Verify response was added + assertThat(conv._actionResponses.length).isGreaterThan(0); + }); + + it("handle method works without request parameter (backward compat, sync)", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/13|") as any; + + let handlerCalled = false; + + // Register sync handler without request parameter + conv.handle("sync-action", (args: any) => { + handlerCalled = true; + return { processed: true, input: args.input }; + }); + + assertThat(conv._invocations.has("sync-action")).isTrue(); + + const invocation = conv._invocations.get("sync-action"); + await invocation({ + name: "sync-action", + toolId: "tool-101", + arguments: '{"input":"test"}' + }); + + assertThat(handlerCalled).isTrue(); + assertThat(conv._actionResponses.length).isGreaterThan(0); + }); + + it("handle method works with request parameter (with metadata, async)", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/14|") as any; + + let handlerCalled = false; + let capturedRequest: any = null; + let capturedArgs: any = null; + + // Register handler with request parameter (two args) + conv.handle("action-with-request", async (request: any, args: any) => { + handlerCalled = true; + capturedRequest = request; + capturedArgs = args; + return { toolId: request.toolId, data: args.data }; + }); + + assertThat(conv._invocations.has("action-with-request")).isTrue(); + + const invocation = conv._invocations.get("action-with-request"); + const testRequest = { + name: "action-with-request", + toolId: "tool-102", + arguments: '{"data":"metadata-test"}' + }; + + await invocation(testRequest); + + assertThat(handlerCalled).isTrue(); + assertThat(capturedRequest).isNotNull(); + assertThat(capturedRequest.toolId).isSameAs("tool-102"); + assertThat(capturedArgs.data).isSameAs("metadata-test"); + }); + + it("handle method works with request parameter (with metadata, sync)", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/15|") as any; + + let capturedToolId: string = null; + + // Register sync handler with request parameter + conv.handle("sync-with-request", (request: any, args: any) => { + capturedToolId = request.toolId; + return { success: true }; + }); + + const invocation = conv._invocations.get("sync-with-request"); + await invocation({ + name: "sync-with-request", + toolId: "tool-103", + arguments: "{}" + }); + + assertThat(capturedToolId).isSameAs("tool-103"); + }); + + it("handle method arity detection works correctly", async () => { + const conv = store.ai.conversation("agents/1-A", "conversations/16|") as any; + + // Single parameter function (args only) + const singleParamHandler = (args: any) => ({ result: args }); + assertThat(singleParamHandler.length).isSameAs(1); + + // Two parameter function (request, args) + const twoParamHandler = (request: any, args: any) => ({ result: args }); + assertThat(twoParamHandler.length).isSameAs(2); + + // Register both + conv.handle("single-param", singleParamHandler); + conv.handle("two-param", twoParamHandler); + + // Both should be registered + assertThat(conv._invocations.has("single-param")).isTrue(); + assertThat(conv._invocations.has("two-param")).isTrue(); + }); }); diff --git a/test/Ported/Documents/Operations/AiStreamingTest.ts b/test/Ported/Documents/Operations/AiStreamingTest.ts new file mode 100644 index 00000000..d2b808b4 --- /dev/null +++ b/test/Ported/Documents/Operations/AiStreamingTest.ts @@ -0,0 +1,104 @@ +import {Readable} from "node:stream"; +import {assertThat} from "../../../Utils/AssertExtensions.js"; +import {DocumentConventions} from "../../../../src/Documents/Conventions/DocumentConventions.js"; +import {RunConversationOperation} from "../../../../src/Documents/Operations/AI/Agents/RunConversationOperation.js"; +import {RavenTestContext} from "../../../Utils/TestUtil.js"; + +(RavenTestContext.isRavenDbServerVersion("7.1") ? describe : describe.skip)("AiConversationTest", () => { + it("should parse streaming response correctly", async () => { + const streamingResponse = `"Hello" +"World" +"!" +{"conversationId":"conv/1-A","response":{"message":"Hello World!"},"changeVector":"A:1-xyz","actionRequests":[]} +`; + + const receivedChunks: string[] = []; + const streamCallback = async (chunk: string) => { + receivedChunks.push(chunk); + }; + + const operation = new RunConversationOperation<{ message: string }>( + "agents/1-A", + "conv/1|", + "Test prompt", + [], + undefined, + undefined, + "message", + streamCallback + ); + + const conventions = new DocumentConventions(); + const command = operation.getCommand(conventions); + + const bodyStream = Readable.from([streamingResponse]); + + await command.setResponseAsync(bodyStream, false); + + assertThat(receivedChunks).hasSize(3); + assertThat(receivedChunks[0]).isEqualTo("Hello"); + assertThat(receivedChunks[1]).isEqualTo("World"); + assertThat(receivedChunks[2]).isEqualTo("!"); + + assertThat(command.result).isNotNull(); + assertThat(command.result.conversationId).isEqualTo("conv/1-A"); + assertThat(command.result.response).isNotNull(); + assertThat(command.result.response.message).isEqualTo("Hello World!"); + }); + + it("should handle non-streaming response correctly", async () => { + const normalResponse = `{"conversationId":"conv/2-A","response":{"message":"Direct"},"changeVector":"A:2-xyz","actionRequests":[]}`; + + const operation = new RunConversationOperation<{ message: string }>( + "agents/1-A", + "conv/2|", + "Test prompt", + ); + + const conventions = new DocumentConventions(); + const command = operation.getCommand(conventions); + + const bodyStream = Readable.from([normalResponse]); + + await command.setResponseAsync(bodyStream, false); + + assertThat(command.result).isNotNull(); + assertThat(command.result.conversationId).isEqualTo("conv/2-A"); + assertThat(command.result.response.message).isEqualTo("Direct"); + }); + + it("should handle empty lines in streaming response", async () => { + const streamingResponse = `"Chunk1" + +"Chunk2" + +{"conversationId":"conv/3-A","response":{"text":"Done"},"changeVector":"A:3-xyz","actionRequests":[]} +`; + + const receivedChunks: string[] = []; + const streamCallback = async (chunk: string) => { + receivedChunks.push(chunk); + }; + + const operation = new RunConversationOperation<{ text: string }>( + "agents/1-A", + "conv/3|", + "Test", + [], + undefined, + undefined, + "text", + streamCallback + ); + + const conventions = new DocumentConventions(); + const command = operation.getCommand(conventions); + const bodyStream = Readable.from([streamingResponse]); + + await command.setResponseAsync(bodyStream, false); + + assertThat(receivedChunks).hasSize(2); + assertThat(receivedChunks[0]).isEqualTo("Chunk1"); + assertThat(receivedChunks[1]).isEqualTo("Chunk2"); + }); +});