@squidcloud/client 1.0.145 → 1.0.146-beta
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 -53942
- package/dist/esm/index.js +1 -0
- package/dist/internal-common/src/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +47 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +895 -0
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +31 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +185 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +431 -0
- package/dist/internal-common/src/public-types/ai-matchmaking.public-types.d.ts +186 -0
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +170 -0
- package/dist/internal-common/src/public-types/api-client.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/api.public-types.d.ts +91 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +50 -0
- package/dist/{common/src/backend-function.schemas.d.ts → internal-common/src/public-types/code-executor.public-types.d.ts} +1 -1
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +83 -0
- package/dist/internal-common/src/public-types/document.public-types.d.ts +71 -0
- package/dist/internal-common/src/public-types/external-auth/external-auth.public-types.d.ts +39 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +183 -0
- package/dist/internal-common/src/public-types/http-status.public-types.d.ts +415 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/job.public-types.d.ts +59 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +154 -0
- package/dist/internal-common/src/public-types/openapi.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +113 -0
- package/dist/internal-common/src/public-types/regions.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +43 -0
- package/dist/{common/src/schema/schema.types.d.ts → internal-common/src/public-types/schema.public-types.d.ts} +54 -54
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +60 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +4 -0
- package/dist/{common/src/types.d.ts → internal-common/src/public-types/typescript.public-types.d.ts} +20 -14
- package/dist/internal-common/src/public-types/web.public-types.d.ts +93 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
- package/dist/{common/src/query/query-context.d.ts → internal-common/src/public-types-backend/query.public-context.d.ts} +177 -137
- package/dist/{common/src/ai-chatbot.schemas.d.ts → internal-common/src/public-utils/context-utils.d.ts} +1 -1
- package/dist/internal-common/src/public-utils/id-utils.d.ts +44 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +199 -0
- package/dist/{common/src/mutation.schemas.d.ts → internal-common/src/types/ai-assistant.types.d.ts} +1 -1
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
- package/dist/{common/src → internal-common/src/types}/backend-function.types.d.ts +1 -1
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +17 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/internal-common/src/types/observability.types.d.ts +78 -0
- package/dist/internal-common/src/types/query.types.d.ts +13 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/{common/src → internal-common/src/types}/time-units.d.ts +1 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/{common → internal-common}/src/utils/global.utils.d.ts +1 -1
- package/dist/internal-common/src/utils/http.d.ts +5 -0
- package/dist/{common → internal-common}/src/utils/lock.manager.d.ts +14 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +58 -0
- package/dist/internal-common/src/utils/serialization.d.ts +17 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/{common → internal-common}/src/websocket.impl.d.ts +26 -21
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/admin-client.d.ts +23 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +181 -0
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +37 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +69 -0
- package/dist/typescript-client/src/ai-assistant-client.d.ts +72 -73
- package/dist/typescript-client/src/ai-audio-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-client.d.ts +129 -0
- package/dist/typescript-client/src/ai-files-client.d.ts +33 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +86 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client.d.ts +28 -0
- package/dist/typescript-client/src/ai-matchmaking-client.d.ts +99 -0
- package/dist/typescript-client/src/api-client.d.ts +69 -0
- package/dist/typescript-client/src/auth.manager.d.ts +11 -26
- package/dist/typescript-client/src/backend-function.manager.d.ts +1 -9
- package/dist/typescript-client/src/client-customization.utils.d.ts +1 -0
- package/dist/typescript-client/src/client-id.service.d.ts +1 -27
- package/dist/typescript-client/src/collection-reference.d.ts +105 -80
- package/dist/typescript-client/src/collection-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/connection-details.d.ts +24 -23
- package/dist/typescript-client/src/console-utils.d.ts +1 -0
- package/dist/typescript-client/src/data.manager.d.ts +1 -173
- package/dist/typescript-client/src/destruct.manager.d.ts +1 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +39 -16
- package/dist/typescript-client/src/document-identity.service.d.ts +1 -12
- package/dist/typescript-client/src/document-reference.d.ts +151 -140
- package/dist/typescript-client/src/document-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/document-store.d.ts +1 -14
- package/dist/typescript-client/src/execute-function-options.d.ts +73 -0
- package/dist/typescript-client/src/external-auth-client.d.ts +36 -0
- package/dist/typescript-client/src/extraction-client.d.ts +32 -0
- package/dist/typescript-client/src/file-args-transformer.d.ts +1 -0
- package/dist/typescript-client/src/file-utils.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +63 -9
- package/dist/typescript-client/src/integration-client.d.ts +60 -0
- package/dist/typescript-client/src/job-client.d.ts +32 -0
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +1 -10
- package/dist/typescript-client/src/native-query-manager.d.ts +1 -7
- package/dist/typescript-client/src/notification-client.d.ts +20 -0
- package/dist/typescript-client/src/observability-client.d.ts +43 -0
- package/dist/typescript-client/src/public-types.d.ts +30 -0
- package/dist/typescript-client/src/public-utils.d.ts +1 -0
- package/dist/typescript-client/src/query/deserializer.d.ts +10 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +316 -161
- package/dist/typescript-client/src/query/local-query-manager.d.ts +1 -9
- package/dist/{common → typescript-client}/src/query/pagination.d.ts +65 -62
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +228 -77
- package/dist/typescript-client/src/query/query-sender.d.ts +1 -33
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -130
- package/dist/typescript-client/src/query/query.types.d.ts +16 -49
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +41 -0
- package/dist/typescript-client/src/query-utils.d.ts +18 -0
- package/dist/typescript-client/src/queue.manager.d.ts +12 -0
- package/dist/typescript-client/src/rate-limiter.d.ts +1 -32
- package/dist/typescript-client/src/rpc.manager.d.ts +1 -30
- package/dist/typescript-client/src/scheduler-client.d.ts +31 -0
- package/dist/typescript-client/src/secret.client.d.ts +96 -22
- package/dist/typescript-client/src/socket.manager.d.ts +1 -43
- package/dist/typescript-client/src/squid-http-client.d.ts +11 -0
- package/dist/typescript-client/src/squid.d.ts +378 -269
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
- package/dist/typescript-client/src/storage-client.d.ts +145 -0
- package/dist/typescript-client/src/types.d.ts +27 -2
- package/dist/typescript-client/src/version.d.ts +5 -0
- package/dist/typescript-client/src/web-client.d.ts +63 -0
- package/dist/typescript-client/src/webhook.manager.d.ts +10 -0
- package/package.json +34 -18
- package/dist/common/src/ai-assistant.types.d.ts +0 -25
- package/dist/common/src/ai-chatbot.context.d.ts +0 -12
- package/dist/common/src/ai-chatbot.types.d.ts +0 -27
- package/dist/common/src/api-call.context.d.ts +0 -13
- package/dist/common/src/api.types.d.ts +0 -4
- package/dist/common/src/application.schemas.d.ts +0 -66
- package/dist/common/src/application.types.d.ts +0 -143
- package/dist/common/src/backend-run.types.d.ts +0 -2
- package/dist/common/src/bundle-api.types.d.ts +0 -43
- package/dist/common/src/bundle-data.types.d.ts +0 -5
- package/dist/common/src/communication.types.d.ts +0 -8
- package/dist/common/src/context.types.d.ts +0 -40
- package/dist/common/src/distributed-lock.context.d.ts +0 -4
- package/dist/common/src/document.types.d.ts +0 -22
- package/dist/common/src/graphql.context.d.ts +0 -7
- package/dist/common/src/graphql.types.d.ts +0 -9
- package/dist/common/src/heartbeat.types.d.ts +0 -1
- package/dist/common/src/http-status.enum.d.ts +0 -50
- package/dist/common/src/index.d.ts +0 -57
- package/dist/common/src/integrations/ai_chatbot.types.d.ts +0 -31
- package/dist/common/src/integrations/api.types.d.ts +0 -80
- package/dist/common/src/integrations/auth.types.d.ts +0 -47
- package/dist/common/src/integrations/database.types.d.ts +0 -274
- package/dist/common/src/integrations/index.d.ts +0 -134
- package/dist/common/src/integrations/observability.types.d.ts +0 -23
- package/dist/common/src/logger.types.d.ts +0 -21
- package/dist/common/src/metrics.types.d.ts +0 -1
- package/dist/common/src/mutation.context.d.ts +0 -14
- package/dist/common/src/mutation.types.d.ts +0 -53
- package/dist/common/src/named-query.context.d.ts +0 -4
- package/dist/common/src/named-query.schemas.d.ts +0 -1
- package/dist/common/src/named-query.types.d.ts +0 -1
- package/dist/common/src/native-query.context.d.ts +0 -7
- package/dist/common/src/native-query.types.d.ts +0 -16
- package/dist/common/src/query/base-query-builder.d.ts +0 -147
- package/dist/common/src/query/index.d.ts +0 -4
- package/dist/common/src/query/serialized-query.types.d.ts +0 -24
- package/dist/common/src/query.types.d.ts +0 -64
- package/dist/common/src/regions.d.ts +0 -1
- package/dist/common/src/secret.schemas.d.ts +0 -1
- package/dist/common/src/secret.types.d.ts +0 -22
- package/dist/common/src/security.types.d.ts +0 -1
- package/dist/common/src/socket.schemas.d.ts +0 -1
- package/dist/common/src/socket.types.d.ts +0 -5
- package/dist/common/src/trigger.types.d.ts +0 -1
- package/dist/common/src/utils/array.d.ts +0 -1
- package/dist/common/src/utils/assert.d.ts +0 -1
- package/dist/common/src/utils/error.d.ts +0 -4
- package/dist/common/src/utils/http.d.ts +0 -2
- package/dist/common/src/utils/id.d.ts +0 -2
- package/dist/common/src/utils/object.d.ts +0 -5
- package/dist/common/src/utils/serialization.d.ts +0 -6
- package/dist/common/src/utils/transforms.d.ts +0 -18
- package/dist/common/src/utils/url.d.ts +0 -1
- package/dist/common/src/utils/validation.d.ts +0 -25
- package/dist/common/src/webhook-response.d.ts +0 -1
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
- package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
- package/dist/typescript-client/src/ai.types.d.ts +0 -61
- package/dist/typescript-client/src/api.manager.d.ts +0 -11
- package/dist/typescript-client/src/graphql-client.d.ts +0 -14
- package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
- package/dist/typescript-client/src/named-query.manager.d.ts +0 -11
- package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
- package/dist/typescript-client/src/state/actions.d.ts +0 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
- package/dist/typescript-client/src/state/state.service.d.ts +0 -22
- package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
|
@@ -1,137 +1,177 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
operator:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
1
|
+
import { AiQueryOptions } from '../public-types/ai-query.public-types';
|
|
2
|
+
import { IntegrationId } from '../public-types/communication.public-types';
|
|
3
|
+
import { CollectionName, DocumentData } from '../public-types/document.public-types';
|
|
4
|
+
import { FieldSort, Operator, Query, SimpleCondition } from '../public-types/query.public-types';
|
|
5
|
+
import { DeepRecord, FieldOf, PartialBy, Paths } from '../public-types/typescript.public-types';
|
|
6
|
+
/**
|
|
7
|
+
* The information provided to the secureAiQuery function about the AI query being executed.
|
|
8
|
+
* @category AI
|
|
9
|
+
*/
|
|
10
|
+
export interface AiQueryContext {
|
|
11
|
+
/** The prompt provided for the AI query. */
|
|
12
|
+
prompt: string;
|
|
13
|
+
/** The options used for executing the AI query. */
|
|
14
|
+
options: AiQueryOptions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents the Squid query context.
|
|
18
|
+
* Passed to methods that require query details, such as those annotated with the `@secureCollection` annotation.
|
|
19
|
+
* @category Database
|
|
20
|
+
*/
|
|
21
|
+
export declare class QueryContext<T extends DocumentData = any> {
|
|
22
|
+
readonly query: Query<T>;
|
|
23
|
+
/**
|
|
24
|
+
* The ID of the integration being queried.
|
|
25
|
+
*/
|
|
26
|
+
get integrationId(): IntegrationId;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the collection being queried.
|
|
29
|
+
*/
|
|
30
|
+
get collectionName(): CollectionName;
|
|
31
|
+
/**
|
|
32
|
+
* The query limit if one exists, -1 otherwise.
|
|
33
|
+
*/
|
|
34
|
+
get limit(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Verifies that the query's sort order aligns with the provided field sorts. The fields specified in the `sorts`
|
|
37
|
+
* parameter must appear in the exact order at the beginning of the query's sort sequence. The query can include
|
|
38
|
+
* additional fields in its sort order, but only after the specified sorts.
|
|
39
|
+
*
|
|
40
|
+
* @param sorts An array of field sorts.
|
|
41
|
+
* @returns Whether the query's sorts matches the provided field sorts.
|
|
42
|
+
*/
|
|
43
|
+
sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Verifies that the query's sort order exactly matches the provided field sorts. The fields specified in the
|
|
46
|
+
* `sorts` parameter must appear in the exact order in the query's sort sequence. No additional sorts may be present
|
|
47
|
+
* in the query.
|
|
48
|
+
*
|
|
49
|
+
* @param sorts An array of field sorts.
|
|
50
|
+
* @returns Whether the query's sorts exactly match the provided field sorts.
|
|
51
|
+
*/
|
|
52
|
+
sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
|
|
55
|
+
* to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
|
|
56
|
+
* additional conditions, as these only narrow the result set.
|
|
57
|
+
*
|
|
58
|
+
* @param fieldName The name of the field for the condition.
|
|
59
|
+
* @param operator The operator of the condition.
|
|
60
|
+
* @param value The value of the condition.
|
|
61
|
+
* @returns Whether the query is a subquery of the parent condition.
|
|
62
|
+
*/
|
|
63
|
+
isSubqueryOf<F extends Paths<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
|
|
66
|
+
* to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
|
|
67
|
+
* additional conditions, as these only narrow the result set.
|
|
68
|
+
*
|
|
69
|
+
* @param condition The condition to validate.
|
|
70
|
+
* @returns Whether the query is a subquery of the parent condition.
|
|
71
|
+
*/
|
|
72
|
+
isSubqueryOfCondition(condition: GeneralCondition<T>): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Verifies that the query is a subquery of the specified conditions. A subquery is defined as a query that evaluates
|
|
75
|
+
* to a subset of the results that would be obtained by applying the parent conditions. The subquery may also include
|
|
76
|
+
* additional conditions, as these only narrow the result set.
|
|
77
|
+
*
|
|
78
|
+
* @param conditions The conditions to validate.
|
|
79
|
+
* @returns Whether the query includes subquery of the parent conditions.
|
|
80
|
+
*/
|
|
81
|
+
isSubqueryOfConditions(conditions: GeneralConditions<T>): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Verifies that the query is a subquery of the specified query. A subquery is defined as a query that evaluates
|
|
84
|
+
* to a subset of the results that obtained for the parent query, including sorts and limits.
|
|
85
|
+
*
|
|
86
|
+
* @param query The query to validate.
|
|
87
|
+
* @returns Whether the query is a subquery of the parent query.
|
|
88
|
+
*/
|
|
89
|
+
isSubqueryOfQuery(query: Query<T>): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Returns all conditions that apply to any of the specified field names. This method
|
|
92
|
+
* provides a convenient way to retrieve all conditions that involve a specific set of fields.
|
|
93
|
+
*
|
|
94
|
+
* @param fieldNames The field names for which to retrieve conditions.
|
|
95
|
+
* @returns An array of conditions that involve any of the specified field names.
|
|
96
|
+
*/
|
|
97
|
+
getConditionsFor<K extends Paths<T>>(...fieldNames: Array<K>): ContextConditions<T, K>;
|
|
98
|
+
/**
|
|
99
|
+
* Returns all conditions that apply to the specified field name. This method provides
|
|
100
|
+
* a convenient way to retrieve all conditions that involve a specific field.
|
|
101
|
+
*
|
|
102
|
+
* @param fieldName The field name for which to retrieve conditions.
|
|
103
|
+
* @returns An array of conditions that involve the specified field name.
|
|
104
|
+
*/
|
|
105
|
+
getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns true if the given document can be a result of the query.
|
|
108
|
+
* The method does not account for limit and sort order.
|
|
109
|
+
*/
|
|
110
|
+
documentMatchesQuery(doc: DocumentData): boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A list of context conditions.
|
|
114
|
+
* @category Database
|
|
115
|
+
*/
|
|
116
|
+
export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
|
|
117
|
+
/**
|
|
118
|
+
* A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'.
|
|
119
|
+
* @category Database
|
|
120
|
+
*/
|
|
121
|
+
export type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
|
|
122
|
+
/**
|
|
123
|
+
* A condition using the 'in' operator to match values within a set.
|
|
124
|
+
* @category Database
|
|
125
|
+
*/
|
|
126
|
+
export interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
|
|
127
|
+
/** Specifies the 'in' operator to check if a value exists within an array. */
|
|
128
|
+
operator: 'in';
|
|
129
|
+
/** An array of values to match against the field. */
|
|
130
|
+
value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A condition using the 'not in' operator to exclude values within a set.
|
|
134
|
+
* @category Database
|
|
135
|
+
*/
|
|
136
|
+
export interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
|
|
137
|
+
/** Specifies the 'not in' operator to check if a value does not exist within an array. */
|
|
138
|
+
operator: 'not in';
|
|
139
|
+
/** An array of values to exclude from the field. */
|
|
140
|
+
value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A condition using operators other than 'in' or 'not in' for field comparisons.
|
|
144
|
+
* @category Database
|
|
145
|
+
*/
|
|
146
|
+
export interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
|
|
147
|
+
/** The operator to use for the comparison, excluding 'in' and 'not in'. */
|
|
148
|
+
operator: Exclude<ContextOperator, 'in' | 'not in'>;
|
|
149
|
+
/** The value to compare against the field. */
|
|
150
|
+
value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A condition that includes all operators, including 'in' and 'not in', for general use.
|
|
154
|
+
* @category Database
|
|
155
|
+
*/
|
|
156
|
+
export interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
|
|
157
|
+
/** The operator to apply to the condition, including all possible operators. */
|
|
158
|
+
operator: AllOperators;
|
|
159
|
+
/** The value to use in the condition comparison. */
|
|
160
|
+
value: any;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A list of general conditions.
|
|
164
|
+
* @category Database
|
|
165
|
+
*/
|
|
166
|
+
export type GeneralConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<GeneralCondition<Doc, F>>;
|
|
167
|
+
/**
|
|
168
|
+
* @category Database
|
|
169
|
+
*/
|
|
170
|
+
export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
|
|
171
|
+
type AllOperators = Operator | 'in' | 'not in';
|
|
172
|
+
/**
|
|
173
|
+
* A generic value that can exist in a query.
|
|
174
|
+
* @category Database
|
|
175
|
+
*/
|
|
176
|
+
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;
|
|
177
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a random RFC 4122 version 4 UUID.
|
|
3
|
+
* The UUID is generated using a cryptographic pseudorandom number generator.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateUUID(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Generates a UUID-style ID.
|
|
8
|
+
* @deprecated Use `generateUUID` instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateId(): string;
|
|
11
|
+
/** Default length if ID produced by `generateShortId`. */
|
|
12
|
+
export declare const DEFAULT_SHORT_ID_LENGTH = 18;
|
|
13
|
+
/**
|
|
14
|
+
* Generates an ID of the given `length` using lowercase latin letters and digits.
|
|
15
|
+
* If the 'prefix' provided replaces the first generated characters with the prefix.
|
|
16
|
+
* If the 'prefixToAvoid' provided, ensures the generated ID does not start with this prefix.
|
|
17
|
+
* When both 'prefix' and 'prefixToAvoid' are provided, 'prefixToAvoid' must be longer than 'prefix'.
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateShortId(length?: number, prefix?: string, prefixToAvoid?: string): string;
|
|
20
|
+
/**
|
|
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.
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateShortIds({ count, length, prefix }: GenerateShortIdsOptions): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Options for generating multiple short IDs.
|
|
30
|
+
*/
|
|
31
|
+
export interface GenerateShortIdsOptions {
|
|
32
|
+
/** The number of IDs to generate. */
|
|
33
|
+
count: number;
|
|
34
|
+
/**
|
|
35
|
+
* The length of each generated ID.
|
|
36
|
+
* @default DEFAULT_SHORT_ID_LENGTH.
|
|
37
|
+
*/
|
|
38
|
+
length?: number;
|
|
39
|
+
/**
|
|
40
|
+
* A string that must be a predefined prefix for each ID. Replaces the first generated characters.
|
|
41
|
+
* @default - no prefix.
|
|
42
|
+
*/
|
|
43
|
+
prefix?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiAgentContext, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings } from '../public-types/ai-agent.public-types';
|
|
2
|
+
import { AiChatModelName, AiEmbeddingsModelName, AiProviderType } from '../public-types/ai-common.public-types';
|
|
3
|
+
import { AiContextMetadata, AiContextMetadataFilter } from '../public-types/ai-knowledge-base.public-types';
|
|
4
|
+
import { AiAgentId, AiKnowledgeBaseId, AppId, ClientRequestId } from '../public-types/communication.public-types';
|
|
5
|
+
import { JobId } from '../public-types/job.public-types';
|
|
6
|
+
import { SecretKey } from '../public-types/secret.public-types';
|
|
7
|
+
/** Specification for an AI model, defining its operational parameters. */
|
|
8
|
+
export type AiModelSpec = {
|
|
9
|
+
/** Maximum tokens the model can generate in a single response. */
|
|
10
|
+
maxOutputTokens: number;
|
|
11
|
+
/** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
|
|
12
|
+
contextWindowTokens: number;
|
|
13
|
+
};
|
|
14
|
+
/** Map of AI model details by model name. */
|
|
15
|
+
export declare const AI_VENDOR_MODEL_SPECS: Record<AiChatModelName, AiModelSpec>;
|
|
16
|
+
/** Map of embedding AI model specs by model name. */
|
|
17
|
+
export declare const AI_VENDOR_EMBEDDING_MODEL_SPECS: Record<AiEmbeddingsModelName, AiModelSpec>;
|
|
18
|
+
export interface AiChatRequest {
|
|
19
|
+
agentId: AiAgentId;
|
|
20
|
+
clientRequestId: ClientRequestId;
|
|
21
|
+
prompt?: string;
|
|
22
|
+
options?: AllAiAgentChatOptions;
|
|
23
|
+
jobId: JobId;
|
|
24
|
+
}
|
|
25
|
+
export interface AiAskRequest {
|
|
26
|
+
agentId: AiAgentId;
|
|
27
|
+
prompt?: string;
|
|
28
|
+
options?: AllAiAgentChatOptions;
|
|
29
|
+
jobId: JobId;
|
|
30
|
+
}
|
|
31
|
+
export interface AiGenerateImageRequest {
|
|
32
|
+
prompt: string;
|
|
33
|
+
options: AiGenerateImageOptions;
|
|
34
|
+
}
|
|
35
|
+
export interface AiAskQuestionInternalRequest {
|
|
36
|
+
appId: AppId;
|
|
37
|
+
prompt: string;
|
|
38
|
+
options: AiChatOptions;
|
|
39
|
+
}
|
|
40
|
+
export interface AiAskQuestionInternalResponse {
|
|
41
|
+
answer: string;
|
|
42
|
+
}
|
|
43
|
+
export interface GetSharedAgentsInternalRequest {
|
|
44
|
+
organizationId: string;
|
|
45
|
+
}
|
|
46
|
+
export interface GetSharedAgentsInternalResponse {
|
|
47
|
+
sharedAgents: Array<{
|
|
48
|
+
agentId: AiAgentId;
|
|
49
|
+
appId: AppId;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface ClearSharedAgentsForOrgInternalRequest {
|
|
53
|
+
organizationId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface AiContextSizeRequest {
|
|
56
|
+
appId: AppId;
|
|
57
|
+
agentId: AiAgentId;
|
|
58
|
+
}
|
|
59
|
+
export interface AiContextSizeResponse {
|
|
60
|
+
sizeBytes: number;
|
|
61
|
+
}
|
|
62
|
+
export interface AiAskResponse {
|
|
63
|
+
responseString: string;
|
|
64
|
+
annotations?: Record<string, AiAnnotation>;
|
|
65
|
+
}
|
|
66
|
+
export interface AiAskWithVoiceResponse {
|
|
67
|
+
responseString: string;
|
|
68
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
69
|
+
annotations?: Record<string, AiAnnotation>;
|
|
70
|
+
}
|
|
71
|
+
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
72
|
+
transcribedPrompt: string;
|
|
73
|
+
responseString: string;
|
|
74
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
75
|
+
annotations?: Record<string, AiAnnotation>;
|
|
76
|
+
}
|
|
77
|
+
export interface AiTranscribeAndChatResponse {
|
|
78
|
+
transcribedPrompt: string;
|
|
79
|
+
}
|
|
80
|
+
export interface AiAudioCreateSpeechResponse {
|
|
81
|
+
mimeType: string;
|
|
82
|
+
extension: string;
|
|
83
|
+
base64File: string;
|
|
84
|
+
}
|
|
85
|
+
export interface AiAudioCreateSpeechRequest {
|
|
86
|
+
input: string;
|
|
87
|
+
options: AiAudioCreateSpeechOptions;
|
|
88
|
+
}
|
|
89
|
+
export interface GetAgentRequest {
|
|
90
|
+
agentId: AiAgentId;
|
|
91
|
+
}
|
|
92
|
+
export interface GetAgentResponse {
|
|
93
|
+
agent: AiAgent | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface GetAgentContextRequest {
|
|
96
|
+
agentId: AiAgentId;
|
|
97
|
+
contextId: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ConnectAgentKnowledgeBaseRequest {
|
|
100
|
+
agentId: AiAgentId;
|
|
101
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
102
|
+
description: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DisconnectAgentKnowledgeBaseRequest {
|
|
105
|
+
agentId: AiAgentId;
|
|
106
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
107
|
+
}
|
|
108
|
+
export interface DeleteAgentRequest {
|
|
109
|
+
agentId: AiAgentId;
|
|
110
|
+
}
|
|
111
|
+
export interface UnshareAgentRequest {
|
|
112
|
+
agentId: AiAgentId;
|
|
113
|
+
}
|
|
114
|
+
export interface SetAgentOptionInPathRequest {
|
|
115
|
+
agentId: AiAgentId;
|
|
116
|
+
path: string;
|
|
117
|
+
value: unknown;
|
|
118
|
+
}
|
|
119
|
+
export interface ListAgentContextsRequest {
|
|
120
|
+
agentId: AiAgentId;
|
|
121
|
+
}
|
|
122
|
+
export interface ListAgentContextsResponse {
|
|
123
|
+
contexts: Array<AiAgentContext>;
|
|
124
|
+
}
|
|
125
|
+
export interface DeleteAgentContextsRequest {
|
|
126
|
+
agentId: AiAgentId;
|
|
127
|
+
contextIds: Array<string>;
|
|
128
|
+
}
|
|
129
|
+
export interface UpsertAgentContextsRequest {
|
|
130
|
+
agentId: AiAgentId;
|
|
131
|
+
contextRequests: Array<AgentContextRequest>;
|
|
132
|
+
}
|
|
133
|
+
export interface UpsertAgentCustomGuardrailsRequest {
|
|
134
|
+
agentId: AiAgentId;
|
|
135
|
+
customGuardrail: string;
|
|
136
|
+
}
|
|
137
|
+
export interface DeleteAgentCustomGuardrailsRequest {
|
|
138
|
+
agentId: AiAgentId;
|
|
139
|
+
}
|
|
140
|
+
export interface ListAgentsResponse {
|
|
141
|
+
agents: Array<AiAgent>;
|
|
142
|
+
}
|
|
143
|
+
export interface GetApplicationAiSettingsResponse {
|
|
144
|
+
settings: ApplicationAiSettings;
|
|
145
|
+
}
|
|
146
|
+
export interface GetApplicationAiSettingsResponse {
|
|
147
|
+
settings: ApplicationAiSettings;
|
|
148
|
+
}
|
|
149
|
+
export interface SetApplicationAiSettingsRequest {
|
|
150
|
+
settings: ApplicationAiSettings;
|
|
151
|
+
}
|
|
152
|
+
export interface SetAiProviderApiKeySecretRequest {
|
|
153
|
+
providerType: AiProviderType;
|
|
154
|
+
secretKey: SecretKey | undefined;
|
|
155
|
+
}
|
|
156
|
+
export interface SetAiProviderApiKeySecretResponse {
|
|
157
|
+
settings: ApplicationAiSettings;
|
|
158
|
+
}
|
|
159
|
+
export interface RegenerateAgentApiKeyRequest {
|
|
160
|
+
agentId: AiAgentId;
|
|
161
|
+
}
|
|
162
|
+
export interface GetAgentApiKeyRequest {
|
|
163
|
+
agentId: AiAgentId;
|
|
164
|
+
}
|
|
165
|
+
export declare function validateAiContextMetadata(metadata: AiContextMetadata): void;
|
|
166
|
+
export declare function validateAiContextMetadataFilter(filter: AiContextMetadataFilter): void;
|
|
167
|
+
export declare const METADATA_SERVICE_FUNCTION_NAME = "default:metadata";
|
|
168
|
+
export interface UpdateApplicationAiSettingsWebhookPayload {
|
|
169
|
+
appId: AppId;
|
|
170
|
+
aiSettings: ApplicationAiSettings;
|
|
171
|
+
}
|
|
172
|
+
export interface GetChatHistoryRequest {
|
|
173
|
+
agentId: AiAgentId;
|
|
174
|
+
memoryId: string;
|
|
175
|
+
}
|
|
176
|
+
export interface GetChatHistoryResponse {
|
|
177
|
+
messages: Array<AiChatMessage>;
|
|
178
|
+
}
|
|
179
|
+
export interface ProvideAgentFeedbackRequest {
|
|
180
|
+
agentId: string;
|
|
181
|
+
feedback: string;
|
|
182
|
+
}
|
|
183
|
+
export interface UploadAiFileRequest {
|
|
184
|
+
/** AI provider to upload file to. */
|
|
185
|
+
provider: AiProviderType;
|
|
186
|
+
/** Optional expiration time in seconds. If provided, file will be registered for automatic cleanup. */
|
|
187
|
+
expirationInSeconds?: number;
|
|
188
|
+
}
|
|
189
|
+
export interface UploadAiFileResponse {
|
|
190
|
+
fileId: string;
|
|
191
|
+
}
|
|
192
|
+
export interface DeleteAiFileRequest {
|
|
193
|
+
fileId: string;
|
|
194
|
+
/** AI provider that owns the file. */
|
|
195
|
+
provider: AiProviderType;
|
|
196
|
+
}
|
|
197
|
+
export interface DeleteAiFileResponse {
|
|
198
|
+
deleted: boolean;
|
|
199
|
+
}
|
package/dist/{common/src/mutation.schemas.d.ts → internal-common/src/types/ai-assistant.types.d.ts}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|