@squidcloud/jira-client 1.0.497 → 1.0.499
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 +1609 -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 +2379 -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 +57 -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 +105 -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 +20 -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 +93 -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,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
|
+
}
|