@squidcloud/client 1.0.342 → 1.0.344

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +120 -24
  3. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +7 -4
  4. package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +19 -16
  5. package/dist/internal-common/src/public-types/api-client.public-types.d.ts +4 -0
  6. package/dist/internal-common/src/public-types/backend.public-types.d.ts +12 -1
  7. package/dist/internal-common/src/public-types/communication.public-types.d.ts +7 -0
  8. package/dist/internal-common/src/public-types/context.public-types.d.ts +14 -3
  9. package/dist/internal-common/src/public-types/document.public-types.d.ts +9 -2
  10. package/dist/internal-common/src/public-types/extraction.public-types.d.ts +17 -0
  11. package/dist/internal-common/src/public-types/http-status.enum.d.ts +1 -0
  12. package/dist/internal-common/src/public-types/integration.public-types.d.ts +12 -1
  13. package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +40 -0
  14. package/dist/internal-common/src/public-types/metric.public-types.d.ts +32 -2
  15. package/dist/internal-common/src/public-types/openapi.public-types.d.ts +4 -0
  16. package/dist/internal-common/src/public-types/query.public-types.d.ts +26 -7
  17. package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +13 -0
  18. package/dist/internal-common/src/public-types/schema.public-types.d.ts +4 -0
  19. package/dist/internal-common/src/public-types/secret.public-types.d.ts +10 -0
  20. package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +18 -0
  21. package/dist/internal-common/src/public-types/socket.public-types.d.ts +1 -0
  22. package/dist/internal-common/src/public-types/typescript.public-types.d.ts +8 -0
  23. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +9 -0
  24. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +28 -0
  25. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +12 -0
  26. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +12 -1
  27. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +6 -0
  28. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  29. package/dist/typescript-client/src/admin-client.d.ts +6 -0
  30. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +9 -0
  31. package/dist/typescript-client/src/agent/ai-agent-client.d.ts +8 -0
  32. package/dist/typescript-client/src/ai-client.d.ts +16 -0
  33. package/dist/typescript-client/src/ai-image-client.d.ts +3 -2
  34. package/dist/typescript-client/src/api-client.d.ts +44 -0
  35. package/dist/typescript-client/src/extraction-client.d.ts +7 -0
  36. package/dist/typescript-client/src/integration-client.d.ts +30 -0
  37. package/dist/typescript-client/src/personal-storage-client.d.ts +8 -0
  38. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +115 -8
  39. package/dist/typescript-client/src/scheduler-client.d.ts +17 -0
  40. package/dist/typescript-client/src/secret.client.d.ts +46 -0
  41. package/dist/typescript-client/src/squid.d.ts +26 -0
  42. package/dist/typescript-client/src/version.d.ts +1 -1
  43. package/package.json +1 -1
@@ -19,15 +19,19 @@ interface BaseMutation {
19
19
  */
20
20
  export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
21
21
  /**
22
+ * Represents a delete mutation on a document.
22
23
  * @category Database
23
24
  */
24
25
  export interface DeleteMutation extends BaseMutation {
26
+ /** Specifies that the mutation is a deletion. */
25
27
  type: 'delete';
26
28
  }
27
29
  /**
30
+ * Represents an update mutation on a document.
28
31
  * @category Database
29
32
  */
30
33
  export interface UpdateMutation<T = any> extends BaseMutation {
34
+ /** Specifies that the mutation is an update. */
31
35
  type: 'update';
32
36
  /** The updated properties */
33
37
  properties: {
@@ -35,9 +39,11 @@ export interface UpdateMutation<T = any> extends BaseMutation {
35
39
  };
36
40
  }
37
41
  /**
42
+ * Represents an insert mutation on a document.
38
43
  * @category Database
39
44
  */
40
45
  export interface InsertMutation<T = any> extends BaseMutation {
46
+ /** Specifies that the mutation is an insertion. */
41
47
  type: 'insert';
42
48
  /** The inserted document */
43
49
  properties: T;
@@ -52,7 +58,9 @@ export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | App
52
58
  * @category Database
53
59
  */
54
60
  export interface ValueUpdatePropertyMutation<Value = any> {
61
+ /** Specifies that the mutation updates a value. */
55
62
  type: 'update';
63
+ /** New value to be set. */
56
64
  value: Value;
57
65
  }
58
66
  /**
@@ -60,8 +68,11 @@ export interface ValueUpdatePropertyMutation<Value = any> {
60
68
  * @category Database
61
69
  */
62
70
  export interface ApplyNumericFnPropertyMutation {
71
+ /** Specifies that the mutation applies a numeric function. */
63
72
  type: 'applyNumericFn';
73
+ /** Numeric function to apply. */
64
74
  fn: 'increment';
75
+ /** Value to use in the numeric function. */
65
76
  value: number;
66
77
  }
67
78
  /**
@@ -69,15 +80,21 @@ export interface ApplyNumericFnPropertyMutation {
69
80
  * @category Database
70
81
  */
71
82
  export interface RemovePropertyMutation {
83
+ /** Specifies that the mutation removes a property. */
72
84
  type: 'removeProperty';
73
85
  }
74
86
  interface ApplyExtendString {
87
+ /** Specifies that the mutation applies a string function. */
75
88
  type: 'applyStringFn';
89
+ /** String function to extend the existing string. */
76
90
  fn: 'extendString';
91
+ /** String value to append. */
77
92
  value: string;
78
93
  }
79
94
  interface ApplyTrimString {
95
+ /** Specifies that the mutation applies a string function. */
80
96
  type: 'applyStringFn';
97
+ /** String function to trim the existing string. */
81
98
  fn: 'trim';
82
99
  }
83
100
  /**
@@ -90,7 +107,9 @@ export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
90
107
  * @category Database
91
108
  */
92
109
  export interface BeforeAndAfterDocs<T = SquidDocument> {
110
+ /** Document state before the mutation. */
93
111
  before: T | undefined;
112
+ /** Document state after the mutation. */
94
113
  after: T | undefined;
95
114
  }
96
115
  /**
@@ -101,8 +120,17 @@ export declare class MutationContext<T = any> {
101
120
  readonly mutation: Mutation<T>;
102
121
  readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
103
122
  readonly serverTimeStamp: Date;
123
+ /**
124
+ * Returns the type of the mutation (insert, update, or delete).
125
+ */
104
126
  getMutationType(): MutationType;
127
+ /**
128
+ * Returns the state of the document before the mutation was applied.
129
+ */
105
130
  get before(): T | undefined;
131
+ /**
132
+ * Returns the state of the document after the mutation was applied.
133
+ */
106
134
  get after(): T | undefined;
107
135
  /** Returns true if the mutation affects the provided path. */
108
136
  affectsPath(path: Paths<T>): boolean;
@@ -1,29 +1,41 @@
1
1
  import { IntegrationId } from '../public-types/communication.public-types';
2
2
  /**
3
+ * Represents the type of native query request, either relational or MongoDB.
3
4
  * @category Database
4
5
  */
5
6
  export type NativeQueryRequestType = 'relational' | 'mongo';
6
7
  interface BaseNativeQueryContext {
8
+ /** Type of the native query request. */
7
9
  type: NativeQueryRequestType;
10
+ /** Identifier for the integration. */
8
11
  integrationId: IntegrationId;
9
12
  }
10
13
  /**
14
+ * Context for executing a relational database query.
11
15
  * @category Database
12
16
  */
13
17
  export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
18
+ /** Specifies that the query is for a relational database. */
14
19
  type: 'relational';
20
+ /** SQL query string to be executed. */
15
21
  query: string;
22
+ /** Parameters to be used in the query. */
16
23
  params: Record<string, any>;
17
24
  }
18
25
  /**
26
+ * Context for executing a MongoDB query.
19
27
  * @category Database
20
28
  */
21
29
  export interface MongoNativeQueryContext extends BaseNativeQueryContext {
30
+ /** Specifies that the query is for a Mongo database. */
22
31
  type: 'mongo';
32
+ /** Name of the MongoDB collection to query. */
23
33
  collectionName: string;
34
+ /** Array of aggregation pipeline stages. */
24
35
  aggregationPipeline: Array<any | undefined>;
25
36
  }
26
37
  /**
38
+ * Union type representing either a relational or MongoDB native query context.
27
39
  * @category Database
28
40
  */
29
41
  export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext;
@@ -109,32 +109,43 @@ export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Do
109
109
  */
110
110
  export type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
111
111
  /**
112
+ * A condition using the 'in' operator to match values within a set.
112
113
  * @category Database
113
114
  */
114
115
  export interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
116
+ /** Specifies the 'in' operator to check if a value exists within an array. */
115
117
  operator: 'in';
118
+ /** An array of values to match against the field. */
116
119
  value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
117
120
  }
118
121
  /**
122
+ * A condition using the 'not in' operator to exclude values within a set.
119
123
  * @category Database
120
124
  */
121
125
  export interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
126
+ /** Specifies the 'not in' operator to check if a value does not exist within an array. */
122
127
  operator: 'not in';
128
+ /** An array of values to exclude from the field. */
123
129
  value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
124
130
  }
125
131
  /**
132
+ * A condition using operators other than 'in' or 'not in' for field comparisons.
126
133
  * @category Database
127
134
  */
128
135
  export interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
136
+ /** The operator to use for the comparison, excluding 'in' and 'not in'. */
129
137
  operator: Exclude<ContextOperator, 'in' | 'not in'>;
138
+ /** The value to compare against the field. */
130
139
  value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
131
140
  }
132
141
  /**
133
- * A condition that includes the 'in' and 'not in' operators.
142
+ * A condition that includes all operators, including 'in' and 'not in', for general use.
134
143
  * @category Database
135
144
  */
136
145
  export interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
146
+ /** The operator to apply to the condition, including all possible operators. */
137
147
  operator: AllOperators;
148
+ /** The value to use in the condition comparison. */
138
149
  value: any;
139
150
  }
140
151
  /**
@@ -39,11 +39,17 @@ export interface MmFindMatchesForEntityRequest {
39
39
  export interface MmFindMatchesForEntityResponse {
40
40
  matches: Array<MmEntityMatch>;
41
41
  }
42
+ export interface MmListMatchMakersResponse {
43
+ matchMakers: Array<MmMatchMaker>;
44
+ }
42
45
  export interface MmListEntitiesRequest {
43
46
  matchMakerId: string;
44
47
  categoryId: string;
45
48
  options: MmListEntitiesOptions;
46
49
  }
50
+ export interface MmListEntitiesResponse {
51
+ entities: Array<MmEntity>;
52
+ }
47
53
  export interface MmGetEntityRequest {
48
54
  matchMakerId: string;
49
55
  entityId: string;
@@ -0,0 +1,6 @@
1
+ export interface Base64File {
2
+ filename: string;
3
+ mimetype: string;
4
+ base64: string;
5
+ __isSquidBase64File__: true;
6
+ }
@@ -11,6 +11,12 @@ export declare class AdminClient {
11
11
  private readonly appId;
12
12
  private readonly integrationClient;
13
13
  private readonly secretClient;
14
+ /**
15
+ * Returns the IntegrationClient for managing integrations.
16
+ */
14
17
  integrations(): IntegrationClient;
18
+ /**
19
+ * Returns the SecretClient for managing secrets.
20
+ */
15
21
  secrets(): SecretClient;
16
22
  }
@@ -75,8 +75,17 @@ export declare class AiAgentReference {
75
75
  * Resets any feedback previously provided to the agent.
76
76
  */
77
77
  resetFeedback(): Promise<void>;
78
+ /**
79
+ * Updates the agent's guardrails with the provided options.
80
+ */
78
81
  updateGuardrails(guardrails: GuardrailsOptions): Promise<void>;
82
+ /**
83
+ * Updates the agent's custom guardrails with the provided custom guardrail.
84
+ */
79
85
  updateCustomGuardrails(customGuardrail: string): Promise<void>;
86
+ /**
87
+ * Deletes the custom guardrails for the agent.
88
+ */
80
89
  deleteCustomGuardrail(): Promise<void>;
81
90
  /**
82
91
  * Sends a prompt to the agent and receives streamed text responses.
@@ -11,7 +11,15 @@ export declare class AiAgentClient {
11
11
  private readonly socketManager;
12
12
  private readonly ongoingChatSequences;
13
13
  private readonly statusUpdates;
14
+ /**
15
+ * Retrieves an instance of AiAgentReference for a specific agent ID.
16
+ * This reference provides methods for interacting with the agent.
17
+ */
14
18
  agent(id: AiAgentId): AiAgentReference;
19
+ /**
20
+ * Lists all agents available in the system.
21
+ * @returns A promise that resolves to an array of AiAgent instances.
22
+ */
15
23
  listAgents(): Promise<Array<AiAgent>>;
16
24
  private handleChatResponse;
17
25
  private handleStatusMessage;
@@ -16,7 +16,14 @@ export declare class AiClient {
16
16
  private readonly rpcManager;
17
17
  private readonly aiAssistantClient;
18
18
  private aiAgentClient?;
19
+ /**
20
+ * Returns a reference to the specified AI agent.
21
+ * If no ID is provided, the built-in agent is used by default.
22
+ */
19
23
  agent(agentId?: AiAgentId): AiAgentReference;
24
+ /**
25
+ * Lists all available AI agents.
26
+ */
20
27
  listAgents(): Promise<Array<AiAgent>>;
21
28
  /**
22
29
  * Retrieves the AI assistant client.
@@ -61,6 +68,15 @@ export declare class AiClient {
61
68
  * {@link https://docs.squid.cloud/docs/ai}.
62
69
  */
63
70
  executeAiQuery(integrationId: IntegrationId, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryResponse>;
71
+ /**
72
+ * Executes an AI query across multiple database integrations and returns their responses.
73
+ * Useful when querying multiple sources with the same prompt.
74
+ *
75
+ * @param integrationIds The list of integration IDs to query.
76
+ * @param prompt The prompt to send to the AI.
77
+ * @param options Optional query execution parameters.
78
+ * @returns A promise resolving to the responses from all queried integrations.
79
+ */
64
80
  executeAiQueryMulti(integrationIds: Array<IntegrationId>, prompt: string, options?: ExecuteAiQueryOptions): Promise<ExecuteAiQueryMultiResponse>;
65
81
  /**
66
82
  * Request to execute an AI-powered API call.
@@ -7,11 +7,12 @@ import { AiGenerateImageOptions } from './public-types';
7
7
  export declare class AiImageClient {
8
8
  private readonly rpcManager;
9
9
  /**
10
- * Generates an image based on a given text prompt and options.
10
+ * Generates an image based on a given text prompt and options and returns a url to the generated image.
11
+ * The url will be valid for one hour.
11
12
  *
12
13
  * @param prompt - A natural language description of the desired image.
13
14
  * @param options - Configuration options for image generation (e.g., size, style).
14
- * @returns A Promise that resolves to a base64-encoded image string.
15
+ * @returns A Promise that resolves to a url with the image.
15
16
  */
16
17
  generate(prompt: string, options: AiGenerateImageOptions): Promise<string>;
17
18
  /**
@@ -9,10 +9,54 @@ import { ApiOptions } from '../../internal-common/src/public-types/api-client.pu
9
9
  */
10
10
  export declare class ApiClient {
11
11
  private readonly rpcManager;
12
+ /**
13
+ * Sends a GET request to the specified integration endpoint.
14
+ *
15
+ * @param integrationId The integration to send the request to.
16
+ * @param endpointId The API endpoint to call.
17
+ * @param options Optional API request options (headers, query params, etc).
18
+ * @returns A promise resolving to the HTTP response.
19
+ */
12
20
  get<ResponseBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
21
+ /**
22
+ * Sends a POST request to the specified integration endpoint.
23
+ *
24
+ * @param integrationId The integration to send the request to.
25
+ * @param endpointId The API endpoint to call.
26
+ * @param body Optional request body to send.
27
+ * @param options Optional API request options (headers, query params, etc).
28
+ * @returns A promise resolving to the HTTP response.
29
+ */
13
30
  post<ResponseBodyType = unknown, RequestBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, body?: RequestBodyType, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
31
+ /**
32
+ * Sends a DELETE request to the specified integration endpoint.
33
+ *
34
+ * @param integrationId The integration to send the request to.
35
+ * @param endpointId The API endpoint to call.
36
+ * @param body Optional request body to send.
37
+ * @param options Optional API request options (headers, query params, etc).
38
+ * @returns A promise resolving to the HTTP response.
39
+ */
14
40
  delete<ResponseBodyType = unknown, RequestBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, body?: RequestBodyType, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
41
+ /**
42
+ * Sends a PATCH request to the specified integration endpoint.
43
+ *
44
+ * @param integrationId The integration to send the request to.
45
+ * @param endpointId The API endpoint to call.
46
+ * @param body Optional request body to send.
47
+ * @param options Optional API request options (headers, query params, etc).
48
+ * @returns A promise resolving to the HTTP response.
49
+ */
15
50
  patch<ResponseBodyType = unknown, RequestBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, body?: RequestBodyType, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
51
+ /**
52
+ * Sends a PUT request to the specified integration endpoint.
53
+ *
54
+ * @param integrationId The integration to send the request to.
55
+ * @param endpointId The API endpoint to call.
56
+ * @param body Optional request body to send.
57
+ * @param options Optional API request options (headers, query params, etc).
58
+ * @returns A promise resolving to the HTTP response.
59
+ */
16
60
  put<ResponseBodyType = unknown, RequestBodyType = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, body?: RequestBodyType, options?: ApiOptions): Promise<HttpResponse<ResponseBodyType>>;
17
61
  /**
18
62
  * Performs an HTTP API request to the given integration ID and endpoint ID.
@@ -6,5 +6,12 @@ import { DocumentTextDataResponse, ExtractDataFromDocumentFileOptions } from '..
6
6
  */
7
7
  export declare class ExtractionClient {
8
8
  private readonly rpcManager;
9
+ /**
10
+ * Extracts structured text data from a document file using AI.
11
+ *
12
+ * @param file - The document file to extract data from.
13
+ * @param options - (Optional) Extraction options such as parsing hints or preprocessing flags.
14
+ * @returns A promise that resolves with the extracted document data.
15
+ */
9
16
  extractDataFromDocumentFile(file: File, options?: ExtractDataFromDocumentFileOptions): Promise<DocumentTextDataResponse>;
10
17
  }
@@ -7,9 +7,39 @@ import { IntegrationId, IntegrationInfo, IntegrationType } from './public-types'
7
7
  export declare class IntegrationClient {
8
8
  private readonly rpcManager;
9
9
  private readonly iacBaseUrl;
10
+ /**
11
+ * Lists all integrations for the current application.
12
+ *
13
+ * @param type - (Optional) Filter by integration type.
14
+ * @returns A promise that resolves with a list of integrations.
15
+ */
10
16
  list<ConfigurationType = Record<string, any>>(type?: IntegrationType): Promise<Array<IntegrationInfo<ConfigurationType>>>;
17
+ /**
18
+ * Retrieves the integration by its ID.
19
+ *
20
+ * @param integrationId - The ID of the integration to retrieve.
21
+ * @returns A promise that resolves with the integration info, or `undefined` if not found.
22
+ */
11
23
  get<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
24
+ /**
25
+ * Deletes the integration with the given ID.
26
+ *
27
+ * @param integrationId - The ID of the integration to delete.
28
+ * @returns A promise that resolves when the integration has been deleted.
29
+ */
12
30
  delete(integrationId: IntegrationId): Promise<void>;
31
+ /**
32
+ * Deletes multiple integrations by their IDs.
33
+ *
34
+ * @param integrationIds - An array of integration IDs to delete.
35
+ * @returns A promise that resolves when all deletions are complete.
36
+ */
13
37
  deleteMany(integrationIds: Array<IntegrationId>): Promise<void>;
38
+ /**
39
+ * Creates or updates an integration.
40
+ *
41
+ * @param integration - The integration information to upsert.
42
+ * @returns A promise that resolves when the operation is complete.
43
+ */
14
44
  upsertIntegration<ConfigurationType = Record<string, any>>(integration: IntegrationInfo<ConfigurationType>): Promise<void>;
15
45
  }
@@ -72,6 +72,14 @@ export declare class PersonalStorageClient {
72
72
  * @returns A promise that resolves when the document or folder is successfully indexed.
73
73
  */
74
74
  indexDocumentOrFolder(documentOrFolderId: string, identifier: string, agentId: string, metadata?: AiContextMetadata): Promise<void>;
75
+ /**
76
+ * Lists all documents or folders that have been indexed for AI processing.
77
+ *
78
+ * @param identifier - A user-provided identifier (usually a user ID) associated with the indexed documents.
79
+ * @param agentId - The AI agent ID used when indexing the documents.
80
+ * @param type - (Optional) The type of items to list: `'file'` or `'folder'`. If omitted, returns both.
81
+ * @returns A promise that resolves with an array of indexed documents or folders.
82
+ */
75
83
  listIndexedDocuments(identifier: string, agentId: string, type?: PsDocumentType): Promise<Array<PsIndexedDocument>>;
76
84
  /**
77
85
  * Unindexes a previously indexed document, removing it from AI processing.
@@ -102,7 +102,6 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
102
102
  * @returns The query builder
103
103
  */
104
104
  limit(limit: number): this;
105
- getLimit(): number;
106
105
  /**
107
106
  * Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
108
107
  * determines the order in which they are applied.
@@ -112,13 +111,19 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
112
111
  */
113
112
  sortBy(fieldName: (keyof ReturnType[RootAlias] & FieldName) | string, asc?: boolean): this;
114
113
  /**
115
- * Joins this query with another join query and return a new query builder that can be used to query the joined
116
- * documents.
117
- * @param queryBuilder The query builder to join with
118
- * @param alias TODO
119
- * @param joinFields TODO
120
- * @param options TODO
121
- * @returns A new query builder that can be used to query the joined documents
114
+ * Joins this query with another collection using a specified alias from the left side of the join,
115
+ * allowing you to build complex multi-level joins. The join is defined by specifying which fields
116
+ * to use on both sides of the relationship.
117
+ *
118
+ * @param queryBuilder - The query builder for the collection you want to join with.
119
+ * @param alias - A unique alias for the joined collection. Must not conflict with existing aliases.
120
+ * @param joinFields - The join condition specifying which fields to join: `left` is from the `leftAlias` collection,
121
+ * `right` is from the joined collection.
122
+ * @param options - Configuration for the join:
123
+ * - `leftAlias`: the alias of the collection on the left-hand side of the join.
124
+ * - `isInner`: whether this should be an inner join (default is outer join).
125
+ * @returns A new `JoinQueryBuilder` instance including the joined collection, allowing you to continue building the
126
+ * query.
122
127
  */
123
128
  join<NewAlias extends string, NewReturnType extends DocumentData, LeftAlias extends Extract<keyof ReturnType, Alias>, IsInner extends boolean = false>(queryBuilder: QueryBuilder<NewReturnType>, alias: Exclude<NewAlias, keyof ReturnType>, joinFields: {
124
129
  left: keyof Required<ReturnType>[LeftAlias] & FieldName;
@@ -127,6 +132,15 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
127
132
  leftAlias: LeftAlias;
128
133
  isInner?: IsInner;
129
134
  }): Omit<JoinQueryBuilder<Omit<Aliases, LeftAlias> & Record<LeftAlias, [...Aliases[LeftAlias], NewAlias]> & Record<NewAlias, []>, ReturnType & (IsInner extends true ? Record<NewAlias, NewReturnType> : Partial<Record<NewAlias, NewReturnType>>), NewAlias, RootAlias>, 'limit' | 'getLimit'>;
135
+ /**
136
+ * Joins this query with another collection using a specified alias from the left side.
137
+ *
138
+ * @param queryBuilder - The query builder for the collection to be joined.
139
+ * @param alias - A unique alias for the joined collection.
140
+ * @param joinFields - Fields that define the join relationship (`left` and `right`).
141
+ * @param options - Options including the left alias to join from and whether the join is inner.
142
+ * @returns A new `JoinQueryBuilder` including the joined collection.
143
+ */
130
144
  join<NewAlias extends string, NewReturnType extends DocumentData, IsInner extends boolean = false>(queryBuilder: QueryBuilder<NewReturnType>, alias: Exclude<NewAlias, keyof ReturnType>, joinFields: {
131
145
  left: keyof Required<ReturnType>[LatestAlias] & FieldName;
132
146
  right: keyof NewReturnType & FieldName;
@@ -147,13 +161,56 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
147
161
  dereference(): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
148
162
  /** @inheritDoc */
149
163
  build(): Query;
164
+ /**
165
+ * Gets the list of sort orders applied to the query.
166
+ *
167
+ * @returns An array of field sort configurations.
168
+ */
150
169
  getSortOrders(): Array<FieldSort<any>>;
170
+ /**
171
+ * Creates a deep copy of the current query builder.
172
+ *
173
+ * @returns A cloned instance of the query builder.
174
+ */
151
175
  clone(): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
176
+ /**
177
+ * Adds a composite condition (AND of multiple conditions) to the query.
178
+ *
179
+ * @param conditions An array of simple conditions to apply.
180
+ * @returns The updated query builder.
181
+ */
152
182
  addCompositeCondition(conditions: Array<SimpleCondition>): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
183
+ /**
184
+ * Reverses the current sort order(s) of the query.
185
+ *
186
+ * @returns The updated query builder with reversed sort order(s).
187
+ */
153
188
  flipSortOrder(): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
189
+ /**
190
+ * Extracts the root document's data from a join query result.
191
+ *
192
+ * @param data A result object with document references.
193
+ * @returns The root alias's document reference data.
194
+ */
154
195
  extractData(data: WithDocumentReferences<ReturnType>): Required<ReturnType>[RootAlias];
196
+ /**
197
+ * Serializes the join query into a plain object.
198
+ *
199
+ * @returns A serialized representation of the query, suitable for transport or logging.
200
+ */
155
201
  serialize(): SerializedJoinQuery;
202
+ /**
203
+ * Enables pagination for the join query results.
204
+ *
205
+ * @param options Optional pagination configuration such as page size and cursor.
206
+ * @returns A {@link Pagination} object for fetching paginated results.
207
+ */
156
208
  paginate(options?: Partial<PaginationOptions>): Pagination<WithDocumentReferences<ReturnType>>;
209
+ /**
210
+ * Checks whether the join query contains any inner joins.
211
+ *
212
+ * @returns `true` if at least one join is inner; otherwise `false`.
213
+ */
157
214
  hasIsInner(): boolean;
158
215
  }
159
216
  /**
@@ -172,12 +229,50 @@ export declare class DereferencedJoin<Aliases extends Record<Alias, Alias[]>, Re
172
229
  * @inheritDoc
173
230
  */
174
231
  peek(): Array<ReturnType>;
232
+ /**
233
+ * Returns the current sort orders applied to the query.
234
+ *
235
+ * @returns An array of field sort definitions.
236
+ */
175
237
  getSortOrders(): Array<FieldSort<any>>;
238
+ /**
239
+ * Clones the current join query builder instance.
240
+ *
241
+ * @returns A deep copy of the join query builder.
242
+ */
176
243
  clone(): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
244
+ /**
245
+ * Adds multiple conditions that are combined with an AND operator.
246
+ *
247
+ * @param conditions An array of conditions to be applied together.
248
+ * @returns The updated query builder.
249
+ */
177
250
  addCompositeCondition(conditions: Array<SimpleCondition>): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
251
+ /**
252
+ * Reverses the direction of all currently applied sort orders.
253
+ *
254
+ * @returns The updated query builder.
255
+ */
178
256
  flipSortOrder(): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
257
+ /**
258
+ * Extracts the root document's data from the given join result.
259
+ *
260
+ * @param data A record containing document references.
261
+ * @returns The root document's data.
262
+ */
179
263
  extractData(data: ReturnType): any;
264
+ /**
265
+ * Enables pagination for the join query results.
266
+ *
267
+ * @param options Optional pagination configuration such as page size and cursor.
268
+ * @returns A {@link Pagination} object for fetching paginated results.
269
+ */
180
270
  paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
271
+ /**
272
+ * Serializes the join query into a plain object.
273
+ *
274
+ * @returns A serialized representation of the query, suitable for transport or logging.
275
+ */
181
276
  serialize(): SerializedJoinQuery;
182
277
  }
183
278
  /**
@@ -199,11 +294,23 @@ export declare class GroupedJoin<Aliases extends Record<Alias, Alias[]>, ReturnT
199
294
  /** @inheritDoc */
200
295
  dereference(): SnapshotEmitter<Grouped<Aliases, ReturnType, RootAlias>>;
201
296
  private groupData;
297
+ /** @inheritDoc */
202
298
  getSortOrders(): Array<FieldSort<any>>;
299
+ /** @inheritDoc */
203
300
  clone(): GroupedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
301
+ /** @inheritDoc */
204
302
  addCompositeCondition(conditions: Array<SimpleCondition>): GroupedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
303
+ /** @inheritDoc */
205
304
  flipSortOrder(): GroupedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
305
+ /** @inheritDoc */
206
306
  extractData(data: Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>): any;
307
+ /** @inheritDoc */
207
308
  serialize(): SerializedJoinQuery;
309
+ /**
310
+ * Enables pagination for the join query results.
311
+ *
312
+ * @param options Optional pagination configuration such as page size and cursor.
313
+ * @returns A {@link Pagination} object for fetching paginated results.
314
+ */
208
315
  paginate(options?: Partial<PaginationOptions>): Pagination<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>;
209
316
  }
@@ -6,8 +6,25 @@ import { SchedulerInfo } from './public-types';
6
6
  */
7
7
  export declare class SchedulerClient {
8
8
  private readonly rpcManager;
9
+ /**
10
+ * Lists all configured schedulers.
11
+ *
12
+ * @returns A promise resolving to an array of scheduler metadata.
13
+ */
9
14
  list(): Promise<SchedulerInfo[]>;
15
+ /**
16
+ * Enables one or more schedulers by their IDs.
17
+ *
18
+ * @param schedulerId A single scheduler ID or an array of scheduler IDs to enable.
19
+ * @returns A promise that resolves once the update is complete.
20
+ */
10
21
  enable(schedulerId: string | string[]): Promise<void>;
22
+ /**
23
+ * Disables one or more schedulers by their IDs.
24
+ *
25
+ * @param schedulerId A single scheduler ID or an array of scheduler IDs to disable.
26
+ * @returns A promise that resolves once the update is complete.
27
+ */
11
28
  disable(schedulerId: string | string[]): Promise<void>;
12
29
  private update;
13
30
  private createUpdateSchedulerOptions;