@squidcloud/client 1.0.477 → 1.0.478
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.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +31 -12
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +2 -2
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +8 -2
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/metadata-filter.public-types.d.ts +27 -10
- package/dist/internal-common/src/public-types/query.public-types.d.ts +5 -2
- package/dist/internal-common/src/public-utils/id-utils.d.ts +1 -4
- package/dist/typescript-client/src/execute-function-options.d.ts +1 -2
- package/dist/typescript-client/src/public-types.d.ts +1 -0
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +1 -6
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +1 -6
- package/dist/typescript-client/src/query/query.types.d.ts +7 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/metric-name.d.ts +0 -14
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -148
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -72
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -190
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -242
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -202
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -59
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/file.types.d.ts +0 -6
- package/dist/internal-common/src/types/headers.types.d.ts +0 -17
- package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/notification.types.d.ts +0 -5
- package/dist/internal-common/src/types/observability.types.d.ts +0 -163
- package/dist/internal-common/src/types/query.types.d.ts +0 -15
- package/dist/internal-common/src/types/secret.types.d.ts +0 -7
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/stage.d.ts +0 -9
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
- package/dist/internal-common/src/utils/array.d.ts +0 -7
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http.d.ts +0 -11
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -86
- package/dist/internal-common/src/utils/serialization.d.ts +0 -18
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -6
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -19
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -61,7 +61,11 @@ export interface GptImageOptions extends BaseAiGenerateImageOptions {
|
|
|
61
61
|
/** The number of images to generate; defaults to 1. */
|
|
62
62
|
numberOfImagesToGenerate?: number;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Base options shared by all OpenAI audio transcription models.
|
|
66
|
+
* @category AI
|
|
67
|
+
*/
|
|
68
|
+
export interface BaseOpenAiAudioTranscribeOptions extends BaseAiAudioTranscribeOptions {
|
|
65
69
|
/** Specifies the model for audio transcription. */
|
|
66
70
|
modelName: OpenAiAudioTranscriptionModelName;
|
|
67
71
|
/** The temperature for sampling during transcription; defaults to model-specific value. */
|
|
@@ -423,15 +427,17 @@ export interface BaseAiChatOptions {
|
|
|
423
427
|
/** The context ID to use for the request. If not provided, the agent's default context will be used. */
|
|
424
428
|
memoryOptions?: AiAgentMemoryOptions;
|
|
425
429
|
/**
|
|
426
|
-
* Names a
|
|
427
|
-
* runs in
|
|
428
|
-
* one ask persist and are visible to later asks reusing the same id —
|
|
430
|
+
* Names a persistent working directory for CLI-backed agents (`claude-code`, `codex`). When set, the
|
|
431
|
+
* agent runs in a directory keyed by this id, synced across pod replicas via the shared workspace
|
|
432
|
+
* server, so files created in one ask persist and are visible to later asks reusing the same id —
|
|
433
|
+
* including across providers.
|
|
429
434
|
*
|
|
430
435
|
* Pass the same id consistently for a conversation; changing it points the agent at a different
|
|
431
436
|
* directory (and, for Claude Code, starts a fresh transcript). Must match `[A-Za-z0-9_-]` (1-200 chars).
|
|
432
|
-
* Ignored by non-CLI agents and when
|
|
437
|
+
* Ignored by non-CLI agents and when the workspace server is unconfigured (falls back to a pod-local,
|
|
438
|
+
* non-synced, ephemeral dir).
|
|
433
439
|
*/
|
|
434
|
-
|
|
440
|
+
workspaceId?: string;
|
|
435
441
|
/** Whether to disable the whole context for the request. Default to false. */
|
|
436
442
|
disableContext?: boolean;
|
|
437
443
|
/**
|
|
@@ -799,9 +805,16 @@ export interface AiAgentContext {
|
|
|
799
805
|
* @category AI
|
|
800
806
|
*/
|
|
801
807
|
export type AgentContextRequest = TextContextRequest | FileContextRequest;
|
|
802
|
-
|
|
808
|
+
/**
|
|
809
|
+
* Base fields shared by all agent context requests.
|
|
810
|
+
* @category AI
|
|
811
|
+
*/
|
|
812
|
+
export interface BaseContextRequest {
|
|
813
|
+
/** The unique identifier of the context item. */
|
|
803
814
|
contextId: string;
|
|
815
|
+
/** The type of the context content. */
|
|
804
816
|
type: AiKnowledgeBaseContextType;
|
|
817
|
+
/** Optional metadata associated with the context item. */
|
|
805
818
|
metadata?: AiContextMetadata;
|
|
806
819
|
}
|
|
807
820
|
/**
|
|
@@ -981,6 +994,12 @@ export interface UserAiAskResponse {
|
|
|
981
994
|
cacheWriteInputTokens?: number;
|
|
982
995
|
/** Total request cost in USD as reported by the provider. Only set by providers that compute it (e.g. claude-code). */
|
|
983
996
|
totalCostUsd?: number;
|
|
997
|
+
/**
|
|
998
|
+
* True when the run succeeded but persisting its workspace (push) failed, so the working-directory
|
|
999
|
+
* changes made during this ask may not survive to the next one. Only ever set for workspace-backed CLI
|
|
1000
|
+
* agents; absent otherwise.
|
|
1001
|
+
*/
|
|
1002
|
+
workspacePushFailed?: boolean;
|
|
984
1003
|
}
|
|
985
1004
|
/** Represents an annotation in the AI response. */
|
|
986
1005
|
export type AiAnnotation = AiFileAnnotation;
|
|
@@ -1002,10 +1021,11 @@ export type AiSessionContext = {
|
|
|
1002
1021
|
/** The ID of the job associated with the session. */
|
|
1003
1022
|
jobId: JobId;
|
|
1004
1023
|
/**
|
|
1005
|
-
* The
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*
|
|
1024
|
+
* The chat timeout (in milliseconds) the root chat request explicitly set. Present only when
|
|
1025
|
+
* the root request passed `timeoutMs`. Nested AI operations (e.g. AI-query stages spawned by a
|
|
1026
|
+
* tool call) budget against it so a long-running parent chat is not silently capped by the
|
|
1027
|
+
* nested defaults; explicitly configured per-stage `aiOptions.timeoutMs` is more specific and
|
|
1028
|
+
* takes precedence over it.
|
|
1009
1029
|
*/
|
|
1010
1030
|
timeoutMs?: number;
|
|
1011
1031
|
};
|
|
@@ -1160,4 +1180,3 @@ export interface ListChatModelsResponse {
|
|
|
1160
1180
|
/** All chat models available to the application. */
|
|
1161
1181
|
models: Array<ModelIdSpec>;
|
|
1162
1182
|
}
|
|
1163
|
-
export {};
|
|
@@ -24,7 +24,7 @@ export type AiFileProviderType = Extract<AiProviderType, 'openai' | 'gemini' | '
|
|
|
24
24
|
* Public OpenAI chat model names (active models only).
|
|
25
25
|
* @category AI
|
|
26
26
|
*/
|
|
27
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.5-pro"];
|
|
27
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.5-pro", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"];
|
|
28
28
|
/**
|
|
29
29
|
* Public Gemini chat model names (active models only).
|
|
30
30
|
* @category AI
|
|
@@ -44,7 +44,7 @@ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-haiku-4-5-202
|
|
|
44
44
|
* The supported AI model names.
|
|
45
45
|
* @category AI
|
|
46
46
|
*/
|
|
47
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.5-pro", "claude-haiku-4-5-20251001", "claude-opus-4-8", "claude-sonnet-5", "gemini-3.1-pro", "gemini-3.5-flash", "gemini-3.1-flash-lite", "grok-4.3", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
47
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.5-pro", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "claude-haiku-4-5-20251001", "claude-opus-4-8", "claude-sonnet-5", "gemini-3.1-pro", "gemini-3.5-flash", "gemini-3.1-flash-lite", "grok-4.3", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
48
48
|
/** Checks if the given model name is a global AI chat model name. */
|
|
49
49
|
export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
|
|
50
50
|
/**
|
|
@@ -222,9 +222,16 @@ export type AiKnowledgeBaseContextType = 'text' | 'file';
|
|
|
222
222
|
* @category AI
|
|
223
223
|
*/
|
|
224
224
|
export type AiKnowledgeBaseContextRequest = AiKnowledgeBaseTextContextRequest | AiKnowledgeBaseFileContextRequest;
|
|
225
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Base fields shared by all knowledge base context requests.
|
|
227
|
+
* @category AI
|
|
228
|
+
*/
|
|
229
|
+
export interface BaseAiKnowledgeBaseContextRequest {
|
|
230
|
+
/** The unique identifier of the context item. */
|
|
226
231
|
contextId: string;
|
|
232
|
+
/** The type of the context content. */
|
|
227
233
|
type: AiKnowledgeBaseContextType;
|
|
234
|
+
/** Optional metadata associated with the context item. */
|
|
228
235
|
metadata?: AiContextMetadata;
|
|
229
236
|
}
|
|
230
237
|
/**
|
|
@@ -568,4 +575,3 @@ export interface GeneratedMetadataFieldDescription {
|
|
|
568
575
|
/** The AI-generated description for the field. */
|
|
569
576
|
description: string;
|
|
570
577
|
}
|
|
571
|
-
export {};
|
|
@@ -17,7 +17,7 @@ export type FunctionName = string;
|
|
|
17
17
|
*/
|
|
18
18
|
export interface AiFunctionIdWithContext {
|
|
19
19
|
/**
|
|
20
|
-
* The ID of the AI function as described in
|
|
20
|
+
* The ID of the AI function as described in the `@aiFunction` decorator.
|
|
21
21
|
* Historically named as 'name' because AI function name is the default value for 'ID'.
|
|
22
22
|
*/
|
|
23
23
|
name: AiFunctionId;
|
|
@@ -4,7 +4,7 @@ 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", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "
|
|
7
|
+
export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "snowflake", "elasticsearch", "legend"];
|
|
8
8
|
/**
|
|
9
9
|
* @category Auth
|
|
10
10
|
*/
|
|
@@ -12,31 +12,49 @@
|
|
|
12
12
|
export type MetadataValue = number | string | boolean | undefined;
|
|
13
13
|
/** Array of metadata values (used by `$in` / `$nin`). */
|
|
14
14
|
export type MetadataValueArray = MetadataValue[];
|
|
15
|
-
|
|
15
|
+
/** Matches when the field equals the given value. */
|
|
16
|
+
export interface MetadataEqFilter {
|
|
17
|
+
/** The value the field must equal. */
|
|
16
18
|
$eq: MetadataValue;
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
/** Matches when the field does not equal the given value. */
|
|
21
|
+
export interface MetadataNeFilter {
|
|
22
|
+
/** The value the field must not equal. */
|
|
19
23
|
$ne: MetadataValue;
|
|
20
24
|
}
|
|
21
|
-
|
|
25
|
+
/** Matches when the field is greater than the given value. */
|
|
26
|
+
export interface MetadataGtFilter {
|
|
27
|
+
/** The value the field must be greater than. */
|
|
22
28
|
$gt: number;
|
|
23
29
|
}
|
|
24
|
-
|
|
30
|
+
/** Matches when the field is greater than or equal to the given value. */
|
|
31
|
+
export interface MetadataGteFilter {
|
|
32
|
+
/** The value the field must be greater than or equal to. */
|
|
25
33
|
$gte: number;
|
|
26
34
|
}
|
|
27
|
-
|
|
35
|
+
/** Matches when the field is less than the given value. */
|
|
36
|
+
export interface MetadataLtFilter {
|
|
37
|
+
/** The value the field must be less than. */
|
|
28
38
|
$lt: number;
|
|
29
39
|
}
|
|
30
|
-
|
|
40
|
+
/** Matches when the field is less than or equal to the given value. */
|
|
41
|
+
export interface MetadataLteFilter {
|
|
42
|
+
/** The value the field must be less than or equal to. */
|
|
31
43
|
$lte: number;
|
|
32
44
|
}
|
|
33
|
-
|
|
45
|
+
/** Matches when the field value is one of the given values. */
|
|
46
|
+
export interface MetadataInFilter {
|
|
47
|
+
/** The values the field must be one of. */
|
|
34
48
|
$in: MetadataValueArray;
|
|
35
49
|
}
|
|
36
|
-
|
|
50
|
+
/** Matches when the field value is not one of the given values. */
|
|
51
|
+
export interface MetadataNinFilter {
|
|
52
|
+
/** The values the field must not be one of. */
|
|
37
53
|
$nin: MetadataValueArray;
|
|
38
54
|
}
|
|
39
|
-
|
|
55
|
+
/** Matches based on whether the field exists. */
|
|
56
|
+
export interface MetadataExistsFilter {
|
|
57
|
+
/** Whether the field must exist. */
|
|
40
58
|
$exists: boolean;
|
|
41
59
|
}
|
|
42
60
|
/** A single-field operator: one of `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$exists`. */
|
|
@@ -82,4 +100,3 @@ export interface MetadataOrFilter {
|
|
|
82
100
|
* ```
|
|
83
101
|
*/
|
|
84
102
|
export type MetadataFilter = MetadataFieldFilter | MetadataAndFilter | MetadataOrFilter;
|
|
85
|
-
export {};
|
|
@@ -60,7 +60,11 @@ export interface CompositeCondition<Doc extends DocumentData = any> {
|
|
|
60
60
|
/** An array of simple conditions with restricted operators for composite evaluation. */
|
|
61
61
|
fields: Array<SimpleCondition<Doc, Paths<Doc>, CompositeConditionOperator>>;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Set of operators supported by `CompositeCondition`.
|
|
65
|
+
* @category Database
|
|
66
|
+
*/
|
|
67
|
+
export type CompositeConditionOperator = '>=' | '<=' | '>' | '<';
|
|
64
68
|
/**
|
|
65
69
|
* Set of operators supported by `DocIdCondition`.
|
|
66
70
|
* @category Database
|
|
@@ -143,4 +147,3 @@ export interface LimitBy<Doc extends DocumentData = any> {
|
|
|
143
147
|
/** Indicates whether to reverse the sort order for this limit. */
|
|
144
148
|
reverseSort: boolean;
|
|
145
149
|
}
|
|
146
|
-
export {};
|
|
@@ -19,10 +19,7 @@ export declare const DEFAULT_SHORT_ID_LENGTH = 18;
|
|
|
19
19
|
export declare function generateShortId(length?: number, prefix?: string, prefixToAvoid?: string): string;
|
|
20
20
|
/**
|
|
21
21
|
* Generates a set of unique IDs under the same behavior as `generateShortId`.
|
|
22
|
-
*
|
|
23
|
-
* @param length The length of the ID to be generated. Default is 18.
|
|
24
|
-
* @param prefix The prefix of the generated ID. Default is an empty string.
|
|
25
|
-
* @param count The number of IDs to be generated.
|
|
22
|
+
* See `GenerateShortIdsOptions` for the available options.
|
|
26
23
|
*/
|
|
27
24
|
export declare function generateShortIds({ count, length, prefix }: GenerateShortIdsOptions): string[];
|
|
28
25
|
/**
|
|
@@ -48,7 +48,7 @@ export interface ExecuteFunctionCachedResult<T> {
|
|
|
48
48
|
cacheTimeMillis: number;
|
|
49
49
|
}
|
|
50
50
|
/** Options for `LastUsedValueExecuteFunctionCache`. */
|
|
51
|
-
interface LastUsedValueExecuteFunctionCacheOptions {
|
|
51
|
+
export interface LastUsedValueExecuteFunctionCacheOptions {
|
|
52
52
|
/** Argument equality comparator. */
|
|
53
53
|
argsComparator: ExecuteFunctionArgsComparator;
|
|
54
54
|
/** Validity duration in milliseconds. */
|
|
@@ -70,4 +70,3 @@ export interface ConcurrentCallDeduplicationOptions {
|
|
|
70
70
|
/** Comparator to determine if concurrent calls are equivalent. */
|
|
71
71
|
argsComparator: ExecuteFunctionArgsComparator;
|
|
72
72
|
}
|
|
73
|
-
export {};
|
|
@@ -20,6 +20,7 @@ export * from '../../internal-common/src/public-types/extraction.public-types';
|
|
|
20
20
|
export * from '../../internal-common/src/public-types/http-status.public-types';
|
|
21
21
|
export * from '../../internal-common/src/public-types/integration.public-types';
|
|
22
22
|
export * from '../../internal-common/src/public-types/job.public-types';
|
|
23
|
+
export * from '../../internal-common/src/public-types/metadata-filter.public-types';
|
|
23
24
|
export * from '../../internal-common/src/public-types/metric.public-types';
|
|
24
25
|
export * from '../../internal-common/src/public-types/openapi.public-types';
|
|
25
26
|
export * from '../../internal-common/src/public-types/query.public-types';
|
|
@@ -3,12 +3,8 @@ import { DocumentReference } from '../document-reference';
|
|
|
3
3
|
import { Alias, DOC_ID_FIELD, DocIdOrDocIdObj, DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, Query, SerializedJoinQuery, SimpleCondition } from '../public-types';
|
|
4
4
|
import { Pagination, PaginationOptions } from './pagination';
|
|
5
5
|
import { BaseQueryBuilder, HasDereference, QueryBuilder } from './query-builder.factory';
|
|
6
|
+
import { ProjectedResult } from './query.types';
|
|
6
7
|
import { SnapshotEmitter } from './snapshot-emitter';
|
|
7
|
-
/** Result type after projection: only the selected fields.
|
|
8
|
-
* Note: __docId__ and PKs are still returned at runtime, but not included in the type.
|
|
9
|
-
* Users must explicitly project fields they want in the type.
|
|
10
|
-
*/
|
|
11
|
-
type ProjectedResult<T, K extends keyof T> = Pick<T, K>;
|
|
12
8
|
/**
|
|
13
9
|
* Represents the result of a join query where each property is a document reference,
|
|
14
10
|
* grouped by alias instead of containing DocumentData.
|
|
@@ -325,4 +321,3 @@ export declare class GroupedJoin<Aliases extends Record<Alias, Alias[]>, ReturnT
|
|
|
325
321
|
paginate(options?: Partial<PaginationOptions>): Pagination<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>;
|
|
326
322
|
private groupData;
|
|
327
323
|
}
|
|
328
|
-
export {};
|
|
@@ -2,12 +2,8 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { DocumentReference } from '../document-reference';
|
|
3
3
|
import { DOC_ID_FIELD, DocIdOrDocIdObj, DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, Query, QueryDeleteResult, SerializedSimpleQuery, SimpleCondition } from '../public-types';
|
|
4
4
|
import { Pagination, PaginationOptions } from './pagination';
|
|
5
|
+
import { ProjectedResult } from './query.types';
|
|
5
6
|
import { SnapshotEmitter } from './snapshot-emitter';
|
|
6
|
-
/** Result type after projection: only the selected fields.
|
|
7
|
-
* Note: __docId__ and PKs are still returned at runtime, but not included in the type.
|
|
8
|
-
* Users must explicitly project fields they want in the type.
|
|
9
|
-
*/
|
|
10
|
-
type ProjectedResult<T, K extends keyof T> = Pick<T, K>;
|
|
11
7
|
/**
|
|
12
8
|
* Interface used solely for inheritDoc
|
|
13
9
|
* @category Database
|
|
@@ -275,4 +271,3 @@ export declare class Changes<DocumentType extends DocumentData> {
|
|
|
275
271
|
/** The actual document data that was deleted from the query result */
|
|
276
272
|
readonly deletes: Array<DocumentType>;
|
|
277
273
|
}
|
|
278
|
-
export {};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Alias, SquidDocument } from '../public-types';
|
|
2
2
|
/** Two transactions cannot run in parallel - this mutex is used for blocking a second transaction. */
|
|
3
3
|
export declare const RUN_IN_TRANSACTION_MUTEX = "dataManager_runInTransaction";
|
|
4
|
+
/**
|
|
5
|
+
* Result type after projection: only the selected fields.
|
|
6
|
+
* Note: __docId__ and PKs are still returned at runtime, but not included in the type.
|
|
7
|
+
* Users must explicitly project fields they want in the type.
|
|
8
|
+
* @category Database
|
|
9
|
+
*/
|
|
10
|
+
export type ProjectedResult<T, K extends keyof T> = Pick<T, K>;
|
|
4
11
|
/**
|
|
5
12
|
* Represents a collection of documents associated with a specific alias
|
|
6
13
|
* in a query, typically used in joined query results.
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Names of the Squid metrics.
|
|
3
|
-
*
|
|
4
|
-
* This list and its Kotlin counterpart (MetricName.kt) may diverge:
|
|
5
|
-
* each side declares only the metrics that its own backend emits.
|
|
6
|
-
* However, metrics emitted by both backends MUST use identical names on both sides —
|
|
7
|
-
* otherwise dashboards and metric queries that mix data from both sources will break.
|
|
8
|
-
*
|
|
9
|
-
* See MetricName.kt for documentation on each value.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatReasoningTokens_count", "squid_aiChatbotChatCacheReadInputTokens_count", "squid_aiChatbotChatCacheWriteInputTokens_count", "squid_aiChatbotChatCostUsd_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_apiControllerCall_count", "squid_apiControllerCall_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_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_eventHandler_count", "squid_eventHandler_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", "squid_acquireLock_count", "squid_acquireLock_time", "squid_releaseLock_count", "squid_releaseLock_time"];
|
|
12
|
-
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
13
|
-
/** Common prefix for all Squid metrics. */
|
|
14
|
-
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,72 +0,0 @@
|
|
|
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 {};
|