@opencraw/studio 0.0.31 → 0.0.33
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/document-view/index.d.ts +1 -1
- package/dist/document-view/workbook-view.mapper.d.ts +17 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +658 -49
- package/dist/page-snapshot/blocked-page.algorithm.d.ts +10 -0
- package/dist/page-snapshot/consent-banner.algorithm.d.ts +23 -0
- package/dist/page-snapshot/detect-url.use-case.d.ts +13 -0
- package/dist/page-snapshot/index.d.ts +4 -0
- package/dist/page-snapshot/inline-assets.mapper.d.ts +29 -0
- package/dist/page-snapshot/inline-local-images.use-case.d.ts +19 -0
- package/dist/page-snapshot/take-snapshot.use-case.d.ts +2 -0
- package/dist/recipe-workspace/import-document.use-case.d.ts +5 -3
- package/dist/selector-inference/selector-ranking.policy.d.ts +1 -1
- package/dist/src/document-view/index.d.ts +1 -1
- package/dist/src/document-view/workbook-view.mapper.d.ts +17 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/page-snapshot/blocked-page.algorithm.d.ts +10 -0
- package/dist/src/page-snapshot/consent-banner.algorithm.d.ts +23 -0
- package/dist/src/page-snapshot/detect-url.use-case.d.ts +13 -0
- package/dist/src/page-snapshot/index.d.ts +4 -0
- package/dist/src/page-snapshot/inline-assets.mapper.d.ts +29 -0
- package/dist/src/page-snapshot/inline-local-images.use-case.d.ts +19 -0
- package/dist/src/page-snapshot/take-snapshot.use-case.d.ts +2 -0
- package/dist/src/recipe-workspace/import-document.use-case.d.ts +5 -3
- package/dist/src/selector-inference/selector-ranking.policy.d.ts +1 -1
- package/dist/src/studio-api/command.contract.d.ts +31 -0
- package/dist/src/studio-api/deck-view.contract.d.ts +2 -0
- package/dist/src/studio-api/detect-url-view.contract.d.ts +24 -0
- package/dist/src/studio-api/grid-view.contract.d.ts +15 -0
- package/dist/src/studio-api/index.d.ts +8 -6
- package/dist/src/studio-api/infer-selector-view.contract.d.ts +86 -0
- package/dist/src/studio-api/snapshot-view.contract.d.ts +1 -0
- package/dist/src/studio-server/detect-url.handler.d.ts +10 -0
- package/dist/src/studio-server/grid-view.handler.d.ts +12 -1
- package/dist/studio-api/command.contract.d.ts +31 -0
- package/dist/studio-api/deck-view.contract.d.ts +2 -0
- package/dist/studio-api/detect-url-view.contract.d.ts +24 -0
- package/dist/studio-api/grid-view.contract.d.ts +15 -0
- package/dist/studio-api/index.d.ts +8 -6
- package/dist/studio-api/infer-selector-view.contract.d.ts +86 -0
- package/dist/studio-api/snapshot-view.contract.d.ts +1 -0
- package/dist/studio-server/detect-url.handler.d.ts +10 -0
- package/dist/studio-server/grid-view.handler.d.ts +12 -1
- package/dist/ui/assets/index-Db6-8OgZ.js +42 -0
- package/dist/ui/assets/{pdf-CtmGNMM2.js → pdf-rdp2xUbL.js} +1 -1
- package/dist/ui/index.html +11 -2
- package/dist/ui/opencraw-logo.svg +28 -0
- package/package.json +3 -3
- package/dist/ui/assets/index-CMzc4-FL.js +0 -40
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a page is the site's bot check or an access-denied page instead of its content, and, if so, what to tell the person: the
|
|
3
|
+
* Studio's browser was turned away, so everything else on the screen is not the page they asked for.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The page's title and the start of its visible text.
|
|
6
|
+
* @param status - The HTTP status the page came with, when known.
|
|
7
|
+
* @returns A sentence for the person, or `undefined` when the page looks like a page.
|
|
8
|
+
*/
|
|
9
|
+
export declare function blockedPageNotice(text: string, status?: number): string | undefined;
|
|
10
|
+
//# sourceMappingURL=blocked-page.algorithm.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The attribute a pop-up that covers the page is marked with in the snapshot; the picture leaves it out unless "Show hidden" is on. */
|
|
2
|
+
export declare const OVERLAY_ATTRIBUTE = "data-oc-overlay";
|
|
3
|
+
/**
|
|
4
|
+
* A script that, in a page, finds a cookie or consent banner's button and presses it: "Reject all", "Only necessary cookies" and the
|
|
5
|
+
* like first, else "Accept all", "I agree"... in English, Portuguese, Spanish, French, Italian, German and Dutch, and by the ids the common
|
|
6
|
+
* consent tools give their buttons (OneTrust, Didomi, Cookiebot, Usercentrics, Osano, iubenda). A banner that is left in place covers the
|
|
7
|
+
* page in the Studio's view of it, and the Studio's own clicks (to pick a value) would land on it. Only buttons whose whole text is one
|
|
8
|
+
* of these are pressed, so a "Cookie settings" or "Gerir os cookies" button, a link to a policy and the page's own buttons are left alone.
|
|
9
|
+
* The answer is the text of the button pressed, or an empty string when there was none.
|
|
10
|
+
*
|
|
11
|
+
* It only ever runs in the browser the Studio captures the page with, never in a crawl.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DISMISS_CONSENT_SCRIPT: string;
|
|
14
|
+
/**
|
|
15
|
+
* A script that marks, in the page, every pop-up that covers it: something fixed to the window that fills most of it (a dimming backdrop,
|
|
16
|
+
* a modal), a modal dialog, or a banner a consent tool put there. The picture of the page leaves them out (the page behind is what the
|
|
17
|
+
* person wants to pick from), and "Show hidden" brings them back. Run after the consent button has been tried: a banner that went away
|
|
18
|
+
* needs nothing, one that stayed (its button in a form the script does not know, an icon with no text) is covered here.
|
|
19
|
+
*
|
|
20
|
+
* Only the outermost element of an overlay is marked, since hiding it hides all it holds.
|
|
21
|
+
*/
|
|
22
|
+
export declare const MARK_OVERLAYS_SCRIPT = "(() => {\n const attribute = 'data-oc-overlay'\n const consentName = /cookie|consent|gdpr|privacy|onetrust|ot-sdk|didomi|cookiebot|usercentrics|trustarc|truste|osano|iubenda|cmp|banner-modal/i\n const width = window.innerWidth\n const height = window.innerHeight\n const marked = []\n for (const element of document.querySelectorAll('body *')) {\n if (marked.some((outer) => outer.contains(element))) continue\n const style = getComputedStyle(element)\n if (style.position !== 'fixed' || style.display === 'none' || style.visibility === 'hidden') continue\n const box = element.getBoundingClientRect()\n if (box.width === 0 || box.height === 0) continue\n const covers = box.width >= width * 0.6 && box.height >= height * 0.5\n const modal = element.getAttribute('aria-modal') === 'true' || element.getAttribute('role') === 'dialog' || element.getAttribute('role') === 'alertdialog'\n const named = consentName.test((element.id || '') + ' ' + (typeof element.className === 'string' ? element.className : ''))\n // A page built as one fixed, scrolling frame is the page, not a pop-up on it.\n if (covers && !modal && !named && (element.innerText || '').length > document.body.innerText.length * 0.6) continue\n // A bar along an edge (a site's own header or footer) is not a pop-up unless a consent tool named it.\n if (covers || modal || named) {\n element.setAttribute(attribute, '1')\n marked.push(element)\n }\n }\n\n return marked.length\n})()";
|
|
23
|
+
//# sourceMappingURL=consent-banner.algorithm.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** What an address returns, in the engine's own words (`html` is a page; anything else is a document it reads), or `unknown` when it cannot be fetched. */
|
|
2
|
+
export type UrlKind = 'html' | 'json' | 'jsonl' | 'text' | 'pdf' | 'csv' | 'xlsx' | 'pptx' | 'yaml' | 'markdown' | 'xml' | 'docx' | 'unknown';
|
|
3
|
+
/**
|
|
4
|
+
* What an address returns: the format the engine reads its response as (content type, then what the first bytes
|
|
5
|
+
* show, then the file extension in the address), and, for an API that serves JSON as `text/plain` (common), JSON when
|
|
6
|
+
* the text starts like an object or an array. Only the start of the response is read: a large file is not downloaded.
|
|
7
|
+
* An address that cannot be fetched is `unknown`; the recipe started from it then reports why on its first snapshot.
|
|
8
|
+
*
|
|
9
|
+
* @param url - The address.
|
|
10
|
+
* @returns The kind: `html` is a page to open in a browser, anything else a document to read.
|
|
11
|
+
*/
|
|
12
|
+
export declare function detectUrlKind(url: string): Promise<UrlKind>;
|
|
13
|
+
//# sourceMappingURL=detect-url.use-case.d.ts.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export { detectUrlKind } from './detect-url.use-case';
|
|
2
|
+
export type { UrlKind } from './detect-url.use-case';
|
|
1
3
|
export { fetchStartPage } from './fetch-start-page.use-case';
|
|
2
4
|
export { takeSnapshot } from './take-snapshot.use-case';
|
|
3
5
|
export type { SnapshotResult } from './take-snapshot.use-case';
|
|
6
|
+
export { inlineLocalImages } from './inline-local-images.use-case';
|
|
7
|
+
export type { InlinedImages } from './inline-local-images.use-case';
|
|
4
8
|
export { rewriteDocument } from './rewrite-document.mapper';
|
|
5
9
|
export type { RewrittenDocument } from './rewrite-document.mapper';
|
|
6
10
|
export { hiddenMarksScript, HIDDEN_ATTRIBUTE } from './hidden-marks.algorithm';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** A stylesheet or font the page loaded, as the capture browser received it. */
|
|
2
|
+
export interface CapturedAsset {
|
|
3
|
+
kind: 'css' | 'font';
|
|
4
|
+
/** The bytes; text for a stylesheet. */
|
|
5
|
+
body: Uint8Array;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A stylesheet's text with every `url(...)` made absolute, and each font the page loaded embedded as a data address. The picture of a page
|
|
9
|
+
* is shown in a frame that is not the site, so a font file is a cross-site request the site's server does not allow: its text comes
|
|
10
|
+
* out in a fallback face and its icons (a menu, a close button) as empty boxes. A font inside the page cannot be refused.
|
|
11
|
+
*
|
|
12
|
+
* @param css - The stylesheet text.
|
|
13
|
+
* @param base - Where the stylesheet came from (or the page, for a `<style>` in it).
|
|
14
|
+
* @param assets - What the page loaded, by address.
|
|
15
|
+
* @returns The stylesheet, ready to sit inside the snapshot.
|
|
16
|
+
*/
|
|
17
|
+
export declare function embedFonts(css: string, base: string, assets: ReadonlyMap<string, CapturedAsset>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Turns a captured page into one that carries its own styles: every `<link rel="stylesheet">` the page loaded becomes a `<style>` with
|
|
20
|
+
* the stylesheet's text, and the fonts in it (and in the page's own `<style>`s) are embedded. A stylesheet that was not captured is left
|
|
21
|
+
* as the link it was.
|
|
22
|
+
*
|
|
23
|
+
* @param html - The page as captured.
|
|
24
|
+
* @param pageUrl - The page's address.
|
|
25
|
+
* @param assets - The stylesheets and fonts the page loaded, by address.
|
|
26
|
+
* @returns The page with its styles and fonts inside it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function inlineAssets(html: string, pageUrl: string, assets: ReadonlyMap<string, CapturedAsset>): string;
|
|
29
|
+
//# sourceMappingURL=inline-assets.mapper.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** What `inlineLocalImages` made of a document. */
|
|
2
|
+
export interface InlinedImages {
|
|
3
|
+
html: string;
|
|
4
|
+
/** How many images were embedded. */
|
|
5
|
+
inlined: number;
|
|
6
|
+
/** How many pictures could not be found next to the file (or were too big), so they stay as they were. */
|
|
7
|
+
missing: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A document read from a file (a Markdown file, say) names its pictures by paths beside it, which the browser showing it cannot open. The
|
|
11
|
+
* pictures that sit in the document's own folder are embedded in the page as data addresses, so they show; ones that are not there are counted
|
|
12
|
+
* so the person is told. Nothing outside the document's folder is ever read.
|
|
13
|
+
*
|
|
14
|
+
* @param html - The document as HTML, its addresses already made absolute against `documentUrl`.
|
|
15
|
+
* @param documentUrl - The document's own `file:` address.
|
|
16
|
+
* @returns The page with the pictures embedded, and how many were embedded and how many could not be.
|
|
17
|
+
*/
|
|
18
|
+
export declare function inlineLocalImages(html: string, documentUrl: string): Promise<InlinedImages>;
|
|
19
|
+
//# sourceMappingURL=inline-local-images.use-case.d.ts.map
|
|
@@ -15,6 +15,8 @@ export interface SnapshotResult {
|
|
|
15
15
|
* snapshot no longer has by the time it is cached.
|
|
16
16
|
*/
|
|
17
17
|
rawHtml: string;
|
|
18
|
+
/** Something to tell the person about the page: it is a bot check or an access-denied page, not the content. */
|
|
19
|
+
notice?: string;
|
|
18
20
|
/**
|
|
19
21
|
* The format `http.client.ts` read the body as (api mode only; `undefined`
|
|
20
22
|
* in web mode, whose document is always HTML) — what the content pane
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface ImportedDocument {
|
|
2
2
|
/** The copy's path on disk, inside `folder`. */
|
|
3
3
|
path: string;
|
|
4
|
-
/** The copy as a `file:` URL: what the recipe's `start.url` becomes. */
|
|
4
|
+
/** The copy as a `file:` URL relative to the folder (`file:report.pdf`): what the recipe's `start.url` becomes, so the folder can be moved or shared. */
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -9,8 +9,10 @@ export interface ImportedDocument {
|
|
|
9
9
|
* `file:` URL the same way a run would read any downloaded file (core's
|
|
10
10
|
* `HttpClient` handles `file:` itself). The folder is created when missing,
|
|
11
11
|
* so dropping a file is also a way to start a workspace. A name already in
|
|
12
|
-
* the folder is never overwritten:
|
|
13
|
-
*
|
|
12
|
+
* the folder is never overwritten: a file there with the very same bytes is
|
|
13
|
+
* reused (loading one document twice leaves one copy), a different one gets
|
|
14
|
+
* the next free numbered name (`report-2.pdf`); the returned `path`/`url`
|
|
15
|
+
* say which.
|
|
14
16
|
*
|
|
15
17
|
* @param folder - The workspace folder; created (recursively) when it does not exist.
|
|
16
18
|
* @param name - The file's own name, no directories: the copy keeps it, extension included.
|
|
@@ -14,7 +14,7 @@ export interface RankedCandidate extends SelectorCandidate {
|
|
|
14
14
|
* Ordering: candidates that do not match `targetNodeId` (when given) sort
|
|
15
15
|
* last; among the rest, best tier first, and within a tier the fewest
|
|
16
16
|
* matches first (the most specific selector that still hits the target).
|
|
17
|
-
* A candidate matching nothing is dropped entirely: it is not a real option.
|
|
17
|
+
* Equal on all that, the selector naming more ids and classes comes first. A candidate matching nothing is dropped entirely: it is not a real option.
|
|
18
18
|
*
|
|
19
19
|
* @param html - The document to verify against (the snapshot, or the live page for the second, cross-check pass).
|
|
20
20
|
* @param candidates - Unranked candidates, e.g. from `candidatesFor`.
|
|
@@ -8,6 +8,6 @@ export { previewDeckTable, previewGridTable, previewPdfTable } from './table-pre
|
|
|
8
8
|
export type { DeckTablePreviewMatch, DeckTablePreviewOptions, DeckTablePreviewResult, GridTablePreviewMatch, GridTablePreviewOptions, GridTablePreviewResult, TablePreviewMatch, TablePreviewOptions, TablePreviewResult } from './table-preview.use-case.js';
|
|
9
9
|
export { previewRegion } from './region-preview.use-case.js';
|
|
10
10
|
export type { RegionPreviewResult, RegionPreviewMatch } from './region-preview.use-case.js';
|
|
11
|
-
export { workbookDocumentView } from './workbook-view.mapper.js';
|
|
11
|
+
export { workbookDocumentView, workbookSheetRows } from './workbook-view.mapper.js';
|
|
12
12
|
export type { GridCellType, GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView } from './workbook-view.mapper.js';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -22,7 +22,10 @@ export interface GridSheetView {
|
|
|
22
22
|
hiddenRows: number[];
|
|
23
23
|
/** The widest row's own length, ragged rows included — for the grid to size its columns. */
|
|
24
24
|
columnCount: number;
|
|
25
|
+
/** The sheet's rows; only the first window of them when `rowCount` is set (the rest are fetched with `grid-rows`). */
|
|
25
26
|
rows: GridCellView[][];
|
|
27
|
+
/** How many rows the sheet has, set only when `rows` holds just the first window of them. */
|
|
28
|
+
rowCount?: number;
|
|
26
29
|
merges: GridMergeView[];
|
|
27
30
|
/** Column widths in characters by 0-based column, as the spreadsheet stores them; absent keys are columns the file does not size. */
|
|
28
31
|
columnWidths?: Record<string, number>;
|
|
@@ -55,5 +58,18 @@ export interface WorkbookDocumentView {
|
|
|
55
58
|
* @param document - The read workbook (a spreadsheet or a CSV).
|
|
56
59
|
* @returns The view.
|
|
57
60
|
*/
|
|
58
|
-
export declare function workbookDocumentView(document: WorkbookDocument
|
|
61
|
+
export declare function workbookDocumentView(document: WorkbookDocument, options?: {
|
|
62
|
+
windowRows?: number;
|
|
63
|
+
}): WorkbookDocumentView;
|
|
64
|
+
/**
|
|
65
|
+
* A run of one sheet's rows, typed, for a grid that only holds the screens around where it is scrolled to (the rest of a big file is never
|
|
66
|
+
* sent to the browser until it is needed).
|
|
67
|
+
*
|
|
68
|
+
* @param document - The read workbook.
|
|
69
|
+
* @param sheetIndex - Which sheet, 0-based.
|
|
70
|
+
* @param from - The first row, 0-based.
|
|
71
|
+
* @param count - How many rows at most.
|
|
72
|
+
* @returns The rows (fewer at the end of the sheet, none past it).
|
|
73
|
+
*/
|
|
74
|
+
export declare function workbookSheetRows(document: WorkbookDocument, sheetIndex: number, from: number, count: number): GridCellView[][];
|
|
59
75
|
//# sourceMappingURL=workbook-view.mapper.d.ts.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export { runSample, loadRecipePair } from './sample-run/index.js';
|
|
|
9
9
|
export type { RecipePair, SampleRunCallbacks, SampleRunHandle, SampleRunRecord, SampleRunRejected, SampleRunResult, SampleStepSummary, SampleStoppedBy } from './sample-run/index.js';
|
|
10
10
|
export { fetchStartPage } from './page-snapshot/index.js';
|
|
11
11
|
export type { WhyFacts, WhyStepFact } from './explain-why/index.js';
|
|
12
|
-
export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, studioCommandSchema, chooseFolderViewSchema, openPathViewSchema, importDocumentViewSchema, stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, studioEventSchema, loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema, sampleRunRecordSchema, sampleRunViewSchema, startPageViewSchema, snapshotViewSchema, verifySelectorViewSchema, fieldPickSchema, inferSelectorViewSchema, sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema, whyViewSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, regionPreviewMatchSchema, regionPreviewViewSchema, gridViewCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, domTreeNodeViewSchema, pageDataFindingSchema, inspectViewSchema, observedResponseSchema, responsesSeenViewSchema, documentTreeNodeViewSchema, documentTreeViewSchema, pdfCellViewSchema, pdfRowViewSchema, pdfPageViewSchema, pdfDocumentViewSchema, tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchema, tablePreviewViewSchema, gridCellViewSchema, gridMergeViewSchema, gridSheetViewSchema, workbookDocumentViewSchema, gridTablePreviewMatchSchema, gridTablePreviewViewSchema, deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema, deckTablePreviewMatchSchema, deckTablePreviewViewSchema, startRecordingCommandSchema, stopRecordingCommandSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, } from './studio-api/index.js';
|
|
13
|
-
export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StudioCommand, ChooseFolderView, OpenPathView, ImportDocumentView, RegionPreviewMatchView, RegionPreviewView, StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, StudioEvent, LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView, SampleRunView, StartPageView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
|
|
12
|
+
export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, detectUrlCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, studioCommandSchema, chooseFolderViewSchema, openPathViewSchema, importDocumentViewSchema, stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, studioEventSchema, loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema, sampleRunRecordSchema, sampleRunViewSchema, startPageViewSchema, detectUrlViewSchema, snapshotViewSchema, verifySelectorViewSchema, fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema, sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema, whyViewSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, regionPreviewMatchSchema, regionPreviewViewSchema, gridViewCommandSchema, gridRowsCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, domTreeNodeViewSchema, pageDataFindingSchema, inspectViewSchema, observedResponseSchema, responsesSeenViewSchema, documentTreeNodeViewSchema, documentTreeViewSchema, pdfCellViewSchema, pdfRowViewSchema, pdfPageViewSchema, pdfDocumentViewSchema, tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchema, tablePreviewViewSchema, gridCellViewSchema, gridMergeViewSchema, gridRowsViewSchema, gridSheetViewSchema, workbookDocumentViewSchema, gridTablePreviewMatchSchema, gridTablePreviewViewSchema, deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema, deckTablePreviewMatchSchema, deckTablePreviewViewSchema, startRecordingCommandSchema, stopRecordingCommandSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, } from './studio-api/index.js';
|
|
13
|
+
export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, DetectUrlCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridRowsCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StudioCommand, ChooseFolderView, OpenPathView, ImportDocumentView, RegionPreviewMatchView, RegionPreviewView, StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, StudioEvent, LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView, SampleRunView, StartPageView, DetectUrlView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SelectorAlternative, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridRowsView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a page is the site's bot check or an access-denied page instead of its content, and, if so, what to tell the person: the
|
|
3
|
+
* Studio's browser was turned away, so everything else on the screen is not the page they asked for.
|
|
4
|
+
*
|
|
5
|
+
* @param text - The page's title and the start of its visible text.
|
|
6
|
+
* @param status - The HTTP status the page came with, when known.
|
|
7
|
+
* @returns A sentence for the person, or `undefined` when the page looks like a page.
|
|
8
|
+
*/
|
|
9
|
+
export declare function blockedPageNotice(text: string, status?: number): string | undefined;
|
|
10
|
+
//# sourceMappingURL=blocked-page.algorithm.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The attribute a pop-up that covers the page is marked with in the snapshot; the picture leaves it out unless "Show hidden" is on. */
|
|
2
|
+
export declare const OVERLAY_ATTRIBUTE = "data-oc-overlay";
|
|
3
|
+
/**
|
|
4
|
+
* A script that, in a page, finds a cookie or consent banner's button and presses it: "Reject all", "Only necessary cookies" and the
|
|
5
|
+
* like first, else "Accept all", "I agree"... in English, Portuguese, Spanish, French, Italian, German and Dutch, and by the ids the common
|
|
6
|
+
* consent tools give their buttons (OneTrust, Didomi, Cookiebot, Usercentrics, Osano, iubenda). A banner that is left in place covers the
|
|
7
|
+
* page in the Studio's view of it, and the Studio's own clicks (to pick a value) would land on it. Only buttons whose whole text is one
|
|
8
|
+
* of these are pressed, so a "Cookie settings" or "Gerir os cookies" button, a link to a policy and the page's own buttons are left alone.
|
|
9
|
+
* The answer is the text of the button pressed, or an empty string when there was none.
|
|
10
|
+
*
|
|
11
|
+
* It only ever runs in the browser the Studio captures the page with, never in a crawl.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DISMISS_CONSENT_SCRIPT: string;
|
|
14
|
+
/**
|
|
15
|
+
* A script that marks, in the page, every pop-up that covers it: something fixed to the window that fills most of it (a dimming backdrop,
|
|
16
|
+
* a modal), a modal dialog, or a banner a consent tool put there. The picture of the page leaves them out (the page behind is what the
|
|
17
|
+
* person wants to pick from), and "Show hidden" brings them back. Run after the consent button has been tried: a banner that went away
|
|
18
|
+
* needs nothing, one that stayed (its button in a form the script does not know, an icon with no text) is covered here.
|
|
19
|
+
*
|
|
20
|
+
* Only the outermost element of an overlay is marked, since hiding it hides all it holds.
|
|
21
|
+
*/
|
|
22
|
+
export declare const MARK_OVERLAYS_SCRIPT = "(() => {\n const attribute = 'data-oc-overlay'\n const consentName = /cookie|consent|gdpr|privacy|onetrust|ot-sdk|didomi|cookiebot|usercentrics|trustarc|truste|osano|iubenda|cmp|banner-modal/i\n const width = window.innerWidth\n const height = window.innerHeight\n const marked = []\n for (const element of document.querySelectorAll('body *')) {\n if (marked.some((outer) => outer.contains(element))) continue\n const style = getComputedStyle(element)\n if (style.position !== 'fixed' || style.display === 'none' || style.visibility === 'hidden') continue\n const box = element.getBoundingClientRect()\n if (box.width === 0 || box.height === 0) continue\n const covers = box.width >= width * 0.6 && box.height >= height * 0.5\n const modal = element.getAttribute('aria-modal') === 'true' || element.getAttribute('role') === 'dialog' || element.getAttribute('role') === 'alertdialog'\n const named = consentName.test((element.id || '') + ' ' + (typeof element.className === 'string' ? element.className : ''))\n // A page built as one fixed, scrolling frame is the page, not a pop-up on it.\n if (covers && !modal && !named && (element.innerText || '').length > document.body.innerText.length * 0.6) continue\n // A bar along an edge (a site's own header or footer) is not a pop-up unless a consent tool named it.\n if (covers || modal || named) {\n element.setAttribute(attribute, '1')\n marked.push(element)\n }\n }\n\n return marked.length\n})()";
|
|
23
|
+
//# sourceMappingURL=consent-banner.algorithm.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** What an address returns, in the engine's own words (`html` is a page; anything else is a document it reads), or `unknown` when it cannot be fetched. */
|
|
2
|
+
export type UrlKind = 'html' | 'json' | 'jsonl' | 'text' | 'pdf' | 'csv' | 'xlsx' | 'pptx' | 'yaml' | 'markdown' | 'xml' | 'docx' | 'unknown';
|
|
3
|
+
/**
|
|
4
|
+
* What an address returns: the format the engine reads its response as (content type, then what the first bytes
|
|
5
|
+
* show, then the file extension in the address), and, for an API that serves JSON as `text/plain` (common), JSON when
|
|
6
|
+
* the text starts like an object or an array. Only the start of the response is read: a large file is not downloaded.
|
|
7
|
+
* An address that cannot be fetched is `unknown`; the recipe started from it then reports why on its first snapshot.
|
|
8
|
+
*
|
|
9
|
+
* @param url - The address.
|
|
10
|
+
* @returns The kind: `html` is a page to open in a browser, anything else a document to read.
|
|
11
|
+
*/
|
|
12
|
+
export declare function detectUrlKind(url: string): Promise<UrlKind>;
|
|
13
|
+
//# sourceMappingURL=detect-url.use-case.d.ts.map
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export { detectUrlKind } from './detect-url.use-case.js';
|
|
2
|
+
export type { UrlKind } from './detect-url.use-case.js';
|
|
1
3
|
export { fetchStartPage } from './fetch-start-page.use-case.js';
|
|
2
4
|
export { takeSnapshot } from './take-snapshot.use-case.js';
|
|
3
5
|
export type { SnapshotResult } from './take-snapshot.use-case.js';
|
|
6
|
+
export { inlineLocalImages } from './inline-local-images.use-case.js';
|
|
7
|
+
export type { InlinedImages } from './inline-local-images.use-case.js';
|
|
4
8
|
export { rewriteDocument } from './rewrite-document.mapper.js';
|
|
5
9
|
export type { RewrittenDocument } from './rewrite-document.mapper.js';
|
|
6
10
|
export { hiddenMarksScript, HIDDEN_ATTRIBUTE } from './hidden-marks.algorithm.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** A stylesheet or font the page loaded, as the capture browser received it. */
|
|
2
|
+
export interface CapturedAsset {
|
|
3
|
+
kind: 'css' | 'font';
|
|
4
|
+
/** The bytes; text for a stylesheet. */
|
|
5
|
+
body: Uint8Array;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A stylesheet's text with every `url(...)` made absolute, and each font the page loaded embedded as a data address. The picture of a page
|
|
9
|
+
* is shown in a frame that is not the site, so a font file is a cross-site request the site's server does not allow: its text comes
|
|
10
|
+
* out in a fallback face and its icons (a menu, a close button) as empty boxes. A font inside the page cannot be refused.
|
|
11
|
+
*
|
|
12
|
+
* @param css - The stylesheet text.
|
|
13
|
+
* @param base - Where the stylesheet came from (or the page, for a `<style>` in it).
|
|
14
|
+
* @param assets - What the page loaded, by address.
|
|
15
|
+
* @returns The stylesheet, ready to sit inside the snapshot.
|
|
16
|
+
*/
|
|
17
|
+
export declare function embedFonts(css: string, base: string, assets: ReadonlyMap<string, CapturedAsset>): string;
|
|
18
|
+
/**
|
|
19
|
+
* Turns a captured page into one that carries its own styles: every `<link rel="stylesheet">` the page loaded becomes a `<style>` with
|
|
20
|
+
* the stylesheet's text, and the fonts in it (and in the page's own `<style>`s) are embedded. A stylesheet that was not captured is left
|
|
21
|
+
* as the link it was.
|
|
22
|
+
*
|
|
23
|
+
* @param html - The page as captured.
|
|
24
|
+
* @param pageUrl - The page's address.
|
|
25
|
+
* @param assets - The stylesheets and fonts the page loaded, by address.
|
|
26
|
+
* @returns The page with its styles and fonts inside it.
|
|
27
|
+
*/
|
|
28
|
+
export declare function inlineAssets(html: string, pageUrl: string, assets: ReadonlyMap<string, CapturedAsset>): string;
|
|
29
|
+
//# sourceMappingURL=inline-assets.mapper.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** What `inlineLocalImages` made of a document. */
|
|
2
|
+
export interface InlinedImages {
|
|
3
|
+
html: string;
|
|
4
|
+
/** How many images were embedded. */
|
|
5
|
+
inlined: number;
|
|
6
|
+
/** How many pictures could not be found next to the file (or were too big), so they stay as they were. */
|
|
7
|
+
missing: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A document read from a file (a Markdown file, say) names its pictures by paths beside it, which the browser showing it cannot open. The
|
|
11
|
+
* pictures that sit in the document's own folder are embedded in the page as data addresses, so they show; ones that are not there are counted
|
|
12
|
+
* so the person is told. Nothing outside the document's folder is ever read.
|
|
13
|
+
*
|
|
14
|
+
* @param html - The document as HTML, its addresses already made absolute against `documentUrl`.
|
|
15
|
+
* @param documentUrl - The document's own `file:` address.
|
|
16
|
+
* @returns The page with the pictures embedded, and how many were embedded and how many could not be.
|
|
17
|
+
*/
|
|
18
|
+
export declare function inlineLocalImages(html: string, documentUrl: string): Promise<InlinedImages>;
|
|
19
|
+
//# sourceMappingURL=inline-local-images.use-case.d.ts.map
|
|
@@ -15,6 +15,8 @@ export interface SnapshotResult {
|
|
|
15
15
|
* snapshot no longer has by the time it is cached.
|
|
16
16
|
*/
|
|
17
17
|
rawHtml: string;
|
|
18
|
+
/** Something to tell the person about the page: it is a bot check or an access-denied page, not the content. */
|
|
19
|
+
notice?: string;
|
|
18
20
|
/**
|
|
19
21
|
* The format `http.client.ts` read the body as (api mode only; `undefined`
|
|
20
22
|
* in web mode, whose document is always HTML) — what the content pane
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface ImportedDocument {
|
|
2
2
|
/** The copy's path on disk, inside `folder`. */
|
|
3
3
|
path: string;
|
|
4
|
-
/** The copy as a `file:` URL: what the recipe's `start.url` becomes. */
|
|
4
|
+
/** The copy as a `file:` URL relative to the folder (`file:report.pdf`): what the recipe's `start.url` becomes, so the folder can be moved or shared. */
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -9,8 +9,10 @@ export interface ImportedDocument {
|
|
|
9
9
|
* `file:` URL the same way a run would read any downloaded file (core's
|
|
10
10
|
* `HttpClient` handles `file:` itself). The folder is created when missing,
|
|
11
11
|
* so dropping a file is also a way to start a workspace. A name already in
|
|
12
|
-
* the folder is never overwritten:
|
|
13
|
-
*
|
|
12
|
+
* the folder is never overwritten: a file there with the very same bytes is
|
|
13
|
+
* reused (loading one document twice leaves one copy), a different one gets
|
|
14
|
+
* the next free numbered name (`report-2.pdf`); the returned `path`/`url`
|
|
15
|
+
* say which.
|
|
14
16
|
*
|
|
15
17
|
* @param folder - The workspace folder; created (recursively) when it does not exist.
|
|
16
18
|
* @param name - The file's own name, no directories: the copy keeps it, extension included.
|
|
@@ -14,7 +14,7 @@ export interface RankedCandidate extends SelectorCandidate {
|
|
|
14
14
|
* Ordering: candidates that do not match `targetNodeId` (when given) sort
|
|
15
15
|
* last; among the rest, best tier first, and within a tier the fewest
|
|
16
16
|
* matches first (the most specific selector that still hits the target).
|
|
17
|
-
* A candidate matching nothing is dropped entirely: it is not a real option.
|
|
17
|
+
* Equal on all that, the selector naming more ids and classes comes first. A candidate matching nothing is dropped entirely: it is not a real option.
|
|
18
18
|
*
|
|
19
19
|
* @param html - The document to verify against (the snapshot, or the live page for the second, cross-check pass).
|
|
20
20
|
* @param candidates - Unranked candidates, e.g. from `candidatesFor`.
|
|
@@ -10,6 +10,11 @@ export declare const openWorkspaceCommandSchema: z.ZodObject<{
|
|
|
10
10
|
type: z.ZodLiteral<"open-workspace">;
|
|
11
11
|
folder: z.ZodString;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
+
/** Says what a page address returns, so a recipe is started the right way: a JSON API is read with a request, a page with a browser. */
|
|
14
|
+
export declare const detectUrlCommandSchema: z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"detect-url">;
|
|
16
|
+
url: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
13
18
|
/** Says what a path is (folder, recipe or document) and where to open it: how a link or an IDE entry opens a path (issue #235). `workspace` is the folder a document should belong to, when the caller has one. */
|
|
14
19
|
export declare const openPathCommandSchema: z.ZodObject<{
|
|
15
20
|
type: z.ZodLiteral<"open-path">;
|
|
@@ -87,6 +92,7 @@ export declare const inferSelectorCommandSchema: z.ZodObject<{
|
|
|
87
92
|
recipeId: z.ZodString;
|
|
88
93
|
path: z.ZodString;
|
|
89
94
|
nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
|
|
95
|
+
within: z.ZodOptional<z.ZodString>;
|
|
90
96
|
}, z.core.$strip>;
|
|
91
97
|
/**
|
|
92
98
|
* The Inspect panel's DOM tree and data-in-the-page findings, off the same
|
|
@@ -201,6 +207,18 @@ export declare const gridViewCommandSchema: z.ZodObject<{
|
|
|
201
207
|
delimiter: z.ZodOptional<z.ZodString>;
|
|
202
208
|
encoding: z.ZodOptional<z.ZodString>;
|
|
203
209
|
}, z.core.$strip>;
|
|
210
|
+
/**
|
|
211
|
+
* `grid-rows`: a run of one sheet's rows of a big CSV/spreadsheet, for the grid canvas that holds only the screens around where it is
|
|
212
|
+
* scrolled to. The first window comes with `grid-view`; the rest are asked for as the person scrolls.
|
|
213
|
+
*/
|
|
214
|
+
export declare const gridRowsCommandSchema: z.ZodObject<{
|
|
215
|
+
type: z.ZodLiteral<"grid-rows">;
|
|
216
|
+
recipeId: z.ZodString;
|
|
217
|
+
path: z.ZodString;
|
|
218
|
+
sheet: z.ZodInt;
|
|
219
|
+
from: z.ZodInt;
|
|
220
|
+
count: z.ZodInt;
|
|
221
|
+
}, z.core.$strip>;
|
|
204
222
|
/** A `table` extract's options for a workbook, as the studio's grid canvas picks build them — mirrors `document-view/table-preview.use-case.ts`'s `GridTablePreviewOptions`. */
|
|
205
223
|
export declare const gridPreviewOptionsSchema: z.ZodObject<{
|
|
206
224
|
sheet: z.ZodOptional<z.ZodString>;
|
|
@@ -399,6 +417,9 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
399
417
|
}, z.core.$strip>, z.ZodObject<{
|
|
400
418
|
type: z.ZodLiteral<"fetch-start-page">;
|
|
401
419
|
recipeId: z.ZodString;
|
|
420
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
421
|
+
type: z.ZodLiteral<"detect-url">;
|
|
422
|
+
url: z.ZodString;
|
|
402
423
|
}, z.core.$strip>, z.ZodObject<{
|
|
403
424
|
type: z.ZodLiteral<"save-outline">;
|
|
404
425
|
path: z.ZodString;
|
|
@@ -417,6 +438,7 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
417
438
|
recipeId: z.ZodString;
|
|
418
439
|
path: z.ZodString;
|
|
419
440
|
nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
|
|
441
|
+
within: z.ZodOptional<z.ZodString>;
|
|
420
442
|
}, z.core.$strip>, z.ZodObject<{
|
|
421
443
|
type: z.ZodLiteral<"explain-why">;
|
|
422
444
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -471,6 +493,13 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
471
493
|
path: z.ZodString;
|
|
472
494
|
delimiter: z.ZodOptional<z.ZodString>;
|
|
473
495
|
encoding: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
497
|
+
type: z.ZodLiteral<"grid-rows">;
|
|
498
|
+
recipeId: z.ZodString;
|
|
499
|
+
path: z.ZodString;
|
|
500
|
+
sheet: z.ZodInt;
|
|
501
|
+
from: z.ZodInt;
|
|
502
|
+
count: z.ZodInt;
|
|
474
503
|
}, z.core.$strip>, z.ZodObject<{
|
|
475
504
|
type: z.ZodLiteral<"grid-preview">;
|
|
476
505
|
recipeId: z.ZodString;
|
|
@@ -523,6 +552,7 @@ export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
|
|
|
523
552
|
export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
|
|
524
553
|
export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
|
|
525
554
|
export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
|
|
555
|
+
export type DetectUrlCommand = z.infer<typeof detectUrlCommandSchema>;
|
|
526
556
|
export type SaveOutlineCommand = z.infer<typeof saveOutlineCommandSchema>;
|
|
527
557
|
export type TakeSnapshotCommand = z.infer<typeof takeSnapshotCommandSchema>;
|
|
528
558
|
export type VerifySelectorCommand = z.infer<typeof verifySelectorCommandSchema>;
|
|
@@ -535,6 +565,7 @@ export type TablePreviewOptions = z.infer<typeof tablePreviewOptionsSchema>;
|
|
|
535
565
|
export type TablePreviewCommand = z.infer<typeof tablePreviewCommandSchema>;
|
|
536
566
|
export type RegionPreviewCommand = z.infer<typeof regionPreviewCommandSchema>;
|
|
537
567
|
export type GridViewCommand = z.infer<typeof gridViewCommandSchema>;
|
|
568
|
+
export type GridRowsCommand = z.infer<typeof gridRowsCommandSchema>;
|
|
538
569
|
export type GridPreviewOptions = z.infer<typeof gridPreviewOptionsSchema>;
|
|
539
570
|
export type GridPreviewCommand = z.infer<typeof gridPreviewCommandSchema>;
|
|
540
571
|
export type DeckViewCommand = z.infer<typeof deckViewCommandSchema>;
|
|
@@ -49,6 +49,7 @@ export declare const deckSlideViewSchema: z.ZodObject<{
|
|
|
49
49
|
date: "date";
|
|
50
50
|
}>;
|
|
51
51
|
}, z.core.$strip>>>;
|
|
52
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
52
53
|
merges: z.ZodArray<z.ZodObject<{
|
|
53
54
|
ref: z.ZodString;
|
|
54
55
|
top: z.ZodNumber;
|
|
@@ -103,6 +104,7 @@ export declare const deckDocumentViewSchema: z.ZodObject<{
|
|
|
103
104
|
date: "date";
|
|
104
105
|
}>;
|
|
105
106
|
}, z.core.$strip>>>;
|
|
107
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
106
108
|
merges: z.ZodArray<z.ZodObject<{
|
|
107
109
|
ref: z.ZodString;
|
|
108
110
|
top: z.ZodNumber;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* `detect-url`'s answer: what the address returns, so "Load ▾ Web page" starts the right recipe: `html` is a page (opened in a
|
|
4
|
+
* browser); `json`, `pdf`, `csv`, `xlsx`, `markdown`, `xml`... are documents (read with a request); `unknown` when it could not be fetched.
|
|
5
|
+
*/
|
|
6
|
+
export declare const detectUrlViewSchema: z.ZodObject<{
|
|
7
|
+
kind: z.ZodEnum<{
|
|
8
|
+
unknown: "unknown";
|
|
9
|
+
text: "text";
|
|
10
|
+
html: "html";
|
|
11
|
+
json: "json";
|
|
12
|
+
jsonl: "jsonl";
|
|
13
|
+
pdf: "pdf";
|
|
14
|
+
csv: "csv";
|
|
15
|
+
xlsx: "xlsx";
|
|
16
|
+
pptx: "pptx";
|
|
17
|
+
yaml: "yaml";
|
|
18
|
+
markdown: "markdown";
|
|
19
|
+
xml: "xml";
|
|
20
|
+
docx: "docx";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type DetectUrlView = z.infer<typeof detectUrlViewSchema>;
|
|
24
|
+
//# sourceMappingURL=detect-url-view.contract.d.ts.map
|
|
@@ -31,6 +31,7 @@ export declare const gridSheetViewSchema: z.ZodObject<{
|
|
|
31
31
|
date: "date";
|
|
32
32
|
}>;
|
|
33
33
|
}, z.core.$strip>>>;
|
|
34
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
34
35
|
merges: z.ZodArray<z.ZodObject<{
|
|
35
36
|
ref: z.ZodString;
|
|
36
37
|
top: z.ZodNumber;
|
|
@@ -43,6 +44,18 @@ export declare const gridSheetViewSchema: z.ZodObject<{
|
|
|
43
44
|
defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
|
|
44
45
|
defaultRowHeight: z.ZodOptional<z.ZodNumber>;
|
|
45
46
|
}, z.core.$strip>;
|
|
47
|
+
/** What `grid-rows` answers with: a run of one sheet's rows. */
|
|
48
|
+
export declare const gridRowsViewSchema: z.ZodObject<{
|
|
49
|
+
rows: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
50
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
51
|
+
type: z.ZodEnum<{
|
|
52
|
+
string: "string";
|
|
53
|
+
number: "number";
|
|
54
|
+
boolean: "boolean";
|
|
55
|
+
date: "date";
|
|
56
|
+
}>;
|
|
57
|
+
}, z.core.$strip>>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
46
59
|
/** What `grid-view` answers with (studio plan §3.4, issue #94's 5c): every sheet's cells, typed, with hidden sheets/rows marked and merged ranges resolved, for the grid canvas to draw. */
|
|
47
60
|
export declare const workbookDocumentViewSchema: z.ZodObject<{
|
|
48
61
|
sheets: z.ZodArray<z.ZodObject<{
|
|
@@ -59,6 +72,7 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
|
|
|
59
72
|
date: "date";
|
|
60
73
|
}>;
|
|
61
74
|
}, z.core.$strip>>>;
|
|
75
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
62
76
|
merges: z.ZodArray<z.ZodObject<{
|
|
63
77
|
ref: z.ZodString;
|
|
64
78
|
top: z.ZodNumber;
|
|
@@ -76,6 +90,7 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
|
|
|
76
90
|
delimiter: z.ZodString;
|
|
77
91
|
}, z.core.$strip>>;
|
|
78
92
|
}, z.core.$strip>;
|
|
93
|
+
export type GridRowsView = z.infer<typeof gridRowsViewSchema>;
|
|
79
94
|
export type GridCellView = z.infer<typeof gridCellViewSchema>;
|
|
80
95
|
export type GridMergeView = z.infer<typeof gridMergeViewSchema>;
|
|
81
96
|
export type GridSheetView = z.infer<typeof gridSheetViewSchema>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, gridViewCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, startRecordingCommandSchema, stopRecordingCommandSchema, studioCommandSchema } from './command.contract.js';
|
|
2
|
-
export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StartRecordingCommand, StopRecordingCommand, StudioCommand } from './command.contract.js';
|
|
1
|
+
export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, detectUrlCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, gridViewCommandSchema, gridRowsCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, startRecordingCommandSchema, stopRecordingCommandSchema, studioCommandSchema } from './command.contract.js';
|
|
2
|
+
export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, DetectUrlCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridRowsCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StartRecordingCommand, StopRecordingCommand, StudioCommand } from './command.contract.js';
|
|
3
3
|
export { snapshotViewSchema } from './snapshot-view.contract.js';
|
|
4
4
|
export type { SnapshotView } from './snapshot-view.contract.js';
|
|
5
5
|
export { verifySelectorViewSchema } from './verify-selector-view.contract.js';
|
|
6
6
|
export type { VerifySelectorView } from './verify-selector-view.contract.js';
|
|
7
|
-
export { fieldPickSchema, inferSelectorViewSchema } from './infer-selector-view.contract.js';
|
|
8
|
-
export type { FieldPick, InferSelectorView } from './infer-selector-view.contract.js';
|
|
7
|
+
export { fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema } from './infer-selector-view.contract.js';
|
|
8
|
+
export type { FieldPick, InferSelectorView, SelectorAlternative } from './infer-selector-view.contract.js';
|
|
9
9
|
export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, studioEventSchema } from './event.contract.js';
|
|
10
10
|
export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, StudioEvent } from './event.contract.js';
|
|
11
11
|
export { loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema } from './workspace-view.contract.js';
|
|
@@ -18,6 +18,8 @@ export { importDocumentViewSchema } from './import-document-view.contract.js';
|
|
|
18
18
|
export type { ImportDocumentView } from './import-document-view.contract.js';
|
|
19
19
|
export { sampleRunRecordSchema, sampleRunViewSchema } from './sample-run-view.contract.js';
|
|
20
20
|
export type { SampleRunRecord, SampleRunView } from './sample-run-view.contract.js';
|
|
21
|
+
export { detectUrlViewSchema } from './detect-url-view.contract.js';
|
|
22
|
+
export type { DetectUrlView } from './detect-url-view.contract.js';
|
|
21
23
|
export { startPageViewSchema } from './start-page-view.contract.js';
|
|
22
24
|
export type { StartPageView } from './start-page-view.contract.js';
|
|
23
25
|
export { sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema } from './outline-view.contract.js';
|
|
@@ -36,8 +38,8 @@ export { tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchem
|
|
|
36
38
|
export type { TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView } from './table-preview-view.contract.js';
|
|
37
39
|
export { regionPreviewMatchSchema, regionPreviewViewSchema } from './region-preview-view.contract.js';
|
|
38
40
|
export type { RegionPreviewMatchView, RegionPreviewView } from './region-preview-view.contract.js';
|
|
39
|
-
export { gridCellViewSchema, gridMergeViewSchema, gridSheetViewSchema, workbookDocumentViewSchema } from './grid-view.contract.js';
|
|
40
|
-
export type { GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView } from './grid-view.contract.js';
|
|
41
|
+
export { gridCellViewSchema, gridMergeViewSchema, gridRowsViewSchema, gridSheetViewSchema, workbookDocumentViewSchema } from './grid-view.contract.js';
|
|
42
|
+
export type { GridCellView, GridMergeView, GridRowsView, GridSheetView, WorkbookDocumentView } from './grid-view.contract.js';
|
|
41
43
|
export { gridTablePreviewMatchSchema, gridTablePreviewViewSchema } from './grid-preview-view.contract.js';
|
|
42
44
|
export type { GridTablePreviewMatchView, GridTablePreviewView } from './grid-preview-view.contract.js';
|
|
43
45
|
export { deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema } from './deck-view.contract.js';
|