@squidcloud/client 1.0.145-beta → 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.
Files changed (206) hide show
  1. package/dist/cjs/index.js +1 -50433
  2. package/dist/esm/index.js +1 -0
  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 +47 -0
  5. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +895 -0
  6. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +31 -0
  7. package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +185 -0
  8. package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +431 -0
  9. package/dist/internal-common/src/public-types/ai-matchmaking.public-types.d.ts +186 -0
  10. package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +170 -0
  11. package/dist/internal-common/src/public-types/api-client.public-types.d.ts +9 -0
  12. package/dist/internal-common/src/public-types/api.public-types.d.ts +91 -0
  13. package/dist/internal-common/src/public-types/backend.public-types.d.ts +50 -0
  14. package/dist/{common/src/backend-function.schemas.d.ts → internal-common/src/public-types/code-executor.public-types.d.ts} +1 -1
  15. package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
  16. package/dist/internal-common/src/public-types/context.public-types.d.ts +83 -0
  17. package/dist/internal-common/src/public-types/document.public-types.d.ts +71 -0
  18. package/dist/internal-common/src/public-types/external-auth/external-auth.public-types.d.ts +39 -0
  19. package/dist/internal-common/src/public-types/extraction.public-types.d.ts +183 -0
  20. package/dist/internal-common/src/public-types/http-status.public-types.d.ts +415 -0
  21. package/dist/internal-common/src/public-types/integration.public-types.d.ts +51 -0
  22. package/dist/internal-common/src/public-types/job.public-types.d.ts +59 -0
  23. package/dist/internal-common/src/public-types/metric.public-types.d.ts +154 -0
  24. package/dist/internal-common/src/public-types/openapi.public-types.d.ts +9 -0
  25. package/dist/internal-common/src/public-types/query.public-types.d.ts +113 -0
  26. package/dist/internal-common/src/public-types/regions.public-types.d.ts +4 -0
  27. package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +43 -0
  28. package/dist/{common/src/schema/schema.types.d.ts → internal-common/src/public-types/schema.public-types.d.ts} +54 -54
  29. package/dist/internal-common/src/public-types/secret.public-types.d.ts +51 -0
  30. package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +60 -0
  31. package/dist/internal-common/src/public-types/socket.public-types.d.ts +4 -0
  32. package/dist/{common/src/types.d.ts → internal-common/src/public-types/typescript.public-types.d.ts} +20 -14
  33. package/dist/internal-common/src/public-types/web.public-types.d.ts +93 -0
  34. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  35. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
  36. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
  37. package/dist/{common/src/query/query-context.d.ts → internal-common/src/public-types-backend/query.public-context.d.ts} +177 -137
  38. package/dist/{common/src/ai-chatbot.schemas.d.ts → internal-common/src/public-utils/context-utils.d.ts} +1 -1
  39. package/dist/internal-common/src/public-utils/id-utils.d.ts +44 -0
  40. package/dist/internal-common/src/types/ai-agent.types.d.ts +199 -0
  41. package/dist/{common/src/mutation.schemas.d.ts → internal-common/src/types/ai-assistant.types.d.ts} +1 -1
  42. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
  43. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
  44. package/dist/{common/src → internal-common/src/types}/backend-function.types.d.ts +1 -1
  45. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  46. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  47. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  48. package/dist/internal-common/src/types/headers.types.d.ts +17 -0
  49. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  50. package/dist/internal-common/src/types/notification.types.d.ts +5 -0
  51. package/dist/internal-common/src/types/observability.types.d.ts +78 -0
  52. package/dist/internal-common/src/types/query.types.d.ts +13 -0
  53. package/dist/internal-common/src/types/secret.types.d.ts +7 -0
  54. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  55. package/dist/internal-common/src/types/stage.d.ts +9 -0
  56. package/dist/{common/src → internal-common/src/types}/time-units.d.ts +1 -1
  57. package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
  58. package/dist/internal-common/src/utils/array.d.ts +7 -0
  59. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  60. package/dist/{common → internal-common}/src/utils/global.utils.d.ts +1 -1
  61. package/dist/internal-common/src/utils/http.d.ts +5 -0
  62. package/dist/{common → internal-common}/src/utils/lock.manager.d.ts +14 -14
  63. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  64. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  65. package/dist/internal-common/src/utils/object.d.ts +58 -0
  66. package/dist/internal-common/src/utils/serialization.d.ts +17 -0
  67. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  68. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  69. package/dist/internal-common/src/utils/validation.d.ts +19 -0
  70. package/dist/{common → internal-common}/src/websocket.impl.d.ts +26 -21
  71. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  72. package/dist/typescript-client/src/admin-client.d.ts +23 -0
  73. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +181 -0
  74. package/dist/typescript-client/src/agent/ai-agent-client.d.ts +37 -0
  75. package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +69 -0
  76. package/dist/typescript-client/src/ai-assistant-client.d.ts +72 -73
  77. package/dist/typescript-client/src/ai-audio-client.d.ts +25 -0
  78. package/dist/typescript-client/src/ai-client.d.ts +129 -0
  79. package/dist/typescript-client/src/ai-files-client.d.ts +33 -0
  80. package/dist/typescript-client/src/ai-image-client.d.ts +25 -0
  81. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +86 -0
  82. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client.d.ts +28 -0
  83. package/dist/typescript-client/src/ai-matchmaking-client.d.ts +99 -0
  84. package/dist/typescript-client/src/api-client.d.ts +69 -0
  85. package/dist/typescript-client/src/auth.manager.d.ts +11 -26
  86. package/dist/typescript-client/src/backend-function.manager.d.ts +1 -9
  87. package/dist/typescript-client/src/client-customization.utils.d.ts +1 -0
  88. package/dist/typescript-client/src/client-id.service.d.ts +1 -27
  89. package/dist/typescript-client/src/collection-reference.d.ts +105 -80
  90. package/dist/typescript-client/src/collection-reference.factory.d.ts +1 -13
  91. package/dist/typescript-client/src/connection-details.d.ts +24 -23
  92. package/dist/typescript-client/src/console-utils.d.ts +1 -0
  93. package/dist/typescript-client/src/data.manager.d.ts +1 -173
  94. package/dist/typescript-client/src/destruct.manager.d.ts +1 -12
  95. package/dist/typescript-client/src/distributed-lock.manager.d.ts +39 -16
  96. package/dist/typescript-client/src/document-identity.service.d.ts +1 -12
  97. package/dist/typescript-client/src/document-reference.d.ts +151 -140
  98. package/dist/typescript-client/src/document-reference.factory.d.ts +1 -13
  99. package/dist/typescript-client/src/document-store.d.ts +1 -14
  100. package/dist/typescript-client/src/execute-function-options.d.ts +73 -0
  101. package/dist/typescript-client/src/external-auth-client.d.ts +36 -0
  102. package/dist/typescript-client/src/extraction-client.d.ts +32 -0
  103. package/dist/typescript-client/src/file-args-transformer.d.ts +1 -0
  104. package/dist/typescript-client/src/file-utils.d.ts +1 -0
  105. package/dist/typescript-client/src/index.d.ts +63 -9
  106. package/dist/typescript-client/src/integration-client.d.ts +60 -0
  107. package/dist/typescript-client/src/job-client.d.ts +32 -0
  108. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +1 -10
  109. package/dist/typescript-client/src/native-query-manager.d.ts +1 -7
  110. package/dist/typescript-client/src/notification-client.d.ts +20 -0
  111. package/dist/typescript-client/src/observability-client.d.ts +43 -0
  112. package/dist/typescript-client/src/public-types.d.ts +30 -0
  113. package/dist/typescript-client/src/public-utils.d.ts +1 -0
  114. package/dist/typescript-client/src/query/deserializer.d.ts +10 -3
  115. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +316 -161
  116. package/dist/typescript-client/src/query/local-query-manager.d.ts +1 -9
  117. package/dist/{common → typescript-client}/src/query/pagination.d.ts +65 -62
  118. package/dist/typescript-client/src/query/query-builder.factory.d.ts +228 -77
  119. package/dist/typescript-client/src/query/query-sender.d.ts +1 -33
  120. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -130
  121. package/dist/typescript-client/src/query/query.types.d.ts +16 -49
  122. package/dist/typescript-client/src/query/snapshot-emitter.d.ts +41 -0
  123. package/dist/typescript-client/src/query-utils.d.ts +18 -0
  124. package/dist/typescript-client/src/queue.manager.d.ts +12 -0
  125. package/dist/typescript-client/src/rate-limiter.d.ts +1 -32
  126. package/dist/typescript-client/src/rpc.manager.d.ts +1 -30
  127. package/dist/typescript-client/src/scheduler-client.d.ts +31 -0
  128. package/dist/typescript-client/src/secret.client.d.ts +96 -22
  129. package/dist/typescript-client/src/socket.manager.d.ts +1 -43
  130. package/dist/typescript-client/src/squid-http-client.d.ts +11 -0
  131. package/dist/typescript-client/src/squid.d.ts +378 -269
  132. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  133. package/dist/typescript-client/src/storage-client.d.ts +145 -0
  134. package/dist/typescript-client/src/types.d.ts +27 -2
  135. package/dist/typescript-client/src/version.d.ts +5 -0
  136. package/dist/typescript-client/src/web-client.d.ts +63 -0
  137. package/dist/typescript-client/src/webhook.manager.d.ts +10 -0
  138. package/package.json +34 -18
  139. package/dist/common/src/ai-assistant.types.d.ts +0 -25
  140. package/dist/common/src/ai-chatbot.context.d.ts +0 -12
  141. package/dist/common/src/ai-chatbot.types.d.ts +0 -27
  142. package/dist/common/src/api-call.context.d.ts +0 -13
  143. package/dist/common/src/api.types.d.ts +0 -4
  144. package/dist/common/src/application.schemas.d.ts +0 -66
  145. package/dist/common/src/application.types.d.ts +0 -143
  146. package/dist/common/src/backend-run.types.d.ts +0 -2
  147. package/dist/common/src/bundle-api.types.d.ts +0 -43
  148. package/dist/common/src/bundle-data.types.d.ts +0 -5
  149. package/dist/common/src/communication.types.d.ts +0 -8
  150. package/dist/common/src/context.types.d.ts +0 -40
  151. package/dist/common/src/distributed-lock.context.d.ts +0 -4
  152. package/dist/common/src/document.types.d.ts +0 -22
  153. package/dist/common/src/graphql.context.d.ts +0 -7
  154. package/dist/common/src/graphql.types.d.ts +0 -9
  155. package/dist/common/src/heartbeat.types.d.ts +0 -1
  156. package/dist/common/src/http-status.enum.d.ts +0 -50
  157. package/dist/common/src/index.d.ts +0 -57
  158. package/dist/common/src/integrations/ai_chatbot.types.d.ts +0 -31
  159. package/dist/common/src/integrations/api.types.d.ts +0 -80
  160. package/dist/common/src/integrations/auth.types.d.ts +0 -47
  161. package/dist/common/src/integrations/database.types.d.ts +0 -274
  162. package/dist/common/src/integrations/index.d.ts +0 -134
  163. package/dist/common/src/integrations/observability.types.d.ts +0 -23
  164. package/dist/common/src/logger.types.d.ts +0 -21
  165. package/dist/common/src/metrics.types.d.ts +0 -1
  166. package/dist/common/src/mutation.context.d.ts +0 -14
  167. package/dist/common/src/mutation.types.d.ts +0 -53
  168. package/dist/common/src/named-query.context.d.ts +0 -4
  169. package/dist/common/src/named-query.schemas.d.ts +0 -1
  170. package/dist/common/src/named-query.types.d.ts +0 -1
  171. package/dist/common/src/native-query.context.d.ts +0 -7
  172. package/dist/common/src/native-query.types.d.ts +0 -16
  173. package/dist/common/src/query/base-query-builder.d.ts +0 -147
  174. package/dist/common/src/query/index.d.ts +0 -4
  175. package/dist/common/src/query/serialized-query.types.d.ts +0 -24
  176. package/dist/common/src/query.types.d.ts +0 -64
  177. package/dist/common/src/regions.d.ts +0 -1
  178. package/dist/common/src/secret.schemas.d.ts +0 -1
  179. package/dist/common/src/secret.types.d.ts +0 -22
  180. package/dist/common/src/security.types.d.ts +0 -1
  181. package/dist/common/src/socket.schemas.d.ts +0 -1
  182. package/dist/common/src/socket.types.d.ts +0 -5
  183. package/dist/common/src/trigger.types.d.ts +0 -1
  184. package/dist/common/src/utils/array.d.ts +0 -1
  185. package/dist/common/src/utils/assert.d.ts +0 -1
  186. package/dist/common/src/utils/error.d.ts +0 -4
  187. package/dist/common/src/utils/http.d.ts +0 -2
  188. package/dist/common/src/utils/id.d.ts +0 -2
  189. package/dist/common/src/utils/object.d.ts +0 -5
  190. package/dist/common/src/utils/serialization.d.ts +0 -6
  191. package/dist/common/src/utils/transforms.d.ts +0 -18
  192. package/dist/common/src/utils/url.d.ts +0 -1
  193. package/dist/common/src/utils/validation.d.ts +0 -25
  194. package/dist/common/src/webhook-response.d.ts +0 -1
  195. package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
  196. package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
  197. package/dist/typescript-client/src/ai.types.d.ts +0 -61
  198. package/dist/typescript-client/src/api.manager.d.ts +0 -11
  199. package/dist/typescript-client/src/graphql-client.d.ts +0 -14
  200. package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
  201. package/dist/typescript-client/src/named-query.manager.d.ts +0 -11
  202. package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
  203. package/dist/typescript-client/src/state/actions.d.ts +0 -29
  204. package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
  205. package/dist/typescript-client/src/state/state.service.d.ts +0 -22
  206. package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
@@ -0,0 +1,186 @@
1
+ import { AiContextMetadata, AiContextMetadataFilter } from './ai-knowledge-base.public-types';
2
+ /**
3
+ * Represents a category in the matchmaker.
4
+ * The description is used by the AI to extract features from the content.
5
+ * @category AI
6
+ */
7
+ export interface MmCategory {
8
+ /** The unique identifier of the category. */
9
+ id: string;
10
+ /** A description used by the AI to understand and extract features from the category content. */
11
+ description: string;
12
+ }
13
+ /**
14
+ * Represents a matchmaker entity for a given category.
15
+ * The metadata is used to filter the entities when finding matches.
16
+ * @category AI
17
+ */
18
+ export interface MmEntity {
19
+ /** The unique identifier of the entity. */
20
+ id: string;
21
+ /** The content of the entity to be matched. */
22
+ content: string;
23
+ /** The ID of the category this entity belongs to. */
24
+ categoryId: string;
25
+ /** Metadata used for filtering entities during matching. */
26
+ metadata: AiContextMetadata;
27
+ }
28
+ /**
29
+ * Represents a matchmaker.
30
+ * The description is used to describe the matchmaker and by the AI to better understand the domain.
31
+ * The categories represent the types of entities that can be matched (it is possible to match items in the same
32
+ * category).
33
+ * @category AI
34
+ */
35
+ export interface MmMatchMaker {
36
+ /** The unique identifier of the matchmaker. */
37
+ id: string;
38
+ /** A description aiding the AI in understanding the matchmaker's domain. */
39
+ description: string;
40
+ /** An array of categories defining the types of entities that can be matched. */
41
+ categories: Array<MmCategory>;
42
+ }
43
+ /**
44
+ * Represents a matchmaker entity match. A high score indicates a good match.
45
+ * @category AI
46
+ */
47
+ export interface MmEntityMatch extends MmEntity {
48
+ /** The score of the match, ranging from 0 to 100, where 100 is the best match. */
49
+ score: number;
50
+ /** The reasoning behind the match score, provided by the AI. */
51
+ reasoning: string;
52
+ }
53
+ /**
54
+ * Represents options for finding matches in the matchmaker system.
55
+ * @category AI
56
+ */
57
+ export interface MmFindMatchesOptions {
58
+ /** Optional metadata filter conditions to narrow down matching entities; defaults to none. */
59
+ metadataFilter?: AiContextMetadataFilter;
60
+ /** The maximum number of matches to return; defaults to 100, with a maximum of 100. */
61
+ limit?: number;
62
+ /** The category ID to match entities against; defaults to the next or first category in the matchmaker. */
63
+ matchToCategoryId?: string;
64
+ }
65
+ /**
66
+ * Represents options for listing entities in the matchmaker system.
67
+ - * @category AI
68
+ */
69
+ export interface MmListEntitiesOptions {
70
+ /** Optional metadata filter conditions to narrow down listed entities; defaults to none. */
71
+ metadataFilter?: AiContextMetadataFilter;
72
+ /** The maximum number of entities to return; defaults to 100. */
73
+ limit?: number;
74
+ }
75
+ /**
76
+ * API request to delete a matchmaker
77
+ * @category AI
78
+ */
79
+ export interface MmDeleteMatchMakerRequest {
80
+ /** The ID of the matchmaker to delete */
81
+ matchMakerId: string;
82
+ }
83
+ /**
84
+ * API response for getting a matchmaker
85
+ * @category AI
86
+ */
87
+ export interface MmGetMatchMakerResponse {
88
+ /** The matchmaker, if found */
89
+ matchMaker: MmMatchMaker | undefined;
90
+ }
91
+ /**
92
+ * API request to delete an entity
93
+ * @category AI
94
+ */
95
+ export interface MmDeleteEntityRequest {
96
+ /** The ID of the matchmaker */
97
+ matchMakerId: string;
98
+ /** The ID of the entity to delete */
99
+ entityId: string;
100
+ }
101
+ /**
102
+ * API request to insert multiple entities
103
+ * @category AI
104
+ */
105
+ export interface MmInsertEntitiesRequest {
106
+ /** The ID of the matchmaker */
107
+ matchMakerId: string;
108
+ /** Array of entities to insert */
109
+ entities: Array<MmEntity>;
110
+ }
111
+ /**
112
+ * API request to find matches for an entity
113
+ * @category AI
114
+ */
115
+ export interface MmFindMatchesRequest {
116
+ /** The ID of the matchmaker */
117
+ matchMakerId: string;
118
+ /** The ID of the entity to find matches for */
119
+ entityId: string;
120
+ /** Options for finding matches */
121
+ options: MmFindMatchesOptions;
122
+ }
123
+ /**
124
+ * API response for finding matches
125
+ * @category AI
126
+ */
127
+ export interface MmFindMatchesResponse {
128
+ /** Array of matching entities */
129
+ matches: Array<MmEntityMatch>;
130
+ }
131
+ /**
132
+ * API request to find matches for an entity not yet inserted
133
+ * @category AI
134
+ */
135
+ export interface MmFindMatchesForEntityRequest {
136
+ /** The ID of the matchmaker */
137
+ matchMakerId: string;
138
+ /** The entity to find matches for */
139
+ entity: Omit<MmEntity, 'metadata' | 'id'>;
140
+ /** Options for finding matches */
141
+ options: MmFindMatchesOptions;
142
+ }
143
+ /**
144
+ * API response for finding matches for an entity
145
+ * @category AI
146
+ */
147
+ export interface MmFindMatchesForEntityResponse {
148
+ /** Array of matching entities */
149
+ matches: Array<MmEntityMatch>;
150
+ }
151
+ /**
152
+ * API response for listing matchmakers
153
+ * @category AI
154
+ */
155
+ export interface MmListMatchMakersResponse {
156
+ /** Array of matchmakers */
157
+ matchMakers: Array<MmMatchMaker>;
158
+ }
159
+ /**
160
+ * API request to list entities
161
+ * @category AI
162
+ */
163
+ export interface MmListEntitiesRequest {
164
+ /** The ID of the matchmaker */
165
+ matchMakerId: string;
166
+ /** The ID of the category */
167
+ categoryId: string;
168
+ /** Options for listing entities */
169
+ options: MmListEntitiesOptions;
170
+ }
171
+ /**
172
+ * API response for listing entities
173
+ * @category AI
174
+ */
175
+ export interface MmListEntitiesResponse {
176
+ /** Array of entities */
177
+ entities: Array<MmEntity>;
178
+ }
179
+ /**
180
+ * API response for getting an entity
181
+ * @category AI
182
+ */
183
+ export interface MmGetEntityResponse {
184
+ /** The entity, if found */
185
+ entity: MmEntity | undefined;
186
+ }
@@ -0,0 +1,170 @@
1
+ import { AiChatOptions, AiSessionContext } from './ai-agent.public-types';
2
+ import { ApiOptions } from './api-client.public-types';
3
+ import { AiAgentId, IntegrationId } from './communication.public-types';
4
+ /**
5
+ * Request to execute an AI query using a specific integration.
6
+ * Supports additional query execution options.
7
+ * @category AI
8
+ */
9
+ export interface AiQueryRequest {
10
+ /** ID of the integration to execute the AI query. */
11
+ integrationId: IntegrationId;
12
+ /** User-provided prompt for the AI query. */
13
+ prompt: string;
14
+ /** Additional options for query execution. */
15
+ options?: AiQueryOptions;
16
+ }
17
+ /**
18
+ * Options for configuring AI query execution.
19
+ * Includes instructions, model overrides, and additional execution settings.
20
+ * @category AI
21
+ */
22
+ export interface AiQueryOptions {
23
+ /**
24
+ * Custom instructions to modify AI query generation behavior.
25
+ * Used for all stages unless there is a per-stage override.
26
+ */
27
+ instructions?: string;
28
+ /** Whether to enable raw results output. */
29
+ enableRawResults?: boolean;
30
+ /** Whether to generate a step-by-step walkthrough for the response. */
31
+ generateWalkthrough?: boolean;
32
+ /** Options for the collection selection stage. */
33
+ selectCollectionsOptions?: AiQuerySelectCollectionsOptions;
34
+ /** Options for the query generation stage. */
35
+ generateQueryOptions?: AiQueryGenerateQueryOptions;
36
+ /** Options specify how to query result should be analyzed (processed) before returning it to user. */
37
+ analyzeResultsOptions?: AiQueryAnalyzeResultsOptions;
38
+ /** Session information for the AI query execution. */
39
+ sessionContext?: AiSessionContext;
40
+ }
41
+ /**
42
+ * Options for the collection selection stage.
43
+ *
44
+ * At this stage Squid selects a subset of collections that will be used by the later stage to generate the real query.
45
+ * It is recommended that the set of collections selected by this stage be broad enough so the query generation stage
46
+ * has a good view of the database.
47
+ */
48
+ export interface AiQuerySelectCollectionsOptions {
49
+ /**
50
+ * Limits collections to be used in the query only to these collections.
51
+ * When not provided, all collections are used.
52
+ */
53
+ collectionsToUse?: string[];
54
+ /** Defines the stage algorithm. Default: 'auto'. */
55
+ runMode?: AiQueryCollectionsSelectionRunMode;
56
+ /** Used to customize AI agent behavior used by the stage. */
57
+ aiOptions?: AiChatOptions;
58
+ }
59
+ /**
60
+ * Defines the stage behavior:
61
+ * - 'default' - Squid will decide if to run the collection selection algorithm or not.
62
+ * - 'force' - Collection selection algorithm is run always, even if collectionsToUse are provided.
63
+ * - 'disable' - The stage is disabled. The whole schema (or collectionsToUse) will be passed to the next step.
64
+ */
65
+ export type AiQueryCollectionsSelectionRunMode = 'default' | 'force' | 'disable';
66
+ /**
67
+ * Options for the query generation stage.
68
+ *
69
+ * At this stage Squid generates the database native query based on the user prompt and a set of collections selected
70
+ * in the previous stage. */
71
+ export interface AiQueryGenerateQueryOptions {
72
+ /** Customizes AI agent behavior used by the stage. */
73
+ aiOptions?: AiChatOptions;
74
+ /** Number of retries due to errors in a generated AI query. Default: 2. */
75
+ maxErrorCorrections?: number;
76
+ /**
77
+ * If provided, the AI Query process will use this agent to generate a query.
78
+ */
79
+ agentId?: AiAgentId;
80
+ }
81
+ /** Options for the query result analysis. */
82
+ export interface AiQueryAnalyzeResultsOptions {
83
+ /** Enables or disables code interpreter mode. Default: 'false'. */
84
+ enableCodeInterpreter?: boolean;
85
+ /** Customizes AI agent behavior used by the stage. */
86
+ aiOptions?: AiChatOptions;
87
+ /**
88
+ * If provided, the AI Query process will use this agent to analyze the query result and provide the final answer.
89
+ */
90
+ agentId?: AiAgentId;
91
+ }
92
+ /**
93
+ * Response from an AI query execution.
94
+ * Contains the generated answer, optional explanation, and executed query details.
95
+ * @category AI
96
+ */
97
+ export interface AiQueryResponse {
98
+ /** AI-generated answer for the query. */
99
+ answer: string;
100
+ /** Optional explanation for the AI-generated answer. */
101
+ explanation?: string;
102
+ /** Query executed by the AI, if applicable. */
103
+ executedQuery?: string;
104
+ /** Markdown format type of the executed query response. */
105
+ queryMarkdownType?: string;
106
+ /** URL to access raw results from the query execution. */
107
+ rawResultsUrl?: string;
108
+ /** Indicates whether the query execution was successful. */
109
+ success: boolean;
110
+ }
111
+ /**
112
+ * Details of an executed query, including the query text and result type.
113
+ * @category AI
114
+ */
115
+ export interface ExecutedQuery {
116
+ /** Text of the executed query. */
117
+ query: string;
118
+ /** The Markdown type of the result (sql, mongo, etc.). */
119
+ markdownType: string;
120
+ /** URL to access raw results from the query execution. */
121
+ rawResultsUrl?: string;
122
+ }
123
+ /**
124
+ * Response from executing an AI query across multiple integrations.
125
+ * Includes answers and explanations for each executed query.
126
+ * @category AI
127
+ */
128
+ export interface ExecuteAiQueryMultiResponse {
129
+ /** AI-generated answer for the multi-integration query. */
130
+ answer: string;
131
+ /** Optional explanation for the AI-generated response. */
132
+ explanation?: string;
133
+ /** List of executed queries with details. */
134
+ executedQueries: Array<ExecutedQuery>;
135
+ /** Indicates whether the query execution was successful. */
136
+ success: boolean;
137
+ }
138
+ /**
139
+ * The AI API call response
140
+ * @category AI
141
+ */
142
+ export interface AiApiResult {
143
+ /** ID of the executed API endpoint. */
144
+ endpointId: string;
145
+ /** Name of the executed API endpoint. */
146
+ responseBody: string | object;
147
+ /** Status code of the executed API request. */
148
+ responseStatusCode: number;
149
+ /** Request's body of the executed API request. */
150
+ requestBody: any;
151
+ /** Request options of the executed API request. */
152
+ requestOptions: ApiOptions;
153
+ }
154
+ /**
155
+ * Response from executing an AI-powered API request.
156
+ * Includes the AI-generated answer and details of executed API calls.
157
+ * @category AI
158
+ */
159
+ export interface ExecuteAiApiResponse {
160
+ /** AI-generated answer for the API request. */
161
+ answer: string;
162
+ /** Optional explanation for the AI-generated API response. */
163
+ explanation?: string;
164
+ /** List of executed API requests and their results. */
165
+ executedApis?: Array<AiApiResult>;
166
+ /** Markdown format type of the executed query response. */
167
+ queryMarkdownType?: string;
168
+ /** Indicates whether the API request execution was successful. */
169
+ success: boolean;
170
+ }
@@ -0,0 +1,9 @@
1
+ /** Optional configuration for an API call, including headers, query, and path parameters. */
2
+ export interface ApiOptions {
3
+ /** Headers to include in the API request. */
4
+ headers?: Record<string, string | number | boolean>;
5
+ /** Query parameters to append to the API URL. */
6
+ queryParams?: Record<string, string | number | boolean>;
7
+ /** Path parameters to substitute in the API URL. */
8
+ pathParams?: Record<string, string | number | boolean>;
9
+ }
@@ -0,0 +1,91 @@
1
+ import { FieldName } from './document.public-types';
2
+ /** Represents the HTTP methods supported by an API endpoint. */
3
+ export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
4
+ /** An identifier string used to uniquely represent an API endpoint. */
5
+ export type ApiEndpointId = string;
6
+ /** Represents the location in an API request where a parameter can be found. */
7
+ export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
8
+ /** Represents the location in an API response where a value can appear. */
9
+ export type ApiResponseParameterLocation = 'header' | 'body';
10
+ /** Specifies the allowed locations where injection parameters can be inserted into the API request. */
11
+ export type ApiInjectionParameterLocation = 'header' | 'query';
12
+ /** A string path used to locate a specific field in a response structure. */
13
+ export type FieldPath = string;
14
+ /** A map of API endpoint definitions keyed by unique endpoint IDs. */
15
+ export type IntegrationApiEndpoints = Record<ApiEndpointId, ApiEndpoint>;
16
+ /** Describes a field included in an API request, including its location, optional description, and whether it is required. */
17
+ export interface ApiRequestField {
18
+ /** The location of the field in the API request (e.g., query, body, header, path). */
19
+ location: ApiParameterLocation;
20
+ /** An optional description of the field's purpose or usage. */
21
+ description?: string;
22
+ /** Indicates whether the field is mandatory for the request. */
23
+ required?: boolean;
24
+ }
25
+ /** The options for calling an API. */
26
+ export interface InternalCallApiOptions {
27
+ /** If true, the response will be returned as-is without any processing. */
28
+ nativeResponse?: boolean;
29
+ /**
30
+ * An optional string to override the default origin of the API (e.g. `https://host:port`). Useful for
31
+ * scenarios such as testing, development, or accessing the API from different environments.
32
+ */
33
+ originOverride?: string;
34
+ }
35
+ /** Describes a field included in an API response, optionally including the field path and a description. */
36
+ export interface ApiResponseField {
37
+ /** The location of the field in the API response (e.g., header, body). */
38
+ location: ApiResponseParameterLocation;
39
+ /** The path to the field within the response structure, if applicable. */
40
+ path?: FieldPath;
41
+ /** An optional description of the field's content or purpose. */
42
+ description?: string;
43
+ }
44
+ /** Represents the possible values for injected field types used in request modification (e.g., secret or regular). */
45
+ export declare const API_INJECTION_FIELD_TYPES: readonly ["secret", "regular"];
46
+ /** The type of value to inject into an API request, such as a secret or a regular value. */
47
+ export type ApiInjectionFieldType = (typeof API_INJECTION_FIELD_TYPES)[number];
48
+ /** Defines a value to be injected into the API call, such as a secret or query parameter, along with its location and type. */
49
+ export interface ApiInjectionField {
50
+ /** The value to be injected into the request. */
51
+ value: string;
52
+ /** The type of the injected value, either 'secret' or 'regular'. */
53
+ type: ApiInjectionFieldType;
54
+ /** The location in the request where the value should be injected (e.g., header, query). */
55
+ location: ApiInjectionParameterLocation;
56
+ }
57
+ /** Connection options for interacting with a GraphQL API. */
58
+ export interface GraphQLConnectionOptions {
59
+ /** The base URL of the GraphQL API endpoint. */
60
+ baseUrl: string;
61
+ /** An optional schema defining fields to inject into the GraphQL request. */
62
+ injectionSchema?: ApiInjectionSchema;
63
+ }
64
+ /** A mapping of field names to their corresponding injection field definitions. */
65
+ export type ApiInjectionSchema = Record<FieldName, ApiInjectionField>;
66
+ /** Options for discovering APIs via an OpenAPI specification. */
67
+ export interface OpenApiDiscoveryOptions {
68
+ /** The URL of the OpenAPI specification document. */
69
+ openApiSpecUrl: string;
70
+ }
71
+ /** Represents the structure of an API endpoint, including its path, method, schemas, and metadata. */
72
+ export interface ApiEndpoint {
73
+ /** The relative path of the endpoint (e.g., '/users'). */
74
+ relativePath: string;
75
+ /** The HTTP method used by the endpoint (e.g., 'get', 'post'). */
76
+ method: HttpMethod;
77
+ /** A schema defining the fields expected in the request, if any. */
78
+ requestSchema?: Record<FieldName, ApiRequestField>;
79
+ /** A schema defining the fields returned in the response, if any. */
80
+ responseSchema?: Record<FieldPath, ApiResponseField>;
81
+ /** A schema defining fields to inject into the request, if any. */
82
+ injectionSchema?: ApiInjectionSchema;
83
+ /** An optional array of tags categorizing the endpoint. */
84
+ tags?: Array<string>;
85
+ /** An optional description of the endpoint's purpose or behavior. */
86
+ description?: string;
87
+ /** The MIME type of the request body, if applicable (e.g., 'application/json'). */
88
+ bodyMimeType?: string;
89
+ /** Indicates whether the request body is mandatory for the endpoint. */
90
+ isRequestBodyRequired?: boolean;
91
+ }
@@ -0,0 +1,50 @@
1
+ /** Backend related public types that should be available on the client SDK */
2
+ /** A type alias for a string that represents an AI function ID. */
3
+ export type AiFunctionId = string;
4
+ /** A type alias for a string that represents an AI functions configurator ID. */
5
+ export type AiFunctionsConfiguratorId = string;
6
+ /**
7
+ * A type alias for a service identifier.
8
+ * @category Queue
9
+ */
10
+ export type TopicName = string;
11
+ /** A type alias for a service class name. */
12
+ export type ServiceName = string;
13
+ /** A type alias for a function name within a service. */
14
+ export type FunctionName = string;
15
+ /**
16
+ * Function name with contextual data, where the data must be serializable as JSON.
17
+ */
18
+ export interface AiFunctionIdWithContext {
19
+ /**
20
+ * The ID of the AI function as described in @aiFunction decorator.
21
+ * Historically named as 'name' because AI function name is the default value for 'ID'.
22
+ */
23
+ name: AiFunctionId;
24
+ /** A record of contextual data associated with the function call. */
25
+ context?: Record<string, unknown>;
26
+ /** A list of predefined parameter values for the AI function. These parameters are hidden from the AI. */
27
+ predefinedParameters?: Record<string, unknown>;
28
+ }
29
+ /**
30
+ * A combined service and function name in the format 'ServiceName:FunctionName'.
31
+ * Uniquely identifies a function within a service.
32
+ */
33
+ export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
34
+ /**
35
+ * LLM model name for use in API calls, eg. "gpt-4o-mini".
36
+ */
37
+ export type UserAiChatModelName = string;
38
+ /**
39
+ * Stats about a given LLM model.
40
+ */
41
+ export type LlmModelMetadata = {
42
+ /**
43
+ * A friendly name for the model, to display in UIs.
44
+ */
45
+ displayName: string;
46
+ /** Maximum tokens the model can generate in a single response. */
47
+ maxOutputTokens: number;
48
+ /** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
49
+ contextWindowTokens: number;
50
+ };
@@ -0,0 +1,30 @@
1
+ /** A type alias for an application id. */
2
+ export type AppId = string;
3
+ /** A tuple of environment identifiers like 'dev' or 'prod'. */
4
+ export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
5
+ /** A type representing valid environment identifiers derived from ENVIRONMENT_IDS. */
6
+ export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
7
+ /** A type alias for a squid developer identifier. */
8
+ export type SquidDeveloperId = string;
9
+ /** A type alias for an integration id. */
10
+ export type IntegrationId = string;
11
+ /** A type alias for a client identifier. */
12
+ export type ClientId = string;
13
+ /** A type alias for a squid document identifier. */
14
+ export type SquidDocId = string;
15
+ /** A type alias for a client request identifier. */
16
+ export type ClientRequestId = string;
17
+ /** ID of AI agent. Also known as AI profile id. */
18
+ export type AiAgentId = string;
19
+ /** App-level ID of AI Knowledge Base */
20
+ export type AiKnowledgeBaseId = string;
21
+ /**
22
+ * The built-in agent id. Cannot be customized.
23
+ * @category AI
24
+ */
25
+ export declare const BUILT_IN_AGENT_ID = "built_in_agent";
26
+ /**
27
+ * A type alias for an AI context identifier.
28
+ * @category AI
29
+ */
30
+ export type AiContextId = string;
@@ -0,0 +1,83 @@
1
+ import { AppId, ClientId } from './communication.public-types';
2
+ /**
3
+ * @category Auth
4
+ */
5
+ export type AuthType = 'Bearer' | 'ApiKey';
6
+ /**
7
+ * The payload of a JWT token when Bearer authentication is used.
8
+ * @category Auth
9
+ */
10
+ export interface AuthWithBearer {
11
+ /** Specifies the Bearer authentication type. */
12
+ type: 'Bearer';
13
+ /** The unique identifier of the authenticated user. */
14
+ userId: string;
15
+ /** The expiration timestamp of the token, in seconds. */
16
+ expiration: number;
17
+ /** Additional attributes associated with the token. */
18
+ attributes: Record<string, any>;
19
+ /** The raw JWT token string, if available. */
20
+ jwt?: string;
21
+ }
22
+ /**
23
+ * The authentication object for the current request when an API key is used.
24
+ * @category Auth
25
+ */
26
+ export interface AuthWithApiKey {
27
+ /** Specifies the API key authentication type. */
28
+ type: 'ApiKey';
29
+ /** The API key string used for authentication. */
30
+ apiKey: string;
31
+ }
32
+ /**
33
+ * The authentication object for the current request.
34
+ * @category Auth
35
+ */
36
+ export type Auth = AuthWithBearer | AuthWithApiKey;
37
+ /**
38
+ * Represents an authentication token with its type and associated details.
39
+ * @category Auth
40
+ */
41
+ export interface AuthToken {
42
+ /** The type of authentication (e.g., 'Bearer' or 'ApiKey'). */
43
+ type: AuthType;
44
+ /** The token string used for authentication. */
45
+ token: string;
46
+ /** The ID of the integration associated with the token, if applicable. */
47
+ integrationId?: string;
48
+ }
49
+ /** * The context of a request to a service, providing metadata about the request source. */
50
+ export interface RunContext {
51
+ /** Your applicationId. */
52
+ appId: AppId;
53
+ /**
54
+ * The id of the client that initiated this request. This is only relevant in cases that the request was initiated by
55
+ * a client such as when securing an api call or a DB operation. This id will not be available for triggers,
56
+ * schedulers, webhooks and other functions that are not directly initiated by a user action.
57
+ */
58
+ clientId?: ClientId;
59
+ /** The IP address of the client that initiated this request. */
60
+ sourceIp?: string;
61
+ /** The headers of the request. Headers are in lower-case. */
62
+ headers?: Record<string, any>;
63
+ /** Additional context for OpenAPI requests */
64
+ openApiContext?: OpenApiContext;
65
+ }
66
+ /** In the case of OpenAPI, the context of the request is provided in a separate object. */
67
+ export interface OpenApiContext {
68
+ /** The OpenAPI request. */
69
+ request: RawRequest;
70
+ }
71
+ /** Represents a raw HTTP request, including method, path, query parameters, body, and headers. */
72
+ export interface RawRequest {
73
+ /** The HTTP method of the request (e.g., GET, POST, PUT, DELETE). */
74
+ method: string;
75
+ /** The path of the request, excluding the domain and query parameters. */
76
+ path: string;
77
+ /** The query parameters of the request, represented as key-value pairs. */
78
+ queryParams?: Record<string, string>;
79
+ /** The body of the request, if applicable. */
80
+ rawBody?: string;
81
+ /** The headers of the request, represented as key-value pairs. */
82
+ headers?: Record<string, string>;
83
+ }