@squidcloud/twilio-client 1.0.493
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/twilio/common/src/twilio-types.d.ts +224 -0
- package/dist/connectors/twilio/twilio-client/src/index.d.ts +2 -0
- package/dist/connectors/twilio/twilio-client/src/twilio-client.d.ts +18 -0
- package/dist/index.js +1 -0
- package/dist/internal-common/src/ai/voice-languages.d.ts +22 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +1536 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +298 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +2144 -0
- package/dist/internal-common/src/public-types/ai-voice.public-types.d.ts +200 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +61 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +405 -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 +87 -0
- package/dist/internal-common/src/public-types/metadata-filter.public-types.d.ts +106 -0
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +82 -0
- package/package.json +25 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The extraction method to use for processing documents.
|
|
3
|
+
*
|
|
4
|
+
* `legacy` extracts text and embedded images in-process without any external model call.
|
|
5
|
+
* `legacy_with_llm` extracts the same text, and additionally renders each page to a screenshot that is
|
|
6
|
+
* described by a vision model — covering content the text layer cannot carry (figures, layout, scanned
|
|
7
|
+
* regions) at the cost of one model call per page. Both run with no external OCR provider.
|
|
8
|
+
*/
|
|
9
|
+
export type DocumentExtractionMethod = 'mistral_ocr' | 'legacy' | 'legacy_with_llm' | 'amazon_textract' | 'azure_document_intelligence';
|
|
10
|
+
/**
|
|
11
|
+
* Options for customizing how data is extracted from a document.
|
|
12
|
+
*/
|
|
13
|
+
export interface ExtractDataFromDocumentOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Minimum width/height (in pixels) of images to extract. Smaller images will be ignored.
|
|
16
|
+
*/
|
|
17
|
+
imageMinSizePixels?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to extract embedded images from the document. Defaults to true.
|
|
20
|
+
*/
|
|
21
|
+
extractImages?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Specific page indexes to extract from the document (0-based whole numbers). If omitted or empty, all
|
|
24
|
+
* pages are extracted. Duplicates are collapsed, order does not matter, and a selection containing no
|
|
25
|
+
* whole page number at all is rejected.
|
|
26
|
+
*
|
|
27
|
+
* An index past the end of the document is ignored, and a selection naming only such indexes is
|
|
28
|
+
* rejected — but only where the document is read here. Extracting a PDF *by URL* through an OCR
|
|
29
|
+
* provider hands it over without reading it, so its length is unknown and what an out-of-range index
|
|
30
|
+
* does is up to that provider. Upload the file instead to have the whole selection checked.
|
|
31
|
+
*/
|
|
32
|
+
pageIndexes?: number[];
|
|
33
|
+
/**
|
|
34
|
+
* The preferred method for extracting data from the document.
|
|
35
|
+
*/
|
|
36
|
+
preferredExtractionMethod?: DocumentExtractionMethod;
|
|
37
|
+
/**
|
|
38
|
+
* Whether Squid keeps or discards the original file.
|
|
39
|
+
*
|
|
40
|
+
* Keeping the original file allows reprocessing and the ability for the user to download it later.
|
|
41
|
+
*
|
|
42
|
+
* Defaults to false.
|
|
43
|
+
*/
|
|
44
|
+
discardOriginalFile?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Format hint for text-based extraction (markdown / HTML). When omitted, the format is detected from
|
|
47
|
+
* the content. Only consulted by extractors that handle text input.
|
|
48
|
+
*/
|
|
49
|
+
textFormat?: 'auto' | 'markdown' | 'html' | 'plain';
|
|
50
|
+
/**
|
|
51
|
+
* Whether to read document-level properties (title/author/dates) from the source container and
|
|
52
|
+
* return them as `documentMetadata`. Off by default: container parsing has a real per-file cost
|
|
53
|
+
* (zip/PDF re-parse), so callers opt in only when the owning knowledge base declares metadata fields.
|
|
54
|
+
*
|
|
55
|
+
* Honored only by file-based extraction (which owns the original buffer for every format);
|
|
56
|
+
* URL-based extraction ignores it and never returns `documentMetadata`.
|
|
57
|
+
*/
|
|
58
|
+
collectDocumentMetadata?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Safety-net storage expiration (seconds) registered WITH the long-term upload of the original file,
|
|
61
|
+
* before its bytes land — so a process crash at any later point (mid-OCR, before the caller ever
|
|
62
|
+
* learns the path) leaves a self-collecting object instead of a permanent orphan. The caller that
|
|
63
|
+
* sets this owns clearing the expiration once it durably references the path; leaving it unset keeps
|
|
64
|
+
* the original permanent from the moment it uploads.
|
|
65
|
+
*/
|
|
66
|
+
originalFileExpirationSeconds?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Request payload for extracting data from a document via URL.
|
|
70
|
+
*/
|
|
71
|
+
export interface ExtractDataFromDocumentUrlRequest {
|
|
72
|
+
/**
|
|
73
|
+
* The publicly accessible URL pointing to the document file.
|
|
74
|
+
*/
|
|
75
|
+
url: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional parameters to control how the extraction is performed.
|
|
78
|
+
*/
|
|
79
|
+
options?: ExtractDataFromDocumentOptions;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Request payload for extracting data from a document file (uploaded directly).
|
|
83
|
+
*/
|
|
84
|
+
export interface ExtractDataFromDocumentFileRequest {
|
|
85
|
+
/**
|
|
86
|
+
* Optional parameters to control how the extraction is performed.
|
|
87
|
+
*/
|
|
88
|
+
options?: ExtractDataFromDocumentOptions;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* What an extracted image depicts: an image embedded in the page, or a full-page screenshot.
|
|
92
|
+
*/
|
|
93
|
+
export type ExtractedImageKind = 'embedded' | 'fullPage';
|
|
94
|
+
/**
|
|
95
|
+
* Representation of an image extracted from a document, for use in generated content.
|
|
96
|
+
*/
|
|
97
|
+
export interface ExtractDataFromDocumentImage {
|
|
98
|
+
/**
|
|
99
|
+
* A unique identifier for the image.
|
|
100
|
+
*/
|
|
101
|
+
id: string;
|
|
102
|
+
/**
|
|
103
|
+
* A placeholder or marker in the content where this image should be inserted.
|
|
104
|
+
*/
|
|
105
|
+
textToReplaceInContent: string;
|
|
106
|
+
/**
|
|
107
|
+
* The base64-encoded image data, prefixed with its MIME type (e.g., data:image/png;base64,...).
|
|
108
|
+
*/
|
|
109
|
+
imageBase64Url: string;
|
|
110
|
+
/**
|
|
111
|
+
* What the image depicts. Absent means `embedded`. Selects the description prompt — a page
|
|
112
|
+
* screenshot is described as a complement to the page's stored text, an embedded image in full.
|
|
113
|
+
*/
|
|
114
|
+
kind?: ExtractedImageKind;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A single extracted page from the document, including structured content and images.
|
|
118
|
+
*/
|
|
119
|
+
export interface ExtractDataFromDocumentPage {
|
|
120
|
+
/**
|
|
121
|
+
* Optional title for the page (e.g., sheet name or section heading).
|
|
122
|
+
*/
|
|
123
|
+
title?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Page index in the original document (0-based).
|
|
126
|
+
*/
|
|
127
|
+
index: number;
|
|
128
|
+
/**
|
|
129
|
+
* Extracted textual content or CSV representation of the page.
|
|
130
|
+
*/
|
|
131
|
+
content: string;
|
|
132
|
+
/**
|
|
133
|
+
* List of images extracted from this page.
|
|
134
|
+
*/
|
|
135
|
+
images: Array<ExtractDataFromDocumentImage>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Structural information about one sheet of a spreadsheet file.
|
|
139
|
+
*/
|
|
140
|
+
export interface SpreadsheetSheetInfo {
|
|
141
|
+
/**
|
|
142
|
+
* The sheet name.
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
/**
|
|
146
|
+
* Number of data rows in the sheet (excluding the header row).
|
|
147
|
+
*/
|
|
148
|
+
rowCount: number;
|
|
149
|
+
/**
|
|
150
|
+
* Number of columns in the sheet.
|
|
151
|
+
*/
|
|
152
|
+
columnCount: number;
|
|
153
|
+
/**
|
|
154
|
+
* Present and true when the sheet is hidden (or very-hidden) in the workbook. Hidden sheets are
|
|
155
|
+
* extracted like visible ones; the flag lets downstream surfaces say so. Omitted for visible
|
|
156
|
+
* sheets to keep the stored inventory JSON compact.
|
|
157
|
+
*/
|
|
158
|
+
hidden?: boolean;
|
|
159
|
+
/** Cells whose value is computed by a formula. Omitted when zero, keeping the stored JSON compact. */
|
|
160
|
+
formulaCellCount?: number;
|
|
161
|
+
/** Merged ranges declared on the sheet. Omitted when zero. */
|
|
162
|
+
mergedRangeCount?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Sheet-qualified references to this sheet from formulas on OTHER VISIBLE sheets. Omitted when
|
|
165
|
+
* zero. Raw evidence of "a live sheet reads this one", which is why references from hidden sheets
|
|
166
|
+
* are excluded — those are reported through {@link disconnected}, which walks them transitively.
|
|
167
|
+
*/
|
|
168
|
+
inboundRefCount?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Sheet-qualified references from this sheet's formulas to other sheets OF THIS WORKBOOK. Omitted
|
|
171
|
+
* when zero. External references (`[Book.xlsx]Sheet1!A1`) are not counted — except in a legacy
|
|
172
|
+
* .xls, whose formula text does not mark them (see {@link disconnected}), so a reference into
|
|
173
|
+
* another workbook's same-named sheet counts here.
|
|
174
|
+
*/
|
|
175
|
+
outboundRefCount?: number;
|
|
176
|
+
/** Formulas on the sheet containing a `#REF!` error, the signature of deleted precedents. Omitted when zero. */
|
|
177
|
+
refErrorCount?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Present and true when the sheet is hidden AND takes no part in the workbook's live dependency
|
|
180
|
+
* graph: nothing the live model reads leads to it, and it reads no visible sheet itself.
|
|
181
|
+
*
|
|
182
|
+
* Reachability, not adjacency: a hidden sheet read by another hidden sheet that a visible sheet
|
|
183
|
+
* reads is live, and the walk crosses as many hidden hops as the workbook has. It follows the READ
|
|
184
|
+
* direction only. A hidden staging or print sheet that merely reads the live model — downstream of
|
|
185
|
+
* it, not orphaned from it — is spared by that second clause, but sparing it does not spare what
|
|
186
|
+
* feeds IT: were liveness to flow backwards, one legacy tab still pointing at the current dashboard
|
|
187
|
+
* would carry its whole cluster of stale detail sheets back into the live set.
|
|
188
|
+
*
|
|
189
|
+
* Deliberately conservative on two further counts. It is never asserted for visible sheets, which
|
|
190
|
+
* are orphaned by design far more often than not (cover pages, chart tabs, mapping tables). And it
|
|
191
|
+
* remains a heuristic for "legacy", not a proof: `INDIRECT()`, defined-name and VBA/Power Query
|
|
192
|
+
* references are all invisible to a formula scan, so a hidden sheet reached only that way is a
|
|
193
|
+
* false positive. Consumers should present it as the evidence it is, never as a verdict.
|
|
194
|
+
*
|
|
195
|
+
* It is also under-reported in the legacy .xls container, where a parsed external reference keeps
|
|
196
|
+
* only the other workbook's sheet NAME: a link to the model this file was copied from can be
|
|
197
|
+
* credited to that file's own leftover copy of the sheet and spare it the flag. Missing orphans
|
|
198
|
+
* that way, never inventing them, is the direction this signal can afford to be wrong in.
|
|
199
|
+
*/
|
|
200
|
+
disconnected?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Up to a few representative formulas ("C5=SUM(B2:B4)") for the summary preview. NOT persisted in
|
|
203
|
+
* the bounded inventory JSON — preview-time only.
|
|
204
|
+
*/
|
|
205
|
+
formulaSample?: Array<string>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Workbook-level parts the per-sheet CSV dump cannot express, counted from the container index so
|
|
209
|
+
* the summary can SAY what it cannot show (chart-locked figures, pivot views, staleness of
|
|
210
|
+
* external-workbook cached values). Every field is omitted when zero/false.
|
|
211
|
+
*/
|
|
212
|
+
export interface SpreadsheetWorkbookFeatures {
|
|
213
|
+
/** Charts embedded in the workbook; chart data is not extracted. */
|
|
214
|
+
chartCount?: number;
|
|
215
|
+
/** Pivot tables; their computed views are not extracted. */
|
|
216
|
+
pivotTableCount?: number;
|
|
217
|
+
/** External-link parts (other workbooks, DDE, or OLE); linked cells carry last-cached values that may be stale. */
|
|
218
|
+
externalLinkCount?: number;
|
|
219
|
+
/** Sheets carrying cell comments/notes (not extracted). */
|
|
220
|
+
commentPartCount?: number;
|
|
221
|
+
/** The workbook contains VBA macros. */
|
|
222
|
+
hasVbaMacros?: boolean;
|
|
223
|
+
}
|
|
224
|
+
/** One data series of a chart, with its cached categories and values. */
|
|
225
|
+
export interface SpreadsheetChartSeries {
|
|
226
|
+
/** The series name. */
|
|
227
|
+
name?: string;
|
|
228
|
+
/** The categories (x-axis labels) for the series. */
|
|
229
|
+
categories: Array<string>;
|
|
230
|
+
/** The numeric values for the series. */
|
|
231
|
+
values: Array<number>;
|
|
232
|
+
/**
|
|
233
|
+
* The series' true cached point count, present ONLY when extraction retained fewer points than the
|
|
234
|
+
* series actually declares. Without it, a consumer cannot tell a complete 8-point series apart from
|
|
235
|
+
* the first 8 points of a 12-point one, and would describe a January-December series as ending in
|
|
236
|
+
* August.
|
|
237
|
+
*/
|
|
238
|
+
totalPointCount?: number;
|
|
239
|
+
}
|
|
240
|
+
/** One chart's cached content. Cached values are what the chart last rendered; formulas are not evaluated. */
|
|
241
|
+
export interface SpreadsheetChartInfo {
|
|
242
|
+
/** The chart's title, when it declares one. */
|
|
243
|
+
title?: string;
|
|
244
|
+
/** The worksheet the chart is anchored to, when the relationship graph resolves it. */
|
|
245
|
+
sheetName?: string;
|
|
246
|
+
/** The chart's data series, in declaration order. */
|
|
247
|
+
series: Array<SpreadsheetChartSeries>;
|
|
248
|
+
/**
|
|
249
|
+
* The chart's true series count, present ONLY when extraction retained fewer series than the chart
|
|
250
|
+
* actually declares — so an omitted-series count is computed against what the chart HAS, not against
|
|
251
|
+
* what survived extraction's own cap.
|
|
252
|
+
*/
|
|
253
|
+
totalSeriesCount?: number;
|
|
254
|
+
}
|
|
255
|
+
/** One pivot table's identity and fields. Displayed aggregates are NOT extracted — only what it is built from. */
|
|
256
|
+
export interface SpreadsheetPivotInfo {
|
|
257
|
+
/** The pivot table name. */
|
|
258
|
+
name?: string;
|
|
259
|
+
/** The worksheet the pivot table is anchored to. */
|
|
260
|
+
sheetName?: string;
|
|
261
|
+
/** The field names used in the pivot table. */
|
|
262
|
+
fields: Array<string>;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Structural information about a parseable spreadsheet document.
|
|
266
|
+
*/
|
|
267
|
+
export interface SpreadsheetDocumentInfo {
|
|
268
|
+
/**
|
|
269
|
+
* The sheets of the spreadsheet, in workbook order.
|
|
270
|
+
*/
|
|
271
|
+
sheets: Array<SpreadsheetSheetInfo>;
|
|
272
|
+
/** Workbook-level parts the CSV dump cannot express (best-effort; absent for CSV/TSV and .xls). */
|
|
273
|
+
features?: SpreadsheetWorkbookFeatures;
|
|
274
|
+
/** Charts with their cached series (best-effort; absent for .xls and when none exist). */
|
|
275
|
+
charts?: Array<SpreadsheetChartInfo>;
|
|
276
|
+
/** Pivot tables with their field names (best-effort; absent for .xls/.xlsb and when none exist). */
|
|
277
|
+
pivots?: Array<SpreadsheetPivotInfo>;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* The full result of extracting data from a document, including all pages and any extracted images.
|
|
281
|
+
*/
|
|
282
|
+
export interface ExtractDataFromDocumentResponse {
|
|
283
|
+
/**
|
|
284
|
+
* Array of pages containing extracted data.
|
|
285
|
+
*/
|
|
286
|
+
pages: Array<ExtractDataFromDocumentPage>;
|
|
287
|
+
/**
|
|
288
|
+
* Pages the OCR provider reported as processed (billed), when it reports one. Can exceed
|
|
289
|
+
* `pages.length` — a blank page is billed but returns no content.
|
|
290
|
+
*/
|
|
291
|
+
ocrPagesProcessed?: number;
|
|
292
|
+
/**
|
|
293
|
+
* Path to the original file in cloud storage, if applicable.
|
|
294
|
+
*/
|
|
295
|
+
longTermStoragePath?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Document-level metadata extracted from the source container (best-effort). Present only when the
|
|
298
|
+
* extractor was able to read it.
|
|
299
|
+
*/
|
|
300
|
+
documentMetadata?: DocumentMetadata;
|
|
301
|
+
/**
|
|
302
|
+
* Structural information about the sheets when the document is a parseable spreadsheet
|
|
303
|
+
* (best-effort). Presence marks the document for the spreadsheet summary-embedding lane.
|
|
304
|
+
*/
|
|
305
|
+
spreadsheet?: SpreadsheetDocumentInfo;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Create PDF request type.
|
|
309
|
+
*/
|
|
310
|
+
export type CreatePdfType = 'html' | 'url';
|
|
311
|
+
/** The type of output options to apply when creating a PDF document. */
|
|
312
|
+
export type CreatePdfOutputOptionsType = 'format' | 'dimensions';
|
|
313
|
+
/** Base interface for PDF output options. This is used to define the type of output options. */
|
|
314
|
+
export interface BaseCreatePdfOutputOptions {
|
|
315
|
+
/** The type of output options, either 'format' or 'dimensions'. */
|
|
316
|
+
type: CreatePdfOutputOptionsType;
|
|
317
|
+
}
|
|
318
|
+
/** Output options by format */
|
|
319
|
+
export interface CreatePdfOutputFormatOptions extends BaseCreatePdfOutputOptions {
|
|
320
|
+
/** The type of output options, always 'format' for this interface. */
|
|
321
|
+
type: 'format';
|
|
322
|
+
/** The type of formatting, always 'format' for this interface. */
|
|
323
|
+
format: 'letter' | 'legal' | 'tabloid' | 'ledger' | 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6';
|
|
324
|
+
}
|
|
325
|
+
/** Output options by custom dimensions */
|
|
326
|
+
export interface CreatePdfOutputDimensionsOptions extends BaseCreatePdfOutputOptions {
|
|
327
|
+
/** The type of formatting, always 'dimensions' for this interface. */
|
|
328
|
+
type: 'dimensions';
|
|
329
|
+
/** The width of the PDF document in pixels. */
|
|
330
|
+
width: number;
|
|
331
|
+
/** The height of the PDF document in pixels. */
|
|
332
|
+
height: number;
|
|
333
|
+
}
|
|
334
|
+
/** Combined formatting options for creating a PDF document. */
|
|
335
|
+
export type CreatePdfOutputOptions = CreatePdfOutputFormatOptions | CreatePdfOutputDimensionsOptions;
|
|
336
|
+
/**
|
|
337
|
+
* Base request for creating a PDF document.
|
|
338
|
+
*/
|
|
339
|
+
export interface BaseCreatePdfRequest {
|
|
340
|
+
/**
|
|
341
|
+
* The type of PDF creation to perform, either from HTML or a URL.
|
|
342
|
+
*/
|
|
343
|
+
type: CreatePdfType;
|
|
344
|
+
/** The formatting options for the PDF document. Can be either a predefined format (like 'letter') or custom dimensions. */
|
|
345
|
+
outputOptions?: CreatePdfOutputOptions;
|
|
346
|
+
/** Optional title for the PDF document. */
|
|
347
|
+
title?: string;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Request payload for creating a PDF from a URL.
|
|
351
|
+
*/
|
|
352
|
+
export interface CreatePdfFromUrlRequest extends BaseCreatePdfRequest {
|
|
353
|
+
/** The type of PDF creation, always 'url' for this request. */
|
|
354
|
+
type: 'url';
|
|
355
|
+
/**
|
|
356
|
+
* The URL of the webpage to convert into a PDF.
|
|
357
|
+
*/
|
|
358
|
+
url: string;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Request payload for creating a PDF from HTML content.
|
|
362
|
+
*/
|
|
363
|
+
export interface CreatePdfFromHtmlRequest extends BaseCreatePdfRequest {
|
|
364
|
+
/** The type of PDF creation, always 'html' for this request. */
|
|
365
|
+
type: 'html';
|
|
366
|
+
/** The HTML content to convert into a PDF. Should not contain <html>, <body>, <head>, should just include the inner HTML */
|
|
367
|
+
innerHtml: string;
|
|
368
|
+
/** Optional URL for CSS styles to apply to the HTML content. */
|
|
369
|
+
cssUrl?: string;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Combined request type for creating a PDF, which can be either from a URL or HTML content.
|
|
373
|
+
*/
|
|
374
|
+
export type CreatePdfRequest = CreatePdfFromUrlRequest | CreatePdfFromHtmlRequest;
|
|
375
|
+
/**
|
|
376
|
+
* Response type for the PDF creation operation, containing the URL of the generated PDF.
|
|
377
|
+
*/
|
|
378
|
+
export interface CreatePdfResponse {
|
|
379
|
+
/** The publicly accessible URL where the generated PDF can be downloaded. */
|
|
380
|
+
url: string;
|
|
381
|
+
/** The generated filename. */
|
|
382
|
+
fileName?: string;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Document-level properties read from the source container during extraction. Every field is optional
|
|
386
|
+
* and best-effort: when a container does not expose a property (or parsing fails) the field is simply
|
|
387
|
+
* absent. Consumed by schema-driven metadata extraction as the deterministic source for matching
|
|
388
|
+
* knowledge-base `metadataFields` before falling back to LLM extraction.
|
|
389
|
+
* @category AI
|
|
390
|
+
*/
|
|
391
|
+
export interface DocumentMetadata {
|
|
392
|
+
/** Document title (e.g. OOXML `dc:title`, PDF `/Title`, front-matter `title`, `<title>`). */
|
|
393
|
+
docTitle?: string;
|
|
394
|
+
/** Document author (e.g. OOXML `dc:creator`, PDF `/Author`, front-matter / `<meta author>`). */
|
|
395
|
+
docAuthor?: string;
|
|
396
|
+
/** Creation timestamp, ISO 8601. */
|
|
397
|
+
docCreatedAt?: string;
|
|
398
|
+
/** Last-modified timestamp, ISO 8601. */
|
|
399
|
+
docModifiedAt?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Source document type: `pdf` | `docx` | `doc` | `pptx` | `ppt` | `xlsx` | `xlsm` | `xls` | `xlsb` |
|
|
402
|
+
* `eml` | `msg` | `csv` | `tsv` | `md` | `html` | `txt`.
|
|
403
|
+
*/
|
|
404
|
+
docType?: string;
|
|
405
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { IntegrationId } from './communication.public-types';
|
|
2
|
+
/** List of all integration types supported by Squid. */
|
|
3
|
+
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "azure-entra-external-id", "azure-entra-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "generic_site_ingester", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "twilio", "elevenlabs", "openai_voice", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "sharepoint", "vertex"];
|
|
4
|
+
/**
|
|
5
|
+
* @category Database
|
|
6
|
+
*/
|
|
7
|
+
export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "snowflake", "elasticsearch", "legend"];
|
|
8
|
+
/**
|
|
9
|
+
* @category Auth
|
|
10
|
+
*/
|
|
11
|
+
export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "keycloak", "descope", "firebase_auth", "azure-entra-external-id", "azure-entra-id"];
|
|
12
|
+
/**
|
|
13
|
+
* Auth integration types that can OAuth-protect an MCP server (see `McpOAuthOptions` and
|
|
14
|
+
* `AiAgentMcpServerConfig.oauthIntegrationId`). Kept in sync with the providers supported by the
|
|
15
|
+
* MCP OAuth validation in core.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MCP_OAUTH_INTEGRATION_TYPES: readonly ["auth0"];
|
|
18
|
+
/** Supported integration types for GraphQL-based services. */
|
|
19
|
+
export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql"];
|
|
20
|
+
/** Supported integration types for HTTP-based services. */
|
|
21
|
+
export declare const HTTP_INTEGRATION_TYPES: readonly ["api"];
|
|
22
|
+
/** Represents a supported integration type identifier, such as 'postgres', 'auth0', or 's3'. */
|
|
23
|
+
export type IntegrationType = (typeof INTEGRATION_TYPES)[number];
|
|
24
|
+
/** Supported schema types for integrations */
|
|
25
|
+
export declare const INTEGRATION_SCHEMA_TYPES: readonly ["data", "api", "graphql"];
|
|
26
|
+
/** Describes the type of schema the integration provides, such as data, API, or GraphQL schema. */
|
|
27
|
+
export type IntegrationSchemaType = (typeof INTEGRATION_SCHEMA_TYPES)[number];
|
|
28
|
+
/**
|
|
29
|
+
* @category Database
|
|
30
|
+
*/
|
|
31
|
+
export declare const BUILT_IN_DB_INTEGRATION_ID: IntegrationId;
|
|
32
|
+
/**
|
|
33
|
+
* @category Queue
|
|
34
|
+
*/
|
|
35
|
+
export declare const BUILT_IN_QUEUE_INTEGRATION_ID: IntegrationId;
|
|
36
|
+
/**
|
|
37
|
+
* ID for the cloud specific storage integration: s3 (built_in_s3) or gcs (built_in_gcs).
|
|
38
|
+
* @category
|
|
39
|
+
*/
|
|
40
|
+
export declare const BUILT_IN_STORAGE_INTEGRATION_ID: IntegrationId;
|
|
41
|
+
/** Metadata describing a configured integration, including its ID, type, timestamps, and optional configuration object. */
|
|
42
|
+
export interface IntegrationInfo<ConfigurationType = Record<string, any> | undefined> {
|
|
43
|
+
/** The unique identifier of the integration instance. */
|
|
44
|
+
id: IntegrationId;
|
|
45
|
+
/** The type of the integration (e.g., postgres, auth0, s3). */
|
|
46
|
+
type: IntegrationType;
|
|
47
|
+
/** The date when the integration was created. */
|
|
48
|
+
creationDate?: Date;
|
|
49
|
+
/** The date when the integration was last updated. */
|
|
50
|
+
updateDate?: Date;
|
|
51
|
+
/**
|
|
52
|
+
* When false, the integration is disabled: runtime access is rejected and sync jobs skip it.
|
|
53
|
+
* Absent means enabled on create; an update that omits it keeps the stored value, so re-enabling
|
|
54
|
+
* requires an explicit `enabled: true`.
|
|
55
|
+
*/
|
|
56
|
+
enabled?: boolean | null;
|
|
57
|
+
/** The configuration object for the integration, if any. */
|
|
58
|
+
configuration: ConfigurationType;
|
|
59
|
+
}
|
|
60
|
+
/** Returns true when the integration is explicitly disabled. An absent or null `enabled` means enabled. */
|
|
61
|
+
export declare function isIntegrationDisabled(integration: Pick<IntegrationInfo, 'enabled'>): boolean;
|
|
62
|
+
/** Integration IDs used for built-in integrations by Squid. */
|
|
63
|
+
export declare const SQUID_BUILT_IN_INTEGRATION_IDS: readonly [string, string, string];
|
|
64
|
+
/** Returns true if ID is a built-in integration ID in Squid. */
|
|
65
|
+
export declare function isBuiltInIntegrationId(id: unknown): id is (typeof SQUID_BUILT_IN_INTEGRATION_IDS)[number];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a unique identifier for a job.
|
|
3
|
+
*/
|
|
4
|
+
export type JobId = string;
|
|
5
|
+
/** Represents a request to get an asynchronous job by its ID. */
|
|
6
|
+
export interface GetJobRequest {
|
|
7
|
+
/** The unique identifier of the job to retrieve */
|
|
8
|
+
jobId: JobId;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Represents a request to get an asynchronous job by its ID.
|
|
12
|
+
*/
|
|
13
|
+
export interface GetJobResponse {
|
|
14
|
+
/** The job details */
|
|
15
|
+
job: AsyncJob | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Represents a request to subscribe to job updates.
|
|
19
|
+
* This allows clients to receive real-time updates about the job's status.
|
|
20
|
+
*/
|
|
21
|
+
export interface SubscribeToJobRequest {
|
|
22
|
+
/** The unique identifier of the job to subscribe to */
|
|
23
|
+
jobId: JobId;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a request to start a client-owned job.
|
|
27
|
+
* The caller generates the jobId; the client that starts the job owns it and must resolve it.
|
|
28
|
+
*/
|
|
29
|
+
export interface StartJobRequest {
|
|
30
|
+
/** The unique identifier of the job to start. */
|
|
31
|
+
jobId: JobId;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Represents a request to resolve a client-owned job with its result or error.
|
|
35
|
+
*/
|
|
36
|
+
export interface ResolveJobRequest {
|
|
37
|
+
/** The unique identifier of the job to resolve. */
|
|
38
|
+
jobId: JobId;
|
|
39
|
+
/** The terminal status to set on the job. */
|
|
40
|
+
status: 'completed' | 'failed';
|
|
41
|
+
/** The job result, present when status is 'completed'. */
|
|
42
|
+
result?: unknown;
|
|
43
|
+
/** The error message, present when status is 'failed'. */
|
|
44
|
+
error?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Represents a keep-alive request signalling that the client still owns the listed active jobs.
|
|
48
|
+
*/
|
|
49
|
+
export interface KeepAliveRequest {
|
|
50
|
+
/** The identifiers of the jobs the client is keeping alive. */
|
|
51
|
+
jobIds: Array<JobId>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Represents an asynchronous job
|
|
55
|
+
*/
|
|
56
|
+
export interface AsyncJob<T = any> {
|
|
57
|
+
/**
|
|
58
|
+
* The unique identifier of the job.
|
|
59
|
+
*/
|
|
60
|
+
id: JobId;
|
|
61
|
+
/**
|
|
62
|
+
* The timestamp when the job was created.
|
|
63
|
+
*/
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
/**
|
|
66
|
+
* The timestamp when the job was last updated.
|
|
67
|
+
*/
|
|
68
|
+
updatedAt: Date;
|
|
69
|
+
/**
|
|
70
|
+
* The current status of the job.
|
|
71
|
+
* Can be one of the following:
|
|
72
|
+
* - 'in_progress': The job is currently being processed.
|
|
73
|
+
* - 'completed': The job has finished successfully.
|
|
74
|
+
* - 'failed': The job has failed.
|
|
75
|
+
*/
|
|
76
|
+
status: 'in_progress' | 'completed' | 'failed';
|
|
77
|
+
/**
|
|
78
|
+
* The result of the job, if available.
|
|
79
|
+
* This is of type `T` and is optional.
|
|
80
|
+
*/
|
|
81
|
+
result?: T;
|
|
82
|
+
/**
|
|
83
|
+
* The error message, if the job has failed.
|
|
84
|
+
* This is optional.
|
|
85
|
+
*/
|
|
86
|
+
error?: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic metadata filter types used across the platform.
|
|
3
|
+
*
|
|
4
|
+
* These types define a MongoDB-style filter syntax for filtering records by metadata
|
|
5
|
+
* fields. They support field-level operators (`$eq`, `$ne`, `$gt`, `$gte`, `$lt`,
|
|
6
|
+
* `$lte`, `$in`, `$nin`, `$exists`) and boolean combinators (`$and`, `$or`).
|
|
7
|
+
*
|
|
8
|
+
* Originally created for AI knowledge base context filtering, these types are now
|
|
9
|
+
* shared across metrics tag filtering, matchmaking, and other subsystems. Operators
|
|
10
|
+
* specific to one subsystem (e.g. the knowledge base's `$underPath` for hierarchical
|
|
11
|
+
* path scoping) live with that subsystem, not here.
|
|
12
|
+
*/
|
|
13
|
+
/** Primitive metadata value. */
|
|
14
|
+
export type MetadataValue = number | string | boolean | undefined;
|
|
15
|
+
/** Array of metadata values (used by `$in` / `$nin`). */
|
|
16
|
+
export type MetadataValueArray = MetadataValue[];
|
|
17
|
+
/** Matches when the field equals the given value. */
|
|
18
|
+
export interface MetadataEqFilter {
|
|
19
|
+
/** The value the field must equal. */
|
|
20
|
+
$eq: MetadataValue;
|
|
21
|
+
}
|
|
22
|
+
/** Matches when the field does not equal the given value. */
|
|
23
|
+
export interface MetadataNeFilter {
|
|
24
|
+
/** The value the field must not equal. */
|
|
25
|
+
$ne: MetadataValue;
|
|
26
|
+
}
|
|
27
|
+
/** Matches when the field is greater than the given value. */
|
|
28
|
+
export interface MetadataGtFilter {
|
|
29
|
+
/** The value the field must be greater than. */
|
|
30
|
+
$gt: number;
|
|
31
|
+
}
|
|
32
|
+
/** Matches when the field is greater than or equal to the given value. */
|
|
33
|
+
export interface MetadataGteFilter {
|
|
34
|
+
/** The value the field must be greater than or equal to. */
|
|
35
|
+
$gte: number;
|
|
36
|
+
}
|
|
37
|
+
/** Matches when the field is less than the given value. */
|
|
38
|
+
export interface MetadataLtFilter {
|
|
39
|
+
/** The value the field must be less than. */
|
|
40
|
+
$lt: number;
|
|
41
|
+
}
|
|
42
|
+
/** Matches when the field is less than or equal to the given value. */
|
|
43
|
+
export interface MetadataLteFilter {
|
|
44
|
+
/** The value the field must be less than or equal to. */
|
|
45
|
+
$lte: number;
|
|
46
|
+
}
|
|
47
|
+
/** Matches when the field value is one of the given values. */
|
|
48
|
+
export interface MetadataInFilter {
|
|
49
|
+
/** The values the field must be one of. */
|
|
50
|
+
$in: MetadataValueArray;
|
|
51
|
+
}
|
|
52
|
+
/** Matches when the field value is not one of the given values. */
|
|
53
|
+
export interface MetadataNinFilter {
|
|
54
|
+
/** The values the field must not be one of. */
|
|
55
|
+
$nin: MetadataValueArray;
|
|
56
|
+
}
|
|
57
|
+
/** Matches based on whether the field exists. */
|
|
58
|
+
export interface MetadataExistsFilter {
|
|
59
|
+
/** Whether the field must exist. */
|
|
60
|
+
$exists: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A single-field operator: one of `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$exists`.
|
|
64
|
+
*/
|
|
65
|
+
export type MetadataSimpleFilter = MetadataEqFilter | MetadataNeFilter | MetadataGtFilter | MetadataGteFilter | MetadataLtFilter | MetadataLteFilter | MetadataInFilter | MetadataNinFilter | MetadataExistsFilter;
|
|
66
|
+
/**
|
|
67
|
+
* A filter for metadata based on field-specific conditions or direct values.
|
|
68
|
+
* @category Metadata
|
|
69
|
+
*/
|
|
70
|
+
export interface MetadataFieldFilter {
|
|
71
|
+
/** A record where keys are field names and values are either operator objects or direct scalar values. */
|
|
72
|
+
[field: string]: MetadataSimpleFilter | MetadataValue;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A filter combining multiple metadata filters with a logical AND operation.
|
|
76
|
+
* @category Metadata
|
|
77
|
+
*/
|
|
78
|
+
export interface MetadataAndFilter {
|
|
79
|
+
/** An array of filters that must all be true for the condition to pass. */
|
|
80
|
+
$and: MetadataFilter[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A filter combining multiple metadata filters with a logical OR operation.
|
|
84
|
+
* @category Metadata
|
|
85
|
+
*/
|
|
86
|
+
export interface MetadataOrFilter {
|
|
87
|
+
/** An array of filters where at least one must be true for the condition to pass. */
|
|
88
|
+
$or: MetadataFilter[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A composable metadata filter supporting field operators and boolean combinators.
|
|
92
|
+
*
|
|
93
|
+
* @example Simple equality
|
|
94
|
+
* ```ts
|
|
95
|
+
* { status: 'active' }
|
|
96
|
+
* ```
|
|
97
|
+
* @example Operators
|
|
98
|
+
* ```ts
|
|
99
|
+
* { age: { $gte: 18 }, role: { $in: ['admin', 'editor'] } }
|
|
100
|
+
* ```
|
|
101
|
+
* @example Boolean combinators
|
|
102
|
+
* ```ts
|
|
103
|
+
* { $or: [{ status: 'active' }, { role: { $ne: 'guest' } }] }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export type MetadataFilter = MetadataFieldFilter | MetadataAndFilter | MetadataOrFilter;
|