@squidcloud/jira-client 1.0.496 → 1.0.498
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/connectors/jira/common/src/jira-types.d.ts +1 -28
- package/dist/internal-common/src/ai/system-openai-compatible.d.ts +35 -0
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +71 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +1594 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +303 -0
- package/dist/internal-common/src/public-types/ai-function.public-types.d.ts +114 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +2378 -0
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +266 -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 +99 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +61 -0
- package/dist/internal-common/src/public-types/connector.public-types.d.ts +12 -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/event.public-types.d.ts +18 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +405 -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 +65 -0
- package/dist/internal-common/src/public-types/job.public-types.d.ts +101 -0
- package/dist/internal-common/src/public-types/langgraph.public-types.d.ts +50 -0
- package/dist/internal-common/src/public-types/metadata-filter.public-types.d.ts +106 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +149 -0
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +43 -0
- package/dist/internal-common/src/public-types/schema.public-types.d.ts +88 -0
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +82 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/source-code.public-types.d.ts +208 -0
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +20 -0
- package/dist/internal-common/src/public-types-backend/ai-agent.public-context.d.ts +101 -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/application.public-types.d.ts +94 -0
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +199 -0
- package/dist/internal-common/src/public-types-backend/bundle-data.public-types.d.ts +18 -0
- package/dist/internal-common/src/public-types-backend/distributed-lock.public-context.d.ts +4 -0
- package/dist/internal-common/src/public-types-backend/graphql.public-context.d.ts +7 -0
- package/dist/internal-common/src/public-types-backend/langgraph.public-context.d.ts +16 -0
- package/dist/internal-common/src/public-types-backend/mcp.public-types.d.ts +55 -0
- package/dist/internal-common/src/public-types-backend/metric.public-context.d.ts +12 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +161 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +75 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +193 -0
- package/dist/internal-common/src/public-types-backend/storage.public-types.d.ts +15 -0
- package/dist/internal-common/src/public-types-backend/topic.public-context.d.ts +17 -0
- package/dist/internal-common/src/types/application.types.d.ts +98 -0
- package/dist/internal-common/src/types/backend-run.types.d.ts +55 -0
- package/dist/internal-common/src/types/bundle-data.types.d.ts +18 -0
- package/dist/internal-common/src/types/connector.types.d.ts +77 -0
- package/dist/internal-common/src/types/integrations/ai.types.d.ts +1 -0
- package/dist/internal-common/src/types/integrations/api.types.d.ts +76 -0
- package/dist/internal-common/src/types/integrations/auth.types.d.ts +1 -0
- package/dist/internal-common/src/types/integrations/database.types.d.ts +44 -0
- package/dist/internal-common/src/types/integrations/observability.types.d.ts +1 -0
- package/dist/internal-common/src/types/integrations/queue-types.d.ts +1 -0
- package/dist/internal-common/src/types/integrations/schemas.d.ts +6 -0
- package/dist/internal-common/src/types/integrations/storage-types.d.ts +22 -0
- package/dist/internal-common/src/types/langgraph.types.d.ts +1 -0
- package/dist/internal-common/src/types/openapi.types.d.ts +1 -0
- package/dist/internal-common/src/types/query.types.d.ts +21 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/time-units.d.ts +1 -0
- package/dist/internal-common/src/utils/object.d.ts +88 -0
- package/dist/internal-common/src/utils/serialization.d.ts +30 -0
- package/dist/internal-common/src/utils/worker-manager-utils.d.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { AiAgentMemoryOptions, AiChatOptions, AiFileUrl, AiSessionContext } from './ai-agent.public-types';
|
|
2
|
+
import { AiChatModelName } from './ai-common.public-types';
|
|
3
|
+
import { ApiOptions } from './api-client.public-types';
|
|
4
|
+
import { AiAgentId, IntegrationId } from './communication.public-types';
|
|
5
|
+
import { PartialBy } from './typescript.public-types';
|
|
6
|
+
/** A single output column descriptor in a raw query result file. */
|
|
7
|
+
export interface AiQueryResultFieldSchema {
|
|
8
|
+
/** Column name as it appears in the query result. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Data type of the column (e.g. "varchar", "int", "decimal"). */
|
|
11
|
+
type: string;
|
|
12
|
+
/** Human-readable description of what the column represents. */
|
|
13
|
+
desc: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options for configuring AI query execution.
|
|
17
|
+
* @category AI
|
|
18
|
+
*/
|
|
19
|
+
export interface AiQueryOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Custom instructions to modify AI query generation behavior.
|
|
22
|
+
* Used for all stages unless there is a per-stage override.
|
|
23
|
+
*/
|
|
24
|
+
instructions?: string;
|
|
25
|
+
/** Whether to enable raw results output. */
|
|
26
|
+
enableRawResults?: boolean;
|
|
27
|
+
/** Options for the collection selection stage. */
|
|
28
|
+
selectCollectionsOptions?: AiQuerySelectCollectionsOptions;
|
|
29
|
+
/** Options for the query generation stage. */
|
|
30
|
+
generateQueryOptions?: AiQueryGenerateQueryOptions;
|
|
31
|
+
/** Options to specify how the query result should be analyzed (processed) before returning it to the user. */
|
|
32
|
+
analyzeResultsOptions?: AiQueryAnalyzeResultsOptions;
|
|
33
|
+
/** Session information for the AI query execution. */
|
|
34
|
+
sessionContext?: PartialBy<AiSessionContext, 'agentId'>;
|
|
35
|
+
/** memory options */
|
|
36
|
+
memoryOptions?: AiAgentMemoryOptions;
|
|
37
|
+
/** When true, returns generated queries without executing or analyzing them. Default: false. */
|
|
38
|
+
generateQueriesOnly?: boolean;
|
|
39
|
+
/** Optional AI validation of generated queries. Can be used independently or with generateQueriesOnly. */
|
|
40
|
+
validateWithAiOptions?: AiQueryValidateWithAiOptions;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Options of a single AI query call: the query options plus a credential the client sends as a request header.
|
|
44
|
+
* @category AI
|
|
45
|
+
*/
|
|
46
|
+
export interface AiQueryRequestOptions extends AiQueryOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Access token the generated queries run with in place of the integration's stored secret, for integration
|
|
49
|
+
* types that support it. Other types ignore it. Sent in the `x-squid-integration-access-tokens` request header
|
|
50
|
+
* rather than with the options, so it is never stored.
|
|
51
|
+
*/
|
|
52
|
+
accessToken?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Request to execute an AI query using a specific integration.
|
|
56
|
+
* Supports additional query execution options.
|
|
57
|
+
* @category AI
|
|
58
|
+
*/
|
|
59
|
+
export interface AiQueryRequest {
|
|
60
|
+
/** ID of the integration to execute the AI query. */
|
|
61
|
+
integrationId: IntegrationId;
|
|
62
|
+
/** User-provided prompt for the AI query. */
|
|
63
|
+
prompt: string;
|
|
64
|
+
/** Additional options for query execution. */
|
|
65
|
+
options?: AiQueryOptions;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Options for the collection selection stage.
|
|
69
|
+
*
|
|
70
|
+
* At this stage Squid selects a subset of collections that will be used by the later stage to generate the real query.
|
|
71
|
+
* It is recommended that the set of collections selected by this stage be broad enough so the query generation stage
|
|
72
|
+
* has a good view of the database.
|
|
73
|
+
*/
|
|
74
|
+
export interface AiQuerySelectCollectionsOptions {
|
|
75
|
+
/**
|
|
76
|
+
* Limits collections to be used in the query only to these collections.
|
|
77
|
+
* When not provided, all collections are used.
|
|
78
|
+
*/
|
|
79
|
+
collectionsToUse?: string[];
|
|
80
|
+
/** Defines the stage algorithm. Default: 'auto'. */
|
|
81
|
+
runMode?: AiQueryCollectionsSelectionRunMode;
|
|
82
|
+
/** Used to customize AI agent behavior used by the stage. */
|
|
83
|
+
aiOptions?: AiChatOptions;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Defines the stage behavior:
|
|
87
|
+
* - 'default' - Squid will decide if to run the collection selection algorithm or not.
|
|
88
|
+
* - 'force' - Collection selection algorithm is run always, even if collectionsToUse are provided.
|
|
89
|
+
* - 'disable' - The stage is disabled. The whole schema (or collectionsToUse) will be passed to the next step.
|
|
90
|
+
*/
|
|
91
|
+
export type AiQueryCollectionsSelectionRunMode = 'default' | 'force' | 'disable';
|
|
92
|
+
/**
|
|
93
|
+
* Options for the query generation stage.
|
|
94
|
+
*
|
|
95
|
+
* At this stage Squid generates the database native query based on the user prompt and a set of collections selected
|
|
96
|
+
* in the previous stage. */
|
|
97
|
+
export interface AiQueryGenerateQueryOptions {
|
|
98
|
+
/** Customizes AI agent behavior used by the stage. */
|
|
99
|
+
aiOptions?: AiChatOptions;
|
|
100
|
+
/** Number of retries due to errors in a generated AI query. Default: 2. */
|
|
101
|
+
maxErrorCorrections?: number;
|
|
102
|
+
/**
|
|
103
|
+
* If provided, the AI Query process will use this agent to generate a query.
|
|
104
|
+
*/
|
|
105
|
+
agentId?: AiAgentId;
|
|
106
|
+
/**
|
|
107
|
+
* When enabled, allows the AI to ask for clarification instead of attempting to generate
|
|
108
|
+
* a query when the request is ambiguous, too complex, or impossible to answer with the
|
|
109
|
+
* available schema. Default: false.
|
|
110
|
+
*/
|
|
111
|
+
allowClarification?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/** Options for the query result analysis. */
|
|
114
|
+
export interface AiQueryAnalyzeResultsOptions {
|
|
115
|
+
/**
|
|
116
|
+
* When set to true, the stage is disabled.
|
|
117
|
+
* The response will contain generated queries, raw results, and a hardcoded text in the answer
|
|
118
|
+
* to check the result files.
|
|
119
|
+
*/
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
/** Enables or disables code interpreter mode. Default: 'false'. */
|
|
122
|
+
enableCodeInterpreter?: boolean;
|
|
123
|
+
/** Customizes AI agent behavior used by the stage. */
|
|
124
|
+
aiOptions?: AiChatOptions;
|
|
125
|
+
/**
|
|
126
|
+
* If provided, the AI Query process will use this agent to analyze the query result and provide the final answer.
|
|
127
|
+
*/
|
|
128
|
+
agentId?: AiAgentId;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Options for AI-based validation of generated queries.
|
|
132
|
+
* @category AI
|
|
133
|
+
*/
|
|
134
|
+
export interface AiQueryValidateWithAiOptions {
|
|
135
|
+
/** Whether AI validation is enabled. */
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
/** Defaults to the same model used for query generation. */
|
|
138
|
+
aiOptions?: AiChatOptions;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Information about an executed query.
|
|
142
|
+
* @category AI
|
|
143
|
+
*/
|
|
144
|
+
export interface ExecutedQueryInfo {
|
|
145
|
+
/** The executed query string. */
|
|
146
|
+
query: string;
|
|
147
|
+
/** Optional description of what this query retrieves. */
|
|
148
|
+
purpose?: string;
|
|
149
|
+
/** Whether this specific query executed successfully. */
|
|
150
|
+
success: boolean;
|
|
151
|
+
/** Raw result file information. Undefined if upload failed or raw results are not enabled. */
|
|
152
|
+
rawResult?: AiFileUrl;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Response from an AI query execution.
|
|
156
|
+
* Contains the generated answer, optional explanation, and executed query details.
|
|
157
|
+
* @category AI
|
|
158
|
+
*/
|
|
159
|
+
export interface AiQueryResponse {
|
|
160
|
+
/** AI-generated answer for the query. */
|
|
161
|
+
answer: string;
|
|
162
|
+
/** Optional explanation for the AI-generated answer. */
|
|
163
|
+
explanation?: string;
|
|
164
|
+
/** Executed queries with their details and raw result URLs. */
|
|
165
|
+
executedQueries: ExecutedQueryInfo[];
|
|
166
|
+
/** Markdown format type of the executed query response. */
|
|
167
|
+
queryMarkdownType?: string;
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated Use {@link ExecutedQueryInfo.rawResult} in {@link executedQueries} instead.
|
|
170
|
+
* URL to access raw results from the first executed query. Populated for backward compatibility.
|
|
171
|
+
*/
|
|
172
|
+
rawResultsUrl?: string;
|
|
173
|
+
/** Indicates whether the query execution was successful. */
|
|
174
|
+
success: boolean;
|
|
175
|
+
/** Indicates whether a code interpreter was used to analyze the results. */
|
|
176
|
+
usedCodeInterpreter?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* When the AI needs clarification to generate a query, this field contains the clarification question.
|
|
179
|
+
* Only populated when `generateQueryOptions.allowClarification` is enabled, and the AI determines
|
|
180
|
+
* it cannot generate a valid query without more information.
|
|
181
|
+
*/
|
|
182
|
+
clarificationQuestion?: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The AI API call response
|
|
186
|
+
* @category AI
|
|
187
|
+
*/
|
|
188
|
+
export interface AiApiResult {
|
|
189
|
+
/** ID of the executed API endpoint. */
|
|
190
|
+
endpointId: string;
|
|
191
|
+
/** Name of the executed API endpoint. */
|
|
192
|
+
responseBody: string | object;
|
|
193
|
+
/** Status code of the executed API request. */
|
|
194
|
+
responseStatusCode: number;
|
|
195
|
+
/** Request's body of the executed API request. */
|
|
196
|
+
requestBody: any;
|
|
197
|
+
/** Request options of the executed API request. */
|
|
198
|
+
requestOptions: ApiOptions;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Response from executing an AI-powered API request.
|
|
202
|
+
* Includes the AI-generated answer and details of executed API calls.
|
|
203
|
+
* @category AI
|
|
204
|
+
*/
|
|
205
|
+
export interface ExecuteAiApiResponse {
|
|
206
|
+
/** AI-generated answer for the API request. */
|
|
207
|
+
answer: string;
|
|
208
|
+
/** Optional explanation for the AI-generated API response. */
|
|
209
|
+
explanation?: string;
|
|
210
|
+
/** List of executed API requests and their results. */
|
|
211
|
+
executedApis?: Array<AiApiResult>;
|
|
212
|
+
/** Markdown format type of the executed query response. */
|
|
213
|
+
queryMarkdownType?: string;
|
|
214
|
+
/** Indicates whether the API request execution was successful. */
|
|
215
|
+
success: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Options for executing an AI-powered query over spreadsheet files.
|
|
219
|
+
* @category AI
|
|
220
|
+
*/
|
|
221
|
+
export interface AiSpreadsheetQueryOptions {
|
|
222
|
+
/**
|
|
223
|
+
* Extra instructions honored when composing the answer (e.g. formatting rules or domain
|
|
224
|
+
* conventions of the calling agent).
|
|
225
|
+
*/
|
|
226
|
+
instructions?: string;
|
|
227
|
+
/** Overrides the model used to answer the query. */
|
|
228
|
+
model?: AiChatModelName;
|
|
229
|
+
/**
|
|
230
|
+
* Background gathered by the calling agent (facts from retrieved chunks, chat history, or earlier
|
|
231
|
+
* spreadsheet queries in the same conversation). Injected into the sub-agent's prompt as reference
|
|
232
|
+
* data — not as instructions — so it starts oriented instead of rediscovering the caller's context.
|
|
233
|
+
*/
|
|
234
|
+
context?: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Request for executing an AI-powered query over spreadsheet files.
|
|
238
|
+
* @category AI
|
|
239
|
+
*/
|
|
240
|
+
export interface ExecuteAiSpreadsheetQueryRequest {
|
|
241
|
+
/** Natural language question to answer using the spreadsheet data. */
|
|
242
|
+
prompt: string;
|
|
243
|
+
/** The spreadsheet files to query. */
|
|
244
|
+
files: Array<AiFileUrl>;
|
|
245
|
+
/** Optional query options. */
|
|
246
|
+
options?: AiSpreadsheetQueryOptions;
|
|
247
|
+
/** Optional session context for status updates and tracing. */
|
|
248
|
+
sessionContext?: AiSessionContext;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Response from executing an AI-powered query over spreadsheet files.
|
|
252
|
+
* @category AI
|
|
253
|
+
*/
|
|
254
|
+
export interface ExecuteAiSpreadsheetQueryResponse {
|
|
255
|
+
/** AI-generated answer computed from the spreadsheet data. */
|
|
256
|
+
answer: string;
|
|
257
|
+
/** Indicates whether the query execution was successful. */
|
|
258
|
+
success: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* All Python code executed to produce the answer, in execution order. Each step ran as its own
|
|
261
|
+
* sandbox script; multiple steps are joined with `# --- Step N ---` separators.
|
|
262
|
+
*/
|
|
263
|
+
executedCode?: string;
|
|
264
|
+
/** Files produced while answering (e.g. charts or exports emitted by the executed code). */
|
|
265
|
+
files?: Array<AiFileUrl>;
|
|
266
|
+
}
|
|
@@ -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,99 @@
|
|
|
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' | 'path';
|
|
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
|
+
/**
|
|
67
|
+
* Options for discovering APIs via an OpenAPI specification. Supply either a URL
|
|
68
|
+
* to fetch the document from, or the raw document content directly.
|
|
69
|
+
*/
|
|
70
|
+
export interface OpenApiDiscoveryOptions {
|
|
71
|
+
/** The URL of the OpenAPI specification document. */
|
|
72
|
+
openApiSpecUrl?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The raw OpenAPI specification document (JSON or YAML), used to discover the
|
|
75
|
+
* schema directly when the spec is provided as content rather than a URL.
|
|
76
|
+
*/
|
|
77
|
+
openApiSpecContent?: string;
|
|
78
|
+
}
|
|
79
|
+
/** Represents the structure of an API endpoint, including its path, method, schemas, and metadata. */
|
|
80
|
+
export interface ApiEndpoint {
|
|
81
|
+
/** The relative path of the endpoint (e.g., '/users'). */
|
|
82
|
+
relativePath: string;
|
|
83
|
+
/** The HTTP method used by the endpoint (e.g., 'get', 'post'). */
|
|
84
|
+
method: HttpMethod;
|
|
85
|
+
/** A schema defining the fields expected in the request, if any. */
|
|
86
|
+
requestSchema?: Record<FieldName, ApiRequestField>;
|
|
87
|
+
/** A schema defining the fields returned in the response, if any. */
|
|
88
|
+
responseSchema?: Record<FieldPath, ApiResponseField>;
|
|
89
|
+
/** A schema defining fields to inject into the request, if any. */
|
|
90
|
+
injectionSchema?: ApiInjectionSchema;
|
|
91
|
+
/** An optional array of tags categorizing the endpoint. */
|
|
92
|
+
tags?: Array<string>;
|
|
93
|
+
/** An optional description of the endpoint's purpose or behavior. */
|
|
94
|
+
description?: string;
|
|
95
|
+
/** The MIME type of the request body, if applicable (e.g., 'application/json'). */
|
|
96
|
+
bodyMimeType?: string;
|
|
97
|
+
/** Indicates whether the request body is mandatory for the endpoint. */
|
|
98
|
+
isRequestBodyRequired?: boolean;
|
|
99
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 the `@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
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Stats about a given embedding model.
|
|
53
|
+
*/
|
|
54
|
+
export type EmbeddingModelMetadata = {
|
|
55
|
+
/** A friendly name for the model, to display in UIs. */
|
|
56
|
+
displayName: string;
|
|
57
|
+
/** The number of dimensions produced by this embedding model. */
|
|
58
|
+
dimensions: number;
|
|
59
|
+
/** Maximum input tokens per request. */
|
|
60
|
+
maxTokens: number;
|
|
61
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of all connector package names.
|
|
3
|
+
* To prevent automatic discovery && latest version sync in 'prod' add your connector package name to
|
|
4
|
+
* 'CONNECTOR_PACKAGES_TO_EXCLUDE_FROM_AUTO_SYNC' in ConnectorsService (console-backend).
|
|
5
|
+
* @category Platform
|
|
6
|
+
*/
|
|
7
|
+
export declare const CONNECTOR_IDS: readonly ["bitbucket", "confluence", "connect_companion", "cotomi", "elevenlabs", "openai_voice", "essentials", "freshdesk", "generic_site_ingester", "github", "google_calendar", "google_drive", "hubspot", "sharepoint", "jira", "jira_jsm", "linear", "mail", "onedrive", "outlook", "salesforce", "servicenow_csm", "slack", "teams", "ticketmind_companion", "twilio", "zendesk"];
|
|
8
|
+
/**
|
|
9
|
+
* Unique connector package name.
|
|
10
|
+
* @category Platform
|
|
11
|
+
*/
|
|
12
|
+
export type ConnectorId = (typeof CONNECTOR_IDS)[number];
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IntegrationId } from './communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a primitive data type used in database fields.
|
|
4
|
+
* @category Database
|
|
5
|
+
*/
|
|
6
|
+
export type PrimitiveFieldType = string | number | boolean | null | Date;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a recursive field type structure for database documents, including primitives, arrays, and nested objects.
|
|
9
|
+
* @category Database
|
|
10
|
+
*/
|
|
11
|
+
export type FieldType = PrimitiveFieldType | Array<FieldType> | {
|
|
12
|
+
[key: string]: FieldType;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A type alias for a field name.
|
|
16
|
+
* @category Database
|
|
17
|
+
*/
|
|
18
|
+
export type FieldName<T = any> = string & keyof T;
|
|
19
|
+
/**
|
|
20
|
+
* A type alias for a document id as string.
|
|
21
|
+
* @category Database
|
|
22
|
+
*/
|
|
23
|
+
export type DocId = string;
|
|
24
|
+
/**
|
|
25
|
+
* A type alias for a document id object when the ID is a composite of primary keys.
|
|
26
|
+
* @category Database
|
|
27
|
+
*/
|
|
28
|
+
export type DocIdObj = Record<FieldName, any>;
|
|
29
|
+
/**
|
|
30
|
+
* A type alias for a document id or a document id object.
|
|
31
|
+
* @category Database
|
|
32
|
+
*/
|
|
33
|
+
export type DocIdOrDocIdObj = DocId | DocIdObj;
|
|
34
|
+
/**
|
|
35
|
+
* A type alias for a collection name.
|
|
36
|
+
* @category Database
|
|
37
|
+
*/
|
|
38
|
+
export type CollectionName = string;
|
|
39
|
+
/**
|
|
40
|
+
* A generic document data type.
|
|
41
|
+
* @category Database
|
|
42
|
+
*/
|
|
43
|
+
export type DocumentData = Record<FieldName, any | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* A type alias for timestamp field..
|
|
46
|
+
* @category Database
|
|
47
|
+
*/
|
|
48
|
+
export type DocTimestamp = number;
|
|
49
|
+
/**
|
|
50
|
+
* The structure of a Squid Document with metadata and dynamic fields.
|
|
51
|
+
* @category Database
|
|
52
|
+
*/
|
|
53
|
+
export interface SquidDocument {
|
|
54
|
+
[fieldName: string]: FieldType | undefined;
|
|
55
|
+
/** The unique identifier of the document. */
|
|
56
|
+
__docId__: DocId;
|
|
57
|
+
/** The timestamp of the document, typically in milliseconds. */
|
|
58
|
+
__ts__: DocTimestamp;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The full document identifier, combining collection name, document ID, and integration ID.
|
|
62
|
+
* @category Database
|
|
63
|
+
*/
|
|
64
|
+
export interface SquidDocIdObj {
|
|
65
|
+
/** The name of the collection containing the document. */
|
|
66
|
+
collectionName: CollectionName;
|
|
67
|
+
/** The unique identifier of the document within the collection. */
|
|
68
|
+
docId: DocId;
|
|
69
|
+
/** The ID of the integration associated with the document. */
|
|
70
|
+
integrationId: IntegrationId;
|
|
71
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A generic event that can be emitted with `squid.events().emit` and handled by one or more
|
|
3
|
+
* subscribers declared with the backend `@eventHandler` decorator. Events are delivered over core's
|
|
4
|
+
* internal event stream (not the public queue API), at-least-once and with no ordering guarantee.
|
|
5
|
+
*/
|
|
6
|
+
export interface TriggerEvent<T = unknown> {
|
|
7
|
+
/** Unique event id (e.g. `generateUUID()`). */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The event type. Determines which `@eventHandler` subscribers receive the event. */
|
|
10
|
+
type: string;
|
|
11
|
+
/** Arbitrary, JSON-serializable event payload. */
|
|
12
|
+
payload: T;
|
|
13
|
+
}
|
|
14
|
+
/** Request body for the `events/emit` core endpoint that publishes a `TriggerEvent`. */
|
|
15
|
+
export interface EmitEventRequest<T = unknown> {
|
|
16
|
+
/** The event to emit. */
|
|
17
|
+
event: TriggerEvent<T>;
|
|
18
|
+
}
|