@squidcloud/client 1.0.314 → 1.0.315

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 (39) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +4 -2
  3. package/dist/typescript-client/src/ai-agent-client.d.ts +10 -11
  4. package/dist/typescript-client/src/ai-client.d.ts +5 -11
  5. package/dist/typescript-client/src/index.d.ts +0 -1
  6. package/dist/typescript-client/src/personal-storage-client.d.ts +13 -6
  7. package/dist/typescript-client/src/squid.d.ts +0 -1
  8. package/dist/typescript-client/src/version.d.ts +1 -1
  9. package/package.json +2 -2
  10. package/dist/internal-common/src/metric-name.d.ts +0 -9
  11. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -21
  12. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -18
  13. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -123
  14. package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
  15. package/dist/internal-common/src/types/ai-chatbot.types.d.ts +0 -60
  16. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -34
  17. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  18. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  19. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  20. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  21. package/dist/internal-common/src/types/observability.types.d.ts +0 -71
  22. package/dist/internal-common/src/types/query.types.d.ts +0 -10
  23. package/dist/internal-common/src/types/secret.types.d.ts +0 -2
  24. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  25. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  26. package/dist/internal-common/src/utils/array.d.ts +0 -1
  27. package/dist/internal-common/src/utils/assert.d.ts +0 -1
  28. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  29. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  30. package/dist/internal-common/src/utils/http.d.ts +0 -1
  31. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  32. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  33. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  34. package/dist/internal-common/src/utils/object.d.ts +0 -49
  35. package/dist/internal-common/src/utils/serialization.d.ts +0 -5
  36. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
  37. package/dist/internal-common/src/utils/validation.d.ts +0 -20
  38. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
  39. package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
2
- import { IntegrationId } from './communication.public-types';
2
+ import { AiAgentId, IntegrationId } from './communication.public-types';
3
3
  import { AiChatPromptQuotas, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata } from '../types/ai-chatbot.types';
4
4
  /** The supported OpenAI models */
5
5
  export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"];
@@ -233,10 +233,12 @@ export interface AiChatbotFileContext extends AiChatbotContextBase {
233
233
  extractImages?: boolean;
234
234
  minImageWidth?: number;
235
235
  minImageHeight?: number;
236
+ fullPageAsImage?: boolean;
237
+ extractionModel?: AiChatModelName;
236
238
  }
237
239
  export declare class AiChatbotChatContext {
238
240
  readonly prompt?: string;
239
- readonly profileId: string;
241
+ readonly profileId: AiAgentId;
240
242
  }
241
243
  export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
242
244
  export type AiContextMetadataValue = number | string | boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { AiChatbotChatOptions, AiChatbotContext, AiChatbotProfileMetadata, AiObserveStatusOptions, AiProfileId, AiSearchOptions, AiSearchResponse, AiStatusMessage, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse, MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS } from './public-types';
1
+ import { AiAgentId, AiChatbotChatOptions, AiChatbotContext, AiChatbotProfileMetadata, AiObserveStatusOptions, AiSearchOptions, AiSearchResponse, AiStatusMessage, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse, MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS } from './public-types';
2
2
  import { Observable } from 'rxjs';
3
3
  import { BlobAndFilename } from './types';
4
4
  export interface TranscribeAndChatResponse {
@@ -23,7 +23,6 @@ export type AskOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions' |
23
23
  export declare class AiAgentClient {
24
24
  private readonly rpcManager;
25
25
  private readonly socketManager;
26
- private readonly integrationId;
27
26
  private readonly ongoingChatSequences;
28
27
  private readonly statusUpdates;
29
28
  /**
@@ -38,14 +37,14 @@ export declare class AiAgentClient {
38
37
  /**
39
38
  * Sends a prompt to the specified profile id.
40
39
  *
41
- * @param profileId - The profile id.
40
+ * @param agentId - The agent id.
42
41
  * @param prompt - The prompt.
43
42
  * @param options - The options to send to the chat model.
44
43
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
45
44
  * that has been received so far.
46
45
  */
47
- chat(profileId: string, prompt: string, options?: ChatOptionsWithoutVoice): Observable<string>;
48
- transcribeAndChat(profileId: string, fileToTranscribe: File, options?: ChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
46
+ chat(agentId: AiAgentId, prompt: string, options?: ChatOptionsWithoutVoice): Observable<string>;
47
+ transcribeAndChat(agentId: AiAgentId, fileToTranscribe: File, options?: ChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
49
48
  private chatInternal;
50
49
  search(agentId: string, options: AiSearchOptions): Promise<AiSearchResponse>;
51
50
  /**
@@ -56,12 +55,12 @@ export declare class AiAgentClient {
56
55
  * @param options - The options to send to the chat model.
57
56
  * @returns A promise that resolves when the chat is complete. The resolved value is the entire response.
58
57
  */
59
- ask(agentId: AiProfileId, prompt: string, options?: AskOptionsWithoutVoice): Promise<string>;
60
- observeStatusUpdates(agentId: AiProfileId, options?: AiObserveStatusOptions): Observable<AiStatusMessage>;
61
- transcribeAndAsk(profileId: string, fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
62
- transcribeAndAskWithVoiceResponse(profileId: string, fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
63
- askWithVoiceResponse(profileId: string, prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
64
- askInternal<T>(profileId: AiProfileId, prompt: string | File, isVoiceResponse: boolean, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<T>;
58
+ ask(agentId: AiAgentId, prompt: string, options?: AskOptionsWithoutVoice): Promise<string>;
59
+ observeStatusUpdates(agentId: AiAgentId, options?: AiObserveStatusOptions): Observable<AiStatusMessage>;
60
+ transcribeAndAsk(agentId: AiAgentId, fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
61
+ transcribeAndAskWithVoiceResponse(agentId: AiAgentId, fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
62
+ askWithVoiceResponse(agentId: AiAgentId, prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
63
+ askInternal<T>(agentId: AiAgentId, prompt: string | File, isVoiceResponse: boolean, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<T>;
65
64
  private handleChatResponse;
66
65
  private handleStatusMessage;
67
66
  private createStatusSubject;
@@ -1,6 +1,6 @@
1
- import { AiAgentReference, AiChatbotClient } from './ai-agent-client';
1
+ import { AiAgentReference } from './ai-agent-client';
2
2
  import { AiAssistantClient } from './ai-assistant-client';
3
- import { IntegrationId } from './public-types';
3
+ import { AiAgentId, IntegrationId } from './public-types';
4
4
  import { AiImageClient } from './ai-image-client';
5
5
  import { AiAudioClient } from './ai-audio-client';
6
6
  import { AiMatchMakingClient } from './ai-matchmaking-client';
@@ -11,17 +11,11 @@ import { ExecuteAiApiResponse, ExecuteAiQueryMultiResponse, ExecuteAiQueryOption
11
11
  * through its methods.
12
12
  */
13
13
  export declare class AiClient {
14
- private readonly aiChatbotClientFactory;
14
+ private readonly socketManager;
15
15
  private readonly rpcManager;
16
16
  private readonly aiAssistantClient;
17
- /**
18
- * Retrieves an AI chatbot client for a specific AI integration.
19
- * @param aiIntegrationId - The identifier for the AI integration.
20
- * @returns An instance of AiChatbotClient associated with the given AI integration ID.
21
- * @deprecated Use `agent` method instead.
22
- */
23
- chatbot(aiIntegrationId: IntegrationId): AiChatbotClient;
24
- agent(agentId: string): AiAgentReference;
17
+ private aiAgentClient?;
18
+ agent(agentId: AiAgentId): AiAgentReference;
25
19
  /**
26
20
  * Retrieves the AI assistant client.
27
21
  * @returns An instance of AiAssistantClient.
@@ -1,5 +1,4 @@
1
1
  export * from './ai-assistant-client';
2
- export * from './ai-chatbot-client.factory';
3
2
  export * from './ai-agent-client';
4
3
  export * from './ai-image-client';
5
4
  export * from './ai-audio-client';
@@ -4,6 +4,14 @@ interface PsGetAccessTokenResponse {
4
4
  accessToken: string;
5
5
  expirationTime: Date;
6
6
  }
7
+ type PsDocumentType = 'file' | 'folder';
8
+ interface PsIndexedDocument {
9
+ id: string;
10
+ name: string;
11
+ type: PsDocumentType;
12
+ metadata: AiContextMetadata;
13
+ folderDocumentId?: string;
14
+ }
7
15
  /**
8
16
  * Client to handle personal storage integrations such as Google Drive or Microsoft OneDrive.
9
17
  * Provides methods for saving authentication tokens, indexing documents or folders for AI processing,
@@ -39,21 +47,20 @@ export declare class PersonalStorageClient {
39
47
  *
40
48
  * @param documentOrFolderId - The ID of the document or folder to be indexed.
41
49
  * @param identifier - A user-provided identifier (usually a user ID) that will be associated with the document.
42
- * @param aiIntegrationId - The integration ID for the AI processing configuration.
43
- * @param aiProfileId - The profile ID for the AI processing configuration.
50
+ * @param agentId - The agent ID for the AI processing configuration.
44
51
  * @param metadata - Metadata to include with the index
45
52
  * @returns A promise that resolves when the document or folder is successfully indexed.
46
53
  */
47
- indexDocumentOrFolder(documentOrFolderId: string, identifier: string, aiIntegrationId: string, aiProfileId: string, metadata?: AiContextMetadata): Promise<void>;
54
+ indexDocumentOrFolder(documentOrFolderId: string, identifier: string, agentId: string, metadata?: AiContextMetadata): Promise<void>;
55
+ listIndexedDocuments(identifier: string, agentId: string, type?: PsDocumentType): Promise<Array<PsIndexedDocument>>;
48
56
  /**
49
57
  * Unindexes a previously indexed document, removing it from AI processing.
50
58
  *
51
59
  * @param documentId - The ID of the document to be unindexed.
52
60
  * @param identifier - A user-provided identifier (usually a user ID) that was associated with the document.
53
- * @param aiProfileId - The profile ID for the AI processing configuration.
54
- * @param aiIntegrationId - The integration ID for the AI processing configuration.
61
+ * @param agentId - The agent ID for the AI processing configuration.
55
62
  * @returns A promise that resolves when the document is successfully unindexed.
56
63
  */
57
- unindexDocument(documentId: string, identifier: string, aiProfileId: string, aiIntegrationId: string): Promise<void>;
64
+ unindexDocument(documentId: string, identifier: string, agentId: string): Promise<void>;
58
65
  }
59
66
  export {};
@@ -95,7 +95,6 @@ export declare class Squid {
95
95
  private readonly distributedLockManager;
96
96
  private readonly authManager;
97
97
  private readonly clientIdService;
98
- private readonly aiClientFactory;
99
98
  private readonly _connectionDetails;
100
99
  private readonly querySender;
101
100
  private static readonly squidInstancesMap;
@@ -1 +1 @@
1
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.314";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.315";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.314",
3
+ "version": "1.0.315",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "build:dev": "webpack --mode=development",
14
14
  "build:prod": "webpack --mode=production",
15
15
  "watch": "webpack --watch",
16
- "lint": "eslint . --ext .ts",
16
+ "lint": "eslint",
17
17
  "build-and-check-public-types": "npm run build && npm run check-public-types",
18
18
  "keep-only-public-types": "del-cli 'dist/internal-common/src/**' '!dist/internal-common/src/public-types' '!dist/internal-common/src/public-utils'",
19
19
  "check-public-types": "tsc -p tsconfig.types.json",
@@ -1,9 +0,0 @@
1
- /**
2
- * Names of the Squid metrics.
3
- * Should be in sync with MetricName.kt.
4
- * See MetricName.kt for documentation on each value.
5
- */
6
- export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatOutcome_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_built_in_db_size", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_acquireLock_count", "squid_releaseLock_count", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time"];
7
- export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
8
- /** Common prefix for all Squid metrics. */
9
- export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
@@ -1,21 +0,0 @@
1
- import { ApiEndpointId, HttpMethod } from '../public-types/integrations/api.public-types';
2
- import { IntegrationId } from '../public-types/communication.public-types';
3
- import { ApiOptions } from '../public-types/api-client.public-types';
4
- /** The headers of an API call. */
5
- export type ApiHeaders = Record<string, string | number | boolean>;
6
- /** The context of an API call. */
7
- export declare class ApiCallContext {
8
- readonly integrationId: IntegrationId;
9
- readonly endpointId: ApiEndpointId;
10
- readonly url: string;
11
- readonly method: HttpMethod;
12
- readonly body: unknown;
13
- readonly options: ApiOptions;
14
- }
15
- export interface CallApiRequest<BodyType = any> {
16
- integrationId: IntegrationId;
17
- endpointId: ApiEndpointId;
18
- body?: BodyType;
19
- overrideMethod?: HttpMethod;
20
- options: ApiOptions;
21
- }
@@ -1,18 +0,0 @@
1
- import { IntegrationId } from '../public-types/communication.public-types';
2
- export type NativeQueryRequestType = 'relational' | 'mongo';
3
- interface BaseNativeQueryContext {
4
- type: NativeQueryRequestType;
5
- integrationId: IntegrationId;
6
- }
7
- export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
8
- type: 'relational';
9
- query: string;
10
- params: Record<string, any>;
11
- }
12
- export interface MongoNativeQueryContext extends BaseNativeQueryContext {
13
- type: 'mongo';
14
- collectionName: string;
15
- aggregationPipeline: Array<any | undefined>;
16
- }
17
- export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext;
18
- export {};
@@ -1,123 +0,0 @@
1
- import { FieldSort, Operator, Query, SimpleCondition } from '../public-types/query.public-types';
2
- import { DeepRecord, FieldOf, PartialBy, Paths } from '../public-types/typescript.public-types';
3
- import { CollectionName, DocumentData } from '../public-types/document.public-types';
4
- import { IntegrationId } from '../public-types/communication.public-types';
5
- export declare class QueryContext<T extends DocumentData = any> {
6
- readonly query: Query<T>;
7
- /**
8
- * The ID of the integration being queried.
9
- */
10
- get integrationId(): IntegrationId;
11
- /**
12
- * The name of the collection being queried.
13
- */
14
- get collectionName(): CollectionName;
15
- /**
16
- * The query limit if one exists, -1 otherwise.
17
- */
18
- get limit(): number;
19
- /**
20
- * Verifies that the query's sort order aligns with the provided field sorts. The fields specified in the `sorts`
21
- * parameter must appear in the exact order at the beginning of the query's sort sequence. The query can include
22
- * additional fields in its sort order, but only after the specified sorts.
23
- *
24
- * @param sorts An array of field sorts.
25
- * @returns Whether the query's sorts matches the provided field sorts.
26
- */
27
- sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
28
- /**
29
- * Verifies that the query's sort order exactly matches the provided field sorts. The fields specified in the
30
- * `sorts` parameter must appear in the exact order in the query's sort sequence. No additional sorts may be present
31
- * in the query.
32
- *
33
- * @param sorts An array of field sorts.
34
- * @returns Whether the query's sorts exactly match the provided field sorts.
35
- */
36
- sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
37
- /**
38
- * Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
39
- * to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
40
- * additional conditions, as these only narrow the result set.
41
- *
42
- * @param fieldName The name of the field for the condition.
43
- * @param operator The operator of the condition.
44
- * @param value The value of the condition.
45
- * @returns Whether the query is a subquery of the parent condition.
46
- */
47
- isSubqueryOf<F extends Paths<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
48
- /**
49
- * Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
50
- * to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
51
- * additional conditions, as these only narrow the result set.
52
- *
53
- * @param condition The condition to validate.
54
- * @returns Whether the query is a subquery of the parent condition.
55
- */
56
- isSubqueryOfCondition(condition: GeneralCondition<T>): boolean;
57
- /**
58
- * Verifies that the query is a subquery of the specified conditions. A subquery is defined as a query that evaluates
59
- * to a subset of the results that would be obtained by applying the parent conditions. The subquery may also include
60
- * additional conditions, as these only narrow the result set.
61
- *
62
- * @param conditions The conditions to validate.
63
- * @returns Whether the query includes subquery of the parent conditions.
64
- */
65
- isSubqueryOfConditions(conditions: GeneralConditions<T>): boolean;
66
- /**
67
- * Verifies that the query is a subquery of the specified query. A subquery is defined as a query that evaluates
68
- * to a subset of the results that obtained for the parent query, including sorts and limits.
69
- *
70
- * @param query The query to validate.
71
- * @returns Whether the query is a subquery of the parent query.
72
- */
73
- isSubqueryOfQuery(query: Query<T>): boolean;
74
- /**
75
- * Returns all conditions that apply to any of the specified field names. This method
76
- * provides a convenient way to retrieve all conditions that involve a specific set of fields.
77
- *
78
- * @param fieldNames The field names for which to retrieve conditions.
79
- * @returns An array of conditions that involve any of the specified field names.
80
- */
81
- getConditionsFor<K extends Paths<T>>(...fieldNames: Array<K>): ContextConditions<T, K>;
82
- /**
83
- * Returns all conditions that apply to the specified field name. This method provides
84
- * a convenient way to retrieve all conditions that involve a specific field.
85
- *
86
- * @param fieldName The field name for which to retrieve conditions.
87
- * @returns An array of conditions that involve the specified field name.
88
- */
89
- getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
90
- /**
91
- * Returns true if the given document can be a result of the query.
92
- * The method does not account for limit and sort order.
93
- */
94
- documentMatchesQuery(doc: DocumentData): boolean;
95
- }
96
- /** A list of context conditions */
97
- export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
98
- /** A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'. */
99
- export type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
100
- export interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
101
- operator: 'in';
102
- value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
103
- }
104
- export interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
105
- operator: 'not in';
106
- value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
107
- }
108
- export interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
109
- operator: Exclude<ContextOperator, 'in' | 'not in'>;
110
- value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
111
- }
112
- /** A condition that includes the 'in' and 'not in' operators. */
113
- export interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
114
- operator: AllOperators;
115
- value: any;
116
- }
117
- /** A list of general conditions. */
118
- export type GeneralConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<GeneralCondition<Doc, F>>;
119
- export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
120
- type AllOperators = Operator | 'in' | 'not in';
121
- /** A generic value that can exist in a query. */
122
- export type GenericValue<Doc = any, F extends Paths<Doc> = Paths<Doc>, O extends AllOperators = any> = O extends 'in' ? Array<DeepRecord<Doc>[F]> | null : O extends 'not in' ? Array<DeepRecord<Doc>[F]> | null : DeepRecord<Doc>[F] | null;
123
- export {};
@@ -1,60 +0,0 @@
1
- import { AiFileUrl } from '../public-types/ai-chatbot.public-types';
2
- import { AiAgentId, IntegrationId } from '../public-types/communication.public-types';
3
- import { FunctionName, FunctionNameWithContext } from '../public-types/bundle-data.public-types';
4
- import { IntegrationType } from '../public-types/integration.public-types';
5
- export type AiChatResponseFormat = 'text' | 'json_object';
6
- export interface AiChatOptions {
7
- maxTokens: number;
8
- responseFormat: AiChatResponseFormat;
9
- temperature: number;
10
- topP: number;
11
- instructions: Array<string>;
12
- clientId: string;
13
- fileUrls: Array<AiFileUrl>;
14
- /** Constrains effort on reasoning for reasoning models. o1 models only. */
15
- reasoningEffort?: 'low' | 'medium' | 'high';
16
- /** Current AI profile ID (AI agent ID). */
17
- agentId?: AiAgentId;
18
- /** A unique chat ID for the conversation. */
19
- chatId?: string;
20
- /** Global per-agent context passed to all AI functions. Must be a serializable JSON. */
21
- agentContext?: Record<string, unknown>;
22
- /** List of AI functions available for the chatbot. Overrides the stored list.*/
23
- functions?: Array<FunctionName | FunctionNameWithContext>;
24
- /** List of connected AI agents can be called by the current agent. Overrides the stored list.*/
25
- connectedAgents?: Array<AiConnectedAgentMetadata>;
26
- /** List of connected integrations. Overrides the stored list. */
27
- connectedIntegrations?: Array<AiConnectedIntegrationMetadata>;
28
- /** Current budget for nested or recursive AI chat calls per single prompt. */
29
- quotas?: AiChatPromptQuotas;
30
- }
31
- export interface AiConnectedAgentMetadata {
32
- agentId: AiAgentId;
33
- /**
34
- * Description of the connected agent for the parent agent context.
35
- * Works as AI function description.
36
- */
37
- description: string;
38
- }
39
- export interface AiConnectedIntegrationMetadata {
40
- integrationId: IntegrationId;
41
- /** Type of the connected integration. */
42
- integrationType: IntegrationType;
43
- /**
44
- * Description of the connected integration for the parent agent context.
45
- * Works as AI function description.
46
- * If not provided the default one is used.
47
- */
48
- description?: string;
49
- }
50
- /** Quotas for a single AI chat prompt (`ask()` method call). */
51
- export interface AiChatPromptQuotas {
52
- /**
53
- * Maximum depth of AI call recursion allowed.
54
- * Recursion occurs when one AI agent calls another.
55
- * Note that, for simplicity of implementation, this option guarantees only the maximum recursion depth,
56
- * not the total number of nested AI calls.
57
- * Default: 5.
58
- */
59
- maxAiCallStackSize: number;
60
- }
@@ -1,34 +0,0 @@
1
- import { MmEntity, MmEntityMatch, MmFindMatchesOptions, MmListEntitiesOptions, MmMatchMaker } from '../public-types/ai-matchmaking.types';
2
- export interface MmCreateMatchMakerRequest {
3
- matchMaker: MmMatchMaker;
4
- }
5
- export interface MmDeleteEntityRequest {
6
- entityId: string;
7
- }
8
- export interface MmInsertEntityRequest {
9
- matchMakerId: string;
10
- entity: MmEntity;
11
- }
12
- export interface MmFindMatchesRequest {
13
- entityId: string;
14
- options: MmFindMatchesOptions;
15
- }
16
- export interface MmFindMatchesResponse {
17
- matches: Array<MmEntityMatch>;
18
- }
19
- export interface MmFindMatchesForEntityRequest {
20
- matchMakerId: string;
21
- entity: Omit<MmEntity, 'metadata' | 'id'>;
22
- options: MmFindMatchesOptions;
23
- }
24
- export interface MmFindMatchesForEntityResponse {
25
- matches: Array<MmEntityMatch>;
26
- }
27
- export interface MmListEntitiesRequest {
28
- matchMakerId: string;
29
- categoryId: string;
30
- options: MmListEntitiesOptions;
31
- }
32
- export interface MmDeleteMatchMakerRequest {
33
- matchMakerId: string;
34
- }
@@ -1 +0,0 @@
1
- export type ChatId = string;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- import { MetricName } from '../metric-name';
2
- import { AppId } from '../public-types/communication.public-types';
3
- export interface ObservableNameMetrics {
4
- count: MetricName;
5
- time: MetricName;
6
- }
7
- export declare const ObservableNames: {
8
- readonly functionExecution: ObservableNameMetrics;
9
- readonly codeInitialization: ObservableNameMetrics;
10
- readonly getAiChatbotProfiles: ObservableNameMetrics;
11
- readonly aiImageGeneration: ObservableNameMetrics;
12
- readonly aiRemoveBackground: ObservableNameMetrics;
13
- readonly aiAudioTranscribe: ObservableNameMetrics;
14
- readonly aiAudioCreateSpeech: ObservableNameMetrics;
15
- readonly discoverGraphQLConnectionSchema: ObservableNameMetrics;
16
- readonly discoverOpenApiSchema: ObservableNameMetrics;
17
- readonly discoverOpenApiSchemaFromFile: ObservableNameMetrics;
18
- readonly graphqlQuery: ObservableNameMetrics;
19
- readonly testGraphQLConnection: ObservableNameMetrics;
20
- readonly graphql: ObservableNameMetrics;
21
- };
22
- export type ObservableName = keyof typeof ObservableNames;
23
- export interface MetricEvent {
24
- appId: AppId;
25
- name: MetricName;
26
- tags: Record<string, string>;
27
- timestamp: Date;
28
- value: number;
29
- isExposedToUser: boolean;
30
- }
31
- export interface LogEvent {
32
- message: string;
33
- level: string;
34
- tags: Record<string, string>;
35
- timestamp: Date;
36
- isExposedToUser: boolean;
37
- host: string;
38
- source?: string;
39
- service?: string;
40
- }
41
- export declare const AUDIT_LOG_EVENT_NAMES: readonly ["ai_agent_prompt"];
42
- export type AuditLogEventName = (typeof AUDIT_LOG_EVENT_NAMES)[number];
43
- export interface AuditLogEvent {
44
- appId: AppId;
45
- name: AuditLogEventName;
46
- timestamp: Date;
47
- context: {
48
- clientId?: string;
49
- userId: string;
50
- };
51
- tags: Record<string, string>;
52
- }
53
- /** Tag for metric events. Value: '0' - not an error, '1' - is an error. */
54
- export declare const O11Y_TAG_IS_ERROR = "isError";
55
- /** Tag for log events. Metrics have an explicit appId field. */
56
- export declare const O11Y_TAG_APP_ID = "appId";
57
- /** Tag for metric and log events. */
58
- export declare const O11Y_TAG_INTEGRATION_ID = "integrationId";
59
- /** Tag for AI events. */
60
- export declare const O11Y_TAG_AI_MODEL = "aiModel";
61
- export declare const O11Y_TAG_AI_PROFILE = "aiProfile";
62
- export declare const O11Y_TAG_API_KEY_SOURCE = "apiKeySource";
63
- /** Tag for metric and log events. Value: '0' - not a tenant originated, '1' - is a tenant originated. */
64
- export declare const O11Y_TAG_IS_TENANT_ORIGINATED = "isTenantOriginated";
65
- /** Contains a full (with a service name) function name for backend functions. */
66
- export declare const O11Y_TAG_FUNCTION_NAME = "functionName";
67
- /** Contains a type of the function name for backend functions (See ExecuteFunctionAnnotationType.). */
68
- export declare const O11Y_TAG_FUNCTION_TYPE = "functionType";
69
- export declare function getBooleanMetricTagValue(value: boolean): string;
70
- export declare const COUNT_METRIC_SUFFIXES: string[];
71
- export declare const GAUGE_METRIC_SUFFIXES: string[];
@@ -1,10 +0,0 @@
1
- /**
2
- * Generates the regex pattern, handling special characters as follows:
3
- * - `_` is replaced with a `.`
4
- * - `%` is replaced with `[\s\S]*`.
5
- * - The above characters can be escaped with \, eg. `\_` is replaced with `_` and `\%` with `%`.
6
- * - All special characters in regex (-, /, \, ^, $, *, +, ?, ., (, ), |, [, ], {, }) get escaped with \
7
- *
8
- * Exported for testing purposes.
9
- * */
10
- export declare function replaceSpecialCharacters(input: string): string;
@@ -1,2 +0,0 @@
1
- export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
2
- export declare const APP_API_KEY = "APP_API_KEY";
@@ -1 +0,0 @@
1
- export declare const SOCKET_RECONNECT_TIMEOUT: number;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** Returns true if the application is run by a Playwright test. */
2
- export declare function isPlaywrightTestMode(): boolean | undefined;
@@ -1 +0,0 @@
1
- export declare function isTimestampEnabled(): boolean;
@@ -1 +0,0 @@
1
- export declare function getApplicationUrl(regionPrefix: string, appId: string, path: string): string;
@@ -1,14 +0,0 @@
1
- type LockMutex = string;
2
- /**
3
- * A simple lock manager that locks a list of mutexes.
4
- * When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
5
- * and potential deadlocks.
6
- */
7
- export declare class LockManager {
8
- private readonly locks;
9
- lock(...mutexes: LockMutex[]): Promise<void>;
10
- release(...mutexes: LockMutex[]): void;
11
- canGetLock(...mutexes: LockMutex[]): boolean;
12
- lockSync(...mutexes: LockMutex[]): void;
13
- }
14
- export {};
@@ -1,4 +0,0 @@
1
- import { QueryMetricsRequestCommon, QueryMetricsResultGroup } from '../public-types/metric.public-types';
2
- export type QueryMetricsRequestIntervals = Required<Pick<QueryMetricsRequestCommon, 'fillValue' | 'fn' | 'groupByTags' | 'periodEndSeconds' | 'periodStartSeconds' | 'pointIntervalAlignment' | 'pointIntervalSeconds' | 'tagDomains' | 'noDataBehavior'>>;
3
- /** Adds missed known tag domain groups and fills all missed points with a request.fillValue. */
4
- export declare function fillMissedPoints(request: QueryMetricsRequestIntervals, resultGroups: Array<QueryMetricsResultGroup>): void;
@@ -1,7 +0,0 @@
1
- /**
2
- * Type suffixes defines the type of the metric and can be used for
3
- * metric value validation for incoming metrics.
4
- */
5
- export declare const SQUID_METRIC_TYPE_SUFFIXES: readonly ["_count", "_time", "_size", "_entries", "_value"];
6
- /** Returns true if the given metric has a valid metric type. */
7
- export declare function hasValidMetricTypeSuffix(metricName: string): boolean;