@opencraw/core 0.1.1 → 0.1.3
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/README.md +4 -2
- package/dist/index.esm.js +3010 -638
- package/dist/src/access/access-profile.contract.d.ts +4 -0
- package/dist/src/access/index.d.ts +1 -1
- package/dist/src/api-steps/extract-from-document.use-case.d.ts +16 -3
- package/dist/src/api-steps/index.d.ts +1 -1
- package/dist/src/api-steps/send-request.use-case.d.ts +5 -4
- package/dist/src/browser-session/browser-profile.store.d.ts +52 -0
- package/dist/src/browser-session/browser.client.d.ts +8 -0
- package/dist/src/browser-session/index.d.ts +1 -0
- package/dist/src/captcha/captcha-budget.model.d.ts +21 -0
- package/dist/src/captcha/captcha-detection.client.d.ts +28 -0
- package/dist/src/captcha/captcha-guard.use-case.d.ts +64 -0
- package/dist/src/captcha/captcha-solver-registry.store.d.ts +19 -0
- package/dist/src/captcha/captcha-solver.contract.d.ts +47 -0
- package/dist/src/captcha/captcha.error.d.ts +13 -0
- package/dist/src/captcha/index.d.ts +10 -0
- package/dist/src/captcha/resolve-captcha.use-case.d.ts +40 -0
- package/dist/src/crawl-events/crawl-event.contract.d.ts +48 -0
- package/dist/src/crawl-execution/bootstrap-session.use-case.d.ts +27 -3
- package/dist/src/crawl-execution/crawl-options.config.d.ts +30 -0
- package/dist/src/crawl-execution/crawl-report.model.d.ts +6 -0
- package/dist/src/crawl-execution/create-crawler.use-case.d.ts +2 -1
- package/dist/src/crawl-execution/rotating-runner.use-case.d.ts +9 -0
- package/dist/src/crawl-execution/run-crawl.use-case.d.ts +6 -2
- package/dist/src/crawl-execution/run-input-recipe.use-case.d.ts +14 -3
- package/dist/src/deck-document/deck-document.model.d.ts +58 -0
- package/dist/src/deck-document/deck-table.algorithm.d.ts +35 -0
- package/dist/src/deck-document/index.d.ts +6 -0
- package/dist/src/deck-document/read-pptx.client.d.ts +16 -0
- package/dist/src/extraction-scope/extraction-scope.model.d.ts +3 -1
- package/dist/src/http-session/http-response.contract.d.ts +13 -1
- package/dist/src/http-session/text-decoding.algorithm.d.ts +35 -0
- package/dist/src/index.d.ts +13 -4
- package/dist/src/markdown-document/index.d.ts +3 -0
- package/dist/src/markdown-document/read-markdown.client.d.ts +29 -0
- package/dist/src/pdf-document/index.d.ts +1 -1
- package/dist/src/pdf-document/row-assembly.algorithm.d.ts +10 -1
- package/dist/src/recipe-loading/recipe-binding.validator.d.ts +3 -1
- package/dist/src/recipe-schema/index.d.ts +3 -3
- package/dist/src/recipe-schema/input-recipe.contract.d.ts +57 -4
- package/dist/src/recipe-schema/recipe-kind.enum.d.ts +3 -2
- package/dist/src/recipe-schema/step.contract.d.ts +46 -2
- package/dist/src/record-sink/dedupe.policy.d.ts +19 -7
- package/dist/src/record-sink/index.d.ts +1 -0
- package/dist/src/selection/index.d.ts +1 -1
- package/dist/src/selection/json-text.algorithm.d.ts +30 -3
- package/dist/src/step-flow/for-each.use-case.d.ts +4 -2
- package/dist/src/step-flow/host-throttle.policy.d.ts +49 -0
- package/dist/src/step-flow/index.d.ts +5 -0
- package/dist/src/step-flow/run-gate.policy.d.ts +12 -1
- package/dist/src/step-flow/step-runner.contract.d.ts +13 -0
- package/dist/src/step-flow/transport-retry.policy.d.ts +76 -0
- package/dist/src/web-steps/navigate.use-case.d.ts +3 -2
- package/dist/src/web-steps/run-web-step.use-case.d.ts +18 -3
- package/dist/src/workbook-document/csv-parser.algorithm.d.ts +26 -0
- package/dist/src/workbook-document/csv-workbook.mapper.d.ts +24 -0
- package/dist/src/workbook-document/grid-table.algorithm.d.ts +53 -0
- package/dist/src/workbook-document/html-tables.mapper.d.ts +14 -0
- package/dist/src/workbook-document/index.d.ts +9 -0
- package/dist/src/workbook-document/read-xlsx.client.d.ts +18 -0
- package/dist/src/workbook-document/workbook-document.model.d.ts +51 -0
- package/dist/src/yaml-document/index.d.ts +3 -0
- package/dist/src/yaml-document/read-yaml.client.d.ts +25 -0
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -16,11 +16,13 @@ npx playwright install chromium # web recipes and browser bootstraps only
|
|
|
16
16
|
| `loadRecipes(source)` | Reads, validates and binds recipes from one source holding all of them, the output recipe found by its `kind`. The source is any of the forms below. Throws `RecipeValidationError` / `RecipeBindingError` with every problem and its JSON path. |
|
|
17
17
|
| `loadRecipeSet({ output, inputs })` | The same, with the output recipe given apart; each part is any of the forms below. |
|
|
18
18
|
| `readRecipeSource(source)` | Decodes recipes without validating them, each with where it came from, for tooling. |
|
|
19
|
-
| `createCrawler(options)` | Builds an engine: `hooks`, `sink` (`memorySink()` default, `jsonLinesSink(path, { append? })`), `onEvent`, `browser` settings, `dedupe` (`run` / `recipe` / `off`), `onRecipeError` (`continue` / `stop`), `resume` (skip keys the sink already has), `access` + `accessPlugins` (proxy profiles, see [access.md](../../docs/recipes/access.md)). |
|
|
19
|
+
| `createCrawler(options)` | Builds an engine: `hooks`, `sink` (`memorySink()` default, `jsonLinesSink(path, { append? })`), `onEvent`, `browser` settings, `dedupe` (`run` / `recipe` / `off`), `onRecipeError` (`continue` / `stop`), `resume` (skip keys the sink already has), `access` + `accessPlugins` (proxy profiles, see [access.md](../../docs/recipes/access.md)), `captchaSolvers` (see [captcha.md](../../docs/recipes/captcha.md)), `throttle` (per-site politeness), `retry` (requests that fail in passing), `parallel` (input recipes at once), `profilesDir` (persistent browser profiles). |
|
|
20
20
|
| `loadAccessConfig(path)`, `AccessBroker`, `ACCESS_PRESETS` | Access configs: load and validate one, lease a profile outside a crawl (the cli's `probe` does), list the provider presets. |
|
|
21
21
|
| `crawler.run(set)` | Runs every input recipe in sequence; returns a `CrawlReport`. |
|
|
22
22
|
| `crawler.close()` | Closes the browser, if one was launched. |
|
|
23
23
|
| `readPdf(bytes)`, `findTables(pdf, query)`, `pdfText(pdf)` | The PDF reader and table extractor `request as: "pdf"` and `extract kind: "table"` use, for tooling. |
|
|
24
|
+
| `csvWorkbook(text, options)`, `parseCsv(text, delimiter)`, `detectDelimiter(text)`, `findGridTables(workbook, query)`, `workbookText(workbook)` | The CSV reader and the workbook table extractor `request as: "csv"` / `"xlsx"` and `extract kind: "table"` use, for tooling. Spreadsheets are read by [`@opencraw/office-reader`](../office-reader). |
|
|
25
|
+
| `findDeckTables(deck, query)`, `deckText(deck)` | The deck table extractor and text `request as: "pptx"` uses, for tooling; presentations are read by [`@opencraw/office-reader`](../office-reader). |
|
|
24
26
|
| `HttpClient`, `BrowserClient` | The same clients the engine's runners use, for tooling built on top of `@opencraw/core` (`@opencraw/cli`'s `probe` command uses both). |
|
|
25
27
|
| `parseInputRecipe`, `parseOutputRecipe`, `inputRecipeJsonSchema`, `outputRecipeJsonSchema`, `accessConfigJsonSchema` | The contracts, for tooling. |
|
|
26
28
|
|
|
@@ -60,7 +62,7 @@ step-flow forEach / paginate / emit / policies api-steps
|
|
|
60
62
|
web-steps goto / click / extract runner transformation the built-in ops
|
|
61
63
|
output-mapping ids -> validated records record-sink memory, JSON Lines, dedupe
|
|
62
64
|
recipe-loading files -> a bound RecipeSet crawl-execution sessions, runs, reports
|
|
63
|
-
access proxy profiles, presets, leases, plugins
|
|
65
|
+
access proxy profiles, presets, leases, plugins captcha detection, the solve loop, the budget
|
|
64
66
|
```
|
|
65
67
|
|
|
66
68
|
`e2e/` holds the fixture shop and the browser suite (`nx run core:e2e`); `tools/` emits `schemas/`.
|