@squidcloud/client 1.0.423 → 1.0.425

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 (54) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/metric-name.d.ts +9 -0
  4. package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +14 -0
  5. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +81 -13
  6. package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +12 -15
  7. package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +14 -0
  8. package/dist/internal-common/src/public-types/integration.public-types.d.ts +2 -2
  9. package/dist/internal-common/src/public-types/web.public-types.d.ts +26 -0
  10. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  11. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
  12. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
  13. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
  14. package/dist/internal-common/src/types/ai-agent.types.d.ts +195 -0
  15. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
  16. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
  17. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  18. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  19. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  20. package/dist/internal-common/src/types/headers.types.d.ts +17 -0
  21. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  22. package/dist/internal-common/src/types/notification.types.d.ts +5 -0
  23. package/dist/internal-common/src/types/observability.types.d.ts +101 -0
  24. package/dist/internal-common/src/types/query.types.d.ts +13 -0
  25. package/dist/internal-common/src/types/secret.types.d.ts +7 -0
  26. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  27. package/dist/internal-common/src/types/stage.d.ts +9 -0
  28. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  29. package/dist/internal-common/src/types/url-shortener.types.d.ts +45 -0
  30. package/dist/internal-common/src/utils/array.d.ts +7 -0
  31. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  32. package/dist/internal-common/src/utils/file-utils.d.ts +2 -0
  33. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  34. package/dist/internal-common/src/utils/http.d.ts +5 -0
  35. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  36. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  37. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  38. package/dist/internal-common/src/utils/object.d.ts +86 -0
  39. package/dist/internal-common/src/utils/serialization.d.ts +18 -0
  40. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  41. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  42. package/dist/internal-common/src/utils/validation.d.ts +19 -0
  43. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  44. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +17 -1
  45. package/dist/typescript-client/src/ai-client.d.ts +0 -7
  46. package/dist/typescript-client/src/index.d.ts +0 -2
  47. package/dist/typescript-client/src/public-types.d.ts +0 -1
  48. package/dist/typescript-client/src/version.d.ts +1 -1
  49. package/dist/typescript-client/src/web-client.d.ts +9 -14
  50. package/package.json +1 -1
  51. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +0 -31
  52. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
  53. package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -72
  54. /package/dist/{typescript-client/src/file-utils.d.ts → internal-common/src/types/backend-function.types.d.ts} +0 -0
@@ -0,0 +1,9 @@
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_aiContextUpsert_count", "squid_aiContextDelete_count", "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_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_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_";
@@ -12,6 +12,8 @@ export interface AiAgentDatabaseIntegrationOptions {
12
12
  * When this list is not provided (i.e., it is `undefined`) or is empty, the AI agent has access to all collections.
13
13
  */
14
14
  collectionsToUse?: string[];
15
+ /** If true, disables the code interpreter when analyzing query results. Default: false. */
16
+ disableCodeInterpreter?: boolean;
15
17
  /** If true, provides more detailed status updates during AI query execution. Default: false. */
16
18
  verboseStatusUpdates?: boolean;
17
19
  /** If provided, this agent will be used to generate the query. */
@@ -33,3 +35,15 @@ export interface AiAgentApiIntegrationOptions {
33
35
  /** If provided, this agent will be used to generate API calls. */
34
36
  generateApiCallAgentId?: AiAgentId;
35
37
  }
38
+ /**
39
+ * Configuration options for AI agent MCP integration.
40
+ */
41
+ export interface AiAgentMcpIntegrationOptions {
42
+ /**
43
+ * A list of MCP tool names that the AI agent can use.
44
+ *
45
+ * When this list is not provided (i.e., it is `undefined`) or is empty,
46
+ * the AI agent has access to all tools.
47
+ */
48
+ toolsToUse?: string[];
49
+ }
@@ -1,5 +1,5 @@
1
1
  import { JSONSchema } from 'json-schema-typed';
2
- import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiEmbeddingsModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, GeminiChatModelName, GrokChatModelName, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat } from './ai-common.public-types';
2
+ import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, GeminiChatModelName, GrokChatModelName, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat } from './ai-common.public-types';
3
3
  import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
4
4
  import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
5
5
  import { AiAgentId, AiContextId, AiKnowledgeBaseId, AppId, IntegrationId } from './communication.public-types';
@@ -560,17 +560,14 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
560
560
  auditLog?: boolean;
561
561
  /** The default chat options for the agent, overridable by the user during use. */
562
562
  options: AiChatOptions<T>;
563
- /** The embedding model name used by the agent. */
564
- embeddingModelName: AiEmbeddingsModelName;
565
563
  /** Optional api key used specifically for operations on this agent */
566
564
  apiKey?: string;
567
565
  }
568
566
  /**
569
567
  * @category AI
570
568
  */
571
- export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options' | 'embeddingModelName'> & {
569
+ export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
572
570
  options?: AiChatOptions;
573
- embeddingModelName?: AiEmbeddingsModelName;
574
571
  };
575
572
  /**
576
573
  * A status message from an AI agent operation.
@@ -585,6 +582,10 @@ export interface AiStatusMessage {
585
582
  chatId?: string;
586
583
  /** The title or summary of the status message. */
587
584
  title: string;
585
+ /** Markdown body content for the status update. */
586
+ body: string;
587
+ /** ID of the parent status update for nested display. */
588
+ parentStatusUpdateId?: string;
588
589
  /** The Job ID associated with the status message. */
589
590
  jobId: JobId;
590
591
  /** Optional tags providing additional metadata about the status. */
@@ -611,14 +612,6 @@ export interface AiChatMessage {
611
612
  /** Time the entry is created. Unix time millis. */
612
613
  timestamp: number;
613
614
  }
614
- /**
615
- * Name of the tag that contains ID of the parent message.
616
- * When the tag is present, the current message should be considered in the context of the parent message.
617
- * Example: the message can contain a function call result.
618
- */
619
- export declare const AI_STATUS_MESSAGE_PARENT_MESSAGE_ID_TAG = "parent";
620
- /** The tag contains a response of the AI tool call. */
621
- export declare const AI_STATUS_MESSAGE_RESULT_TAG = "result";
622
615
  /**
623
616
  * A single chunk of data returned from an AI search operation.
624
617
  * @category AI
@@ -896,4 +889,79 @@ export interface AiGenerateImageRequest {
896
889
  /** Options for image generation */
897
890
  options?: AiGenerateImageOptions;
898
891
  }
892
+ /**
893
+ * Revision action types for agent history tracking.
894
+ * @category AI
895
+ */
896
+ export type AiAgentRevisionAction = 'created' | 'updated' | 'deleted';
897
+ /**
898
+ * Represents a single agent revision entry.
899
+ * @category AI
900
+ */
901
+ export interface AiAgentRevision {
902
+ /** The ID of the agent this revision belongs to. */
903
+ agentId: AiAgentId;
904
+ /** The revision number, incremented for each change to the agent. */
905
+ revisionNumber: number;
906
+ /** The action that triggered this revision (created, updated, or deleted). */
907
+ action: AiAgentRevisionAction;
908
+ /** Timestamp when this revision was created. */
909
+ createdAt: Date;
910
+ /** Snapshot of the agent data at the time of the revision. */
911
+ agentSnapshot: AiAgent;
912
+ }
913
+ /**
914
+ * Request to list all revisions for an agent.
915
+ * @category AI
916
+ */
917
+ export interface ListAgentRevisionsRequest {
918
+ /** The ID of the agent to list revisions for. */
919
+ agentId: AiAgentId;
920
+ }
921
+ /**
922
+ * Response containing the list of agent revisions.
923
+ * @category AI
924
+ */
925
+ export interface ListAgentRevisionsResponse {
926
+ /** The list of revisions for the agent, sorted by revision number descending. */
927
+ revisions: Array<AiAgentRevision>;
928
+ }
929
+ /**
930
+ * Request to get a specific agent revision.
931
+ * @category AI
932
+ */
933
+ export interface GetAgentRevisionRequest {
934
+ /** The ID of the agent to get the revision for. */
935
+ agentId: AiAgentId;
936
+ /** The revision number to retrieve. */
937
+ revisionNumber: number;
938
+ }
939
+ /**
940
+ * Response containing a specific agent revision.
941
+ * @category AI
942
+ */
943
+ export interface GetAgentRevisionResponse {
944
+ /** The requested revision, or undefined if not found. */
945
+ revision: AiAgentRevision | undefined;
946
+ }
947
+ /**
948
+ * Request to restore an agent to a specific revision.
949
+ * @category AI
950
+ */
951
+ export interface RestoreAgentRevisionRequest {
952
+ /** The ID of the agent to restore. */
953
+ agentId: AiAgentId;
954
+ /** The revision number to restore the agent to. */
955
+ revisionNumber: number;
956
+ }
957
+ /**
958
+ * Request to delete a specific agent revision.
959
+ * @category AI
960
+ */
961
+ export interface DeleteAgentRevisionRequest {
962
+ /** The ID of the agent whose revision should be deleted. */
963
+ agentId: AiAgentId;
964
+ /** The revision number to delete. */
965
+ revisionNumber: number;
966
+ }
899
967
  export {};
@@ -19,37 +19,34 @@ export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
19
19
  * Type of AI provider that supports file upload operations.
20
20
  * Only a subset of AI providers support file management features.
21
21
  */
22
- export type AiFileProviderType = Extract<AiProviderType, 'openai' | 'gemini' | 'anthropic'>;
22
+ export type AiFileProviderType = Extract<AiProviderType, 'openai' | 'gemini' | 'anthropic' | 'grok'>;
23
23
  /**
24
+ * Public OpenAI chat model names (active models only).
24
25
  * @category AI
25
26
  */
26
- export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini"];
27
+ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5-mini", "gpt-5-nano", "gpt-5.2", "gpt-5.2-pro"];
27
28
  /**
29
+ * Public Gemini chat model names (active models only).
28
30
  * @category AI
29
31
  */
30
- export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
32
+ export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-3-pro", "gemini-3-flash", "gemini-2.5-flash-lite"];
31
33
  /**
32
- * Notes:
33
- * - 'grok-3-mini' model os ~10x less expensive than 'grok-3'.
34
- * - '*-fast' models are ~2x more expensive than non-fast variants and only marginally faster.
35
- * - 'grok-4' cost is comparable to 'grok-3-fast'.
36
- *
34
+ * Public Grok chat model names (active models only).
37
35
  * @category AI
38
36
  */
39
- export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
37
+ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
40
38
  /**
39
+ * Public Anthropic chat model names (active models only).
41
40
  * @category AI
42
41
  */
43
- export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
42
+ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-haiku-4-5-20251001", "claude-opus-4-5-20251101", "claude-sonnet-4-5-20250929"];
44
43
  /**
45
44
  * The supported AI model names.
46
45
  * @category AI
47
46
  */
48
- export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
49
- /**
50
- * Check if the given model name is a global AI chat model name.
51
- */
52
- export declare function isVendorAiChatModelName(modelName: string): modelName is (typeof VENDOR_AI_CHAT_MODEL_NAMES)[number];
47
+ export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5-mini", "gpt-5-nano", "gpt-5.2", "gpt-5.2-pro", "claude-haiku-4-5-20251001", "claude-opus-4-5-20251101", "claude-sonnet-4-5-20250929", "gemini-3-pro", "gemini-3-flash", "gemini-2.5-flash-lite", "grok-4", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
48
+ /** Checks if the given model name is a global AI chat model name. */
49
+ export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
53
50
  /**
54
51
  * @category AI
55
52
  */
@@ -77,6 +77,12 @@ export interface AiQueryGenerateQueryOptions {
77
77
  * If provided, the AI Query process will use this agent to generate a query.
78
78
  */
79
79
  agentId?: AiAgentId;
80
+ /**
81
+ * When enabled, allows the AI to ask for clarification instead of attempting to generate
82
+ * a query when the request is ambiguous, too complex, or impossible to answer with the
83
+ * available schema. Default: false.
84
+ */
85
+ allowClarification?: boolean;
80
86
  }
81
87
  /** Options for the query result analysis. */
82
88
  export interface AiQueryAnalyzeResultsOptions {
@@ -107,6 +113,14 @@ export interface AiQueryResponse {
107
113
  rawResultsUrl?: string;
108
114
  /** Indicates whether the query execution was successful. */
109
115
  success: boolean;
116
+ /** Indicates whether code interpreter was used to analyze the results. */
117
+ usedCodeInterpreter?: boolean;
118
+ /**
119
+ * When the AI needs clarification to generate a query, this field contains the clarification question.
120
+ * Only populated when `generateQueryOptions.allowClarification` is enabled and the AI determines
121
+ * it cannot generate a valid query without more information.
122
+ */
123
+ clarificationQuestion?: string;
110
124
  }
111
125
  /**
112
126
  * Details of an executed query, including the query text and result type.
@@ -4,13 +4,13 @@ export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents
4
4
  /**
5
5
  * @category Database
6
6
  */
7
- export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "sap_hana", "snowflake", "elasticsearch", "legend"];
7
+ export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "sap_hana", "snowflake", "elasticsearch", "legend"];
8
8
  /**
9
9
  * @category Auth
10
10
  */
11
11
  export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "keycloak", "descope", "firebase_auth"];
12
12
  /** Supported integration types for GraphQL-based services. */
13
- export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql", "linear"];
13
+ export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql"];
14
14
  /** Supported integration types for HTTP-based services. */
15
15
  export declare const HTTP_INTEGRATION_TYPES: readonly ["api"];
16
16
  /** Represents a supported integration type identifier, such as 'postgres', 'auth0', or 's3'. */
@@ -37,6 +37,28 @@ export interface WebGetUrlContentResponse {
37
37
  /** The content fetched from the URL in Markdown format. */
38
38
  markdownText: string;
39
39
  }
40
+ /**
41
+ * Options for creating a shortened URL.
42
+ */
43
+ export interface CreateShortUrlOptions {
44
+ /** The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). */
45
+ url: string;
46
+ /** Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. */
47
+ secondsToLive?: number;
48
+ /** Optional file extension to include in the shortened URL ID (e.g., 'pdf', 'html'). The extension becomes part of the ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
49
+ fileExtension?: string;
50
+ }
51
+ /**
52
+ * Options for creating multiple shortened URLs.
53
+ */
54
+ export interface CreateShortUrlsOptions {
55
+ /** The URLs to shorten. They must be valid URLs and should include the protocol (start with http:// or https://). */
56
+ urls: string[];
57
+ /** Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. */
58
+ secondsToLive?: number;
59
+ /** Optional file extension to include in all shortened URL IDs (e.g., 'pdf', 'html'). The extension becomes part of each ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
60
+ fileExtension?: string;
61
+ }
40
62
  /**
41
63
  * Request to create a shortened URL.
42
64
  */
@@ -45,6 +67,8 @@ export interface WebShortUrlRequest {
45
67
  url: string;
46
68
  /** Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. */
47
69
  secondsToLive?: number;
70
+ /** Optional file extension to include in the shortened URL ID (e.g., 'pdf', 'html'). The extension becomes part of the ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
71
+ fileExtension?: string;
48
72
  }
49
73
  /**
50
74
  * Request to create shortened URLs.
@@ -54,6 +78,8 @@ export interface WebShortUrlBulkRequest {
54
78
  urls: string[];
55
79
  /** Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. */
56
80
  secondsToLive?: number;
81
+ /** Optional file extension to include in all shortened URL IDs (e.g., 'pdf', 'html'). The extension becomes part of each ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
82
+ fileExtension?: string;
57
83
  }
58
84
  /**
59
85
  * Response with the newly created shortened URL.
@@ -0,0 +1,30 @@
1
+ import { ApiOptions } from '../public-types/api-client.public-types';
2
+ import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types';
3
+ import { IntegrationId } from '../public-types/communication.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
+ /**
16
+ * Represents a request to call an API through a specified integration and endpoint.
17
+ * Includes optional method override and additional request options.
18
+ */
19
+ export interface CallApiRequest<BodyType = any> {
20
+ /** The identifier of the integration through which the API is called. */
21
+ integrationId: IntegrationId;
22
+ /** Target API endpoint to invoke. */
23
+ endpointId: ApiEndpointId;
24
+ /** Optional request payload. */
25
+ body?: BodyType;
26
+ /** Optional HTTP method override. Default is POST. */
27
+ overrideMethod?: HttpMethod;
28
+ /** Additional request options. */
29
+ options: ApiOptions;
30
+ }
@@ -0,0 +1,148 @@
1
+ import { SquidDocIdObj, SquidDocument } from '../public-types/document.public-types';
2
+ import { Paths } from '../public-types/typescript.public-types';
3
+ /**
4
+ * The mutation type.
5
+ * @category Database
6
+ */
7
+ export declare const MUTATION_TYPES: readonly ["insert", "update", "delete"];
8
+ /**
9
+ * @category Database
10
+ */
11
+ export type MutationType = (typeof MUTATION_TYPES)[number];
12
+ interface BaseMutation {
13
+ type: MutationType;
14
+ squidDocIdObj: SquidDocIdObj;
15
+ }
16
+ /**
17
+ * A mutation on a document.
18
+ * @category Database
19
+ */
20
+ export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
21
+ /**
22
+ * Represents a delete mutation on a document.
23
+ * @category Database
24
+ */
25
+ export interface DeleteMutation extends BaseMutation {
26
+ /** Specifies that the mutation is a deletion. */
27
+ type: 'delete';
28
+ }
29
+ /**
30
+ * Represents an update mutation on a document.
31
+ * @category Database
32
+ */
33
+ export interface UpdateMutation<T = any> extends BaseMutation {
34
+ /** Specifies that the mutation is an update. */
35
+ type: 'update';
36
+ /** The updated properties */
37
+ properties: {
38
+ [key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
39
+ };
40
+ }
41
+ /**
42
+ * Represents an insert mutation on a document.
43
+ * @category Database
44
+ */
45
+ export interface InsertMutation<T = any> extends BaseMutation {
46
+ /** Specifies that the mutation is an insertion. */
47
+ type: 'insert';
48
+ /** The inserted document */
49
+ properties: T;
50
+ }
51
+ /**
52
+ * A representation of a single property update.
53
+ * @category Database
54
+ */
55
+ export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
56
+ /**
57
+ * A value update property mutation.
58
+ * @category Database
59
+ */
60
+ export interface ValueUpdatePropertyMutation<Value = any> {
61
+ /** Specifies that the mutation updates a value. */
62
+ type: 'update';
63
+ /** New value to be set. */
64
+ value: Value;
65
+ }
66
+ /**
67
+ * Applying a numeric function to a property.
68
+ * @category Database
69
+ */
70
+ export interface ApplyNumericFnPropertyMutation {
71
+ /** Specifies that the mutation applies a numeric function. */
72
+ type: 'applyNumericFn';
73
+ /** Numeric function to apply. */
74
+ fn: 'increment';
75
+ /** Value to use in the numeric function. */
76
+ value: number;
77
+ }
78
+ /**
79
+ * A property update that removes a property from a document.
80
+ * @category Database
81
+ */
82
+ export interface RemovePropertyMutation {
83
+ /** Specifies that the mutation removes a property. */
84
+ type: 'removeProperty';
85
+ }
86
+ interface ApplyExtendString {
87
+ /** Specifies that the mutation applies a string function. */
88
+ type: 'applyStringFn';
89
+ /** String function to extend the existing string. */
90
+ fn: 'extendString';
91
+ /** String value to append. */
92
+ value: string;
93
+ }
94
+ interface ApplyTrimString {
95
+ /** Specifies that the mutation applies a string function. */
96
+ type: 'applyStringFn';
97
+ /** String function to trim the existing string. */
98
+ fn: 'trim';
99
+ }
100
+ /**
101
+ * A property mutation that modifies a string.
102
+ * @category Database
103
+ */
104
+ export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
105
+ /**
106
+ * The before and after documents of a document change.
107
+ * @category Database
108
+ */
109
+ export interface BeforeAndAfterDocs<T = SquidDocument> {
110
+ /** Document state before the mutation. */
111
+ before: T | undefined;
112
+ /** Document state after the mutation. */
113
+ after: T | undefined;
114
+ }
115
+ /**
116
+ * The mutation context that will be provided to the security function.
117
+ * @category Database
118
+ */
119
+ export declare class MutationContext<T = any> {
120
+ readonly mutation: Mutation<T>;
121
+ readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
122
+ readonly serverTimeStamp: Date;
123
+ /**
124
+ * Returns the state of the document before the mutation was applied.
125
+ */
126
+ get before(): T | undefined;
127
+ /**
128
+ * Returns the state of the document after the mutation was applied.
129
+ */
130
+ get after(): T | undefined;
131
+ /**
132
+ * Returns the type of the mutation (insert, update, or delete).
133
+ */
134
+ getMutationType(): MutationType;
135
+ /** Returns true if the mutation affects the provided path. */
136
+ affectsPath(path: Paths<T>): boolean;
137
+ /**
138
+ * Find all affected paths starting from a root path.
139
+ *
140
+ * @example
141
+ * doc before - { a: { b: 1, c: 2 }, d: 3 }
142
+ * doc after - { a: { b: 1, c: 3 }, d: 4 }
143
+ * doc.affectedPaths('a') // ['a.c']
144
+ */
145
+ affectedPaths(startingRoot?: Paths<T> | string): Array<Paths<T>>;
146
+ private checkPath;
147
+ }
148
+ export {};
@@ -0,0 +1,72 @@
1
+ import { IntegrationId } from '../public-types/communication.public-types';
2
+ /**
3
+ * Represents the type of native query request, either relational, elastic or MongoDB.
4
+ * @category Database
5
+ */
6
+ export type NativeQueryRequestType = 'relational' | 'mongo' | 'elasticsearch' | 'pure';
7
+ interface BaseNativeQueryContext {
8
+ /** Type of the native query request. */
9
+ type: NativeQueryRequestType;
10
+ /** Identifier for the integration. */
11
+ integrationId: IntegrationId;
12
+ }
13
+ /**
14
+ * Context for executing a relational database query.
15
+ * @category Database
16
+ */
17
+ export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
18
+ /** Specifies that the query is for a relational database. */
19
+ type: 'relational';
20
+ /** SQL query string to be executed. */
21
+ query: string;
22
+ /** Parameters to be used in the query. */
23
+ params: Record<string, any>;
24
+ }
25
+ /**
26
+ * Context for executing a MongoDB query.
27
+ * @category Database
28
+ */
29
+ export interface MongoNativeQueryContext extends BaseNativeQueryContext {
30
+ /** Specifies that the query is for a Mongo database. */
31
+ type: 'mongo';
32
+ /** Name of the MongoDB collection to query. */
33
+ collectionName: string;
34
+ /** Array of aggregation pipeline stages. */
35
+ aggregationPipeline: Array<any | undefined>;
36
+ }
37
+ /**
38
+ * Context for executing an Elasticsearch query.
39
+ * @category Database
40
+ */
41
+ export interface ElasticsearchNativeQueryContext {
42
+ /** Specifies that the query is for an Elasticsearch database. */
43
+ type: 'elasticsearch';
44
+ /** Elasticsearch index to query. */
45
+ index: string;
46
+ /** Elasticsearch query string. */
47
+ endpoint?: string;
48
+ /** HTTP method to use for the request. */
49
+ method?: 'GET' | 'POST';
50
+ /** Body of the request. */
51
+ body: Record<string, any>;
52
+ /** Headers to include in the request. */
53
+ integrationId: IntegrationId;
54
+ }
55
+ /**
56
+ * Context for executing a pure database query.
57
+ * @category Database
58
+ */
59
+ export interface PureNativeQueryContext extends BaseNativeQueryContext {
60
+ /** Specifies that the query is for a relational database. */
61
+ type: 'pure';
62
+ /** SQL query string to be executed. */
63
+ query: string;
64
+ /** Parameters to be used in the query. */
65
+ params: Record<string, any>;
66
+ }
67
+ /**
68
+ * Union type representing either a relational or MongoDB native query context.
69
+ * @category Database
70
+ */
71
+ export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext | ElasticsearchNativeQueryContext | PureNativeQueryContext;
72
+ export {};