diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 12ff1e64..00000000 --- a/.dockerignore +++ /dev/null @@ -1,59 +0,0 @@ -# Dependencies -node_modules/ -**/node_modules/ - -# Build outputs -dist/ -**/dist/ - -# Git -.git/ -.gitignore - -# CI/CD -.github/ -.gitlab-ci.yml -.travis.yml - -# IDE -.vscode/ -.idea/ -*.swp -*.swo -*~ - -# OS -.DS_Store -Thumbs.db - -# Testing -test/ -tests/ -__tests__/ -*.test.js -*.spec.js -coverage/ -.nyc_output/ - -# Logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Environment -.env -.env.* - -# Temporary files -*.tmp -*.temp -.cache/ - -# Examples and scripts -examples/ -bin/ - -# Other packages (we only need mcp-server) -packages/*/ -!packages/mcp-server/ diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 57c09214..b7538a54 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -5,9 +5,10 @@ name: Publish NPM on: workflow_dispatch: inputs: - path: - description: The path to run the release in, e.g. '.' or 'packages/mcp-server' + tag: + description: 'Release tag to publish, e.g. v2.18.0' required: true + type: string release: types: [published] @@ -15,37 +16,38 @@ on: jobs: publish: name: publish + if: github.repository == 'context-dot-dev/context-typescript-sdk' runs-on: ubuntu-latest + environment: production permissions: - contents: write + contents: read id-token: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: refs/tags/${{ inputs.tag || github.event.release.tag_name }} + persist-credentials: false - name: Set up Node uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: node-version: '24' + - name: Verify release version + run: test "$RELEASE_TAG" = "v$(node -p 'require("./package.json").version')" + env: + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} + + - name: Set up npm trusted publishing + run: npm install --global npm@11 + - name: Install dependencies - run: | - yarn install + run: yarn install --frozen-lockfile - - name: Publish to NPM - run: | - if [ -n "$INPUT_PATH" ]; then - PATHS_RELEASED="[\"$INPUT_PATH\"]" - else - PATHS_RELEASED='[\".\", \"packages/mcp-server\"]' - fi - yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }" - env: - INPUT_PATH: ${{ github.event.inputs.path }} + - name: Build package + run: yarn build - - name: Upload MCP Server DXT GitHub release asset - run: | - gh release upload ${{ github.event.release.tag_name }} \ - packages/mcp-server/context_dev_api.mcpb - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish to NPM + working-directory: dist + run: npm publish --access public --provenance diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 136b751a..d316b536 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,7 @@ name: Release Doctor on: pull_request: + types: [opened, synchronize, reopened, edited] branches: - main workflow_dispatch: @@ -14,6 +15,13 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Verify release title matches package version + if: startsWith(github.head_ref, 'release-please') + env: + RELEASE_TITLE: ${{ github.event.pull_request.title }} + run: | + test "$RELEASE_TITLE" = "release: $(node -p 'require("./package.json").version')" + - name: Check release environment run: | bash ./bin/check-release-environment diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index c0210fa8..00000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Release Please -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - if: github.repository == 'context-dot-dev/context-typescript-sdk' - runs-on: ubuntu-latest - - steps: - - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 - id: release - with: - token: ${{ secrets.RELEASE_PLEASE_TOKEN }} diff --git a/.gitignore b/.gitignore index ae4aa20e..9487e48a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,4 @@ dist-deno /*.tgz .idea/ .eslintcache -dist-bundle -*.mcpb oidc diff --git a/.prettierignore b/.prettierignore index 36afd3b3..3548c5af 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,7 +2,6 @@ CHANGELOG.md /ecosystem-tests/*/** /node_modules /deno -/packages/mcp-server/manifest.json # don't format tsc output, will break source maps -dist +/dist diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b9c017b3..26b4a530 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.14.0" + ".": "3.30.0" } diff --git a/.stats.yml b/.stats.yml index 1fd29914..364b6123 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 41 +configured_endpoints: 46 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9509077f..7971ef55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,471 @@ # Changelog +## [3.30.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.29.0...v3.30.0) (2026-11-17) + + +### Features + +* **billing:** report plan facts in usage and limit errors ([#2897](https://github.com/context-dot-dev/context-typescript-sdk/issues/2897)) ([16a84a8](https://github.com/context-dot-dev/context-typescript-sdk/commit/16a84a80ac73485be395ced4b7c7c5ed585e53a2)) + + +### Chores + +* run release-please centrally from brand-dev-server ([79ed995](https://github.com/context-dot-dev/context-typescript-sdk/commit/79ed995ce1e37170c302bdd927f27dd4a0793ab5)) + + +### Documentation + +* **scrape:** mention transcripts on the Markdown format ([#2903](https://github.com/context-dot-dev/context-typescript-sdk/issues/2903)) ([16a84a8](https://github.com/context-dot-dev/context-typescript-sdk/commit/16a84a80ac73485be395ced4b7c7c5ed585e53a2)) + +## [3.29.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.28.0...v3.29.0) (2026-11-12) + + +### Features + +* **zdr:** accept zero data retention on people search and company search ([#2852](https://github.com/context-dot-dev/context-typescript-sdk/issues/2852)) ([26775ce](https://github.com/context-dot-dev/context-typescript-sdk/commit/26775ce98bcecbea0824548f6665012dd750a539)) + +## [3.28.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.27.0...v3.28.0) (2026-11-09) + + +### Features + +* **parse:** support WARC archives in parsing and scraping ([#2761](https://github.com/context-dot-dev/context-typescript-sdk/issues/2761)) ([0c7797d](https://github.com/context-dot-dev/context-typescript-sdk/commit/0c7797dc97ee6374404f5e60e2cf26b2a39fa98f)) + +## [3.27.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.26.0...v3.27.0) (2026-11-09) + + +### Features + +* **batches:** let sitemap crawls choose which paths count as non-pages ([#2796](https://github.com/context-dot-dev/context-typescript-sdk/issues/2796)) ([5e89196](https://github.com/context-dot-dev/context-typescript-sdk/commit/5e89196bfdddcddf3e88d646495b7ed0457aa356)) + +## [3.26.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.25.0...v3.26.0) (2026-11-08) + + +### Features + +* **batch:** raise batch submissions to 2,500 per minute per organization ([#2734](https://github.com/context-dot-dev/context-typescript-sdk/issues/2734)) ([2bbef8a](https://github.com/context-dot-dev/context-typescript-sdk/commit/2bbef8a6784dfd2b7847c20aeba8ecca0e41c1ff)) + +## [3.25.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.24.1...v3.25.0) (2026-11-07) + + +### Features + +* **batch:** accept lightweight submissions and queue pending work ([#2683](https://github.com/context-dot-dev/context-typescript-sdk/issues/2683)) ([14f386b](https://github.com/context-dot-dev/context-typescript-sdk/commit/14f386b89dff3f0ed647c2a0a912c66434b68111)) + +## [3.24.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.24.0...v3.24.1) (2026-11-05) + + +### Documentation + +* **logs:** say that a request log appears a few seconds after the request ([#2564](https://github.com/context-dot-dev/context-typescript-sdk/issues/2564)) ([d28f0e9](https://github.com/context-dot-dev/context-typescript-sdk/commit/d28f0e97c76160ff12608ab796dc716e26c96dcf)) + +## [3.24.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.23.1...v3.24.0) (2026-11-05) + + +### Features + +* **scrape:** add Tripadvisor reviews parser ([#2508](https://github.com/context-dot-dev/context-typescript-sdk/issues/2508)) ([191a060](https://github.com/context-dot-dev/context-typescript-sdk/commit/191a060897c65270acf9b9421ef3b6516c54ddcc)) + +## [3.23.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.23.0...v3.23.1) (2026-11-04) + + +### Refactors + +* **fonts:** share font link schemas and inferred types ([d1525f3](https://github.com/context-dot-dev/context-typescript-sdk/commit/d1525f393fd8370fce4c1b820bf52c1609920650)) + +## [3.23.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.22.0...v3.23.0) (2026-11-02) + + +### Features + +* **scrape:** read framework-embedded page data in the json format ([#2405](https://github.com/context-dot-dev/context-typescript-sdk/issues/2405)) ([d1c58dc](https://github.com/context-dot-dev/context-typescript-sdk/commit/d1c58dc46af12cc8a3926620a935a2531e4df031)) + +## [3.22.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.21.0...v3.22.0) (2026-11-01) + + +### Features + +* **scrape:** return Yelp reviewer id and profile url in yelp-reviews ([#2402](https://github.com/context-dot-dev/context-typescript-sdk/issues/2402)) ([3f07f7e](https://github.com/context-dot-dev/context-typescript-sdk/commit/3f07f7e8b2f6be34d5f45dddf75e067e77f131ec)) + +## [3.21.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.20.0...v3.21.0) (2026-10-31) + + +### Features + +* **scrape:** add reddit-post prebuilt parser with full comment trees ([#2217](https://github.com/context-dot-dev/context-typescript-sdk/issues/2217)) ([733e0c9](https://github.com/context-dot-dev/context-typescript-sdk/commit/733e0c9a361a1dc19838bc8ed5f89f2e6e298416)) + +## [3.20.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.19.1...v3.20.0) (2026-10-30) + + +### Features + +* **scrape:** add Yelp reviews parser ([2ab8370](https://github.com/context-dot-dev/context-typescript-sdk/commit/2ab837017c196f99d336715e33a4acfc2a40cd24)) +* **scrape:** add Yelp search parser ([186069c](https://github.com/context-dot-dev/context-typescript-sdk/commit/186069c8b338250ace47c8106bda051f02df73b6)) + +## [3.19.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.19.0...v3.19.1) (2026-10-29) + + +### Bug Fixes + +* **scrape:** derive the /web/scrape request spec from its zod schema ([#2044](https://github.com/context-dot-dev/context-typescript-sdk/issues/2044)) ([211f581](https://github.com/context-dot-dev/context-typescript-sdk/commit/211f581508298cc4a21299f565c490aabeeed532)) + +## [3.19.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.18.0...v3.19.0) (2026-10-28) + + +### Features + +* **access-policies:** limit which websites API requests can reach ([#2213](https://github.com/context-dot-dev/context-typescript-sdk/issues/2213)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) +* **access-policies:** limit which websites API requests can reach ([#2213](https://github.com/context-dot-dev/context-typescript-sdk/issues/2213)) ([ff77d90](https://github.com/context-dot-dev/context-typescript-sdk/commit/ff77d900714bdbbfc8f4db32f07bc81421b25ac7)) +* **access-policies:** limit which websites API requests can reach ([#2213](https://github.com/context-dot-dev/context-typescript-sdk/issues/2213)) ([4a96b45](https://github.com/context-dot-dev/context-typescript-sdk/commit/4a96b45d64fbd0b9278205772e170ef81b49fb51)) +* **access-policies:** limit which websites API requests can reach ([#2213](https://github.com/context-dot-dev/context-typescript-sdk/issues/2213)) ([93ccc89](https://github.com/context-dot-dev/context-typescript-sdk/commit/93ccc892b4758e3ac4b2ad0954738f075d362655)) +* **access-policies:** limit which websites API requests can reach ([#2213](https://github.com/context-dot-dev/context-typescript-sdk/issues/2213)) ([e96b8e6](https://github.com/context-dot-dev/context-typescript-sdk/commit/e96b8e6833971894877b28e03e04486cedfa8a7c)) +* **brand:** support log-free brand and styleguide requests ([#2231](https://github.com/context-dot-dev/context-typescript-sdk/issues/2231)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) +* **brand:** support log-free brand and styleguide requests ([#2231](https://github.com/context-dot-dev/context-typescript-sdk/issues/2231)) ([ff77d90](https://github.com/context-dot-dev/context-typescript-sdk/commit/ff77d900714bdbbfc8f4db32f07bc81421b25ac7)) +* **brand:** support log-free brand and styleguide requests ([#2231](https://github.com/context-dot-dev/context-typescript-sdk/issues/2231)) ([4a96b45](https://github.com/context-dot-dev/context-typescript-sdk/commit/4a96b45d64fbd0b9278205772e170ef81b49fb51)) +* **brand:** support log-free brand and styleguide requests ([#2231](https://github.com/context-dot-dev/context-typescript-sdk/issues/2231)) ([93ccc89](https://github.com/context-dot-dev/context-typescript-sdk/commit/93ccc892b4758e3ac4b2ad0954738f075d362655)) +* **monitors:** add search target to watch the web for new developments ([#2215](https://github.com/context-dot-dev/context-typescript-sdk/issues/2215)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) +* **monitors:** add search target to watch the web for new developments ([#2215](https://github.com/context-dot-dev/context-typescript-sdk/issues/2215)) ([ff77d90](https://github.com/context-dot-dev/context-typescript-sdk/commit/ff77d900714bdbbfc8f4db32f07bc81421b25ac7)) + + +### Bug Fixes + +* **brand:** keep metadata-only usage logs for ZDR brand requests ([#2234](https://github.com/context-dot-dev/context-typescript-sdk/issues/2234)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) +* **brand:** keep metadata-only usage logs for ZDR brand requests ([#2234](https://github.com/context-dot-dev/context-typescript-sdk/issues/2234)) ([ff77d90](https://github.com/context-dot-dev/context-typescript-sdk/commit/ff77d900714bdbbfc8f4db32f07bc81421b25ac7)) +* **brand:** keep metadata-only usage logs for ZDR brand requests ([#2234](https://github.com/context-dot-dev/context-typescript-sdk/issues/2234)) ([4a96b45](https://github.com/context-dot-dev/context-typescript-sdk/commit/4a96b45d64fbd0b9278205772e170ef81b49fb51)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([ff77d90](https://github.com/context-dot-dev/context-typescript-sdk/commit/ff77d900714bdbbfc8f4db32f07bc81421b25ac7)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([4a96b45](https://github.com/context-dot-dev/context-typescript-sdk/commit/4a96b45d64fbd0b9278205772e170ef81b49fb51)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([93ccc89](https://github.com/context-dot-dev/context-typescript-sdk/commit/93ccc892b4758e3ac4b2ad0954738f075d362655)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([e96b8e6](https://github.com/context-dot-dev/context-typescript-sdk/commit/e96b8e6833971894877b28e03e04486cedfa8a7c)) +* **openapi:** keep legacy batch inputs in the spec as deprecated ([#2225](https://github.com/context-dot-dev/context-typescript-sdk/issues/2225)) ([1bd3e5c](https://github.com/context-dot-dev/context-typescript-sdk/commit/1bd3e5ca3bebc1a079701c5b8c322a62b6361127)) +* **scrape:** restore Instagram profile posts from public pages ([#2233](https://github.com/context-dot-dev/context-typescript-sdk/issues/2233)) ([2e7cbf7](https://github.com/context-dot-dev/context-typescript-sdk/commit/2e7cbf721079a86aaf706bca719f74ae26191ac4)) + +## [3.18.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.17.1...v3.18.0) (2026-10-27) + + +### Features + +* **parse:** mark PDF page numbers inline in Markdown with includeNumberedPages ([#2110](https://github.com/context-dot-dev/context-typescript-sdk/issues/2110)) ([eb1e97f](https://github.com/context-dot-dev/context-typescript-sdk/commit/eb1e97f29ca78b86611f808632e264cac59c0e53)) + + +### Bug Fixes + +* **people:** split ultra people ranking on its strongest phrase signals ([#2209](https://github.com/context-dot-dev/context-typescript-sdk/issues/2209)) ([6a36584](https://github.com/context-dot-dev/context-typescript-sdk/commit/6a3658407f1b0c9f4a4cdf520f305d9149b01d1d)) + +## [3.17.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.17.0...v3.17.1) (2026-10-27) + + +### Documentation + +* **people:** note that complex ultra people searches can take up to 60 seconds ([#2206](https://github.com/context-dot-dev/context-typescript-sdk/issues/2206)) ([3b35d9a](https://github.com/context-dot-dev/context-typescript-sdk/commit/3b35d9a754e095d206804bcf0bfe3cb97dffd81a)) + +## [3.17.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.16.0...v3.17.0) (2026-10-27) + + +### Features + +* **people:** add ultra mode to people search ([#2149](https://github.com/context-dot-dev/context-typescript-sdk/issues/2149)) ([cca0757](https://github.com/context-dot-dev/context-typescript-sdk/commit/cca07576fc137e45bf0ccfd638479dcb4f251cb4)) + +## [3.16.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.15.0...v3.16.0) (2026-10-27) + + +### Features + +* **api:** serve a public OpenAPI spec and generate the SDKs from it ([#2075](https://github.com/context-dot-dev/context-typescript-sdk/issues/2075)) ([87349d2](https://github.com/context-dot-dev/context-typescript-sdk/commit/87349d2037f4973e4b2b4579c5c3b83daa1ebb5a)) + +## [3.15.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.14.1...v3.15.0) (2026-10-23) + + +### Features + +* **people:** publish people search in the API specification ([#2094](https://github.com/context-dot-dev/context-typescript-sdk/issues/2094)) ([0228537](https://github.com/context-dot-dev/context-typescript-sdk/commit/02285374860c2548591d3fe0abd76c2033671aca)) + +## [3.14.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.14.0...v3.14.1) (2026-10-21) + + +### Documentation + +* **openapi:** unify regex wording and shorten sourcePreference descriptions ([#2051](https://github.com/context-dot-dev/context-typescript-sdk/issues/2051)) ([28f76b7](https://github.com/context-dot-dev/context-typescript-sdk/commit/28f76b70ff490c29e44c80ce078cd026f0256998)) + +## [3.14.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.13.0...v3.14.0) (2026-10-21) + + +### Features + +* **scrape:** add sourcePreference to choose between HTML conversion and published Markdown ([#2010](https://github.com/context-dot-dev/context-typescript-sdk/issues/2010)) ([d2084ac](https://github.com/context-dot-dev/context-typescript-sdk/commit/d2084ac777f950c1b3b92c7bc6a17d012759425a)) + +## [3.13.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.12.3...v3.13.0) (2026-10-21) + + +### Features + +* **batch:** follow only chosen languages in start_url crawls ([#2003](https://github.com/context-dot-dev/context-typescript-sdk/issues/2003)) ([86dfa4d](https://github.com/context-dot-dev/context-typescript-sdk/commit/86dfa4d3ca8490c221f380de480f400a987f1b4c)) + +## [3.12.3](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.12.2...v3.12.3) (2026-10-21) + + +### Bug Fixes + +* **openapi:** document request_id and key_metadata on every response in one place ([#2042](https://github.com/context-dot-dev/context-typescript-sdk/issues/2042)) ([867de4d](https://github.com/context-dot-dev/context-typescript-sdk/commit/867de4d4e66c5bbe8e7be5ba28537bd42e5a1518)) + +## [3.12.2](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.12.1...v3.12.2) (2026-10-21) + + +### Bug Fixes + +* **answers:** document request_id in the /web/answers response ([#2040](https://github.com/context-dot-dev/context-typescript-sdk/issues/2040)) ([3181430](https://github.com/context-dot-dev/context-typescript-sdk/commit/31814309db43f2f76876a13cb46823a247663ff0)) + +## [3.12.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.12.0...v3.12.1) (2026-10-21) + + +### Bug Fixes + +* **news:** return extended descriptions for index search ([#2019](https://github.com/context-dot-dev/context-typescript-sdk/issues/2019)) ([99f1f90](https://github.com/context-dot-dev/context-typescript-sdk/commit/99f1f90fd28d2e9b6c39efd7a2c9024f37206bb0)) + +## [3.12.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.11.0...v3.12.0) (2026-10-19) + + +### Features + +* **crawl:** add exclude URL regex to crawl and sitemap endpoints ([#1982](https://github.com/context-dot-dev/context-typescript-sdk/issues/1982)) ([892d6fb](https://github.com/context-dot-dev/context-typescript-sdk/commit/892d6fb350603d4e620c07daef9cd5442f279a94)) + +## [3.11.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.10.0...v3.11.0) (2026-10-19) + + +### Features + +* **news:** add natural-language search to POST /news/search ([#1975](https://github.com/context-dot-dev/context-typescript-sdk/issues/1975)) ([d2afbbe](https://github.com/context-dot-dev/context-typescript-sdk/commit/d2afbbee526024e7e5b497474dbcccd0a668c4a3)) + +## [3.10.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.9.0...v3.10.0) (2026-10-18) + + +### Features + +* **scrape:** add TikTok profile and video prebuilt parsers ([#1956](https://github.com/context-dot-dev/context-typescript-sdk/issues/1956)) ([2b7a922](https://github.com/context-dot-dev/context-typescript-sdk/commit/2b7a9223088c1aa018205300fa489d4877dd981b)) + +## [3.9.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.8.0...v3.9.0) (2026-10-18) + + +### Features + +* **people:** allow enrichment on free plans ([#1961](https://github.com/context-dot-dev/context-typescript-sdk/issues/1961)) ([355cd7d](https://github.com/context-dot-dev/context-typescript-sdk/commit/355cd7dc5b406402127c657a81d799ff9915f8e4)) + +## [3.8.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.7.0...v3.8.0) (2026-10-17) + + +### Features + +* **brand:** add search metadata and country and language filters ([#1945](https://github.com/context-dot-dev/context-typescript-sdk/issues/1945)) ([8782f4e](https://github.com/context-dot-dev/context-typescript-sdk/commit/8782f4e71a5f391b1f414fcf587d41219b26a746)) +* **scrape:** add g2-reviews prebuilt parser ([#1933](https://github.com/context-dot-dev/context-typescript-sdk/issues/1933)) ([8d2fa9e](https://github.com/context-dot-dev/context-typescript-sdk/commit/8d2fa9efc4d8925f09c51194f305e32818f0ca3e)) +* **scrape:** add google-maps-reviews prebuilt parser with oldest-first sort ([#1928](https://github.com/context-dot-dev/context-typescript-sdk/issues/1928)) ([30315d0](https://github.com/context-dot-dev/context-typescript-sdk/commit/30315d037ab9024b2efea6e9b8d3337da8afcb03)) +* **scrape:** add Instagram profile, post, and feed prebuilt parsers ([#1905](https://github.com/context-dot-dev/context-typescript-sdk/issues/1905)) ([ae45c50](https://github.com/context-dot-dev/context-typescript-sdk/commit/ae45c503c70bc4903562e7324acc4c76554e7a7f)) +* **search:** add languages filter to web search ([#1833](https://github.com/context-dot-dev/context-typescript-sdk/issues/1833)) ([e07f6c3](https://github.com/context-dot-dev/context-typescript-sdk/commit/e07f6c3c09327a969ca5641cb1eca1cc8cfbaa64)) + +## [3.7.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.6.0...v3.7.0) (2026-10-16) + + +### Features + +* **batch:** support Scrape Anything batches up to 100k URLs ([#1883](https://github.com/context-dot-dev/context-typescript-sdk/issues/1883)) ([c447e68](https://github.com/context-dot-dev/context-typescript-sdk/commit/c447e68b5d39b322d2c159a46938cce67e4c8a16)) +* **scrape:** add App Store app and reviews prebuilt parsers ([#1859](https://github.com/context-dot-dev/context-typescript-sdk/issues/1859)) ([9ea0075](https://github.com/context-dot-dev/context-typescript-sdk/commit/9ea0075732b70dcc403ae6479cd453835471d369)) +* **scrape:** add emails prebuilt parser ([#1862](https://github.com/context-dot-dev/context-typescript-sdk/issues/1862)) ([9ea0075](https://github.com/context-dot-dev/context-typescript-sdk/commit/9ea0075732b70dcc403ae6479cd453835471d369)) +* **scrape:** add Google Play app and reviews prebuilt parsers ([#1857](https://github.com/context-dot-dev/context-typescript-sdk/issues/1857)) ([9ea0075](https://github.com/context-dot-dev/context-typescript-sdk/commit/9ea0075732b70dcc403ae6479cd453835471d369)) +* **scrape:** add links prebuilt parser ([#1865](https://github.com/context-dot-dev/context-typescript-sdk/issues/1865)) ([9ea0075](https://github.com/context-dot-dev/context-typescript-sdk/commit/9ea0075732b70dcc403ae6479cd453835471d369)) +* **scrape:** add phone-numbers prebuilt parser ([#1863](https://github.com/context-dot-dev/context-typescript-sdk/issues/1863)) ([9ea0075](https://github.com/context-dot-dev/context-typescript-sdk/commit/9ea0075732b70dcc403ae6479cd453835471d369)) +* **scrape:** list browser profiles and label them with descriptions ([#1914](https://github.com/context-dot-dev/context-typescript-sdk/issues/1914)) ([9cc6cfc](https://github.com/context-dot-dev/context-typescript-sdk/commit/9cc6cfceebd5ec12c4ee6dccceb2628a8574625a)) +* **search:** allow requesting a single result ([#1880](https://github.com/context-dot-dev/context-typescript-sdk/issues/1880)) ([06afee3](https://github.com/context-dot-dev/context-typescript-sdk/commit/06afee30979ed4ce08b6e2eb9062a06d916296c9)) +* **search:** order company search results by headcount, traffic, funding or founding year ([#1916](https://github.com/context-dot-dev/context-typescript-sdk/issues/1916)) ([9cc6cfc](https://github.com/context-dot-dev/context-typescript-sdk/commit/9cc6cfceebd5ec12c4ee6dccceb2628a8574625a)) + +## [3.6.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.5.0...v3.6.0) (2026-10-14) + + +### Features + +* **scrape:** add login profiles for authenticated scraping ([#1617](https://github.com/context-dot-dev/context-typescript-sdk/issues/1617)) ([af15286](https://github.com/context-dot-dev/context-typescript-sdk/commit/af15286afa9d946c6e27fc9075f685bfc57d70c2)) +* **scrape:** add prebuilt Google Maps parsing ([#1824](https://github.com/context-dot-dev/context-typescript-sdk/issues/1824)) ([f591111](https://github.com/context-dot-dev/context-typescript-sdk/commit/f591111493f9434d35df95249466aaf6bf8f001b)) +* **web-search:** charge markdown per delivered page ([#1729](https://github.com/context-dot-dev/context-typescript-sdk/issues/1729)) ([7969bc9](https://github.com/context-dot-dev/context-typescript-sdk/commit/7969bc95e11a7e77645b7ad3af097c406f9a7e12)) + + +### Documentation + +* demonstrate scraping formats throughout README ([e9b2400](https://github.com/context-dot-dev/context-typescript-sdk/commit/e9b2400177404d9ff436ab86c75135d29c046568)) +* format capability table ([dadbc3a](https://github.com/context-dot-dev/context-typescript-sdk/commit/dadbc3a86d3e4edbafb725a2b56191c23871d096)) +* lead README with Context.dev capabilities ([ea754f3](https://github.com/context-dot-dev/context-typescript-sdk/commit/ea754f3369c731dd8ba95d89ba065efa798dc27e)) +* reconcile custom scraping README with generated examples ([085efb2](https://github.com/context-dot-dev/context-typescript-sdk/commit/085efb2b0b7501f2cf3cc176e4de2e621a46474b)) +* remove Stainless README attribution ([2628c22](https://github.com/context-dot-dev/context-typescript-sdk/commit/2628c22cdc48e011546ba0e0ef45d2e3f7fe8b53)) + +## [3.5.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.4.0...v3.5.0) (2026-10-07) + + +### Features + +* **batches:** keep batch result files for 180 days ([#1638](https://github.com/context-dot-dev/context-typescript-sdk/issues/1638)) ([39fc762](https://github.com/context-dot-dev/context-typescript-sdk/commit/39fc762e0effa24906a76643429273e975eff203)) +* **news:** add Google News sitemap feeds for 52 sites from the NEEDLE 4-star gaps ([#1612](https://github.com/context-dot-dev/context-typescript-sdk/issues/1612)) ([e3ff127](https://github.com/context-dot-dev/context-typescript-sdk/commit/e3ff1272921ff10db0326beae6c2f94582efc04c)) +* **search:** /web/search - for news results extend description with matching passages from article. ([435424d](https://github.com/context-dot-dev/context-typescript-sdk/commit/435424d48a7bb8900febd3146e25a2bd453d2272)) + + +### Bug Fixes + +* **answers:** keep page links for the agent and only cite URLs it actually saw ([#1571](https://github.com/context-dot-dev/context-typescript-sdk/issues/1571)) ([da733ee](https://github.com/context-dot-dev/context-typescript-sdk/commit/da733eed4a52641246d71a24308c8b72094e9a4c)) +* **scrape:** keep the relevant sections of long pages for JSON extraction ([#1582](https://github.com/context-dot-dev/context-typescript-sdk/issues/1582)) ([8891890](https://github.com/context-dot-dev/context-typescript-sdk/commit/8891890369c39d18404d2859a6c181ed14d185bb)) +* **search:** shorter default page-read budget and blocked-page codes for search results ([#1573](https://github.com/context-dot-dev/context-typescript-sdk/issues/1573)) ([429afc2](https://github.com/context-dot-dev/context-typescript-sdk/commit/429afc288ed925f75a5b18a9204a47df0c65f869)) + +## [3.4.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.3.0...v3.4.0) (2026-09-30) + + +### Features + +* **logs:** serve request logs at /org/logs ([#1442](https://github.com/context-dot-dev/context-typescript-sdk/issues/1442)) ([f9b8c6d](https://github.com/context-dot-dev/context-typescript-sdk/commit/f9b8c6db3acad05121e5445207b05af08c69dfd7)) +* **scrape:** accept documents up to 50 MB ([#1436](https://github.com/context-dot-dev/context-typescript-sdk/issues/1436)) ([91e8d5e](https://github.com/context-dot-dev/context-typescript-sdk/commit/91e8d5e529c51b2b66554d877f756acf833a6366)) +* **scrape:** add productParams.dedupeImages, always run product AI fallback ([#1423](https://github.com/context-dot-dev/context-typescript-sdk/issues/1423)) ([889ef20](https://github.com/context-dot-dev/context-typescript-sdk/commit/889ef2055c8ba9e7f956990fe5a9237e2993af82)) +* **scrape:** default POST /web/scrape deadline to 90s ([#1428](https://github.com/context-dot-dev/context-typescript-sdk/issues/1428)) ([bc3912b](https://github.com/context-dot-dev/context-typescript-sdk/commit/bc3912b90e614a3889f8cd0449d6501bbed5c28e)) + + +### Bug Fixes + +* **api:** derive OpenAPI request docs from runtime Zod schemas ([#1421](https://github.com/context-dot-dev/context-typescript-sdk/issues/1421)) ([7020c30](https://github.com/context-dot-dev/context-typescript-sdk/commit/7020c30b863e8b5ecdb669a763ecf378172ff674)) + +## [3.3.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.2.0...v3.3.0) (2026-09-29) + + +### Features + +* **answers:** route people and company research with faster answers ([#1336](https://github.com/context-dot-dev/context-typescript-sdk/issues/1336)) ([8c27f11](https://github.com/context-dot-dev/context-typescript-sdk/commit/8c27f11e9869c560e48733e7eea567bcaac4f68b)) +* **api:** explain failed scrape outputs and fix agent-reported bugs ([#1360](https://github.com/context-dot-dev/context-typescript-sdk/issues/1360)) ([b552101](https://github.com/context-dot-dev/context-typescript-sdk/commit/b552101be2e060deff5ab065ec7dc557bf439f18)) +* **monitors:** support browser actions on page monitors ([#1365](https://github.com/context-dot-dev/context-typescript-sdk/issues/1365)) ([9c4d8c6](https://github.com/context-dot-dev/context-typescript-sdk/commit/9c4d8c6a032ab485a2dacb8e596641e69b910dad)) +* **scrape:** default cache age to three days and allow one year ([#1339](https://github.com/context-dot-dev/context-typescript-sdk/issues/1339)) ([56cf963](https://github.com/context-dot-dev/context-typescript-sdk/commit/56cf963833d23e8e663cea0cb241007b4f4e99f2)) +* **search:** add highlights to web search and bill page reads per 10 results ([#1387](https://github.com/context-dot-dev/context-typescript-sdk/issues/1387)) ([9a4d3cf](https://github.com/context-dot-dev/context-typescript-sdk/commit/9a4d3cfbd20e9181b84b5b60079cc232f0b94ae0)) +* **web-search:** extend page cache defaults ([#1408](https://github.com/context-dot-dev/context-typescript-sdk/issues/1408)) ([47f5a8e](https://github.com/context-dot-dev/context-typescript-sdk/commit/47f5a8e7dda03ff3d4507d3e45030d2e05ec3a69)) + + +### Bug Fixes + +* **api:** document search domain limits and clarify scrape parameter errors ([#1388](https://github.com/context-dot-dev/context-typescript-sdk/issues/1388)) ([d5f9ce1](https://github.com/context-dot-dev/context-typescript-sdk/commit/d5f9ce1b09edf45122372dfcbd1cebaa6108b90e)) +* **scrape:** resolve extracted URLs from source references ([#1333](https://github.com/context-dot-dev/context-typescript-sdk/issues/1333)) ([51b131b](https://github.com/context-dot-dev/context-typescript-sdk/commit/51b131b2c12a8903abeca139a66c070c64040304)) + + +### Documentation + +* **openapi:** complete concise API reference metadata ([#1329](https://github.com/context-dot-dev/context-typescript-sdk/issues/1329)) ([790d1f4](https://github.com/context-dot-dev/context-typescript-sdk/commit/790d1f42e0cd523501a3e7d038be664c64929765)) +* **scrape:** rename endpoint to Scrape Anything ([#1341](https://github.com/context-dot-dev/context-typescript-sdk/issues/1341)) ([84ace2a](https://github.com/context-dot-dev/context-typescript-sdk/commit/84ace2adbccb99145ab5930a3cca20aa6b71eeb7)) + +## [3.2.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.1.0...v3.2.0) (2026-09-27) + + +### Features + +* **feedback:** add agent feedback endpoint ([#1322](https://github.com/context-dot-dev/context-typescript-sdk/issues/1322)) ([ccf8f08](https://github.com/context-dot-dev/context-typescript-sdk/commit/ccf8f08cec4db47eea9b49e3623fd375377f5b75)) +* **highlights:** preserve Markdown structure in scrape excerpts ([#1236](https://github.com/context-dot-dev/context-typescript-sdk/issues/1236)) ([503abec](https://github.com/context-dot-dev/context-typescript-sdk/commit/503abec171290eaab2c4fa97bfacffd28d4e70f3)) +* **scrape:** enable highlights with zero data retention ([#1246](https://github.com/context-dot-dev/context-typescript-sdk/issues/1246)) ([abfa08c](https://github.com/context-dot-dev/context-typescript-sdk/commit/abfa08c189f56daa91f53fd53fbf1b29ad58322d)) + + +### Bug Fixes + +* **openapi:** document exclusive news filters ([#1265](https://github.com/context-dot-dev/context-typescript-sdk/issues/1265)) ([b3b4267](https://github.com/context-dot-dev/context-typescript-sdk/commit/b3b4267a2b4452dc71546243888dc1333e30ef19)) +* **scrape:** only flag partial success when a requested format succeeds ([#1325](https://github.com/context-dot-dev/context-typescript-sdk/issues/1325)) ([b6d8483](https://github.com/context-dot-dev/context-typescript-sdk/commit/b6d848326f79ce7333f0299540976933420057d2)) +* **scrape:** preserve successful formats when other outputs fail ([#1263](https://github.com/context-dot-dev/context-typescript-sdk/issues/1263)) ([a31d02e](https://github.com/context-dot-dev/context-typescript-sdk/commit/a31d02e8c30a229cfd8b0fa0f3aa79ed9f301f10)) +* **scrape:** retain highlight headings only when needed ([#1245](https://github.com/context-dot-dev/context-typescript-sdk/issues/1245)) ([54b38a5](https://github.com/context-dot-dev/context-typescript-sdk/commit/54b38a5dec14bd25540894b112826262d175c620)) + +## [3.1.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v3.0.0...v3.1.0) (2026-09-23) + + +### Features + +* **scrape:** add highlights format to POST /web/scrape ([#1210](https://github.com/context-dot-dev/context-typescript-sdk/issues/1210)) ([9a81729](https://github.com/context-dot-dev/context-typescript-sdk/commit/9a81729963bc7af20ab82498143b593f070adaeb)) +* **scrape:** add json output format to POST /web/scrape ([#1213](https://github.com/context-dot-dev/context-typescript-sdk/issues/1213)) ([7f96676](https://github.com/context-dot-dev/context-typescript-sdk/commit/7f966761a10434baa0a66aceb24725d227f71b16)) +* **scrape:** add product extraction format to POST /web/scrape ([#1212](https://github.com/context-dot-dev/context-typescript-sdk/issues/1212)) ([21edbde](https://github.com/context-dot-dev/context-typescript-sdk/commit/21edbde24214379f9a20b11366b3e298ff4df407)) + +## [3.0.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.19.0...v3.0.0) (2026-09-22) + + +### Features + +* **billing:** charge for 404s and skip fraud accounting ([#1152](https://github.com/context-dot-dev/context-typescript-sdk/issues/1152)) ([b0a4aa5](https://github.com/context-dot-dev/context-typescript-sdk/commit/b0a4aa52533b83f905218d84976494c1dd931d1e)) +* **scrape:** add cache age support to byte downloads ([#1171](https://github.com/context-dot-dev/context-typescript-sdk/issues/1171)) ([477940d](https://github.com/context-dot-dev/context-typescript-sdk/commit/477940dccfff3cf4b2265d56dc7b15c95d232c1a)) +* **scrape:** add unified scrape API ([#1182](https://github.com/context-dot-dev/context-typescript-sdk/issues/1182)) ([3c92f39](https://github.com/context-dot-dev/context-typescript-sdk/commit/3c92f39ccd9d60820af5874e866fcc8058a9f2d5)) +* **scrape:** align timeout options and public SDK methods ([#1207](https://github.com/context-dot-dev/context-typescript-sdk/issues/1207)) ([bb950e7](https://github.com/context-dot-dev/context-typescript-sdk/commit/bb950e714a482b50d540a8abceea92fddf3e6678)) +* **scrape:** support country for image scraping ([#1172](https://github.com/context-dot-dev/context-typescript-sdk/issues/1172)) ([477940d](https://github.com/context-dot-dev/context-typescript-sdk/commit/477940dccfff3cf4b2265d56dc7b15c95d232c1a)) +* **scrape:** support custom screenshot headers ([#1169](https://github.com/context-dot-dev/context-typescript-sdk/issues/1169)) ([bacbc64](https://github.com/context-dot-dev/context-typescript-sdk/commit/bacbc64bb21b56f6c87926729af62731e1cd3e84)) +* **scrape:** support waitForMs for byte downloads ([#1170](https://github.com/context-dot-dev/context-typescript-sdk/issues/1170)) ([47c18a0](https://github.com/context-dot-dev/context-typescript-sdk/commit/47c18a0b11c00a6f697abb99a2e79795736d3143)) + + +### Bug Fixes + +* **scrape:** reuse legacy caches across all output formats ([#1197](https://github.com/context-dot-dev/context-typescript-sdk/issues/1197)) ([57dd03d](https://github.com/context-dot-dev/context-typescript-sdk/commit/57dd03dd18f93840faf239efdaeeca8a8f6fbaec)) + +## [2.19.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.18.1...v2.19.0) (2026-09-18) + + +### Features + +* **api:** enable ZDR on remaining AI endpoints via OpenAI ([#1099](https://github.com/context-dot-dev/context-typescript-sdk/issues/1099)) ([9147c49](https://github.com/context-dot-dev/context-typescript-sdk/commit/9147c496af2bc72c4be185abe6dc01c91ca4fdf3)) +* **products:** extract ProductGroup variants with images ([#1124](https://github.com/context-dot-dev/context-typescript-sdk/issues/1124)) ([9a80da2](https://github.com/context-dot-dev/context-typescript-sdk/commit/9a80da2aed02602d5ef7ab2bff03eff440753680)) +* **scrape:** add CSS extraction rules to HTML scraping ([#1146](https://github.com/context-dot-dev/context-typescript-sdk/issues/1146)) ([c5235fc](https://github.com/context-dot-dev/context-typescript-sdk/commit/c5235fc82b2d2abff938d25175aa6d1152d0f867)) +* **web:** add URL-based scrape screenshot endpoint ([#1150](https://github.com/context-dot-dev/context-typescript-sdk/issues/1150)) ([6c7cd79](https://github.com/context-dot-dev/context-typescript-sdk/commit/6c7cd7998646feca5d8bdecee63e35c9383de7d8)) + + +### Bug Fixes + +* **api:** lower partial scrape timeout minimum to five seconds ([#1118](https://github.com/context-dot-dev/context-typescript-sdk/issues/1118)) ([2baeba3](https://github.com/context-dot-dev/context-typescript-sdk/commit/2baeba3bf88170a1e6c6c877d2a4758392202f01)) + +## [2.18.1](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.18.0...v2.18.1) (2026-09-15) + + +### Bug Fixes + +* **api:** guarantee search descriptions and align response types ([#1089](https://github.com/context-dot-dev/context-typescript-sdk/issues/1089)) ([9f55749](https://github.com/context-dot-dev/context-typescript-sdk/commit/9f55749869ff8149d1458357b11e55976519e590)) + +## [2.18.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.17.0...v2.18.0) (2026-09-15) + + +### Features + +* **answers:** add live web research with fast and ultra modes ([#954](https://github.com/context-dot-dev/context-typescript-sdk/issues/954)) ([8d9f488](https://github.com/context-dot-dev/context-typescript-sdk/commit/8d9f4882f87378e63dcfd8737e067c9b17770406)) +* **api-keys:** enforce scoped API key permissions ([#1038](https://github.com/context-dot-dev/context-typescript-sdk/issues/1038)) ([de5e60d](https://github.com/context-dot-dev/context-typescript-sdk/commit/de5e60dcc85e3754302cec35060cffe8c238cd8a)) +* **api:** unify timeout configuration and return partial results ([#1030](https://github.com/context-dot-dev/context-typescript-sdk/issues/1030)) ([b8e4d37](https://github.com/context-dot-dev/context-typescript-sdk/commit/b8e4d371a307f5f7effc7984cc3e6f458d9ab5fa)) +* **monitors:** add page selector filters ([#1037](https://github.com/context-dot-dev/context-typescript-sdk/issues/1037)) ([25fd26d](https://github.com/context-dot-dev/context-typescript-sdk/commit/25fd26d00df62cd2bc4fc04f246940494e07828b)) +* **web:** add raw bytes scraping endpoint ([#1081](https://github.com/context-dot-dev/context-typescript-sdk/issues/1081)) ([dec6eb8](https://github.com/context-dot-dev/context-typescript-sdk/commit/dec6eb854b4c25592a3c6eeb065e195417ab4cb4)) + + +### Bug Fixes + +* **api:** honour maxAgeMs=0 on brand retrieve, styleguide and fonts endpoints ([#998](https://github.com/context-dot-dev/context-typescript-sdk/issues/998)) ([503a20e](https://github.com/context-dot-dev/context-typescript-sdk/commit/503a20ed84b09182432bc164c2d4bfe6ca386505)) +* **security:** consolidate dependency updates and harden public fetches ([#1040](https://github.com/context-dot-dev/context-typescript-sdk/issues/1040)) ([db2c906](https://github.com/context-dot-dev/context-typescript-sdk/commit/db2c9065d92e20c8db5dac07c65e5b1fd289e798)) +* **webhooks:** format Slack webhook notifications ([#1045](https://github.com/context-dot-dev/context-typescript-sdk/issues/1045)) ([9615345](https://github.com/context-dot-dev/context-typescript-sdk/commit/961534544b1fd85fdc351be36d7f8a4ba54b5da7)) + +## [2.17.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.16.0...v2.17.0) (2026-09-11) + + +### Features + +* **api:** return request_id on every response ([37e1f63](https://github.com/context-dot-dev/context-typescript-sdk/commit/37e1f63aeea80c7ece0a33029864fe2dd40637c4)) +* **logs:** expose request log endpoints in SDKs ([#1025](https://github.com/context-dot-dev/context-typescript-sdk/issues/1025)) ([ca7e22a](https://github.com/context-dot-dev/context-typescript-sdk/commit/ca7e22a3ba12d75961d940fb81d8a36ead6ea761)) + + +### Bug Fixes + +* **api:** reject timeoutMS too short for waitForMs ([a46905a](https://github.com/context-dot-dev/context-typescript-sdk/commit/a46905a650e7d357657b9d27cfca7cf9b784576f)) + +## [2.16.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.15.0...v2.16.0) (2026-09-08) + + +### Features + +* **webhooks:** add configurable retries and manual replay ([da20ddb](https://github.com/context-dot-dev/context-typescript-sdk/commit/da20ddbcc80c966aaed048ddb3bef70e5c2d8e8e)) +* **webhooks:** simplify delivery APIs ([680fd86](https://github.com/context-dot-dev/context-typescript-sdk/commit/680fd86d86fc05ec1d0f0a7bb5993b13834bdb70)) + +## [2.15.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.14.0...v2.15.0) (2026-09-03) + + +### Features + +* **sitemap:** add subdomain discovery ([dcd655a](https://github.com/context-dot-dev/context-typescript-sdk/commit/dcd655aa389a76d728842ca17437222cb67ed4b2)) + + +### Bug Fixes + +* **openapi:** strip empty-object defaults from the generated spec ([01a5153](https://github.com/context-dot-dev/context-typescript-sdk/commit/01a515383a6d31d619cb1217911d659c9a52ff21)) + ## [2.14.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.13.0...v2.14.0) (2026-08-27) diff --git a/README.md b/README.md index edfa7cc5..16f1e614 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,11 @@ -# Context Dev TypeScript API Library +# Context.dev TypeScript SDK API Library [![NPM version]()](https://npmjs.org/package/context.dev) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/context.dev) -This library provides convenient access to the Context Dev REST API from server-side TypeScript or JavaScript. +Context.dev is a web scraping API for AI agents and LLMs. This SDK turns any URL into clean, LLM-ready markdown, crawls whole sites, searches the web, takes screenshots and extracts structured JSON against a schema you define, all with one API key. Proxies, JavaScript rendering and anti-bot handling run on Context.dev's side, so there is no headless browser to host. The REST API documentation can be found on [docs.context.dev](https://docs.context.dev/). The full API of this library can be found in [api.md](api.md). -It is generated with [Stainless](https://www.stainless.com/). - -## MCP Server - -Use the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. - -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D) - -> Note: You may need to set environment variables in your MCP client. - ## Installation ```sh @@ -25,21 +14,103 @@ npm install context.dev ## Usage +Set `CONTEXT_DEV_API_KEY` to your API key; the client reads it automatically. + +### Scrape markdown and HTML + The full API of this library can be found in [api.md](api.md). -```js +```ts import ContextDev from 'context.dev'; -const client = new ContextDev({ - apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted +const client = new ContextDev(); + +const page = await client.web.scrape({ + url: 'https://example.com', + formats: { markdown: true, html: true }, +}); + +console.log(page.markdown.data); +console.log(page.html.data); +``` + +### Extract structured JSON + +`jsonParams.schema` accepts JSON Schema; install Zod 4 (`npm install zod@^4`) to build a schema with Zod and convert it with `z.toJSONSchema`. + +```ts +import ContextDev from 'context.dev'; +import { z } from 'zod'; + +const client = new ContextDev(); +const pageSchema = z.object({ + title: z.string().nullable(), + description: z.string().nullable(), +}); + +const page = await client.web.scrape({ + url: 'https://example.com', + formats: { json: true }, + jsonParams: { schema: z.toJSONSchema(pageSchema) }, }); -const brand = await client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }); +console.log(page.json.data); +``` + +### Extract relevant highlights -console.log(brand.cache_metadata); +Return the passages that answer a question about the page. + +```ts +import ContextDev from 'context.dev'; + +const client = new ContextDev(); + +const page = await client.web.scrape({ + url: 'https://example.com', + formats: { highlights: true }, + highlightsParams: { query: 'What is this domain used for?' }, +}); + +console.log(page.highlights.data); ``` +### Take a screenshot + +The screenshot is returned as a base64 image data URL. + +```ts +import ContextDev from 'context.dev'; + +const client = new ContextDev(); + +const page = await client.web.scrape({ + url: 'https://example.com', + formats: { screenshot: true }, +}); + +console.log(page.screenshot.data); +``` + +## What you can do + +| Task | Method | +| ---------------------------------------------------------------- | ------------------------ | +| Scrape a URL to markdown, HTML, JSON, highlights or a screenshot | `client.web.scrape` | +| Crawl a site and get every page as markdown | `client.web.webCrawlMd` | +| Map every URL on a domain | `client.web.mapUrls` | +| Search the web | `client.web.search` | +| Take a screenshot of a page | `client.web.screenshot` | +| Parse PDFs and documents | `client.parse.handle` | +| Run thousands of URLs as a batch | `client.batch.submit` | +| Watch a page for changes | `client.monitors.create` | +| Look up a company's logo, colors and brand data | `client.brand.retrieve` | + +## Use it from an AI agent + +Context.dev also ships as a plugin for [Claude](https://github.com/context-dot-dev/claude-plugin), [Cursor](https://github.com/context-dot-dev/cursor-plugin) and [Gemini CLI](https://github.com/context-dot-dev/gemini-cli-context), and as tools for [LangChain](https://github.com/context-dot-dev/langchain-context) and [Haystack](https://github.com/context-dot-dev/context-haystack). + ### Request & Response types This library includes TypeScript definitions for all request params and response fields. You may import and use them like so: @@ -52,8 +123,8 @@ const client = new ContextDev({ apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted }); -const params: ContextDev.BrandRetrieveParams = { domain: 'REPLACE_ME', type: 'by_domain' }; -const brand: ContextDev.BrandRetrieveResponse = await client.brand.retrieve(params); +const params: ContextDev.WebScrapeParams = { url: 'https://example.com', formats: { markdown: true } }; +const page: ContextDev.WebScrapeResponse = await client.web.scrape(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. @@ -66,8 +137,8 @@ a subclass of `APIError` will be thrown: ```ts -const brand = await client.brand - .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }) +const page = await client.web + .scrape({ url: 'https://example.com', formats: { markdown: true } }) .catch(async (err) => { if (err instanceof ContextDev.APIError) { console.log(err.status); // 400 @@ -108,7 +179,7 @@ const client = new ContextDev({ }); // Or, configure per-request: -await client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }, { +await client.web.scrape({ url: 'https://example.com', formats: { markdown: true } }, { maxRetries: 5, }); ``` @@ -125,7 +196,7 @@ const client = new ContextDev({ }); // Override per-request: -await client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }, { +await client.web.scrape({ url: 'https://example.com', formats: { markdown: true } }, { timeout: 5 * 1000, }); ``` @@ -148,17 +219,17 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse ```ts const client = new ContextDev(); -const response = await client.brand - .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }) +const response = await client.web + .scrape({ url: 'https://example.com', formats: { markdown: true } }) .asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object -const { data: brand, response: raw } = await client.brand - .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }) +const { data: page, response: raw } = await client.web + .scrape({ url: 'https://example.com', formats: { markdown: true } }) .withResponse(); console.log(raw.headers.get('X-My-Header')); -console.log(brand.cache_metadata); +console.log(page.markdown.data); ``` ### Logging @@ -238,8 +309,9 @@ parameter. This library doesn't validate at runtime that the request matches the send will be sent as-is. ```ts -client.brand.retrieve({ - // ... +client.web.scrape({ + url: 'https://example.com', + formats: { markdown: true }, // @ts-expect-error baz is not yet public baz: 'undocumented option', }); diff --git a/api.md b/api.md index 725e8f12..c717263b 100644 --- a/api.md +++ b/api.md @@ -12,56 +12,36 @@ Methods: Types: -- WebExtractResponse +- WebAnswersResponse - WebExtractCompetitorsResponse -- WebExtractFontsResponse - WebExtractStyleguideResponse +- WebMapURLsResponse +- WebScrapeResponse - WebScreenshotResponse - WebSearchResponse - WebWebCrawlMdResponse -- WebWebScrapeHTMLResponse -- WebWebScrapeImagesResponse -- WebWebScrapeMdResponse -- WebWebScrapeSitemapResponse Methods: -- client.web.extract({ ...params }) -> WebExtractResponse +- client.web.answers({ ...params }) -> WebAnswersResponse - client.web.extractCompetitors({ ...params }) -> WebExtractCompetitorsResponse -- client.web.extractFonts({ ...params }) -> WebExtractFontsResponse - client.web.extractStyleguide({ ...params }) -> WebExtractStyleguideResponse +- client.web.mapUrls({ ...params }) -> WebMapURLsResponse +- client.web.scrape({ ...params }) -> WebScrapeResponse - client.web.screenshot({ ...params }) -> WebScreenshotResponse - client.web.search({ ...params }) -> WebSearchResponse - client.web.webCrawlMd({ ...params }) -> WebWebCrawlMdResponse -- client.web.webScrapeHTML({ ...params }) -> WebWebScrapeHTMLResponse -- client.web.webScrapeImages({ ...params }) -> WebWebScrapeImagesResponse -- client.web.webScrapeMd({ ...params }) -> WebWebScrapeMdResponse -- client.web.webScrapeSitemap({ ...params }) -> WebWebScrapeSitemapResponse - -# AI - -Types: - -- AIExtractProductResponse -- AIExtractProductsResponse - -Methods: - -- client.ai.extractProduct({ ...params }) -> AIExtractProductResponse -- client.ai.extractProducts({ ...params }) -> AIExtractProductsResponse # Brand Types: - BrandRetrieveResponse -- BrandRetrieveSimplifiedResponse - BrandSearchResponse Methods: - client.brand.retrieve({ ...params }) -> BrandRetrieveResponse -- client.brand.retrieveSimplified({ ...params }) -> BrandRetrieveSimplifiedResponse - client.brand.search({ ...params }) -> BrandSearchResponse # Industry @@ -103,6 +83,8 @@ Types: - MonitorListChangesResponse - MonitorListRunsResponse - MonitorRetrieveChangeResponse +- MonitorRetrieveRunResponse +- MonitorRotateWebhookSecretResponse - MonitorRunResponse Methods: @@ -119,6 +101,8 @@ Methods: - client.monitors.listChanges(monitorID, { ...params }) -> MonitorListChangesResponse - client.monitors.listRuns(monitorID, { ...params }) -> MonitorListRunsResponse - client.monitors.retrieveChange(changeID) -> MonitorRetrieveChangeResponse +- client.monitors.retrieveRun(runID, { ...params }) -> MonitorRetrieveRunResponse +- client.monitors.rotateWebhookSecret(monitorID) -> MonitorRotateWebhookSecretResponse - client.monitors.run(monitorID) -> MonitorRunResponse # Batch @@ -145,15 +129,42 @@ Methods: - client.batch.getResults(batchID, { ...params }) -> BatchGetResultsResponse - client.batch.submit({ ...params }) -> BatchSubmitResponse +# Webhooks + +Types: + +- RetryConfig + +## Deliveries + +Types: + +- Attempt +- Delivery +- DeliverySummary +- DeliveryRetrieveResponse +- DeliveryListResponse +- DeliveryListAttemptsResponse +- DeliveryRetryResponse + +Methods: + +- client.webhooks.deliveries.retrieve(deliveryID, { ...params }) -> DeliveryRetrieveResponse +- client.webhooks.deliveries.list({ ...params }) -> DeliveryListResponse +- client.webhooks.deliveries.listAttempts(deliveryID, { ...params }) -> DeliveryListAttemptsResponse +- client.webhooks.deliveries.retry(deliveryID, { ...params }) -> DeliveryRetryResponse + # People Types: - PersonEnrichResponse +- PersonSearchResponse Methods: - client.people.enrich({ ...params }) -> PersonEnrichResponse +- client.people.search({ ...params }) -> PersonSearchResponse # News @@ -164,3 +175,37 @@ Types: Methods: - client.news.search({ ...params }) -> NewsSearchResponse + +# Logs + +Types: + +- LogRetrieveResponse +- LogListResponse + +Methods: + +- client.logs.retrieve(requestID) -> LogRetrieveResponse +- client.logs.list({ ...params }) -> LogListResponse + +# Browser + +## Profiles + +Types: + +- ProfileListResponse + +Methods: + +- client.browser.profiles.list({ ...params }) -> ProfileListResponse + +# Feedback + +Types: + +- FeedbackSubmitResponse + +Methods: + +- client.feedback.submit({ ...params }) -> FeedbackSubmitResponse diff --git a/eslint.config.mjs b/eslint.config.mjs index 18b8b5ae..2712a3e0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,7 +31,7 @@ export default tseslint.config( }, }, { - files: ['tests/**', 'examples/**', 'packages/**'], + files: ['tests/**', 'examples/**'], rules: { 'no-restricted-imports': 'off', }, diff --git a/package.json b/package.json index ee79d4ce..95c6843a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "context.dev", - "version": "2.14.0", + "version": "3.30.0", "description": "The official TypeScript library for the Context Dev API", "author": "Context Dev ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/Dockerfile b/packages/mcp-server/Dockerfile deleted file mode 100644 index a3140e2f..00000000 --- a/packages/mcp-server/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -# Dockerfile for Context Dev MCP Server -# -# This Dockerfile builds a Docker image for the MCP Server. -# -# To build the image locally: -# docker build -f packages/mcp-server/Dockerfile -t context.dev-mcp:local . -# -# To run the image: -# docker run -i context.dev-mcp:local [OPTIONS] -# -# Common options: -# --tool= Include specific tools -# --resource= Include tools for specific resources -# --operation=read|write Filter by operation type -# --client= Set client compatibility (e.g., claude, cursor) -# --transport= Set transport type (stdio or http) -# -# For a full list of options: -# docker run -i context.dev-mcp:local --help -# -# Note: The MCP server uses stdio transport by default. Docker's -i flag -# enables interactive mode, allowing the container to communicate over stdin/stdout. - -# Build stage -FROM node:24-alpine AS builder - -# Install bash for build script -RUN apk add --no-cache bash openssl - -# Set working directory -WORKDIR /build - -# Copy entire repository -COPY . . - -# Install all dependencies and build everything -RUN yarn install --frozen-lockfile && \ - yarn build && \ - # Remove the symlink to the SDK so it doesn't interfere with the explicit COPY below - rm -Rf packages/mcp-server/node_modules/context.dev - -FROM denoland/deno:alpine-2.7.1 - -# Install node and npm -RUN apk add --no-cache nodejs npm - -ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib - -# Add non-root user -RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001 - -# Set working directory -WORKDIR /app - -# Copy the built mcp-server dist directory -COPY --from=builder /build/packages/mcp-server/dist ./ - -# Copy node_modules from mcp-server (includes all production deps) -COPY --from=builder /build/packages/mcp-server/node_modules ./node_modules - -# Copy the built context.dev into node_modules -COPY --from=builder /build/dist ./node_modules/context.dev - -# Change ownership to nodejs user -RUN chown -R nodejs:nodejs /app -RUN chown -R nodejs:nodejs /deno-dir - -# Switch to non-root user -USER nodejs - -# The MCP server uses stdio transport by default -# No exposed ports needed for stdio communication - -# Set the entrypoint to the MCP server -ENTRYPOINT ["node", "index.js"] - -# Allow passing arguments to the MCP server -CMD [] diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md deleted file mode 100644 index e1b2506f..00000000 --- a/packages/mcp-server/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# Context Dev TypeScript MCP Server - -It is generated with [Stainless](https://www.stainless.com/). - -## Installation - -### Direct invocation - -You can run the MCP Server directly via `npx`: - -```sh -export CONTEXT_DEV_API_KEY="My API Key" -npx -y context.dev-mcp@latest -``` - -### Via MCP Client - -There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already -have a client, consult their documentation to install the MCP server. - -For clients with a configuration JSON, it might look something like this: - -```json -{ - "mcpServers": { - "context_dev_api": { - "command": "npx", - "args": ["-y", "context.dev-mcp"], - "env": { - "CONTEXT_DEV_API_KEY": "My API Key" - } - } - } -} -``` - -### Cursor - -If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables -in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server. - -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0) - -### VS Code - -If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables -in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration. - -[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D) - -### Claude Code - -If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your -environment variables in Claude Code's `.claude.json`, which can be found in your home directory. - -``` -claude mcp add context.dev_mcp_api --env CONTEXT_DEV_API_KEY="My API Key" -- npx -y context.dev-mcp -``` - -## Code Mode - -This MCP server is built on the "Code Mode" tool scheme. In this MCP Server, -your agent will write code against the TypeScript SDK, which will then be executed in an -isolated sandbox. To accomplish this, the server will expose two tools to your agent: - -- The first tool is a docs search tool, which can be used to generically query for - documentation about your API/SDK. - -- The second tool is a code tool, where the agent can write code against the TypeScript SDK. - The code will be executed in a sandbox environment without web or filesystem access. Then, - anything the code returns or prints will be returned to the agent as the result of the - tool call. - -Using this scheme, agents are capable of performing very complex tasks deterministically -and repeatably. - -## Running remotely - -Launching the client with `--transport=http` launches the server as a remote server using Streamable HTTP transport. The `--port` setting can choose the port it will run on, and the `--socket` setting allows it to run on a Unix socket. - -Authorization can be provided via the `Authorization` header using the Bearer scheme. - -Additionally, authorization can be provided via the following headers: -| Header | Equivalent client option | Security scheme | -| ----------------------- | ------------------------ | --------------- | -| `x-context-dev-api-key` | `apiKey` | bearerAuth | - -A configuration JSON for this server might look like this, assuming the server is hosted at `http://localhost:3000`: - -```json -{ - "mcpServers": { - "context_dev_api": { - "url": "http://localhost:3000", - "headers": { - "Authorization": "Bearer " - } - } - } -} -``` diff --git a/packages/mcp-server/build b/packages/mcp-server/build deleted file mode 100644 index 7772183c..00000000 --- a/packages/mcp-server/build +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash -set -exuo pipefail - -rm -rf dist; mkdir dist - -# Copy src to dist/src and build from dist/src into dist, so that -# the source map for index.js.map will refer to ./src/index.ts etc -cp -rp src README.md dist - -for file in LICENSE; do - if [ -e "../../${file}" ]; then cp "../../${file}" dist; fi -done - -for file in CHANGELOG.md; do - if [ -e "${file}" ]; then cp "${file}" dist; fi -done - -# this converts the export map paths for the dist directory -# and does a few other minor things -PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist/package.json - -# updates the `context.dev` dependency to point to NPM -node scripts/postprocess-dist-package-json.cjs - -# build to .js/.mjs/.d.ts files -./node_modules/.bin/tsc-multi - -cp tsconfig.dist-src.json dist/src/tsconfig.json - -chmod +x dist/index.js - -DIST_PATH=./dist PKG_IMPORT_PATH=context.dev-mcp/ node ../../scripts/utils/postprocess-files.cjs - -# mcp bundle -rm -rf dist-bundle context_dev_api.mcpb; mkdir dist-bundle - -# copy package.json -PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist-bundle/package.json - -# copy files -node scripts/copy-bundle-files.cjs - -# install runtime deps -cd dist-bundle -npm install -cd .. - -# pack bundle -cp manifest.json dist-bundle - -npx mcpb pack dist-bundle context_dev_api.mcpb - -npx mcpb sign context_dev_api.mcpb --self-signed - -# clean up -rm -rf dist-bundle diff --git a/packages/mcp-server/jest.config.ts b/packages/mcp-server/jest.config.ts deleted file mode 100644 index 6935ead2..00000000 --- a/packages/mcp-server/jest.config.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { JestConfigWithTsJest } from 'ts-jest'; - -const config: JestConfigWithTsJest = { - preset: 'ts-jest/presets/default-esm', - testEnvironment: 'node', - transform: { - '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], - }, - moduleNameMapper: { - '^context.dev-mcp$': '/src/index.ts', - '^context.dev-mcp/(.*)$': '/src/$1', - }, - modulePathIgnorePatterns: ['/dist/'], - testPathIgnorePatterns: ['scripts'], -}; - -export default config; diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json deleted file mode 100644 index a922fa45..00000000 --- a/packages/mcp-server/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "dxt_version": "0.2", - "name": "context.dev-mcp", - "version": "2.14.0", - "description": "The official MCP Server for the Context Dev API", - "author": { - "name": "Context Dev", - "email": "hello@context.dev" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/context-dot-dev/context-typescript-sdk.git" - }, - "homepage": "https://github.com/context-dot-dev/context-typescript-sdk/tree/main/packages/mcp-server#readme", - "documentation": "https://docs.context.dev/", - "server": { - "type": "node", - "entry_point": "index.js", - "mcp_config": { - "command": "node", - "args": [ - "${__dirname}/index.js" - ], - "env": { - "CONTEXT_DEV_API_KEY": "${user_config.CONTEXT_DEV_API_KEY}" - } - } - }, - "user_config": { - "CONTEXT_DEV_API_KEY": { - "title": "api_key", - "description": "", - "required": true, - "type": "string" - } - }, - "tools": [], - "tools_generated": true, - "compatibility": { - "runtimes": { - "node": ">=18.0.0" - } - }, - "keywords": [ - "api" - ] -} diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json deleted file mode 100644 index 25a509b8..00000000 --- a/packages/mcp-server/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "context.dev-mcp", - "version": "2.14.0", - "description": "The official MCP Server for the Context Dev API", - "author": "Context Dev ", - "types": "dist/index.d.ts", - "main": "dist/index.js", - "type": "commonjs", - "repository": { - "type": "git", - "url": "git+https://github.com/context-dot-dev/context-typescript-sdk.git", - "directory": "packages/mcp-server" - }, - "homepage": "https://github.com/context-dot-dev/context-typescript-sdk/tree/main/packages/mcp-server#readme", - "license": "Apache-2.0", - "packageManager": "yarn@1.22.22", - "private": false, - "publishConfig": { - "access": "public" - }, - "scripts": { - "test": "jest", - "build": "bash ./build", - "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", - "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", - "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "npm run build", - "tsn": "ts-node -r tsconfig-paths/register", - "lint": "eslint .", - "fix": "eslint --fix ." - }, - "dependencies": { - "context.dev": "link:../../dist/", - "ajv": "^8.18.0", - "@cloudflare/cabidela": "^0.2.4", - "@hono/node-server": "^1.19.10", - "@modelcontextprotocol/sdk": "^1.27.1", - "hono": "^4.12.4", - "@valtown/deno-http-worker": "^0.0.21", - "cookie-parser": "^1.4.6", - "cors": "^2.8.5", - "express": "^5.1.0", - "fuse.js": "^7.1.0", - "minisearch": "^7.2.0", - "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz", - "pino": "^10.3.1", - "pino-http": "^11.0.0", - "pino-pretty": "^13.1.3", - "qs": "^6.14.1", - "typescript": "5.8.3", - "yargs": "^17.7.2", - "zod": "^3.25.20", - "zod-to-json-schema": "^3.24.5", - "zod-validation-error": "^4.0.1" - }, - "bin": { - "mcp-server": "dist/index.js" - }, - "devDependencies": { - "@anthropic-ai/mcpb": "^2.1.2", - "@types/cookie-parser": "^1.4.10", - "@types/cors": "^2.8.19", - "@types/express": "^5.0.3", - "@types/jest": "^29.4.0", - "@types/qs": "^6.14.0", - "@types/yargs": "^17.0.8", - "@typescript-eslint/eslint-plugin": "8.31.1", - "@typescript-eslint/parser": "8.31.1", - "eslint": "^9.39.1", - "eslint-plugin-prettier": "^5.4.1", - "eslint-plugin-unused-imports": "^4.1.4", - "jest": "^29.4.0", - "prettier": "^3.0.0", - "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", - "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz", - "tsconfig-paths": "^4.0.0" - }, - "imports": { - "context.dev-mcp": ".", - "context.dev-mcp/*": "./src/*" - }, - "exports": { - ".": { - "require": "./dist/index.js", - "default": "./dist/index.mjs" - }, - "./*.mjs": "./dist/*.mjs", - "./*.js": "./dist/*.js", - "./*": { - "require": "./dist/*.js", - "default": "./dist/*.mjs" - } - } -} diff --git a/packages/mcp-server/scripts/copy-bundle-files.cjs b/packages/mcp-server/scripts/copy-bundle-files.cjs deleted file mode 100644 index 5681886c..00000000 --- a/packages/mcp-server/scripts/copy-bundle-files.cjs +++ /dev/null @@ -1,36 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const pkgJson = require('../dist-bundle/package.json'); - -const distDir = path.resolve(__dirname, '..', 'dist'); -const distBundleDir = path.resolve(__dirname, '..', 'dist-bundle'); -const distBundlePkgJson = path.join(distBundleDir, 'package.json'); - -async function* walk(dir) { - for await (const d of await fs.promises.opendir(dir)) { - const entry = path.join(dir, d.name); - if (d.isDirectory()) yield* walk(entry); - else if (d.isFile()) yield entry; - } -} - -async function copyFiles() { - // copy runtime files - for await (const file of walk(distDir)) { - if (!/[cm]?js$/.test(file)) continue; - const dest = path.join(distBundleDir, path.relative(distDir, file)); - await fs.promises.mkdir(path.dirname(dest), { recursive: true }); - await fs.promises.copyFile(file, dest); - } - - // replace package.json reference with local reference - for (const dep in pkgJson.dependencies) { - if (dep === 'context.dev') { - pkgJson.dependencies[dep] = 'file:../../../dist/'; - } - } - - await fs.promises.writeFile(distBundlePkgJson, JSON.stringify(pkgJson, null, 2)); -} - -copyFiles(); diff --git a/packages/mcp-server/scripts/postprocess-dist-package-json.cjs b/packages/mcp-server/scripts/postprocess-dist-package-json.cjs deleted file mode 100644 index da147f99..00000000 --- a/packages/mcp-server/scripts/postprocess-dist-package-json.cjs +++ /dev/null @@ -1,12 +0,0 @@ -const fs = require('fs'); -const pkgJson = require('../dist/package.json'); -const parentPkgJson = require('../../../package.json'); - -for (const dep in pkgJson.dependencies) { - // ensure we point to NPM instead of a local directory - if (dep === 'context.dev') { - pkgJson.dependencies[dep] = '^' + parentPkgJson.version; - } -} - -fs.writeFileSync('dist/package.json', JSON.stringify(pkgJson, null, 2)); diff --git a/packages/mcp-server/src/auth.ts b/packages/mcp-server/src/auth.ts deleted file mode 100644 index 935a1b16..00000000 --- a/packages/mcp-server/src/auth.ts +++ /dev/null @@ -1,42 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { IncomingMessage } from 'node:http'; -import { ClientOptions } from 'context.dev'; -import { McpOptions } from './options'; - -export const parseClientAuthHeaders = (req: IncomingMessage, required?: boolean): Partial => { - if (req.headers.authorization) { - const scheme = req.headers.authorization.split(' ')[0]!; - const value = req.headers.authorization.slice(scheme.length + 1); - switch (scheme) { - case 'Bearer': - return { apiKey: req.headers.authorization.slice('Bearer '.length) }; - default: - throw new Error( - 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).', - ); - } - } else if (required) { - throw new Error('Missing required Authorization header; see WWW-Authenticate header for details.'); - } - - const apiKey = - Array.isArray(req.headers['x-context-dev-api-key']) ? - req.headers['x-context-dev-api-key'][0] - : req.headers['x-context-dev-api-key']; - return { apiKey }; -}; - -export const getStainlessApiKey = (req: IncomingMessage, mcpOptions: McpOptions): string | undefined => { - // Try to get the key from the x-stainless-api-key header - const headerKey = - Array.isArray(req.headers['x-stainless-api-key']) ? - req.headers['x-stainless-api-key'][0] - : req.headers['x-stainless-api-key']; - if (headerKey && typeof headerKey === 'string') { - return headerKey; - } - - // Fall back to value set in the mcpOptions (e.g. from environment variable), if provided - return mcpOptions.stainlessApiKey; -}; diff --git a/packages/mcp-server/src/code-tool-paths.cts b/packages/mcp-server/src/code-tool-paths.cts deleted file mode 100644 index 78263e45..00000000 --- a/packages/mcp-server/src/code-tool-paths.cts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export function getWorkerPath(): string { - return require.resolve('./code-tool-worker.mjs'); -} diff --git a/packages/mcp-server/src/code-tool-types.ts b/packages/mcp-server/src/code-tool-types.ts deleted file mode 100644 index 21108d89..00000000 --- a/packages/mcp-server/src/code-tool-types.ts +++ /dev/null @@ -1,17 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { ClientOptions } from 'context.dev'; - -export type WorkerInput = { - project_name: string; - code: string; - client_opts: ClientOptions; - intent?: string | undefined; -}; - -export type WorkerOutput = { - is_error: boolean; - result: unknown | null; - log_lines: string[]; - err_lines: string[]; -}; diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts deleted file mode 100644 index c66589ea..00000000 --- a/packages/mcp-server/src/code-tool-worker.ts +++ /dev/null @@ -1,320 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import path from 'node:path'; -import util from 'node:util'; -import Fuse from 'fuse.js'; -import ts from 'typescript'; -import { WorkerOutput } from './code-tool-types'; -import { ContextDev, ClientOptions } from 'context.dev'; - -async function tseval(code: string) { - return import('data:application/typescript;charset=utf-8;base64,' + Buffer.from(code).toString('base64')); -} - -function getRunFunctionSource(code: string): { - type: 'declaration' | 'expression'; - client: string | undefined; - code: string; -} | null { - const sourceFile = ts.createSourceFile('code.ts', code, ts.ScriptTarget.Latest, true); - const printer = ts.createPrinter(); - - for (const statement of sourceFile.statements) { - // Check for top-level function declarations - if (ts.isFunctionDeclaration(statement)) { - if (statement.name?.text === 'run') { - return { - type: 'declaration', - client: statement.parameters[0]?.name.getText(), - code: printer.printNode(ts.EmitHint.Unspecified, statement.body!, sourceFile), - }; - } - } - - // Check for variable declarations: const run = () => {} or const run = function() {} - if (ts.isVariableStatement(statement)) { - for (const declaration of statement.declarationList.declarations) { - if ( - ts.isIdentifier(declaration.name) && - declaration.name.text === 'run' && - // Check if it's initialized with a function - declaration.initializer && - (ts.isFunctionExpression(declaration.initializer) || ts.isArrowFunction(declaration.initializer)) - ) { - return { - type: 'expression', - client: declaration.initializer.parameters[0]?.name.getText(), - code: printer.printNode(ts.EmitHint.Unspecified, declaration.initializer, sourceFile), - }; - } - } - } - } - - return null; -} - -function getTSDiagnostics(code: string): string[] { - const functionSource = getRunFunctionSource(code)!; - const codeWithImport = [ - 'import { ContextDev } from "context.dev";', - functionSource.type === 'declaration' ? - `async function run(${functionSource.client}: ContextDev)` - : `const run: (${functionSource.client}: ContextDev) => Promise =`, - functionSource.code, - ].join('\n'); - const sourcePath = path.resolve('code.ts'); - const ast = ts.createSourceFile(sourcePath, codeWithImport, ts.ScriptTarget.Latest, true); - const options = ts.getDefaultCompilerOptions(); - options.target = ts.ScriptTarget.Latest; - options.module = ts.ModuleKind.NodeNext; - options.moduleResolution = ts.ModuleResolutionKind.NodeNext; - const host = ts.createCompilerHost(options, true); - const newHost: typeof host = { - ...host, - getSourceFile: (...args) => { - if (path.resolve(args[0]) === sourcePath) { - return ast; - } - return host.getSourceFile(...args); - }, - readFile: (...args) => { - if (path.resolve(args[0]) === sourcePath) { - return codeWithImport; - } - return host.readFile(...args); - }, - fileExists: (...args) => { - if (path.resolve(args[0]) === sourcePath) { - return true; - } - return host.fileExists(...args); - }, - }; - const program = ts.createProgram({ - options, - rootNames: [sourcePath], - host: newHost, - }); - const diagnostics = ts.getPreEmitDiagnostics(program, ast); - return diagnostics.map((d) => { - const message = ts.flattenDiagnosticMessageText(d.messageText, '\n'); - if (!d.file || !d.start) return `- ${message}`; - const { line: lineNumber } = ts.getLineAndCharacterOfPosition(d.file, d.start); - const line = codeWithImport.split('\n').at(lineNumber)?.trim(); - return line ? `- ${message}\n ${line}` : `- ${message}`; - }); -} - -const fuse = new Fuse( - [ - 'client.parse.handle', - 'client.web.extract', - 'client.web.extractCompetitors', - 'client.web.extractFonts', - 'client.web.extractStyleguide', - 'client.web.screenshot', - 'client.web.search', - 'client.web.webCrawlMd', - 'client.web.webScrapeHTML', - 'client.web.webScrapeImages', - 'client.web.webScrapeMd', - 'client.web.webScrapeSitemap', - 'client.ai.extractProduct', - 'client.ai.extractProducts', - 'client.brand.retrieve', - 'client.brand.retrieveSimplified', - 'client.brand.search', - 'client.industry.retrieveNaics', - 'client.industry.retrieveSic', - 'client.utility.prefetch', - 'client.monitors.create', - 'client.monitors.delete', - 'client.monitors.getCreditUsage', - 'client.monitors.getLimits', - 'client.monitors.list', - 'client.monitors.listAccountChanges', - 'client.monitors.listAccountRuns', - 'client.monitors.listChanges', - 'client.monitors.listRuns', - 'client.monitors.retrieve', - 'client.monitors.retrieveChange', - 'client.monitors.run', - 'client.monitors.update', - 'client.batch.cancel', - 'client.batch.delete', - 'client.batch.getResults', - 'client.batch.list', - 'client.batch.retrieve', - 'client.batch.submit', - 'client.people.enrich', - 'client.news.search', - ], - { threshold: 1, shouldSort: true }, -); - -function getMethodSuggestions(fullyQualifiedMethodName: string): string[] { - return fuse - .search(fullyQualifiedMethodName) - .map(({ item }) => item) - .slice(0, 5); -} - -const proxyToObj = new WeakMap(); -const objToProxy = new WeakMap(); - -type ClientProxyConfig = { - path: string[]; - isBelievedBad?: boolean; -}; - -function makeSdkProxy(obj: T, { path, isBelievedBad = false }: ClientProxyConfig): T { - let proxy: T = objToProxy.get(obj); - - if (!proxy) { - proxy = new Proxy(obj, { - get(target, prop, receiver) { - const propPath = [...path, String(prop)]; - const value = Reflect.get(target, prop, receiver); - - if (isBelievedBad || (!(prop in target) && value === undefined)) { - // If we're accessing a path that doesn't exist, it will probably eventually error. - // Let's proxy it and mark it bad so that we can control the error message. - // We proxy an empty class so that an invocation or construction attempt is possible. - return makeSdkProxy(class {}, { path: propPath, isBelievedBad: true }); - } - - if (value !== null && (typeof value === 'object' || typeof value === 'function')) { - return makeSdkProxy(value, { path: propPath, isBelievedBad }); - } - - return value; - }, - - apply(target, thisArg, args) { - if (isBelievedBad || typeof target !== 'function') { - const fullyQualifiedMethodName = path.join('.'); - const suggestions = getMethodSuggestions(fullyQualifiedMethodName); - throw new Error( - `${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`, - ); - } - - return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args); - }, - - construct(target, args, newTarget) { - if (isBelievedBad || typeof target !== 'function') { - const fullyQualifiedMethodName = path.join('.'); - const suggestions = getMethodSuggestions(fullyQualifiedMethodName); - throw new Error( - `${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`, - ); - } - - return Reflect.construct(target, args, newTarget); - }, - }); - - objToProxy.set(obj, proxy); - proxyToObj.set(proxy, obj); - } - - return proxy; -} - -function parseError(code: string, error: unknown): string | undefined { - if (!(error instanceof Error)) return; - const cause = error.cause instanceof Error ? `: ${error.cause.message}` : ''; - const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`; - try { - // Deno uses V8; the first ":LINE:COLUMN" is the top of stack. - const lineNumber = error.stack?.match(/:([0-9]+):[0-9]+/)?.[1]; - // -1 for the zero-based indexing - const line = - lineNumber && - code - .split('\n') - .at(parseInt(lineNumber, 10) - 1) - ?.trim(); - return line ? `${message}\n at line ${lineNumber}\n ${line}` : message; - } catch { - return message; - } -} - -const fetch = async (req: Request): Promise => { - const { opts, code } = (await req.json()) as { opts: ClientOptions; code: string }; - - const runFunctionSource = code ? getRunFunctionSource(code) : null; - if (!runFunctionSource) { - const message = - code ? - 'The code is missing a top-level `run` function.' - : 'The code argument is missing. Provide one containing a top-level `run` function.'; - return Response.json( - { - is_error: true, - result: `${message} Write code within this template:\n\n\`\`\`\nasync function run(client) {\n // Fill this out\n}\n\`\`\``, - log_lines: [], - err_lines: [], - } satisfies WorkerOutput, - { status: 400, statusText: 'Code execution error' }, - ); - } - - const diagnostics = getTSDiagnostics(code); - if (diagnostics.length > 0) { - return Response.json( - { - is_error: true, - result: `The code contains TypeScript diagnostics:\n${diagnostics.join('\n')}`, - log_lines: [], - err_lines: [], - } satisfies WorkerOutput, - { status: 400, statusText: 'Code execution error' }, - ); - } - - const client = new ContextDev({ - ...opts, - }); - - const log_lines: string[] = []; - const err_lines: string[] = []; - const originalConsole = globalThis.console; - globalThis.console = { - ...originalConsole, - log: (...args: unknown[]) => { - log_lines.push(util.format(...args)); - }, - error: (...args: unknown[]) => { - err_lines.push(util.format(...args)); - }, - }; - try { - let run_ = async (client: any) => {}; - run_ = (await tseval(`${code}\nexport default run;`)).default; - const result = await run_(makeSdkProxy(client, { path: ['client'] })); - return Response.json({ - is_error: false, - result, - log_lines, - err_lines, - } satisfies WorkerOutput); - } catch (e) { - return Response.json( - { - is_error: true, - result: parseError(code, e), - log_lines, - err_lines, - } satisfies WorkerOutput, - { status: 400, statusText: 'Code execution error' }, - ); - } finally { - globalThis.console = originalConsole; - } -}; - -export default { fetch }; diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts deleted file mode 100644 index d5cd7d59..00000000 --- a/packages/mcp-server/src/code-tool.ts +++ /dev/null @@ -1,315 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { ContentBlock, McpRequestContext, McpTool, Metadata, ToolCallResult, asErrorResult } from './types'; -import { Tool } from '@modelcontextprotocol/sdk/types.js'; -import { WorkerOutput } from './code-tool-types'; -import { getLogger } from './logger'; -import { SdkMethod } from './methods'; -import { McpCodeExecutionMode } from './options'; -import { ClientOptions } from 'context.dev'; - -const prompt = `Runs JavaScript code to interact with the Context Dev API. - -You are a skilled TypeScript programmer writing code to interface with the service. -Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run. -For example: - -\`\`\` -async function run(client) { - const brand = await client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }); - - console.log(brand.cache_metadata); -} -\`\`\` - -You will be returned anything that your function returns, plus the results of any console.log statements. -Do not add try-catch blocks for single API calls. The tool will handle errors for you. -Do not add comments unless necessary for generating better code. -Code will run in a container, and cannot interact with the network outside of the given SDK client. -Variables will not persist between calls, so make sure to return or log any data you might need later. -Remember that you are writing TypeScript code, so you need to be careful with your types. -Always type dynamic key-value stores explicitly as Record instead of {}.`; - -/** - * A tool that runs code against a copy of the SDK. - * - * Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once, - * we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then - * a generic endpoint that can be used to invoke any endpoint with the provided arguments. - * - * @param blockedMethods - The methods to block for code execution. Blocking is done by simple string - * matching, so it is not secure against obfuscation. For stronger security, block in the downstream API - * with limited API keys. - * @param codeExecutionMode - Whether to execute code in a local Deno environment or in a remote - * sandbox environment hosted by Stainless. - */ -export function codeTool({ - blockedMethods, - codeExecutionMode, -}: { - blockedMethods: SdkMethod[] | undefined; - codeExecutionMode: McpCodeExecutionMode; -}): McpTool { - const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] }; - const tool: Tool = { - name: 'execute', - description: prompt, - inputSchema: { - type: 'object', - properties: { - code: { - type: 'string', - description: 'Code to execute.', - }, - intent: { - type: 'string', - description: 'Task you are trying to perform. Used for improving the service.', - }, - }, - required: ['code'], - }, - }; - - const logger = getLogger(); - - const handler = async ({ - reqContext, - args, - }: { - reqContext: McpRequestContext; - args: any; - }): Promise => { - const code = args.code as string; - // Do very basic blocking of code that includes forbidden method names. - // - // WARNING: This is not secure against obfuscation and other evasion methods. If - // stronger security blocks are required, then these should be enforced in the downstream - // API (e.g., by having users call the MCP server with API keys with limited permissions). - if (blockedMethods) { - const blockedMatches = blockedMethods.filter((method) => code.includes(method.fullyQualifiedName)); - if (blockedMatches.length > 0) { - return asErrorResult( - `The following methods have been blocked by the MCP server and cannot be used in code execution: ${blockedMatches - .map((m) => m.fullyQualifiedName) - .join(', ')}`, - ); - } - } - - let result: ToolCallResult; - const startTime = Date.now(); - - logger.debug('Executing code in local Deno environment'); - result = await localDenoHandler({ reqContext, args }); - - logger.info( - { - codeExecutionMode, - durationMs: Date.now() - startTime, - isError: result.isError, - contentRows: result.content?.length ?? 0, - }, - 'Got code tool execution result', - ); - return result; - }; - - return { metadata, tool, handler }; -} - -const localDenoHandler = async ({ - reqContext, - args, -}: { - reqContext: McpRequestContext; - args: unknown; -}): Promise => { - const fs = await import('node:fs'); - const path = await import('node:path'); - const url = await import('node:url'); - const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker'); - const { getWorkerPath } = await import('./code-tool-paths.cjs'); - const workerPath = getWorkerPath(); - - const client = reqContext.client; - const baseURLHostname = new URL(client.baseURL).hostname; - const { code } = args as { code: string }; - - let denoPath: string; - - const packageRoot = path.resolve(path.dirname(workerPath), '..'); - const packageNodeModulesPath = path.resolve(packageRoot, 'node_modules'); - - // Check if deno is in PATH - const { execSync } = await import('node:child_process'); - try { - execSync('command -v deno', { stdio: 'ignore' }); - denoPath = 'deno'; - } catch { - try { - // Use deno binary in node_modules if it's found - const denoNodeModulesPath = path.resolve(packageNodeModulesPath, 'deno', 'bin.cjs'); - await fs.promises.access(denoNodeModulesPath, fs.constants.X_OK); - denoPath = denoNodeModulesPath; - } catch { - return asErrorResult( - 'Deno is required for code execution but was not found. ' + - 'Install it from https://deno.land or run: npm install deno', - ); - } - } - - const allowReadPaths = [ - 'code-tool-worker.mjs', - `${workerPath.replace(/([\/\\]node_modules)[\/\\].+$/, '$1')}/`, - packageRoot, - ]; - - // Follow symlinks in node_modules to allow read access to workspace-linked packages - try { - const sdkPkgName = 'context.dev'; - const sdkDir = path.resolve(packageNodeModulesPath, sdkPkgName); - const realSdkDir = fs.realpathSync(sdkDir); - if (realSdkDir !== sdkDir) { - allowReadPaths.push(realSdkDir); - } - } catch { - // Ignore if symlink resolution fails - } - - const allowRead = allowReadPaths.join(','); - - const worker = await newDenoHTTPWorker(url.pathToFileURL(workerPath), { - denoExecutable: denoPath, - runFlags: [ - `--node-modules-dir=manual`, - `--allow-read=${allowRead}`, - `--allow-net=${baseURLHostname}`, - // Allow environment variables because instantiating the client will try to read from them, - // even though they are not set. - '--allow-env', - ], - printOutput: true, - spawnOptions: { - cwd: path.dirname(workerPath), - // Merge any upstream client envs into the Deno subprocess environment, - // with the upstream env vars taking precedence. - env: { ...process.env, ...reqContext.upstreamClientEnvs }, - }, - }); - - try { - const resp = await new Promise((resolve, reject) => { - worker.addEventListener('exit', (exitCode) => { - reject(new Error(`Worker exited with code ${exitCode}`)); - }); - - // Strip null/undefined values so that the worker SDK client can fall back to - // reading from environment variables (including any upstreamClientEnvs). - const opts = { - ...(client.baseURL != null ? { baseURL: client.baseURL } : undefined), - ...(client.apiKey != null ? { apiKey: client.apiKey } : undefined), - defaultHeaders: { - 'X-Stainless-MCP': 'true', - }, - } satisfies Partial as ClientOptions; - - const req = worker.request( - 'http://localhost', - { - headers: { - 'content-type': 'application/json', - }, - method: 'POST', - }, - (resp) => { - const body: Uint8Array[] = []; - resp.on('error', (err) => { - reject(err); - }); - resp.on('data', (chunk) => { - body.push(chunk); - }); - resp.on('end', () => { - resolve( - new Response(Buffer.concat(body).toString(), { - status: resp.statusCode ?? 200, - headers: resp.headers as any, - }), - ); - }); - }, - ); - - const body = JSON.stringify({ - opts, - code, - }); - - req.write(body, (err) => { - if (err != null) { - reject(err); - } - }); - - req.end(); - }); - - if (resp.status === 200) { - const { result, log_lines, err_lines } = (await resp.json()) as WorkerOutput; - const returnOutput: ContentBlock | null = - result == null ? null : ( - { - type: 'text', - text: typeof result === 'string' ? result : JSON.stringify(result), - } - ); - const logOutput: ContentBlock | null = - log_lines.length === 0 ? - null - : { - type: 'text', - text: log_lines.join('\n'), - }; - const errOutput: ContentBlock | null = - err_lines.length === 0 ? - null - : { - type: 'text', - text: 'Error output:\n' + err_lines.join('\n'), - }; - return { - content: [returnOutput, logOutput, errOutput].filter((block) => block !== null), - }; - } else { - const { result, log_lines, err_lines } = (await resp.json()) as WorkerOutput; - const messageOutput: ContentBlock | null = - result == null ? null : ( - { - type: 'text', - text: typeof result === 'string' ? result : JSON.stringify(result), - } - ); - const logOutput: ContentBlock | null = - log_lines.length === 0 ? - null - : { - type: 'text', - text: log_lines.join('\n'), - }; - const errOutput: ContentBlock | null = - err_lines.length === 0 ? - null - : { - type: 'text', - text: 'Error output:\n' + err_lines.join('\n'), - }; - return { - content: [messageOutput, logOutput, errOutput].filter((block) => block !== null), - isError: true, - }; - } - } finally { - worker.terminate(); - } -}; diff --git a/packages/mcp-server/src/docs-search-tool.ts b/packages/mcp-server/src/docs-search-tool.ts deleted file mode 100644 index eafcd871..00000000 --- a/packages/mcp-server/src/docs-search-tool.ts +++ /dev/null @@ -1,79 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { Tool } from '@modelcontextprotocol/sdk/types.js'; -import { Metadata, McpRequestContext, asTextContentResult } from './types'; - -import type { LocalDocsSearch } from './local-docs-search'; - -export const metadata: Metadata = { - resource: 'all', - operation: 'read', - tags: [], - httpMethod: 'get', -}; - -export const tool: Tool = { - name: 'search_docs', - description: - 'Search SDK documentation to find methods, parameters, and usage examples for interacting with the API. Use this before writing code when you need to discover the right approach.', - inputSchema: { - type: 'object', - properties: { - query: { - type: 'string', - description: 'The query to search for.', - }, - language: { - type: 'string', - description: 'The language for the SDK to search for.', - enum: ['http', 'python', 'go', 'typescript', 'javascript', 'terraform', 'ruby', 'java', 'kotlin'], - }, - detail: { - type: 'string', - description: 'The amount of detail to return.', - enum: ['default', 'verbose'], - }, - }, - required: ['query', 'language'], - }, - annotations: { - readOnlyHint: true, - }, -}; - -let _localSearch: LocalDocsSearch | undefined; - -export function setLocalSearch(search: LocalDocsSearch): void { - _localSearch = search; -} - -async function searchLocal(args: Record): Promise { - if (!_localSearch) { - throw new Error('Local search not initialized'); - } - - const query = (args['query'] as string) ?? ''; - const language = (args['language'] as string) ?? 'typescript'; - const detail = (args['detail'] as string) ?? 'default'; - - return _localSearch.search({ - query, - language, - detail, - maxResults: 10, - }).results; -} - -export const handler = async ({ - reqContext, - args, -}: { - reqContext: McpRequestContext; - args: Record | undefined; -}) => { - const body = args ?? {}; - - return asTextContentResult(await searchLocal(body)); -}; - -export default { metadata, tool, handler }; diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts deleted file mode 100644 index a8dfd8a9..00000000 --- a/packages/mcp-server/src/http.ts +++ /dev/null @@ -1,227 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { McpServer } from '@modelcontextprotocol/sdk/server/mcp'; -import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; -import { ClientOptions } from 'context.dev'; -import express from 'express'; -import pino from 'pino'; -import pinoHttp from 'pino-http'; -import { getStainlessApiKey, parseClientAuthHeaders } from './auth'; -import { getLogger } from './logger'; -import { McpOptions } from './options'; -import { initMcpServer, newMcpServer } from './server'; - -const newServer = async ({ - clientOptions, - mcpOptions, - req, - res, -}: { - clientOptions: ClientOptions; - mcpOptions: McpOptions; - req: express.Request; - res: express.Response; -}): Promise => { - const stainlessApiKey = getStainlessApiKey(req, mcpOptions); - const customInstructionsPath = mcpOptions.customInstructionsPath; - const server = await newMcpServer({ stainlessApiKey, customInstructionsPath }); - - const authOptions = parseClientAuthHeaders(req, false); - - let upstreamClientEnvs: Record | undefined; - const clientEnvsHeader = req.headers['x-stainless-mcp-client-envs']; - if (typeof clientEnvsHeader === 'string') { - try { - const parsed = JSON.parse(clientEnvsHeader); - if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) { - upstreamClientEnvs = parsed; - } - } catch { - // Ignore malformed header - } - } - - // Parse x-stainless-mcp-client-permissions header to override permission options - // - // Note: Permissions are best-effort and intended to prevent clients from doing unexpected things; - // they're not a hard security boundary, so we allow arbitrary, client-driven overrides. - // - // See the Stainless MCP documentation for more details. - let effectiveMcpOptions = mcpOptions; - const clientPermissionsHeader = req.headers['x-stainless-mcp-client-permissions']; - if (typeof clientPermissionsHeader === 'string') { - try { - const parsed = JSON.parse(clientPermissionsHeader); - if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) { - effectiveMcpOptions = { - ...mcpOptions, - ...(typeof parsed.allow_http_gets === 'boolean' && { codeAllowHttpGets: parsed.allow_http_gets }), - ...(Array.isArray(parsed.allowed_methods) && { codeAllowedMethods: parsed.allowed_methods }), - ...(Array.isArray(parsed.blocked_methods) && { codeBlockedMethods: parsed.blocked_methods }), - }; - getLogger().info( - { clientPermissions: parsed }, - 'Overriding code execution permissions from x-stainless-mcp-client-permissions header', - ); - } - } catch (error) { - getLogger().warn({ error }, 'Failed to parse x-stainless-mcp-client-permissions header'); - } - } - - const mcpClientInfo = - typeof req.body?.params?.clientInfo?.name === 'string' ? - { name: req.body.params.clientInfo.name, version: String(req.body.params.clientInfo.version ?? '') } - : undefined; - - await initMcpServer({ - server: server, - mcpOptions: effectiveMcpOptions, - clientOptions: { - ...clientOptions, - ...authOptions, - }, - stainlessApiKey: stainlessApiKey, - upstreamClientEnvs, - mcpSessionId: (req as any).mcpSessionId, - mcpClientInfo, - }); - - if (mcpClientInfo) { - getLogger().info({ mcpSessionId: (req as any).mcpSessionId, mcpClientInfo }, 'MCP client connected'); - } - - return server; -}; - -const post = - (options: { clientOptions: ClientOptions; mcpOptions: McpOptions }) => - async (req: express.Request, res: express.Response) => { - const server = await newServer({ ...options, req, res }); - // If we return null, we already set the authorization error. - if (server === null) return; - const transport = new StreamableHTTPServerTransport(); - await server.connect(transport as any); - await transport.handleRequest(req, res, req.body); - }; - -const get = async (req: express.Request, res: express.Response) => { - res.status(405).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not supported', - }, - }); -}; - -const del = async (req: express.Request, res: express.Response) => { - res.status(405).json({ - jsonrpc: '2.0', - error: { - code: -32000, - message: 'Method not supported', - }, - }); -}; - -const redactHeaders = (headers: Record) => { - const hiddenHeaders = /auth|cookie|key|token|x-stainless-mcp-client-envs/i; - const filtered = { ...headers }; - Object.keys(filtered).forEach((key) => { - if (hiddenHeaders.test(key)) { - filtered[key] = '[REDACTED]'; - } - }); - return filtered; -}; - -export const streamableHTTPApp = ({ - clientOptions = {}, - mcpOptions, -}: { - clientOptions?: ClientOptions; - mcpOptions: McpOptions; -}): express.Express => { - const app = express(); - app.set('query parser', 'extended'); - app.use(express.json()); - app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { - const existing = req.headers['mcp-session-id']; - const sessionId = (Array.isArray(existing) ? existing[0] : existing) || crypto.randomUUID(); - (req as any).mcpSessionId = sessionId; - const origWriteHead = res.writeHead.bind(res); - res.writeHead = function (statusCode: number, ...rest: any[]) { - res.setHeader('mcp-session-id', sessionId); - return origWriteHead(statusCode, ...rest); - } as typeof res.writeHead; - next(); - }); - app.use( - pinoHttp({ - logger: getLogger(), - customProps: (req) => ({ - mcpSessionId: (req as any).mcpSessionId, - }), - customLogLevel: (req, res) => { - if (res.statusCode >= 500) { - return 'error'; - } else if (res.statusCode >= 400) { - return 'warn'; - } - return 'info'; - }, - customSuccessMessage: function (req, res) { - return `Request ${req.method} to ${req.url} completed with status ${res.statusCode}`; - }, - customErrorMessage: function (req, res, err) { - return `Request ${req.method} to ${req.url} errored with status ${res.statusCode}`; - }, - serializers: { - req: pino.stdSerializers.wrapRequestSerializer((req) => { - return { - ...req, - headers: redactHeaders(req.raw.headers), - }; - }), - res: pino.stdSerializers.wrapResponseSerializer((res) => { - return { - ...res, - headers: redactHeaders(res.headers), - }; - }), - }, - }), - ); - - app.get('/health', async (req: express.Request, res: express.Response) => { - res.status(200).send('OK'); - }); - app.get('/', get); - app.post('/', post({ clientOptions, mcpOptions })); - app.delete('/', del); - - return app; -}; - -export const launchStreamableHTTPServer = async ({ - mcpOptions, - port, -}: { - mcpOptions: McpOptions; - port: number | string | undefined; -}) => { - const app = streamableHTTPApp({ mcpOptions }); - const server = app.listen(port); - const address = server.address(); - - const logger = getLogger(); - - if (typeof address === 'string') { - logger.info(`MCP Server running on streamable HTTP at ${address}`); - } else if (address !== null) { - logger.info(`MCP Server running on streamable HTTP on port ${address.port}`); - } else { - logger.info(`MCP Server running on streamable HTTP on port ${port}`); - } -}; diff --git a/packages/mcp-server/src/index.ts b/packages/mcp-server/src/index.ts deleted file mode 100644 index 5bca4a60..00000000 --- a/packages/mcp-server/src/index.ts +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env node - -import { selectTools } from './server'; -import { McpOptions, parseCLIOptions } from './options'; -import { launchStdioServer } from './stdio'; -import { launchStreamableHTTPServer } from './http'; -import type { McpTool } from './types'; -import { configureLogger, getLogger } from './logger'; - -async function main() { - const options = parseOptionsOrError(); - configureLogger({ - level: options.debug ? 'debug' : 'info', - pretty: options.logFormat === 'pretty', - }); - - const selectedTools = await selectToolsOrError(options); - - getLogger().info( - { tools: selectedTools.map((e) => e.tool.name) }, - `MCP Server starting with ${selectedTools.length} tools`, - ); - - switch (options.transport) { - case 'stdio': - await launchStdioServer(options); - break; - case 'http': - await launchStreamableHTTPServer({ - mcpOptions: options, - port: options.socket ?? options.port, - }); - break; - } -} - -if (require.main === module) { - main().catch((error) => { - // Logger might not be initialized yet - console.error('Fatal error in main()', error); - process.exit(1); - }); -} - -function parseOptionsOrError() { - try { - return parseCLIOptions(); - } catch (error) { - // Logger is initialized after options, so use console.error here - console.error('Error parsing options', error); - process.exit(1); - } -} - -async function selectToolsOrError(options: McpOptions): Promise { - try { - const includedTools = selectTools(options); - if (includedTools.length === 0) { - getLogger().error('No tools match the provided filters'); - process.exit(1); - } - return includedTools; - } catch (error) { - getLogger().error({ error }, 'Error filtering tools'); - process.exit(1); - } -} diff --git a/packages/mcp-server/src/instructions.ts b/packages/mcp-server/src/instructions.ts deleted file mode 100644 index f3d6fdd8..00000000 --- a/packages/mcp-server/src/instructions.ts +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import fs from 'fs/promises'; -import { getLogger } from './logger'; - -const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes - -interface InstructionsCacheEntry { - fetchedInstructions: string; - fetchedAt: number; -} - -const instructionsCache = new Map(); - -export async function getInstructions({ - stainlessApiKey, - customInstructionsPath, -}: { - stainlessApiKey?: string | undefined; - customInstructionsPath?: string | undefined; -}): Promise { - const now = Date.now(); - const cacheKey = customInstructionsPath ?? stainlessApiKey ?? ''; - const cached = instructionsCache.get(cacheKey); - - if (cached && now - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) { - return cached.fetchedInstructions; - } - - // Evict stale entries so the cache doesn't grow unboundedly. - for (const [key, entry] of instructionsCache) { - if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) { - instructionsCache.delete(key); - } - } - - let fetchedInstructions: string; - - if (customInstructionsPath) { - fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath); - } else { - fetchedInstructions = - '\n This is the context.dev MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n '; - } - - instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now }); - return fetchedInstructions; -} - -async function fetchLatestInstructionsFromFile(path: string): Promise { - try { - return await fs.readFile(path, 'utf-8'); - } catch (error) { - getLogger().error({ error, path }, 'Error fetching instructions from file'); - throw error; - } -} diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts deleted file mode 100644 index 6c9fbb33..00000000 --- a/packages/mcp-server/src/local-docs-search.ts +++ /dev/null @@ -1,2661 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import MiniSearch from 'minisearch'; -import * as fs from 'node:fs/promises'; -import * as path from 'node:path'; -import { getLogger } from './logger'; - -type PerLanguageData = { - method?: string; - example?: string; -}; - -type MethodEntry = { - name: string; - endpoint: string; - httpMethod: string; - summary: string; - description: string; - stainlessPath: string; - qualified: string; - params?: string[]; - response?: string; - markdown?: string; - perLanguage?: Record; -}; - -type ProseChunk = { - content: string; - tag: string; - sectionContext?: string; - source?: string; -}; - -type MiniSearchDocument = { - id: string; - kind: 'http_method' | 'prose'; - name?: string; - endpoint?: string; - summary?: string; - description?: string; - qualified?: string; - stainlessPath?: string; - content?: string; - sectionContext?: string; - _original: Record; -}; - -type SearchResult = { - results: (string | Record)[]; -}; - -const EMBEDDED_METHODS: MethodEntry[] = [ - { - name: 'handle', - endpoint: '/parse', - httpMethod: 'post', - summary: 'Parse Bytes', - description: - 'Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.', - stainlessPath: '(resource) parse > (method) handle', - qualified: 'client.parse.handle', - params: [ - 'body: string;', - 'client?: string;', - 'extension?: string;', - 'includeImages?: boolean;', - 'includeLinks?: boolean;', - 'ocr?: boolean;', - 'pdf?: { end?: number; start?: number; };', - 'shortenBase64Images?: boolean;', - 'tags?: string[];', - 'useMainContentOnly?: boolean;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - '{ markdown: string; success: true; type: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }', - markdown: - "## handle\n\n`client.parse.handle(body: string, client?: string, extension?: string, includeImages?: boolean, includeLinks?: boolean, ocr?: boolean, pdf?: { end?: number; start?: number; }, shortenBase64Images?: boolean, tags?: string[], useMainContentOnly?: boolean, zdr?: 'enabled' | 'disabled'): { markdown: string; success: true; type: string; key_metadata?: object; }`\n\n**post** `/parse`\n\nConverts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.\n\n### Parameters\n\n- `body: string`\n\n- `client?: string`\n Optional client identifier used for usage attribution.\n\n- `extension?: string`\n Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.\n\n- `includeImages?: boolean`\n Include image references in Markdown output\n\n- `includeLinks?: boolean`\n Preserve hyperlinks in Markdown output\n\n- `ocr?: boolean`\n When true for PDF inputs, OCR the selected pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.\n\n- `pdf?: { end?: number; start?: number; }`\n PDF page-range options as a JSON object, e.g. {\"start\": 2, \"end\": 5}.\n - `end?: number`\n Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.\n - `start?: number`\n First 1-based PDF page to parse. When omitted, parsing starts at the first page.\n\n- `shortenBase64Images?: boolean`\n Shorten base64-encoded image data in the Markdown output\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `useMainContentOnly?: boolean`\n Extract only the main content from HTML-like inputs\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ markdown: string; success: true; type: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `markdown: string`\n - `success: true`\n - `type: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.parse.handle(fs.createReadStream('path/to/file'));\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'parse->handle', - example: - "parse->handle(\n FileParam::fromString('Example data', filename: uniqid('file-upload-', true))\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Parse.Handle', - example: - 'package main\n\nimport (\n\t"bytes"\n\t"context"\n\t"fmt"\n\t"io"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Parse.Handle(\n\t\tcontext.TODO(),\n\t\tio.Reader(bytes.NewBuffer([]byte("Example data"))),\n\t\tcontextdev.ParseHandleParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Markdown)\n}\n', - }, - cli: { - method: 'parse handle', - example: "context-dev parse handle \\\n --api-key 'My API Key' \\\n --body 'Example data'", - }, - python: { - method: 'parse.handle', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.parse.handle(\n body=b"Example data",\n)\nprint(response.markdown)', - }, - ruby: { - method: 'parse.handle', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.parse.handle(body: StringIO.new("Example data"))\n\nputs(response)', - }, - typescript: { - method: 'client.parse.handle', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.parse.handle(fs.createReadStream('path/to/file'));\n\nconsole.log(response.markdown);", - }, - http: { - example: - "curl https://api.context.dev/v1/parse \\\n -H 'Content-Type: application/octet-stream' \\\n -H \"Authorization: Bearer $CONTEXT_DEV_API_KEY\" \\\n -F 'body=@/path/to/body'", - }, - }, - }, - { - name: 'web_scrape_html', - endpoint: '/web/scrape/html', - httpMethod: 'get', - summary: 'Scrape HTML', - description: - 'Scrapes the given URL and returns the raw HTML content of the page. The base request costs 1 credit; requests with browser actions cost 2 credits.', - stainlessPath: '(resource) web > (method) web_scrape_html', - qualified: 'client.web.webScrapeHTML', - params: [ - 'url: string;', - "actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[];", - 'country?: string;', - 'excludeSelectors?: string[];', - 'headers?: object;', - 'includeFrames?: boolean;', - 'includeSelectors?: string[];', - 'maxAgeMs?: number;', - 'pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; };', - 'settleAnimations?: boolean;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'useMainContentOnly?: boolean;', - 'waitForMs?: number;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; html: string; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; success: true; type: string; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; actionsHtmlStale?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## web_scrape_html\n\n`client.web.webScrapeHTML(url: string, actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[], country?: string, excludeSelectors?: string[], headers?: object, includeFrames?: boolean, includeSelectors?: string[], maxAgeMs?: number, pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }, settleAnimations?: boolean, tags?: string[], timeoutMS?: number, useMainContentOnly?: boolean, waitForMs?: number, zdr?: 'enabled' | 'disabled'): { cache_metadata: object; html: string; metadata: object; success: true; type: string; url: string; actionsApplied?: object[]; actionsHtmlStale?: boolean; key_metadata?: object; }`\n\n**get** `/web/scrape/html`\n\nScrapes the given URL and returns the raw HTML content of the page. The base request costs 1 credit; requests with browser actions cost 2 credits.\n\n### Parameters\n\n- `url: string`\n Full URL to scrape (must include http:// or https:// protocol)\n\n- `actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[]`\n Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.\n\n- `country?: string`\n Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).\n\n- `excludeSelectors?: string[]`\n CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\".\n\n- `headers?: object`\n Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.\n\n- `includeFrames?: boolean`\n When true, iframes are rendered inline into the returned HTML.\n\n- `includeSelectors?: string[]`\n CSS selectors. When provided, only matching subtrees (and their descendants) are kept and everything else is dropped. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\".\n\n- `maxAgeMs?: number`\n Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.\n\n- `pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }`\n PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.\n - `end?: number`\n Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.\n - `ocr?: boolean`\n When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.\n - `shouldParse?: boolean`\n When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned.\n - `start?: number`\n First 1-based PDF page to parse. When omitted, parsing starts at the first page.\n\n- `settleAnimations?: boolean`\n When true, waits briefly for CSS and transition animations to settle before extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `useMainContentOnly?: boolean`\n When true, return only the page's main content in the HTML response, excluding headers, footers, sidebars, and navigation when detectable.\n\n- `waitForMs?: number`\n Optional browser wait time in milliseconds after initial page load. Min: 0. Max: 30000 (30 seconds).\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; html: string; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; success: true; type: string; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; actionsHtmlStale?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `html: string`\n - `metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }`\n - `success: true`\n - `type: string`\n - `url: string`\n - `actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]`\n - `actionsHtmlStale?: boolean`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeHTML({ url: 'https://example.com' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->webScrapeHTML', - example: - "web->webScrapeHTML(\n url: 'https://example.com',\n actions: [['do' => 'wait', 'timeMs' => 0]],\n country: 'de',\n excludeSelectors: ['x'],\n headers: ['foo' => 'J!'],\n includeFrames: true,\n includeSelectors: ['x'],\n maxAgeMs: 0,\n pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n settleAnimations: true,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1,\n useMainContentOnly: true,\n waitForMs: 0,\n zdr: 'enabled',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.WebScrapeHTML', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.WebScrapeHTML(context.TODO(), contextdev.WebWebScrapeHTMLParams{\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web web_scrape_html', - example: - "context-dev web web-scrape-html \\\n --api-key 'My API Key' \\\n --url https://example.com", - }, - python: { - method: 'web.web_scrape_html', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.web_scrape_html(\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.web_scrape_html', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.web_scrape_html(url: "https://example.com")\n\nputs(response)', - }, - typescript: { - method: 'client.web.webScrapeHTML', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.webScrapeHTML({ url: 'https://example.com' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/scrape/html \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'web_scrape_md', - endpoint: '/web/scrape/markdown', - httpMethod: 'get', - summary: 'Scrape Markdown', - description: - 'Scrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON responses from a recognized API key; use error_code to distinguish stable failure categories.\n\n### YouTube\n\nYouTube URLs return the video or channel itself rather than the surrounding player and navigation chrome. A URL addressing a single video (`/watch`, `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, view count, keywords, full description, and the transcript when the video has captions that can be retrieved; videos without captions return everything except the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) returns its name, handle, subscriber count, video count, and full description. When `includeImages=true`, video responses also include the thumbnail and channel responses include the avatar. Costs the same as any other scrape.\n\n### Billing & errors\n\n| HTTP status | Billed? | Meaning |\n| --- | --- | --- |\n| 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |\n| 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds |\n| 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |\n| 404 | No | Target page returned or fingerprinted as not found |\n| 408 | No | Request timed out |\n| 413 | No | Target content exceeds the maximum supported size (20 MB) |\n| 415 | No | Unsupported content type |\n| 429 | No | Per-minute rate limit exceeded; honor Retry-After |\n| 500 | No | Internal error |', - stainlessPath: '(resource) web > (method) web_scrape_md', - qualified: 'client.web.webScrapeMd', - params: [ - 'url: string;', - "actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[];", - 'country?: string;', - 'excludeSelectors?: string[];', - 'headers?: object;', - 'includeFrames?: boolean;', - 'includeHTML?: boolean;', - 'includeImages?: boolean;', - 'includeLinks?: boolean;', - 'includeSelectors?: string[];', - 'maxAgeMs?: number;', - 'pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; };', - 'settleAnimations?: boolean;', - 'shortenBase64Images?: boolean;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'useMainContentOnly?: boolean;', - 'waitForMs?: number;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; contentLength: number; markdown: string; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; success: true; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; actionsHtmlStale?: boolean; html?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## web_scrape_md\n\n`client.web.webScrapeMd(url: string, actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[], country?: string, excludeSelectors?: string[], headers?: object, includeFrames?: boolean, includeHTML?: boolean, includeImages?: boolean, includeLinks?: boolean, includeSelectors?: string[], maxAgeMs?: number, pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }, settleAnimations?: boolean, shortenBase64Images?: boolean, tags?: string[], timeoutMS?: number, useMainContentOnly?: boolean, waitForMs?: number, zdr?: 'enabled' | 'disabled'): { cache_metadata: object; contentLength: number; markdown: string; metadata: object; success: true; url: string; actionsApplied?: object[]; actionsHtmlStale?: boolean; html?: string; key_metadata?: object; }`\n\n**get** `/web/scrape/markdown`\n\nScrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON responses from a recognized API key; use error_code to distinguish stable failure categories.\n\n### YouTube\n\nYouTube URLs return the video or channel itself rather than the surrounding player and navigation chrome. A URL addressing a single video (`/watch`, `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, view count, keywords, full description, and the transcript when the video has captions that can be retrieved; videos without captions return everything except the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) returns its name, handle, subscriber count, video count, and full description. When `includeImages=true`, video responses also include the thumbnail and channel responses include the avatar. Costs the same as any other scrape.\n\n### Billing & errors\n\n| HTTP status | Billed? | Meaning |\n| --- | --- | --- |\n| 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |\n| 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds |\n| 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |\n| 404 | No | Target page returned or fingerprinted as not found |\n| 408 | No | Request timed out |\n| 413 | No | Target content exceeds the maximum supported size (20 MB) |\n| 415 | No | Unsupported content type |\n| 429 | No | Per-minute rate limit exceeded; honor Retry-After |\n| 500 | No | Internal error |\n\n### Parameters\n\n- `url: string`\n Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)\n\n- `actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[]`\n Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.\n\n- `country?: string`\n Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).\n\n- `excludeSelectors?: string[]`\n CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\".\n\n- `headers?: object`\n Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.\n\n- `includeFrames?: boolean`\n When true, the contents of iframes are rendered to Markdown.\n\n- `includeHTML?: boolean`\n When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request.\n\n- `includeImages?: boolean`\n Include image references in Markdown output\n\n- `includeLinks?: boolean`\n Preserve hyperlinks in Markdown output\n\n- `includeSelectors?: string[]`\n CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before conversion to Markdown. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\".\n\n- `maxAgeMs?: number`\n Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.\n\n- `pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }`\n PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.\n - `end?: number`\n Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.\n - `ocr?: boolean`\n When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.\n - `shouldParse?: boolean`\n When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned.\n - `start?: number`\n First 1-based PDF page to parse. When omitted, parsing starts at the first page.\n\n- `settleAnimations?: boolean`\n When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.\n\n- `shortenBase64Images?: boolean`\n Shorten base64-encoded image data in the Markdown output\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `useMainContentOnly?: boolean`\n Extract only the main content of the page, excluding headers, footers, sidebars, and navigation\n\n- `waitForMs?: number`\n Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; contentLength: number; markdown: string; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; success: true; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; actionsHtmlStale?: boolean; html?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `contentLength: number`\n - `markdown: string`\n - `metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }`\n - `success: true`\n - `url: string`\n - `actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]`\n - `actionsHtmlStale?: boolean`\n - `html?: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeMd({ url: 'https://example.com' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->webScrapeMd', - example: - "web->webScrapeMd(\n url: 'https://example.com',\n actions: [['do' => 'wait', 'timeMs' => 0]],\n country: 'de',\n excludeSelectors: ['x'],\n headers: ['foo' => 'J!'],\n includeFrames: true,\n includeHTML: true,\n includeImages: true,\n includeLinks: true,\n includeSelectors: ['x'],\n maxAgeMs: 0,\n pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n settleAnimations: true,\n shortenBase64Images: true,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1,\n useMainContentOnly: true,\n waitForMs: 0,\n zdr: 'enabled',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.WebScrapeMd', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.WebScrapeMd(context.TODO(), contextdev.WebWebScrapeMdParams{\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web web_scrape_md', - example: "context-dev web web-scrape-md \\\n --api-key 'My API Key' \\\n --url https://example.com", - }, - python: { - method: 'web.web_scrape_md', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.web_scrape_md(\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.web_scrape_md', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.web_scrape_md(url: "https://example.com")\n\nputs(response)', - }, - typescript: { - method: 'client.web.webScrapeMd', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.webScrapeMd({ url: 'https://example.com' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/scrape/markdown \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'web_scrape_images', - endpoint: '/web/scrape/images', - httpMethod: 'get', - summary: 'Scrape Images', - description: - 'Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and embeds. The base request costs 1 credit, or 2 credits with browser actions. When enrichment is enabled, the entire call costs 5 credits, including requests that also use actions.', - stainlessPath: '(resource) web > (method) web_scrape_images', - qualified: 'client.web.webScrapeImages', - params: [ - 'url: string;', - "actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[];", - 'dedupe?: boolean;', - 'enrichment?: { classification?: boolean; hostedUrl?: boolean; maxTimePerMs?: number; resolution?: boolean; };', - 'headers?: object;', - 'maxAgeMs?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'waitForMs?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; images: { alt: string; element: 'img' | 'svg' | 'link' | 'source' | 'video' | 'css' | 'object' | 'meta' | 'background'; src: string; type: 'url' | 'html' | 'base64'; enrichment?: { height?: number; mimetype?: string; type?: 'photography' | 'illustration' | 'logo' | 'wordmark' | 'icon' | 'pattern' | 'graphic' | 'other'; url?: string; width?: number; }; }[]; success: true; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## web_scrape_images\n\n`client.web.webScrapeImages(url: string, actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[], dedupe?: boolean, enrichment?: { classification?: boolean; hostedUrl?: boolean; maxTimePerMs?: number; resolution?: boolean; }, headers?: object, maxAgeMs?: number, tags?: string[], timeoutMS?: number, waitForMs?: number): { cache_metadata: object; images: object[]; success: true; url: string; actionsApplied?: object[]; key_metadata?: object; }`\n\n**get** `/web/scrape/images`\n\nExtract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and embeds. The base request costs 1 credit, or 2 credits with browser actions. When enrichment is enabled, the entire call costs 5 credits, including requests that also use actions.\n\n### Parameters\n\n- `url: string`\n Page URL to inspect. Must include http:// or https://.\n\n- `actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[]`\n Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.\n\n- `dedupe?: boolean`\n When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: false.\n\n- `enrichment?: { classification?: boolean; hostedUrl?: boolean; maxTimePerMs?: number; resolution?: boolean; }`\n Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.\n - `classification?: boolean`\n Classify each image by visual asset type.\n - `hostedUrl?: boolean`\n Host materializable images on the Brand.dev CDN and return their URL and MIME type.\n - `maxTimePerMs?: number`\n Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.\n - `resolution?: boolean`\n Measure image width and height when possible.\n\n- `headers?: object`\n Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.\n\n- `maxAgeMs?: number`\n Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `waitForMs?: number`\n Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; images: { alt: string; element: 'img' | 'svg' | 'link' | 'source' | 'video' | 'css' | 'object' | 'meta' | 'background'; src: string; type: 'url' | 'html' | 'base64'; enrichment?: { height?: number; mimetype?: string; type?: 'photography' | 'illustration' | 'logo' | 'wordmark' | 'icon' | 'pattern' | 'graphic' | 'other'; url?: string; width?: number; }; }[]; success: true; url: string; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `images: { alt: string; element: 'img' | 'svg' | 'link' | 'source' | 'video' | 'css' | 'object' | 'meta' | 'background'; src: string; type: 'url' | 'html' | 'base64'; enrichment?: { height?: number; mimetype?: string; type?: 'photography' | 'illustration' | 'logo' | 'wordmark' | 'icon' | 'pattern' | 'graphic' | 'other'; url?: string; width?: number; }; }[]`\n - `success: true`\n - `url: string`\n - `actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeImages({ url: 'https://example.com' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->webScrapeImages', - example: - "web->webScrapeImages(\n url: 'https://example.com',\n actions: [['do' => 'wait', 'timeMs' => 0]],\n dedupe: true,\n enrichment: [\n 'classification' => true,\n 'hostedURL' => true,\n 'maxTimePerMs' => 1,\n 'resolution' => true,\n ],\n headers: ['foo' => 'J!'],\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1,\n waitForMs: 0,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.WebScrapeImages', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.WebScrapeImages(context.TODO(), contextdev.WebWebScrapeImagesParams{\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web web_scrape_images', - example: - "context-dev web web-scrape-images \\\n --api-key 'My API Key' \\\n --url https://example.com", - }, - python: { - method: 'web.web_scrape_images', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.web_scrape_images(\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.web_scrape_images', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.web_scrape_images(url: "https://example.com")\n\nputs(response)', - }, - typescript: { - method: 'client.web.webScrapeImages', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.webScrapeImages({ url: 'https://example.com' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/scrape/images \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'web_scrape_sitemap', - endpoint: '/web/scrape/sitemap', - httpMethod: 'get', - summary: 'Crawl Sitemap', - description: - "Crawl an entire website's sitemap and return all discovered page URLs. Pass `search` to have the crawled sitemap filtered down to the pages about a phrase (for example `pricing and plans` or `api authentication docs`), most relevant first — a searched crawl scans the whole sitemap and costs 2 credits instead of 1.", - stainlessPath: '(resource) web > (method) web_scrape_sitemap', - qualified: 'client.web.webScrapeSitemap', - params: [ - 'domain: string;', - 'headers?: object;', - 'maxLinks?: number;', - 'search?: string;', - 'sitemapUrl?: string;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'urlRegex?: string;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - '{ domain: string; meta: { errors: number; sitemapsDiscovered: number; sitemapsFetched: number; sitemapsSkipped: number; }; success: true; urls: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }', - markdown: - "## web_scrape_sitemap\n\n`client.web.webScrapeSitemap(domain: string, headers?: object, maxLinks?: number, search?: string, sitemapUrl?: string, tags?: string[], timeoutMS?: number, urlRegex?: string, zdr?: 'enabled' | 'disabled'): { domain: string; meta: object; success: true; urls: string[]; key_metadata?: object; }`\n\n**get** `/web/scrape/sitemap`\n\nCrawl an entire website's sitemap and return all discovered page URLs. Pass `search` to have the crawled sitemap filtered down to the pages about a phrase (for example `pricing and plans` or `api authentication docs`), most relevant first — a searched crawl scans the whole sitemap and costs 2 credits instead of 1.\n\n### Parameters\n\n- `domain: string`\n Domain to build a sitemap for\n\n- `headers?: object`\n Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.\n\n- `maxLinks?: number`\n Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000.\n\n- `search?: string`\n Optional search phrase. When provided, the crawled sitemap is filtered to the pages whose URLs are about that phrase, most relevant first, and the request costs 2 credits instead of 1.\n\n- `sitemapUrl?: string`\n Optional explicit sitemap URL. When provided, exactly this sitemap is crawled instead of discovering the domain's sitemaps.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `urlRegex?: string`\n Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks.\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ domain: string; meta: { errors: number; sitemapsDiscovered: number; sitemapsFetched: number; sitemapsSkipped: number; }; success: true; urls: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `domain: string`\n - `meta: { errors: number; sitemapsDiscovered: number; sitemapsFetched: number; sitemapsSkipped: number; }`\n - `success: true`\n - `urls: string[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeSitemap({ domain: 'xxx' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->webScrapeSitemap', - example: - "web->webScrapeSitemap(\n domain: 'xxx',\n headers: ['foo' => 'J!'],\n maxLinks: 1,\n search: 'help center and troubleshooting articles',\n sitemapURL: 'https://example.com',\n tags: ['production', 'team-alpha'],\n timeoutMs: 1,\n urlRegex: '^https?://[^/]+/blog/',\n zdr: 'enabled',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.WebScrapeSitemap', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.WebScrapeSitemap(context.TODO(), contextdev.WebWebScrapeSitemapParams{\n\t\tDomain: "xxx",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Domain)\n}\n', - }, - cli: { - method: 'web web_scrape_sitemap', - example: "context-dev web web-scrape-sitemap \\\n --api-key 'My API Key' \\\n --domain xxx", - }, - python: { - method: 'web.web_scrape_sitemap', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.web_scrape_sitemap(\n domain="xxx",\n)\nprint(response.domain)', - }, - ruby: { - method: 'web.web_scrape_sitemap', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.web_scrape_sitemap(domain: "xxx")\n\nputs(response)', - }, - typescript: { - method: 'client.web.webScrapeSitemap', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.webScrapeSitemap({ domain: 'xxx' });\n\nconsole.log(response.domain);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/scrape/sitemap \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'screenshot', - endpoint: '/web/screenshot', - httpMethod: 'get', - summary: 'Scrape Screenshot', - description: 'Capture a screenshot of a website.', - stainlessPath: '(resource) web > (method) screenshot', - qualified: 'client.web.screenshot', - params: [ - 'clearPopups?: boolean;', - "colorScheme?: 'light' | 'dark';", - 'country?: string;', - 'directUrl?: string;', - 'domain?: string;', - "fullScreenshot?: 'true' | 'false';", - 'handleCookiePopup?: boolean;', - 'maxAgeMs?: number;', - "page?: 'login' | 'signup' | 'blog' | 'careers' | 'pricing' | 'terms' | 'privacy' | 'contact';", - 'scrollOffset?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'viewport?: { height?: number; width?: number; };', - 'waitForMs?: number;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code?: number; domain?: string; height?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; screenshot?: string; screenshotType?: 'viewport' | 'fullPage'; status?: string; width?: number; }", - markdown: - "## screenshot\n\n`client.web.screenshot(clearPopups?: boolean, colorScheme?: 'light' | 'dark', country?: string, directUrl?: string, domain?: string, fullScreenshot?: 'true' | 'false', handleCookiePopup?: boolean, maxAgeMs?: number, page?: 'login' | 'signup' | 'blog' | 'careers' | 'pricing' | 'terms' | 'privacy' | 'contact', scrollOffset?: number, tags?: string[], timeoutMS?: number, viewport?: { height?: number; width?: number; }, waitForMs?: number, zdr?: 'enabled' | 'disabled'): { cache_metadata: object; code?: number; domain?: string; height?: number; key_metadata?: object; screenshot?: string; screenshotType?: 'viewport' | 'fullPage'; status?: string; width?: number; }`\n\n**get** `/web/screenshot`\n\nCapture a screenshot of a website.\n\n### Parameters\n\n- `clearPopups?: boolean`\n Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently.\n\n- `colorScheme?: 'light' | 'dark'`\n Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.\n\n- `country?: string`\n Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).\n\n- `directUrl?: string`\n A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.\n\n- `domain?: string`\n Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.\n\n- `fullScreenshot?: 'true' | 'false'`\n Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).\n\n- `handleCookiePopup?: boolean`\n Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.\n\n- `maxAgeMs?: number`\n Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.\n\n- `page?: 'login' | 'signup' | 'blog' | 'careers' | 'pricing' | 'terms' | 'privacy' | 'contact'`\n Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.\n\n- `scrollOffset?: number`\n Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `viewport?: { height?: number; width?: number; }`\n Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.\n - `height?: number`\n Viewport height in pixels.\n - `width?: number`\n Viewport width in pixels.\n\n- `waitForMs?: number`\n Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code?: number; domain?: string; height?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; screenshot?: string; screenshotType?: 'viewport' | 'fullPage'; status?: string; width?: number; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `code?: number`\n - `domain?: string`\n - `height?: number`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `screenshot?: string`\n - `screenshotType?: 'viewport' | 'fullPage'`\n - `status?: string`\n - `width?: number`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.screenshot();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->screenshot', - example: - "web->screenshot(\n clearPopups: true,\n colorScheme: 'light',\n country: 'de',\n directURL: 'https://example.com',\n domain: 'xxx',\n fullScreenshot: 'true',\n handleCookiePopup: true,\n maxAgeMs: 0,\n page: 'login',\n scrollOffset: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1,\n viewport: ['height' => 240, 'width' => 240],\n waitForMs: 0,\n zdr: 'enabled',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.Screenshot', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.Screenshot(context.TODO(), contextdev.WebScreenshotParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Width)\n}\n', - }, - cli: { - method: 'web screenshot', - example: "context-dev web screenshot \\\n --api-key 'My API Key'", - }, - python: { - method: 'web.screenshot', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.screenshot()\nprint(response.width)', - }, - ruby: { - method: 'web.screenshot', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.screenshot\n\nputs(response)', - }, - typescript: { - method: 'client.web.screenshot', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.screenshot();\n\nconsole.log(response.width);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/screenshot \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'web_crawl_md', - endpoint: '/web/crawl', - httpMethod: 'post', - summary: 'Crawl Website & Scrape Markdown', - description: - 'Performs a crawl starting from a given URL, extracts page content as Markdown, and returns results for all crawled pages.', - stainlessPath: '(resource) web > (method) web_crawl_md', - qualified: 'client.web.webCrawlMd', - params: [ - 'url: string;', - 'country?: string;', - 'excludeSelectors?: string[];', - 'followSubdomains?: boolean;', - 'includeFrames?: boolean;', - 'includeImages?: boolean;', - 'includeLinks?: boolean;', - 'includeSelectors?: string[];', - 'maxAgeMs?: number;', - 'maxDepth?: number;', - 'maxPages?: number;', - 'pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; };', - 'settleAnimations?: boolean;', - 'shortenBase64Images?: boolean;', - 'stopAfterMs?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'urlRegex?: string;', - 'useMainContentOnly?: boolean;', - 'waitForMs?: number;', - "zdr?: 'enabled' | 'disabled';", - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; metadata: { maxCrawlDepth: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; }; results: { markdown: string; metadata: { crawlDepth: number; finalUrl: string; sourceUrl: string; statusCode: number; success: boolean; title: string; url: string; additionalMeta?: object; alternates?: object[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: object[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; twitter?: object; }; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## web_crawl_md\n\n`client.web.webCrawlMd(url: string, country?: string, excludeSelectors?: string[], followSubdomains?: boolean, includeFrames?: boolean, includeImages?: boolean, includeLinks?: boolean, includeSelectors?: string[], maxAgeMs?: number, maxDepth?: number, maxPages?: number, pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }, settleAnimations?: boolean, shortenBase64Images?: boolean, stopAfterMs?: number, tags?: string[], timeoutMS?: number, urlRegex?: string, useMainContentOnly?: boolean, waitForMs?: number, zdr?: 'enabled' | 'disabled'): { cache_metadata: object; metadata: object; results: object[]; key_metadata?: object; }`\n\n**post** `/web/crawl`\n\nPerforms a crawl starting from a given URL, extracts page content as Markdown, and returns results for all crawled pages.\n\n### Parameters\n\n- `url: string`\n The starting URL for the crawl (must include http:// or https:// protocol)\n\n- `country?: string`\n Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).\n\n- `excludeSelectors?: string[]`\n CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\".\n\n- `followSubdomains?: boolean`\n When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent.\n\n- `includeFrames?: boolean`\n When true, the contents of iframes are rendered to Markdown for each crawled page.\n\n- `includeImages?: boolean`\n Include image references in the Markdown output\n\n- `includeLinks?: boolean`\n Preserve hyperlinks in the Markdown output\n\n- `includeSelectors?: string[]`\n CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before each crawled page is converted to Markdown. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\".\n\n- `maxAgeMs?: number`\n Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.\n\n- `maxDepth?: number`\n Maximum link depth from the starting URL (0 = only the starting page)\n\n- `maxPages?: number`\n Maximum number of pages to crawl. Hard cap: 500.\n\n- `pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }`\n PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.\n - `end?: number`\n Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.\n - `ocr?: boolean`\n When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost.\n - `shouldParse?: boolean`\n When true, PDF pages are fetched and parsed. When false, PDF pages are skipped entirely (not included in results and not counted as failures).\n - `start?: number`\n First 1-based PDF page to parse. When omitted, parsing starts at the first page.\n\n- `settleAnimations?: boolean`\n When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.\n\n- `shortenBase64Images?: boolean`\n Truncate base64-encoded image data in the Markdown output\n\n- `stopAfterMs?: number`\n Soft time budget for the crawl in milliseconds. After each scrape, the crawler checks the elapsed time and, if exceeded, returns the pages collected so far instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `urlRegex?: string`\n Regex pattern. Only URLs matching this pattern will be followed and scraped. An automatic prefix scope in the form ^ follows a redirect of the starting page.\n\n- `useMainContentOnly?: boolean`\n Extract only the main content, stripping headers, footers, sidebars, and navigation\n\n- `waitForMs?: number`\n Browser wait time in milliseconds after initial page load for each crawled page. Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).\n\n- `zdr?: 'enabled' | 'disabled'`\n Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; metadata: { maxCrawlDepth: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; }; results: { markdown: string; metadata: { crawlDepth: number; finalUrl: string; sourceUrl: string; statusCode: number; success: boolean; title: string; url: string; additionalMeta?: object; alternates?: object[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: object[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; twitter?: object; }; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `metadata: { maxCrawlDepth: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; }`\n - `results: { markdown: string; metadata: { crawlDepth: number; finalUrl: string; sourceUrl: string; statusCode: number; success: boolean; title: string; url: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; twitter?: object; }; }[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webCrawlMd({ url: 'https://example.com' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->webCrawlMd', - example: - "web->webCrawlMd(\n url: 'https://example.com',\n country: 'de',\n excludeSelectors: ['string'],\n followSubdomains: true,\n includeFrames: true,\n includeImages: true,\n includeLinks: true,\n includeSelectors: ['string'],\n maxAgeMs: 0,\n maxDepth: 0,\n maxPages: 1,\n pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n settleAnimations: true,\n shortenBase64Images: true,\n stopAfterMs: 10000,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n urlRegex: '^https?://[^/]+/blog/',\n useMainContentOnly: true,\n waitForMs: 0,\n zdr: 'enabled',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.WebCrawlMd', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.WebCrawlMd(context.TODO(), contextdev.WebWebCrawlMdParams{\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web web_crawl_md', - example: "context-dev web web-crawl-md \\\n --api-key 'My API Key' \\\n --url https://example.com", - }, - python: { - method: 'web.web_crawl_md', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.web_crawl_md(\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.web_crawl_md', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.web_crawl_md(url: "https://example.com")\n\nputs(response)', - }, - typescript: { - method: 'client.web.webCrawlMd', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.webCrawlMd({ url: 'https://example.com' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/crawl \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "url": "https://example.com",\n "country": "de",\n "tags": [\n "production",\n "team-alpha"\n ],\n "urlRegex": "^https?://[^/]+/blog/"\n }\'', - }, - }, - }, - { - name: 'extract_fonts', - endpoint: '/web/fonts', - httpMethod: 'get', - summary: 'Scrape Fonts', - description: - 'Scrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.', - stainlessPath: '(resource) web > (method) extract_fonts', - qualified: 'client.web.extractFonts', - params: [ - 'directUrl?: string;', - 'domain?: string;', - 'maxAgeMs?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code: number; domain: string; fonts: { fallbacks: string[]; font: string; num_elements: number; num_words: number; percent_elements: number; percent_words: number; uses: string[]; }[]; status: string; fontLinks?: object; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## extract_fonts\n\n`client.web.extractFonts(directUrl?: string, domain?: string, maxAgeMs?: number, tags?: string[], timeoutMS?: number): { cache_metadata: object; code: number; domain: string; fonts: object[]; status: string; fontLinks?: object; key_metadata?: object; }`\n\n**get** `/web/fonts`\n\nScrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.\n\n### Parameters\n\n- `directUrl?: string`\n A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, fonts are extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.\n\n- `domain?: string`\n Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.\n\n- `maxAgeMs?: number`\n Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code: number; domain: string; fonts: { fallbacks: string[]; font: string; num_elements: number; num_words: number; percent_elements: number; percent_words: number; uses: string[]; }[]; status: string; fontLinks?: object; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `code: number`\n - `domain: string`\n - `fonts: { fallbacks: string[]; font: string; num_elements: number; num_words: number; percent_elements: number; percent_words: number; uses: string[]; }[]`\n - `status: string`\n - `fontLinks?: object`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.extractFonts();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->extractFonts', - example: - "web->extractFonts(\n directURL: 'https://example.com',\n domain: 'xxx',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.ExtractFonts', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.ExtractFonts(context.TODO(), contextdev.WebExtractFontsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web extract_fonts', - example: "context-dev web extract-fonts \\\n --api-key 'My API Key'", - }, - python: { - method: 'web.extract_fonts', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.extract_fonts()\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.extract_fonts', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.extract_fonts\n\nputs(response)', - }, - typescript: { - method: 'client.web.extractFonts', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractFonts();\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/fonts \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'extract_styleguide', - endpoint: '/web/styleguide', - httpMethod: 'get', - summary: 'Scrape Styleguide', - description: - 'Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.', - stainlessPath: '(resource) web > (method) extract_styleguide', - qualified: 'client.web.extractStyleguide', - params: [ - "colorScheme?: 'light' | 'dark';", - 'directUrl?: string;', - 'domain?: string;', - 'maxAgeMs?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code?: number; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; styleguide?: { colors: { accent: string; background: string; text: string; }; components: { button: object; card?: object; }; elementSpacing: { lg: string; md: string; sm: string; xl: string; xs: string; }; fontLinks: object; mode: 'light' | 'dark'; shadows: { inner: string; lg: string; md: string; sm: string; xl: string; }; typography: { headings: object; p?: object; }; }; }", - markdown: - "## extract_styleguide\n\n`client.web.extractStyleguide(colorScheme?: 'light' | 'dark', directUrl?: string, domain?: string, maxAgeMs?: number, tags?: string[], timeoutMS?: number): { cache_metadata: object; code?: number; domain?: string; key_metadata?: object; status?: string; styleguide?: object; }`\n\n**get** `/web/styleguide`\n\nExtract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.\n\n### Parameters\n\n- `colorScheme?: 'light' | 'dark'`\n Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.\n\n- `directUrl?: string`\n A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.\n\n- `domain?: string`\n Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.\n\n- `maxAgeMs?: number`\n Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; code?: number; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; styleguide?: { colors: { accent: string; background: string; text: string; }; components: { button: object; card?: object; }; elementSpacing: { lg: string; md: string; sm: string; xl: string; xs: string; }; fontLinks: object; mode: 'light' | 'dark'; shadows: { inner: string; lg: string; md: string; sm: string; xl: string; }; typography: { headings: object; p?: object; }; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `code?: number`\n - `domain?: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `status?: string`\n - `styleguide?: { colors: { accent: string; background: string; text: string; }; components: { button: { link?: { backgroundColor: string; borderColor: string; borderRadius: string; borderStyle: string; borderWidth: string; boxShadow: string; color: string; css: string; fontSize: string; fontWeight: number; minHeight: string; minWidth: string; padding: string; textDecoration: string; fontFallbacks?: string[]; fontFamily?: string; textDecorationColor?: string; }; primary?: { backgroundColor: string; borderColor: string; borderRadius: string; borderStyle: string; borderWidth: string; boxShadow: string; color: string; css: string; fontSize: string; fontWeight: number; minHeight: string; minWidth: string; padding: string; textDecoration: string; fontFallbacks?: string[]; fontFamily?: string; textDecorationColor?: string; }; secondary?: { backgroundColor: string; borderColor: string; borderRadius: string; borderStyle: string; borderWidth: string; boxShadow: string; color: string; css: string; fontSize: string; fontWeight: number; minHeight: string; minWidth: string; padding: string; textDecoration: string; fontFallbacks?: string[]; fontFamily?: string; textDecorationColor?: string; }; }; card?: { backgroundColor: string; borderColor: string; borderRadius: string; borderStyle: string; borderWidth: string; boxShadow: string; css: string; padding: string; textColor: string; }; }; elementSpacing: { lg: string; md: string; sm: string; xl: string; xs: string; }; fontLinks: object; mode: 'light' | 'dark'; shadows: { inner: string; lg: string; md: string; sm: string; xl: string; }; typography: { headings: { h1?: { fontFallbacks: string[]; fontFamily: string; fontSize: string; fontWeight: number; letterSpacing: string; lineHeight: string; }; h2?: { fontFallbacks: string[]; fontFamily: string; fontSize: string; fontWeight: number; letterSpacing: string; lineHeight: string; }; h3?: { fontFallbacks: string[]; fontFamily: string; fontSize: string; fontWeight: number; letterSpacing: string; lineHeight: string; }; h4?: { fontFallbacks: string[]; fontFamily: string; fontSize: string; fontWeight: number; letterSpacing: string; lineHeight: string; }; }; p?: { fontFallbacks: string[]; fontFamily: string; fontSize: string; fontWeight: number; letterSpacing: string; lineHeight: string; }; }; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.extractStyleguide();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->extractStyleguide', - example: - "web->extractStyleguide(\n colorScheme: 'light',\n directURL: 'https://example.com',\n domain: 'xxx',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.ExtractStyleguide', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.ExtractStyleguide(context.TODO(), contextdev.WebExtractStyleguideParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Styleguide)\n}\n', - }, - cli: { - method: 'web extract_styleguide', - example: "context-dev web extract-styleguide \\\n --api-key 'My API Key'", - }, - python: { - method: 'web.extract_styleguide', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.extract_styleguide()\nprint(response.styleguide)', - }, - ruby: { - method: 'web.extract_styleguide', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.extract_styleguide\n\nputs(response)', - }, - typescript: { - method: 'client.web.extractStyleguide', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractStyleguide();\n\nconsole.log(response.styleguide);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/styleguide \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'search', - endpoint: '/web/search', - httpMethod: 'post', - summary: 'Web Search', - description: 'Search the web and optionally scrape each result to Markdown in one round-trip.', - stainlessPath: '(resource) web > (method) search', - qualified: 'client.web.search', - params: [ - 'query: string;', - 'country?: string;', - 'excludeDomains?: string[];', - "freshness?: 'last_24_hours' | 'last_week' | 'last_month' | 'last_year';", - 'includeDomains?: string[];', - 'markdownOptions?: { enabled?: boolean; includeFrames?: boolean; includeImages?: boolean; includeLinks?: boolean; maxAgeMs?: number; pdf?: { end?: number; shouldParse?: boolean; start?: number; }; shortenBase64Images?: boolean; timeoutMS?: number; useMainContentOnly?: boolean; waitForMs?: number; };', - 'numResults?: number;', - 'queryFanout?: boolean;', - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; query: string; results: { description: string; markdown: { code: 'SUCCESS' | 'NOT_REQUESTED' | 'TIMEOUT' | 'CONTENT_TOO_LARGE' | 'WEBSITE_ACCESS_ERROR' | 'ERROR'; markdown: string; }; relevance: 'high' | 'medium' | 'low'; title: string; url: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## search\n\n`client.web.search(query: string, country?: string, excludeDomains?: string[], freshness?: 'last_24_hours' | 'last_week' | 'last_month' | 'last_year', includeDomains?: string[], markdownOptions?: { enabled?: boolean; includeFrames?: boolean; includeImages?: boolean; includeLinks?: boolean; maxAgeMs?: number; pdf?: { end?: number; shouldParse?: boolean; start?: number; }; shortenBase64Images?: boolean; timeoutMS?: number; useMainContentOnly?: boolean; waitForMs?: number; }, numResults?: number, queryFanout?: boolean, tags?: string[], timeoutMS?: number): { cache_metadata: object; query: string; results: object[]; key_metadata?: object; }`\n\n**post** `/web/search`\n\nSearch the web and optionally scrape each result to Markdown in one round-trip.\n\n### Parameters\n\n- `query: string`\n Search query. Accepts natural language as well as Google-style search operators such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.\n\n- `country?: string`\n Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: \"us\", \"gb\", \"de\".\n\n- `excludeDomains?: string[]`\n Blocklist — drop results from these domains. Example: [\"pinterest.com\", \"reddit.com\"].\n\n- `freshness?: 'last_24_hours' | 'last_week' | 'last_month' | 'last_year'`\n Restrict results to content published within this window.\n\n- `includeDomains?: string[]`\n Allowlist — only return results from these domains. Example: [\"arxiv.org\", \"github.com\"].\n\n- `markdownOptions?: { enabled?: boolean; includeFrames?: boolean; includeImages?: boolean; includeLinks?: boolean; maxAgeMs?: number; pdf?: { end?: number; shouldParse?: boolean; start?: number; }; shortenBase64Images?: boolean; timeoutMS?: number; useMainContentOnly?: boolean; waitForMs?: number; }`\n Inline Markdown scraping for each result. Set `enabled: true` to activate.\n - `enabled?: boolean`\n Scrape each result to Markdown. Off by default to keep search cheap and fast.\n - `includeFrames?: boolean`\n Render iframe contents into the Markdown.\n - `includeImages?: boolean`\n Emit image references in the Markdown.\n - `includeLinks?: boolean`\n Keep hyperlinks in the Markdown.\n - `maxAgeMs?: number`\n Cache TTL in ms for scraped Markdown keyed by URL + options. Default 1 day, max 30 days. Set to 0 to force a fresh scrape.\n - `pdf?: { end?: number; shouldParse?: boolean; start?: number; }`\n PDF handling. Use start/end to bound text extraction and OCR to a page range.\n - `shortenBase64Images?: boolean`\n Truncate inline base64 image payloads to keep responses small.\n - `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n - `useMainContentOnly?: boolean`\n Strip nav, header, footer, and sidebar — keep only the primary article content.\n - `waitForMs?: number`\n Extra wait after page load before rendering, in ms (0–30000). Useful for JS-heavy pages.\n\n- `numResults?: number`\n Number of results to request and return (10–100). Defaults to 10.\n\n- `queryFanout?: boolean`\n Expand the query into multiple parallel variants for broader recall.\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; query: string; results: { description: string; markdown: { code: 'SUCCESS' | 'NOT_REQUESTED' | 'TIMEOUT' | 'CONTENT_TOO_LARGE' | 'WEBSITE_ACCESS_ERROR' | 'ERROR'; markdown: string; }; relevance: 'high' | 'medium' | 'low'; title: string; url: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `query: string`\n - `results: { description: string; markdown: { code: 'SUCCESS' | 'NOT_REQUESTED' | 'TIMEOUT' | 'CONTENT_TOO_LARGE' | 'WEBSITE_ACCESS_ERROR' | 'ERROR'; markdown: string; }; relevance: 'high' | 'medium' | 'low'; title: string; url: string; }[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.search({ query: 'x' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->search', - example: - "web->search(\n query: 'x',\n country: 'af',\n excludeDomains: ['string'],\n freshness: 'last_24_hours',\n includeDomains: ['string'],\n markdownOptions: [\n 'enabled' => true,\n 'includeFrames' => true,\n 'includeImages' => true,\n 'includeLinks' => true,\n 'maxAgeMs' => 0,\n 'pdf' => ['end' => 1, 'shouldParse' => true, 'start' => 1],\n 'shortenBase64Images' => true,\n 'timeoutMs' => 1000,\n 'useMainContentOnly' => true,\n 'waitForMs' => 0,\n ],\n numResults: 10,\n queryFanout: true,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.Search', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.Search(context.TODO(), contextdev.WebSearchParams{\n\t\tQuery: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web search', - example: "context-dev web search \\\n --api-key 'My API Key' \\\n --query x", - }, - python: { - method: 'web.search', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.search(\n query="x",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.search', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.search(query: "x")\n\nputs(response)', - }, - typescript: { - method: 'client.web.search', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.search({ query: 'x' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/search \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "query": "x",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'extract', - endpoint: '/web/extract', - httpMethod: 'post', - summary: 'Extract Structured Website Data', - description: - 'Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.', - stainlessPath: '(resource) web > (method) extract', - qualified: 'client.web.extract', - params: [ - 'schema: object;', - 'url: string;', - "actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[];", - 'factCheck?: boolean;', - 'followSubdomains?: boolean;', - 'includeFrames?: boolean;', - 'instructions?: string;', - 'maxAgeMs?: number;', - 'maxDepth?: number;', - 'maxPages?: number;', - 'pdf?: { end?: number; shouldParse?: boolean; start?: number; };', - 'settleAnimations?: boolean;', - 'stopAfterMs?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - 'waitForMs?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; data: object; metadata: { maxCrawlDepth: number; numBlocked: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; }; status: string; url: string; urls_analyzed: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## extract\n\n`client.web.extract(schema: object, url: string, actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[], factCheck?: boolean, followSubdomains?: boolean, includeFrames?: boolean, instructions?: string, maxAgeMs?: number, maxDepth?: number, maxPages?: number, pdf?: { end?: number; shouldParse?: boolean; start?: number; }, settleAnimations?: boolean, stopAfterMs?: number, tags?: string[], timeoutMS?: number, waitForMs?: number): { cache_metadata: object; data: object; metadata: object; status: string; url: string; urls_analyzed: string[]; key_metadata?: object; }`\n\n**post** `/web/extract`\n\nCrawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.\n\n### Parameters\n\n- `schema: object`\n JSON Schema for the returned data object. Image fields such as `image_urls` or `product_photos` automatically make page image references available to extraction, so product data and photos can be returned in one call. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.\n\n- `url: string`\n The starting website URL to crawl and extract from. Must include http:// or https://.\n\n- `actions?: { do: 'wait'; timeMs: number; } | { action: string; do: 'perform'; } | { do: 'scroll'; amount?: number | 'viewport' | 'max'; container?: string; direction?: 'up' | 'down' | 'left' | 'right'; maxScrolls?: number; }[]`\n Optional browser actions executed in order on the requested page after it loads, before links are discovered or additional pages are crawled. Requires a paid plan. When actions are provided and stopAfterMs is omitted, the crawl budget defaults to 110000 ms.\n\n- `factCheck?: boolean`\n When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source.\n\n- `followSubdomains?: boolean`\n When true, follow links on subdomains of the starting URL's domain.\n\n- `includeFrames?: boolean`\n When true, iframe contents are included in Markdown before extraction.\n\n- `instructions?: string`\n Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema.\n\n- `maxAgeMs?: number`\n Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms).\n\n- `maxDepth?: number`\n Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit.\n\n- `maxPages?: number`\n Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.\n\n- `pdf?: { end?: number; shouldParse?: boolean; start?: number; }`\n - `end?: number`\n Last 1-based PDF page to parse. Must be greater than or equal to start when both are provided.\n - `shouldParse?: boolean`\n When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.\n - `start?: number`\n First 1-based PDF page to parse.\n\n- `settleAnimations?: boolean`\n When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.\n\n- `stopAfterMs?: number`\n Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are provided.\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `waitForMs?: number`\n Optional browser wait time in milliseconds after initial page load for each crawled page.\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; data: object; metadata: { maxCrawlDepth: number; numBlocked: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; }; status: string; url: string; urls_analyzed: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `data: object`\n - `metadata: { maxCrawlDepth: number; numBlocked: number; numFailed: number; numSkipped: number; numSucceeded: number; numUrls: number; actionsApplied?: { instruction: string; status: 'applied' | 'failed' | 'skipped'; completionEvidence?: string; durationMs?: number; error?: string; method?: string; targetDescription?: string; }[]; }`\n - `status: string`\n - `url: string`\n - `urls_analyzed: string[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.extract({\n schema: {\n type: 'bar',\n properties: 'bar',\n required: 'bar',\n additionalProperties: 'bar',\n},\n url: 'https://example.com',\n});\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->extract', - example: - "web->extract(\n schema: [\n 'type' => 'bar',\n 'properties' => 'bar',\n 'required' => 'bar',\n 'additionalProperties' => 'bar',\n ],\n url: 'https://example.com',\n actions: [['do' => 'wait', 'timeMs' => 0]],\n factCheck: true,\n followSubdomains: true,\n includeFrames: true,\n instructions: 'instructions',\n maxAgeMs: 0,\n maxDepth: 0,\n maxPages: 1,\n pdf: ['end' => 1, 'shouldParse' => true, 'start' => 1],\n settleAnimations: true,\n stopAfterMs: 10000,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n waitForMs: 0,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.Extract', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.Extract(context.TODO(), contextdev.WebExtractParams{\n\t\tSchema: map[string]any{\n\t\t\t"type": "bar",\n\t\t\t"properties": "bar",\n\t\t\t"required": "bar",\n\t\t\t"additionalProperties": "bar",\n\t\t},\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'web extract', - example: - "context-dev web extract \\\n --api-key 'My API Key' \\\n --schema '{type: bar, properties: bar, required: bar, additionalProperties: bar}' \\\n --url https://example.com", - }, - python: { - method: 'web.extract', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.extract(\n schema={\n "type": "bar",\n "properties": "bar",\n "required": "bar",\n "additionalProperties": "bar",\n },\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'web.extract', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.extract(\n schema: {type: "bar", properties: "bar", required: "bar", additionalProperties: "bar"},\n url: "https://example.com"\n)\n\nputs(response)', - }, - typescript: { - method: 'client.web.extract', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extract({\n schema: {\n type: 'bar',\n properties: 'bar',\n required: 'bar',\n additionalProperties: 'bar',\n },\n url: 'https://example.com',\n});\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/extract \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "schema": {\n "type": "bar",\n "properties": "bar",\n "required": "bar",\n "additionalProperties": "bar"\n },\n "url": "https://example.com",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'extract_competitors', - endpoint: '/web/competitors', - httpMethod: 'get', - summary: 'Find website competitors', - description: - "Analyze a company's landing page and web search evidence to return direct competitors for the same product or market.", - stainlessPath: '(resource) web > (method) extract_competitors', - qualified: 'client.web.extractCompetitors', - params: ['domain: string;', 'numCompetitors?: number;', 'tags?: string[];', 'timeoutMS?: number;'], - response: - "{ competitors: { confidence: 'high' | 'medium'; description: string; domain: string; name: string; sourceUrls: string[]; url: string; }[]; domain: string; status: 'ok'; target: { companyName: string; field: string; fieldDescription: string; websiteUrl: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## extract_competitors\n\n`client.web.extractCompetitors(domain: string, numCompetitors?: number, tags?: string[], timeoutMS?: number): { competitors: object[]; domain: string; status: 'ok'; target: object; key_metadata?: object; }`\n\n**get** `/web/competitors`\n\nAnalyze a company's landing page and web search evidence to return direct competitors for the same product or market.\n\n### Parameters\n\n- `domain: string`\n Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted and normalized to their domain.\n\n- `numCompetitors?: number`\n Exact number of direct competitors to return. Defaults to 5.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ competitors: { confidence: 'high' | 'medium'; description: string; domain: string; name: string; sourceUrls: string[]; url: string; }[]; domain: string; status: 'ok'; target: { companyName: string; field: string; fieldDescription: string; websiteUrl: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `competitors: { confidence: 'high' | 'medium'; description: string; domain: string; name: string; sourceUrls: string[]; url: string; }[]`\n - `domain: string`\n - `status: 'ok'`\n - `target: { companyName: string; field: string; fieldDescription: string; websiteUrl: string; }`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.extractCompetitors({ domain: 'xxx' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'web->extractCompetitors', - example: - "web->extractCompetitors(\n domain: 'xxx',\n numCompetitors: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Web.ExtractCompetitors', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Web.ExtractCompetitors(context.TODO(), contextdev.WebExtractCompetitorsParams{\n\t\tDomain: "xxx",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Competitors)\n}\n', - }, - cli: { - method: 'web extract_competitors', - example: "context-dev web extract-competitors \\\n --api-key 'My API Key' \\\n --domain xxx", - }, - python: { - method: 'web.extract_competitors', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.web.extract_competitors(\n domain="xxx",\n)\nprint(response.competitors)', - }, - ruby: { - method: 'web.extract_competitors', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.web.extract_competitors(domain: "xxx")\n\nputs(response)', - }, - typescript: { - method: 'client.web.extractCompetitors', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractCompetitors({ domain: 'xxx' });\n\nconsole.log(response.competitors);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/competitors \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'extract_products', - endpoint: '/brand/ai/products', - httpMethod: 'post', - summary: "Extract products from a brand's website", - description: - "Extract product information from a brand's website. We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more.", - stainlessPath: '(resource) ai > (method) extract_products', - qualified: 'client.ai.extractProducts', - params: [ - '{ domain: string; maxAgeMs?: number; maxProducts?: number; tags?: string[]; timeoutMS?: number; } | { directUrl: string; maxAgeMs?: number; maxProducts?: number; tags?: string[]; timeoutMS?: number; };', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; products?: { description: string; features: string[]; images: string[]; name: string; sku: string; tags: string[]; target_audience: string[]; availability?: string; billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based'; category?: string; currency?: string; dimensions?: string[]; image_url?: string; price?: number; pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom'; regular_price?: number; url?: string; }[]; }", - perLanguage: { - php: { - method: 'ai->extractProducts', - example: - "ai->extractProducts(\n domain: 'domain',\n maxAgeMs: 0,\n maxProducts: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n directURL: 'https://example.com',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.AI.ExtractProducts', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.AI.ExtractProducts(context.TODO(), contextdev.AIExtractProductsParams{\n\t\tOfByDomain: &contextdev.AIExtractProductsParamsBodyByDomain{\n\t\t\tDomain: "domain",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'ai extract_products', - example: - "context-dev ai extract-products \\\n --api-key 'My API Key' \\\n --domain domain \\\n --direct-url https://example.com", - }, - python: { - method: 'ai.extract_products', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.ai.extract_products(\n domain="domain",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'ai.extract_products', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.ai.extract_products(body: {domain: "domain"})\n\nputs(response)', - }, - typescript: { - method: 'client.ai.extractProducts', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.extractProducts({ domain: 'domain' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/brand/ai/products \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "domain": "domain",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'extract_product', - endpoint: '/brand/ai/product', - httpMethod: 'post', - summary: 'Extract a single product from a URL', - description: - 'Given a single URL, determines if it is a product page and extracts the product information.', - stainlessPath: '(resource) ai > (method) extract_product', - qualified: 'client.ai.extractProduct', - params: ['url: string;', 'maxAgeMs?: number;', 'tags?: string[];', 'timeoutMS?: number;'], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; is_product_page?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; platform?: 'amazon' | 'tiktok_shop' | 'etsy' | 'generic'; product?: { description: string; features: string[]; images: string[]; name: string; sku: string; tags: string[]; target_audience: string[]; availability?: string; billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based'; category?: string; currency?: string; dimensions?: string[]; image_url?: string; price?: number; pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom'; regular_price?: number; url?: string; }; }", - markdown: - "## extract_product\n\n`client.ai.extractProduct(url: string, maxAgeMs?: number, tags?: string[], timeoutMS?: number): { cache_metadata: object; is_product_page?: boolean; key_metadata?: object; platform?: 'amazon' | 'tiktok_shop' | 'etsy' | 'generic'; product?: object; }`\n\n**post** `/brand/ai/product`\n\nGiven a single URL, determines if it is a product page and extracts the product information.\n\n### Parameters\n\n- `url: string`\n The product page URL to extract product data from.\n\n- `maxAgeMs?: number`\n Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; is_product_page?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; platform?: 'amazon' | 'tiktok_shop' | 'etsy' | 'generic'; product?: { description: string; features: string[]; images: string[]; name: string; sku: string; tags: string[]; target_audience: string[]; availability?: string; billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based'; category?: string; currency?: string; dimensions?: string[]; image_url?: string; price?: number; pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom'; regular_price?: number; url?: string; }; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `is_product_page?: boolean`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `platform?: 'amazon' | 'tiktok_shop' | 'etsy' | 'generic'`\n - `product?: { description: string; features: string[]; images: string[]; name: string; sku: string; tags: string[]; target_audience: string[]; availability?: string; billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based'; category?: string; currency?: string; dimensions?: string[]; image_url?: string; price?: number; pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom'; regular_price?: number; url?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.ai.extractProduct({ url: 'https://example.com' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'ai->extractProduct', - example: - "ai->extractProduct(\n url: 'https://example.com',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.AI.ExtractProduct', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.AI.ExtractProduct(context.TODO(), contextdev.AIExtractProductParams{\n\t\tURL: "https://example.com",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'ai extract_product', - example: - "context-dev ai extract-product \\\n --api-key 'My API Key' \\\n --url https://example.com", - }, - python: { - method: 'ai.extract_product', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.ai.extract_product(\n url="https://example.com",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'ai.extract_product', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.ai.extract_product(url: "https://example.com")\n\nputs(response)', - }, - typescript: { - method: 'client.ai.extractProduct', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.extractProduct({ url: 'https://example.com' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/brand/ai/product \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "url": "https://example.com",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'retrieve', - endpoint: '/brand/retrieve', - httpMethod: 'post', - summary: 'Retrieve brand data', - description: - 'Retrieve logos, backdrops, colors, industry, description, and more. Provide exactly one lookup identifier in the request body: a domain, company name, email address, stock ticker, transaction descriptor, or direct URL. Note: `by_direct_url` fetches brand data only from the provided URL — not from the entire internet.', - stainlessPath: '(resource) brand > (method) retrieve', - qualified: 'client.brand.retrieve', - params: [ - "{ domain: string; type: 'by_domain'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; tags?: string[]; timeoutMS?: number; } | { name: string; type: 'by_name'; country_gl?: string; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; tags?: string[]; timeoutMS?: number; } | { email: string; type: 'by_email'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; tags?: string[]; timeoutMS?: number; } | { ticker: string; type: 'by_ticker'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; tags?: string[]; ticker_exchange?: string; timeoutMS?: number; } | { direct_url: string; type: 'by_direct_url'; tags?: string[]; timeoutMS?: number; } | { transaction_info: string; type: 'by_transaction'; city?: string; country_gl?: string; force_language?: string; high_confidence_only?: boolean; maxSpeed?: boolean; mcc?: string | number; phone?: string | number; tags?: string[]; timeoutMS?: number; };", - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; brand?: { address?: { city?: string; country?: string; country_code?: string; postal_code?: string; state_code?: string; state_province?: string; street?: string; }; backdrops?: { colors?: object[]; resolution?: object; url?: string; }[]; colors?: { hex?: string; name?: string; source?: 'site' | 'logo'; }[]; description?: string; domain?: string; email?: string; employees?: { exact?: number; range?: string; }; industries?: { eic?: object[]; }; is_nsfw?: boolean; links?: { blog?: string; careers?: string; contact?: string; pricing?: string; privacy?: string; terms?: string; }; logos?: { colors?: object[]; mode?: 'light' | 'dark' | 'has_opaque_background'; resolution?: object; type?: 'icon' | 'logo'; url?: string; }[]; phone?: string; primary_language?: string; slogan?: string; socials?: { type?: string; url?: string; }[]; stock?: { exchange?: string; ticker?: string; }; title?: string; }; code?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; }", - perLanguage: { - php: { - method: 'brand->retrieve', - example: - "brand->retrieve(\n domain: 'xxx',\n type: 'by_transaction',\n forceLanguage: 'afrikaans',\n maxAgeMs: 0,\n maxSpeed: true,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n name: 'xxx',\n countryGl: 'country_gl',\n email: 'dev@stainless.com',\n ticker: 'ticker',\n tickerExchange: 'ticker_exchange',\n directURL: 'https://example.com',\n transactionInfo: 'xxx',\n city: 'city',\n highConfidenceOnly: true,\n mcc: 'string',\n phone: 'string',\n);\n\nvar_dump($brand);", - }, - go: { - method: 'client.Brand.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbrand, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: "stripe.com",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brand.CacheMetadata)\n}\n', - }, - cli: { - method: 'brand retrieve', - example: - "context-dev brand retrieve \\\n --api-key 'My API Key' \\\n --domain xxx \\\n --type by_domain \\\n --name xxx \\\n --email dev@stainless.com \\\n --ticker ticker \\\n --direct-url https://example.com \\\n --transaction-info xxx", - }, - python: { - method: 'brand.retrieve', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nbrand = client.brand.retrieve(\n domain="stripe.com",\n type="by_domain",\n)\nprint(brand.cache_metadata)', - }, - ruby: { - method: 'brand.retrieve', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nbrand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: :by_domain})\n\nputs(brand)', - }, - typescript: { - method: 'client.brand.retrieve', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst brand = await client.brand.retrieve({ domain: 'stripe.com', type: 'by_domain' });\n\nconsole.log(brand.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/brand/retrieve \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "domain": "xxx",\n "type": "by_domain",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'search', - endpoint: '/brand/search', - httpMethod: 'get', - summary: 'Brand Search', - description: 'Search indexed brands by name or domain', - stainlessPath: '(resource) brand > (method) search', - qualified: 'client.brand.search', - params: [ - 'query: string;', - 'autocomplete?: boolean;', - "queryBy?: 'name' | 'domain'[];", - 'tags?: string[];', - 'typoTolerance?: number;', - ], - response: - '{ results: { domain: string; logo: string; name: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }', - markdown: - "## search\n\n`client.brand.search(query: string, autocomplete?: boolean, queryBy?: 'name' | 'domain'[], tags?: string[], typoTolerance?: number): { results: object[]; key_metadata?: object; }`\n\n**get** `/brand/search`\n\nSearch indexed brands by name or domain\n\n### Parameters\n\n- `query: string`\n Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.com', 'nik').\n\n- `autocomplete?: boolean`\n Whether the search term matches by prefix, so partial words match as they are typed (e.g. 'nik' matches Nike). Set to false to match whole words only.\n\n- `queryBy?: 'name' | 'domain'[]`\n Fields to match the search term against, as a comma-separated list or repeated parameter: 'name', 'domain', or both. Defaults to both.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `typoTolerance?: number`\n Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no typo tolerance).\n\n### Returns\n\n- `{ results: { domain: string; logo: string; name: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `results: { domain: string; logo: string; name: string; }[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.brand.search({ query: 'x' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'brand->search', - example: - "brand->search(\n query: 'x',\n autocomplete: true,\n queryBy: ['name'],\n tags: ['production', 'team-alpha'],\n typoTolerance: 0,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Brand.Search', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Brand.Search(context.TODO(), contextdev.BrandSearchParams{\n\t\tQuery: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Results)\n}\n', - }, - cli: { - method: 'brand search', - example: "context-dev brand search \\\n --api-key 'My API Key' \\\n --query x", - }, - python: { - method: 'brand.search', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.brand.search(\n query="x",\n)\nprint(response.results)', - }, - ruby: { - method: 'brand.search', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.brand.search(query: "x")\n\nputs(response)', - }, - typescript: { - method: 'client.brand.search', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.brand.search({ query: 'x' });\n\nconsole.log(response.results);", - }, - http: { - example: - 'curl https://api.context.dev/v1/brand/search \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve_simplified', - endpoint: '/brand/retrieve-simplified', - httpMethod: 'get', - summary: 'Retrieve simplified brand data by domain', - description: - 'Returns a simplified version of brand data containing only essential information: domain, title, colors, logos, and backdrops. Optimized for faster responses and reduced data transfer.', - stainlessPath: '(resource) brand > (method) retrieve_simplified', - qualified: 'client.brand.retrieveSimplified', - params: [ - 'domain: string;', - 'maxAgeMs?: number;', - 'tags?: string[];', - "theme?: 'light' | 'dark';", - 'timeoutMS?: number;', - ], - response: - "{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; brand?: { backdrops?: { colors?: object[]; resolution?: object; url?: string; }[]; colors?: { hex?: string; name?: string; source?: 'site' | 'logo'; }[]; domain?: string; logos?: { colors?: object[]; mode?: 'light' | 'dark' | 'has_opaque_background'; resolution?: object; type?: 'icon' | 'logo'; url?: string; }[]; title?: string; }; code?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; }", - markdown: - "## retrieve_simplified\n\n`client.brand.retrieveSimplified(domain: string, maxAgeMs?: number, tags?: string[], theme?: 'light' | 'dark', timeoutMS?: number): { cache_metadata: object; brand?: object; code?: number; key_metadata?: object; status?: string; }`\n\n**get** `/brand/retrieve-simplified`\n\nReturns a simplified version of brand data containing only essential information: domain, title, colors, logos, and backdrops. Optimized for faster responses and reduced data transfer.\n\n### Parameters\n\n- `domain: string`\n Domain name to retrieve simplified brand data for\n\n- `maxAgeMs?: number`\n Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `theme?: 'light' | 'dark'`\n Optional theme preference used when selecting brand assets.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; brand?: { backdrops?: { colors?: object[]; resolution?: object; url?: string; }[]; colors?: { hex?: string; name?: string; source?: 'site' | 'logo'; }[]; domain?: string; logos?: { colors?: object[]; mode?: 'light' | 'dark' | 'has_opaque_background'; resolution?: object; type?: 'icon' | 'logo'; url?: string; }[]; title?: string; }; code?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; }`\n\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `brand?: { backdrops?: { colors?: { hex?: string; name?: string; }[]; resolution?: { aspect_ratio?: number; height?: number; width?: number; }; url?: string; }[]; colors?: { hex?: string; name?: string; source?: 'site' | 'logo'; }[]; domain?: string; logos?: { colors?: { hex?: string; name?: string; }[]; mode?: 'light' | 'dark' | 'has_opaque_background'; resolution?: { aspect_ratio?: number; height?: number; width?: number; }; type?: 'icon' | 'logo'; url?: string; }[]; title?: string; }`\n - `code?: number`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `status?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.brand.retrieveSimplified({ domain: 'xxx' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'brand->retrieveSimplified', - example: - "brand->retrieveSimplified(\n domain: 'xxx',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n theme: 'light',\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Brand.GetSimplified', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Brand.GetSimplified(context.TODO(), contextdev.BrandGetSimplifiedParams{\n\t\tDomain: "xxx",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.CacheMetadata)\n}\n', - }, - cli: { - method: 'brand retrieve_simplified', - example: "context-dev brand retrieve-simplified \\\n --api-key 'My API Key' \\\n --domain xxx", - }, - python: { - method: 'brand.retrieve_simplified', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.brand.retrieve_simplified(\n domain="xxx",\n)\nprint(response.cache_metadata)', - }, - ruby: { - method: 'brand.retrieve_simplified', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.brand.retrieve_simplified(domain: "xxx")\n\nputs(response)', - }, - typescript: { - method: 'client.brand.retrieveSimplified', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.brand.retrieveSimplified({ domain: 'xxx' });\n\nconsole.log(response.cache_metadata);", - }, - http: { - example: - 'curl https://api.context.dev/v1/brand/retrieve-simplified \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve_naics', - endpoint: '/web/naics', - httpMethod: 'get', - summary: 'Classify NAICS industries', - description: 'Classify any brand into 2022 NAICS industry codes from its domain or name.', - stainlessPath: '(resource) industry > (method) retrieve_naics', - qualified: 'client.industry.retrieveNaics', - params: [ - 'input: string;', - 'maxResults?: number;', - 'minResults?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; }[]; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; type?: string; }", - markdown: - "## retrieve_naics\n\n`client.industry.retrieveNaics(input: string, maxResults?: number, minResults?: number, tags?: string[], timeoutMS?: number): { codes?: object[]; domain?: string; key_metadata?: object; status?: string; type?: string; }`\n\n**get** `/web/naics`\n\nClassify any brand into 2022 NAICS industry codes from its domain or name.\n\n### Parameters\n\n- `input: string`\n Brand domain or title to retrieve NAICS code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.\n\n- `maxResults?: number`\n Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5.\n\n- `minResults?: number`\n Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; }[]; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; type?: string; }`\n\n - `codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; }[]`\n - `domain?: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `status?: string`\n - `type?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.industry.retrieveNaics({ input: 'xxxx' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'industry->retrieveNaics', - example: - "industry->retrieveNaics(\n input: 'xxxx',\n maxResults: 1,\n minResults: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Industry.GetNaics', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Industry.GetNaics(context.TODO(), contextdev.IndustryGetNaicsParams{\n\t\tInput: "xxxx",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Codes)\n}\n', - }, - cli: { - method: 'industry retrieve_naics', - example: "context-dev industry retrieve-naics \\\n --api-key 'My API Key' \\\n --input xxxx", - }, - python: { - method: 'industry.retrieve_naics', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.industry.retrieve_naics(\n input="xxxx",\n)\nprint(response.codes)', - }, - ruby: { - method: 'industry.retrieve_naics', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.industry.retrieve_naics(input: "xxxx")\n\nputs(response)', - }, - typescript: { - method: 'client.industry.retrieveNaics', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.industry.retrieveNaics({ input: 'xxxx' });\n\nconsole.log(response.codes);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/naics \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve_sic', - endpoint: '/web/sic', - httpMethod: 'get', - summary: 'Classify SIC industries', - description: - 'Classify any brand into Standard Industrial Classification (SIC) codes from its domain or name. Choose between the original SIC system (`original_sic`) or the latest SIC list maintained by the SEC (`latest_sec`).', - stainlessPath: '(resource) industry > (method) retrieve_sic', - qualified: 'client.industry.retrieveSic', - params: [ - 'input: string;', - 'maxResults?: number;', - 'minResults?: number;', - 'tags?: string[];', - 'timeoutMS?: number;', - "type?: 'original_sic' | 'latest_sec';", - ], - response: - "{ classification?: 'original_sic' | 'latest_sec'; codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; majorGroup?: string; majorGroupName?: string; office?: string; }[]; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; type?: string; }", - markdown: - "## retrieve_sic\n\n`client.industry.retrieveSic(input: string, maxResults?: number, minResults?: number, tags?: string[], timeoutMS?: number, type?: 'original_sic' | 'latest_sec'): { classification?: 'original_sic' | 'latest_sec'; codes?: object[]; domain?: string; key_metadata?: object; status?: string; type?: string; }`\n\n**get** `/web/sic`\n\nClassify any brand into Standard Industrial Classification (SIC) codes from its domain or name. Choose between the original SIC system (`original_sic`) or the latest SIC list maintained by the SEC (`latest_sec`).\n\n### Parameters\n\n- `input: string`\n Brand domain or title to retrieve SIC code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.\n\n- `maxResults?: number`\n Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.\n\n- `minResults?: number`\n Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n- `type?: 'original_sic' | 'latest_sec'`\n Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Industrial Classification system; `latest_sec` uses the current SIC list as published by the SEC. Defaults to `original_sic`.\n\n### Returns\n\n- `{ classification?: 'original_sic' | 'latest_sec'; codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; majorGroup?: string; majorGroupName?: string; office?: string; }[]; domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; type?: string; }`\n\n - `classification?: 'original_sic' | 'latest_sec'`\n - `codes?: { code: string; confidence: 'high' | 'medium' | 'low'; name: string; majorGroup?: string; majorGroupName?: string; office?: string; }[]`\n - `domain?: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `status?: string`\n - `type?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.industry.retrieveSic({ input: 'xxxx' });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'industry->retrieveSic', - example: - "industry->retrieveSic(\n input: 'xxxx',\n maxResults: 1,\n minResults: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n type: 'original_sic',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Industry.GetSic', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Industry.GetSic(context.TODO(), contextdev.IndustryGetSicParams{\n\t\tInput: "xxxx",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Classification)\n}\n', - }, - cli: { - method: 'industry retrieve_sic', - example: "context-dev industry retrieve-sic \\\n --api-key 'My API Key' \\\n --input xxxx", - }, - python: { - method: 'industry.retrieve_sic', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.industry.retrieve_sic(\n input="xxxx",\n)\nprint(response.classification)', - }, - ruby: { - method: 'industry.retrieve_sic', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.industry.retrieve_sic(input: "xxxx")\n\nputs(response)', - }, - typescript: { - method: 'client.industry.retrieveSic', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.industry.retrieveSic({ input: 'xxxx' });\n\nconsole.log(response.classification);", - }, - http: { - example: - 'curl https://api.context.dev/v1/web/sic \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'prefetch', - endpoint: '/utility/prefetch', - httpMethod: 'post', - summary: 'Prefetch data', - description: - "Signal that you may fetch data soon to improve latency. The type field selects what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a styleguide extraction) and identifier carries exactly one lookup key: a domain, or an email whose domain is extracted and validated (free email providers and disposable email addresses are not allowed).", - stainlessPath: '(resource) utility > (method) prefetch', - qualified: 'client.utility.prefetch', - params: [ - 'identifier: { domain: string; } | { email: string; };', - "type: 'brand' | 'styleguide';", - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; message?: string; status?: string; type?: 'brand' | 'styleguide'; }", - markdown: - "## prefetch\n\n`client.utility.prefetch(identifier: { domain: string; } | { email: string; }, type: 'brand' | 'styleguide', tags?: string[], timeoutMS?: number): { domain?: string; key_metadata?: object; message?: string; status?: string; type?: 'brand' | 'styleguide'; }`\n\n**post** `/utility/prefetch`\n\nSignal that you may fetch data soon to improve latency. The type field selects what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a styleguide extraction) and identifier carries exactly one lookup key: a domain, or an email whose domain is extracted and validated (free email providers and disposable email addresses are not allowed).\n\n### Parameters\n\n- `identifier: { domain: string; } | { email: string; }`\n Identifier of the target to prefetch. Provide exactly one of domain or email.\n\n- `type: 'brand' | 'styleguide'`\n What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the styleguide cache.\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ domain?: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; message?: string; status?: string; type?: 'brand' | 'styleguide'; }`\n\n - `domain?: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `message?: string`\n - `status?: string`\n - `type?: 'brand' | 'styleguide'`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.utility.prefetch({\n identifier: { domain: 'xxx' },\n type: 'brand',\n});\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'utility->prefetch', - example: - "utility->prefetch(\n identifier: ['domain' => 'xxx'],\n type: 'brand',\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Utility.Prefetch', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Utility.Prefetch(context.TODO(), contextdev.UtilityPrefetchParams{\n\t\tIdentifier: contextdev.UtilityPrefetchParamsIdentifierUnion{\n\t\t\tOfByDomain: &contextdev.UtilityPrefetchParamsIdentifierByDomain{\n\t\t\t\tDomain: "xxx",\n\t\t\t},\n\t\t},\n\t\tType: contextdev.UtilityPrefetchParamsTypeBrand,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Domain)\n}\n', - }, - cli: { - method: 'utility prefetch', - example: - "context-dev utility prefetch \\\n --api-key 'My API Key' \\\n --identifier '{domain: xxx}' \\\n --type brand", - }, - python: { - method: 'utility.prefetch', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.utility.prefetch(\n identifier={\n "domain": "xxx"\n },\n type="brand",\n)\nprint(response.domain)', - }, - ruby: { - method: 'utility.prefetch', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.utility.prefetch(identifier: {domain: "xxx"}, type: :brand)\n\nputs(response)', - }, - typescript: { - method: 'client.utility.prefetch', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.utility.prefetch({\n identifier: { domain: 'xxx' },\n type: 'brand',\n});\n\nconsole.log(response.domain);", - }, - http: { - example: - 'curl https://api.context.dev/v1/utility/prefetch \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "identifier": {\n "domain": "xxx"\n },\n "type": "brand",\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'create', - endpoint: '/monitors', - httpMethod: 'post', - summary: 'Create a monitor', - description: - 'Creates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.', - stainlessPath: '(resource) monitors > (method) create', - qualified: 'client.monitors.create', - params: [ - 'name: string;', - "target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; };", - "change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; };", - "mode?: 'web';", - "schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; };", - 'tags?: string[];', - "webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; };", - ], - response: - "{ id: string; change_detection: object | object; created_at: string; initial_run_id: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }", - markdown: - "## create\n\n`client.monitors.create(name: string, target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }, change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }, mode?: 'web', schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, tags?: string[], webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }): { id: string; change_detection: object | object; created_at: string; initial_run_id: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }`\n\n**post** `/monitors`\n\nCreates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.\n\n### Parameters\n\n- `name: string`\n\n- `target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `mode?: 'web'`\n Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.\n\n- `webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }`\n - `url: string`\n Webhook URL events are delivered to.\n - `events?: 'change.detected' | 'run.completed'[]`\n Events delivered to this endpoint. `change.detected` fires only when a run detects a change; `run.completed` fires on every completed run — including runs that detected no change — and embeds the change when one was detected. Defaults to `[\"change.detected\"]` when omitted.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; initial_run_id: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }; webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }`\n A newly created monitor plus `initial_run_id`, the id of the baseline run queued at creation.\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `initial_run_id: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }`\n - `webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.create({\n name: 'Acme pricing page',\n target: { type: 'page', url: 'https://acme.com/pricing' },\n});\n\nconsole.log(monitor);\n```", - perLanguage: { - php: { - method: 'monitors->create', - example: - "monitors->create(\n name: 'Acme pricing page',\n target: [\n 'type' => 'page',\n 'url' => 'https://acme.com/pricing',\n 'instructions' => 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.',\n 'normalizeWhitespace' => true,\n ],\n changeDetection: ['type' => 'exact'],\n mode: 'web',\n schedule: ['frequency' => 6, 'type' => 'interval', 'unit' => 'hours'],\n tags: ['pricing', 'competitor'],\n webhook: [\n 'url' => 'https://example.com/webhook',\n 'events' => ['change.detected', 'run.completed'],\n ],\n);\n\nvar_dump($monitor);", - }, - go: { - method: 'client.Monitors.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmonitor, err := client.Monitors.New(context.TODO(), contextdev.MonitorNewParams{\n\t\tName: "Acme pricing page",\n\t\tTarget: contextdev.MonitorNewParamsTargetUnion{\n\t\t\tOfPage: &contextdev.MonitorNewParamsTargetPage{\n\t\t\t\tURL: "https://acme.com/pricing",\n\t\t\t},\n\t\t},\n\t\tChangeDetection: contextdev.MonitorNewParamsChangeDetectionUnion{\n\t\t\tOfExact: &contextdev.MonitorNewParamsChangeDetectionExact{},\n\t\t},\n\t\tMode: contextdev.MonitorNewParamsModeWeb,\n\t\tSchedule: contextdev.MonitorNewParamsSchedule{\n\t\t\tType: "interval",\n\t\t\tFrequency: 6,\n\t\t\tUnit: "hours",\n\t\t},\n\t\tWebhook: contextdev.MonitorNewParamsWebhook{\n\t\t\tURL: "https://example.com/webhook",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitor.ID)\n}\n', - }, - cli: { - method: 'monitors create', - example: - "context-dev monitors create \\\n --api-key 'My API Key' \\\n --name 'Acme pricing page' \\\n --target '{type: page, url: https://acme.com/pricing}'", - }, - python: { - method: 'monitors.create', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nmonitor = client.monitors.create(\n name="Acme pricing page",\n target={\n "type": "page",\n "url": "https://acme.com/pricing",\n },\n change_detection={\n "type": "exact"\n },\n mode="web",\n schedule={\n "type": "interval",\n "frequency": 6,\n "unit": "hours",\n },\n webhook={\n "url": "https://example.com/webhook"\n },\n)\nprint(monitor.id)', - }, - ruby: { - method: 'monitors.create', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nmonitor = context_dev.monitors.create(\n name: "Acme pricing page",\n target: {type: :page, url: "https://acme.com/pricing"}\n)\n\nputs(monitor)', - }, - typescript: { - method: 'client.monitors.create', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitor = await client.monitors.create({\n name: 'Acme pricing page',\n target: { type: 'page', url: 'https://acme.com/pricing' },\n change_detection: { type: 'exact' },\n mode: 'web',\n schedule: {\n type: 'interval',\n frequency: 6,\n unit: 'hours',\n },\n webhook: { url: 'https://example.com/webhook' },\n});\n\nconsole.log(monitor.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "name": "Acme pricing page",\n "target": {\n "type": "page",\n "url": "https://acme.com/pricing"\n },\n "change_detection": {\n "type": "exact"\n },\n "mode": "web",\n "schedule": {\n "frequency": 6,\n "type": "interval",\n "unit": "hours"\n },\n "tags": [\n "pricing",\n "competitor"\n ],\n "webhook": {\n "url": "https://example.com/webhook"\n }\n }\'', - }, - }, - }, - { - name: 'list', - endpoint: '/monitors', - httpMethod: 'get', - summary: 'List monitors', - description: - 'Lists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.', - stainlessPath: '(resource) monitors > (method) list', - qualified: 'client.monitors.list', - params: [ - "change_detection_type?: 'exact' | 'semantic';", - 'cursor?: string;', - 'limit?: number;', - 'q?: string;', - "search_by?: 'name' | 'url' | 'instructions' | 'tags'[];", - "search_type?: 'exact' | 'prefix';", - "status?: 'active' | 'paused' | 'failed';", - 'tag?: string;', - 'tags?: string[];', - "target_type?: 'page' | 'sitemap' | 'extract';", - ], - response: - "{ data: { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }[]; has_more: boolean; next_cursor: string; }", - markdown: - "## list\n\n`client.monitors.list(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, q?: string, search_by?: 'name' | 'url' | 'instructions' | 'tags'[], search_type?: 'exact' | 'prefix', status?: 'active' | 'paused' | 'failed', tag?: string, tags?: string[], target_type?: 'page' | 'sitemap' | 'extract'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors`\n\nLists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n Filter by change detection type.\n\n- `cursor?: string`\n Opaque pagination cursor from a previous response.\n\n- `limit?: number`\n Maximum number of items to return per page (1-100). Defaults to 25.\n\n- `q?: string`\n Free-text search term, matched against the fields named in `search_by`.\n\n- `search_by?: 'name' | 'url' | 'instructions' | 'tags'[]`\n Comma-separated fields to search with `q`. Defaults to all of them. Note `instructions` only exists on extract monitors.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'active' | 'paused' | 'failed'`\n Filter monitors by lifecycle status.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `tags?: string[]`\n Comma-separated list of tags to filter by (matches monitors having any of them).\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n Filter by target type.\n\n### Returns\n\n- `{ data: { id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }; webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }; webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors);\n```", - perLanguage: { - php: { - method: 'monitors->list', - example: - "monitors->list(\n changeDetectionType: 'exact',\n cursor: 'cursor',\n limit: 1,\n q: 'pricing',\n searchBy: ['name'],\n searchType: 'exact',\n status: 'active',\n tag: 'pricing',\n tags: ['x'],\n targetType: 'page',\n);\n\nvar_dump($monitors);", - }, - go: { - method: 'client.Monitors.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmonitors, err := client.Monitors.List(context.TODO(), contextdev.MonitorListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitors.Data)\n}\n', - }, - cli: { - method: 'monitors list', - example: "context-dev monitors list \\\n --api-key 'My API Key'", - }, - python: { - method: 'monitors.list', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nmonitors = client.monitors.list()\nprint(monitors.data)', - }, - ruby: { - method: 'monitors.list', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nmonitors = context_dev.monitors.list\n\nputs(monitors)', - }, - typescript: { - method: 'client.monitors.list', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve', - endpoint: '/monitors/{monitor_id}', - httpMethod: 'get', - summary: 'Get a monitor', - description: 'Get a monitor', - stainlessPath: '(resource) monitors > (method) retrieve', - qualified: 'client.monitors.retrieve', - params: ['monitor_id: string;'], - response: - "{ id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }", - markdown: - "## retrieve\n\n`client.monitors.retrieve(monitor_id: string): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }`\n\n**get** `/monitors/{monitor_id}`\n\nGet a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }; webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }`\n - `webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor);\n```", - perLanguage: { - php: { - method: 'monitors->retrieve', - example: - "monitors->retrieve('mon_123');\n\nvar_dump($monitor);", - }, - go: { - method: 'client.Monitors.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmonitor, err := client.Monitors.Get(context.TODO(), "mon_123")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitor.ID)\n}\n', - }, - cli: { - method: 'monitors retrieve', - example: "context-dev monitors retrieve \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.retrieve', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nmonitor = client.monitors.retrieve(\n "mon_123",\n)\nprint(monitor.id)', - }, - ruby: { - method: 'monitors.retrieve', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nmonitor = context_dev.monitors.retrieve("mon_123")\n\nputs(monitor)', - }, - typescript: { - method: 'client.monitors.retrieve', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'update', - endpoint: '/monitors/{monitor_id}', - httpMethod: 'patch', - summary: 'Update a monitor', - description: - 'Updates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.', - stainlessPath: '(resource) monitors > (method) update', - qualified: 'client.monitors.update', - params: [ - 'monitor_id: string;', - "change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; };", - 'name?: string;', - "schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; };", - "status?: 'active' | 'paused';", - 'tags?: string[];', - "target?: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; };", - "webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; };", - ], - response: - "{ id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }", - markdown: - "## update\n\n`client.monitors.update(monitor_id: string, change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }, name?: string, schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, status?: 'active' | 'paused', tags?: string[], target?: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }, webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; webhook_failure?: object; }`\n\n**patch** `/monitors/{monitor_id}`\n\nUpdates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.\n\n### Parameters\n\n- `monitor_id: string`\n\n- `change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name?: string`\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `status?: 'active' | 'paused'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.\n\n- `target?: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }`\n Set to null to remove the webhook.\n - `url: string`\n Webhook URL events are delivered to.\n - `events?: 'change.detected' | 'run.completed'[]`\n Events delivered to this endpoint. `change.detected` fires only when a run detects a change; `run.completed` fires on every completed run — including runs that detected no change — and embeds the change when one was detected. Defaults to `[\"change.detected\"]` when omitted.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }; webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; instructions?: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; events?: 'change.detected' | 'run.completed'[]; secret?: string; }`\n - `webhook_failure?: { consecutive_failures: number; last_failed_at: string; last_message: string; last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.update('mon_123');\n\nconsole.log(monitor);\n```", - perLanguage: { - php: { - method: 'monitors->update', - example: - "monitors->update(\n 'mon_123',\n changeDetection: ['type' => 'exact'],\n name: 'Acme pricing monitor',\n schedule: ['frequency' => 1, 'type' => 'interval', 'unit' => 'hours'],\n status: 'active',\n tags: ['pricing', 'competitor'],\n target: [\n 'type' => 'page',\n 'url' => 'https://acme.com/pricing',\n 'instructions' => 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.',\n 'normalizeWhitespace' => true,\n ],\n webhook: [\n 'url' => 'https://example.com/webhook',\n 'events' => ['change.detected', 'run.completed'],\n ],\n);\n\nvar_dump($monitor);", - }, - go: { - method: 'client.Monitors.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmonitor, err := client.Monitors.Update(\n\t\tcontext.TODO(),\n\t\t"mon_123",\n\t\tcontextdev.MonitorUpdateParams{\n\t\t\tName: contextdev.String("Acme pricing monitor"),\n\t\t\tSchedule: contextdev.MonitorUpdateParamsSchedule{\n\t\t\t\tType: "interval",\n\t\t\t\tFrequency: 1,\n\t\t\t\tUnit: "hours",\n\t\t\t},\n\t\t\tStatus: contextdev.MonitorUpdateParamsStatusActive,\n\t\t\tWebhook: contextdev.MonitorUpdateParamsWebhook{\n\t\t\t\tURL: "https://example.com/webhook",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitor.ID)\n}\n', - }, - cli: { - method: 'monitors update', - example: "context-dev monitors update \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.update', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nmonitor = client.monitors.update(\n monitor_id="mon_123",\n name="Acme pricing monitor",\n schedule={\n "type": "interval",\n "frequency": 1,\n "unit": "hours",\n },\n status="active",\n webhook={\n "url": "https://example.com/webhook"\n },\n)\nprint(monitor.id)', - }, - ruby: { - method: 'monitors.update', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nmonitor = context_dev.monitors.update("mon_123")\n\nputs(monitor)', - }, - typescript: { - method: 'client.monitors.update', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitor = await client.monitors.update('mon_123', {\n name: 'Acme pricing monitor',\n schedule: {\n type: 'interval',\n frequency: 1,\n unit: 'hours',\n },\n status: 'active',\n webhook: { url: 'https://example.com/webhook' },\n});\n\nconsole.log(monitor.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID \\\n -X PATCH \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "name": "Acme pricing monitor",\n "schedule": {\n "frequency": 1,\n "type": "interval",\n "unit": "hours"\n },\n "status": "active",\n "tags": [\n "pricing",\n "competitor"\n ],\n "webhook": {\n "url": "https://example.com/webhook"\n }\n }\'', - }, - }, - }, - { - name: 'delete', - endpoint: '/monitors/{monitor_id}', - httpMethod: 'delete', - summary: 'Delete a monitor', - description: 'Delete a monitor', - stainlessPath: '(resource) monitors > (method) delete', - qualified: 'client.monitors.delete', - params: ['monitor_id: string;'], - response: '{ id: string; deleted: boolean; }', - markdown: - "## delete\n\n`client.monitors.delete(monitor_id: string): { id: string; deleted: boolean; }`\n\n**delete** `/monitors/{monitor_id}`\n\nDelete a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; deleted: boolean; }`\n\n - `id: string`\n - `deleted: boolean`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.delete('mon_123');\n\nconsole.log(monitor);\n```", - perLanguage: { - php: { - method: 'monitors->delete', - example: - "monitors->delete('mon_123');\n\nvar_dump($monitor);", - }, - go: { - method: 'client.Monitors.Delete', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tmonitor, err := client.Monitors.Delete(context.TODO(), "mon_123")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", monitor.ID)\n}\n', - }, - cli: { - method: 'monitors delete', - example: "context-dev monitors delete \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.delete', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nmonitor = client.monitors.delete(\n "mon_123",\n)\nprint(monitor.id)', - }, - ruby: { - method: 'monitors.delete', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nmonitor = context_dev.monitors.delete("mon_123")\n\nputs(monitor)', - }, - typescript: { - method: 'client.monitors.delete', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst monitor = await client.monitors.delete('mon_123');\n\nconsole.log(monitor.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'run', - endpoint: '/monitors/{monitor_id}/run', - httpMethod: 'post', - summary: 'Run a monitor now', - description: - 'Triggers an immediate run of the monitor outside its normal schedule. The run is queued and processed asynchronously.', - stainlessPath: '(resource) monitors > (method) run', - qualified: 'client.monitors.run', - params: ['monitor_id: string;'], - response: '{ monitor_id: string; queued: boolean; run_id: string; }', - markdown: - "## run\n\n`client.monitors.run(monitor_id: string): { monitor_id: string; queued: boolean; run_id: string; }`\n\n**post** `/monitors/{monitor_id}/run`\n\nTriggers an immediate run of the monitor outside its normal schedule. The run is queued and processed asynchronously.\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ monitor_id: string; queued: boolean; run_id: string; }`\n\n - `monitor_id: string`\n - `queued: boolean`\n - `run_id: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.run('mon_123');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->run', - example: - "monitors->run('mon_123');\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.Run', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.Run(context.TODO(), "mon_123")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.MonitorID)\n}\n', - }, - cli: { - method: 'monitors run', - example: "context-dev monitors run \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.run', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.run(\n "mon_123",\n)\nprint(response.monitor_id)', - }, - ruby: { - method: 'monitors.run', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.run("mon_123")\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.run', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.run('mon_123');\n\nconsole.log(response.monitor_id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID/run \\\n -X POST \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'list_runs', - endpoint: '/monitors/{monitor_id}/runs', - httpMethod: 'get', - summary: 'List monitor runs', - description: 'List monitor runs', - stainlessPath: '(resource) monitors > (method) list_runs', - qualified: 'client.monitors.listRuns', - params: [ - 'monitor_id: string;', - 'cursor?: string;', - 'limit?: number;', - "status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped';", - ], - response: - "{ data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: object[]; webhook_delivery?: object; }[]; has_more: boolean; next_cursor: string; }", - markdown: - "## list_runs\n\n`client.monitors.listRuns(monitor_id: string, cursor?: string, limit?: number, status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors/{monitor_id}/runs`\n\nList monitor runs\n\n### Parameters\n\n- `monitor_id: string`\n\n- `cursor?: string`\n Opaque pagination cursor from a previous response.\n\n- `limit?: number`\n Maximum number of items to return per page (1-100). Defaults to 25.\n\n- `status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'`\n Filter runs by lifecycle status.\n\n### Returns\n\n- `{ data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: object[]; webhook_delivery?: object; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: { attempted_at: string; error: { code: string; message: string; }; event: 'change.detected' | 'run.completed'; event_id: string; http_status: number; status: 'delivered' | 'rejected' | 'failed' | 'skipped_unsafe_url'; }[]; webhook_delivery?: { attempted_at: string; error: { code: string; message: string; }; event: 'change.detected' | 'run.completed'; event_id: string; http_status: number; status: 'delivered' | 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.listRuns('mon_123');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->listRuns', - example: - "monitors->listRuns(\n 'mon_123', cursor: 'cursor', limit: 1, status: 'queued'\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.ListRuns', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.ListRuns(\n\t\tcontext.TODO(),\n\t\t"mon_123",\n\t\tcontextdev.MonitorListRunsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'monitors list_runs', - example: "context-dev monitors list-runs \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.list_runs', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.list_runs(\n monitor_id="mon_123",\n)\nprint(response.data)', - }, - ruby: { - method: 'monitors.list_runs', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.list_runs("mon_123")\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.listRuns', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.listRuns('mon_123');\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID/runs \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'list_changes', - endpoint: '/monitors/{monitor_id}/changes', - httpMethod: 'get', - summary: 'List changes for a monitor', - description: 'List changes for a monitor', - stainlessPath: '(resource) monitors > (method) list_changes', - qualified: 'client.monitors.listChanges', - params: [ - 'monitor_id: string;', - 'cursor?: string;', - 'limit?: number;', - 'since?: string;', - 'tag?: string;', - 'until?: string;', - ], - response: - "{ data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]; has_more: boolean; next_cursor: string; }", - markdown: - "## list_changes\n\n`client.monitors.listChanges(monitor_id: string, cursor?: string, limit?: number, since?: string, tag?: string, until?: string): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors/{monitor_id}/changes`\n\nList changes for a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n- `cursor?: string`\n Opaque pagination cursor from a previous response.\n\n- `limit?: number`\n Maximum number of items to return per page (1-100). Defaults to 25.\n\n- `since?: string`\n Only include items at or after this ISO 8601 timestamp.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `until?: string`\n Only include items before this ISO 8601 timestamp.\n\n### Returns\n\n- `{ data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.listChanges('mon_123');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->listChanges', - example: - "monitors->listChanges(\n 'mon_123',\n cursor: 'cursor',\n limit: 1,\n since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n tag: 'pricing',\n until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.ListChanges', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.ListChanges(\n\t\tcontext.TODO(),\n\t\t"mon_123",\n\t\tcontextdev.MonitorListChangesParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'monitors list_changes', - example: "context-dev monitors list-changes \\\n --api-key 'My API Key' \\\n --monitor-id mon_123", - }, - python: { - method: 'monitors.list_changes', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.list_changes(\n monitor_id="mon_123",\n)\nprint(response.data)', - }, - ruby: { - method: 'monitors.list_changes', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.list_changes("mon_123")\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.listChanges', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.listChanges('mon_123');\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/$MONITOR_ID/changes \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'list_account_runs', - endpoint: '/monitors/runs', - httpMethod: 'get', - summary: 'List runs', - description: 'Returns an account-wide feed of monitor runs across all monitors.', - stainlessPath: '(resource) monitors > (method) list_account_runs', - qualified: 'client.monitors.listAccountRuns', - params: [ - 'cursor?: string;', - 'limit?: number;', - "status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped';", - ], - response: - "{ data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: object[]; webhook_delivery?: object; }[]; has_more: boolean; next_cursor: string; }", - markdown: - "## list_account_runs\n\n`client.monitors.listAccountRuns(cursor?: string, limit?: number, status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors/runs`\n\nReturns an account-wide feed of monitor runs across all monitors.\n\n### Parameters\n\n- `cursor?: string`\n Opaque pagination cursor from a previous response.\n\n- `limit?: number`\n Maximum number of items to return per page (1-100). Defaults to 25.\n\n- `status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'`\n Filter runs by lifecycle status.\n\n### Returns\n\n- `{ data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: object[]; webhook_delivery?: object; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; baseline_created: boolean; change_detected: boolean; change_detection_type: 'exact' | 'semantic'; credits_charged: number; monitor_id: string; run_type: 'baseline' | 'scheduled'; status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; target_type: 'page' | 'sitemap' | 'extract'; change_id?: string; completed_at?: string; error?: { code: string; message: string; }; skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded'; started_at?: string; webhook_deliveries?: { attempted_at: string; error: { code: string; message: string; }; event: 'change.detected' | 'run.completed'; event_id: string; http_status: number; status: 'delivered' | 'rejected' | 'failed' | 'skipped_unsafe_url'; }[]; webhook_delivery?: { attempted_at: string; error: { code: string; message: string; }; event: 'change.detected' | 'run.completed'; event_id: string; http_status: number; status: 'delivered' | 'rejected' | 'failed' | 'skipped_unsafe_url'; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.listAccountRuns();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->listAccountRuns', - example: - "monitors->listAccountRuns(\n cursor: 'cursor', limit: 1, status: 'queued'\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.ListAccountRuns', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.ListAccountRuns(context.TODO(), contextdev.MonitorListAccountRunsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'monitors list_account_runs', - example: "context-dev monitors list-account-runs \\\n --api-key 'My API Key'", - }, - python: { - method: 'monitors.list_account_runs', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.list_account_runs()\nprint(response.data)', - }, - ruby: { - method: 'monitors.list_account_runs', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.list_account_runs\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.listAccountRuns', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.listAccountRuns();\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/runs \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'list_account_changes', - endpoint: '/monitors/changes', - httpMethod: 'get', - summary: 'List changes', - description: 'Returns an account-wide feed of detected changes across monitors.', - stainlessPath: '(resource) monitors > (method) list_account_changes', - qualified: 'client.monitors.listAccountChanges', - params: [ - "change_detection_type?: 'exact' | 'semantic';", - 'cursor?: string;', - 'limit?: number;', - 'monitor_id?: string;', - 'since?: string;', - 'tag?: string;', - "target_type?: 'page' | 'sitemap' | 'extract';", - 'until?: string;', - ], - response: - "{ data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]; has_more: boolean; next_cursor: string; }", - markdown: - "## list_account_changes\n\n`client.monitors.listAccountChanges(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, monitor_id?: string, since?: string, tag?: string, target_type?: 'page' | 'sitemap' | 'extract', until?: string): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors/changes`\n\nReturns an account-wide feed of detected changes across monitors.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n Filter by change detection type.\n\n- `cursor?: string`\n Opaque pagination cursor from a previous response.\n\n- `limit?: number`\n Maximum number of items to return per page (1-100). Defaults to 25.\n\n- `monitor_id?: string`\n Filter changes to a single monitor.\n\n- `since?: string`\n Only include items at or after this ISO 8601 timestamp.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n Filter by target type.\n\n- `until?: string`\n Only include items before this ISO 8601 timestamp.\n\n### Returns\n\n- `{ data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; confidence?: number; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; removed_url_count?: number; tags?: string[]; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.listAccountChanges();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->listAccountChanges', - example: - "monitors->listAccountChanges(\n changeDetectionType: 'exact',\n cursor: 'cursor',\n limit: 1,\n monitorID: 'mon_123',\n since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n tag: 'pricing',\n targetType: 'page',\n until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.ListAccountChanges', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.ListAccountChanges(context.TODO(), contextdev.MonitorListAccountChangesParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'monitors list_account_changes', - example: "context-dev monitors list-account-changes \\\n --api-key 'My API Key'", - }, - python: { - method: 'monitors.list_account_changes', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.list_account_changes()\nprint(response.data)', - }, - ruby: { - method: 'monitors.list_account_changes', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.list_account_changes\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.listAccountChanges', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.listAccountChanges();\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/changes \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve_change', - endpoint: '/monitors/changes/{change_id}', - httpMethod: 'get', - summary: 'Get a change', - description: 'Get a change', - stainlessPath: '(resource) monitors > (method) retrieve_change', - qualified: 'client.monitors.retrieveChange', - params: ['change_id: string;'], - response: - "{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; tags: string[]; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; }", - markdown: - "## retrieve_change\n\n`client.monitors.retrieveChange(change_id: string): { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; tags: string[]; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: object[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; }`\n\n**get** `/monitors/changes/{change_id}`\n\nGet a change\n\n### Parameters\n\n- `change_id: string`\n\n### Returns\n\n- `{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; tags: string[]; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; }`\n A detected change. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (page: `diff` + excerpts; sitemap: `added_urls`/`removed_urls`; semantic: `confidence`/`importance`/`evidence`/`matched_urls`).\n\n - `id: string`\n - `change_detection_type: 'exact' | 'semantic'`\n - `detected_at: string`\n - `mode: 'web'`\n - `monitor_id: string`\n - `run_id: string`\n - `summary: string`\n - `tags: string[]`\n - `target_type: 'page' | 'sitemap' | 'extract'`\n - `title: string`\n - `url: string`\n - `added_url_count?: number`\n - `added_urls?: string[]`\n - `after_text_excerpt?: string`\n - `before_text_excerpt?: string`\n - `confidence?: number`\n - `diff?: string`\n - `evidence?: { after: string; before: string; url?: string; }[]`\n - `importance?: 'low' | 'medium' | 'high'`\n - `matched_url_count?: number`\n - `matched_urls?: string[]`\n - `removed_url_count?: number`\n - `removed_urls?: string[]`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.retrieveChange('chg_123');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->retrieveChange', - example: - "monitors->retrieveChange('chg_123');\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.GetChange', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.GetChange(context.TODO(), "chg_123")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', - }, - cli: { - method: 'monitors retrieve_change', - example: - "context-dev monitors retrieve-change \\\n --api-key 'My API Key' \\\n --change-id chg_123", - }, - python: { - method: 'monitors.retrieve_change', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.retrieve_change(\n "chg_123",\n)\nprint(response.id)', - }, - ruby: { - method: 'monitors.retrieve_change', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.retrieve_change("chg_123")\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.retrieveChange', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.retrieveChange('chg_123');\n\nconsole.log(response.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/changes/$CHANGE_ID \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'get_credit_usage', - endpoint: '/monitors/credit-usage', - httpMethod: 'get', - summary: 'Monitor credit usage', - description: - 'Returns credits charged per monitor over an optional [since, until] window, newest spenders first.', - stainlessPath: '(resource) monitors > (method) get_credit_usage', - qualified: 'client.monitors.getCreditUsage', - params: ['since?: string;', 'until?: string;'], - response: - '{ data: { credits: number; monitor_id: string; name: string; runs: number; }[]; total_credits: number; }', - markdown: - "## get_credit_usage\n\n`client.monitors.getCreditUsage(since?: string, until?: string): { data: object[]; total_credits: number; }`\n\n**get** `/monitors/credit-usage`\n\nReturns credits charged per monitor over an optional [since, until] window, newest spenders first.\n\n### Parameters\n\n- `since?: string`\n Only include items at or after this ISO 8601 timestamp.\n\n- `until?: string`\n Only include items before this ISO 8601 timestamp.\n\n### Returns\n\n- `{ data: { credits: number; monitor_id: string; name: string; runs: number; }[]; total_credits: number; }`\n\n - `data: { credits: number; monitor_id: string; name: string; runs: number; }[]`\n - `total_credits: number`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.getCreditUsage();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->getCreditUsage', - example: - "monitors->getCreditUsage(\n since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.GetCreditUsage', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.GetCreditUsage(context.TODO(), contextdev.MonitorGetCreditUsageParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'monitors get_credit_usage', - example: "context-dev monitors get-credit-usage \\\n --api-key 'My API Key'", - }, - python: { - method: 'monitors.get_credit_usage', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.get_credit_usage()\nprint(response.data)', - }, - ruby: { - method: 'monitors.get_credit_usage', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.get_credit_usage\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.getCreditUsage', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.getCreditUsage();\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/credit-usage \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'get_limits', - endpoint: '/monitors/limits', - httpMethod: 'get', - summary: 'Monitor limits', - description: 'Returns how many monitors the account has and the maximum it allows.', - stainlessPath: '(resource) monitors > (method) get_limits', - qualified: 'client.monitors.getLimits', - response: - "{ monitors_limit: number; monitors_used: number; plan: 'free' | 'starter' | 'pro' | 'scale'; }", - markdown: - "## get_limits\n\n`client.monitors.getLimits(): { monitors_limit: number; monitors_used: number; plan: 'free' | 'starter' | 'pro' | 'scale'; }`\n\n**get** `/monitors/limits`\n\nReturns how many monitors the account has and the maximum it allows.\n\n### Returns\n\n- `{ monitors_limit: number; monitors_used: number; plan: 'free' | 'starter' | 'pro' | 'scale'; }`\n\n - `monitors_limit: number`\n - `monitors_used: number`\n - `plan: 'free' | 'starter' | 'pro' | 'scale'`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.getLimits();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'monitors->getLimits', - example: - "monitors->getLimits();\n\nvar_dump($response);", - }, - go: { - method: 'client.Monitors.GetLimits', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Monitors.GetLimits(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.MonitorsLimit)\n}\n', - }, - cli: { - method: 'monitors get_limits', - example: "context-dev monitors get-limits \\\n --api-key 'My API Key'", - }, - python: { - method: 'monitors.get_limits', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.monitors.get_limits()\nprint(response.monitors_limit)', - }, - ruby: { - method: 'monitors.get_limits', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.monitors.get_limits\n\nputs(response)', - }, - typescript: { - method: 'client.monitors.getLimits', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.monitors.getLimits();\n\nconsole.log(response.monitors_limit);", - }, - http: { - example: - 'curl https://api.context.dev/v1/monitors/limits \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'submit', - endpoint: '/batch/submit', - httpMethod: 'post', - summary: 'Submit a batch', - description: 'Scrape 25K URLs or crawl large websites asynchronously. ', - stainlessPath: '(resource) batch > (method) submit', - qualified: 'client.batch.submit', - params: [ - "input: { data: { format: 'markdown'; urls: { url: string; itemId?: string; meta?: object; }[]; options?: { country?: string; excludeSelectors?: string[]; includeHTML?: boolean; includeImages?: boolean; includeLinks?: boolean; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; shortenBase64Images?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; } | { format: 'html'; urls: { url: string; itemId?: string; meta?: object; }[]; options?: { country?: string; excludeSelectors?: string[]; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; }; mode: 'scrape'; } | { data: { format: 'markdown'; source: { type: 'start_url'; url: string; controls?: { followSubdomains?: boolean; maxDepth?: number; maxUrls?: number; regex?: string; }; } | { domain: string; type: 'sitemap'; controls?: { maxUrls?: number; regex?: string; }; }; options?: { country?: string; excludeSelectors?: string[]; includeHTML?: boolean; includeImages?: boolean; includeLinks?: boolean; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; shortenBase64Images?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; } | { format: 'html'; source: { type: 'start_url'; url: string; controls?: { followSubdomains?: boolean; maxDepth?: number; maxUrls?: number; regex?: string; }; } | { domain: string; type: 'sitemap'; controls?: { maxUrls?: number; regex?: string; }; }; options?: { country?: string; excludeSelectors?: string[]; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; }; mode: 'crawl'; };", - 'tags?: string[];', - 'webhookUrl?: string;', - 'Idempotency-Key?: string;', - ], - response: - "{ id: string; cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; created_at: string; credits: { reserved: number; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; invalid_urls: { reason: string; url: string; }[]; mode: 'scrape' | 'crawl'; status: 'queued'; tags: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; webhook_secret?: string; }", - markdown: - "## submit\n\n`client.batch.submit(input: { data: { format: 'markdown'; urls: object[]; options?: object; } | { format: 'html'; urls: object[]; options?: object; }; mode: 'scrape'; } | { data: { format: 'markdown'; source: object | object; options?: object; } | { format: 'html'; source: object | object; options?: object; }; mode: 'crawl'; }, tags?: string[], webhookUrl?: string, Idempotency-Key?: string): { id: string; cache_metadata: object; crawl: crawl_controls; created_at: string; credits: object; format: 'markdown' | 'html'; input: intake; invalid_urls: object[]; mode: 'scrape' | 'crawl'; status: 'queued'; tags: string[]; key_metadata?: object; webhook_secret?: string; }`\n\n**post** `/batch/submit`\n\nScrape 25K URLs or crawl large websites asynchronously. \n\n### Parameters\n\n- `input: { data: { format: 'markdown'; urls: { url: string; itemId?: string; meta?: object; }[]; options?: { country?: string; excludeSelectors?: string[]; includeHTML?: boolean; includeImages?: boolean; includeLinks?: boolean; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; shortenBase64Images?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; } | { format: 'html'; urls: { url: string; itemId?: string; meta?: object; }[]; options?: { country?: string; excludeSelectors?: string[]; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; }; mode: 'scrape'; } | { data: { format: 'markdown'; source: { type: 'start_url'; url: string; controls?: { followSubdomains?: boolean; maxDepth?: number; maxUrls?: number; regex?: string; }; } | { domain: string; type: 'sitemap'; controls?: { maxUrls?: number; regex?: string; }; }; options?: { country?: string; excludeSelectors?: string[]; includeHTML?: boolean; includeImages?: boolean; includeLinks?: boolean; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; shortenBase64Images?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; } | { format: 'html'; source: { type: 'start_url'; url: string; controls?: { followSubdomains?: boolean; maxDepth?: number; maxUrls?: number; regex?: string; }; } | { domain: string; type: 'sitemap'; controls?: { maxUrls?: number; regex?: string; }; }; options?: { country?: string; excludeSelectors?: string[]; includeSelectors?: string[]; maxAgeMs?: number; pdf?: { end?: number; ocr?: boolean; shouldParse?: boolean; start?: number; }; settleAnimations?: boolean; useMainContentOnly?: boolean; waitForMs?: number; }; }; mode: 'crawl'; }`\n Choose a URL list or a site crawl.\n\n- `tags?: string[]`\n Tags stored on the batch. Filter the batch list by them later.\n\n- `webhookUrl?: string`\n URL notified when the batch finishes.\n\n- `Idempotency-Key?: string`\n Any string unique to this submission. Retries with the same key return the original batch.\n\n### Returns\n\n- `{ id: string; cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; created_at: string; credits: { reserved: number; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; invalid_urls: { reason: string; url: string; }[]; mode: 'scrape' | 'crawl'; status: 'queued'; tags: string[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; webhook_secret?: string; }`\n\n - `id: string`\n - `cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }`\n - `crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: { type: 'start_url'; url: string; } | { domain: string; type: 'sitemap'; }; url_pattern: string; }`\n - `created_at: string`\n - `credits: { reserved: number; }`\n - `format: 'markdown' | 'html'`\n - `input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }`\n - `invalid_urls: { reason: string; url: string; }[]`\n - `mode: 'scrape' | 'crawl'`\n - `status: 'queued'`\n - `tags: string[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `webhook_secret?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.batch.submit({ input: {\n data: { format: 'markdown', urls: [{ url: 'https://example.com/products/anvil' }, { url: 'https://example.com/products/hammer' }] },\n mode: 'scrape',\n} });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'batch->submit', - example: - "batch->submit(\n input: [\n 'data' => [\n 'format' => 'markdown',\n 'urls' => [\n [\n 'url' => 'https://example.com/products/anvil',\n 'itemID' => 'sku-1',\n 'meta' => ['category' => 'bar'],\n ],\n [\n 'url' => 'https://example.com/products/hammer',\n 'itemID' => 'sku-2',\n 'meta' => ['foo' => 'bar'],\n ],\n ],\n 'options' => [\n 'country' => 'de',\n 'excludeSelectors' => ['x'],\n 'includeHTML' => true,\n 'includeImages' => true,\n 'includeLinks' => true,\n 'includeSelectors' => ['x'],\n 'maxAgeMs' => 0,\n 'pdf' => [\n 'end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1\n ],\n 'settleAnimations' => true,\n 'shortenBase64Images' => true,\n 'useMainContentOnly' => true,\n 'waitForMs' => 0,\n ],\n ],\n 'mode' => 'scrape',\n ],\n tags: ['docs', 'competitor'],\n webhookURL: 'webhookUrl',\n idempotencyKey: 'Idempotency-Key',\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Batch.Submit', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Batch.Submit(context.TODO(), contextdev.BatchSubmitParams{\n\t\tInput: contextdev.BatchSubmitParamsInputUnion{\n\t\t\tOfScrape: &contextdev.BatchSubmitParamsInputScrape{\n\t\t\t\tData: contextdev.BatchSubmitParamsInputScrapeDataUnion{\n\t\t\t\t\tOfMarkdown: &contextdev.BatchSubmitParamsInputScrapeDataMarkdown{\n\t\t\t\t\t\tURLs: []contextdev.BatchSubmitParamsInputScrapeDataMarkdownURL{{\n\t\t\t\t\t\t\tURL: "https://example.com/products/anvil",\n\t\t\t\t\t\t\tItemID: contextdev.String("sku-1"),\n\t\t\t\t\t\t\tMeta: map[string]any{\n\t\t\t\t\t\t\t\t"category": "tools",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tURL: "https://example.com/products/hammer",\n\t\t\t\t\t\t\tItemID: contextdev.String("sku-2"),\n\t\t\t\t\t\t}},\n\t\t\t\t\t\tOptions: contextdev.BatchSubmitParamsInputScrapeDataMarkdownOptions{\n\t\t\t\t\t\t\tUseMainContentOnly: contextdev.Bool(true),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', - }, - cli: { - method: 'batch submit', - example: - "context-dev batch submit \\\n --api-key 'My API Key' \\\n --input '{data: {format: markdown, urls: [{url: https://example.com/products/anvil}, {url: https://example.com/products/hammer}]}, mode: scrape}'", - }, - python: { - method: 'batch.submit', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.batch.submit(\n input={\n "data": {\n "urls": [{\n "url": "https://example.com/products/anvil",\n "item_id": "sku-1",\n "meta": {\n "category": "tools"\n },\n }, {\n "url": "https://example.com/products/hammer",\n "item_id": "sku-2",\n }],\n "options": {\n "use_main_content_only": True\n },\n }\n },\n)\nprint(response.id)', - }, - ruby: { - method: 'batch.submit', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.batch.submit(\n input: {\n data: {\n format: :markdown,\n urls: [{url: "https://example.com/products/anvil"}, {url: "https://example.com/products/hammer"}]\n },\n mode: :scrape\n }\n)\n\nputs(response)', - }, - typescript: { - method: 'client.batch.submit', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.batch.submit({\n input: {\n data: {\n urls: [\n {\n url: 'https://example.com/products/anvil',\n itemId: 'sku-1',\n meta: { category: 'tools' },\n },\n { url: 'https://example.com/products/hammer', itemId: 'sku-2' },\n ],\n options: { useMainContentOnly: true },\n },\n },\n});\n\nconsole.log(response.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/submit \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "input": {\n "data": {\n "format": "markdown",\n "urls": [\n {\n "url": "https://example.com/products/anvil",\n "itemId": "sku-1",\n "meta": {\n "category": "bar"\n }\n },\n {\n "url": "https://example.com/products/hammer",\n "itemId": "sku-2"\n }\n ],\n "options": {\n "useMainContentOnly": true\n }\n },\n "mode": "scrape"\n },\n "tags": [\n "docs",\n "competitor"\n ]\n }\'', - }, - }, - }, - { - name: 'list', - endpoint: '/batch/list', - httpMethod: 'get', - summary: 'List batches', - description: 'List your batches from newest to oldest. Filter by status or continue with a cursor.', - stainlessPath: '(resource) batch > (method) list', - qualified: 'client.batch.list', - params: [ - 'cursor?: string;', - 'limit?: number;', - 'q?: string;', - "search_type?: 'exact' | 'prefix';", - "status?: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed';", - 'tags?: string;', - ], - response: - "{ data?: { id: string; crawl: object; credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }; failure: object; format: 'markdown' | 'html'; input: object; mode: 'scrape' | 'crawl'; page_errors: object[]; progress: { failed: number; pending: number; succeeded: number; }; results: { expires_at: string; files: object[]; }; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: { completed_at: string; created_at: string; started_at: string; }; }[]; has_more?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; next_cursor?: string; }", - markdown: - "## list\n\n`client.batch.list(cursor?: string, limit?: number, q?: string, search_type?: 'exact' | 'prefix', status?: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed', tags?: string): { data?: object[]; has_more?: boolean; key_metadata?: object; next_cursor?: string; }`\n\n**get** `/batch/list`\n\nList your batches from newest to oldest. Filter by status or continue with a cursor.\n\n### Parameters\n\n- `cursor?: string`\n Cursor from the previous page.\n\n- `limit?: number`\n Batches per page. Defaults to 25.\n\n- `q?: string`\n Free-text search term, matched against the batch id, crawl source (start URL or sitemap domain), and tags.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'`\n Filter by status.\n\n- `tags?: string`\n Comma-separated list of tags to filter by (matches batches having any of them).\n\n### Returns\n\n- `{ data?: { id: string; crawl: object; credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }; failure: object; format: 'markdown' | 'html'; input: object; mode: 'scrape' | 'crawl'; page_errors: object[]; progress: { failed: number; pending: number; succeeded: number; }; results: { expires_at: string; files: object[]; }; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: { completed_at: string; created_at: string; started_at: string; }; }[]; has_more?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; next_cursor?: string; }`\n\n - `data?: { id: string; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: { type: 'start_url'; url: string; } | { domain: string; type: 'sitemap'; }; url_pattern: string; }; credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }; failure: { code: string; message: string; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; mode: 'scrape' | 'crawl'; page_errors: { code: string; count: number; }[]; progress: { failed: number; pending: number; succeeded: number; }; results: { expires_at: string; files: { bytes: number; items: number; url: string; }[]; }; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: { completed_at: string; created_at: string; started_at: string; }; }[]`\n - `has_more?: boolean`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `next_cursor?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst batches = await client.batch.list();\n\nconsole.log(batches);\n```", - perLanguage: { - php: { - method: 'batch->list', - example: - "batch->list(\n cursor: 'cursor',\n limit: 1,\n q: 'batch_1a2b',\n searchType: 'exact',\n status: 'queued',\n tags: 'docs,competitor',\n);\n\nvar_dump($batches);", - }, - go: { - method: 'client.Batch.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbatches, err := client.Batch.List(context.TODO(), contextdev.BatchListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", batches.Data)\n}\n', - }, - cli: { - method: 'batch list', - example: "context-dev batch list \\\n --api-key 'My API Key'", - }, - python: { - method: 'batch.list', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nbatches = client.batch.list()\nprint(batches.data)', - }, - ruby: { - method: 'batch.list', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nbatches = context_dev.batch.list\n\nputs(batches)', - }, - typescript: { - method: 'client.batch.list', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst batches = await client.batch.list();\n\nconsole.log(batches.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/list \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'retrieve', - endpoint: '/batch/{batch_id}', - httpMethod: 'get', - summary: 'Get a batch', - description: 'Check progress, and get download links once the batch finishes.', - stainlessPath: '(resource) batch > (method) retrieve', - qualified: 'client.batch.retrieve', - params: ['batch_id: string;'], - response: - "{ id: string; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }; failure: { code: string; message: string; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; invalid_urls: { reason: string; url: string; }[]; mode: 'scrape' | 'crawl'; page_errors: { code: string; count: number; }[]; progress: { failed: number; pending: number; succeeded: number; }; results: { expires_at: string; files: { bytes: number; items: number; url: string; }[]; }; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: { completed_at: string; created_at: string; started_at: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## retrieve\n\n`client.batch.retrieve(batch_id: string): { id: string; crawl: crawl_controls; credits: object; failure: failure; format: 'markdown' | 'html'; input: intake; invalid_urls: object[]; mode: 'scrape' | 'crawl'; page_errors: page_error_count[]; progress: object; results: object; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: object; key_metadata?: object; }`\n\n**get** `/batch/{batch_id}`\n\nCheck progress, and get download links once the batch finishes.\n\n### Parameters\n\n- `batch_id: string`\n ID of the batch to retrieve or cancel.\n\n### Returns\n\n- `{ id: string; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }; failure: { code: string; message: string; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; invalid_urls: { reason: string; url: string; }[]; mode: 'scrape' | 'crawl'; page_errors: { code: string; count: number; }[]; progress: { failed: number; pending: number; succeeded: number; }; results: { expires_at: string; files: { bytes: number; items: number; url: string; }[]; }; status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; tags: string[]; timing: { completed_at: string; created_at: string; started_at: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `id: string`\n - `crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: { type: 'start_url'; url: string; } | { domain: string; type: 'sitemap'; }; url_pattern: string; }`\n - `credits: { net: number; ocr_charged: number; refunded: number; reserved: number; }`\n - `failure: { code: string; message: string; }`\n - `format: 'markdown' | 'html'`\n - `input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }`\n - `invalid_urls: { reason: string; url: string; }[]`\n - `mode: 'scrape' | 'crawl'`\n - `page_errors: { code: string; count: number; }[]`\n - `progress: { failed: number; pending: number; succeeded: number; }`\n - `results: { expires_at: string; files: { bytes: number; items: number; url: string; }[]; }`\n - `status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'`\n - `tags: string[]`\n - `timing: { completed_at: string; created_at: string; started_at: string; }`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst batch = await client.batch.retrieve('batch_9f2c8a');\n\nconsole.log(batch);\n```", - perLanguage: { - php: { - method: 'batch->retrieve', - example: - "batch->retrieve('batch_9f2c8a');\n\nvar_dump($batch);", - }, - go: { - method: 'client.Batch.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbatch, err := client.Batch.Get(context.TODO(), "batch_9f2c8a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", batch.ID)\n}\n', - }, - cli: { - method: 'batch retrieve', - example: "context-dev batch retrieve \\\n --api-key 'My API Key' \\\n --batch-id batch_9f2c8a", - }, - python: { - method: 'batch.retrieve', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nbatch = client.batch.retrieve(\n "batch_9f2c8a",\n)\nprint(batch.id)', - }, - ruby: { - method: 'batch.retrieve', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nbatch = context_dev.batch.retrieve("batch_9f2c8a")\n\nputs(batch)', - }, - typescript: { - method: 'client.batch.retrieve', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batch.retrieve('batch_9f2c8a');\n\nconsole.log(batch.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/$BATCH_ID \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'get_results', - endpoint: '/batch/{batch_id}/results', - httpMethod: 'get', - summary: 'Get batch results', - description: "Page through a finished batch's results as JSON instead of downloading the NDJSON files.", - stainlessPath: '(resource) batch > (method) get_results', - qualified: 'client.batch.getResults', - params: ['batch_id: string;', 'cursor?: string;', 'limit?: number;'], - response: - "{ data?: { cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; final_url: string; http_status: number; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: object[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: object[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; status: 'ok'; url: string; html?: string; itemId?: string; markdown?: string; meta?: object; ocr_pages?: number; } | { error_code: string; message: string; status: 'error'; url: string; itemId?: string; meta?: object; }[]; has_more?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; next_cursor?: string; }", - markdown: - "## get_results\n\n`client.batch.getResults(batch_id: string, cursor?: string, limit?: number): { data?: object | object[]; has_more?: boolean; key_metadata?: object; next_cursor?: string; }`\n\n**get** `/batch/{batch_id}/results`\n\nPage through a finished batch's results as JSON instead of downloading the NDJSON files.\n\n### Parameters\n\n- `batch_id: string`\n ID of the batch to retrieve or cancel.\n\n- `cursor?: string`\n next_cursor from the previous page.\n\n- `limit?: number`\n Records per page. Defaults to 25. A page can close early so its payload stays under ~8 MB; rely on next_cursor rather than counting records.\n\n### Returns\n\n- `{ data?: { cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; final_url: string; http_status: number; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: object[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: object[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; status: 'ok'; url: string; html?: string; itemId?: string; markdown?: string; meta?: object; ocr_pages?: number; } | { error_code: string; message: string; status: 'error'; url: string; itemId?: string; meta?: object; }[]; has_more?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; next_cursor?: string; }`\n\n - `data?: { cache_metadata: { age_ms: number; status: 'hit' | 'miss' | 'zdr'; }; final_url: string; http_status: number; metadata: { finalUrl: string; sourceUrl: string; additionalMeta?: object; alternates?: { href: string; hreflang?: string; title?: string; type?: string; }[]; author?: string; canonicalUrl?: string; description?: string; favicon?: string; headings?: { level: number; text: string; }[]; image?: string; jsonLd?: object[]; keywords?: string[]; language?: string; modifiedTime?: string; openGraph?: object; publishedTime?: string; robots?: string; siteName?: string; title?: string; twitter?: object; }; status: 'ok'; url: string; html?: string; itemId?: string; markdown?: string; meta?: object; ocr_pages?: number; } | { error_code: string; message: string; status: 'error'; url: string; itemId?: string; meta?: object; }[]`\n - `has_more?: boolean`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n - `next_cursor?: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.batch.getResults('batch_9f2c8a');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'batch->getResults', - example: - "batch->getResults(\n 'batch_9f2c8a', cursor: 'cursor', limit: 1\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.Batch.GetResults', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Batch.GetResults(\n\t\tcontext.TODO(),\n\t\t"batch_9f2c8a",\n\t\tcontextdev.BatchGetResultsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'batch get_results', - example: "context-dev batch get-results \\\n --api-key 'My API Key' \\\n --batch-id batch_9f2c8a", - }, - python: { - method: 'batch.get_results', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.batch.get_results(\n batch_id="batch_9f2c8a",\n)\nprint(response.data)', - }, - ruby: { - method: 'batch.get_results', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.batch.get_results("batch_9f2c8a")\n\nputs(response)', - }, - typescript: { - method: 'client.batch.getResults', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.batch.getResults('batch_9f2c8a');\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/$BATCH_ID/results \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'cancel', - endpoint: '/batch/{batch_id}/cancel', - httpMethod: 'post', - summary: 'Cancel a batch', - description: - 'Stop a batch from starting new pages. In-progress pages finish, and unused credits are refunded.', - stainlessPath: '(resource) batch > (method) cancel', - qualified: 'client.batch.cancel', - params: ['batch_id: string;'], - response: - "{ id: string; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; credits: { reserved: number; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; mode: 'scrape' | 'crawl'; page_errors: { code: string; count: number; }[]; progress: { failed: number; pending: number; succeeded: number; }; status: 'cancelling'; tags: string[]; timing: { created_at: string; started_at: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## cancel\n\n`client.batch.cancel(batch_id: string): { id: string; crawl: crawl_controls; credits: object; format: 'markdown' | 'html'; input: intake; mode: 'scrape' | 'crawl'; page_errors: page_error_count[]; progress: object; status: 'cancelling'; tags: string[]; timing: object; key_metadata?: object; }`\n\n**post** `/batch/{batch_id}/cancel`\n\nStop a batch from starting new pages. In-progress pages finish, and unused credits are refunded.\n\n### Parameters\n\n- `batch_id: string`\n ID of the batch to retrieve or cancel.\n\n### Returns\n\n- `{ id: string; crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: object | object; url_pattern: string; }; credits: { reserved: number; }; format: 'markdown' | 'html'; input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }; mode: 'scrape' | 'crawl'; page_errors: { code: string; count: number; }[]; progress: { failed: number; pending: number; succeeded: number; }; status: 'cancelling'; tags: string[]; timing: { created_at: string; started_at: string; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `id: string`\n - `crawl: { follow_subdomains: boolean; max_depth: number; max_pages: number; source: { type: 'start_url'; url: string; } | { domain: string; type: 'sitemap'; }; url_pattern: string; }`\n - `credits: { reserved: number; }`\n - `format: 'markdown' | 'html'`\n - `input: { duplicates: number; invalid: number; reserved: number; reserved_is_ceiling: boolean; submitted: number; }`\n - `mode: 'scrape' | 'crawl'`\n - `page_errors: { code: string; count: number; }[]`\n - `progress: { failed: number; pending: number; succeeded: number; }`\n - `status: 'cancelling'`\n - `tags: string[]`\n - `timing: { created_at: string; started_at: string; }`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.batch.cancel('batch_9f2c8a');\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'batch->cancel', - example: - "batch->cancel('batch_9f2c8a');\n\nvar_dump($response);", - }, - go: { - method: 'client.Batch.Cancel', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Batch.Cancel(context.TODO(), "batch_9f2c8a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ID)\n}\n', - }, - cli: { - method: 'batch cancel', - example: "context-dev batch cancel \\\n --api-key 'My API Key' \\\n --batch-id batch_9f2c8a", - }, - python: { - method: 'batch.cancel', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.batch.cancel(\n "batch_9f2c8a",\n)\nprint(response.id)', - }, - ruby: { - method: 'batch.cancel', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.batch.cancel("batch_9f2c8a")\n\nputs(response)', - }, - typescript: { - method: 'client.batch.cancel', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.batch.cancel('batch_9f2c8a');\n\nconsole.log(response.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/$BATCH_ID/cancel \\\n -X POST \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'delete', - endpoint: '/batch/{batch_id}', - httpMethod: 'delete', - summary: 'Delete a batch', - description: - 'Permanently delete a finished batch and its stored results. Active batches must settle first.', - stainlessPath: '(resource) batch > (method) delete', - qualified: 'client.batch.delete', - params: ['batch_id: string;'], - response: - '{ id?: string; deleted?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }', - markdown: - "## delete\n\n`client.batch.delete(batch_id: string): { id?: string; deleted?: boolean; key_metadata?: object; }`\n\n**delete** `/batch/{batch_id}`\n\nPermanently delete a finished batch and its stored results. Active batches must settle first.\n\n### Parameters\n\n- `batch_id: string`\n ID of the batch to retrieve or cancel.\n\n### Returns\n\n- `{ id?: string; deleted?: boolean; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `id?: string`\n - `deleted?: boolean`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst batch = await client.batch.delete('batch_9f2c8a');\n\nconsole.log(batch);\n```", - perLanguage: { - php: { - method: 'batch->delete', - example: - "batch->delete('batch_9f2c8a');\n\nvar_dump($batch);", - }, - go: { - method: 'client.Batch.Delete', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tbatch, err := client.Batch.Delete(context.TODO(), "batch_9f2c8a")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", batch.ID)\n}\n', - }, - cli: { - method: 'batch delete', - example: "context-dev batch delete \\\n --api-key 'My API Key' \\\n --batch-id batch_9f2c8a", - }, - python: { - method: 'batch.delete', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nbatch = client.batch.delete(\n "batch_9f2c8a",\n)\nprint(batch.id)', - }, - ruby: { - method: 'batch.delete', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nbatch = context_dev.batch.delete("batch_9f2c8a")\n\nputs(batch)', - }, - typescript: { - method: 'client.batch.delete', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst batch = await client.batch.delete('batch_9f2c8a');\n\nconsole.log(batch.id);", - }, - http: { - example: - 'curl https://api.context.dev/v1/batch/$BATCH_ID \\\n -X DELETE \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"', - }, - }, - }, - { - name: 'enrich', - endpoint: '/people/enrich', - httpMethod: 'post', - summary: 'Enrich Person', - description: - 'Finds and normalizes the best available person candidate from additive identity clues, then assigns an identity match score from 0 to 100. Available on all paid plans. Successful requests cost 20 credits. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error.', - stainlessPath: '(resource) people > (method) enrich', - qualified: 'client.people.enrich', - params: [ - 'company?: { domain?: string; name?: string; };', - 'education?: { degree?: string; field_of_study?: string; graduation_year?: number; institution?: { domain?: string; name?: string; }; }[];', - 'email?: string;', - 'location?: { city?: string; country?: string; region?: string; };', - 'name?: { first?: string; last?: string; };', - 'social_urls?: string[];', - 'tags?: string[];', - 'timeoutMS?: number;', - ], - response: - "{ match: { person: { current_role_status: 'present' | 'none' | 'unknown'; education: object[]; experience: object[]; skills: string[]; social_urls: string[]; website_urls: string[]; avatar_url?: string; bio?: string; checked_at?: string; current_role?: object; email?: string; last_updated?: string; location?: object; name?: object; }; score: number; status: 'candidate'; } | { person: null; score: null; status: 'not_found'; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## enrich\n\n`client.people.enrich(company?: { domain?: string; name?: string; }, education?: { degree?: string; field_of_study?: string; graduation_year?: number; institution?: { domain?: string; name?: string; }; }[], email?: string, location?: { city?: string; country?: string; region?: string; }, name?: { first?: string; last?: string; }, social_urls?: string[], tags?: string[], timeoutMS?: number): { match: object | object; key_metadata?: object; }`\n\n**post** `/people/enrich`\n\nFinds and normalizes the best available person candidate from additive identity clues, then assigns an identity match score from 0 to 100. Available on all paid plans. Successful requests cost 20 credits. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error.\n\n### Parameters\n\n- `company?: { domain?: string; name?: string; }`\n - `domain?: string`\n - `name?: string`\n\n- `education?: { degree?: string; field_of_study?: string; graduation_year?: number; institution?: { domain?: string; name?: string; }; }[]`\n\n- `email?: string`\n\n- `location?: { city?: string; country?: string; region?: string; }`\n - `city?: string`\n - `country?: string`\n - `region?: string`\n\n- `name?: { first?: string; last?: string; }`\n - `first?: string`\n - `last?: string`\n\n- `social_urls?: string[]`\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n- `timeoutMS?: number`\n Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).\n\n### Returns\n\n- `{ match: { person: { current_role_status: 'present' | 'none' | 'unknown'; education: object[]; experience: object[]; skills: string[]; social_urls: string[]; website_urls: string[]; avatar_url?: string; bio?: string; checked_at?: string; current_role?: object; email?: string; last_updated?: string; location?: object; name?: object; }; score: number; status: 'candidate'; } | { person: null; score: null; status: 'not_found'; }; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `match: { person: { current_role_status: 'present' | 'none' | 'unknown'; education: { institution: { name: string; domain?: string; }; degree?: string; description?: string; end_date?: { year: number; day?: number; month?: number; }; field_of_study?: string; start_date?: { year: number; day?: number; month?: number; }; }[]; experience: { organization: { name: string; domain?: string; }; title: string; description?: string; end_date?: { year: number; day?: number; month?: number; }; is_current?: boolean; location?: string; start_date?: { year: number; day?: number; month?: number; }; }[]; skills: string[]; social_urls: string[]; website_urls: string[]; avatar_url?: string; bio?: string; checked_at?: string; current_role?: { organization: { name: string; domain?: string; }; title: string; description?: string; end_date?: { year: number; day?: number; month?: number; }; is_current?: boolean; location?: string; start_date?: { year: number; day?: number; month?: number; }; }; email?: string; last_updated?: string; location?: { city?: string; country?: string; country_code?: string; display?: string; region?: string; }; name?: { first?: string; full?: string; last?: string; }; }; score: number; status: 'candidate'; } | { person: null; score: null; status: 'not_found'; }`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.people.enrich();\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'people->enrich', - example: - "people->enrich(\n company: [\n 'domain' => 'analyticalengines.example', 'name' => 'Analytical Engines'\n ],\n education: [\n [\n 'degree' => 'x',\n 'fieldOfStudy' => 'x',\n 'graduationYear' => 1900,\n 'institution' => ['domain' => 'x', 'name' => 'x'],\n ],\n ],\n email: 'dev@stainless.com',\n location: ['city' => 'x', 'country' => 'x', 'region' => 'x'],\n name: ['first' => 'Ada', 'last' => 'Lovelace'],\n socialURLs: ['https://www.linkedin.com/in/ada-lovelace/'],\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.People.Enrich', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.People.Enrich(context.TODO(), contextdev.PersonEnrichParams{\n\t\tCompany: contextdev.PersonEnrichParamsCompany{\n\t\t\tName: contextdev.String("Analytical Engines"),\n\t\t\tDomain: contextdev.String("analyticalengines.example"),\n\t\t},\n\t\tName: contextdev.PersonEnrichParamsName{\n\t\t\tFirst: contextdev.String("Ada"),\n\t\t\tLast: contextdev.String("Lovelace"),\n\t\t},\n\t\tSocialURLs: []string{"https://www.linkedin.com/in/ada-lovelace/"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Match)\n}\n', - }, - cli: { - method: 'people enrich', - example: "context-dev people enrich \\\n --api-key 'My API Key'", - }, - python: { - method: 'people.enrich', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.people.enrich(\n company={\n "name": "Analytical Engines",\n "domain": "analyticalengines.example",\n },\n name={\n "first": "Ada",\n "last": "Lovelace",\n },\n social_urls=["https://www.linkedin.com/in/ada-lovelace/"],\n)\nprint(response.match)', - }, - ruby: { - method: 'people.enrich', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.people.enrich\n\nputs(response)', - }, - typescript: { - method: 'client.people.enrich', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.people.enrich({\n company: { name: 'Analytical Engines', domain: 'analyticalengines.example' },\n name: { first: 'Ada', last: 'Lovelace' },\n social_urls: ['https://www.linkedin.com/in/ada-lovelace/'],\n});\n\nconsole.log(response.match);", - }, - http: { - example: - 'curl https://api.context.dev/v1/people/enrich \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "company": {\n "domain": "analyticalengines.example",\n "name": "Analytical Engines"\n },\n "name": {\n "first": "Ada",\n "last": "Lovelace"\n },\n "social_urls": [\n "https://www.linkedin.com/in/ada-lovelace/"\n ],\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, - { - name: 'search', - endpoint: '/news/search', - httpMethod: 'post', - summary: 'Search company news', - description: - 'Searches live and historical company news for one company, identified in searchBy by name, domain, ticker (optionally disambiguated by exchange), or ISIN. Results can be filtered by publisher domain, publisher country, article language, article type, and published-at date, and include stable story IDs, source metadata, verified entity relevance, and cursor pagination.', - stainlessPath: '(resource) news > (method) search', - qualified: 'client.news.search', - params: [ - "searchBy: { entity: { name: string; type: 'name'; } | { domain: string; type: 'domain'; } | { ticker: string; type: 'ticker'; exchange?: string; } | { isin: string; type: 'isin'; }; type: 'entity'; };", - 'cursor?: string;', - "filterBy?: { articleLanguage?: 'ar' | 'de' | 'en' | 'es' | 'fr' | 'hi' | 'it' | 'ja' | 'ko' | 'nl' | 'pt' | 'ru' | 'zh'[]; articleType?: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'[]; date?: { from?: number; to?: number; }; sourceCountry?: string[]; sourceDomain?: string[]; };", - 'limit?: number;', - "sortBy?: { type: 'relevance' | 'newest'; };", - 'tags?: string[];', - ], - response: - "{ data: { id: string; authors: string[]; description: string; image_url: string; language: string; match: { confidence: number; level: 'primary' | 'secondary'; }; published_at: string; source: { direct: boolean; domain: string; name: string; }; story_id: string; title: string; type: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'; url: string; }[]; has_more: boolean; meta: { count: number; }; next_cursor: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }", - markdown: - "## search\n\n`client.news.search(searchBy: { entity: { name: string; type: 'name'; } | { domain: string; type: 'domain'; } | { ticker: string; type: 'ticker'; exchange?: string; } | { isin: string; type: 'isin'; }; type: 'entity'; }, cursor?: string, filterBy?: { articleLanguage?: 'ar' | 'de' | 'en' | 'es' | 'fr' | 'hi' | 'it' | 'ja' | 'ko' | 'nl' | 'pt' | 'ru' | 'zh'[]; articleType?: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'[]; date?: { from?: number; to?: number; }; sourceCountry?: string[]; sourceDomain?: string[]; }, limit?: number, sortBy?: { type: 'relevance' | 'newest'; }, tags?: string[]): { data: object[]; has_more: boolean; meta: object; next_cursor: string; key_metadata?: object; }`\n\n**post** `/news/search`\n\nSearches live and historical company news for one company, identified in searchBy by name, domain, ticker (optionally disambiguated by exchange), or ISIN. Results can be filtered by publisher domain, publisher country, article language, article type, and published-at date, and include stable story IDs, source metadata, verified entity relevance, and cursor pagination.\n\n### Parameters\n\n- `searchBy: { entity: { name: string; type: 'name'; } | { domain: string; type: 'domain'; } | { ticker: string; type: 'ticker'; exchange?: string; } | { isin: string; type: 'isin'; }; type: 'entity'; }`\n What to search for.\n - `entity: { name: string; type: 'name'; } | { domain: string; type: 'domain'; } | { ticker: string; type: 'ticker'; exchange?: string; } | { isin: string; type: 'isin'; }`\n The company to search news for, identified by name, domain, ticker, or ISIN.\n - `type: 'entity'`\n How to search. Only entity search is supported.\n\n- `cursor?: string`\n Opaque next_cursor from the previous response, or null for the first page.\n\n- `filterBy?: { articleLanguage?: 'ar' | 'de' | 'en' | 'es' | 'fr' | 'hi' | 'it' | 'ja' | 'ko' | 'nl' | 'pt' | 'ru' | 'zh'[]; articleType?: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'[]; date?: { from?: number; to?: number; }; sourceCountry?: string[]; sourceDomain?: string[]; }`\n Optional result filters.\n - `articleLanguage?: 'ar' | 'de' | 'en' | 'es' | 'fr' | 'hi' | 'it' | 'ja' | 'ko' | 'nl' | 'pt' | 'ru' | 'zh'[]`\n Article languages to include. Up to 3.\n - `articleType?: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'[]`\n Article types to include. Up to 3.\n - `date?: { from?: number; to?: number; }`\n Published-at window in epoch milliseconds.\n - `sourceCountry?: string[]`\n Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3.\n - `sourceDomain?: string[]`\n Publisher domains to include. Up to 3.\n\n- `limit?: number`\n Maximum results to return. Defaults to 10.\n\n- `sortBy?: { type: 'relevance' | 'newest'; }`\n Result ordering. Defaults to newest.\n - `type: 'relevance' | 'newest'`\n Result ordering.\n\n- `tags?: string[]`\n Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.\n\n### Returns\n\n- `{ data: { id: string; authors: string[]; description: string; image_url: string; language: string; match: { confidence: number; level: 'primary' | 'secondary'; }; published_at: string; source: { direct: boolean; domain: string; name: string; }; story_id: string; title: string; type: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'; url: string; }[]; has_more: boolean; meta: { count: number; }; next_cursor: string; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `data: { id: string; authors: string[]; description: string; image_url: string; language: string; match: { confidence: number; level: 'primary' | 'secondary'; }; published_at: string; source: { direct: boolean; domain: string; name: string; }; story_id: string; title: string; type: 'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'; url: string; }[]`\n - `has_more: boolean`\n - `meta: { count: number; }`\n - `next_cursor: string`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.news.search({ searchBy: {\n entity: { name: 'xx', type: 'name' },\n type: 'entity',\n} });\n\nconsole.log(response);\n```", - perLanguage: { - php: { - method: 'news->search', - example: - "news->search(\n searchBy: [\n 'entity' => ['name' => 'xx', 'type' => 'name'], 'type' => 'entity'\n ],\n cursor: 'cursor',\n filterBy: [\n 'articleLanguage' => ['ar'],\n 'articleType' => ['editorial'],\n 'date' => ['from' => 0, 'to' => 0],\n 'sourceCountry' => ['ae'],\n 'sourceDomain' => ['x'],\n ],\n limit: 1,\n sortBy: ['type' => 'relevance'],\n tags: ['production', 'team-alpha'],\n);\n\nvar_dump($response);", - }, - go: { - method: 'client.News.Search', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.News.Search(context.TODO(), contextdev.NewsSearchParams{\n\t\tSearchBy: contextdev.NewsSearchParamsSearchBy{\n\t\t\tEntity: contextdev.NewsSearchParamsSearchByEntityUnion{\n\t\t\t\tOfName: &contextdev.NewsSearchParamsSearchByEntityName{\n\t\t\t\t\tName: "xx",\n\t\t\t\t},\n\t\t\t},\n\t\t\tType: "entity",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Data)\n}\n', - }, - cli: { - method: 'news search', - example: - "context-dev news search \\\n --api-key 'My API Key' \\\n --search-by '{entity: {name: xx, type: name}, type: entity}'", - }, - python: { - method: 'news.search', - example: - 'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.news.search(\n search_by={\n "entity": {\n "name": "xx",\n "type": "name",\n },\n "type": "entity",\n },\n)\nprint(response.data)', - }, - ruby: { - method: 'news.search', - example: - 'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.news.search(search_by: {entity: {name: "xx", type: :name}, type: :entity})\n\nputs(response)', - }, - typescript: { - method: 'client.news.search', - example: - "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.news.search({\n searchBy: {\n entity: { name: 'xx', type: 'name' },\n type: 'entity',\n },\n});\n\nconsole.log(response.data);", - }, - http: { - example: - 'curl https://api.context.dev/v1/news/search \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \\\n -d \'{\n "searchBy": {\n "entity": {\n "name": "xx",\n "type": "name"\n },\n "type": "entity"\n },\n "tags": [\n "production",\n "team-alpha"\n ]\n }\'', - }, - }, - }, -]; - -const EMBEDDED_READMES: { language: string; content: string }[] = [ - { - language: 'php', - content: - "# Context Dev PHP API Library\n\nThe Context Dev PHP library provides convenient access to the Context Dev REST API from any PHP 8.1.0+ application.\n\n## Installation\n\n\n```\ncomposer require \"context-dev/context-dev-php 2.12.0\"\n```\n\n\n## Usage\n\n```php\nbrand->retrieve(domain: 'REPLACE_ME', type: 'by_domain');\n\nvar_dump($brand->cache_metadata);\n```", - }, - { - language: 'go', - content: - '# Context Dev Go API Library\n\nGo Reference\n\nThe Context Dev Go library provides convenient access to the [Context Dev REST API](https://docs.context.dev/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/context-dot-dev/context-go-sdk/v2" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/context-dot-dev/context-go-sdk/v2@v2.12.0\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk/v2"\n\t"github.com/context-dot-dev/context-go-sdk/v2/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"), // defaults to os.LookupEnv("CONTEXT_DEV_API_KEY")\n\t)\n\tbrand, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: "stripe.com",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", brand.CacheMetadata)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.Brand.Get(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/context-dot-dev/context-go-sdk/v2/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{\n\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\tDomain: "stripe.com",\n\t},\n})\nif err != nil {\n\tvar apierr *contextdev.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/brand/retrieve": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.Brand.Get(\n\tctx,\n\tcontextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: "stripe.com",\n\t\t},\n\t},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := contextdev.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.Brand.Get(\n\tcontext.TODO(),\n\tcontextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: "stripe.com",\n\t\t},\n\t},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\nbrand, err := client.Brand.Get(\n\tcontext.TODO(),\n\tcontextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: "stripe.com",\n\t\t},\n\t},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", brand)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/context-dot-dev/context-go-sdk/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', - }, - { - language: 'cli', - content: - "# Context Dev CLI\n\nThe official CLI for the [Context Dev REST API](https://docs.context.dev/).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n\n\n## Installation\n\n### Installing with Go\n\nTo test or install the CLI locally, you need [Go](https://go.dev/doc/install) version 1.22 or later installed.\n\n~~~sh\ngo install 'github.com/context-dot-dev/context-dev-cli/cmd/context-dev@latest'\n~~~\n\nOnce you have run `go install`, the binary is placed in your Go bin directory:\n\n- **Default location**: `$HOME/go/bin` (or `$GOPATH/bin` if GOPATH is set)\n- **Check your path**: Run `go env GOPATH` to see the base directory\n\nIf commands aren't found after installation, add the Go bin directory to your PATH:\n\n~~~sh\n# Add to your shell profile (.zshrc, .bashrc, etc.)\nexport PATH=\"$PATH:$(go env GOPATH)/bin\"\n~~~\n\n\n\n### Running Locally\n\nAfter cloning the git repository for this project, you can use the\n`scripts/run` script to run the tool locally:\n\n~~~sh\n./scripts/run args...\n~~~\n\n## Usage\n\nThe CLI follows a resource-based command structure:\n\n~~~sh\ncontext-dev [resource] [flags...]\n~~~\n\n~~~sh\ncontext-dev brand retrieve \\\n --api-key 'My API Key' \\\n --domain REPLACE_ME \\\n --type by_domain\n~~~\n\nFor details about specific commands, use the `--help` flag.\n\n### Environment variables\n\n| Environment variable | Required |\n| --------------------- | -------- |\n| `CONTEXT_DEV_API_KEY` | yes |\n\n### Global flags\n\n- `--api-key` (can also be set with `CONTEXT_DEV_API_KEY` env var)\n- `--help` - Show command line usage\n- `--debug` - Enable debug logging (includes HTTP request/response details)\n- `--version`, `-v` - Show the CLI version\n- `--base-url` - Use a custom API backend URL\n- `--format` - Change the output format (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--format-error` - Change the output format for errors (`auto`, `explore`, `json`, `jsonl`, `pretty`, `raw`, `yaml`)\n- `--transform` - Transform the data output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n- `--transform-error` - Transform the error output using [GJSON syntax](https://github.com/tidwall/gjson/blob/master/SYNTAX.md)\n\n### Passing files as arguments\n\nTo pass files to your API, you can use the `@myfile.ext` syntax:\n\n~~~bash\ncontext-dev --arg @abe.jpg\n~~~\n\nFiles can also be passed inside JSON or YAML blobs:\n\n~~~bash\ncontext-dev --arg '{image: \"@abe.jpg\"}'\n# Equivalent:\ncontext-dev < --username '\\@abe'\n~~~\n\n#### Explicit encoding\n\nFor JSON endpoints, the CLI tool does filetype sniffing to determine whether the\nfile contents should be sent as a string literal (for plain text files) or as a\nbase64-encoded string literal (for binary files). If you need to explicitly send\nthe file as either plain text or base64-encoded data, you can use\n`@file://myfile.txt` (for string encoding) or `@data://myfile.dat` (for\nbase64-encoding). Note that absolute paths will begin with `@file://` or\n`@data://`, followed by a third `/` (for example, `@file:///tmp/file.txt`).\n\n~~~bash\ncontext-dev --arg @data://file.txt\n~~~\n\n## Linking different Go SDK versions\n\nYou can link the CLI against a different version of the Context Dev Go SDK\nfor development purposes using the `./scripts/link` script.\n\nTo link to a specific version from a repository (version can be a branch,\ngit tag, or commit hash):\n\n~~~bash\n./scripts/link github.com/org/repo@version\n~~~\n\nTo link to a local copy of the SDK:\n\n~~~bash\n./scripts/link ../path/to/contextdev-go\n~~~\n\nIf you run the link script without any arguments, it will default to `../contextdev-go`.\n", - }, - { - language: 'python', - content: - '# Context Dev Python API library\n\n\n[![PyPI version](https://img.shields.io/pypi/v/context.dev.svg?label=pypi%20(stable))](https://pypi.org/project/context.dev/)\n\nThe Context Dev Python library provides convenient access to the Context Dev REST API from any Python 3.9+\napplication. The library includes type definitions for all request params and response fields,\nand offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nThe REST API documentation can be found on [docs.context.dev](https://docs.context.dev/). The full API of this library can be found in [api.md](api.md).\n\n## Installation\n\n```sh\n# install from PyPI\npip install context.dev\n```\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```python\nimport os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\n\nbrand = client.brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n)\nprint(brand.cache_metadata)\n```\n\nWhile you can provide an `api_key` keyword argument,\nwe recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)\nto add `CONTEXT_DEV_API_KEY="My API Key"` to your `.env` file\nso that your API Key is not stored in source control.\n\n## Async usage\n\nSimply import `AsyncContextDev` instead of `ContextDev` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom context.dev import AsyncContextDev\n\nclient = AsyncContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\n\nasync def main() -> None:\n brand = await client.brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n )\n print(brand.cache_metadata)\n\nasyncio.run(main())\n```\n\nFunctionality between the synchronous and asynchronous clients is otherwise identical.\n\n### With aiohttp\n\nBy default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.\n\nYou can enable this by installing `aiohttp`:\n\n```sh\n# install from PyPI\npip install context.dev[aiohttp]\n```\n\nThen you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:\n\n```python\nimport os\nimport asyncio\nfrom context.dev import DefaultAioHttpClient\nfrom context.dev import AsyncContextDev\n\nasync def main() -> None:\n async with AsyncContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n http_client=DefaultAioHttpClient(),\n) as client:\n brand = await client.brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n )\n print(brand.cache_metadata)\n\nasyncio.run(main())\n```\n\n\n\n## Using types\n\nNested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:\n\n- Serializing back into JSON, `model.to_json()`\n- Converting to a dictionary, `model.to_dict()`\n\nTyped requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.\n\n\n\n## Nested params\n\nNested parameters are dictionaries, typed using `TypedDict`, for example:\n\n```python\nfrom context.dev import ContextDev\n\nclient = ContextDev()\n\nresponse = client.parse.handle(\n body=b"Example data",\n pdf={},\n)\nprint(response.pdf)\n```\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `context.dev.APIConnectionError` is raised.\n\nWhen the API returns a non-success status code (that is, 4xx or 5xx\nresponse), a subclass of `context.dev.APIStatusError` is raised, containing `status_code` and `response` properties.\n\nAll errors inherit from `context.dev.APIError`.\n\n```python\nimport context.dev\nfrom context.dev import ContextDev\n\nclient = ContextDev()\n\ntry:\n client.brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n )\nexcept context.dev.APIConnectionError as e:\n print("The server could not be reached")\n print(e.__cause__) # an underlying Exception, likely raised within httpx.\nexcept context.dev.RateLimitError as e:\n print("A 429 status code was received; we should back off a bit.")\nexcept context.dev.APIStatusError as e:\n print("Another non-200-range status code was received")\n print(e.status_code)\n print(e.response)\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors are automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors are all retried by default.\n\nYou can use the `max_retries` option to configure or disable retry settings:\n\n```python\nfrom context.dev import ContextDev\n\n# Configure the default for all requests:\nclient = ContextDev(\n # default is 2\n max_retries=0,\n)\n\n# Or, configure per-request:\nclient.with_options(max_retries = 5).brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n)\n```\n\n### Timeouts\n\nBy default requests time out after 1 minute. You can configure this with a `timeout` option,\nwhich accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:\n\n```python\nfrom context.dev import ContextDev\n\n# Configure the default for all requests:\nclient = ContextDev(\n # 20 seconds (default is 1 minute)\n timeout=20.0,\n)\n\n# More granular control:\nclient = ContextDev(\n timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),\n)\n\n# Override per-request:\nclient.with_options(timeout = 5.0).brand.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n)\n```\n\nOn timeout, an `APITimeoutError` is thrown.\n\nNote that requests that time out are [retried twice by default](#retries).\n\n\n\n## Advanced\n\n### Logging\n\nWe use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.\n\nYou can enable logging by setting the environment variable `CONTEXT_DEV_LOG` to `info`.\n\n```shell\n$ export CONTEXT_DEV_LOG=info\n```\n\nOr to `debug` for more verbose logging.\n\n### How to tell whether `None` means `null` or missing\n\nIn an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:\n\n```py\nif response.my_field is None:\n if \'my_field\' not in response.model_fields_set:\n print(\'Got json like {}, without a "my_field" key present at all.\')\n else:\n print(\'Got json like {"my_field": null}.\')\n```\n\n### Accessing raw response data (e.g. headers)\n\nThe "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,\n\n```py\nfrom context.dev import ContextDev\n\nclient = ContextDev()\nresponse = client.brand.with_raw_response.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n)\nprint(response.headers.get(\'X-My-Header\'))\n\nbrand = response.parse() # get the object that `brand.retrieve()` would have returned\nprint(brand.cache_metadata)\n```\n\nThese methods return an [`APIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object.\n\nThe async client returns an [`AsyncAPIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.\n\n#### `.with_streaming_response`\n\nThe above interface eagerly reads the full response body when you make the request, which may not always be what you want.\n\nTo stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.\n\n```python\nwith client.brand.with_streaming_response.retrieve(\n domain="REPLACE_ME",\n type="by_domain",\n) as response :\n print(response.headers.get(\'X-My-Header\'))\n\n for line in response.iter_lines():\n print(line)\n```\n\nThe context manager is required so that the response will reliably be closed.\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API.\n\nIf you need to access undocumented endpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other\nhttp verbs. Options on the client will be respected (such as retries) when making this request.\n\n```py\nimport httpx\n\nresponse = client.post(\n "/foo",\n cast_to=httpx.Response,\n body={"my_param": True},\n)\n\nprint(response.headers.get("x-foo"))\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You\ncan also get all the extra fields on the Pydantic model as a dict with\n[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).\n\n### Configuring the HTTP client\n\nYou can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:\n\n- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)\n- Custom [transports](https://www.python-httpx.org/advanced/transports/)\n- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality\n\n```python\nimport httpx\nfrom context.dev import ContextDev, DefaultHttpxClient\n\nclient = ContextDev(\n # Or use the `CONTEXT_DEV_BASE_URL` env var\n base_url="http://my.test.server.example.com:8083",\n http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),\n)\n```\n\nYou can also customize the client on a per-request basis by using `with_options()`:\n\n```python\nclient.with_options(http_client=DefaultHttpxClient(...))\n```\n\n### Managing HTTP resources\n\nBy default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.\n\n```py\nfrom context.dev import ContextDev\n\nwith ContextDev() as client:\n # make requests here\n ...\n\n# HTTP client is now closed\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/context-dot-dev/context-python-sdk/issues) with questions, bugs, or suggestions.\n\n### Determining the installed version\n\nIf you\'ve upgraded to the latest version but aren\'t seeing any new features you were expecting then your python environment is likely still using an older version.\n\nYou can determine the version that is being used at runtime with:\n\n```py\nimport context.dev\nprint(context.dev.__version__)\n```\n\n## Requirements\n\nPython 3.9 or higher.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', - }, - { - language: 'ruby', - content: - '# Context Dev Ruby API library\n\nThe Context Dev Ruby library provides convenient access to the Context Dev REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/context-dot-dev/context-ruby-sdk#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/context.dev).\n\nThe REST API documentation can be found on [docs.context.dev](https://docs.context.dev/).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n\n\n```ruby\ngem "context.dev", "~> 2.12.0"\n```\n\n\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "context_dev"\n\ncontext_dev = ContextDev::Client.new(\n api_key: ENV["CONTEXT_DEV_API_KEY"] # This is the default and can be omitted\n)\n\nbrand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})\n\nputs(brand.cache_metadata)\n```\n\n\n\n\n\n\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `ContextDev::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n brand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})\nrescue ContextDev::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue ContextDev::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue ContextDev::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\ncontext_dev = ContextDev::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\ncontext_dev.brand.retrieve(\n body: {domain: "stripe.com", type: "by_domain"},\n request_options: {max_retries: 5}\n)\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\ncontext_dev = ContextDev::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\ncontext_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"}, request_options: {timeout: 5})\n```\n\nOn timeout, `ContextDev::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `ContextDev::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\nbrand =\n context_dev.brand.retrieve(\n body: {domain: "stripe.com", type: "by_domain"},\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(brand[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `ContextDev::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `ContextDev::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\ncontext_dev.brand.retrieve(\n body: ContextDev::BrandRetrieveParams::Body::ByDomain.new(domain: "stripe.com")\n)\n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\ncontext_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})\n\n# You can also splat a full Params class:\nparams = ContextDev::BrandRetrieveParams.new(\n body: ContextDev::BrandRetrieveParams::Body::ByDomain.new(domain: "stripe.com")\n)\ncontext_dev.brand.retrieve(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :txt\nputs(ContextDev::ParseHandleParams::Extension::TXT)\n\n# Revealed type: `T.all(ContextDev::ParseHandleParams::Extension, Symbol)`\nT.reveal_type(ContextDev::ParseHandleParams::Extension::TXT)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\ncontext_dev.parse.handle(\n extension: ContextDev::ParseHandleParams::Extension::TXT,\n # …\n)\n\n# Literal values are also permissible:\ncontext_dev.parse.handle(\n extension: :txt,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/context-dot-dev/context-ruby-sdk/tree/main/CONTRIBUTING.md).\n', - }, - { - language: 'typescript', - content: - "# Context Dev TypeScript API Library\n\n[![NPM version](https://img.shields.io/npm/v/context.dev.svg?label=npm%20(stable))](https://npmjs.org/package/context.dev) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/context.dev)\n\nThis library provides convenient access to the Context Dev REST API from server-side TypeScript or JavaScript.\n\n\n\nThe REST API documentation can be found on [docs.context.dev](https://docs.context.dev/). The full API of this library can be found in [api.md](api.md).\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNvbnRleHQuZGV2LW1jcCJdLCJlbnYiOnsiQ09OVEVYVF9ERVZfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22context.dev-mcp%22%5D%2C%22env%22%3A%7B%22CONTEXT_DEV_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n```sh\nnpm install context.dev\n```\n\n\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n\n```js\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst brand = await client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' });\n\nconsole.log(brand.cache_metadata);\n```\n\n\n\n### Request & Response types\n\nThis library includes TypeScript definitions for all request params and response fields. You may import and use them like so:\n\n\n```ts\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst params: ContextDev.BrandRetrieveParams = { domain: 'REPLACE_ME', type: 'by_domain' };\nconst brand: ContextDev.BrandRetrieveResponse = await client.brand.retrieve(params);\n```\n\nDocumentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.\n\n\n\n\n\n## Handling errors\n\nWhen the library is unable to connect to the API,\nor if the API returns a non-success status code (i.e., 4xx or 5xx response),\na subclass of `APIError` will be thrown:\n\n\n```ts\nconst brand = await client.brand\n .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' })\n .catch(async (err) => {\n if (err instanceof ContextDev.APIError) {\n console.log(err.status); // 400\n console.log(err.name); // BadRequestError\n console.log(err.headers); // {server: 'nginx', ...}\n } else {\n throw err;\n }\n });\n```\n\nError codes are as follows:\n\n| Status Code | Error Type |\n| ----------- | -------------------------- |\n| 400 | `BadRequestError` |\n| 401 | `AuthenticationError` |\n| 403 | `PermissionDeniedError` |\n| 404 | `NotFoundError` |\n| 422 | `UnprocessableEntityError` |\n| 429 | `RateLimitError` |\n| >=500 | `InternalServerError` |\n| N/A | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,\n429 Rate Limit, and >=500 Internal errors will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n\n```js\n// Configure the default for all requests:\nconst client = new ContextDev({\n maxRetries: 0, // default is 2\n});\n\n// Or, configure per-request:\nawait client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }, {\n maxRetries: 5,\n});\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default. You can configure this with a `timeout` option:\n\n\n```ts\n// Configure the default for all requests:\nconst client = new ContextDev({\n timeout: 20 * 1000, // 20 seconds (default is 1 minute)\n});\n\n// Override per-request:\nawait client.brand.retrieve({ domain: 'REPLACE_ME', type: 'by_domain' }, {\n timeout: 5 * 1000,\n});\n```\n\nOn timeout, an `APIConnectionTimeoutError` is thrown.\n\nNote that requests which time out will be [retried twice by default](#retries).\n\n\n\n\n\n## Advanced Usage\n\n### Accessing raw Response data (e.g., headers)\n\nThe \"raw\" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.\nThis method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.\n\nYou can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.\nUnlike `.asResponse()` this method consumes the body, returning once it is parsed.\n\n\n```ts\nconst client = new ContextDev();\n\nconst response = await client.brand\n .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' })\n .asResponse();\nconsole.log(response.headers.get('X-My-Header'));\nconsole.log(response.statusText); // access the underlying Response object\n\nconst { data: brand, response: raw } = await client.brand\n .retrieve({ domain: 'REPLACE_ME', type: 'by_domain' })\n .withResponse();\nconsole.log(raw.headers.get('X-My-Header'));\nconsole.log(brand.cache_metadata);\n```\n\n### Logging\n\n> [!IMPORTANT]\n> All log messages are intended for debugging only. The format and content of log messages\n> may change between releases.\n\n#### Log levels\n\nThe log level can be configured in two ways:\n\n1. Via the `CONTEXT_DEV_LOG` environment variable\n2. Using the `logLevel` client option (overrides the environment variable if set)\n\n```ts\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n logLevel: 'debug', // Show all log messages\n});\n```\n\nAvailable log levels, from most to least verbose:\n\n- `'debug'` - Show debug messages, info, warnings, and errors\n- `'info'` - Show info messages, warnings, and errors\n- `'warn'` - Show warnings and errors (default)\n- `'error'` - Show only errors\n- `'off'` - Disable all logging\n\nAt the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.\nSome authentication-related headers are redacted, but sensitive data in request and response bodies\nmay still be visible.\n\n#### Custom logger\n\nBy default, this library logs to `globalThis.console`. You can also provide a custom logger.\nMost logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.\n\nWhen providing a custom logger, the `logLevel` option still controls which messages are emitted, messages\nbelow the configured level will not be sent to your logger.\n\n```ts\nimport ContextDev from 'context.dev';\nimport pino from 'pino';\n\nconst logger = pino();\n\nconst client = new ContextDev({\n logger: logger.child({ name: 'ContextDev' }),\n logLevel: 'debug', // Send all messages to pino, allowing it to filter\n});\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.\nOptions on the client, such as retries, will be respected when making these requests.\n\n```ts\nawait client.post('/some/path', {\n body: { some_prop: 'foo' },\n query: { some_query_arg: 'bar' },\n});\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented\nparameter. This library doesn't validate at runtime that the request matches the type, so any extra values you\nsend will be sent as-is.\n\n```ts\nclient.brand.retrieve({\n // ...\n // @ts-expect-error baz is not yet public\n baz: 'undocumented option',\n});\n```\n\nFor requests with the `GET` verb, any extra params will be in the query, all other requests will send the\nextra param in the body.\n\nIf you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request\noptions.\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may access the response object with `// @ts-expect-error` on\nthe response object, or cast the response object to the requisite type. Like the request params, we do not\nvalidate or strip extra properties from the response from the API.\n\n### Customizing the fetch client\n\nBy default, this library expects a global `fetch` function is defined.\n\nIf you want to use a different `fetch` function, you can either polyfill the global:\n\n```ts\nimport fetch from 'my-fetch';\n\nglobalThis.fetch = fetch;\n```\n\nOr pass it to the client:\n\n```ts\nimport ContextDev from 'context.dev';\nimport fetch from 'my-fetch';\n\nconst client = new ContextDev({ fetch });\n```\n\n### Fetch options\n\nIf you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)\n\n```ts\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n fetchOptions: {\n // `RequestInit` options\n },\n});\n```\n\n#### Configuring proxies\n\nTo modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy\noptions to requests:\n\n **Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]\n\n```ts\nimport ContextDev from 'context.dev';\nimport * as undici from 'undici';\n\nconst proxyAgent = new undici.ProxyAgent('http://localhost:8888');\nconst client = new ContextDev({\n fetchOptions: {\n dispatcher: proxyAgent,\n },\n});\n```\n\n **Bun** [[docs](https://bun.sh/guides/http/proxy)]\n\n```ts\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n fetchOptions: {\n proxy: 'http://localhost:8888',\n },\n});\n```\n\n **Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]\n\n```ts\nimport ContextDev from 'npm:context.dev';\n\nconst httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });\nconst client = new ContextDev({\n fetchOptions: {\n client: httpClient,\n },\n});\n```\n\n## Frequently Asked Questions\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/context-dot-dev/context-typescript-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nTypeScript >= 4.9 is supported.\n\nThe following runtimes are supported:\n\n- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)\n- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.\n- Deno v1.28.0 or higher.\n- Bun 1.0 or later.\n- Cloudflare Workers.\n- Vercel Edge Runtime.\n- Jest 28 or greater with the `\"node\"` environment (`\"jsdom\"` is not supported at this time).\n- Nitro v2.6 or greater.\n\nNote that React Native is not supported at this time.\n\nIf you are interested in other runtime environments, please open or upvote an issue on GitHub.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n", - }, -]; - -const INDEX_OPTIONS = { - fields: [ - 'name', - 'endpoint', - 'summary', - 'description', - 'qualified', - 'stainlessPath', - 'content', - 'sectionContext', - ], - storeFields: ['kind', '_original'], - searchOptions: { - prefix: true, - fuzzy: 0.1, - boost: { - name: 5, - stainlessPath: 3, - endpoint: 3, - qualified: 3, - summary: 2, - content: 1, - description: 1, - } as Record, - }, -}; - -/** - * Self-contained local search engine backed by MiniSearch. - * Method data is embedded at SDK build time; prose documents - * can be loaded from an optional docs directory at runtime. - */ -export class LocalDocsSearch { - private methodIndex: MiniSearch; - private proseIndex: MiniSearch; - - private constructor() { - this.methodIndex = new MiniSearch(INDEX_OPTIONS); - this.proseIndex = new MiniSearch(INDEX_OPTIONS); - } - - static async create(opts?: { docsDir?: string }): Promise { - const instance = new LocalDocsSearch(); - instance.indexMethods(EMBEDDED_METHODS); - for (const readme of EMBEDDED_READMES) { - instance.indexProse(readme.content, `readme:${readme.language}`); - } - if (opts?.docsDir) { - await instance.loadDocsDirectory(opts.docsDir); - } - return instance; - } - - search(props: { - query: string; - language?: string; - detail?: string; - maxResults?: number; - maxLength?: number; - }): SearchResult { - const { query, language = 'typescript', detail = 'default', maxResults = 5, maxLength = 100_000 } = props; - - const useMarkdown = detail === 'verbose' || detail === 'high'; - - // Search both indices and merge results by score. - // Filter prose hits so language-tagged content (READMEs and docs with - // frontmatter) only matches the requested language. - const methodHits = this.methodIndex - .search(query) - .map((hit) => ({ ...hit, _kind: 'http_method' as const })); - const proseHits = this.proseIndex - .search(query) - .filter((hit) => { - const source = ((hit as Record)['_original'] as ProseChunk | undefined)?.source; - if (!source) return true; - // Check for language-tagged sources: "readme:" or "lang::" - let taggedLang: string | undefined; - if (source.startsWith('readme:')) taggedLang = source.slice('readme:'.length); - else if (source.startsWith('lang:')) taggedLang = source.split(':')[1]; - if (!taggedLang) return true; - return taggedLang === language || (language === 'javascript' && taggedLang === 'typescript'); - }) - .map((hit) => ({ ...hit, _kind: 'prose' as const })); - const merged = [...methodHits, ...proseHits].sort((a, b) => b.score - a.score); - const top = merged.slice(0, maxResults); - - const fullResults: (string | Record)[] = []; - - for (const hit of top) { - const original = (hit as Record)['_original']; - if (hit._kind === 'http_method') { - const m = original as MethodEntry; - if (useMarkdown && m.markdown) { - fullResults.push(m.markdown); - } else { - // Use per-language data when available, falling back to the - // top-level fields (which are TypeScript-specific in the - // legacy codepath). - const langData = m.perLanguage?.[language]; - fullResults.push({ - method: langData?.method ?? m.qualified, - summary: m.summary, - description: m.description, - endpoint: `${m.httpMethod.toUpperCase()} ${m.endpoint}`, - ...(langData?.example ? { example: langData.example } : {}), - ...(m.params ? { params: m.params } : {}), - ...(m.response ? { response: m.response } : {}), - }); - } - } else { - const c = original as ProseChunk; - fullResults.push({ - content: c.content, - ...(c.source ? { source: c.source } : {}), - }); - } - } - - let totalLength = 0; - const results: (string | Record)[] = []; - for (const result of fullResults) { - const len = typeof result === 'string' ? result.length : JSON.stringify(result).length; - totalLength += len; - if (totalLength > maxLength) break; - results.push(result); - } - - if (results.length < fullResults.length) { - results.unshift(`Truncated; showing ${results.length} of ${fullResults.length} results.`); - } - - return { results }; - } - - private indexMethods(methods: MethodEntry[]): void { - const docs: MiniSearchDocument[] = methods.map((m, i) => ({ - id: `method-${i}`, - kind: 'http_method' as const, - name: m.name, - endpoint: m.endpoint, - summary: m.summary, - description: m.description, - qualified: m.qualified, - stainlessPath: m.stainlessPath, - _original: m as unknown as Record, - })); - if (docs.length > 0) { - this.methodIndex.addAll(docs); - } - } - - private async loadDocsDirectory(docsDir: string): Promise { - let entries; - try { - entries = await fs.readdir(docsDir, { withFileTypes: true }); - } catch (err) { - getLogger().warn({ err, docsDir }, 'Could not read docs directory'); - return; - } - - const files = entries - .filter((e) => e.isFile()) - .filter((e) => e.name.endsWith('.md') || e.name.endsWith('.markdown') || e.name.endsWith('.json')); - - for (const file of files) { - try { - const filePath = path.join(docsDir, file.name); - const content = await fs.readFile(filePath, 'utf-8'); - - if (file.name.endsWith('.json')) { - const texts = extractTexts(JSON.parse(content)); - if (texts.length > 0) { - this.indexProse(texts.join('\n\n'), file.name); - } - } else { - // Parse optional YAML frontmatter for language tagging. - // Files with a "language" field in frontmatter will only - // surface in searches for that language. - // - // Example: - // --- - // language: python - // --- - // # Error handling in Python - // ... - const frontmatter = parseFrontmatter(content); - const source = frontmatter.language ? `lang:${frontmatter.language}:${file.name}` : file.name; - this.indexProse(content, source); - } - } catch (err) { - getLogger().warn({ err, file: file.name }, 'Failed to index docs file'); - } - } - } - - private indexProse(markdown: string, source: string): void { - const chunks = chunkMarkdown(markdown); - const baseId = this.proseIndex.documentCount; - - const docs: MiniSearchDocument[] = chunks.map((chunk, i) => ({ - id: `prose-${baseId + i}`, - kind: 'prose' as const, - content: chunk.content, - ...(chunk.sectionContext != null ? { sectionContext: chunk.sectionContext } : {}), - _original: { ...chunk, source } as unknown as Record, - })); - - if (docs.length > 0) { - this.proseIndex.addAll(docs); - } - } -} - -/** Lightweight markdown chunker — splits on headers, chunks by word count. */ -function chunkMarkdown(markdown: string): { content: string; tag: string; sectionContext?: string }[] { - // Strip YAML frontmatter - const stripped = markdown.replace(/^---\n[\s\S]*?\n---\n?/, ''); - const lines = stripped.split('\n'); - - const chunks: { content: string; tag: string; sectionContext?: string }[] = []; - const headers: string[] = []; - let current: string[] = []; - - const flush = () => { - const text = current.join('\n').trim(); - if (!text) return; - const sectionContext = headers.length > 0 ? headers.join(' > ') : undefined; - // Split into ~200-word chunks - const words = text.split(/\s+/); - for (let i = 0; i < words.length; i += 200) { - const slice = words.slice(i, i + 200).join(' '); - if (slice) { - chunks.push({ content: slice, tag: 'p', ...(sectionContext != null ? { sectionContext } : {}) }); - } - } - current = []; - }; - - for (const line of lines) { - const headerMatch = line.match(/^(#{1,6})\s+(.+)/); - if (headerMatch) { - flush(); - const level = headerMatch[1]!.length; - const text = headerMatch[2]!.trim(); - while (headers.length >= level) headers.pop(); - headers.push(text); - } else { - current.push(line); - } - } - flush(); - - return chunks; -} - -/** Recursively extracts string values from a JSON structure. */ -function extractTexts(data: unknown, depth = 0): string[] { - if (depth > 10) return []; - if (typeof data === 'string') return data.trim() ? [data] : []; - if (Array.isArray(data)) return data.flatMap((item) => extractTexts(item, depth + 1)); - if (typeof data === 'object' && data !== null) { - return Object.values(data).flatMap((v) => extractTexts(v, depth + 1)); - } - return []; -} - -/** Parses YAML frontmatter from a markdown string, extracting the language field if present. */ -function parseFrontmatter(markdown: string): { language?: string } { - const match = markdown.match(/^---\n([\s\S]*?)\n---/); - if (!match) return {}; - const body = match[1] ?? ''; - const langMatch = body.match(/^language:\s*(.+)$/m); - return langMatch ? { language: langMatch[1]!.trim() } : {}; -} diff --git a/packages/mcp-server/src/logger.ts b/packages/mcp-server/src/logger.ts deleted file mode 100644 index 29dab11c..00000000 --- a/packages/mcp-server/src/logger.ts +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { pino, type Level, type Logger } from 'pino'; -import pretty from 'pino-pretty'; - -let _logger: Logger | undefined; - -export function configureLogger({ level, pretty: usePretty }: { level: Level; pretty: boolean }): void { - _logger = pino( - { - level, - timestamp: pino.stdTimeFunctions.isoTime, - formatters: { - level(label) { - return { level: label }; - }, - }, - }, - usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr, - ); -} - -export function getLogger(): Logger { - if (!_logger) { - throw new Error('Logger has not been configured. Call configureLogger() before using the logger.'); - } - return _logger; -} diff --git a/packages/mcp-server/src/methods.ts b/packages/mcp-server/src/methods.ts deleted file mode 100644 index 71e4da35..00000000 --- a/packages/mcp-server/src/methods.ts +++ /dev/null @@ -1,332 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { McpOptions } from './options'; - -export type SdkMethod = { - clientCallName: string; - fullyQualifiedName: string; - httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query'; - httpPath?: string; -}; - -export const sdkMethods: SdkMethod[] = [ - { - clientCallName: 'client.parse.handle', - fullyQualifiedName: 'parse.handle', - httpMethod: 'post', - httpPath: '/parse', - }, - { - clientCallName: 'client.web.extract', - fullyQualifiedName: 'web.extract', - httpMethod: 'post', - httpPath: '/web/extract', - }, - { - clientCallName: 'client.web.extractCompetitors', - fullyQualifiedName: 'web.extractCompetitors', - httpMethod: 'get', - httpPath: '/web/competitors', - }, - { - clientCallName: 'client.web.extractFonts', - fullyQualifiedName: 'web.extractFonts', - httpMethod: 'get', - httpPath: '/web/fonts', - }, - { - clientCallName: 'client.web.extractStyleguide', - fullyQualifiedName: 'web.extractStyleguide', - httpMethod: 'get', - httpPath: '/web/styleguide', - }, - { - clientCallName: 'client.web.screenshot', - fullyQualifiedName: 'web.screenshot', - httpMethod: 'get', - httpPath: '/web/screenshot', - }, - { - clientCallName: 'client.web.search', - fullyQualifiedName: 'web.search', - httpMethod: 'post', - httpPath: '/web/search', - }, - { - clientCallName: 'client.web.webCrawlMd', - fullyQualifiedName: 'web.webCrawlMd', - httpMethod: 'post', - httpPath: '/web/crawl', - }, - { - clientCallName: 'client.web.webScrapeHTML', - fullyQualifiedName: 'web.webScrapeHTML', - httpMethod: 'get', - httpPath: '/web/scrape/html', - }, - { - clientCallName: 'client.web.webScrapeImages', - fullyQualifiedName: 'web.webScrapeImages', - httpMethod: 'get', - httpPath: '/web/scrape/images', - }, - { - clientCallName: 'client.web.webScrapeMd', - fullyQualifiedName: 'web.webScrapeMd', - httpMethod: 'get', - httpPath: '/web/scrape/markdown', - }, - { - clientCallName: 'client.web.webScrapeSitemap', - fullyQualifiedName: 'web.webScrapeSitemap', - httpMethod: 'get', - httpPath: '/web/scrape/sitemap', - }, - { - clientCallName: 'client.ai.extractProduct', - fullyQualifiedName: 'ai.extractProduct', - httpMethod: 'post', - httpPath: '/brand/ai/product', - }, - { - clientCallName: 'client.ai.extractProducts', - fullyQualifiedName: 'ai.extractProducts', - httpMethod: 'post', - httpPath: '/brand/ai/products', - }, - { - clientCallName: 'client.brand.retrieve', - fullyQualifiedName: 'brand.retrieve', - httpMethod: 'post', - httpPath: '/brand/retrieve', - }, - { - clientCallName: 'client.brand.retrieveSimplified', - fullyQualifiedName: 'brand.retrieveSimplified', - httpMethod: 'get', - httpPath: '/brand/retrieve-simplified', - }, - { - clientCallName: 'client.brand.search', - fullyQualifiedName: 'brand.search', - httpMethod: 'get', - httpPath: '/brand/search', - }, - { - clientCallName: 'client.industry.retrieveNaics', - fullyQualifiedName: 'industry.retrieveNaics', - httpMethod: 'get', - httpPath: '/web/naics', - }, - { - clientCallName: 'client.industry.retrieveSic', - fullyQualifiedName: 'industry.retrieveSic', - httpMethod: 'get', - httpPath: '/web/sic', - }, - { - clientCallName: 'client.utility.prefetch', - fullyQualifiedName: 'utility.prefetch', - httpMethod: 'post', - httpPath: '/utility/prefetch', - }, - { - clientCallName: 'client.monitors.create', - fullyQualifiedName: 'monitors.create', - httpMethod: 'post', - httpPath: '/monitors', - }, - { - clientCallName: 'client.monitors.retrieve', - fullyQualifiedName: 'monitors.retrieve', - httpMethod: 'get', - httpPath: '/monitors/{monitor_id}', - }, - { - clientCallName: 'client.monitors.update', - fullyQualifiedName: 'monitors.update', - httpMethod: 'patch', - httpPath: '/monitors/{monitor_id}', - }, - { - clientCallName: 'client.monitors.list', - fullyQualifiedName: 'monitors.list', - httpMethod: 'get', - httpPath: '/monitors', - }, - { - clientCallName: 'client.monitors.delete', - fullyQualifiedName: 'monitors.delete', - httpMethod: 'delete', - httpPath: '/monitors/{monitor_id}', - }, - { - clientCallName: 'client.monitors.getCreditUsage', - fullyQualifiedName: 'monitors.getCreditUsage', - httpMethod: 'get', - httpPath: '/monitors/credit-usage', - }, - { - clientCallName: 'client.monitors.getLimits', - fullyQualifiedName: 'monitors.getLimits', - httpMethod: 'get', - httpPath: '/monitors/limits', - }, - { - clientCallName: 'client.monitors.listAccountChanges', - fullyQualifiedName: 'monitors.listAccountChanges', - httpMethod: 'get', - httpPath: '/monitors/changes', - }, - { - clientCallName: 'client.monitors.listAccountRuns', - fullyQualifiedName: 'monitors.listAccountRuns', - httpMethod: 'get', - httpPath: '/monitors/runs', - }, - { - clientCallName: 'client.monitors.listChanges', - fullyQualifiedName: 'monitors.listChanges', - httpMethod: 'get', - httpPath: '/monitors/{monitor_id}/changes', - }, - { - clientCallName: 'client.monitors.listRuns', - fullyQualifiedName: 'monitors.listRuns', - httpMethod: 'get', - httpPath: '/monitors/{monitor_id}/runs', - }, - { - clientCallName: 'client.monitors.retrieveChange', - fullyQualifiedName: 'monitors.retrieveChange', - httpMethod: 'get', - httpPath: '/monitors/changes/{change_id}', - }, - { - clientCallName: 'client.monitors.run', - fullyQualifiedName: 'monitors.run', - httpMethod: 'post', - httpPath: '/monitors/{monitor_id}/run', - }, - { - clientCallName: 'client.batch.retrieve', - fullyQualifiedName: 'batch.retrieve', - httpMethod: 'get', - httpPath: '/batch/{batch_id}', - }, - { - clientCallName: 'client.batch.list', - fullyQualifiedName: 'batch.list', - httpMethod: 'get', - httpPath: '/batch/list', - }, - { - clientCallName: 'client.batch.delete', - fullyQualifiedName: 'batch.delete', - httpMethod: 'delete', - httpPath: '/batch/{batch_id}', - }, - { - clientCallName: 'client.batch.cancel', - fullyQualifiedName: 'batch.cancel', - httpMethod: 'post', - httpPath: '/batch/{batch_id}/cancel', - }, - { - clientCallName: 'client.batch.getResults', - fullyQualifiedName: 'batch.getResults', - httpMethod: 'get', - httpPath: '/batch/{batch_id}/results', - }, - { - clientCallName: 'client.batch.submit', - fullyQualifiedName: 'batch.submit', - httpMethod: 'post', - httpPath: '/batch/submit', - }, - { - clientCallName: 'client.people.enrich', - fullyQualifiedName: 'people.enrich', - httpMethod: 'post', - httpPath: '/people/enrich', - }, - { - clientCallName: 'client.news.search', - fullyQualifiedName: 'news.search', - httpMethod: 'post', - httpPath: '/news/search', - }, -]; - -function allowedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined { - if (!options) { - return undefined; - } - - let allowedMethods: SdkMethod[]; - - if (options.codeAllowHttpGets || options.codeAllowedMethods) { - // Start with nothing allowed and then add into it from options - let allowedMethodsSet = new Set(); - - if (options.codeAllowHttpGets) { - // Add all methods that map to an HTTP GET - sdkMethods - .filter((method) => method.httpMethod === 'get') - .forEach((method) => allowedMethodsSet.add(method)); - } - - if (options.codeAllowedMethods) { - // Add all methods that match any of the allowed regexps - const allowedRegexps = options.codeAllowedMethods.map((pattern) => { - try { - return new RegExp(pattern); - } catch (e) { - throw new Error( - `Invalid regex pattern for allowed method: "${pattern}": ${e instanceof Error ? e.message : e}`, - ); - } - }); - - sdkMethods - .filter((method) => allowedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName))) - .forEach((method) => allowedMethodsSet.add(method)); - } - - allowedMethods = Array.from(allowedMethodsSet); - } else { - // Start with everything allowed - allowedMethods = [...sdkMethods]; - } - - if (options.codeBlockedMethods) { - // Filter down based on blocked regexps - const blockedRegexps = options.codeBlockedMethods.map((pattern) => { - try { - return new RegExp(pattern); - } catch (e) { - throw new Error( - `Invalid regex pattern for blocked method: "${pattern}": ${e instanceof Error ? e.message : e}`, - ); - } - }); - - allowedMethods = allowedMethods.filter( - (method) => !blockedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)), - ); - } - - return allowedMethods; -} - -export function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined { - const allowedMethods = allowedMethodsForCodeTool(options); - if (!allowedMethods) { - return undefined; - } - - const allowedSet = new Set(allowedMethods.map((method) => method.fullyQualifiedName)); - - // Return any methods that are not explicitly allowed - return sdkMethods.filter((method) => !allowedSet.has(method.fullyQualifiedName)); -} diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts deleted file mode 100644 index ff817c70..00000000 --- a/packages/mcp-server/src/options.ts +++ /dev/null @@ -1,185 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import qs from 'qs'; -import yargs from 'yargs'; -import { hideBin } from 'yargs/helpers'; -import z from 'zod'; -import { readEnv } from './util'; - -export type CLIOptions = McpOptions & { - debug: boolean; - logFormat: 'json' | 'pretty'; - transport: 'stdio' | 'http'; - port: number | undefined; - socket: string | undefined; -}; - -export type McpOptions = { - includeCodeTool?: boolean | undefined; - includeDocsTools?: boolean | undefined; - stainlessApiKey?: string | undefined; - docsSearchMode?: 'local' | undefined; - docsDir?: string | undefined; - codeAllowHttpGets?: boolean | undefined; - codeAllowedMethods?: string[] | undefined; - codeBlockedMethods?: string[] | undefined; - codeExecutionMode: McpCodeExecutionMode; - customInstructionsPath?: string | undefined; -}; - -export type McpCodeExecutionMode = 'local'; - -export function parseCLIOptions(): CLIOptions { - const opts = yargs(hideBin(process.argv)) - .option('code-allow-http-gets', { - type: 'boolean', - description: - 'Allow all code tool methods that map to HTTP GET operations. If all code-allow-* flags are unset, then everything is allowed.', - }) - .option('code-allowed-methods', { - type: 'string', - array: true, - description: - 'Methods to explicitly allow for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.', - }) - .option('code-blocked-methods', { - type: 'string', - array: true, - description: - 'Methods to explicitly block for code tool. Evaluated as regular expressions against method fully qualified names. If all code-allow-* flags are unset, then everything is allowed.', - }) - .option('code-execution-mode', { - type: 'string', - choices: ['local'], - default: 'local', - description: - 'The server was generated without access to the Stainless API, so code execution can only run locally on the MCP server machine.', - }) - .option('custom-instructions-path', { - type: 'string', - description: 'Path to custom instructions for the MCP server', - }) - .option('debug', { type: 'boolean', description: 'Enable debug logging' }) - .option('docs-dir', { - type: 'string', - description: - 'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.', - }) - .option('docs-search-mode', { - type: 'string', - choices: ['local'], - default: 'local', - description: - "Documentation search will use an in-memory search index built from embedded SDK method data and optional local docs files; the 'stainless-api' option is unavailable.", - }) - .option('log-format', { - type: 'string', - choices: ['json', 'pretty'], - description: 'Format for log output; defaults to json unless tty is detected', - }) - .option('no-tools', { - type: 'string', - array: true, - choices: ['code', 'docs'], - description: 'Tools to explicitly disable', - }) - .option('port', { - type: 'number', - default: 3000, - description: 'Port to serve on if using http transport', - }) - .option('socket', { type: 'string', description: 'Unix socket to serve on if using http transport' }) - .option('stainless-api-key', { - type: 'string', - default: readEnv('STAINLESS_API_KEY'), - description: - 'API key for Stainless. Used to authenticate requests to Stainless-hosted tools endpoints.', - }) - .option('tools', { - type: 'string', - array: true, - choices: ['code', 'docs'], - description: 'Tools to explicitly enable', - }) - .option('transport', { - type: 'string', - choices: ['stdio', 'http'], - default: 'stdio', - description: 'What transport to use; stdio for local servers or http for remote servers', - }) - .env('MCP_SERVER') - .version(true) - .help(); - - const argv = opts.parseSync(); - - const shouldIncludeToolType = (toolType: 'code' | 'docs') => - argv.noTools?.includes(toolType) ? false - : argv.tools?.includes(toolType) ? true - : undefined; - - const includeCodeTool = shouldIncludeToolType('code'); - const includeDocsTools = shouldIncludeToolType('docs'); - - const transport = argv.transport as 'stdio' | 'http'; - const logFormat = - argv.logFormat ? (argv.logFormat as 'json' | 'pretty') - : process.stderr.isTTY ? 'pretty' - : 'json'; - - return { - ...(includeCodeTool !== undefined && { includeCodeTool }), - ...(includeDocsTools !== undefined && { includeDocsTools }), - debug: !!argv.debug, - stainlessApiKey: argv.stainlessApiKey, - docsSearchMode: argv.docsSearchMode as 'local' | undefined, - docsDir: argv.docsDir, - codeAllowHttpGets: argv.codeAllowHttpGets, - codeAllowedMethods: argv.codeAllowedMethods, - codeBlockedMethods: argv.codeBlockedMethods, - codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode, - customInstructionsPath: argv.customInstructionsPath, - transport, - logFormat, - port: argv.port, - socket: argv.socket, - }; -} - -const coerceArray = (zodType: T) => - z.preprocess( - (val) => - Array.isArray(val) ? val - : val ? [val] - : val, - z.array(zodType).optional(), - ); - -const QueryOptions = z.object({ - tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to use'), - no_tools: coerceArray(z.enum(['code', 'docs'])).describe('Specify which MCP tools to not use.'), - tool: coerceArray(z.string()).describe('Include tools matching the specified names'), -}); - -export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions { - const queryObject = typeof query === 'string' ? qs.parse(query) : query; - const queryOptions = QueryOptions.parse(queryObject); - - let codeTool: boolean | undefined = - queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false - : queryOptions.tools?.includes('code') ? true - : defaultOptions.includeCodeTool; - - let docsTools: boolean | undefined = - queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false - : queryOptions.tools?.includes('docs') ? true - : defaultOptions.includeDocsTools; - - return { - ...(codeTool !== undefined && { includeCodeTool: codeTool }), - ...(docsTools !== undefined && { includeDocsTools: docsTools }), - codeExecutionMode: defaultOptions.codeExecutionMode, - docsSearchMode: defaultOptions.docsSearchMode, - docsDir: defaultOptions.docsDir, - }; -} diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts deleted file mode 100644 index 193f5ed0..00000000 --- a/packages/mcp-server/src/server.ts +++ /dev/null @@ -1,208 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { Server } from '@modelcontextprotocol/sdk/server/index.js'; -import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; -import { - CallToolRequestSchema, - ListToolsRequestSchema, - SetLevelRequestSchema, -} from '@modelcontextprotocol/sdk/types.js'; -import { ClientOptions } from 'context.dev'; -import ContextDev from 'context.dev'; -import { codeTool } from './code-tool'; -import docsSearchTool from './docs-search-tool'; -import { setLocalSearch } from './docs-search-tool'; -import { LocalDocsSearch } from './local-docs-search'; -import { getInstructions } from './instructions'; -import { McpOptions } from './options'; -import { blockedMethodsForCodeTool } from './methods'; -import { HandlerFunction, McpRequestContext, ToolCallResult, McpTool } from './types'; - -export const newMcpServer = async ({ - stainlessApiKey, - customInstructionsPath, -}: { - stainlessApiKey?: string | undefined; - customInstructionsPath?: string | undefined; -}) => - new McpServer( - { - name: 'context_dev_api', - version: '2.13.0', - }, - { - instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }), - capabilities: { tools: {}, logging: {} }, - }, - ); - -/** - * Initializes the provided MCP Server with the given tools and handlers. - * If not provided, the default client, tools and handlers will be used. - */ -export async function initMcpServer(params: { - server: Server | McpServer; - clientOptions?: ClientOptions; - mcpOptions?: McpOptions; - stainlessApiKey?: string | undefined; - upstreamClientEnvs?: Record | undefined; - mcpSessionId?: string | undefined; - mcpClientInfo?: { name: string; version: string } | undefined; -}) { - const server = params.server instanceof McpServer ? params.server.server : params.server; - - const logAtLevel = - (level: 'debug' | 'info' | 'warning' | 'error') => - (message: string, ...rest: unknown[]) => { - void server.sendLoggingMessage({ - level, - data: { message, rest }, - }); - }; - const logger = { - debug: logAtLevel('debug'), - info: logAtLevel('info'), - warn: logAtLevel('warning'), - error: logAtLevel('error'), - }; - - if (params.mcpOptions?.docsSearchMode === 'local') { - const docsDir = params.mcpOptions?.docsDir; - const localSearch = await LocalDocsSearch.create(docsDir ? { docsDir } : undefined); - setLocalSearch(localSearch); - } - - let _client: ContextDev | undefined; - let _clientError: Error | undefined; - let _logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off' | undefined; - - const getClient = (): ContextDev => { - if (_clientError) throw _clientError; - if (!_client) { - try { - _client = new ContextDev({ - logger, - ...params.clientOptions, - defaultHeaders: { - ...params.clientOptions?.defaultHeaders, - 'X-Stainless-MCP': 'true', - }, - }); - if (_logLevel) { - _client = _client.withOptions({ logLevel: _logLevel }); - } - } catch (e) { - _clientError = e instanceof Error ? e : new Error(String(e)); - throw _clientError; - } - } - return _client; - }; - - const providedTools = selectTools(params.mcpOptions); - const toolMap = Object.fromEntries(providedTools.map((mcpTool) => [mcpTool.tool.name, mcpTool])); - - server.setRequestHandler(ListToolsRequestSchema, async () => { - return { - tools: providedTools.map((mcpTool) => mcpTool.tool), - }; - }); - - server.setRequestHandler(CallToolRequestSchema, async (request) => { - const { name, arguments: args } = request.params; - const mcpTool = toolMap[name]; - if (!mcpTool) { - throw new Error(`Unknown tool: ${name}`); - } - - let client: ContextDev; - try { - client = getClient(); - } catch (error) { - return { - content: [ - { - type: 'text' as const, - text: `Failed to initialize client: ${error instanceof Error ? error.message : String(error)}`, - }, - ], - isError: true, - }; - } - - return executeHandler({ - handler: mcpTool.handler, - reqContext: { - client, - stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey, - upstreamClientEnvs: params.upstreamClientEnvs, - mcpSessionId: params.mcpSessionId, - mcpClientInfo: params.mcpClientInfo, - }, - args, - }); - }); - - server.setRequestHandler(SetLevelRequestSchema, async (request) => { - const { level } = request.params; - let logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off'; - switch (level) { - case 'debug': - logLevel = 'debug'; - break; - case 'info': - logLevel = 'info'; - break; - case 'notice': - case 'warning': - logLevel = 'warn'; - break; - case 'error': - logLevel = 'error'; - break; - default: - logLevel = 'off'; - break; - } - _logLevel = logLevel; - if (_client) { - _client = _client.withOptions({ logLevel }); - } - return {}; - }); -} - -/** - * Selects the tools to include in the MCP Server based on the provided options. - */ -export function selectTools(options?: McpOptions): McpTool[] { - const includedTools = []; - - if (options?.includeCodeTool ?? true) { - includedTools.push( - codeTool({ - blockedMethods: blockedMethodsForCodeTool(options), - codeExecutionMode: options?.codeExecutionMode ?? 'local', - }), - ); - } - if (options?.includeDocsTools ?? true) { - includedTools.push(docsSearchTool); - } - return includedTools; -} - -/** - * Runs the provided handler with the given client and arguments. - */ -export async function executeHandler({ - handler, - reqContext, - args, -}: { - handler: HandlerFunction; - reqContext: McpRequestContext; - args: Record | undefined; -}): Promise { - return await handler({ reqContext, args: args || {} }); -} diff --git a/packages/mcp-server/src/stdio.ts b/packages/mcp-server/src/stdio.ts deleted file mode 100644 index b04a5441..00000000 --- a/packages/mcp-server/src/stdio.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; -import { McpOptions } from './options'; -import { initMcpServer, newMcpServer } from './server'; -import { getLogger } from './logger'; - -export const launchStdioServer = async (mcpOptions: McpOptions) => { - const server = await newMcpServer({ - stainlessApiKey: mcpOptions.stainlessApiKey, - customInstructionsPath: mcpOptions.customInstructionsPath, - }); - - await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey }); - - const transport = new StdioServerTransport(); - await server.connect(transport); - getLogger().info('MCP Server running on stdio'); -}; diff --git a/packages/mcp-server/src/types.ts b/packages/mcp-server/src/types.ts deleted file mode 100644 index dd1e4dee..00000000 --- a/packages/mcp-server/src/types.ts +++ /dev/null @@ -1,126 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import ContextDev from 'context.dev'; -import { Tool } from '@modelcontextprotocol/sdk/types.js'; - -type TextContentBlock = { - type: 'text'; - text: string; -}; - -type ImageContentBlock = { - type: 'image'; - data: string; - mimeType: string; -}; - -type AudioContentBlock = { - type: 'audio'; - data: string; - mimeType: string; -}; - -type ResourceContentBlock = { - type: 'resource'; - resource: - | { - uri: string; - mimeType: string; - text: string; - } - | { - uri: string; - mimeType: string; - blob: string; - }; -}; - -export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBlock | ResourceContentBlock; - -export type ToolCallResult = { - content: ContentBlock[]; - isError?: boolean; -}; - -export type McpRequestContext = { - client: ContextDev; - stainlessApiKey?: string | undefined; - upstreamClientEnvs?: Record | undefined; - mcpSessionId?: string | undefined; - mcpClientInfo?: { name: string; version: string } | undefined; -}; - -export type HandlerFunction = ({ - reqContext, - args, -}: { - reqContext: McpRequestContext; - args: Record | undefined; -}) => Promise; - -export function asTextContentResult(result: unknown): ToolCallResult { - return { - content: [ - { - type: 'text', - text: JSON.stringify(result, null, 2), - }, - ], - }; -} - -export async function asBinaryContentResult(response: Response): Promise { - const blob = await response.blob(); - const mimeType = blob.type; - const data = Buffer.from(await blob.arrayBuffer()).toString('base64'); - if (mimeType.startsWith('image/')) { - return { - content: [{ type: 'image', mimeType, data }], - }; - } else if (mimeType.startsWith('audio/')) { - return { - content: [{ type: 'audio', mimeType, data }], - }; - } else { - return { - content: [ - { - type: 'resource', - resource: { - // We must give a URI, even though this isn't actually an MCP resource. - uri: 'resource://tool-response', - mimeType, - blob: data, - }, - }, - ], - }; - } -} - -export function asErrorResult(message: string): ToolCallResult { - return { - content: [ - { - type: 'text', - text: message, - }, - ], - isError: true, - }; -} - -export type Metadata = { - resource: string; - operation: 'read' | 'write'; - tags: string[]; - httpMethod?: string; - httpPath?: string; - operationId?: string; -}; - -export type McpTool = { - metadata: Metadata; - tool: Tool; - handler: HandlerFunction; -}; diff --git a/packages/mcp-server/src/util.ts b/packages/mcp-server/src/util.ts deleted file mode 100644 index 069a2b47..00000000 --- a/packages/mcp-server/src/util.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export const readEnv = (env: string): string | undefined => { - if (typeof (globalThis as any).process !== 'undefined') { - return (globalThis as any).process.env?.[env]?.trim() || undefined; - } else if (typeof (globalThis as any).Deno !== 'undefined') { - return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined; - } - return; -}; - -export const readEnvOrError = (env: string): string => { - let envValue = readEnv(env); - if (envValue === undefined) { - throw new Error(`Environment variable ${env} is not set`); - } - return envValue; -}; - -export const requireValue = (value: T | undefined, description: string): T => { - if (value === undefined) { - throw new Error(`Missing required value: ${description}`); - } - return value; -}; diff --git a/packages/mcp-server/tests/options.test.ts b/packages/mcp-server/tests/options.test.ts deleted file mode 100644 index 17306295..00000000 --- a/packages/mcp-server/tests/options.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { parseCLIOptions } from '../src/options'; - -// Mock process.argv -const mockArgv = (args: string[]) => { - const originalArgv = process.argv; - process.argv = ['node', 'test.js', ...args]; - return () => { - process.argv = originalArgv; - }; -}; - -describe('parseCLIOptions', () => { - it('default parsing should be stdio', () => { - const cleanup = mockArgv([]); - - const result = parseCLIOptions(); - - expect(result.transport).toBe('stdio'); - - cleanup(); - }); - - it('using http transport with a port', () => { - const cleanup = mockArgv(['--transport=http', '--port=2222']); - - const result = parseCLIOptions(); - - expect(result.transport).toBe('http'); - expect(result.port).toBe(2222); - cleanup(); - }); -}); diff --git a/packages/mcp-server/tsc-multi.json b/packages/mcp-server/tsc-multi.json deleted file mode 100644 index 4facad5a..00000000 --- a/packages/mcp-server/tsc-multi.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "targets": [ - { "extname": ".js", "module": "commonjs" }, - { "extname": ".mjs", "module": "esnext" } - ], - "projects": ["tsconfig.build.json"] -} diff --git a/packages/mcp-server/tsconfig.build.json b/packages/mcp-server/tsconfig.build.json deleted file mode 100644 index 28285988..00000000 --- a/packages/mcp-server/tsconfig.build.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["dist/src"], - "exclude": [], - "compilerOptions": { - "rootDir": "./dist/src", - "paths": { - "context.dev-mcp/*": ["./dist/src/*"], - "context.dev-mcp": ["./dist/src/index.ts"] - }, - "noEmit": false, - "declaration": true, - "declarationMap": true, - "outDir": "dist", - "pretty": true, - "sourceMap": true - } -} diff --git a/packages/mcp-server/tsconfig.dist-src.json b/packages/mcp-server/tsconfig.dist-src.json deleted file mode 100644 index e9f2d70b..00000000 --- a/packages/mcp-server/tsconfig.dist-src.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - // this config is included in the published src directory to prevent TS errors - // from appearing when users go to source, and VSCode opens the source .ts file - // via declaration maps - "include": ["index.ts"], - "compilerOptions": { - "target": "es2015", - "lib": ["DOM"], - "moduleResolution": "node" - } -} diff --git a/packages/mcp-server/tsconfig.json b/packages/mcp-server/tsconfig.json deleted file mode 100644 index dbbee1a6..00000000 --- a/packages/mcp-server/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "include": ["src", "tests", "examples"], - "exclude": [], - "compilerOptions": { - "target": "es2022", - "lib": ["es2022"], - "module": "commonjs", - "moduleResolution": "node", - "esModuleInterop": true, - "paths": { - "context.dev-mcp/*": ["./src/*"], - "context.dev-mcp": ["./src/index.ts"] - }, - "noEmit": true, - - "resolveJsonModule": true, - - "forceConsistentCasingInFileNames": true, - - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "strictBindCallApply": true, - "strictPropertyInitialization": true, - "noImplicitThis": true, - "noImplicitReturns": true, - "alwaysStrict": true, - "exactOptionalPropertyTypes": true, - "noUncheckedIndexedAccess": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - - "skipLibCheck": true - } -} diff --git a/packages/mcp-server/yarn.lock b/packages/mcp-server/yarn.lock deleted file mode 100644 index c6b17b02..00000000 --- a/packages/mcp-server/yarn.lock +++ /dev/null @@ -1,4169 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@anthropic-ai/mcpb@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@anthropic-ai/mcpb/-/mcpb-2.1.2.tgz#cf02801929734b8810961f22e2eb72758c27d527" - integrity sha512-goRbBC8ySo7SWb7tRzr+tL6FxDc4JPTRCdgfD2omba7freofvjq5rom1lBnYHZHo6Mizs1jAHJeN53aZbDoy8A== - dependencies: - "@inquirer/prompts" "^6.0.1" - commander "^13.1.0" - fflate "^0.8.2" - galactus "^1.0.0" - ignore "^7.0.5" - node-forge "^1.3.2" - pretty-bytes "^5.6.0" - zod "^3.25.67" - zod-to-json-schema "^3.24.6" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" - integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== - dependencies: - "@babel/helper-validator-identifier" "^7.28.5" - js-tokens "^4.0.0" - picocolors "^1.1.1" - -"@babel/compat-data@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" - integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== - -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" - integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== - dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" - "@babel/helper-compilation-targets" "^7.28.6" - "@babel/helper-module-transforms" "^7.28.6" - "@babel/helpers" "^7.28.6" - "@babel/parser" "^7.28.6" - "@babel/template" "^7.28.6" - "@babel/traverse" "^7.28.6" - "@babel/types" "^7.28.6" - "@jridgewell/remapping" "^2.3.5" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" - integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== - dependencies: - "@babel/parser" "^7.28.6" - "@babel/types" "^7.28.6" - "@jridgewell/gen-mapping" "^0.3.12" - "@jridgewell/trace-mapping" "^0.3.28" - jsesc "^3.0.2" - -"@babel/helper-compilation-targets@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" - integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== - dependencies: - "@babel/compat-data" "^7.28.6" - "@babel/helper-validator-option" "^7.27.1" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-globals@^7.28.0": - version "7.28.0" - resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" - integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== - -"@babel/helper-module-imports@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" - integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== - dependencies: - "@babel/traverse" "^7.28.6" - "@babel/types" "^7.28.6" - -"@babel/helper-module-transforms@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" - integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== - dependencies: - "@babel/helper-module-imports" "^7.28.6" - "@babel/helper-validator-identifier" "^7.28.5" - "@babel/traverse" "^7.28.6" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" - integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== - -"@babel/helper-string-parser@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" - integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== - -"@babel/helper-validator-identifier@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" - integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== - -"@babel/helper-validator-option@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" - integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== - -"@babel/helpers@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" - integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== - dependencies: - "@babel/template" "^7.28.6" - "@babel/types" "^7.28.6" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" - integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== - dependencies: - "@babel/types" "^7.28.6" - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" - integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== - dependencies: - "@babel/helper-plugin-utils" "^7.28.6" - -"@babel/plugin-syntax-import-meta@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" - integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== - dependencies: - "@babel/helper-plugin-utils" "^7.28.6" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" - integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== - dependencies: - "@babel/helper-plugin-utils" "^7.28.6" - -"@babel/template@^7.28.6", "@babel/template@^7.3.3": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" - integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== - dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/parser" "^7.28.6" - "@babel/types" "^7.28.6" - -"@babel/traverse@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" - integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== - dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" - "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.6" - "@babel/template" "^7.28.6" - "@babel/types" "^7.28.6" - debug "^4.3.1" - -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.28.6", "@babel/types@^7.3.3": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" - integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== - dependencies: - "@babel/helper-string-parser" "^7.27.1" - "@babel/helper-validator-identifier" "^7.28.5" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cloudflare/cabidela@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@cloudflare/cabidela/-/cabidela-0.2.4.tgz#9a3e9212e636a24d796a8f16741c24885b326a1a" - integrity sha512-u/1OwwqfcMvjmUFOcb6QtFzVVGpncHJxwl254wjzp0JC5CUlBkV6r5BbRrHI5ZYJEAgu8NeeorirxngmMFPZjQ== - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@eslint-community/eslint-utils@^4.4.0", "@eslint-community/eslint-utils@^4.8.0": - version "4.9.1" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595" - integrity sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ== - dependencies: - eslint-visitor-keys "^3.4.3" - -"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1": - version "4.12.2" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.2.tgz#bccdf615bcf7b6e8db830ec0b8d21c9a25de597b" - integrity sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew== - -"@eslint/config-array@^0.21.2": - version "0.21.2" - resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.2.tgz#f29e22057ad5316cf23836cee9a34c81fffcb7e6" - integrity sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw== - dependencies: - "@eslint/object-schema" "^2.1.7" - debug "^4.3.1" - minimatch "^3.1.5" - -"@eslint/config-helpers@^0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz#1bd006ceeb7e2e55b2b773ab318d300e1a66aeda" - integrity sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw== - dependencies: - "@eslint/core" "^0.17.0" - -"@eslint/core@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.17.0.tgz#77225820413d9617509da9342190a2019e78761c" - integrity sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ== - dependencies: - "@types/json-schema" "^7.0.15" - -"@eslint/eslintrc@^3.3.5": - version "3.3.5" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.5.tgz#c131793cfc1a7b96f24a83e0a8bbd4b881558c60" - integrity sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg== - dependencies: - ajv "^6.14.0" - debug "^4.3.2" - espree "^10.0.1" - globals "^14.0.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.1" - minimatch "^3.1.5" - strip-json-comments "^3.1.1" - -"@eslint/js@9.39.4": - version "9.39.4" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.4.tgz#a3f83bfc6fd9bf33a853dfacd0b49b398eb596c1" - integrity sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw== - -"@eslint/object-schema@^2.1.7": - version "2.1.7" - resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.7.tgz#6e2126a1347e86a4dedf8706ec67ff8e107ebbad" - integrity sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA== - -"@eslint/plugin-kit@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz#9779e3fd9b7ee33571a57435cf4335a1794a6cb2" - integrity sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA== - dependencies: - "@eslint/core" "^0.17.0" - levn "^0.4.1" - -"@hono/node-server@^1.19.10", "@hono/node-server@^1.19.9": - version "1.19.11" - resolved "https://registry.yarnpkg.com/@hono/node-server/-/node-server-1.19.11.tgz#dc419f0826dd2504e9fc86ad289d5636a0444e2f" - integrity sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g== - -"@humanfs/core@^0.19.1": - version "0.19.1" - resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" - integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== - -"@humanfs/node@^0.16.6": - version "0.16.7" - resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.7.tgz#822cb7b3a12c5a240a24f621b5a2413e27a45f26" - integrity sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ== - dependencies: - "@humanfs/core" "^0.19.1" - "@humanwhocodes/retry" "^0.4.0" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/retry@^0.4.0", "@humanwhocodes/retry@^0.4.2": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" - integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== - -"@inquirer/checkbox@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-3.0.1.tgz#0a57f704265f78c36e17f07e421b98efb4b9867b" - integrity sha512-0hm2nrToWUdD6/UHnel/UKGdk1//ke5zGUpHIvk5ZWmaKezlGxZkOJXNSWsdxO/rEqTkbB3lNC2J6nBElV2aAQ== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/figures" "^1.0.6" - "@inquirer/type" "^2.0.0" - ansi-escapes "^4.3.2" - yoctocolors-cjs "^2.1.2" - -"@inquirer/confirm@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-4.0.1.tgz#9106d6bffa0b2fdd0e4f60319b6f04f2e06e6e25" - integrity sha512-46yL28o2NJ9doViqOy0VDcoTzng7rAb6yPQKU7VDLqkmbCaH4JqK4yk4XqlzNWy9PVC5pG1ZUXPBQv+VqnYs2w== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - -"@inquirer/core@^9.2.1": - version "9.2.1" - resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-9.2.1.tgz#677c49dee399c9063f31e0c93f0f37bddc67add1" - integrity sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg== - dependencies: - "@inquirer/figures" "^1.0.6" - "@inquirer/type" "^2.0.0" - "@types/mute-stream" "^0.0.4" - "@types/node" "^22.5.5" - "@types/wrap-ansi" "^3.0.0" - ansi-escapes "^4.3.2" - cli-width "^4.1.0" - mute-stream "^1.0.0" - signal-exit "^4.1.0" - strip-ansi "^6.0.1" - wrap-ansi "^6.2.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/editor@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-3.0.1.tgz#d109f21e050af6b960725388cb1c04214ed7c7bc" - integrity sha512-VA96GPFaSOVudjKFraokEEmUQg/Lub6OXvbIEZU1SDCmBzRkHGhxoFAVaF30nyiB4m5cEbDgiI2QRacXZ2hw9Q== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - external-editor "^3.1.0" - -"@inquirer/expand@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-3.0.1.tgz#aed9183cac4d12811be47a4a895ea8e82a17e22c" - integrity sha512-ToG8d6RIbnVpbdPdiN7BCxZGiHOTomOX94C2FaT5KOHupV40tKEDozp12res6cMIfRKrXLJyexAZhWVHgbALSQ== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/figures@^1.0.6": - version "1.0.15" - resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.15.tgz#dbb49ed80df11df74268023b496ac5d9acd22b3a" - integrity sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g== - -"@inquirer/input@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-3.0.1.tgz#de63d49e516487388508d42049deb70f2cb5f28e" - integrity sha512-BDuPBmpvi8eMCxqC5iacloWqv+5tQSJlUafYWUe31ow1BVXjW2a5qe3dh4X/Z25Wp22RwvcaLCc2siHobEOfzg== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - -"@inquirer/number@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/number/-/number-2.0.1.tgz#b9863080d02ab7dc2e56e16433d83abea0f2a980" - integrity sha512-QpR8jPhRjSmlr/mD2cw3IR8HRO7lSVOnqUvQa8scv1Lsr3xoAMMworcYW3J13z3ppjBFBD2ef1Ci6AE5Qn8goQ== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - -"@inquirer/password@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-3.0.1.tgz#2a9a9143591088336bbd573bcb05d5bf080dbf87" - integrity sha512-haoeEPUisD1NeE2IanLOiFr4wcTXGWrBOyAyPZi1FfLJuXOzNmxCJPgUrGYKVh+Y8hfGJenIfz5Wb/DkE9KkMQ== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - ansi-escapes "^4.3.2" - -"@inquirer/prompts@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-6.0.1.tgz#43f5c0ed35c5ebfe52f1d43d46da2d363d950071" - integrity sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A== - dependencies: - "@inquirer/checkbox" "^3.0.1" - "@inquirer/confirm" "^4.0.1" - "@inquirer/editor" "^3.0.1" - "@inquirer/expand" "^3.0.1" - "@inquirer/input" "^3.0.1" - "@inquirer/number" "^2.0.1" - "@inquirer/password" "^3.0.1" - "@inquirer/rawlist" "^3.0.1" - "@inquirer/search" "^2.0.1" - "@inquirer/select" "^3.0.1" - -"@inquirer/rawlist@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-3.0.1.tgz#729def358419cc929045f264131878ed379e0af3" - integrity sha512-VgRtFIwZInUzTiPLSfDXK5jLrnpkuSOh1ctfaoygKAdPqjcjKYmGh6sCY1pb0aGnCGsmhUxoqLDUAU0ud+lGXQ== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/type" "^2.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/search@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/search/-/search-2.0.1.tgz#69b774a0a826de2e27b48981d01bc5ad81e73721" - integrity sha512-r5hBKZk3g5MkIzLVoSgE4evypGqtOannnB3PKTG9NRZxyFRKcfzrdxXXPcoJQsxJPzvdSU2Rn7pB7lw0GCmGAg== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/figures" "^1.0.6" - "@inquirer/type" "^2.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/select@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-3.0.1.tgz#1df9ed27fb85a5f526d559ac5ce7cc4e9dc4e7ec" - integrity sha512-lUDGUxPhdWMkN/fHy1Lk7pF3nK1fh/gqeyWXmctefhxLYxlDsc7vsPBEpxrfVGDsVdyYJsiJoD4bJ1b623cV1Q== - dependencies: - "@inquirer/core" "^9.2.1" - "@inquirer/figures" "^1.0.6" - "@inquirer/type" "^2.0.0" - ansi-escapes "^4.3.2" - yoctocolors-cjs "^2.1.2" - -"@inquirer/type@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-2.0.0.tgz#08fa513dca2cb6264fe1b0a2fabade051444e3f6" - integrity sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag== - dependencies: - mute-stream "^1.0.0" - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" - integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - -"@jest/core@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" - integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== - dependencies: - "@jest/console" "^29.7.0" - "@jest/reporters" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - ci-info "^3.2.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-changed-files "^29.7.0" - jest-config "^29.7.0" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-resolve-dependencies "^29.7.0" - jest-runner "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - jest-watcher "^29.7.0" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" - integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== - dependencies: - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - -"@jest/expect-utils@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" - integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== - dependencies: - jest-get-type "^29.6.3" - -"@jest/expect@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" - integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== - dependencies: - expect "^29.7.0" - jest-snapshot "^29.7.0" - -"@jest/fake-timers@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" - integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== - dependencies: - "@jest/types" "^29.6.3" - "@sinonjs/fake-timers" "^10.0.2" - "@types/node" "*" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -"@jest/globals@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" - integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/types" "^29.6.3" - jest-mock "^29.7.0" - -"@jest/reporters@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" - integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - "@types/node" "*" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^6.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.1.3" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - jest-worker "^29.7.0" - slash "^3.0.0" - string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" - -"@jest/schemas@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" - integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== - dependencies: - "@sinclair/typebox" "^0.27.8" - -"@jest/source-map@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" - integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== - dependencies: - "@jridgewell/trace-mapping" "^0.3.18" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/test-result@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" - integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== - dependencies: - "@jest/console" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" - integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== - dependencies: - "@jest/test-result" "^29.7.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - slash "^3.0.0" - -"@jest/transform@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" - integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== - dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^2.0.0" - fast-json-stable-stringify "^2.1.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - micromatch "^4.0.4" - pirates "^4.0.4" - slash "^3.0.0" - write-file-atomic "^4.0.2" - -"@jest/types@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" - integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== - dependencies: - "@jest/schemas" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" - integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== - dependencies: - "@jridgewell/sourcemap-codec" "^1.5.0" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/remapping@^2.3.5": - version "2.3.5" - resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" - integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": - version "1.5.5" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" - integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== - -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": - version "0.3.31" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" - integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@modelcontextprotocol/sdk@^1.27.1": - version "1.27.1" - resolved "https://registry.yarnpkg.com/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz#a602cf823bf8a68e13e7112f50aeb02b09fb83b9" - integrity sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA== - dependencies: - "@hono/node-server" "^1.19.9" - ajv "^8.17.1" - ajv-formats "^3.0.1" - content-type "^1.0.5" - cors "^2.8.5" - cross-spawn "^7.0.5" - eventsource "^3.0.2" - eventsource-parser "^3.0.0" - express "^5.2.1" - express-rate-limit "^8.2.1" - hono "^4.11.4" - jose "^6.1.3" - json-schema-typed "^8.0.2" - pkce-challenge "^5.0.0" - raw-body "^3.0.0" - zod "^3.25 || ^4.0" - zod-to-json-schema "^3.25.1" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@pinojs/redact@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@pinojs/redact/-/redact-0.4.0.tgz#c3de060dd12640dcc838516aa2a6803cc7b2e9d6" - integrity sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg== - -"@pkgr/core@^0.2.9": - version "0.2.9" - resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.9.tgz#d229a7b7f9dac167a156992ef23c7f023653f53b" - integrity sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA== - -"@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== - -"@sinonjs/commons@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" - integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.3.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== - dependencies: - "@sinonjs/commons" "^3.0.0" - -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - -"@tsconfig/node10@^1.0.7": - version "1.0.12" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.12.tgz#be57ceac1e4692b41be9de6be8c32a106636dba4" - integrity sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - -"@types/babel__core@^7.1.14": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" - integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.27.0" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.27.0.tgz#b5819294c51179957afaec341442f9341e4108a9" - integrity sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" - integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.28.0" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz#07d713d6cce0d265c9849db0cbe62d3f61f36f74" - integrity sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q== - dependencies: - "@babel/types" "^7.28.2" - -"@types/body-parser@*": - version "1.19.6" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.6.tgz#1859bebb8fd7dac9918a45d54c1971ab8b5af474" - integrity sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.38" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" - integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== - dependencies: - "@types/node" "*" - -"@types/cookie-parser@^1.4.10": - version "1.4.10" - resolved "https://registry.yarnpkg.com/@types/cookie-parser/-/cookie-parser-1.4.10.tgz#a045272a383a30597a01955d4f9c790018f214e4" - integrity sha512-B4xqkqfZ8Wek+rCOeRxsjMS9OgvzebEzzLYw7NHYuvzb7IdxOkI0ZHGgeEBX4PUM7QGVvNSK60T3OvWj3YfBRg== - -"@types/cors@^2.8.19": - version "2.8.19" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.19.tgz#d93ea2673fd8c9f697367f5eeefc2bbfa94f0342" - integrity sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg== - dependencies: - "@types/node" "*" - -"@types/estree@^1.0.6": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" - integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== - -"@types/express-serve-static-core@^5.0.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-5.1.1.tgz#1a77faffee9572d39124933259be2523837d7eaa" - integrity sha512-v4zIMr/cX7/d2BpAEX3KNKL/JrT1s43s96lLvvdTmza1oEvDudCqK9aF/djc/SWgy8Yh0h30TZx5VpzqFCxk5A== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - "@types/send" "*" - -"@types/express@^5.0.3": - version "5.0.6" - resolved "https://registry.yarnpkg.com/@types/express/-/express-5.0.6.tgz#2d724b2c990dcb8c8444063f3580a903f6d500cc" - integrity sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^5.0.0" - "@types/serve-static" "^2" - -"@types/graceful-fs@^4.1.3": - version "4.1.9" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" - integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== - dependencies: - "@types/node" "*" - -"@types/http-errors@*": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.5.tgz#5b749ab2b16ba113423feb1a64a95dcd30398472" - integrity sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg== - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" - integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== - -"@types/istanbul-lib-report@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" - integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" - integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@^29.4.0": - version "29.5.14" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" - integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - -"@types/json-schema@^7.0.15": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/mute-stream@^0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" - integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "25.0.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.8.tgz#e54e00f94fe1db2497b3e42d292b8376a2678c8d" - integrity sha512-powIePYMmC3ibL0UJ2i2s0WIbq6cg6UyVFQxSCpaPxxzAaziRfimGivjdF943sSGV6RADVbk0Nvlm5P/FB44Zg== - dependencies: - undici-types "~7.16.0" - -"@types/node@^22.5.5": - version "22.19.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.19.6.tgz#0e9d80ebcd2dfce03265768c17a1212d4eb07e82" - integrity sha512-qm+G8HuG6hOHQigsi7VGuLjUVu6TtBo/F05zvX04Mw2uCg9Dv0Qxy3Qw7j41SidlTcl5D/5yg0SEZqOB+EqZnQ== - dependencies: - undici-types "~6.21.0" - -"@types/qs@*", "@types/qs@^6.14.0": - version "6.14.0" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.14.0.tgz#d8b60cecf62f2db0fb68e5e006077b9178b85de5" - integrity sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ== - -"@types/range-parser@*": - version "1.2.7" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" - integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== - -"@types/send@*": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/send/-/send-1.2.1.tgz#6a784e45543c18c774c049bff6d3dbaf045c9c74" - integrity sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ== - dependencies: - "@types/node" "*" - -"@types/serve-static@^2": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-2.2.0.tgz#d4a447503ead0d1671132d1ab6bd58b805d8de6a" - integrity sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ== - dependencies: - "@types/http-errors" "*" - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" - integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== - -"@types/wrap-ansi@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" - integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== - -"@types/yargs-parser@*": - version "21.0.3" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" - integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== - -"@types/yargs@^17.0.8": - version "17.0.35" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.35.tgz#07013e46aa4d7d7d50a49e15604c1c5340d4eb24" - integrity sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg== - dependencies: - "@types/yargs-parser" "*" - -"@typescript-eslint/eslint-plugin@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.1.tgz#62f1befe59647524994e89de4516d8dcba7a850a" - integrity sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ== - dependencies: - "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.31.1" - "@typescript-eslint/type-utils" "8.31.1" - "@typescript-eslint/utils" "8.31.1" - "@typescript-eslint/visitor-keys" "8.31.1" - graphemer "^1.4.0" - ignore "^5.3.1" - natural-compare "^1.4.0" - ts-api-utils "^2.0.1" - -"@typescript-eslint/parser@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.31.1.tgz#e9b0ccf30d37dde724ee4d15f4dbc195995cce1b" - integrity sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q== - dependencies: - "@typescript-eslint/scope-manager" "8.31.1" - "@typescript-eslint/types" "8.31.1" - "@typescript-eslint/typescript-estree" "8.31.1" - "@typescript-eslint/visitor-keys" "8.31.1" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.31.1.tgz#1eb52e76878f545e4add142e0d8e3e97e7aa443b" - integrity sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw== - dependencies: - "@typescript-eslint/types" "8.31.1" - "@typescript-eslint/visitor-keys" "8.31.1" - -"@typescript-eslint/type-utils@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.31.1.tgz#be0f438fb24b03568e282a0aed85f776409f970c" - integrity sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA== - dependencies: - "@typescript-eslint/typescript-estree" "8.31.1" - "@typescript-eslint/utils" "8.31.1" - debug "^4.3.4" - ts-api-utils "^2.0.1" - -"@typescript-eslint/types@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.31.1.tgz#478ed6f7e8aee1be7b63a60212b6bffe1423b5d4" - integrity sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ== - -"@typescript-eslint/typescript-estree@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.31.1.tgz#37792fe7ef4d3021c7580067c8f1ae66daabacdf" - integrity sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag== - dependencies: - "@typescript-eslint/types" "8.31.1" - "@typescript-eslint/visitor-keys" "8.31.1" - debug "^4.3.4" - fast-glob "^3.3.2" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^2.0.1" - -"@typescript-eslint/utils@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.31.1.tgz#5628ea0393598a0b2f143d0fc6d019f0dee9dd14" - integrity sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.31.1" - "@typescript-eslint/types" "8.31.1" - "@typescript-eslint/typescript-estree" "8.31.1" - -"@typescript-eslint/visitor-keys@8.31.1": - version "8.31.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.31.1.tgz#6742b0e3ba1e0c1e35bdaf78c03e759eb8dd8e75" - integrity sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw== - dependencies: - "@typescript-eslint/types" "8.31.1" - eslint-visitor-keys "^4.2.0" - -"@valtown/deno-http-worker@^0.0.21": - version "0.0.21" - resolved "https://registry.yarnpkg.com/@valtown/deno-http-worker/-/deno-http-worker-0.0.21.tgz#9ce3b5c1d0db211fe7ea8297881fe551838474ad" - integrity sha512-16kFuUykann75lNytnXXIQlmpzreZjzdyT27ebT3yNGCS3kKaS1iZYWHc3Si9An54Cphwr4qEcviChQkEeJBlA== - -accepts@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-2.0.0.tgz#bbcf4ba5075467f3f2131eab3cffc73c2f5d7895" - integrity sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng== - dependencies: - mime-types "^3.0.0" - negotiator "^1.0.0" - -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-walk@^8.1.1: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== - dependencies: - acorn "^8.11.0" - -acorn@^8.11.0, acorn@^8.4.1: - version "8.15.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" - integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== - -acorn@^8.15.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" - integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ajv-formats@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578" - integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ== - dependencies: - ajv "^8.0.0" - -ajv@^6.14.0: - version "6.14.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.14.0.tgz#fd067713e228210636ebb08c60bd3765d6dbe73a" - integrity sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.0, ajv@^8.17.1: - version "8.17.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" - integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== - dependencies: - fast-deep-equal "^3.1.3" - fast-uri "^3.0.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - -ajv@^8.18.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.18.0.tgz#8864186b6738d003eb3a933172bb3833e10cefbc" - integrity sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A== - dependencies: - fast-deep-equal "^3.1.3" - fast-uri "^3.0.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - -ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -anymatch@^3.0.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -atomic-sleep@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" - integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== - -babel-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" - integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== - dependencies: - "@jest/transform" "^29.7.0" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.6.3" - chalk "^4.0.0" - graceful-fs "^4.2.9" - slash "^3.0.0" - -babel-plugin-istanbul@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" - integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" - "@types/babel__traverse" "^7.0.6" - -babel-preset-current-node-syntax@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" - integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-import-attributes" "^7.24.7" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - -babel-preset-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" - integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== - dependencies: - babel-plugin-jest-hoist "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -baseline-browser-mapping@^2.9.0: - version "2.9.14" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" - integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== - -body-parser@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-2.2.2.tgz#1a32cdb966beaf68de50a9dfbe5b58f83cb8890c" - integrity sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA== - dependencies: - bytes "^3.1.2" - content-type "^1.0.5" - debug "^4.4.3" - http-errors "^2.0.0" - iconv-lite "^0.7.0" - on-finished "^2.4.1" - qs "^6.14.1" - raw-body "^3.0.1" - type-is "^2.0.1" - -brace-expansion@^1.1.7: - version "1.1.12" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" - integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" - integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -browserslist@^4.24.0: - version "4.28.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" - integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== - dependencies: - baseline-browser-mapping "^2.9.0" - caniuse-lite "^1.0.30001759" - electron-to-chromium "^1.5.263" - node-releases "^2.0.27" - update-browserslist-db "^1.2.0" - -bs-logger@^0.2.6: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -bytes@^3.1.2, bytes@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" - integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== - dependencies: - es-errors "^1.3.0" - function-bind "^1.1.2" - -call-bound@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" - integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== - dependencies: - call-bind-apply-helpers "^1.0.2" - get-intrinsic "^1.3.0" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001759: - version "1.0.30001764" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" - integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -ci-info@^3.2.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" - integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== - -cjs-module-lexer@^1.0.0: - version "1.4.3" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d" - integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -cli-width@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" - integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== - -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - -collect-v8-coverage@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz#cc1f01eb8d02298cbc9a437c74c70ab4e5210b80" - integrity sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw== - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -colorette@^2.0.7: - version "2.0.20" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" - integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== - -commander@^13.1.0: - version "13.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-13.1.0.tgz#776167db68c78f38dcce1f9b8d7b8b9a488abf46" - integrity sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -content-disposition@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-1.0.1.tgz#a8b7bbeb2904befdfb6787e5c0c086959f605f9b" - integrity sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q== - -content-type@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" - integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -cookie-parser@^1.4.6: - version "1.4.7" - resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.7.tgz#e2125635dfd766888ffe90d60c286404fa0e7b26" - integrity sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw== - dependencies: - cookie "0.7.2" - cookie-signature "1.0.6" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - -cookie-signature@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.2.2.tgz#57c7fc3cc293acab9fec54d73e15690ebe4a1793" - integrity sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg== - -cookie@0.7.2, cookie@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== - -cors@^2.8.5: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -create-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" - integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-config "^29.7.0" - jest-util "^29.7.0" - prompts "^2.0.1" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -cross-spawn@^7.0.3, cross-spawn@^7.0.5, cross-spawn@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -dateformat@^4.6.3: - version "4.6.3" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" - integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== - -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.7, debug@^4.4.0, debug@^4.4.3: - version "4.4.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" - integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== - dependencies: - ms "^2.1.3" - -dedent@^1.0.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" - integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - -depd@^2.0.0, depd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" - integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -dunder-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" - integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== - dependencies: - call-bind-apply-helpers "^1.0.1" - es-errors "^1.3.0" - gopd "^1.2.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - -electron-to-chromium@^1.5.263: - version "1.5.267" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" - integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== - -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" - integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== - -end-of-stream@^1.1.0: - version "1.4.5" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.5.tgz#7344d711dea40e0b74abc2ed49778743ccedb08c" - integrity sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg== - dependencies: - once "^1.4.0" - -error-ex@^1.3.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.4.tgz#b3a8d8bb6f92eecc1629e3e27d3c8607a8a32414" - integrity sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ== - dependencies: - is-arrayish "^0.2.1" - -es-define-property@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" - integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== - -es-errors@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" - integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== - -es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" - integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== - dependencies: - es-errors "^1.3.0" - -escalade@^3.1.1, escalade@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" - integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== - -escape-html@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-plugin-prettier@^5.4.1: - version "5.5.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz#9eae11593faa108859c26f9a9c367d619a0769c0" - integrity sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw== - dependencies: - prettier-linter-helpers "^1.0.1" - synckit "^0.11.12" - -eslint-plugin-unused-imports@^4.1.4: - version "4.4.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.4.1.tgz#a831f0a2937d7631eba30cb87091ab7d3a5da0e1" - integrity sha512-oZGYUz1X3sRMGUB+0cZyK2VcvRX5lm/vB56PgNNcU+7ficUCKm66oZWKUubXWnOuPjQ8PvmXtCViXBMONPe7tQ== - -eslint-scope@^8.4.0: - version "8.4.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" - integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint-visitor-keys@^4.2.0, eslint-visitor-keys@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" - integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== - -eslint@^9.39.1: - version "9.39.4" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.4.tgz#855da1b2e2ad66dc5991195f35e262bcec8117b5" - integrity sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ== - dependencies: - "@eslint-community/eslint-utils" "^4.8.0" - "@eslint-community/regexpp" "^4.12.1" - "@eslint/config-array" "^0.21.2" - "@eslint/config-helpers" "^0.4.2" - "@eslint/core" "^0.17.0" - "@eslint/eslintrc" "^3.3.5" - "@eslint/js" "9.39.4" - "@eslint/plugin-kit" "^0.4.1" - "@humanfs/node" "^0.16.6" - "@humanwhocodes/module-importer" "^1.0.1" - "@humanwhocodes/retry" "^0.4.2" - "@types/estree" "^1.0.6" - ajv "^6.14.0" - chalk "^4.0.0" - cross-spawn "^7.0.6" - debug "^4.3.2" - escape-string-regexp "^4.0.0" - eslint-scope "^8.4.0" - eslint-visitor-keys "^4.2.1" - espree "^10.4.0" - esquery "^1.5.0" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^8.0.0" - find-up "^5.0.0" - glob-parent "^6.0.2" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - json-stable-stringify-without-jsonify "^1.0.1" - lodash.merge "^4.6.2" - minimatch "^3.1.5" - natural-compare "^1.4.0" - optionator "^0.9.3" - -espree@^10.0.1, espree@^10.4.0: - version "10.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" - integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== - dependencies: - acorn "^8.15.0" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^4.2.1" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.5.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.7.0.tgz#08d048f261f0ddedb5bae95f46809463d9c9496d" - integrity sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - -eventsource-parser@^3.0.0, eventsource-parser@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/eventsource-parser/-/eventsource-parser-3.0.6.tgz#292e165e34cacbc936c3c92719ef326d4aeb4e90" - integrity sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg== - -eventsource@^3.0.2: - version "3.0.7" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-3.0.7.tgz#1157622e2f5377bb6aef2114372728ba0c156989" - integrity sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA== - dependencies: - eventsource-parser "^3.0.1" - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - -expect@^29.0.0, expect@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" - integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== - dependencies: - "@jest/expect-utils" "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - -express-rate-limit@^8.2.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-8.3.1.tgz#0aaba098eadd40f6737f30a98e6b16fa1a29edfb" - integrity sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw== - dependencies: - ip-address "10.1.0" - -express@^5.1.0, express@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/express/-/express-5.2.1.tgz#8f21d15b6d327f92b4794ecf8cb08a72f956ac04" - integrity sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw== - dependencies: - accepts "^2.0.0" - body-parser "^2.2.1" - content-disposition "^1.0.0" - content-type "^1.0.5" - cookie "^0.7.1" - cookie-signature "^1.2.1" - debug "^4.4.0" - depd "^2.0.0" - encodeurl "^2.0.0" - escape-html "^1.0.3" - etag "^1.8.1" - finalhandler "^2.1.0" - fresh "^2.0.0" - http-errors "^2.0.0" - merge-descriptors "^2.0.0" - mime-types "^3.0.0" - on-finished "^2.4.1" - once "^1.4.0" - parseurl "^1.3.3" - proxy-addr "^2.0.7" - qs "^6.14.0" - range-parser "^1.2.1" - router "^2.2.0" - send "^1.1.0" - serve-static "^2.2.0" - statuses "^2.0.1" - type-is "^2.0.1" - vary "^1.1.2" - -external-editor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -fast-copy@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-4.0.2.tgz#57f14115e1edbec274f69090072a480aa29cbedd" - integrity sha512-ybA6PDXIXOXivLJK/z9e+Otk7ve13I4ckBvGO5I2RRmBU1gMHLVDJYEuJYhGwez7YNlYji2M2DvVU+a9mSFDlw== - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" - integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== - -fast-glob@^3.2.12, fast-glob@^3.3.2: - version "3.3.3" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" - integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.8" - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fast-safe-stringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" - integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== - -fast-uri@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" - integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA== - -fastq@^1.6.0: - version "1.20.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.20.1.tgz#ca750a10dc925bc8b18839fd203e3ef4b3ced675" - integrity sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" - integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== - dependencies: - bser "2.1.1" - -fflate@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" - integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== - -file-entry-cache@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" - integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== - dependencies: - flat-cache "^4.0.0" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-2.1.1.tgz#a2c517a6559852bcdb06d1f8bd7f51b68fad8099" - integrity sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA== - dependencies: - debug "^4.4.0" - encodeurl "^2.0.0" - escape-html "^1.0.3" - on-finished "^2.4.1" - parseurl "^1.3.3" - statuses "^2.0.1" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" - integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.4" - -flatted@^3.2.9: - version "3.3.3" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" - integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== - -flora-colossus@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flora-colossus/-/flora-colossus-2.0.0.tgz#af1e85db0a8256ef05f3fb531c1235236c97220a" - integrity sha512-dz4HxH6pOvbUzZpZ/yXhafjbR2I8cenK5xL0KtBFb7U2ADsR+OwXifnxZjij/pZWF775uSCMzWVd+jDik2H2IA== - dependencies: - debug "^4.3.4" - fs-extra "^10.1.0" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-2.0.0.tgz#8dd7df6a1b3a1b3a5cf186c05a5dd267622635a4" - integrity sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A== - -fs-extra@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -function-bind@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" - integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== - -fuse.js@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.1.0.tgz#306228b4befeee11e05b027087c2744158527d09" - integrity sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ== - -galactus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/galactus/-/galactus-1.0.0.tgz#c2615182afa0c6d0859b92e56ae36d052827db7e" - integrity sha512-R1fam6D4CyKQGNlvJne4dkNF+PvUUl7TAJInvTGa9fti9qAv95quQz29GXapA4d8Ec266mJJxFVh82M4GIIGDQ== - dependencies: - debug "^4.3.4" - flora-colossus "^2.0.0" - fs-extra "^10.1.0" - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.2.5, get-intrinsic@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" - integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== - dependencies: - call-bind-apply-helpers "^1.0.2" - es-define-property "^1.0.1" - es-errors "^1.3.0" - es-object-atoms "^1.1.1" - function-bind "^1.1.2" - get-proto "^1.0.1" - gopd "^1.2.0" - has-symbols "^1.1.0" - hasown "^2.0.2" - math-intrinsics "^1.1.0" - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" - integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== - dependencies: - dunder-proto "^1.0.1" - es-object-atoms "^1.0.0" - -get-stdin@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -glob@^7.1.3, glob@^7.1.4: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" - integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== - -gopd@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" - integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== - -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -handlebars@^4.7.8: - version "4.7.8" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" - integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.2" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" - integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== - -hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== - dependencies: - function-bind "^1.1.2" - -help-me@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6" - integrity sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg== - -hono@^4.11.4, hono@^4.12.4: - version "4.12.7" - resolved "https://registry.yarnpkg.com/hono/-/hono-4.12.7.tgz#ca000956e965c2b3d791e43540498e616d6c6442" - integrity sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw== - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-errors@^2.0.0, http-errors@^2.0.1, http-errors@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.1.tgz#36d2f65bc909c8790018dd36fb4d93da6caae06b" - integrity sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ== - dependencies: - depd "~2.0.0" - inherits "~2.0.4" - setprototypeof "~1.2.0" - statuses "~2.0.2" - toidentifier "~1.0.1" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.7.0, iconv-lite@~0.7.0: - version "0.7.2" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.2.tgz#d0bdeac3f12b4835b7359c2ad89c422a4d1cc72e" - integrity sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -ignore@^5.2.0, ignore@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" - integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== - -ignore@^7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9" - integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg== - -import-fresh@^3.2.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" - integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-local@^3.0.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" - integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ip-address@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-10.1.0.tgz#d8dcffb34d0e02eb241427444a6e23f5b0595aa4" - integrity sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-core-module@^2.16.1: - version "2.16.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" - integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== - dependencies: - hasown "^2.0.2" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-promise@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" - integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" - integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== - -istanbul-lib-instrument@^5.0.4: - version "5.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" - integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-instrument@^6.0.0: - version "6.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz#fa15401df6c15874bcb2105f773325d78c666765" - integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== - dependencies: - "@babel/core" "^7.23.9" - "@babel/parser" "^7.23.9" - "@istanbuljs/schema" "^0.1.3" - istanbul-lib-coverage "^3.2.0" - semver "^7.5.4" - -istanbul-lib-report@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" - integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^4.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.1.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.2.0.tgz#cb4535162b5784aa623cee21a7252cf2c807ac93" - integrity sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" - integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== - dependencies: - execa "^5.0.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - -jest-circus@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" - integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^1.0.0" - is-generator-fn "^2.0.0" - jest-each "^29.7.0" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - pretty-format "^29.7.0" - pure-rand "^6.0.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-cli@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" - integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== - dependencies: - "@jest/core" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - chalk "^4.0.0" - create-jest "^29.7.0" - exit "^0.1.2" - import-local "^3.0.2" - jest-config "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - yargs "^17.3.1" - -jest-config@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" - integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== - dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.7.0" - "@jest/types" "^29.6.3" - babel-jest "^29.7.0" - chalk "^4.0.0" - ci-info "^3.2.0" - deepmerge "^4.2.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-circus "^29.7.0" - jest-environment-node "^29.7.0" - jest-get-type "^29.6.3" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-runner "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - micromatch "^4.0.4" - parse-json "^5.2.0" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-json-comments "^3.1.1" - -jest-diff@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" - integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.6.3" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-docblock@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" - integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== - dependencies: - detect-newline "^3.0.0" - -jest-each@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" - integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - jest-get-type "^29.6.3" - jest-util "^29.7.0" - pretty-format "^29.7.0" - -jest-environment-node@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" - integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -jest-get-type@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" - integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== - -jest-haste-map@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" - integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== - dependencies: - "@jest/types" "^29.6.3" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - jest-worker "^29.7.0" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" - integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== - dependencies: - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-matcher-utils@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" - integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== - dependencies: - chalk "^4.0.0" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-message-util@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" - integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" - integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-util "^29.7.0" - -jest-pnp-resolver@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" - integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== - -jest-regex-util@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" - integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== - -jest-resolve-dependencies@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" - integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== - dependencies: - jest-regex-util "^29.6.3" - jest-snapshot "^29.7.0" - -jest-resolve@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" - integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== - dependencies: - chalk "^4.0.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-pnp-resolver "^1.2.2" - jest-util "^29.7.0" - jest-validate "^29.7.0" - resolve "^1.20.0" - resolve.exports "^2.0.0" - slash "^3.0.0" - -jest-runner@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" - integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== - dependencies: - "@jest/console" "^29.7.0" - "@jest/environment" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.13.1" - graceful-fs "^4.2.9" - jest-docblock "^29.7.0" - jest-environment-node "^29.7.0" - jest-haste-map "^29.7.0" - jest-leak-detector "^29.7.0" - jest-message-util "^29.7.0" - jest-resolve "^29.7.0" - jest-runtime "^29.7.0" - jest-util "^29.7.0" - jest-watcher "^29.7.0" - jest-worker "^29.7.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" - integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/globals" "^29.7.0" - "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-snapshot@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" - integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== - dependencies: - "@babel/core" "^7.11.6" - "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^29.7.0" - graceful-fs "^4.2.9" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - natural-compare "^1.4.0" - pretty-format "^29.7.0" - semver "^7.5.3" - -jest-util@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" - integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-validate@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" - integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== - dependencies: - "@jest/types" "^29.6.3" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^29.6.3" - leven "^3.1.0" - pretty-format "^29.7.0" - -jest-watcher@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" - integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== - dependencies: - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.7.0" - string-length "^4.0.1" - -jest-worker@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" - integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== - dependencies: - "@types/node" "*" - jest-util "^29.7.0" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@^29.4.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" - integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== - dependencies: - "@jest/core" "^29.7.0" - "@jest/types" "^29.6.3" - import-local "^3.0.2" - jest-cli "^29.7.0" - -jose@^6.1.3: - version "6.2.1" - resolved "https://registry.yarnpkg.com/jose/-/jose-6.2.1.tgz#7a6b1de83816deaee9055a558e1278a7b2b9ea1b" - integrity sha512-jUaKr1yrbfaImV7R2TN/b3IcZzsw38/chqMpo2XJ7i2F8AfM/lA4G1goC3JVEwg0H7UldTmSt3P68nt31W7/mw== - -joycon@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" - integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== - -"jq-web@https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz": - version "0.8.8" - resolved "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz#7849ef64bdfc28f70cbfc9888f886860e96da10d" - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.2" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" - integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" - integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== - dependencies: - argparse "^2.0.1" - -jsesc@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" - integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-schema-typed@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/json-schema-typed/-/json-schema-typed-8.0.2.tgz#e98ee7b1899ff4a184534d1f167c288c66bbeff4" - integrity sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -json5@^2.2.2, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -jsonfile@^6.0.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.2.0.tgz#7c265bd1b65de6977478300087c99f1c84383f62" - integrity sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -keyv@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.memoize@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -make-dir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" - integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== - dependencies: - semver "^7.5.3" - -make-error@^1.1.1, make-error@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -math-intrinsics@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" - integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== - -media-typer@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-1.1.0.tgz#6ab74b8f2d3320f2064b2a87a38e7931ff3a5561" - integrity sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw== - -merge-descriptors@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz#ea922f660635a2249ee565e0449f951e6b603808" - integrity sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g== - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4, micromatch@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" - integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - -mime-db@^1.54.0: - version "1.54.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" - integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== - -mime-types@^3.0.0, mime-types@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-3.0.2.tgz#39002d4182575d5af036ffa118100f2524b2e2ab" - integrity sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A== - dependencies: - mime-db "^1.54.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" - integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^9.0.4: - version "9.0.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" - integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.5, minimist@^1.2.6: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - -ms@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -mute-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" - integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -negotiator@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-1.0.0.tgz#b6c91bb47172d69f93cfd7c357bbb529019b5f6a" - integrity sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg== - -neo-async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -node-forge@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.3.tgz#0ad80f6333b3a0045e827ac20b7f735f93716751" - integrity sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - -node-releases@^2.0.27: - version "2.0.27" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" - integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -object-assign@^4: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-inspect@^1.13.3: - version "1.13.4" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" - integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== - -on-exit-leak-free@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz#fed195c9ebddb7d9e4c3842f93f281ac8dadd3b8" - integrity sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA== - -on-finished@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.9.3: - version "0.9.4" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" - integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.5" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -p-all@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-all/-/p-all-3.0.0.tgz#077c023c37e75e760193badab2bad3ccd5782bfb" - integrity sha512-qUZbvbBFVXm6uJ7U/WDiO0fv6waBMbjlCm4E66oZdRR+egswICarIdHyVSZZHudH8T5SF8x/JG0q0duFzPnlBw== - dependencies: - p-map "^4.0.0" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2, p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parseurl@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@^8.0.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz#aa818a6981f99321003a08987d3cec9c3474cd1f" - integrity sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA== - -picocolors@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pino-abstract-transport@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz#b21e5f33a297e8c4c915c62b3ce5dd4a87a52c23" - integrity sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg== - dependencies: - split2 "^4.0.0" - -pino-http@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/pino-http/-/pino-http-11.0.0.tgz#ebadef4694fc59aadab9be7e5939aea625b4615f" - integrity sha512-wqg5XIAGRRIWtTk8qPGxkbrfiwEWz1lgedVLvhLALudKXvg1/L2lTFgTGPJ4Z2e3qcRmxoFxDuSdMdMGNM6I1g== - dependencies: - get-caller-file "^2.0.5" - pino "^10.0.0" - pino-std-serializers "^7.0.0" - process-warning "^5.0.0" - -pino-pretty@^13.1.3: - version "13.1.3" - resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-13.1.3.tgz#2274cccda925dd355c104079a5029f6598d0381b" - integrity sha512-ttXRkkOz6WWC95KeY9+xxWL6AtImwbyMHrL1mSwqwW9u+vLp/WIElvHvCSDg0xO/Dzrggz1zv3rN5ovTRVowKg== - dependencies: - colorette "^2.0.7" - dateformat "^4.6.3" - fast-copy "^4.0.0" - fast-safe-stringify "^2.1.1" - help-me "^5.0.0" - joycon "^3.1.1" - minimist "^1.2.6" - on-exit-leak-free "^2.1.0" - pino-abstract-transport "^3.0.0" - pump "^3.0.0" - secure-json-parse "^4.0.0" - sonic-boom "^4.0.1" - strip-json-comments "^5.0.2" - -pino-std-serializers@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz#a7b0cd65225f29e92540e7853bd73b07479893fc" - integrity sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw== - -pino@^10.0.0, pino@^10.3.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/pino/-/pino-10.3.1.tgz#6552c8f8d8481844c9e452e7bf0be90bff1939ce" - integrity sha512-r34yH/GlQpKZbU1BvFFqOjhISRo1MNx1tWYsYvmj6KIRHSPMT2+yHOEb1SG6NMvRoHRF0a07kCOox/9yakl1vg== - dependencies: - "@pinojs/redact" "^0.4.0" - atomic-sleep "^1.0.0" - on-exit-leak-free "^2.1.0" - pino-abstract-transport "^3.0.0" - pino-std-serializers "^7.0.0" - process-warning "^5.0.0" - quick-format-unescaped "^4.0.3" - real-require "^0.2.0" - safe-stable-stringify "^2.3.1" - sonic-boom "^4.0.1" - thread-stream "^4.0.0" - -pirates@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.7.tgz#643b4a18c4257c8a65104b73f3049ce9a0a15e22" - integrity sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA== - -pkce-challenge@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/pkce-challenge/-/pkce-challenge-5.0.1.tgz#3b4446865b17b1745e9ace2016a31f48ddf6230d" - integrity sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prettier-linter-helpers@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz#6a31f88a4bad6c7adda253de12ba4edaea80ebcd" - integrity sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg== - dependencies: - fast-diff "^1.1.2" - -prettier@^3.0.0: - version "3.7.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.4.tgz#d2f8335d4b1cec47e1c8098645411b0c9dff9c0f" - integrity sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA== - -pretty-bytes@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" - integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== - -pretty-format@^29.0.0, pretty-format@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" - integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== - dependencies: - "@jest/schemas" "^29.6.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -process-warning@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-5.0.0.tgz#566e0bf79d1dff30a72d8bbbe9e8ecefe8d378d7" - integrity sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -proxy-addr@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -pump@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.4.tgz#1f313430527fa8b905622ebd22fe1444e757ab3c" - integrity sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -pure-rand@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" - integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== - -qs@^6.14.0, qs@^6.14.1: - version "6.14.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.1.tgz#a41d85b9d3902f31d27861790506294881871159" - integrity sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ== - dependencies: - side-channel "^1.1.0" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -quick-format-unescaped@^4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" - integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== - -range-parser@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@^3.0.0, raw-body@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-3.0.2.tgz#3e3ada5ae5568f9095d84376fd3a49b8fb000a51" - integrity sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA== - dependencies: - bytes "~3.1.2" - http-errors "~2.0.1" - iconv-lite "~0.7.0" - unpipe "~1.0.0" - -react-is@^18.0.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" - integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== - -readable-stream@^3.4.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -real-require@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.2.0.tgz#209632dea1810be2ae063a6ac084fee7e33fba78" - integrity sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve.exports@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" - integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== - -resolve@^1.20.0: - version "1.22.11" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" - integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== - dependencies: - is-core-module "^2.16.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" - integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== - -router@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/router/-/router-2.2.0.tgz#019be620b711c87641167cc79b99090f00b146ef" - integrity sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ== - dependencies: - debug "^4.4.0" - depd "^2.0.0" - is-promise "^4.0.0" - parseurl "^1.3.3" - path-to-regexp "^8.0.0" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-stable-stringify@^2.3.1: - version "2.5.0" - resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz#4ca2f8e385f2831c432a719b108a3bf7af42a1dd" - integrity sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA== - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -secure-json-parse@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-4.1.0.tgz#4f1ab41c67a13497ea1b9131bb4183a22865477c" - integrity sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA== - -semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.3: - version "7.7.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" - integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== - -send@^1.1.0, send@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/send/-/send-1.2.1.tgz#9eab743b874f3550f40a26867bf286ad60d3f3ed" - integrity sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ== - dependencies: - debug "^4.4.3" - encodeurl "^2.0.0" - escape-html "^1.0.3" - etag "^1.8.1" - fresh "^2.0.0" - http-errors "^2.0.1" - mime-types "^3.0.2" - ms "^2.1.3" - on-finished "^2.4.1" - range-parser "^1.2.1" - statuses "^2.0.2" - -serve-static@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-2.2.1.tgz#7f186a4a4e5f5b663ad7a4294ff1bf37cf0e98a9" - integrity sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw== - dependencies: - encodeurl "^2.0.0" - escape-html "^1.0.3" - parseurl "^1.3.3" - send "^1.2.0" - -setprototypeof@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel-list@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" - integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== - dependencies: - es-errors "^1.3.0" - object-inspect "^1.13.3" - -side-channel-map@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" - integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== - dependencies: - call-bound "^1.0.2" - es-errors "^1.3.0" - get-intrinsic "^1.2.5" - object-inspect "^1.13.3" - -side-channel-weakmap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" - integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== - dependencies: - call-bound "^1.0.2" - es-errors "^1.3.0" - get-intrinsic "^1.2.5" - object-inspect "^1.13.3" - side-channel-map "^1.0.1" - -side-channel@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" - integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== - dependencies: - es-errors "^1.3.0" - object-inspect "^1.13.3" - side-channel-list "^1.0.0" - side-channel-map "^1.0.1" - side-channel-weakmap "^1.0.2" - -signal-exit@^3.0.3, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -signal-exit@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -sonic-boom@^4.0.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-4.2.1.tgz#28598250df4899c0ac572d7e2f0460690ba6a030" - integrity sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q== - dependencies: - atomic-sleep "^1.0.0" - -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -split2@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" - integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -stack-utils@^2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" - integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== - dependencies: - escape-string-regexp "^2.0.0" - -statuses@^2.0.1, statuses@^2.0.2, statuses@~2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" - integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-to-stream@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/string-to-stream/-/string-to-stream-3.0.1.tgz#480e6fb4d5476d31cb2221f75307a5dcb6638a42" - integrity sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg== - dependencies: - readable-stream "^3.4.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -strip-json-comments@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-5.0.3.tgz#b7304249dd402ee67fd518ada993ab3593458bcf" - integrity sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw== - -superstruct@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.4.tgz#0adb99a7578bd2f1c526220da6571b2d485d91ca" - integrity sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ== - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -synckit@^0.11.12: - version "0.11.12" - resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.12.tgz#abe74124264fbc00a48011b0d98bdc1cffb64a7b" - integrity sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ== - dependencies: - "@pkgr/core" "^0.2.9" - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -thread-stream@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-4.0.0.tgz#732f007c24da7084f729d6e3a7e3f5934a7380b7" - integrity sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA== - dependencies: - real-require "^0.2.0" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -ts-api-utils@^2.0.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.4.0.tgz#2690579f96d2790253bdcf1ca35d569ad78f9ad8" - integrity sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA== - -ts-jest@^29.1.0: - version "29.4.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" - integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== - dependencies: - bs-logger "^0.2.6" - fast-json-stable-stringify "^2.1.0" - handlebars "^4.7.8" - json5 "^2.2.3" - lodash.memoize "^4.1.2" - make-error "^1.3.6" - semver "^7.7.3" - type-fest "^4.41.0" - yargs-parser "^21.1.1" - -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - -ts-node@^10.5.0: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -"tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz": - version "1.1.11" - resolved "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz#010247051be13b55abdc98f787c017285149f4f2" - dependencies: - debug "^4.3.7" - fast-glob "^3.3.2" - get-stdin "^8.0.0" - p-all "^3.0.0" - picocolors "^1.1.1" - signal-exit "^3.0.7" - string-to-stream "^3.0.1" - superstruct "^1.0.4" - tslib "^2.8.1" - yargs "^17.7.2" - -tsconfig-paths@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" - integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== - dependencies: - json5 "^2.2.2" - minimist "^1.2.6" - strip-bom "^3.0.0" - -tslib@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^4.41.0: - version "4.41.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" - integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== - -type-is@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-2.0.1.tgz#64f6cf03f92fce4015c2b224793f6bdd4b068c97" - integrity sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw== - dependencies: - content-type "^1.0.5" - media-typer "^1.1.0" - mime-types "^3.0.0" - -typescript@5.8.3: - version "5.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" - integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== - -uglify-js@^3.1.4: - version "3.19.3" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" - integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== - -undici-types@~6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" - integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== - -undici-types@~7.16.0: - version "7.16.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" - integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== - -universalify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" - integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== - -unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== - -update-browserslist-db@^1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" - integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== - dependencies: - escalade "^3.2.0" - picocolors "^1.1.1" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -v8-to-istanbul@^9.0.1: - version "9.3.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" - integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^2.0.0" - -vary@^1, vary@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - -walker@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" - integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== - -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^17.3.1, yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -yoctocolors-cjs@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz#7e4964ea8ec422b7a40ac917d3a344cfd2304baa" - integrity sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw== - -zod-to-json-schema@^3.24.5, zod-to-json-schema@^3.24.6, zod-to-json-schema@^3.25.1: - version "3.25.1" - resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz#7f24962101a439ddade2bf1aeab3c3bfec7d84ba" - integrity sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA== - -zod-validation-error@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-4.0.2.tgz#bc605eba49ce0fcd598c127fee1c236be3f22918" - integrity sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ== - -"zod@^3.25 || ^4.0": - version "4.3.5" - resolved "https://registry.yarnpkg.com/zod/-/zod-4.3.5.tgz#aeb269a6f9fc259b1212c348c7c5432aaa474d2a" - integrity sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g== - -zod@^3.25.20, zod@^3.25.67: - version "3.25.76" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34" - integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ== diff --git a/scripts/build b/scripts/build index 4716248d..7c739e87 100755 --- a/scripts/build +++ b/scripts/build @@ -49,9 +49,3 @@ if [ -e ./scripts/build-deno ] then ./scripts/build-deno fi -# build all sub-packages -for dir in packages/*; do - if [ -d "$dir" ]; then - (cd "$dir" && yarn install --pure-lockfile && yarn build) - fi -done diff --git a/scripts/build-all b/scripts/build-all deleted file mode 100755 index 4e5ac01f..00000000 --- a/scripts/build-all +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# build-all is deprecated, use build instead - -bash ./scripts/build diff --git a/scripts/publish-packages.ts b/scripts/publish-packages.ts deleted file mode 100644 index 50e93fef..00000000 --- a/scripts/publish-packages.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Called from the `create-releases.yml` workflow with the output - * of the release please action as the first argument. - * - * Example JSON input: - * - * ```json - { - "releases_created": "true", - "release_created": "true", - "id": "137967744", - "name": "sdk: v0.14.5", - "tag_name": "sdk-v0.14.5", - "sha": "7cc2ba5c694e76a117f731d4cf0b06f8b8361f2e", - "body": "## 0.14.5 (2024-01-22)\n\n...", - "html_url": "https://github.com/$org/$repo/releases/tag/sdk-v0.14.5", - "draft": "false", - "upload_url": "https://uploads.github.com/repos/$org/$repo/releases/137967744/assets{?name,label}", - "path": ".", - "version": "0.14.5", - "major": "0", - "minor": "14", - "patch": "5", - "packages/additional-sdk--release_created": "true", - "packages/additional-sdk--id": "137967756", - "packages/additional-sdk--name": "additional-sdk: v0.5.2", - "packages/additional-sdk--tag_name": "additional-sdk-v0.5.2", - "packages/additional-sdk--sha": "7cc2ba5c694e76a117f731d4cf0b06f8b8361f2e", - "packages/additional-sdk--body": "## 0.5.2 (2024-01-22)\n\n...", - "packages/additional-sdk--html_url": "https://github.com/$org/$repo/releases/tag/additional-sdk-v0.5.2", - "packages/additional-sdk--draft": "false", - "packages/additional-sdk--upload_url": "https://uploads.github.com/repos/$org/$repo/releases/137967756/assets{?name,label}", - "packages/additional-sdk--path": "packages/additional-sdk", - "packages/additional-sdk--version": "0.5.2", - "packages/additional-sdk--major": "0", - "packages/additional-sdk--minor": "5", - "packages/additional-sdk--patch": "2", - "paths_released": "[\".\",\"packages/additional-sdk\"]" - } - ``` - */ - -import { execSync } from 'child_process'; -import path from 'path'; - -function main() { - const data = process.argv[2] ?? process.env['DATA']; - if (!data) { - throw new Error(`Usage: publish-packages.ts '{"json": "obj"}'`); - } - - const rootDir = path.join(__dirname, '..'); - console.log('root dir', rootDir); - console.log(`publish-packages called with ${data}`); - - const outputs = JSON.parse(data); - - const rawPaths = outputs.paths_released; - - if (!rawPaths) { - console.error(JSON.stringify(outputs, null, 2)); - throw new Error('Expected outputs to contain a truthy `paths_released` property'); - } - if (typeof rawPaths !== 'string') { - console.error(JSON.stringify(outputs, null, 2)); - throw new Error('Expected outputs `paths_released` property to be a JSON string'); - } - - const paths = JSON.parse(rawPaths); - if (!Array.isArray(paths)) { - console.error(JSON.stringify(outputs, null, 2)); - throw new Error('Expected outputs `paths_released` property to be an array'); - } - if (!paths.length) { - console.error(JSON.stringify(outputs, null, 2)); - throw new Error('Expected outputs `paths_released` property to contain at least one entry'); - } - - const publishScriptPath = path.join(rootDir, 'bin', 'publish-npm'); - console.log('Using publish script at', publishScriptPath); - - console.log('Ensuring root package is built'); - console.log(`$ yarn build`); - execSync(`yarn build`, { cwd: rootDir, encoding: 'utf8', stdio: 'inherit' }); - - for (const relPackagePath of paths) { - console.log('\n'); - - const packagePath = path.join(rootDir, relPackagePath); - console.log(`Publishing in directory: ${packagePath}`); - - console.log(`$ yarn install`); - execSync(`yarn install`, { cwd: packagePath, encoding: 'utf8', stdio: 'inherit' }); - - console.log(`$ bash ${publishScriptPath}`); - execSync(`bash ${publishScriptPath}`, { cwd: packagePath, encoding: 'utf8', stdio: 'inherit' }); - } - - console.log('Finished publishing packages'); -} - -main(); diff --git a/scripts/utils/make-dist-package-json.cjs b/scripts/utils/make-dist-package-json.cjs index 4d6634ea..7c24f56e 100644 --- a/scripts/utils/make-dist-package-json.cjs +++ b/scripts/utils/make-dist-package-json.cjs @@ -12,14 +12,6 @@ processExportMap(pkgJson.exports); for (const key of ['types', 'main', 'module']) { if (typeof pkgJson[key] === 'string') pkgJson[key] = pkgJson[key].replace(/^(\.\/)?dist\//, './'); } -// Fix bin paths if present -if (pkgJson.bin) { - for (const key in pkgJson.bin) { - if (typeof pkgJson.bin[key] === 'string') { - pkgJson.bin[key] = pkgJson.bin[key].replace(/^(\.\/)?dist\//, './'); - } - } -} delete pkgJson.devDependencies; delete pkgJson.scripts.prepack; diff --git a/src/client.ts b/src/client.ts index 7df8cdc3..4461a79d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -17,13 +17,6 @@ import * as Errors from './core/error'; import * as Uploads from './core/uploads'; import * as API from './resources/index'; import { APIPromise } from './core/api-promise'; -import { - AI, - AIExtractProductParams, - AIExtractProductResponse, - AIExtractProductsParams, - AIExtractProductsResponse, -} from './resources/ai'; import { Batch, BatchCancelResponse, @@ -44,11 +37,10 @@ import { Brand, BrandRetrieveParams, BrandRetrieveResponse, - BrandRetrieveSimplifiedParams, - BrandRetrieveSimplifiedResponse, BrandSearchParams, BrandSearchResponse, } from './resources/brand'; +import { Feedback, FeedbackSubmitParams, FeedbackSubmitResponse } from './resources/feedback'; import { Industry, IndustryRetrieveNaicsParams, @@ -56,6 +48,7 @@ import { IndustryRetrieveSicParams, IndustryRetrieveSicResponse, } from './resources/industry'; +import { LogListParams, LogListResponse, LogRetrieveResponse, Logs } from './resources/logs'; import { MonitorCreateParams, MonitorCreateResponse, @@ -75,6 +68,9 @@ import { MonitorListRunsResponse, MonitorRetrieveChangeResponse, MonitorRetrieveResponse, + MonitorRetrieveRunParams, + MonitorRetrieveRunResponse, + MonitorRotateWebhookSecretResponse, MonitorRunResponse, MonitorUpdateParams, MonitorUpdateResponse, @@ -83,33 +79,35 @@ import { } from './resources/monitors'; import { News, NewsSearchParams, NewsSearchResponse } from './resources/news'; import { Parse, ParseHandleParams, ParseHandleResponse } from './resources/parse'; -import { People, PersonEnrichParams, PersonEnrichResponse } from './resources/people'; +import { + People, + PersonEnrichParams, + PersonEnrichResponse, + PersonSearchParams, + PersonSearchResponse, +} from './resources/people'; import { Utility, UtilityPrefetchParams, UtilityPrefetchResponse } from './resources/utility'; import { Web, + WebAnswersParams, + WebAnswersResponse, WebExtractCompetitorsParams, WebExtractCompetitorsResponse, - WebExtractFontsParams, - WebExtractFontsResponse, - WebExtractParams, - WebExtractResponse, WebExtractStyleguideParams, WebExtractStyleguideResponse, + WebMapURLsParams, + WebMapURLsResponse, + WebScrapeParams, + WebScrapeResponse, WebScreenshotParams, WebScreenshotResponse, WebSearchParams, WebSearchResponse, WebWebCrawlMdParams, WebWebCrawlMdResponse, - WebWebScrapeHTMLParams, - WebWebScrapeHTMLResponse, - WebWebScrapeImagesParams, - WebWebScrapeImagesResponse, - WebWebScrapeMdParams, - WebWebScrapeMdResponse, - WebWebScrapeSitemapParams, - WebWebScrapeSitemapResponse, } from './resources/web'; +import { Browser } from './resources/browser/browser'; +import { RetryConfig, Webhooks } from './resources/webhooks/webhooks'; import { type Fetch } from './internal/builtin-types'; import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers'; import { FinalRequestOptions, RequestOptions } from './internal/request-options'; @@ -829,35 +827,47 @@ export class ContextDev { parse: API.Parse = new API.Parse(this); web: API.Web = new API.Web(this); - ai: API.AI = new API.AI(this); brand: API.Brand = new API.Brand(this); industry: API.Industry = new API.Industry(this); utility: API.Utility = new API.Utility(this); /** - * Monitor pages, sitemaps, and extracted website data for exact or semantic changes. Webhook payloads are documented by the MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload schemas. + * Watch websites for exact or meaningful changes. */ monitors: API.Monitors = new API.Monitors(this); /** * Scrape many pages or crawl a site asynchronously. */ batch: API.Batch = new API.Batch(this); + webhooks: API.Webhooks = new API.Webhooks(this); people: API.People = new API.People(this); /** - * Search live first-party RSS and free historical news data by company identity. + * Search live and historical news about a company. */ news: API.News = new API.News(this); + /** + * Read your organization's API request logs. + */ + logs: API.Logs = new API.Logs(this); + browser: API.Browser = new API.Browser(this); + /** + * Report API issues and documentation mismatches. + */ + feedback: API.Feedback = new API.Feedback(this); } ContextDev.Parse = Parse; ContextDev.Web = Web; -ContextDev.AI = AI; ContextDev.Brand = Brand; ContextDev.Industry = Industry; ContextDev.Utility = Utility; ContextDev.Monitors = Monitors; ContextDev.Batch = Batch; +ContextDev.Webhooks = Webhooks; ContextDev.People = People; ContextDev.News = News; +ContextDev.Logs = Logs; +ContextDev.Browser = Browser; +ContextDev.Feedback = Feedback; export declare namespace ContextDev { export type RequestOptions = Opts.RequestOptions; @@ -870,45 +880,29 @@ export declare namespace ContextDev { export { Web as Web, - type WebExtractResponse as WebExtractResponse, + type WebAnswersResponse as WebAnswersResponse, type WebExtractCompetitorsResponse as WebExtractCompetitorsResponse, - type WebExtractFontsResponse as WebExtractFontsResponse, type WebExtractStyleguideResponse as WebExtractStyleguideResponse, + type WebMapURLsResponse as WebMapURLsResponse, + type WebScrapeResponse as WebScrapeResponse, type WebScreenshotResponse as WebScreenshotResponse, type WebSearchResponse as WebSearchResponse, type WebWebCrawlMdResponse as WebWebCrawlMdResponse, - type WebWebScrapeHTMLResponse as WebWebScrapeHTMLResponse, - type WebWebScrapeImagesResponse as WebWebScrapeImagesResponse, - type WebWebScrapeMdResponse as WebWebScrapeMdResponse, - type WebWebScrapeSitemapResponse as WebWebScrapeSitemapResponse, - type WebExtractParams as WebExtractParams, + type WebAnswersParams as WebAnswersParams, type WebExtractCompetitorsParams as WebExtractCompetitorsParams, - type WebExtractFontsParams as WebExtractFontsParams, type WebExtractStyleguideParams as WebExtractStyleguideParams, + type WebMapURLsParams as WebMapURLsParams, + type WebScrapeParams as WebScrapeParams, type WebScreenshotParams as WebScreenshotParams, type WebSearchParams as WebSearchParams, type WebWebCrawlMdParams as WebWebCrawlMdParams, - type WebWebScrapeHTMLParams as WebWebScrapeHTMLParams, - type WebWebScrapeImagesParams as WebWebScrapeImagesParams, - type WebWebScrapeMdParams as WebWebScrapeMdParams, - type WebWebScrapeSitemapParams as WebWebScrapeSitemapParams, - }; - - export { - AI as AI, - type AIExtractProductResponse as AIExtractProductResponse, - type AIExtractProductsResponse as AIExtractProductsResponse, - type AIExtractProductParams as AIExtractProductParams, - type AIExtractProductsParams as AIExtractProductsParams, }; export { Brand as Brand, type BrandRetrieveResponse as BrandRetrieveResponse, - type BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse, type BrandSearchResponse as BrandSearchResponse, type BrandRetrieveParams as BrandRetrieveParams, - type BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams, type BrandSearchParams as BrandSearchParams, }; @@ -941,6 +935,8 @@ export declare namespace ContextDev { type MonitorListChangesResponse as MonitorListChangesResponse, type MonitorListRunsResponse as MonitorListRunsResponse, type MonitorRetrieveChangeResponse as MonitorRetrieveChangeResponse, + type MonitorRetrieveRunResponse as MonitorRetrieveRunResponse, + type MonitorRotateWebhookSecretResponse as MonitorRotateWebhookSecretResponse, type MonitorRunResponse as MonitorRunResponse, type MonitorCreateParams as MonitorCreateParams, type MonitorUpdateParams as MonitorUpdateParams, @@ -950,6 +946,7 @@ export declare namespace ContextDev { type MonitorListAccountRunsParams as MonitorListAccountRunsParams, type MonitorListChangesParams as MonitorListChangesParams, type MonitorListRunsParams as MonitorListRunsParams, + type MonitorRetrieveRunParams as MonitorRetrieveRunParams, }; export { @@ -969,10 +966,14 @@ export declare namespace ContextDev { type BatchSubmitParams as BatchSubmitParams, }; + export { Webhooks as Webhooks, type RetryConfig as RetryConfig }; + export { People as People, type PersonEnrichResponse as PersonEnrichResponse, + type PersonSearchResponse as PersonSearchResponse, type PersonEnrichParams as PersonEnrichParams, + type PersonSearchParams as PersonSearchParams, }; export { @@ -980,4 +981,19 @@ export declare namespace ContextDev { type NewsSearchResponse as NewsSearchResponse, type NewsSearchParams as NewsSearchParams, }; + + export { + Logs as Logs, + type LogRetrieveResponse as LogRetrieveResponse, + type LogListResponse as LogListResponse, + type LogListParams as LogListParams, + }; + + export { Browser as Browser }; + + export { + Feedback as Feedback, + type FeedbackSubmitResponse as FeedbackSubmitResponse, + type FeedbackSubmitParams as FeedbackSubmitParams, + }; } diff --git a/src/resources/ai.ts b/src/resources/ai.ts deleted file mode 100644 index 24688abb..00000000 --- a/src/resources/ai.ts +++ /dev/null @@ -1,461 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../core/resource'; -import { APIPromise } from '../core/api-promise'; -import { RequestOptions } from '../internal/request-options'; - -export class AI extends APIResource { - /** - * Given a single URL, determines if it is a product page and extracts the product - * information. - * - * @example - * ```ts - * const response = await client.ai.extractProduct({ - * url: 'https://example.com', - * }); - * ``` - */ - extractProduct( - body: AIExtractProductParams, - options?: RequestOptions, - ): APIPromise { - return this._client.post('/brand/ai/product', { body, ...options }); - } - - /** - * Extract product information from a brand's website. We will analyze the website - * and return a list of products with details such as name, description, image, - * pricing, features, and more. - * - * @example - * ```ts - * const response = await client.ai.extractProducts({ - * domain: 'domain', - * }); - * ``` - */ - extractProducts( - body: AIExtractProductsParams, - options?: RequestOptions, - ): APIPromise { - return this._client.post('/brand/ai/products', { body, ...options }); - } -} - -export interface AIExtractProductResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: AIExtractProductResponse.CacheMetadata; - - /** - * Whether the given URL is a product detail page - */ - is_product_page?: boolean; - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: AIExtractProductResponse.KeyMetadata; - - /** - * The detected ecommerce platform, or null if not a product page - */ - platform?: 'amazon' | 'tiktok_shop' | 'etsy' | 'generic' | null; - - /** - * The extracted product data, or null if not a product page - */ - product?: AIExtractProductResponse.Product | null; -} - -export namespace AIExtractProductResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; - - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; - - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } - - /** - * The extracted product data, or null if not a product page - */ - export interface Product { - /** - * Description of the product - */ - description: string; - - /** - * List of product features - */ - features: Array; - - /** - * URLs to product images on the page (up to 7) - */ - images: Array; - - /** - * Name of the product - */ - name: string; - - /** - * Stock Keeping Unit (product identifier). Null if no identifier is found. - */ - sku: string | null; - - /** - * Tags associated with the product - */ - tags: Array; - - /** - * Target audience for the product (array of strings) - */ - target_audience: Array; - - /** - * Normalized stock or ordering availability - */ - availability?: - | 'in_stock' - | 'out_of_stock' - | 'limited_availability' - | 'preorder' - | 'backorder' - | 'made_to_order' - | 'discontinued' - | null; - - /** - * Billing frequency for the product - */ - billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based' | null; - - /** - * Category of the product - */ - category?: string | null; - - /** - * Currency code for the price (e.g., USD, EUR) - */ - currency?: string | null; - - /** - * Dimension statements shown for the product, preserving labels, values, and units - */ - dimensions?: Array; - - /** - * URL to the product image - */ - image_url?: string | null; - - /** - * Price of the product - */ - price?: number | null; - - /** - * Pricing model for the product - */ - pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom' | null; - - /** - * Original or regular price before a displayed discount - */ - regular_price?: number | null; - - /** - * URL to the product page - */ - url?: string | null; - } -} - -export interface AIExtractProductsResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: AIExtractProductsResponse.CacheMetadata; - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: AIExtractProductsResponse.KeyMetadata; - - /** - * Array of products extracted from the website - */ - products?: Array; -} - -export namespace AIExtractProductsResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; - - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; - - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } - - export interface Product { - /** - * Description of the product - */ - description: string; - - /** - * List of product features - */ - features: Array; - - /** - * URLs to product images on the page (up to 7) - */ - images: Array; - - /** - * Name of the product - */ - name: string; - - /** - * Stock Keeping Unit (product identifier). Null if no identifier is found. - */ - sku: string | null; - - /** - * Tags associated with the product - */ - tags: Array; - - /** - * Target audience for the product (array of strings) - */ - target_audience: Array; - - /** - * Normalized stock or ordering availability - */ - availability?: - | 'in_stock' - | 'out_of_stock' - | 'limited_availability' - | 'preorder' - | 'backorder' - | 'made_to_order' - | 'discontinued' - | null; - - /** - * Billing frequency for the product - */ - billing_frequency?: 'monthly' | 'yearly' | 'one_time' | 'usage_based' | null; - - /** - * Category of the product - */ - category?: string | null; - - /** - * Currency code for the price (e.g., USD, EUR) - */ - currency?: string | null; - - /** - * Dimension statements shown for the product, preserving labels, values, and units - */ - dimensions?: Array; - - /** - * URL to the product image - */ - image_url?: string | null; - - /** - * Price of the product - */ - price?: number | null; - - /** - * Pricing model for the product - */ - pricing_model?: 'per_seat' | 'flat' | 'tiered' | 'freemium' | 'custom' | null; - - /** - * Original or regular price before a displayed discount - */ - regular_price?: number | null; - - /** - * URL to the product page - */ - url?: string | null; - } -} - -export interface AIExtractProductParams { - /** - * The product page URL to extract product data from. - */ - url: string; - - /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 7 days (604800000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. - */ - maxAgeMs?: number; - - /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. - */ - tags?: Array; - - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; -} - -export type AIExtractProductsParams = AIExtractProductsParams.ByDomain | AIExtractProductsParams.ByDirectURL; - -export declare namespace AIExtractProductsParams { - export interface ByDomain { - /** - * The domain name to analyze. - */ - domain: string; - - /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 7 days (604800000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. - */ - maxAgeMs?: number; - - /** - * Maximum number of products to extract. - */ - maxProducts?: number; - - /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. - */ - tags?: Array; - - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; - } - - export interface ByDirectURL { - /** - * A specific URL to use directly as the starting point for extraction without - * domain resolution. - */ - directUrl: string; - - /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 7 days (604800000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. - */ - maxAgeMs?: number; - - /** - * Maximum number of products to extract. - */ - maxProducts?: number; - - /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. - */ - tags?: Array; - - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; - } -} - -export declare namespace AI { - export { - type AIExtractProductResponse as AIExtractProductResponse, - type AIExtractProductsResponse as AIExtractProductsResponse, - type AIExtractProductParams as AIExtractProductParams, - type AIExtractProductsParams as AIExtractProductsParams, - }; -} diff --git a/src/resources/batch.ts b/src/resources/batch.ts index a7dd731c..f4170f1e 100644 --- a/src/resources/batch.ts +++ b/src/resources/batch.ts @@ -2,6 +2,7 @@ import { APIResource } from '../core/resource'; import * as BatchAPI from './batch'; +import * as WebhooksAPI from './webhooks/webhooks'; import { APIPromise } from '../core/api-promise'; import { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; @@ -12,7 +13,8 @@ import { path } from '../internal/utils/path'; */ export class Batch extends APIResource { /** - * Check progress, and get download links once the batch finishes. + * Get batch progress and result download links. Result files are deleted 180 days + * after the batch finishes. * * @example * ```ts @@ -24,8 +26,7 @@ export class Batch extends APIResource { } /** - * List your batches from newest to oldest. Filter by status or continue with a - * cursor. + * List your batches, newest first, with optional filters. * * @example * ```ts @@ -40,8 +41,8 @@ export class Batch extends APIResource { } /** - * Permanently delete a finished batch and its stored results. Active batches must - * settle first. + * Permanently delete a finished batch and its results. Its webhook deliveries can + * no longer be retried. * * @example * ```ts @@ -53,8 +54,8 @@ export class Batch extends APIResource { } /** - * Stop a batch from starting new pages. In-progress pages finish, and unused - * credits are refunded. + * Stop a batch from starting new pages. Pages already in progress finish before + * the batch becomes cancelled. * * @example * ```ts @@ -66,8 +67,9 @@ export class Batch extends APIResource { } /** - * Page through a finished batch's results as JSON instead of downloading the - * NDJSON files. + * Page through a finished batch’s results as JSON. Each record contains result + * with the same outputs and per-format errors as POST /web/scrape. Results remain + * available for 180 days. * * @example * ```ts @@ -85,12 +87,23 @@ export class Batch extends APIResource { } /** - * Scrape 25K URLs or crawl large websites asynchronously. + * Scrape up to 100,000 URLs, or crawl a site, asynchronously using the same + * formats and scrape parameters as POST /web/scrape. Choose Markdown, HTML, + * screenshots, images, bytes, parsed fields, products, highlights, and JSON. + * Submission persists the input and returns immediately with status pending. + * Organizations with fewer than 10 available credits and no overage are rejected + * with 402 up front. Each organization can submit up to 2,500 batches per minute, + * independently of its polling budget. Batches wait pending when execution + * capacity is full. Validation, sitemap discovery, the full credit quote, and + * shard scheduling happen afterward. Poll the batch ID or receive a webhook when + * it finishes. Deferred rejections appear as status failed with a failure code and + * message. * * @example * ```ts * const response = await client.batch.submit({ * input: { + * mode: 'scrape', * data: { * urls: [ * { @@ -103,7 +116,8 @@ export class Batch extends APIResource { * itemId: 'sku-2', * }, * ], - * options: { useMainContentOnly: true }, + * formats: { markdown: true, html: true }, + * sharedParams: { mainContentOnly: true }, * }, * }, * }); @@ -154,15 +168,102 @@ export interface Failure { } /** - * The crawl controls as submitted, so the limits requested can be compared against - * what the crawl reached. + * Crawl settings as submitted. */ export interface CrawlControls { + /** + * Regex pattern URLs must not match to be crawled. Null when the crawl set none. + */ + exclude_url_pattern: string | null; + /** * Whether links to subdomains were followed. Always false for a sitemap crawl. */ follow_subdomains: boolean; + /** + * Languages whose pages were followed; null when all languages were. + */ + languages: + | 'same_as_start_url' + | Array< + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' + > + | null; + /** * Link depth limit. Always 0 for a sitemap crawl, which never follows links off * its URLs; null when a `start_url` crawl set no limit. @@ -181,7 +282,7 @@ export interface CrawlControls { source: CrawlControls.StartURL | CrawlControls.Sitemap; /** - * RE2 pattern URLs had to match to be crawled. Null when the crawl set none. + * Regex pattern URLs had to match to be crawled. Null when the crawl set none. */ url_pattern: string | null; } @@ -213,7 +314,7 @@ export namespace CrawlControls { } /** - * What submission took in, and what it charged for. + * What the submission accepted. */ export interface Intake { /** @@ -224,23 +325,17 @@ export interface Intake { duplicates: number; /** - * URLs from your list rejected as unusable; the same ones are itemised in - * `invalid_urls` at submission. Null for a crawl — a crawl that resolves no usable - * page is rejected outright with a 400 rather than accepted with an empty list. + * Rejected input URLs; `null` for a crawl. */ invalid: number | null; /** - * Pages credits were reserved for. Everything else — progress, the refund, the - * completion percentage — is measured against this. + * Pages accepted; progress counts toward this total. */ reserved: number; /** - * Whether `reserved` is an upper bound the batch may finish under. True only for a - * crawl that follows links, whose reachable page count is unknowable until it - * runs. False for a scrape and for a sitemap crawl, where `reserved` is an exact - * page count. + * True when `reserved` is a crawl ceiling; false when it is an exact URL count. */ reserved_is_ceiling: boolean; @@ -253,18 +348,17 @@ export interface Intake { export interface BatchRetrieveResponse { /** - * Batch ID used to retrieve or cancel the job. + * Batch ID. */ id: string; /** - * The crawl controls as submitted, so the limits requested can be compared against - * what the crawl reached. + * Crawl settings as submitted. */ crawl: CrawlControls | null; /** - * What this batch has done to your credit balance. + * Batch credit usage and settlement. */ credits: BatchRetrieveResponse.Credits; @@ -275,23 +369,22 @@ export interface BatchRetrieveResponse { failure: Failure | null; /** - * What each page is returned as. Matches `input.data.format` on the submit - * request. + * Outputs requested for each page. Matches input.data.formats on submission. */ - format: 'markdown' | 'html'; + formats: BatchRetrieveResponse.Formats; /** - * What submission took in, and what it charged for. + * What the submission accepted. */ input: Intake; /** - * Rejected URLs, up to 100. These are not charged. + * Rejected URLs (first 100). */ invalid_urls: Array; /** - * How pages were selected. Matches `input.mode` on the submit request. + * `scrape` (URL list) or `crawl`. */ mode: 'scrape' | 'crawl'; @@ -307,15 +400,23 @@ export interface BatchRetrieveResponse { progress: BatchRetrieveResponse.Progress; /** - * Download links, available once the batch reaches a final status and null before - * then. GET /batch/{batch_id}/results serves the same records as paginated JSON. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Result download links; null until the batch finishes. Files are deleted 180 days + * after the batch finishes. */ results: BatchRetrieveResponse.Results | null; /** - * Current state. `completed`, `cancelled`, and `failed` are final. + * Current state. `pending` means waiting for execution capacity or background + * validation. Capacity-limited batches remain pending until a slot opens. + * `completed`, `cancelled`, and `failed` are final. */ - status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; + status: 'pending' | 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; /** * Tags stored on the batch at submission. @@ -325,41 +426,99 @@ export interface BatchRetrieveResponse { timing: BatchRetrieveResponse.Timing; /** - * API key usage for this request. + * Credits this request used and your remaining balance. */ key_metadata?: BatchRetrieveResponse.KeyMetadata; + + /** + * Access policy IDs applied to every page. + */ + policies?: Array; + + /** + * Batch completion delivery ID, when available. + */ + webhook_delivery_id?: string; } export namespace BatchRetrieveResponse { /** - * What this batch has done to your credit balance. + * Batch credit usage and settlement. */ export interface Credits { /** - * `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. - * Equal to `reserved` until the batch settles. + * `reserved` minus `refunded` plus `ocr_charged`. */ net: number; /** - * Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered - * page, on top of `reserved`. Stays 0 until the batch settles. + * OCR usage charged when the batch settles. */ ocr_charged: number; /** - * Credits returned for pages that did not succeed. Stays 0 until the batch reaches - * a final status, then settles in one movement. + * Credits returned for unsuccessful pages when the batch settles. */ refunded: number; /** - * Credits debited from your balance the moment the batch was accepted. This is a - * charge, not a forecast — the whole amount leaves the balance up front. + * Credits held by background preparation before scraping starts. Zero while + * pending. */ reserved: number; } + /** + * Outputs requested for each page. Matches input.data.formats on submission. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + export interface InvalidURL { /** * Why it was rejected. @@ -382,9 +541,8 @@ export namespace BatchRetrieveResponse { failed: number; /** - * Reserved pages not yet attempted. A cancelled batch keeps reporting the URLs it - * never reached; a crawl whose `input.reserved_is_ceiling` is true reports 0 once - * final, because its unspent budget was never real pages. + * Accepted pages not yet attempted. Unused crawl capacity is excluded after + * completion. */ pending: number; @@ -395,12 +553,12 @@ export namespace BatchRetrieveResponse { } /** - * Download links, available once the batch reaches a final status and null before - * then. GET /batch/{batch_id}/results serves the same records as paginated JSON. + * Result download links; null until the batch finishes. Files are deleted 180 days + * after the batch finishes. */ export interface Results { /** - * When the download URLs expire. + * When these links expire (24 hours after this response). */ expires_at: string; @@ -447,22 +605,28 @@ export namespace BatchRetrieveResponse { } /** - * API key usage for this request. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } export interface BatchListResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Batches on this page. */ @@ -474,8 +638,7 @@ export interface BatchListResponse { has_more?: boolean; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: BatchListResponse.KeyMetadata; @@ -491,18 +654,17 @@ export namespace BatchListResponse { */ export interface Data { /** - * Batch ID used to retrieve or cancel the job. + * Batch ID. */ id: string; /** - * The crawl controls as submitted, so the limits requested can be compared against - * what the crawl reached. + * Crawl settings as submitted. */ crawl: BatchAPI.CrawlControls | null; /** - * What this batch has done to your credit balance. + * Batch credit usage and settlement. */ credits: Data.Credits; @@ -513,18 +675,17 @@ export namespace BatchListResponse { failure: BatchAPI.Failure | null; /** - * What each page is returned as. Matches `input.data.format` on the submit - * request. + * Outputs requested for each page. Matches input.data.formats on submission. */ - format: 'markdown' | 'html'; + formats: Data.Formats; /** - * What submission took in, and what it charged for. + * What the submission accepted. */ input: BatchAPI.Intake; /** - * How pages were selected. Matches `input.mode` on the submit request. + * `scrape` (URL list) or `crawl`. */ mode: 'scrape' | 'crawl'; @@ -540,15 +701,17 @@ export namespace BatchListResponse { progress: Data.Progress; /** - * Download links, available once the batch reaches a final status and null before - * then. GET /batch/{batch_id}/results serves the same records as paginated JSON. + * Result download links; null until the batch finishes. Files are deleted 180 days + * after the batch finishes. */ results: Data.Results | null; /** - * Current state. `completed`, `cancelled`, and `failed` are final. + * Current state. `pending` means waiting for execution capacity or background + * validation. Capacity-limited batches remain pending until a slot opens. + * `completed`, `cancelled`, and `failed` are final. */ - status: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; + status: 'pending' | 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; /** * Tags stored on the batch at submission. @@ -556,38 +719,91 @@ export namespace BatchListResponse { tags: Array; timing: Data.Timing; + + /** + * Access policy IDs applied to every page. + */ + policies?: Array; } export namespace Data { /** - * What this batch has done to your credit balance. + * Batch credit usage and settlement. */ export interface Credits { /** - * `reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. - * Equal to `reserved` until the batch settles. + * `reserved` minus `refunded` plus `ocr_charged`. */ net: number; /** - * Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered - * page, on top of `reserved`. Stays 0 until the batch settles. + * OCR usage charged when the batch settles. */ ocr_charged: number; /** - * Credits returned for pages that did not succeed. Stays 0 until the batch reaches - * a final status, then settles in one movement. + * Credits returned for unsuccessful pages when the batch settles. */ refunded: number; /** - * Credits debited from your balance the moment the batch was accepted. This is a - * charge, not a forecast — the whole amount leaves the balance up front. + * Credits held by background preparation before scraping starts. Zero while + * pending. */ reserved: number; } + /** + * Outputs requested for each page. Matches input.data.formats on submission. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + /** * Pages attempted so far. Use `status` to check completion. */ @@ -598,9 +814,8 @@ export namespace BatchListResponse { failed: number; /** - * Reserved pages not yet attempted. A cancelled batch keeps reporting the URLs it - * never reached; a crawl whose `input.reserved_is_ceiling` is true reports 0 once - * final, because its unspent budget was never real pages. + * Accepted pages not yet attempted. Unused crawl capacity is excluded after + * completion. */ pending: number; @@ -611,12 +826,12 @@ export namespace BatchListResponse { } /** - * Download links, available once the batch reaches a final status and null before - * then. GET /batch/{batch_id}/results serves the same records as paginated JSON. + * Result download links; null until the batch finishes. Files are deleted 180 days + * after the batch finishes. */ export interface Results { /** - * When the download URLs expire. + * When these links expire (24 hours after this response). */ expires_at: string; @@ -664,23 +879,28 @@ export namespace BatchListResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } export interface BatchDeleteResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * ID of the deleted batch. */ @@ -692,25 +912,23 @@ export interface BatchDeleteResponse { deleted?: boolean; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: BatchDeleteResponse.KeyMetadata; } export namespace BatchDeleteResponse { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -723,8 +941,7 @@ export interface BatchCancelResponse { id: string; /** - * The crawl controls as submitted, so the limits requested can be compared against - * what the crawl reached. + * Crawl settings as submitted. */ crawl: CrawlControls | null; @@ -734,12 +951,12 @@ export interface BatchCancelResponse { credits: BatchCancelResponse.Credits; /** - * What each page is returned as. + * Outputs requested for each page. Matches input.data.formats on submission. */ - format: 'markdown' | 'html'; + formats: BatchCancelResponse.Formats; /** - * What submission took in, and what it charged for. + * What the submission accepted. */ input: Intake; @@ -758,6 +975,12 @@ export interface BatchCancelResponse { */ progress: BatchCancelResponse.Progress; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Always `cancelling`. Work already in flight finishes; the batch reaches * `cancelled` shortly after. @@ -770,12 +993,12 @@ export interface BatchCancelResponse { tags: Array; /** - * There is no finish time yet — the batch is still winding down. + * Batch timestamps. */ timing: BatchCancelResponse.Timing; /** - * API key usage for this request. + * Credits this request used and your remaining balance. */ key_metadata?: BatchCancelResponse.KeyMetadata; } @@ -786,12 +1009,62 @@ export namespace BatchCancelResponse { */ export interface Credits { /** - * Credits debited at submission. The unspent remainder is refunded once the batch - * settles — read `credits.refunded` from GET /batch/{batch_id} then. + * Credits held at submission; unused credits are refunded when the batch settles. */ reserved: number; } + /** + * Outputs requested for each page. Matches input.data.formats on submission. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + /** * How far the batch got before cancellation. */ @@ -802,7 +1075,7 @@ export namespace BatchCancelResponse { failed: number; /** - * Reserved pages that will now be skipped, and refunded when the batch settles. + * Pages that will be skipped. */ pending: number; @@ -813,7 +1086,7 @@ export namespace BatchCancelResponse { } /** - * There is no finish time yet — the batch is still winding down. + * Batch timestamps. */ export interface Timing { /** @@ -828,22 +1101,28 @@ export namespace BatchCancelResponse { } /** - * API key usage for this request. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } export interface BatchGetResultsResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Result records on this page. */ @@ -855,8 +1134,7 @@ export interface BatchGetResultsResponse { has_more?: boolean; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: BatchGetResultsResponse.KeyMetadata; @@ -868,34 +1146,22 @@ export interface BatchGetResultsResponse { export namespace BatchGetResultsResponse { /** - * A page the batch fetched successfully. + * At least one requested output succeeded. Check result.isPartial and each output + * success for incomplete results. */ export interface Ok { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: Ok.CacheMetadata; - - /** - * URL the content was read from, after redirects. + * Credits charged for this page, including OCR. Cached outputs use the same + * pricing as POST /web/scrape. */ - final_url: string; + credits_used: number; /** - * HTTP status of the final response, when known. + * The same response as POST /web/scrape, including per-format success, failure, + * and partial results. */ - http_status: number | null; + result: Ok.Result; - /** - * Metadata extracted from the scraped page HTML. - */ - metadata: Ok.Metadata; - - /** - * The page was scraped. - */ status: 'ok'; /** @@ -904,513 +1170,1898 @@ export namespace BatchGetResultsResponse { url: string; /** - * Page HTML. Present on html batches, and on markdown batches submitted with - * `options.includeHTML`. - */ - html?: string; - - /** - * Caller-supplied identifier echoed from submission. + * Your `itemId` from submission. */ itemId?: string; - /** - * Page content as Markdown. Present on markdown batches. - */ - markdown?: string; - /** * Caller-supplied metadata echoed from submission. */ meta?: { [key: string]: unknown }; /** - * PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page - * bills 1 credit on top of the page base credit; absent when no OCR ran. + * PDF pages recovered by OCR. Omitted when OCR did not run. */ ocr_pages?: number; } export namespace Ok { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * The same response as POST /web/scrape, including per-format success, failure, + * and partial results. */ - export interface CacheMetadata { + export interface Result { /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. + * The original HTTP response body, unchanged by waits, actions, and filters. */ - age_ms: number; + bytes: Result.Bytes; /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. + * Whether this response came from cache. */ - status: 'hit' | 'miss' | 'zdr'; - } + cache_metadata: Result.CacheMetadata; - /** - * Metadata extracted from the scraped page HTML. - */ - export interface Metadata { /** - * Final URL scraped after redirects or scraper fallback, when known. Falls back to - * sourceUrl when unavailable. + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. */ - finalUrl: string; + highlights: Result.Highlights; /** - * Original URL requested by the caller. + * Rendered HTML after content filters. */ - sourceUrl: string; + html: Result.HTML; /** - * Additional non-social meta tags not promoted to top-level metadata fields. + * Images after content filters. `[]` when none are found. */ - additionalMeta?: { [key: string]: string | Array }; + images: Result.Images; /** - * Resolved alternate links from link rel=alternate tags. + * Object matching `jsonParams.schema`. */ - alternates?: Array; + json: Result.Json; /** - * Author metadata, when present. + * Markdown after content filters. */ - author?: string; + markdown: Result.Markdown; /** - * Resolved canonical URL, when present. + * Page metadata. Fields are omitted when not found. */ - canonicalUrl?: string; + metadata: Result.Metadata; /** - * Best description extracted from standard, Open Graph, or Twitter metadata. + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. */ - description?: string; + parsed: Result.Parsed; /** - * Resolved favicon URL, when present. + * Product details found on the page. */ - favicon?: string; + product: Result.Product; /** - * Page headings (h1–h6) in document order, extracted from the unfiltered document. - * Capped at the first 500 headings. Omitted when the page has none. + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. */ - headings?: Array; + profile: Result.Profile | null; /** - * Primary resolved preview image from Open Graph, Twitter, or image metadata. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - image?: string; + request_id: string; /** - * JSON-LD structured data blocks parsed from the page. + * Screenshot as a base64 image data URL. */ - jsonLd?: Array<{ [key: string]: unknown }>; + screenshot: Result.Screenshot; /** - * Keywords extracted from the page's keywords meta tag. + * Final URL after redirects and browser actions. */ - keywords?: Array; + url: string; /** - * Language extracted from html lang or language meta tags. + * True when at least one requested output succeeds but the response has failed or + * incomplete outputs. Absent when all requested outputs fail. */ - language?: string; + isPartial?: true; /** - * Modified timestamp/date from page metadata, when present. + * Credits this request used and your remaining balance. */ - modifiedTime?: string; + key_metadata?: Result.KeyMetadata; + } + export namespace Result { /** - * Open Graph metadata with the og: prefix removed and keys camel-cased. + * The original HTTP response body, unchanged by waits, actions, and filters. */ - openGraph?: { [key: string]: string | Array }; + export interface Bytes { + data: Bytes.Data | null; - /** - * Published timestamp/date from page metadata, when present. - */ - publishedTime?: string; + requested: boolean; - /** - * Robots meta directive, when present. - */ - robots?: string; + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; - /** - * Site or application name from page metadata. - */ - siteName?: string; + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Bytes { + export interface Data { + /** + * Body as base64, after HTTP decompression. Up to 50 MiB decoded. + */ + base64: string; + + contentType: string; + } + } /** - * Best title extracted from the page. + * Whether this response came from cache. */ - title?: string; + export interface CacheMetadata { + /** + * Age of the cached data in milliseconds. Zero for miss and zdr responses. + */ + age_ms: number; + + /** + * Whether the response was served from cache, required fresh work, or honored + * zero-data-retention cache bypass. + */ + status: 'hit' | 'miss' | 'zdr'; + } /** - * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. */ - twitter?: { [key: string]: string | Array }; - } + export interface Highlights { + data: Array | null; + + requested: boolean; - export namespace Metadata { - export interface Alternate { /** - * Resolved alternate URL. + * `true` if returned, `false` if it failed, `null` if not requested. */ - href: string; + success: boolean | null; /** - * Language or locale for the alternate URL, when present. + * Why the output failed. Present only when `success` is `false`. */ - hreflang?: string; + error_code?: string; /** - * Alternate resource title, when present. + * Explanation of the failure and possible next steps. */ - title?: string; + message?: string; + } + + /** + * Rendered HTML after content filters. + */ + export interface HTML { + data: string | null; + + requested: boolean; /** - * Alternate resource MIME type, when present. + * `true` if returned, `false` if it failed, `null` if not requested. */ - type?: string; - } + success: boolean | null; - export interface Heading { /** - * Heading level, 1–6 (from h1–h6). + * Why the output failed. Present only when `success` is `false`. */ - level: number; + error_code?: string; /** - * Heading text with whitespace collapsed, truncated to 1000 characters. + * Explanation of the failure and possible next steps. */ - text: string; + message?: string; } - } - } - /** - * A page the batch could not fetch. - */ - export interface Error { - /** - * Why the page failed. - */ - error_code: string; + /** + * Images after content filters. `[]` when none are found. + */ + export interface Images { + data: Array | null; - /** - * Human-readable failure detail. - */ - message: string; + requested: boolean; - /** - * The page could not be scraped. - */ - status: 'error'; + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; - /** - * URL as submitted, or as discovered by the crawl. - */ - url: string; + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; - /** - * Caller-supplied identifier echoed from submission. - */ - itemId?: string; + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } - /** - * Caller-supplied metadata echoed from submission. - */ - meta?: { [key: string]: unknown }; - } + export namespace Images { + export interface Data { + /** + * Alt text, if present. + */ + alt: string | null; - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; + /** + * Image URL, or a data URI for inline images. + */ + url: string; + + classification?: + | 'photography' + | 'illustration' + | 'logo' + | 'wordmark' + | 'icon' + | 'pattern' + | 'graphic' + | 'other'; - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } -} + /** + * Hosted image URL, valid for 24 hours after capture. Requires `file` enrichment + * and ZDR disabled. + */ + fileUrl?: string; -export interface BatchSubmitResponse { - /** - * Batch ID. Poll GET /batch/{batch_id} with it. - */ - id: string; + height?: number; - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: BatchSubmitResponse.CacheMetadata; + width?: number; + } + } - /** - * The crawl controls as submitted, so the limits requested can be compared against - * what the crawl reached. - */ - crawl: CrawlControls | null; + /** + * Object matching `jsonParams.schema`. + */ + export interface Json { + data: { [key: string]: unknown } | null; - /** - * When the batch was created. - */ - created_at: string; + requested: boolean; - /** - * What accepting this batch cost. - */ - credits: BatchSubmitResponse.Credits; + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; - /** - * What each page will be returned as. - */ - format: 'markdown' | 'html'; + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; - /** - * What submission took in, and what it charged for. - */ - input: Intake; + /** + * True when the page was too long to read in full, so values found only in the + * unread parts may be missing. + */ + isTruncated?: true; - /** - * Rejected URLs, up to 100. These are not charged. - */ - invalid_urls: Array; + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } - /** - * How pages will be selected. - */ - mode: 'scrape' | 'crawl'; + /** + * Markdown after content filters. + */ + export interface Markdown { + data: string | null; - /** - * Always `queued`. An accepted batch has not started yet. - */ - status: 'queued'; + requested: boolean; - /** - * Tags stored on the batch. - */ - tags: Array; + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; - /** - * API key usage for this request. - */ - key_metadata?: BatchSubmitResponse.KeyMetadata; + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; - /** - * Signing secret for the completion webhook, returned only here and never again. - * Store it now; it is not repeated by GET /batch/{batch_id}. - */ - webhook_secret?: string; -} + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } -export namespace BatchSubmitResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; + /** + * Page metadata. Fields are omitted when not found. + */ + export interface Metadata { + /** + * Additional non-social meta tags not promoted to top-level metadata fields. + */ + additionalMeta?: { [key: string]: string | Array }; - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } + /** + * Resolved alternate links from link rel=alternate tags. + */ + alternates?: Array; - /** - * What accepting this batch cost. - */ - export interface Credits { - /** - * Credits just debited from your balance. Whatever the batch does not spend is - * refunded when it settles. - */ - reserved: number; - } + /** + * Author metadata, when present. + */ + author?: string; - export interface InvalidURL { - /** - * Why it was rejected. - */ - reason: string; + /** + * Resolved canonical URL, when present. + */ + canonicalUrl?: string; - /** - * Rejected URL. - */ - url: string; - } + /** + * Best description extracted from standard, Open Graph, or Twitter metadata. + */ + description?: string; - /** - * API key usage for this request. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; + /** + * Resolved favicon URL, when present. + */ + favicon?: string; - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } -} + /** + * Up to 500 h1–h6 headings in document order, before content filtering. + */ + headings?: Array; -export interface BatchListParams { - /** - * Cursor from the previous page. - */ - cursor?: string; + /** + * Primary resolved preview image from Open Graph, Twitter, or image metadata. + */ + image?: string; - /** - * Batches per page. Defaults to 25. - */ - limit?: number; + /** + * JSON-LD structured data blocks parsed from the page. + */ + jsonLd?: Array<{ [key: string]: unknown }>; - /** - * Free-text search term, matched against the batch id, crawl source (start URL or - * sitemap domain), and tags. - */ - q?: string; + /** + * Keywords extracted from the page's keywords meta tag. + */ + keywords?: Array; - /** - * `prefix` for as-you-type prefix matching (default), `exact` for full-token - * matching. - */ - search_type?: 'exact' | 'prefix'; + /** + * Language extracted from html lang or language meta tags. + */ + language?: string; - /** - * Filter by status. - */ - status?: 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; + /** + * Modified timestamp/date from page metadata, when present. + */ + modifiedTime?: string; - /** - * Comma-separated list of tags to filter by (matches batches having any of them). - */ - tags?: string; -} + /** + * Open Graph metadata with the og: prefix removed and keys camel-cased. + */ + openGraph?: { [key: string]: string | Array }; -export interface BatchGetResultsParams { - /** - * next_cursor from the previous page. - */ - cursor?: string; + /** + * Published timestamp/date from page metadata, when present. + */ + publishedTime?: string; - /** - * Records per page. Defaults to 25. A page can close early so its payload stays - * under ~8 MB; rely on next_cursor rather than counting records. - */ - limit?: number; -} + /** + * Robots meta directive, when present. + */ + robots?: string; -export interface BatchSubmitParams { - /** - * Body param: Choose a URL list or a site crawl. - */ - input: BatchSubmitParams.Scrape | BatchSubmitParams.Crawl; + /** + * Site or application name from page metadata. + */ + siteName?: string; - /** - * Body param: Tags stored on the batch. Filter the batch list by them later. - */ - tags?: Array; + /** + * Best title extracted from the page. + */ + title?: string; - /** - * Body param: URL notified when the batch finishes. - */ - webhookUrl?: string; + /** + * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + */ + twitter?: { [key: string]: string | Array }; + } - /** - * Header param: Any string unique to this submission. Retries with the same key - * return the original batch. - */ - 'Idempotency-Key'?: string; -} + export namespace Metadata { + export interface Alternate { + /** + * Resolved alternate URL. + */ + href: string; -export namespace BatchSubmitParams { - /** - * Scrape up to 25K URLs in one batch. - */ - export interface Scrape { - /** - * Pages to scrape and their output format. - */ - data: Scrape.Markdown | Scrape.HTML; + /** + * Language or locale for the alternate URL, when present. + */ + hreflang?: string; - /** - * Scrape the pages in `data.urls`. - */ - mode: 'scrape'; - } + /** + * Alternate resource title, when present. + */ + title?: string; - export namespace Scrape { - /** - * Scrape the listed pages as Markdown. - */ - export interface Markdown { - /** - * Return page content as Markdown. - */ - format: 'markdown'; + /** + * Alternate resource MIME type, when present. + */ + type?: string; + } - /** - * Pages to scrape. Maximum 25000. - */ - urls: Array; + export interface Heading { + /** + * Heading level, 1–6 (from h1–h6). + */ + level: number; + + /** + * Heading text with whitespace collapsed, truncated to 1000 characters. + */ + text: string; + } + } /** - * Options for Markdown output. + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. */ - options?: Markdown.Options; - } + export interface Parsed { + data: { [key: string]: unknown } | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * The selected prebuilt parser name, or custom when type is omitted, custom rules + * are used, or parsing is not requested. + */ + type: + | 'custom' + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } - export namespace Markdown { /** - * A page to scrape, with optional data for matching results. + * Product details found on the page. */ - export interface URL { + export interface Product { + data: Product.Data | null; + + requested: boolean; + /** - * Page URL to scrape. + * `true` if returned, `false` if it failed, `null` if not requested. */ - url: string; + success: boolean | null; /** - * Your ID for this page, returned with its result. The same URL can use different - * IDs. + * Why the output failed. Present only when `success` is `false`. */ - itemId?: string; + error_code?: string; /** - * Custom JSON returned unchanged with this page result. + * Explanation of the failure and possible next steps. */ - meta?: { [key: string]: unknown }; + message?: string; + } + + export namespace Product { + export interface Data { + /** + * Whether the page is a product detail page. + */ + isProductPage: boolean; + + /** + * The extracted product, or null when the page is not a product detail page. + */ + product: Data.Product | null; + } + + export namespace Data { + /** + * The extracted product, or null when the page is not a product detail page. + */ + export interface Product { + /** + * Stock or ordering availability. + */ + availability: + | 'in_stock' + | 'out_of_stock' + | 'limited_availability' + | 'preorder' + | 'backorder' + | 'made_to_order' + | 'discontinued' + | null; + + /** + * Brand or vendor. + */ + brand: string | null; + + /** + * Product category. + */ + category: string | null; + + /** + * ISO 4217 currency code. + */ + currency: string | null; + + /** + * Product description. + */ + description: string | null; + + /** + * Product dimensions as shown on the page. + */ + dimensions: Array; + + /** + * Key features and specifications. + */ + features: Array; + + /** + * Product image URLs, main image first. + */ + images: Array; + + /** + * Main product image URL. + */ + imageUrl: string | null; + + /** + * Product name. + */ + name: string; + + /** + * Current price. + */ + price: number | null; + + /** + * List price before any discount. + */ + regularPrice: number | null; + + /** + * Product identifier such as a SKU or model number. + */ + sku: string | null; + + /** + * Product tags. + */ + tags: Array; + + /** + * Intended audience. + */ + targetAudience: Array; + + /** + * Product variations, such as different colors or sizes, with their attributes and + * images. Empty if none are found. May not include every variation offered by the + * store. + */ + variants: Array; + } + + export namespace Product { + export interface Variant { + /** + * Explicit variant attributes such as color, size, material, pattern and + * properties declared by page. + */ + attributes: { [key: string]: string }; + + /** + * Original source image URLs explicitly attached to this variant. + */ + images: Array; + + sku: string | null; + + /** + * Variant or offer URL when provided by the source. May be shared by variants. + */ + url: string | null; + } + } + } } /** - * Options for Markdown output. + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. */ - export interface Options { + export interface Profile { /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Save this ID after creating a profile, then reuse it as + * sharedParams.profile.profileId with type "existing". + */ + id: string; + } + + /** + * Screenshot as a base64 image data URL. + */ + export interface Screenshot { + data: string | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + } + } + + /** + * A page the batch could not fetch. + */ + export interface Error { + /** + * Why the page failed. + */ + error_code: string; + + /** + * Human-readable failure detail. + */ + message: string; + + /** + * The page could not be scraped. + */ + status: 'error'; + + /** + * URL as submitted, or as discovered by the crawl. + */ + url: string; + + /** + * Credits charged for this page, including OCR. Cached outputs use the same + * pricing as POST /web/scrape. + */ + credits_used?: number; + + /** + * Your `itemId` from submission. + */ + itemId?: string; + + /** + * Caller-supplied metadata echoed from submission. + */ + meta?: { [key: string]: unknown }; + + /** + * PDF pages recovered by OCR. Omitted when OCR did not run. + */ + ocr_pages?: number; + + /** + * Per-format failures when scraping returned a structured response. Omitted for + * errors that prevent scraping. + */ + result?: Error.Result; + } + + export namespace Error { + /** + * Per-format failures when scraping returned a structured response. Omitted for + * errors that prevent scraping. + */ + export interface Result { + /** + * The original HTTP response body, unchanged by waits, actions, and filters. + */ + bytes: Result.Bytes; + + /** + * Whether this response came from cache. + */ + cache_metadata: Result.CacheMetadata; + + /** + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. + */ + highlights: Result.Highlights; + + /** + * Rendered HTML after content filters. + */ + html: Result.HTML; + + /** + * Images after content filters. `[]` when none are found. + */ + images: Result.Images; + + /** + * Object matching `jsonParams.schema`. + */ + json: Result.Json; + + /** + * Markdown after content filters. + */ + markdown: Result.Markdown; + + /** + * Page metadata. Fields are omitted when not found. + */ + metadata: Result.Metadata; + + /** + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. + */ + parsed: Result.Parsed; + + /** + * Product details found on the page. + */ + product: Result.Product; + + /** + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. + */ + profile: Result.Profile | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Screenshot as a base64 image data URL. + */ + screenshot: Result.Screenshot; + + /** + * Final URL after redirects and browser actions. + */ + url: string; + + /** + * True when at least one requested output succeeds but the response has failed or + * incomplete outputs. Absent when all requested outputs fail. + */ + isPartial?: true; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: Result.KeyMetadata; + } + + export namespace Result { + /** + * The original HTTP response body, unchanged by waits, actions, and filters. + */ + export interface Bytes { + data: Bytes.Data | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Bytes { + export interface Data { + /** + * Body as base64, after HTTP decompression. Up to 50 MiB decoded. + */ + base64: string; + + contentType: string; + } + } + + /** + * Whether this response came from cache. + */ + export interface CacheMetadata { + /** + * Age of the cached data in milliseconds. Zero for miss and zdr responses. + */ + age_ms: number; + + /** + * Whether the response was served from cache, required fresh work, or honored + * zero-data-retention cache bypass. + */ + status: 'hit' | 'miss' | 'zdr'; + } + + /** + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. + */ + export interface Highlights { + data: Array | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Rendered HTML after content filters. + */ + export interface HTML { + data: string | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Images after content filters. `[]` when none are found. + */ + export interface Images { + data: Array | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Images { + export interface Data { + /** + * Alt text, if present. + */ + alt: string | null; + + /** + * Image URL, or a data URI for inline images. + */ + url: string; + + classification?: + | 'photography' + | 'illustration' + | 'logo' + | 'wordmark' + | 'icon' + | 'pattern' + | 'graphic' + | 'other'; + + /** + * Hosted image URL, valid for 24 hours after capture. Requires `file` enrichment + * and ZDR disabled. + */ + fileUrl?: string; + + height?: number; + + width?: number; + } + } + + /** + * Object matching `jsonParams.schema`. + */ + export interface Json { + data: { [key: string]: unknown } | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * True when the page was too long to read in full, so values found only in the + * unread parts may be missing. + */ + isTruncated?: true; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Markdown after content filters. + */ + export interface Markdown { + data: string | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Page metadata. Fields are omitted when not found. + */ + export interface Metadata { + /** + * Additional non-social meta tags not promoted to top-level metadata fields. + */ + additionalMeta?: { [key: string]: string | Array }; + + /** + * Resolved alternate links from link rel=alternate tags. + */ + alternates?: Array; + + /** + * Author metadata, when present. + */ + author?: string; + + /** + * Resolved canonical URL, when present. + */ + canonicalUrl?: string; + + /** + * Best description extracted from standard, Open Graph, or Twitter metadata. + */ + description?: string; + + /** + * Resolved favicon URL, when present. + */ + favicon?: string; + + /** + * Up to 500 h1–h6 headings in document order, before content filtering. + */ + headings?: Array; + + /** + * Primary resolved preview image from Open Graph, Twitter, or image metadata. + */ + image?: string; + + /** + * JSON-LD structured data blocks parsed from the page. + */ + jsonLd?: Array<{ [key: string]: unknown }>; + + /** + * Keywords extracted from the page's keywords meta tag. + */ + keywords?: Array; + + /** + * Language extracted from html lang or language meta tags. + */ + language?: string; + + /** + * Modified timestamp/date from page metadata, when present. + */ + modifiedTime?: string; + + /** + * Open Graph metadata with the og: prefix removed and keys camel-cased. + */ + openGraph?: { [key: string]: string | Array }; + + /** + * Published timestamp/date from page metadata, when present. + */ + publishedTime?: string; + + /** + * Robots meta directive, when present. + */ + robots?: string; + + /** + * Site or application name from page metadata. + */ + siteName?: string; + + /** + * Best title extracted from the page. + */ + title?: string; + + /** + * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + */ + twitter?: { [key: string]: string | Array }; + } + + export namespace Metadata { + export interface Alternate { + /** + * Resolved alternate URL. + */ + href: string; + + /** + * Language or locale for the alternate URL, when present. + */ + hreflang?: string; + + /** + * Alternate resource title, when present. + */ + title?: string; + + /** + * Alternate resource MIME type, when present. + */ + type?: string; + } + + export interface Heading { + /** + * Heading level, 1–6 (from h1–h6). + */ + level: number; + + /** + * Heading text with whitespace collapsed, truncated to 1000 characters. + */ + text: string; + } + } + + /** + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. + */ + export interface Parsed { + data: { [key: string]: unknown } | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * The selected prebuilt parser name, or custom when type is omitted, custom rules + * are used, or parsing is not requested. + */ + type: + | 'custom' + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Product details found on the page. + */ + export interface Product { + data: Product.Data | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Product { + export interface Data { + /** + * Whether the page is a product detail page. + */ + isProductPage: boolean; + + /** + * The extracted product, or null when the page is not a product detail page. + */ + product: Data.Product | null; + } + + export namespace Data { + /** + * The extracted product, or null when the page is not a product detail page. + */ + export interface Product { + /** + * Stock or ordering availability. + */ + availability: + | 'in_stock' + | 'out_of_stock' + | 'limited_availability' + | 'preorder' + | 'backorder' + | 'made_to_order' + | 'discontinued' + | null; + + /** + * Brand or vendor. + */ + brand: string | null; + + /** + * Product category. + */ + category: string | null; + + /** + * ISO 4217 currency code. + */ + currency: string | null; + + /** + * Product description. + */ + description: string | null; + + /** + * Product dimensions as shown on the page. + */ + dimensions: Array; + + /** + * Key features and specifications. + */ + features: Array; + + /** + * Product image URLs, main image first. + */ + images: Array; + + /** + * Main product image URL. + */ + imageUrl: string | null; + + /** + * Product name. + */ + name: string; + + /** + * Current price. + */ + price: number | null; + + /** + * List price before any discount. + */ + regularPrice: number | null; + + /** + * Product identifier such as a SKU or model number. + */ + sku: string | null; + + /** + * Product tags. + */ + tags: Array; + + /** + * Intended audience. + */ + targetAudience: Array; + + /** + * Product variations, such as different colors or sizes, with their attributes and + * images. Empty if none are found. May not include every variation offered by the + * store. + */ + variants: Array; + } + + export namespace Product { + export interface Variant { + /** + * Explicit variant attributes such as color, size, material, pattern and + * properties declared by page. + */ + attributes: { [key: string]: string }; + + /** + * Original source image URLs explicitly attached to this variant. + */ + images: Array; + + sku: string | null; + + /** + * Variant or offer URL when provided by the source. May be shared by variants. + */ + url: string | null; + } + } + } + } + + /** + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. + */ + export interface Profile { + /** + * Save this ID after creating a profile, then reuse it as + * sharedParams.profile.profileId with type "existing". + */ + id: string; + } + + /** + * Screenshot as a base64 image data URL. + */ + export interface Screenshot { + data: string | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface BatchSubmitResponse { + /** + * Batch ID. Poll GET /batch/{batch_id} with it. + */ + id: string; + + /** + * Whether this response came from cache. + */ + cache_metadata: BatchSubmitResponse.CacheMetadata; + + /** + * Crawl settings as submitted. + */ + crawl: CrawlControls | null; + + /** + * When the batch was created. + */ + created_at: string; + + /** + * Credits are reserved after background validation, before scraping starts. + */ + credits: BatchSubmitResponse.Credits; + + /** + * Outputs requested for each page. Matches input.data.formats on submission. + */ + formats: BatchSubmitResponse.Formats; + + /** + * What the submission accepted. + */ + input: Intake; + + /** + * Rejected URLs (first 100). + */ + invalid_urls: Array; + + /** + * How pages will be selected. + */ + mode: 'scrape' | 'crawl'; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Current state. `pending` means waiting for execution capacity or background + * validation. Capacity-limited batches remain pending until a slot opens. + * `completed`, `cancelled`, and `failed` are final. + */ + status: 'pending' | 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; + + /** + * Tags stored on the batch. + */ + tags: Array; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: BatchSubmitResponse.KeyMetadata; + + /** + * Secret for verifying `X-Context-Signature`. Only submit returns it, so store it. + */ + webhook_secret?: string; +} + +export namespace BatchSubmitResponse { + /** + * Whether this response came from cache. + */ + export interface CacheMetadata { + /** + * Age of the cached data in milliseconds. Zero for miss and zdr responses. + */ + age_ms: number; + + /** + * Whether the response was served from cache, required fresh work, or honored + * zero-data-retention cache bypass. + */ + status: 'hit' | 'miss' | 'zdr'; + } + + /** + * Credits are reserved after background validation, before scraping starts. + */ + export interface Credits { + /** + * Credits reserved by background preparation. Zero while pending. + */ + reserved: number; + } + + /** + * Outputs requested for each page. Matches input.data.formats on submission. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + + export interface InvalidURL { + /** + * Why it was rejected. + */ + reason: string; + + /** + * Rejected URL. + */ + url: string; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface BatchListParams { + /** + * Cursor from the previous page. + */ + cursor?: string; + + /** + * Batches per page. Defaults to 25. + */ + limit?: number; + + /** + * Free-text search term, matched against the batch id, crawl source (start URL or + * sitemap domain), and tags. + */ + q?: string; + + /** + * `prefix` for as-you-type prefix matching (default), `exact` for full-token + * matching. + */ + search_type?: 'exact' | 'prefix'; + + /** + * Include batches submitted with Scrape Anything formats. Defaults to false. + */ + shouldIncludeUnified?: boolean; + + /** + * Filter by status. + */ + status?: 'pending' | 'queued' | 'running' | 'cancelling' | 'completed' | 'cancelled' | 'failed'; + + /** + * Tags to filter by (matches batches having any of them). Pass repeated `tags` + * params or one comma-separated list, e.g. `tags=docs,competitor`. + */ + tags?: string | Array; +} + +export interface BatchGetResultsParams { + /** + * next_cursor from the previous page. + */ + cursor?: string; + + /** + * Records per page. Defaults to 25. A page can close early so its payload stays + * under ~8 MB; rely on next_cursor rather than counting records. + */ + limit?: number; +} + +export interface BatchSubmitParams { + /** + * Body param: Choose a URL list or a site crawl. + */ + input: BatchSubmitParams.Scrape | BatchSubmitParams.Crawl; + + /** + * Body param: Access policy IDs to apply to every page. A URL must pass every + * policy. + */ + policies?: Array; + + /** + * Body param: Tags stored on the batch. Filter the batch list by them later. + */ + tags?: Array; + + /** + * Body param: Where to send the batch's final-status event. Omit `retry` for one + * attempt; `{}` uses the default retry schedule. + */ + webhook?: BatchSubmitParams.Webhook; + + /** + * Body param: Legacy URL notified when the batch finishes. Preserves one + * best-effort attempt. Cannot be combined with webhook. + */ + webhookUrl?: string; + + /** + * Header param: Unique key per submission. Retrying with the same key and body + * returns the original batch; a different body returns `409`. + */ + 'Idempotency-Key'?: string; +} + +export namespace BatchSubmitParams { + /** + * Scrape a list of up to 100,000 URLs. + */ + export interface Scrape { + /** + * Pages to scrape and their output format. + */ + data: Scrape.Markdown | Scrape.HTML | Scrape.BatchUnifiedScrapeData; + + /** + * Scrape the pages in `data.urls`. + */ + mode: 'scrape'; + } + + export namespace Scrape { + /** + * @deprecated Scrape the listed pages as Markdown. + */ + export interface Markdown { + /** + * Return page content as Markdown. + */ + format: 'markdown'; + + /** + * Pages to scrape. Maximum 100000. + */ + urls: Array; + + /** + * Options for Markdown output. + */ + options?: Markdown.Options; + } + + export namespace Markdown { + /** + * A page to scrape, with optional data for matching results. + */ + export interface URL { + /** + * Page URL to scrape. + */ + url: string; + + /** + * Your ID for this page, returned with its result. The same URL can use different + * IDs. + */ + itemId?: string; + + /** + * Custom JSON returned unchanged with this page result. + */ + meta?: { [key: string]: unknown }; + } + + /** + * Options for Markdown output. + */ + export interface Options { + /** + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -1625,51 +3276,53 @@ export namespace BatchSubmitParams { excludeSelectors?: Array | null; /** - * Also include each page's HTML in its result record, as an `html` field alongside - * the Markdown. + * Also return each page's HTML in `html`. */ includeHTML?: boolean; /** - * Include image references in the Markdown. + * Include image references in the Markdown (`html-conversion` only). */ includeImages?: boolean; /** - * Include links in the Markdown. + * Include links in the Markdown (`html-conversion` only). */ includeLinks?: boolean; /** - * Keep only the subtrees matching these CSS selectors. Filtered pages are always - * fetched fresh, ignoring `maxAgeMs`. + * Keep only elements matching these CSS selectors. Filtered pages ignore + * `maxAgeMs`. */ includeSelectors?: Array | null; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1 + * year (31536000000 ms). `0` fetches fresh. */ maxAgeMs?: number | null; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ pdf?: Options.Pdf; /** - * Wait briefly for CSS and transition animations to settle before extraction, on - * pages that render in a browser. + * Wait for CSS animations to finish before extracting, on browser-rendered pages. */ settleAnimations?: boolean; /** - * Shorten inline base64 image data. + * Shorten inline base64 image data (`html-conversion` only). */ shortenBase64Images?: boolean; + /** + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. + */ + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; + /** * Return the main content without navigation or footers. */ @@ -1683,32 +3336,27 @@ export namespace BatchSubmitParams { export namespace Options { /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ export interface Pdf { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. */ end?: number; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * Read scanned PDF pages with OCR; preserve pages that already have text. */ ocr?: boolean; /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`. */ shouldParse?: boolean; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * First 1-based PDF page to parse. */ start?: number; } @@ -1716,7 +3364,7 @@ export namespace BatchSubmitParams { } /** - * Scrape the listed pages as HTML. + * @deprecated Scrape the listed pages as HTML. */ export interface HTML { /** @@ -1725,7 +3373,7 @@ export namespace BatchSubmitParams { format: 'html'; /** - * Pages to scrape. Maximum 25000. + * Pages to scrape. Maximum 100000. */ urls: Array; @@ -1762,8 +3410,7 @@ export namespace BatchSubmitParams { */ export interface Options { /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -1972,79 +3619,842 @@ export namespace BatchSubmitParams { | 'zw'; /** - * Remove elements matching these CSS selectors. Applied after `includeSelectors`, - * so an element matching both is removed. + * Remove elements matching these CSS selectors. Applied after `includeSelectors`, + * so an element matching both is removed. + */ + excludeSelectors?: Array | null; + + /** + * Keep only elements matching these CSS selectors. Filtered pages ignore + * `maxAgeMs`. + */ + includeSelectors?: Array | null; + + /** + * Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1 + * year (31536000000 ms). `0` fetches fresh. + */ + maxAgeMs?: number | null; + + /** + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. + */ + pdf?: Options.Pdf; + + /** + * Wait for CSS animations to finish before extracting, on browser-rendered pages. + */ + settleAnimations?: boolean; + + /** + * Return the main content without navigation or footers. + */ + useMainContentOnly?: boolean; + + /** + * How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + */ + waitForMs?: number; + } + + export namespace Options { + /** + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. + */ + export interface Pdf { + /** + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. + */ + end?: number; + + /** + * Read scanned PDF pages with OCR; preserve pages that already have text. + */ + ocr?: boolean; + + /** + * Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`. + */ + shouldParse?: boolean; + + /** + * First 1-based PDF page to parse. + */ + start?: number; + } + } + } + + /** + * Use the same formats and parameters as POST /web/scrape, replacing url with + * urls. Options apply to every page. + */ + export interface BatchUnifiedScrapeData { + /** + * Outputs to return. Set at least one to `true`. + */ + formats: BatchUnifiedScrapeData.Formats; + + /** + * Pages to scrape. Maximum 100000. + */ + urls: Array; + + /** + * Requires `formats.highlights: true`; required when it is set. + */ + highlightsParams?: BatchUnifiedScrapeData.HighlightsParams; + + /** + * Image options. Requires formats.images: true. + */ + imageParams?: BatchUnifiedScrapeData.ImageParams; + + /** + * Requires `formats.json: true`; required when it is set. + */ + jsonParams?: BatchUnifiedScrapeData.JsonParams; + + /** + * Markdown options. Requires `formats.markdown`. + */ + markdownParams?: BatchUnifiedScrapeData.MarkdownParams; + + /** + * Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to + * 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). + */ + maxAgeMs?: number; + + /** + * Requires `formats.parse: true`; required when it is set. + */ + parseParams?: BatchUnifiedScrapeData.CustomParser | BatchUnifiedScrapeData.PrebuiltParser; + + /** + * Product options. Requires formats.product: true. + */ + productParams?: BatchUnifiedScrapeData.ProductParams; + + /** + * Screenshot options. Requires formats.screenshot: true. + */ + screenshotParams?: BatchUnifiedScrapeData.ScreenshotParams; + + /** + * Browser and content settings shared by all outputs. + */ + sharedParams?: BatchUnifiedScrapeData.SharedParams; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + + /** + * Deadline for each page, using the same behavior and defaults as POST + * /web/scrape. + */ + timeoutOpts?: BatchUnifiedScrapeData.TimeoutOpts; + + /** + * Batches persist their results. Only disabled is supported; enabled returns + * ZDR_NOT_SUPPORTED. + */ + zdr?: 'disabled'; + } + + export namespace BatchUnifiedScrapeData { + /** + * Outputs to return. Set at least one to `true`. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. */ - excludeSelectors?: Array | null; + highlights?: boolean; /** - * Keep only the subtrees matching these CSS selectors. Filtered pages are always - * fetched fresh, ignoring `maxAgeMs`. + * Rendered HTML. */ - includeSelectors?: Array | null; + html?: boolean; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Images found on the page. */ - maxAgeMs?: number | null; + images?: boolean; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). */ - pdf?: Options.Pdf; + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + + /** + * A page to scrape, with optional data for matching results. + */ + export interface URL { + /** + * Page URL to scrape. + */ + url: string; + + /** + * Your ID for this page, returned with its result. The same URL can use different + * IDs. + */ + itemId?: string; + + /** + * Custom JSON returned unchanged with this page result. + */ + meta?: { [key: string]: unknown }; + } + + /** + * Requires `formats.highlights: true`; required when it is set. + */ + export interface HighlightsParams { + /** + * The question or topic to find passages for. + */ + query: string; + + /** + * Maximum combined length of returned passages. + */ + maxCharacters?: number; + } + + /** + * Image options. Requires formats.images: true. + */ + export interface ImageParams { + /** + * Set `visual` to drop visual duplicates, keeping the largest copy. + */ + dedupe?: 'none' | 'visual'; + + /** + * Extra data per image: `dimensions`, `classification`, or a hosted `file` URL. + */ + enrich?: Array<'dimensions' | 'classification' | 'file'>; + } + + /** + * Requires `formats.json: true`; required when it is set. + */ + export interface JsonParams { + /** + * JSON Schema (not an example object) for a top-level object, up to 50 KB. Use + * optional or nullable fields for missing facts. + */ + schema: { [key: string]: unknown }; + + /** + * Extra guidance, such as which facts to prefer or how to read a field. + */ + instructions?: string; + } + + /** + * Markdown options. Requires `formats.markdown`. + */ + export interface MarkdownParams { + /** + * Include images in the Markdown (`html-conversion` only). + */ + includeImages?: boolean; + + /** + * Keep link URLs in the Markdown (`html-conversion` only). + */ + includeLinks?: boolean; + + /** + * How base64 images appear when `includeImages` is set (`html-conversion` only). + */ + inlineImages?: 'placeholder' | 'preserve'; + + /** + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. + */ + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; + } + + export interface CustomParser { + /** + * Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100 + * fields, 5 levels. + */ + rules: { [key: string]: string | CustomParser.UnionMember1 }; + + /** + * Extract fields using custom CSS rules. This is the default when type is omitted. + */ + type?: 'custom'; + } + + export namespace CustomParser { + export interface UnionMember1 { + /** + * CSS selector to match within the current page or parent rule. + */ + selector: string; + + /** + * Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults + * to text. + */ + output?: 'text' | 'html' | string | unknown; + + /** + * Return the first match with `item` or all matches with `list`. + */ + type?: 'item' | 'list'; + } + } + + export interface PrebuiltParser { + /** + * google-maps parses Google Maps business data into data.results. Accepts Maps + * place, search, and internal data URLs. Uses a US exit and English labels + * regardless of hl or Accept-Language. google-maps-reviews returns the reviews of + * a place in data.reviews, in the same shape as the Serper reviews API (rating, + * date, isoDate, snippet, translatedSnippet, likes, user, media, response, link, + * id), plus language, guided ratings in details, and user.isLocalGuide; data also + * carries the place featureId, cid, and sort. sort and limit pick the order and + * count, and oldest is exact. It accepts Maps place, search, and ?cid= URLs, plus + * search.google.com/local/reviews URLs, so the google_maps_url and + * google_reviews_url fields of google-maps results work as input. An unknown place + * returns no reviews. google-play parses a Play Store app into data: details, + * developer contact, ratings, price, permissions, and data safety. + * google-play-reviews returns the 200 newest reviews of the app, with developer + * replies, in data.reviews. Both Play parsers accept app details URLs + * (play.google.com/store/apps/details?id=…); hl and gl set the language and + * storefront, defaulting to en and us. app-store parses an App Store app into + * data: details, developer, ratings, price, version, and screenshots. + * app-store-reviews returns up to the 500 newest reviews in data.reviews. Both App + * Store parsers accept app URLs (apps.apple.com/us/app/…/id…); the country in the + * path sets the storefront, defaulting to us. g2-reviews returns the 25 most + * recently published reviews of a G2 product in data.reviews (rating, title, + * likes, dislikes, problems_solved, reviewer role, company size, and industry), + * plus data.product. It accepts G2 product URLs (g2.com/products/…), follows + * renamed products, and keeps star-rating filters from the URL + * (filters[nps_score][]=1 to 5); other filters, sort orders, and pages are + * ignored. instagram-profile parses a public profile (instagram.com/{username}) + * into data: bio, links, follower and post counts, category, business address, + * similar_accounts, and latest_posts (up to the 12 posts at the top of the + * profile, newest first). Instagram lists pinned posts there ahead of newer ones, + * so posts with is_pinned true can be older; when Instagram shows only a rounded + * post count (32K), post_count is that rounded number and is_post_count_rounded is + * true. instagram-post parses a post or reel (/p/…, /reel/…) into data: caption, + * hashtags, mentions, like, comment, and view counts (like_count and view_count + * are null when the owner hides them), media URLs, tagged users, collaborators, + * location, and the top ~14 comments in data.comments. instagram-feed returns the + * top posts for a hashtag or keyword (/explore/tags/…, /popular/…) or the recent + * posts at a location (/explore/locations/{id}/…) in data.posts; keyword posts + * carry only the shortcode, owner, thumbnail, and views, plus the caption when + * Instagram shows it. All three Instagram parsers read public data without logging + * in, so private accounts return no posts and follower lists are unavailable. + * tiktok-profile parses a public profile (tiktok.com/@{username}) into data: + * nickname, bio, bio link, follower, following, like, and video counts, verified, + * private, and business flags, and business category; it does not list videos. + * tiktok-video parses a video or photo post (/@{username}/video/{id} or + * /@{username}/photo/{id}) into data: caption, hashtags, mentions, author, view, + * like, comment, share, save, and repost counts, duration, thumbnail, a video_url + * that downloads without cookies, image_urls for photo posts, music, location, and + * ad, paid-partnership, and AI-generated flags. tiktok-feed returns videos in the + * tiktok-video shape as data.videos: the latest 15 from a profile URL, the top 30 + * from a hashtag URL (/tag/{name}), or the top 12 from a search URL + * (/search?q={query}). tiktok-comments returns the first 20 comments of a video or + * photo post as data.comments: text, posted_at, like and reply counts, whether the + * author liked it, and the commenter. tiktok-followers and tiktok-following return + * up to 30 accounts of a profile as data.users, in the tiktok-profile shape. + * tiktok-user-search returns the top 10 accounts for a user search URL + * (/search/user?q={query}) as data.users: id, username, nickname, biography, + * avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok + * parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short + * links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). reddit-post parses a post + * (reddit.com/r/{subreddit}/comments/{id}, reddit.com/comments/{id}, or + * redd.it/{id}) into data.post: title, body as Markdown, type (text, link, image, + * gallery, or video), link_url, subreddit, author, flairs, score, upvote_ratio, + * comment and crosspost counts, NSFW, spoiler, locked, stickied, and archived + * flags, images (every gallery image in order), and video (an MP4 url plus an + * hls_url that carries the audio). data.comments holds the comment tree, each + * comment with id, author, body as Markdown, score, posted_at, depth, parent_id, + * url, is_submitter, is_deleted, and its replies; limit caps the total number of + * comments (default 100), filled shallowest first so whole conversations are kept, + * and data.has_more_comments says whether the thread has more. The sort query of + * the URL (best, top, new, controversial, old, qa) orders the comments. + * reddit-search returns search results for a search URL + * (reddit.com/search?q={query}, or reddit.com/r/{subreddit}/search?q={query} to + * search one subreddit). With type=link or no type it returns posts in the + * reddit-post shape as data.posts, ordered by the sort (relevance, hot, top, new, + * comments) and limited to the t time range (hour, day, week, month, year, all) of + * the URL; type=sr returns communities as data.communities (name, title, + * description, sidebar, subscriber_count, created_at, type, NSFW and quarantine + * flags, language, category, icon and banner URLs, and allowed post types); + * type=user returns accounts as data.users (username, display_name, bio, + * created_at, post and comment karma, avatar and banner URLs, and verified, + * employee, moderator, premium, and NSFW flags). limit caps the number of results + * (default 100), in the order Reddit returns them, and data.has_more says whether + * Reddit has more. reddit-subreddit reads a subreddit URL + * (reddit.com/r/{subreddit}, optionally followed by /hot, /new, /top, /rising, or + * /controversial, with t setting the time range of top and controversial, default + * day) into data.subreddit in the community shape of reddit-search, data.rules + * (name, description, applies_to, violation_reason, created_at), and data.posts in + * the reddit-post shape, ordered like the tab (default hot) and with stickied + * posts flagged; r/all and r/popular return posts with a null subreddit and rules. + * limit caps the posts (default 100) and data.has_more says whether Reddit has + * more. Private and quarantined subreddits return WEBSITE_ACCESS_ERROR. + * reddit-user reads a profile URL (reddit.com/user/{username} or + * reddit.com/u/{username}, optionally followed by /overview, /submitted, or + * /comments, with sort set to new, hot, top, or controversial and t setting the + * time range of top and controversial, default all) into data.user (id, username, + * display_name, bio, created_at, total, post, comment, awardee, and awarder karma, + * avatar and banner URLs, and verified, suspended, employee, moderator, premium, + * and NSFW flags), data.trophies (name, description, icon_url, granted_at, url), + * data.moderated_communities (name, title, url, subscriber_count, icon_url, + * is_nsfw), data.posts in the reddit-post shape, and data.comments, each with id, + * author, body as Markdown, score, posted_at, edited_at, url, subreddit, parent_id + * (null for a top-level comment), is_submitter, is_stickied, distinguished, + * award_count, and the post it was left on (id, title, url, author, is_nsfw). The + * overview tab returns both posts and comments; submitted returns null comments + * and comments returns null posts. limit caps the posts and comments together + * (default 100) and data.has_more says whether Reddit has more. Users who hide + * their activity return empty lists, and suspended accounts return their profile + * with null posts and comments. yelp-search accepts Yelp search URLs with + * find_desc and find_loc, reads start as the result offset, and returns up to 20 + * ranked organic businesses in data.businesses with total and pagination. + * yelp-reviews accepts a Yelp business URL (yelp.com/biz/{alias}), uses optional + * start for the offset, and always sorts newest first; unsupported sort and review + * filters are rejected, while tracking params are ignored. It returns up to 20 + * latest public reviews in data.reviews with business details and + * pagination.next_offset. Each review has rating, full text, updated_at, and + * author (id is the Yelp user id from the reviewer profile URL, url links to that + * profile, plus name, location, and review_count); owner replies and photos are + * not included. tripadvisor-reviews accepts a Tripadvisor hotel, restaurant, or + * attraction review URL (tripadvisor.com/Hotel_Review-g{geo}-d{id}-Reviews-….html, + * on any Tripadvisor country domain), reads -or{N}- in the path as the offset, and + * returns 20 reviews in data.reviews in the order Tripadvisor shows them, with + * data.location (id, name, type, url, review_count) and pagination.next_offset. + * Each review has id, url, title, full text, rating, language, published_at, + * visit_month, helpful_votes, subratings, photo_urls, owner_response (text, + * published_at, author_name), and author (id, username, name, url, + * contribution_count); an unknown location returns no reviews. emails accepts any + * page and returns its email addresses as data.emails ([{ email }]), read from + * mailto links, Cloudflare-protected addresses, and visible text. phone-numbers + * accepts any page and returns its valid phone numbers in E.164 as + * data.phone_numbers ([{ phone }]), read from tel links and visible text; numbers + * without a country code are read for the country of the site TLD, defaulting to + * US. links accepts any page and returns its unique http(s) links as data.links + * ([{ url, text }]), with absolute URLs; text falls back to aria-label or image + * alt and is null when a link has none. The emails parser reads the rendered page + * and respects content filters; the other prebuilt parsers read their data + * independently of DOM filters. + */ + parser: + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Use a prebuilt parser instead of custom rules. + */ + type: 'prebuilt'; + + /** + * google-maps-reviews and reddit parsers only. Maximum number of reviews + * (google-maps-reviews, default 100), comments (reddit-post, default 100), or + * results (reddit-search, reddit-subreddit, and reddit-user, default 100) to + * return; maximum 1000. + */ + limit?: number; + + /** + * google-maps-reviews only. Order of data.reviews. newest, relevant, highest, and + * lowest follow Google; oldest returns the earliest reviews first, which Google + * itself does not offer. + */ + sort?: 'newest' | 'oldest' | 'relevant' | 'highest' | 'lowest'; + } + + /** + * Product options. Requires formats.product: true. + */ + export interface ProductParams { + /** + * Drop visually duplicate product images, keeping the largest copy. + */ + dedupeImages?: boolean; + + /** + * @deprecated Ignored. The AI fallback runs automatically. + */ + useAIFallback?: boolean; + } + + /** + * Screenshot options. Requires formats.screenshot: true. + */ + export interface ScreenshotParams { + /** + * What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40 + * megapixels. + */ + area?: 'viewport' | 'fullPage' | ScreenshotParams.Element | ScreenshotParams.Rectangle; + + /** + * Image format for the screenshot. + */ + format?: 'png' | 'jpeg' | 'webp'; + } + + export namespace ScreenshotParams { + export interface Element { + /** + * CSS selector matching exactly one visible element. + */ + selector: string; + } + + /** + * Pixels from the document origin. + */ + export interface Rectangle { + /** + * Height of the capture in pixels. + */ + height: number; + + /** + * Width of the capture in pixels. + */ + width: number; + + /** + * Left edge of the capture, in pixels from the document origin. + */ + x: number; + + /** + * Top edge of the capture, in pixels from the document origin. + */ + y: number; + } + } + + /** + * Browser and content settings shared by all outputs. + */ + export interface SharedParams { + /** + * Browser steps run in order before capture. Requires a paid plan. Skips the + * cache. + */ + actions?: Array< + SharedParams.Perform | SharedParams.Scroll | SharedParams.Wait | SharedParams.WaitFor + >; + + /** + * Proxy country as a two-letter code, such as `US`. Case-insensitive. + */ + country?: string; + + /** + * Accept cookie banners before actions and capture. + */ + dismissCookies?: boolean; + + /** + * Close other popups before actions and capture. + */ + dismissPopups?: boolean; + + /** + * Remove elements matching these CSS selectors. Overrides `includeSelectors`. + */ + excludeSelectors?: Array; + + /** + * HTTP headers to send to the target site. Requests with headers skip the cache. + */ + headers?: { [key: string]: string }; /** - * Wait briefly for CSS and transition animations to settle before extraction, on - * pages that render in a browser. + * Include iframe content in HTML and text outputs. Screenshots always show visible + * frames. + */ + includeFrames?: boolean; + + /** + * Keep only elements matching these CSS selectors. + */ + includeSelectors?: Array; + + /** + * Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`. + */ + mainContentOnly?: boolean; + + /** + * Document parsing options. + */ + parsers?: SharedParams.Parsers; + + /** + * Create or reuse an authenticated browser profile. Requires a paid plan and an + * HTTPS target. Profiles persist session state, bypass shared caches, and cannot + * be combined with ZDR, custom headers, raw bytes, or prebuilt parsers. + */ + profile?: SharedParams.Existing | SharedParams.New; + + /** + * Wait for CSS animations to finish before capture. Defaults to `true` when + * `screenshot` is requested. */ settleAnimations?: boolean; /** - * Return the main content without navigation or footers. + * Emulate a light or dark color scheme. */ - useMainContentOnly?: boolean; + theme?: 'light' | 'dark'; /** - * How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. */ - waitForMs?: number; + viewport?: SharedParams.Viewport; + + /** + * Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500 + * (2000 with frames or XML). + */ + waitFor?: number | string; } - export namespace Options { - /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. - */ - export interface Pdf { + export namespace SharedParams { + export interface Perform { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + type: 'perform'; + } + + export interface Scroll { + /** + * Use `scroll` to move through the page or a container. + */ + type: 'scroll'; + + /** + * Distance per scroll: pixels, one `viewport`, or `max` to reach the end. + */ + amount?: number | 'viewport' | 'max'; + + /** + * Direction to scroll. + */ + direction?: 'down' | 'up' | 'left' | 'right'; + + /** + * Maximum number of scroll steps for this action. + */ + maxScrolls?: number; + + /** + * Scroll this container. Omit to scroll the page. + */ + selector?: string; + } + + export interface Wait { + /** + * Time to pause in milliseconds before the next action. + */ + milliseconds: number; + + /** + * Use `wait` to pause for a fixed duration. + */ + type: 'wait'; + } + + export interface WaitFor { + /** + * CSS selector to wait for before continuing. + */ + selector: string; + + /** + * Use `waitFor` to wait for a matching element. + */ + type: 'waitFor'; + } + + /** + * Document parsing options. + */ + export interface Parsers { + /** + * PDF page range and OCR. + */ + pdf?: Parsers.Pdf; + } + + export namespace Parsers { + /** + * PDF page range and OCR. + */ + export interface Pdf { + /** + * Last page to parse. Must be at least `startPage`. + */ + endPage?: number; + + /** + * Start each page in the Markdown with a `` line using its original + * 1-based page number; these responses are never served from cache. + */ + includeNumberedPages?: boolean; + + /** + * Set `auto` to read scanned pages with OCR. + */ + ocr?: 'off' | 'auto'; + + /** + * First page to parse, starting at 1. + */ + startPage?: number; + } + } + + export interface Existing { + /** + * The ID returned in profile.id by an earlier scrape. + */ + profileId: string; + + /** + * Reuse a saved browser profile. + */ + type: 'existing'; + } + + export interface New { + /** + * Username or email for the target website. + */ + identifier: string; + + /** + * Password used to sign in. It is never stored in the profile. + */ + password: string; + /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Sign in and create a browser profile. */ - end?: number; + type: 'new'; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * Optional label shown when listing profiles with `GET /org/browser/profiles`. */ - ocr?: boolean; + description?: string; + } + /** + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. + */ + export interface Viewport { /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * Browser viewport height in pixels. */ - shouldParse?: boolean; + height?: number; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * Browser viewport width in pixels. */ - start?: number; + width?: number; } } + + /** + * Deadline for each page, using the same behavior and defaults as POST + * /web/scrape. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. + */ + behavior?: 'fail' | 'return-partial'; + } } } @@ -2055,7 +4465,7 @@ export namespace BatchSubmitParams { /** * Crawl source and output format. */ - data: Crawl.Markdown | Crawl.HTML; + data: Crawl.Markdown | Crawl.HTML | Crawl.BatchUnifiedCrawlData; /** * Discover and scrape pages from `data.source`. @@ -2065,7 +4475,7 @@ export namespace BatchSubmitParams { export namespace Crawl { /** - * Crawl pages and return Markdown. + * @deprecated Crawl pages and return Markdown. */ export interface Markdown { /** @@ -2110,23 +4520,112 @@ export namespace BatchSubmitParams { * Limits and filters for page discovery. */ export interface Controls { + /** + * Regex pattern for URLs to exclude, even when they match `regex`. The `start_url` + * itself is always included. + */ + excludeRegex?: string; + /** * Follow links to subdomains. */ followSubdomains?: boolean; + /** + * Only follow pages in these languages, or `same_as_start_url`; all languages when + * omitted. + */ + languages?: + | 'same_as_start_url' + | Array< + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' + >; + /** * Maximum link depth. Source pages are depth 0. No limit when omitted. */ maxDepth?: number; /** - * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. */ maxUrls?: number; /** - * RE2 pattern for URLs to include. The `start_url` itself is always included. + * Regex pattern for URLs to include. The `start_url` itself is always included. */ regex?: string; } @@ -2162,12 +4661,26 @@ export namespace BatchSubmitParams { */ export interface Controls { /** - * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + * Path fragments that skip a sitemap URL in a crawl. Works separately from any + * regex inclusion or exclusion you define. Defaults to + * ["/feed","/rss","/atom","/api/","/cdn-cgi/","/_next/","/__"]. Pass `[]` to keep + * every listed URL. + */ + excludePaths?: Array; + + /** + * Regex pattern; sitemap URLs matching it are not scraped, even when they match + * `regex`. + */ + excludeRegex?: string; + + /** + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. */ maxUrls?: number; /** - * RE2 pattern; only sitemap URLs matching it are scraped. + * Regex pattern; only sitemap URLs matching it are scraped. */ regex?: string; } @@ -2178,8 +4691,7 @@ export namespace BatchSubmitParams { */ export interface Options { /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -2394,51 +4906,53 @@ export namespace BatchSubmitParams { excludeSelectors?: Array | null; /** - * Also include each page's HTML in its result record, as an `html` field alongside - * the Markdown. + * Also return each page's HTML in `html`. */ includeHTML?: boolean; /** - * Include image references in the Markdown. + * Include image references in the Markdown (`html-conversion` only). */ includeImages?: boolean; /** - * Include links in the Markdown. + * Include links in the Markdown (`html-conversion` only). */ includeLinks?: boolean; /** - * Keep only the subtrees matching these CSS selectors. Filtered pages are always - * fetched fresh, ignoring `maxAgeMs`. + * Keep only elements matching these CSS selectors. Filtered pages ignore + * `maxAgeMs`. */ includeSelectors?: Array | null; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1 + * year (31536000000 ms). `0` fetches fresh. */ maxAgeMs?: number | null; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ pdf?: Options.Pdf; /** - * Wait briefly for CSS and transition animations to settle before extraction, on - * pages that render in a browser. + * Wait for CSS animations to finish before extracting, on browser-rendered pages. */ settleAnimations?: boolean; /** - * Shorten inline base64 image data. + * Shorten inline base64 image data (`html-conversion` only). */ shortenBase64Images?: boolean; + /** + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. + */ + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; + /** * Return the main content without navigation or footers. */ @@ -2452,32 +4966,27 @@ export namespace BatchSubmitParams { export namespace Options { /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ export interface Pdf { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. */ end?: number; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * Read scanned PDF pages with OCR; preserve pages that already have text. */ ocr?: boolean; /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`. */ shouldParse?: boolean; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * First 1-based PDF page to parse. */ start?: number; } @@ -2485,7 +4994,7 @@ export namespace BatchSubmitParams { } /** - * Crawl pages and return HTML. + * @deprecated Crawl pages and return HTML. */ export interface HTML { /** @@ -2530,23 +5039,112 @@ export namespace BatchSubmitParams { * Limits and filters for page discovery. */ export interface Controls { + /** + * Regex pattern for URLs to exclude, even when they match `regex`. The `start_url` + * itself is always included. + */ + excludeRegex?: string; + /** * Follow links to subdomains. */ followSubdomains?: boolean; + /** + * Only follow pages in these languages, or `same_as_start_url`; all languages when + * omitted. + */ + languages?: + | 'same_as_start_url' + | Array< + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' + >; + /** * Maximum link depth. Source pages are depth 0. No limit when omitted. */ maxDepth?: number; /** - * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. */ maxUrls?: number; /** - * RE2 pattern for URLs to include. The `start_url` itself is always included. + * Regex pattern for URLs to include. The `start_url` itself is always included. */ regex?: string; } @@ -2582,12 +5180,26 @@ export namespace BatchSubmitParams { */ export interface Controls { /** - * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000. + * Path fragments that skip a sitemap URL in a crawl. Works separately from any + * regex inclusion or exclusion you define. Defaults to + * ["/feed","/rss","/atom","/api/","/cdn-cgi/","/_next/","/__"]. Pass `[]` to keep + * every listed URL. + */ + excludePaths?: Array; + + /** + * Regex pattern; sitemap URLs matching it are not scraped, even when they match + * `regex`. + */ + excludeRegex?: string; + + /** + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. */ maxUrls?: number; /** - * RE2 pattern; only sitemap URLs matching it are scraped. + * Regex pattern; only sitemap URLs matching it are scraped. */ regex?: string; } @@ -2598,8 +5210,7 @@ export namespace BatchSubmitParams { */ export interface Options { /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -2808,81 +5419,1031 @@ export namespace BatchSubmitParams { | 'zw'; /** - * Remove elements matching these CSS selectors. Applied after `includeSelectors`, - * so an element matching both is removed. + * Remove elements matching these CSS selectors. Applied after `includeSelectors`, + * so an element matching both is removed. + */ + excludeSelectors?: Array | null; + + /** + * Keep only elements matching these CSS selectors. Filtered pages ignore + * `maxAgeMs`. + */ + includeSelectors?: Array | null; + + /** + * Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1 + * year (31536000000 ms). `0` fetches fresh. + */ + maxAgeMs?: number | null; + + /** + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. + */ + pdf?: Options.Pdf; + + /** + * Wait for CSS animations to finish before extracting, on browser-rendered pages. + */ + settleAnimations?: boolean; + + /** + * Return the main content without navigation or footers. + */ + useMainContentOnly?: boolean; + + /** + * How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + */ + waitForMs?: number; + } + + export namespace Options { + /** + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. + */ + export interface Pdf { + /** + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. + */ + end?: number; + + /** + * Read scanned PDF pages with OCR; preserve pages that already have text. + */ + ocr?: boolean; + + /** + * Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`. + */ + shouldParse?: boolean; + + /** + * First 1-based PDF page to parse. + */ + start?: number; + } + } + } + + /** + * Use the same formats and parameters as POST /web/scrape, replacing url with + * source. Options apply to every page. + */ + export interface BatchUnifiedCrawlData { + /** + * Outputs to return. Set at least one to `true`. + */ + formats: BatchUnifiedCrawlData.Formats; + + /** + * How to find pages to crawl. + */ + source: BatchUnifiedCrawlData.StartURL | BatchUnifiedCrawlData.Sitemap; + + /** + * Requires `formats.highlights: true`; required when it is set. + */ + highlightsParams?: BatchUnifiedCrawlData.HighlightsParams; + + /** + * Image options. Requires formats.images: true. + */ + imageParams?: BatchUnifiedCrawlData.ImageParams; + + /** + * Requires `formats.json: true`; required when it is set. + */ + jsonParams?: BatchUnifiedCrawlData.JsonParams; + + /** + * Markdown options. Requires `formats.markdown`. + */ + markdownParams?: BatchUnifiedCrawlData.MarkdownParams; + + /** + * Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to + * 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). + */ + maxAgeMs?: number; + + /** + * Requires `formats.parse: true`; required when it is set. + */ + parseParams?: BatchUnifiedCrawlData.CustomParser | BatchUnifiedCrawlData.PrebuiltParser; + + /** + * Product options. Requires formats.product: true. + */ + productParams?: BatchUnifiedCrawlData.ProductParams; + + /** + * Screenshot options. Requires formats.screenshot: true. + */ + screenshotParams?: BatchUnifiedCrawlData.ScreenshotParams; + + /** + * Browser and content settings shared by all outputs. + */ + sharedParams?: BatchUnifiedCrawlData.SharedParams; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + + /** + * Deadline for each page, using the same behavior and defaults as POST + * /web/scrape. + */ + timeoutOpts?: BatchUnifiedCrawlData.TimeoutOpts; + + /** + * Batches persist their results. Only disabled is supported; enabled returns + * ZDR_NOT_SUPPORTED. + */ + zdr?: 'disabled'; + } + + export namespace BatchUnifiedCrawlData { + /** + * Outputs to return. Set at least one to `true`. + */ + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } + + /** + * Discover pages by following links from one URL. + */ + export interface StartURL { + /** + * Start from one page. + */ + type: 'start_url'; + + /** + * Page where crawling begins. A URL without a scheme is read as https://. + */ + url: string; + + /** + * Limits and filters for page discovery. + */ + controls?: StartURL.Controls; + } + + export namespace StartURL { + /** + * Limits and filters for page discovery. + */ + export interface Controls { + /** + * Regex pattern for URLs to exclude, even when they match `regex`. The `start_url` + * itself is always included. + */ + excludeRegex?: string; + + /** + * Follow links to subdomains. + */ + followSubdomains?: boolean; + + /** + * Only follow pages in these languages, or `same_as_start_url`; all languages when + * omitted. + */ + languages?: + | 'same_as_start_url' + | Array< + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' + >; + + /** + * Maximum link depth. Source pages are depth 0. No limit when omitted. + */ + maxDepth?: number; + + /** + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. + */ + maxUrls?: number; + + /** + * Regex pattern for URLs to include. The `start_url` itself is always included. + */ + regex?: string; + } + } + + /** + * Scrape the pages listed in a domain's sitemap. Links on those pages are not + * followed. + */ + export interface Sitemap { + /** + * Domain whose sitemap lists the pages to scrape. A full URL is reduced to its + * domain. + */ + domain: string; + + /** + * Scrape the URLs in the domain's sitemap. + */ + type: 'sitemap'; + + /** + * Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + * URLs and never follows links off them, so there is no crawl depth here. + */ + controls?: Sitemap.Controls; + } + + export namespace Sitemap { + /** + * Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those + * URLs and never follows links off them, so there is no crawl depth here. + */ + export interface Controls { + /** + * Path fragments that skip a sitemap URL in a crawl. Works separately from any + * regex inclusion or exclusion you define. Defaults to + * ["/feed","/rss","/atom","/api/","/cdn-cgi/","/_next/","/__"]. Pass `[]` to keep + * every listed URL. + */ + excludePaths?: Array; + + /** + * Regex pattern; sitemap URLs matching it are not scraped, even when they match + * `regex`. + */ + excludeRegex?: string; + + /** + * Maximum pages to fetch. Unused reserved credits are refunded. Maximum 100000. + */ + maxUrls?: number; + + /** + * Regex pattern; only sitemap URLs matching it are scraped. + */ + regex?: string; + } + } + + /** + * Requires `formats.highlights: true`; required when it is set. + */ + export interface HighlightsParams { + /** + * The question or topic to find passages for. */ - excludeSelectors?: Array | null; + query: string; /** - * Keep only the subtrees matching these CSS selectors. Filtered pages are always - * fetched fresh, ignoring `maxAgeMs`. + * Maximum combined length of returned passages. */ - includeSelectors?: Array | null; + maxCharacters?: number; + } + /** + * Image options. Requires formats.images: true. + */ + export interface ImageParams { /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Set `visual` to drop visual duplicates, keeping the largest copy. */ - maxAgeMs?: number | null; + dedupe?: 'none' | 'visual'; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * Extra data per image: `dimensions`, `classification`, or a hosted `file` URL. */ - pdf?: Options.Pdf; + enrich?: Array<'dimensions' | 'classification' | 'file'>; + } + + /** + * Requires `formats.json: true`; required when it is set. + */ + export interface JsonParams { + /** + * JSON Schema (not an example object) for a top-level object, up to 50 KB. Use + * optional or nullable fields for missing facts. + */ + schema: { [key: string]: unknown }; + + /** + * Extra guidance, such as which facts to prefer or how to read a field. + */ + instructions?: string; + } + + /** + * Markdown options. Requires `formats.markdown`. + */ + export interface MarkdownParams { + /** + * Include images in the Markdown (`html-conversion` only). + */ + includeImages?: boolean; + + /** + * Keep link URLs in the Markdown (`html-conversion` only). + */ + includeLinks?: boolean; + + /** + * How base64 images appear when `includeImages` is set (`html-conversion` only). + */ + inlineImages?: 'placeholder' | 'preserve'; + + /** + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. + */ + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; + } + + export interface CustomParser { + /** + * Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100 + * fields, 5 levels. + */ + rules: { [key: string]: string | CustomParser.UnionMember1 }; + + /** + * Extract fields using custom CSS rules. This is the default when type is omitted. + */ + type?: 'custom'; + } + + export namespace CustomParser { + export interface UnionMember1 { + /** + * CSS selector to match within the current page or parent rule. + */ + selector: string; + + /** + * Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults + * to text. + */ + output?: 'text' | 'html' | string | unknown; + + /** + * Return the first match with `item` or all matches with `list`. + */ + type?: 'item' | 'list'; + } + } + + export interface PrebuiltParser { + /** + * google-maps parses Google Maps business data into data.results. Accepts Maps + * place, search, and internal data URLs. Uses a US exit and English labels + * regardless of hl or Accept-Language. google-maps-reviews returns the reviews of + * a place in data.reviews, in the same shape as the Serper reviews API (rating, + * date, isoDate, snippet, translatedSnippet, likes, user, media, response, link, + * id), plus language, guided ratings in details, and user.isLocalGuide; data also + * carries the place featureId, cid, and sort. sort and limit pick the order and + * count, and oldest is exact. It accepts Maps place, search, and ?cid= URLs, plus + * search.google.com/local/reviews URLs, so the google_maps_url and + * google_reviews_url fields of google-maps results work as input. An unknown place + * returns no reviews. google-play parses a Play Store app into data: details, + * developer contact, ratings, price, permissions, and data safety. + * google-play-reviews returns the 200 newest reviews of the app, with developer + * replies, in data.reviews. Both Play parsers accept app details URLs + * (play.google.com/store/apps/details?id=…); hl and gl set the language and + * storefront, defaulting to en and us. app-store parses an App Store app into + * data: details, developer, ratings, price, version, and screenshots. + * app-store-reviews returns up to the 500 newest reviews in data.reviews. Both App + * Store parsers accept app URLs (apps.apple.com/us/app/…/id…); the country in the + * path sets the storefront, defaulting to us. g2-reviews returns the 25 most + * recently published reviews of a G2 product in data.reviews (rating, title, + * likes, dislikes, problems_solved, reviewer role, company size, and industry), + * plus data.product. It accepts G2 product URLs (g2.com/products/…), follows + * renamed products, and keeps star-rating filters from the URL + * (filters[nps_score][]=1 to 5); other filters, sort orders, and pages are + * ignored. instagram-profile parses a public profile (instagram.com/{username}) + * into data: bio, links, follower and post counts, category, business address, + * similar_accounts, and latest_posts (up to the 12 posts at the top of the + * profile, newest first). Instagram lists pinned posts there ahead of newer ones, + * so posts with is_pinned true can be older; when Instagram shows only a rounded + * post count (32K), post_count is that rounded number and is_post_count_rounded is + * true. instagram-post parses a post or reel (/p/…, /reel/…) into data: caption, + * hashtags, mentions, like, comment, and view counts (like_count and view_count + * are null when the owner hides them), media URLs, tagged users, collaborators, + * location, and the top ~14 comments in data.comments. instagram-feed returns the + * top posts for a hashtag or keyword (/explore/tags/…, /popular/…) or the recent + * posts at a location (/explore/locations/{id}/…) in data.posts; keyword posts + * carry only the shortcode, owner, thumbnail, and views, plus the caption when + * Instagram shows it. All three Instagram parsers read public data without logging + * in, so private accounts return no posts and follower lists are unavailable. + * tiktok-profile parses a public profile (tiktok.com/@{username}) into data: + * nickname, bio, bio link, follower, following, like, and video counts, verified, + * private, and business flags, and business category; it does not list videos. + * tiktok-video parses a video or photo post (/@{username}/video/{id} or + * /@{username}/photo/{id}) into data: caption, hashtags, mentions, author, view, + * like, comment, share, save, and repost counts, duration, thumbnail, a video_url + * that downloads without cookies, image_urls for photo posts, music, location, and + * ad, paid-partnership, and AI-generated flags. tiktok-feed returns videos in the + * tiktok-video shape as data.videos: the latest 15 from a profile URL, the top 30 + * from a hashtag URL (/tag/{name}), or the top 12 from a search URL + * (/search?q={query}). tiktok-comments returns the first 20 comments of a video or + * photo post as data.comments: text, posted_at, like and reply counts, whether the + * author liked it, and the commenter. tiktok-followers and tiktok-following return + * up to 30 accounts of a profile as data.users, in the tiktok-profile shape. + * tiktok-user-search returns the top 10 accounts for a user search URL + * (/search/user?q={query}) as data.users: id, username, nickname, biography, + * avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok + * parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short + * links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). reddit-post parses a post + * (reddit.com/r/{subreddit}/comments/{id}, reddit.com/comments/{id}, or + * redd.it/{id}) into data.post: title, body as Markdown, type (text, link, image, + * gallery, or video), link_url, subreddit, author, flairs, score, upvote_ratio, + * comment and crosspost counts, NSFW, spoiler, locked, stickied, and archived + * flags, images (every gallery image in order), and video (an MP4 url plus an + * hls_url that carries the audio). data.comments holds the comment tree, each + * comment with id, author, body as Markdown, score, posted_at, depth, parent_id, + * url, is_submitter, is_deleted, and its replies; limit caps the total number of + * comments (default 100), filled shallowest first so whole conversations are kept, + * and data.has_more_comments says whether the thread has more. The sort query of + * the URL (best, top, new, controversial, old, qa) orders the comments. + * reddit-search returns search results for a search URL + * (reddit.com/search?q={query}, or reddit.com/r/{subreddit}/search?q={query} to + * search one subreddit). With type=link or no type it returns posts in the + * reddit-post shape as data.posts, ordered by the sort (relevance, hot, top, new, + * comments) and limited to the t time range (hour, day, week, month, year, all) of + * the URL; type=sr returns communities as data.communities (name, title, + * description, sidebar, subscriber_count, created_at, type, NSFW and quarantine + * flags, language, category, icon and banner URLs, and allowed post types); + * type=user returns accounts as data.users (username, display_name, bio, + * created_at, post and comment karma, avatar and banner URLs, and verified, + * employee, moderator, premium, and NSFW flags). limit caps the number of results + * (default 100), in the order Reddit returns them, and data.has_more says whether + * Reddit has more. reddit-subreddit reads a subreddit URL + * (reddit.com/r/{subreddit}, optionally followed by /hot, /new, /top, /rising, or + * /controversial, with t setting the time range of top and controversial, default + * day) into data.subreddit in the community shape of reddit-search, data.rules + * (name, description, applies_to, violation_reason, created_at), and data.posts in + * the reddit-post shape, ordered like the tab (default hot) and with stickied + * posts flagged; r/all and r/popular return posts with a null subreddit and rules. + * limit caps the posts (default 100) and data.has_more says whether Reddit has + * more. Private and quarantined subreddits return WEBSITE_ACCESS_ERROR. + * reddit-user reads a profile URL (reddit.com/user/{username} or + * reddit.com/u/{username}, optionally followed by /overview, /submitted, or + * /comments, with sort set to new, hot, top, or controversial and t setting the + * time range of top and controversial, default all) into data.user (id, username, + * display_name, bio, created_at, total, post, comment, awardee, and awarder karma, + * avatar and banner URLs, and verified, suspended, employee, moderator, premium, + * and NSFW flags), data.trophies (name, description, icon_url, granted_at, url), + * data.moderated_communities (name, title, url, subscriber_count, icon_url, + * is_nsfw), data.posts in the reddit-post shape, and data.comments, each with id, + * author, body as Markdown, score, posted_at, edited_at, url, subreddit, parent_id + * (null for a top-level comment), is_submitter, is_stickied, distinguished, + * award_count, and the post it was left on (id, title, url, author, is_nsfw). The + * overview tab returns both posts and comments; submitted returns null comments + * and comments returns null posts. limit caps the posts and comments together + * (default 100) and data.has_more says whether Reddit has more. Users who hide + * their activity return empty lists, and suspended accounts return their profile + * with null posts and comments. yelp-search accepts Yelp search URLs with + * find_desc and find_loc, reads start as the result offset, and returns up to 20 + * ranked organic businesses in data.businesses with total and pagination. + * yelp-reviews accepts a Yelp business URL (yelp.com/biz/{alias}), uses optional + * start for the offset, and always sorts newest first; unsupported sort and review + * filters are rejected, while tracking params are ignored. It returns up to 20 + * latest public reviews in data.reviews with business details and + * pagination.next_offset. Each review has rating, full text, updated_at, and + * author (id is the Yelp user id from the reviewer profile URL, url links to that + * profile, plus name, location, and review_count); owner replies and photos are + * not included. tripadvisor-reviews accepts a Tripadvisor hotel, restaurant, or + * attraction review URL (tripadvisor.com/Hotel_Review-g{geo}-d{id}-Reviews-….html, + * on any Tripadvisor country domain), reads -or{N}- in the path as the offset, and + * returns 20 reviews in data.reviews in the order Tripadvisor shows them, with + * data.location (id, name, type, url, review_count) and pagination.next_offset. + * Each review has id, url, title, full text, rating, language, published_at, + * visit_month, helpful_votes, subratings, photo_urls, owner_response (text, + * published_at, author_name), and author (id, username, name, url, + * contribution_count); an unknown location returns no reviews. emails accepts any + * page and returns its email addresses as data.emails ([{ email }]), read from + * mailto links, Cloudflare-protected addresses, and visible text. phone-numbers + * accepts any page and returns its valid phone numbers in E.164 as + * data.phone_numbers ([{ phone }]), read from tel links and visible text; numbers + * without a country code are read for the country of the site TLD, defaulting to + * US. links accepts any page and returns its unique http(s) links as data.links + * ([{ url, text }]), with absolute URLs; text falls back to aria-label or image + * alt and is null when a link has none. The emails parser reads the rendered page + * and respects content filters; the other prebuilt parsers read their data + * independently of DOM filters. + */ + parser: + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Use a prebuilt parser instead of custom rules. + */ + type: 'prebuilt'; + + /** + * google-maps-reviews and reddit parsers only. Maximum number of reviews + * (google-maps-reviews, default 100), comments (reddit-post, default 100), or + * results (reddit-search, reddit-subreddit, and reddit-user, default 100) to + * return; maximum 1000. + */ + limit?: number; + + /** + * google-maps-reviews only. Order of data.reviews. newest, relevant, highest, and + * lowest follow Google; oldest returns the earliest reviews first, which Google + * itself does not offer. + */ + sort?: 'newest' | 'oldest' | 'relevant' | 'highest' | 'lowest'; + } + + /** + * Product options. Requires formats.product: true. + */ + export interface ProductParams { + /** + * Drop visually duplicate product images, keeping the largest copy. + */ + dedupeImages?: boolean; + + /** + * @deprecated Ignored. The AI fallback runs automatically. + */ + useAIFallback?: boolean; + } + + /** + * Screenshot options. Requires formats.screenshot: true. + */ + export interface ScreenshotParams { + /** + * What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40 + * megapixels. + */ + area?: 'viewport' | 'fullPage' | ScreenshotParams.Element | ScreenshotParams.Rectangle; + + /** + * Image format for the screenshot. + */ + format?: 'png' | 'jpeg' | 'webp'; + } + + export namespace ScreenshotParams { + export interface Element { + /** + * CSS selector matching exactly one visible element. + */ + selector: string; + } + + /** + * Pixels from the document origin. + */ + export interface Rectangle { + /** + * Height of the capture in pixels. + */ + height: number; + + /** + * Width of the capture in pixels. + */ + width: number; + + /** + * Left edge of the capture, in pixels from the document origin. + */ + x: number; + + /** + * Top edge of the capture, in pixels from the document origin. + */ + y: number; + } + } + + /** + * Browser and content settings shared by all outputs. + */ + export interface SharedParams { + /** + * Browser steps run in order before capture. Requires a paid plan. Skips the + * cache. + */ + actions?: Array< + SharedParams.Perform | SharedParams.Scroll | SharedParams.Wait | SharedParams.WaitFor + >; + + /** + * Proxy country as a two-letter code, such as `US`. Case-insensitive. + */ + country?: string; + + /** + * Accept cookie banners before actions and capture. + */ + dismissCookies?: boolean; + + /** + * Close other popups before actions and capture. + */ + dismissPopups?: boolean; + + /** + * Remove elements matching these CSS selectors. Overrides `includeSelectors`. + */ + excludeSelectors?: Array; + + /** + * HTTP headers to send to the target site. Requests with headers skip the cache. + */ + headers?: { [key: string]: string }; + + /** + * Include iframe content in HTML and text outputs. Screenshots always show visible + * frames. + */ + includeFrames?: boolean; + + /** + * Keep only elements matching these CSS selectors. + */ + includeSelectors?: Array; + + /** + * Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`. + */ + mainContentOnly?: boolean; + + /** + * Document parsing options. + */ + parsers?: SharedParams.Parsers; /** - * Wait briefly for CSS and transition animations to settle before extraction, on - * pages that render in a browser. + * Create or reuse an authenticated browser profile. Requires a paid plan and an + * HTTPS target. Profiles persist session state, bypass shared caches, and cannot + * be combined with ZDR, custom headers, raw bytes, or prebuilt parsers. + */ + profile?: SharedParams.Existing | SharedParams.New; + + /** + * Wait for CSS animations to finish before capture. Defaults to `true` when + * `screenshot` is requested. */ settleAnimations?: boolean; /** - * Return the main content without navigation or footers. + * Emulate a light or dark color scheme. */ - useMainContentOnly?: boolean; + theme?: 'light' | 'dark'; /** - * How long to wait after initial page load, in milliseconds. `0` waits 500 ms. + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. */ - waitForMs?: number; + viewport?: SharedParams.Viewport; + + /** + * Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500 + * (2000 with frames or XML). + */ + waitFor?: number | string; } - export namespace Options { + export namespace SharedParams { + export interface Perform { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + type: 'perform'; + } + + export interface Scroll { + /** + * Use `scroll` to move through the page or a container. + */ + type: 'scroll'; + + /** + * Distance per scroll: pixels, one `viewport`, or `max` to reach the end. + */ + amount?: number | 'viewport' | 'max'; + + /** + * Direction to scroll. + */ + direction?: 'down' | 'up' | 'left' | 'right'; + + /** + * Maximum number of scroll steps for this action. + */ + maxScrolls?: number; + + /** + * Scroll this container. Omit to scroll the page. + */ + selector?: string; + } + + export interface Wait { + /** + * Time to pause in milliseconds before the next action. + */ + milliseconds: number; + + /** + * Use `wait` to pause for a fixed duration. + */ + type: 'wait'; + } + + export interface WaitFor { + /** + * CSS selector to wait for before continuing. + */ + selector: string; + + /** + * Use `waitFor` to wait for a matching element. + */ + type: 'waitFor'; + } + /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * Document parsing options. */ - export interface Pdf { + export interface Parsers { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * PDF page range and OCR. */ - end?: number; + pdf?: Parsers.Pdf; + } + export namespace Parsers { /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * PDF page range and OCR. */ - ocr?: boolean; + export interface Pdf { + /** + * Last page to parse. Must be at least `startPage`. + */ + endPage?: number; + + /** + * Start each page in the Markdown with a `` line using its original + * 1-based page number; these responses are never served from cache. + */ + includeNumberedPages?: boolean; + + /** + * Set `auto` to read scanned pages with OCR. + */ + ocr?: 'off' | 'auto'; + + /** + * First page to parse, starting at 1. + */ + startPage?: number; + } + } + export interface Existing { /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * The ID returned in profile.id by an earlier scrape. */ - shouldParse?: boolean; + profileId: string; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * Reuse a saved browser profile. */ - start?: number; + type: 'existing'; + } + + export interface New { + /** + * Username or email for the target website. + */ + identifier: string; + + /** + * Password used to sign in. It is never stored in the profile. + */ + password: string; + + /** + * Sign in and create a browser profile. + */ + type: 'new'; + + /** + * Optional label shown when listing profiles with `GET /org/browser/profiles`. + */ + description?: string; + } + + /** + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. + */ + export interface Viewport { + /** + * Browser viewport height in pixels. + */ + height?: number; + + /** + * Browser viewport width in pixels. + */ + width?: number; } } + + /** + * Deadline for each page, using the same behavior and defaults as POST + * /web/scrape. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. + */ + behavior?: 'fail' | 'return-partial'; + } } } + + /** + * Where to send the batch's final-status event. Omit `retry` for one attempt; `{}` + * uses the default retry schedule. + */ + export interface Webhook { + /** + * Public HTTP(S) URL that receives batch completion, failure, or cancellation + * events. + */ + url: string; + + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; + } } export declare namespace Batch { diff --git a/src/resources/brand.ts b/src/resources/brand.ts index 73c289b4..e8b2844b 100644 --- a/src/resources/brand.ts +++ b/src/resources/brand.ts @@ -6,11 +6,8 @@ import { RequestOptions } from '../internal/request-options'; export class Brand extends APIResource { /** - * Retrieve logos, backdrops, colors, industry, description, and more. Provide - * exactly one lookup identifier in the request body: a domain, company name, email - * address, stock ticker, transaction descriptor, or direct URL. Note: - * `by_direct_url` fetches brand data only from the provided URL — not from the - * entire internet. + * Retrieve logos, colors, company details, and social links using one lookup + * identifier. A direct URL limits extraction to that page. * * @example * ```ts @@ -25,26 +22,10 @@ export class Brand extends APIResource { } /** - * Returns a simplified version of brand data containing only essential - * information: domain, title, colors, logos, and backdrops. Optimized for faster - * responses and reduced data transfer. - * - * @example - * ```ts - * const response = await client.brand.retrieveSimplified({ - * domain: 'xxx', - * }); - * ``` - */ - retrieveSimplified( - query: BrandRetrieveSimplifiedParams, - options?: RequestOptions, - ): APIPromise { - return this._client.get('/brand/retrieve-simplified', { query, ...options }); - } - - /** - * Search indexed brands by name or domain + * Find up to 10 brands by name or domain, ordered by popularity. Optionally filter + * by country and primary language; both filters must match when provided together. + * Results include description, country, and language when available. Use the + * returned domain to retrieve a full brand profile. * * @example * ```ts @@ -58,53 +39,44 @@ export class Brand extends APIResource { export interface BrandRetrieveResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Detailed brand information */ - cache_metadata: BrandRetrieveResponse.CacheMetadata; + brand: BrandRetrieveResponse.Brand; /** - * Detailed brand information + * Whether this response came from cache. */ - brand?: BrandRetrieveResponse.Brand; + cache_metadata: BrandRetrieveResponse.CacheMetadata; /** * HTTP status code */ - code?: number; + code: number; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - key_metadata?: BrandRetrieveResponse.KeyMetadata; + request_id: string; /** - * Status of the response, e.g., 'ok' + * Always `ok` on success. */ - status?: string; -} + status: string; -export namespace BrandRetrieveResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Credits this request used and your remaining balance. */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; + key_metadata?: BrandRetrieveResponse.KeyMetadata; - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } + /** + * True when the timeout ended processing and this response contains the usable + * data completed so far. Unfinished fields are omitted. + */ + partial?: boolean; +} +export namespace BrandRetrieveResponse { /** * Detailed brand information */ @@ -172,7 +144,7 @@ export namespace BrandRetrieveResponse { phone?: string; /** - * Language to force for the retrieved brand data. + * Language, e.g. `english`. */ primary_language?: | 'afrikaans' @@ -780,7 +752,7 @@ export namespace BrandRetrieveResponse { type?: 'icon' | 'logo'; /** - * CDN hosted url of the logo (ready for display) + * Hosted logo URL. */ url?: string; } @@ -880,57 +852,7 @@ export namespace BrandRetrieveResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; - - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } -} - -export interface BrandRetrieveSimplifiedResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: BrandRetrieveSimplifiedResponse.CacheMetadata; - - /** - * Simplified brand information - */ - brand?: BrandRetrieveSimplifiedResponse.Brand; - - /** - * HTTP status code of the response - */ - code?: number; - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: BrandRetrieveSimplifiedResponse.KeyMetadata; - - /** - * Status of the response, e.g., 'ok' - */ - status?: string; -} - -export namespace BrandRetrieveSimplifiedResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ export interface CacheMetadata { /** @@ -946,188 +868,28 @@ export namespace BrandRetrieveSimplifiedResponse { } /** - * Simplified brand information - */ - export interface Brand { - /** - * An array of backdrop images for the brand - */ - backdrops?: Array; - - /** - * An array of brand colors - */ - colors?: Array; - - /** - * The domain name of the brand - */ - domain?: string; - - /** - * An array of logos associated with the brand - */ - logos?: Array; - - /** - * The title or name of the brand - */ - title?: string; - } - - export namespace Brand { - export interface Backdrop { - /** - * Array of colors in the backdrop image - */ - colors?: Array; - - /** - * Resolution of the backdrop image - */ - resolution?: Backdrop.Resolution; - - /** - * URL of the backdrop image - */ - url?: string; - } - - export namespace Backdrop { - export interface Color { - /** - * Color in hexadecimal format - */ - hex?: string; - - /** - * Name of the color - */ - name?: string; - } - - /** - * Resolution of the backdrop image - */ - export interface Resolution { - /** - * Aspect ratio of the image (width/height) - */ - aspect_ratio?: number; - - /** - * Height of the image in pixels - */ - height?: number; - - /** - * Width of the image in pixels - */ - width?: number; - } - } - - export interface Color { - /** - * Color in hexadecimal format - */ - hex?: string; - - /** - * Name of the color - */ - name?: string; - - /** - * Where the color was observed: 'site' colors come from the website's own theme - * signals (rendered page colors, manifest, theme-color meta), 'logo' colors from - * logo image pixels. - */ - source?: 'site' | 'logo'; - } - - export interface Logo { - /** - * Array of colors in the logo - */ - colors?: Array; - - /** - * Indicates when this logo is best used: 'light' = best for light mode, 'dark' = - * best for dark mode, 'has_opaque_background' = can be used for either as image - * has its own background - */ - mode?: 'light' | 'dark' | 'has_opaque_background'; - - /** - * Resolution of the logo image - */ - resolution?: Logo.Resolution; - - /** - * Type of the logo based on resolution (e.g., 'icon', 'logo') - */ - type?: 'icon' | 'logo'; - - /** - * CDN hosted url of the logo (ready for display) - */ - url?: string; - } - - export namespace Logo { - export interface Color { - /** - * Color in hexadecimal format - */ - hex?: string; - - /** - * Name of the color - */ - name?: string; - } - - /** - * Resolution of the logo image - */ - export interface Resolution { - /** - * Aspect ratio of the image (width/height) - */ - aspect_ratio?: number; - - /** - * Height of the image in pixels - */ - height?: number; - - /** - * Width of the image in pixels - */ - width?: number; - } - } - } - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } export interface BrandSearchResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Up to 10 matching brands, name matches first, then domain matches, most popular * first within each group. Empty when nothing matches. @@ -1135,8 +897,7 @@ export interface BrandSearchResponse { results: Array; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: BrandSearchResponse.KeyMetadata; } @@ -1158,20 +919,403 @@ export namespace BrandSearchResponse { * The brand's name. Empty string when unknown. */ name: string; + + /** + * The brand's country, when available, as an uppercase ISO 3166-1 alpha-2 code. + */ + country?: + | 'AD' + | 'AE' + | 'AF' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AQ' + | 'AR' + | 'AS' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BY' + | 'BZ' + | 'CA' + | 'CC' + | 'CD' + | 'CF' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CU' + | 'CV' + | 'CW' + | 'CX' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FM' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HM' + | 'HN' + | 'HR' + | 'HT' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IR' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KP' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'LY' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MH' + | 'MK' + | 'ML' + | 'MM' + | 'MN' + | 'MO' + | 'MP' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NF' + | 'NG' + | 'NI' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PW' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RU' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SD' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SO' + | 'SR' + | 'SS' + | 'ST' + | 'SV' + | 'SX' + | 'SY' + | 'SZ' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'UM' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VE' + | 'VG' + | 'VI' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'YE' + | 'YT' + | 'ZA' + | 'ZM' + | 'ZW'; + + /** + * The brand's description, when available. + */ + description?: string; + + /** + * The brand's primary language, when available. + */ + language?: + | 'afrikaans' + | 'albanian' + | 'amharic' + | 'arabic' + | 'armenian' + | 'assamese' + | 'aymara' + | 'azeri' + | 'basque' + | 'belarusian' + | 'bengali' + | 'bosnian' + | 'bulgarian' + | 'burmese' + | 'cantonese' + | 'catalan' + | 'cebuano' + | 'chinese' + | 'corsican' + | 'croatian' + | 'czech' + | 'danish' + | 'dutch' + | 'english' + | 'esperanto' + | 'estonian' + | 'farsi' + | 'fijian' + | 'finnish' + | 'french' + | 'galician' + | 'georgian' + | 'german' + | 'greek' + | 'guarani' + | 'gujarati' + | 'haitian-creole' + | 'hausa' + | 'hawaiian' + | 'hebrew' + | 'hindi' + | 'hmong' + | 'hungarian' + | 'icelandic' + | 'igbo' + | 'indonesian' + | 'irish' + | 'italian' + | 'japanese' + | 'javanese' + | 'kannada' + | 'kazakh' + | 'khmer' + | 'kinyarwanda' + | 'korean' + | 'kurdish' + | 'kyrgyz' + | 'lao' + | 'latin' + | 'latvian' + | 'lingala' + | 'lithuanian' + | 'luxembourgish' + | 'macedonian' + | 'malagasy' + | 'malay' + | 'malayalam' + | 'maltese' + | 'maori' + | 'marathi' + | 'mongolian' + | 'nepali' + | 'norwegian' + | 'odia' + | 'oromo' + | 'pashto' + | 'pidgin' + | 'polish' + | 'portuguese' + | 'punjabi' + | 'quechua' + | 'romanian' + | 'russian' + | 'samoan' + | 'scottish-gaelic' + | 'serbian' + | 'sesotho' + | 'shona' + | 'sindhi' + | 'sinhala' + | 'slovak' + | 'slovene' + | 'somali' + | 'spanish' + | 'sundanese' + | 'swahili' + | 'swedish' + | 'tagalog' + | 'tajik' + | 'tamil' + | 'tatar' + | 'telugu' + | 'thai' + | 'tibetan' + | 'tigrinya' + | 'tongan' + | 'tswana' + | 'turkish' + | 'turkmen' + | 'ukrainian' + | 'urdu' + | 'uyghur' + | 'uzbek' + | 'vietnamese' + | 'welsh' + | 'wolof' + | 'xhosa' + | 'yiddish' + | 'yoruba' + | 'zulu'; } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -1321,10 +1465,8 @@ export declare namespace BrandRetrieveParams { | null; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 + * year. `0` refreshes. */ maxAgeMs?: number; @@ -1336,16 +1478,44 @@ export declare namespace BrandRetrieveParams { maxSpeed?: boolean; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + timeoutOpts?: BrandRetrieveByDomainRequest.TimeoutOpts; + + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; + } + + export namespace BrandRetrieveByDomainRequest { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface BrandRetrieveByNameRequest { @@ -1360,10 +1530,249 @@ export declare namespace BrandRetrieveParams { type: 'by_name'; /** - * Optional country code hint (GL parameter) to specify the country when looking up - * by company name. - */ - country_gl?: string; + * Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize + * search. + */ + country_gl?: + | 'af' + | 'al' + | 'dz' + | 'as' + | 'ad' + | 'ao' + | 'ai' + | 'aq' + | 'ag' + | 'ar' + | 'am' + | 'aw' + | 'au' + | 'at' + | 'az' + | 'bs' + | 'bh' + | 'bd' + | 'bb' + | 'by' + | 'be' + | 'bz' + | 'bj' + | 'bm' + | 'bt' + | 'bo' + | 'ba' + | 'bw' + | 'bv' + | 'br' + | 'io' + | 'bn' + | 'bg' + | 'bf' + | 'bi' + | 'kh' + | 'cm' + | 'ca' + | 'cv' + | 'ky' + | 'cf' + | 'td' + | 'cl' + | 'cn' + | 'cx' + | 'cc' + | 'co' + | 'km' + | 'cg' + | 'cd' + | 'ck' + | 'cr' + | 'ci' + | 'hr' + | 'cu' + | 'cy' + | 'cz' + | 'dk' + | 'dj' + | 'dm' + | 'do' + | 'ec' + | 'eg' + | 'sv' + | 'gq' + | 'er' + | 'ee' + | 'et' + | 'fk' + | 'fo' + | 'fj' + | 'fi' + | 'fr' + | 'gf' + | 'pf' + | 'tf' + | 'ga' + | 'gm' + | 'ge' + | 'de' + | 'gh' + | 'gi' + | 'gr' + | 'gl' + | 'gd' + | 'gp' + | 'gu' + | 'gt' + | 'gn' + | 'gw' + | 'gy' + | 'ht' + | 'hm' + | 'va' + | 'hn' + | 'hk' + | 'hu' + | 'is' + | 'in' + | 'id' + | 'ir' + | 'iq' + | 'ie' + | 'il' + | 'it' + | 'jm' + | 'jp' + | 'jo' + | 'kz' + | 'ke' + | 'ki' + | 'kp' + | 'kr' + | 'kw' + | 'kg' + | 'la' + | 'lv' + | 'lb' + | 'ls' + | 'lr' + | 'ly' + | 'li' + | 'lt' + | 'lu' + | 'mo' + | 'mk' + | 'mg' + | 'mw' + | 'my' + | 'mv' + | 'ml' + | 'mt' + | 'mh' + | 'mq' + | 'mr' + | 'mu' + | 'yt' + | 'mx' + | 'fm' + | 'md' + | 'mc' + | 'mn' + | 'ms' + | 'ma' + | 'mz' + | 'mm' + | 'na' + | 'nr' + | 'np' + | 'nl' + | 'an' + | 'nc' + | 'nz' + | 'ni' + | 'ne' + | 'ng' + | 'nu' + | 'nf' + | 'mp' + | 'no' + | 'om' + | 'pk' + | 'pw' + | 'ps' + | 'pa' + | 'pg' + | 'py' + | 'pe' + | 'ph' + | 'pn' + | 'pl' + | 'pt' + | 'pr' + | 'qa' + | 're' + | 'ro' + | 'ru' + | 'rw' + | 'sh' + | 'kn' + | 'lc' + | 'pm' + | 'vc' + | 'ws' + | 'sm' + | 'st' + | 'sa' + | 'sn' + | 'rs' + | 'sc' + | 'sl' + | 'sg' + | 'sk' + | 'si' + | 'sb' + | 'so' + | 'za' + | 'gs' + | 'es' + | 'lk' + | 'sd' + | 'sr' + | 'sj' + | 'sz' + | 'se' + | 'ch' + | 'sy' + | 'tw' + | 'tj' + | 'tz' + | 'th' + | 'tl' + | 'tg' + | 'tk' + | 'to' + | 'tt' + | 'tn' + | 'tr' + | 'tm' + | 'tc' + | 'tv' + | 'ug' + | 'ua' + | 'ae' + | 'gb' + | 'us' + | 'um' + | 'uy' + | 'uz' + | 'vu' + | 've' + | 'vn' + | 'vg' + | 'vi' + | 'wf' + | 'eh' + | 'ye' + | 'zm' + | 'zw'; force_language?: | 'afrikaans' @@ -1489,10 +1898,8 @@ export declare namespace BrandRetrieveParams { | null; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 + * year. `0` refreshes. */ maxAgeMs?: number; @@ -1504,16 +1911,44 @@ export declare namespace BrandRetrieveParams { maxSpeed?: boolean; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. + */ + timeoutOpts?: BrandRetrieveByNameRequest.TimeoutOpts; + + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; + } + + export namespace BrandRetrieveByNameRequest { + /** + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface BrandRetrieveByEmailRequest { @@ -1651,10 +2086,8 @@ export declare namespace BrandRetrieveParams { | null; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 + * year. `0` refreshes. */ maxAgeMs?: number; @@ -1666,16 +2099,44 @@ export declare namespace BrandRetrieveParams { maxSpeed?: boolean; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + timeoutOpts?: BrandRetrieveByEmailRequest.TimeoutOpts; + + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; + } + + export namespace BrandRetrieveByEmailRequest { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface BrandRetrieveByTickerRequest { @@ -1813,10 +2274,8 @@ export declare namespace BrandRetrieveParams { | null; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 + * year. `0` refreshes. */ maxAgeMs?: number; @@ -1828,21 +2287,121 @@ export declare namespace BrandRetrieveParams { maxSpeed?: boolean; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. */ - tags?: Array; + policies?: Array; /** - * Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. + * Labels for filtering usage in the dashboard. */ - ticker_exchange?: string; + tags?: Array; + + /** + * Stock exchange code. + */ + ticker_exchange?: + | 'AMEX' + | 'AMS' + | 'AQS' + | 'ASX' + | 'ATH' + | 'BER' + | 'BME' + | 'BRU' + | 'BSE' + | 'BUD' + | 'BUE' + | 'BVC' + | 'CBOE' + | 'CNQ' + | 'CPH' + | 'DFM' + | 'DOH' + | 'DUB' + | 'DUS' + | 'DXE' + | 'EGX' + | 'FSX' + | 'HAM' + | 'HEL' + | 'HKSE' + | 'HOSE' + | 'ICE' + | 'IOB' + | 'IST' + | 'JKT' + | 'JNB' + | 'JPX' + | 'KLS' + | 'KOE' + | 'KSC' + | 'KUW' + | 'LIS' + | 'LSE' + | 'MCX' + | 'MEX' + | 'MIL' + | 'MUN' + | 'NASDAQ' + | 'NEO' + | 'NSE' + | 'NYSE' + | 'NZE' + | 'OSL' + | 'OTC' + | 'PAR' + | 'PNK' + | 'PRA' + | 'RIS' + | 'SAO' + | 'SAU' + | 'SES' + | 'SET' + | 'SGO' + | 'SHH' + | 'SHZ' + | 'SIX' + | 'STO' + | 'STU' + | 'TAI' + | 'TAL' + | 'TLV' + | 'TSX' + | 'TSXV' + | 'TWO' + | 'VIE' + | 'WSE' + | 'XETRA'; + + /** + * Request deadline and what to return when it passes. + */ + timeoutOpts?: BrandRetrieveByTickerRequest.TimeoutOpts; + + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; + } + export namespace BrandRetrieveByTickerRequest { /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface BrandRetrieveByDirectURLRequest { @@ -1859,16 +2418,44 @@ export declare namespace BrandRetrieveParams { type: 'by_direct_url'; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. + */ + timeoutOpts?: BrandRetrieveByDirectURLRequest.TimeoutOpts; + + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. */ - timeoutMS?: number; + zdr?: 'enabled' | 'disabled'; + } + + export namespace BrandRetrieveByDirectURLRequest { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface BrandRetrieveFromTransactionRequest { @@ -1888,10 +2475,249 @@ export declare namespace BrandRetrieveParams { city?: string; /** - * Optional country code hint (GL parameter) to specify the country when - * identifying a transaction. - */ - country_gl?: string; + * Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize + * search. + */ + country_gl?: + | 'af' + | 'al' + | 'dz' + | 'as' + | 'ad' + | 'ao' + | 'ai' + | 'aq' + | 'ag' + | 'ar' + | 'am' + | 'aw' + | 'au' + | 'at' + | 'az' + | 'bs' + | 'bh' + | 'bd' + | 'bb' + | 'by' + | 'be' + | 'bz' + | 'bj' + | 'bm' + | 'bt' + | 'bo' + | 'ba' + | 'bw' + | 'bv' + | 'br' + | 'io' + | 'bn' + | 'bg' + | 'bf' + | 'bi' + | 'kh' + | 'cm' + | 'ca' + | 'cv' + | 'ky' + | 'cf' + | 'td' + | 'cl' + | 'cn' + | 'cx' + | 'cc' + | 'co' + | 'km' + | 'cg' + | 'cd' + | 'ck' + | 'cr' + | 'ci' + | 'hr' + | 'cu' + | 'cy' + | 'cz' + | 'dk' + | 'dj' + | 'dm' + | 'do' + | 'ec' + | 'eg' + | 'sv' + | 'gq' + | 'er' + | 'ee' + | 'et' + | 'fk' + | 'fo' + | 'fj' + | 'fi' + | 'fr' + | 'gf' + | 'pf' + | 'tf' + | 'ga' + | 'gm' + | 'ge' + | 'de' + | 'gh' + | 'gi' + | 'gr' + | 'gl' + | 'gd' + | 'gp' + | 'gu' + | 'gt' + | 'gn' + | 'gw' + | 'gy' + | 'ht' + | 'hm' + | 'va' + | 'hn' + | 'hk' + | 'hu' + | 'is' + | 'in' + | 'id' + | 'ir' + | 'iq' + | 'ie' + | 'il' + | 'it' + | 'jm' + | 'jp' + | 'jo' + | 'kz' + | 'ke' + | 'ki' + | 'kp' + | 'kr' + | 'kw' + | 'kg' + | 'la' + | 'lv' + | 'lb' + | 'ls' + | 'lr' + | 'ly' + | 'li' + | 'lt' + | 'lu' + | 'mo' + | 'mk' + | 'mg' + | 'mw' + | 'my' + | 'mv' + | 'ml' + | 'mt' + | 'mh' + | 'mq' + | 'mr' + | 'mu' + | 'yt' + | 'mx' + | 'fm' + | 'md' + | 'mc' + | 'mn' + | 'ms' + | 'ma' + | 'mz' + | 'mm' + | 'na' + | 'nr' + | 'np' + | 'nl' + | 'an' + | 'nc' + | 'nz' + | 'ni' + | 'ne' + | 'ng' + | 'nu' + | 'nf' + | 'mp' + | 'no' + | 'om' + | 'pk' + | 'pw' + | 'ps' + | 'pa' + | 'pg' + | 'py' + | 'pe' + | 'ph' + | 'pn' + | 'pl' + | 'pt' + | 'pr' + | 'qa' + | 're' + | 'ro' + | 'ru' + | 'rw' + | 'sh' + | 'kn' + | 'lc' + | 'pm' + | 'vc' + | 'ws' + | 'sm' + | 'st' + | 'sa' + | 'sn' + | 'rs' + | 'sc' + | 'sl' + | 'sg' + | 'sk' + | 'si' + | 'sb' + | 'so' + | 'za' + | 'gs' + | 'es' + | 'lk' + | 'sd' + | 'sr' + | 'sj' + | 'sz' + | 'se' + | 'ch' + | 'sy' + | 'tw' + | 'tj' + | 'tz' + | 'th' + | 'tl' + | 'tg' + | 'tk' + | 'to' + | 'tt' + | 'tn' + | 'tr' + | 'tm' + | 'tc' + | 'tv' + | 'ug' + | 'ua' + | 'ae' + | 'gb' + | 'us' + | 'um' + | 'uy' + | 'uz' + | 'vu' + | 've' + | 'vn' + | 'vg' + | 'vi' + | 'wf' + | 'eh' + | 'ye' + | 'zm' + | 'zw'; force_language?: | 'afrikaans' @@ -2041,51 +2867,45 @@ export declare namespace BrandRetrieveParams { phone?: string | number; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. */ - tags?: Array; + policies?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Labels for filtering usage in the dashboard. */ - timeoutMS?: number; - } -} - -export interface BrandRetrieveSimplifiedParams { - /** - * Domain name to retrieve simplified brand data for - */ - domain: string; + tags?: Array; - /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. - */ - maxAgeMs?: number | null; + /** + * Request deadline and what to return when it passes. + */ + timeoutOpts?: BrandRetrieveFromTransactionRequest.TimeoutOpts; - /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. - */ - tags?: Array; + /** + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; + } - /** - * Optional theme preference used when selecting brand assets. - */ - theme?: 'light' | 'dark'; + export namespace BrandRetrieveFromTransactionRequest { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } + } } export interface BrandSearchParams { @@ -2101,6 +2921,386 @@ export interface BrandSearchParams { */ autocomplete?: boolean; + /** + * Only return brands in this country, as an uppercase ISO 3166-1 alpha-2 code such + * as US or GB. + */ + country?: + | 'AD' + | 'AE' + | 'AF' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AQ' + | 'AR' + | 'AS' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BY' + | 'BZ' + | 'CA' + | 'CC' + | 'CD' + | 'CF' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CU' + | 'CV' + | 'CW' + | 'CX' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FM' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HM' + | 'HN' + | 'HR' + | 'HT' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IR' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KP' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'LY' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MH' + | 'MK' + | 'ML' + | 'MM' + | 'MN' + | 'MO' + | 'MP' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NF' + | 'NG' + | 'NI' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PW' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RU' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SD' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SO' + | 'SR' + | 'SS' + | 'ST' + | 'SV' + | 'SX' + | 'SY' + | 'SZ' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'UM' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VE' + | 'VG' + | 'VI' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'YE' + | 'YT' + | 'ZA' + | 'ZM' + | 'ZW'; + + /** + * Only return brands with this primary language, such as english or french. + */ + language?: + | 'afrikaans' + | 'albanian' + | 'amharic' + | 'arabic' + | 'armenian' + | 'assamese' + | 'aymara' + | 'azeri' + | 'basque' + | 'belarusian' + | 'bengali' + | 'bosnian' + | 'bulgarian' + | 'burmese' + | 'cantonese' + | 'catalan' + | 'cebuano' + | 'chinese' + | 'corsican' + | 'croatian' + | 'czech' + | 'danish' + | 'dutch' + | 'english' + | 'esperanto' + | 'estonian' + | 'farsi' + | 'fijian' + | 'finnish' + | 'french' + | 'galician' + | 'georgian' + | 'german' + | 'greek' + | 'guarani' + | 'gujarati' + | 'haitian-creole' + | 'hausa' + | 'hawaiian' + | 'hebrew' + | 'hindi' + | 'hmong' + | 'hungarian' + | 'icelandic' + | 'igbo' + | 'indonesian' + | 'irish' + | 'italian' + | 'japanese' + | 'javanese' + | 'kannada' + | 'kazakh' + | 'khmer' + | 'kinyarwanda' + | 'korean' + | 'kurdish' + | 'kyrgyz' + | 'lao' + | 'latin' + | 'latvian' + | 'lingala' + | 'lithuanian' + | 'luxembourgish' + | 'macedonian' + | 'malagasy' + | 'malay' + | 'malayalam' + | 'maltese' + | 'maori' + | 'marathi' + | 'mongolian' + | 'nepali' + | 'norwegian' + | 'odia' + | 'oromo' + | 'pashto' + | 'pidgin' + | 'polish' + | 'portuguese' + | 'punjabi' + | 'quechua' + | 'romanian' + | 'russian' + | 'samoan' + | 'scottish-gaelic' + | 'serbian' + | 'sesotho' + | 'shona' + | 'sindhi' + | 'sinhala' + | 'slovak' + | 'slovene' + | 'somali' + | 'spanish' + | 'sundanese' + | 'swahili' + | 'swedish' + | 'tagalog' + | 'tajik' + | 'tamil' + | 'tatar' + | 'telugu' + | 'thai' + | 'tibetan' + | 'tigrinya' + | 'tongan' + | 'tswana' + | 'turkish' + | 'turkmen' + | 'ukrainian' + | 'urdu' + | 'uyghur' + | 'uzbek' + | 'vietnamese' + | 'welsh' + | 'wolof' + | 'xhosa' + | 'yiddish' + | 'yoruba' + | 'zulu'; + /** * Fields to match the search term against, as a comma-separated list or repeated * parameter: 'name', 'domain', or both. Defaults to both. @@ -2108,9 +3308,7 @@ export interface BrandSearchParams { queryBy?: Array<'name' | 'domain'>; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ tags?: Array; @@ -2124,10 +3322,8 @@ export interface BrandSearchParams { export declare namespace Brand { export { type BrandRetrieveResponse as BrandRetrieveResponse, - type BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse, type BrandSearchResponse as BrandSearchResponse, type BrandRetrieveParams as BrandRetrieveParams, - type BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams, type BrandSearchParams as BrandSearchParams, }; } diff --git a/src/resources/browser.ts b/src/resources/browser.ts new file mode 100644 index 00000000..53b35d9f --- /dev/null +++ b/src/resources/browser.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './browser/index'; diff --git a/src/resources/browser/browser.ts b/src/resources/browser/browser.ts new file mode 100644 index 00000000..94b7c271 --- /dev/null +++ b/src/resources/browser/browser.ts @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as ProfilesAPI from './profiles'; +import { ProfileListParams, ProfileListResponse, Profiles } from './profiles'; + +export class Browser extends APIResource { + profiles: ProfilesAPI.Profiles = new ProfilesAPI.Profiles(this._client); +} + +Browser.Profiles = Profiles; + +export declare namespace Browser { + export { + Profiles as Profiles, + type ProfileListResponse as ProfileListResponse, + type ProfileListParams as ProfileListParams, + }; +} diff --git a/src/resources/browser/index.ts b/src/resources/browser/index.ts new file mode 100644 index 00000000..1e5b73fb --- /dev/null +++ b/src/resources/browser/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Browser } from './browser'; +export { Profiles, type ProfileListResponse, type ProfileListParams } from './profiles'; diff --git a/src/resources/browser/profiles.ts b/src/resources/browser/profiles.ts new file mode 100644 index 00000000..8d449034 --- /dev/null +++ b/src/resources/browser/profiles.ts @@ -0,0 +1,99 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { RequestOptions } from '../../internal/request-options'; + +/** + * See the authenticated browser profiles your organization created. + */ +export class Profiles extends APIResource { + /** + * List the browser profiles your organization created with `/web/scrape`, newest + * first. + */ + list( + query: ProfileListParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/org/browser/profiles', { query, ...options }); + } +} + +export interface ProfileListResponse { + /** + * Browser profiles, newest first. + */ + data: Array; + + /** + * Whether a next page exists. + */ + has_more: boolean; + + /** + * Pass as `cursor` to fetch the next page. + */ + next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: ProfileListResponse.KeyMetadata; +} + +export namespace ProfileListResponse { + export interface Data { + /** + * Profile ID to pass as `sharedParams.profile.profileId` on `/web/scrape`. + */ + id: string; + + /** + * When the profile was created. + */ + created_at: string; + + /** + * The description supplied when the profile was created, or null. + */ + description: string | null; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface ProfileListParams { + /** + * The `next_cursor` from the previous page. + */ + cursor?: string; + + /** + * Number of profiles per page. + */ + limit?: number; +} + +export declare namespace Profiles { + export { type ProfileListResponse as ProfileListResponse, type ProfileListParams as ProfileListParams }; +} diff --git a/src/resources/feedback.ts b/src/resources/feedback.ts new file mode 100644 index 00000000..5e1ffdd2 --- /dev/null +++ b/src/resources/feedback.ts @@ -0,0 +1,104 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import { APIPromise } from '../core/api-promise'; +import { RequestOptions } from '../internal/request-options'; + +/** + * Report API issues and documentation mismatches. + */ +export class Feedback extends APIResource { + /** + * Report an API issue or documentation mismatch, including request IDs when + * available. + * + * @example + * ```ts + * const response = await client.feedback.submit({ + * category: 'bug', + * note: 'Markdown drops the plan comparison table; expected all 4 rows.', + * request_id: '3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91', + * url: 'https://stripe.com/pricing', + * }); + * ``` + */ + submit(body: FeedbackSubmitParams, options?: RequestOptions): APIPromise { + return this._client.post('/feedback', { body, ...options }); + } +} + +export interface FeedbackSubmitResponse { + /** + * True when feedback for this request_id was already recorded; the original + * feedback_id is returned. + */ + already_submitted: boolean; + + /** + * ID of the stored feedback. + */ + feedback_id: string; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: FeedbackSubmitResponse.KeyMetadata; +} + +export namespace FeedbackSubmitResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface FeedbackSubmitParams { + /** + * Kind of issue. + */ + category: 'bug' | 'docs_mismatch' | 'friction' | 'feature_gap' | 'quality_degradation' | 'other'; + + /** + * What went wrong and what you expected instead. + */ + note: string; + + /** + * The request_id of the API call the feedback is about, from its response body or + * X-Request-Id header. + */ + request_id?: string; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + + /** + * The page the feedback is about, such as one page of a crawl or a docs page. + */ + url?: string; +} + +export declare namespace Feedback { + export { + type FeedbackSubmitResponse as FeedbackSubmitResponse, + type FeedbackSubmitParams as FeedbackSubmitParams, + }; +} diff --git a/src/resources/index.ts b/src/resources/index.ts index 93e0adeb..3f10e7e0 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,12 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - AI, - type AIExtractProductResponse, - type AIExtractProductsResponse, - type AIExtractProductParams, - type AIExtractProductsParams, -} from './ai'; export { Batch, type PageErrorCount, @@ -26,12 +19,12 @@ export { export { Brand, type BrandRetrieveResponse, - type BrandRetrieveSimplifiedResponse, type BrandSearchResponse, type BrandRetrieveParams, - type BrandRetrieveSimplifiedParams, type BrandSearchParams, } from './brand'; +export { Browser } from './browser/browser'; +export { Feedback, type FeedbackSubmitResponse, type FeedbackSubmitParams } from './feedback'; export { Industry, type IndustryRetrieveNaicsResponse, @@ -39,6 +32,7 @@ export { type IndustryRetrieveNaicsParams, type IndustryRetrieveSicParams, } from './industry'; +export { Logs, type LogRetrieveResponse, type LogListResponse, type LogListParams } from './logs'; export { Monitors, type WebhookDelivery, @@ -54,6 +48,8 @@ export { type MonitorListChangesResponse, type MonitorListRunsResponse, type MonitorRetrieveChangeResponse, + type MonitorRetrieveRunResponse, + type MonitorRotateWebhookSecretResponse, type MonitorRunResponse, type MonitorCreateParams, type MonitorUpdateParams, @@ -63,33 +59,35 @@ export { type MonitorListAccountRunsParams, type MonitorListChangesParams, type MonitorListRunsParams, + type MonitorRetrieveRunParams, } from './monitors'; export { News, type NewsSearchResponse, type NewsSearchParams } from './news'; export { Parse, type ParseHandleResponse, type ParseHandleParams } from './parse'; -export { People, type PersonEnrichResponse, type PersonEnrichParams } from './people'; +export { + People, + type PersonEnrichResponse, + type PersonSearchResponse, + type PersonEnrichParams, + type PersonSearchParams, +} from './people'; export { Utility, type UtilityPrefetchResponse, type UtilityPrefetchParams } from './utility'; export { Web, - type WebExtractResponse, + type WebAnswersResponse, type WebExtractCompetitorsResponse, - type WebExtractFontsResponse, type WebExtractStyleguideResponse, + type WebMapURLsResponse, + type WebScrapeResponse, type WebScreenshotResponse, type WebSearchResponse, type WebWebCrawlMdResponse, - type WebWebScrapeHTMLResponse, - type WebWebScrapeImagesResponse, - type WebWebScrapeMdResponse, - type WebWebScrapeSitemapResponse, - type WebExtractParams, + type WebAnswersParams, type WebExtractCompetitorsParams, - type WebExtractFontsParams, type WebExtractStyleguideParams, + type WebMapURLsParams, + type WebScrapeParams, type WebScreenshotParams, type WebSearchParams, type WebWebCrawlMdParams, - type WebWebScrapeHTMLParams, - type WebWebScrapeImagesParams, - type WebWebScrapeMdParams, - type WebWebScrapeSitemapParams, } from './web'; +export { Webhooks, type RetryConfig } from './webhooks/webhooks'; diff --git a/src/resources/industry.ts b/src/resources/industry.ts index 278a6fe6..5100d4d7 100644 --- a/src/resources/industry.ts +++ b/src/resources/industry.ts @@ -6,7 +6,9 @@ import { RequestOptions } from '../internal/request-options'; export class Industry extends APIResource { /** - * Classify any brand into 2022 NAICS industry codes from its domain or name. + * Classify a company into NAICS industry codes. + * + * @deprecated */ retrieveNaics( query: IndustryRetrieveNaicsParams, @@ -16,9 +18,9 @@ export class Industry extends APIResource { } /** - * Classify any brand into Standard Industrial Classification (SIC) codes from its - * domain or name. Choose between the original SIC system (`original_sic`) or the - * latest SIC list maintained by the SEC (`latest_sec`). + * Classify a company into SIC industry codes. + * + * @deprecated */ retrieveSic( query: IndustryRetrieveSicParams, @@ -29,6 +31,12 @@ export class Industry extends APIResource { } export interface IndustryRetrieveNaicsResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Array of NAICS codes and titles. */ @@ -40,13 +48,18 @@ export interface IndustryRetrieveNaicsResponse { domain?: string; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: IndustryRetrieveNaicsResponse.KeyMetadata; /** - * Status of the response, e.g., 'ok' + * True when the timeout ended processing and this response contains only usable + * results completed so far. Unfinished results are omitted. + */ + partial?: boolean; + + /** + * Always `ok` on success. */ status?: string; @@ -75,23 +88,28 @@ export namespace IndustryRetrieveNaicsResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } export interface IndustryRetrieveSicResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Echoes back which SIC dataset was used to classify the brand. */ @@ -110,13 +128,18 @@ export interface IndustryRetrieveSicResponse { domain?: string; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: IndustryRetrieveSicResponse.KeyMetadata; /** - * Status of the response, e.g., 'ok' + * True when the timeout ended processing and this response contains only usable + * results completed so far. Unfinished results are omitted. + */ + partial?: boolean; + + /** + * Always `ok` on success. */ status?: string; @@ -163,17 +186,16 @@ export namespace IndustryRetrieveSicResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -199,18 +221,38 @@ export interface IndustryRetrieveNaicsParams { minResults?: number; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. + */ + timeoutOpts?: IndustryRetrieveNaicsParams.TimeoutOpts; + + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} + +export namespace IndustryRetrieveNaicsParams { + /** + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export interface IndustryRetrieveSicParams { @@ -232,25 +274,43 @@ export interface IndustryRetrieveSicParams { minResults?: number; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + timeoutOpts?: IndustryRetrieveSicParams.TimeoutOpts; /** - * Which SIC dataset to classify against. `original_sic` uses the 1987 Standard - * Industrial Classification system; `latest_sec` uses the current SIC list as - * published by the SEC. Defaults to `original_sic`. + * SIC dataset: `original_sic` (1987) or `latest_sec` (current SEC list). */ type?: 'original_sic' | 'latest_sec'; + + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} + +export namespace IndustryRetrieveSicParams { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export declare namespace Industry { diff --git a/src/resources/logs.ts b/src/resources/logs.ts new file mode 100644 index 00000000..67195830 --- /dev/null +++ b/src/resources/logs.ts @@ -0,0 +1,327 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../core/resource'; +import { APIPromise } from '../core/api-promise'; +import { RequestOptions } from '../internal/request-options'; +import { path } from '../internal/utils/path'; + +/** + * Read your organization's API request logs. + */ +export class Logs extends APIResource { + /** + * Retrieve a request’s metadata, retained input, and response. An entry becomes + * retrievable a few seconds after its request completes, so a 404 NOT_FOUND for a + * request that just finished means ingestion has not caught up yet; retry after a + * few seconds. + */ + retrieve(requestID: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/org/logs/${requestID}`, options); + } + + /** + * List your organization’s request logs with filters and pagination. Logs also + * include batch settlements and monitor runs. + */ + list(query: LogListParams | null | undefined = {}, options?: RequestOptions): APIPromise { + return this._client.get('/org/logs', { query, ...options }); + } +} + +export interface LogRetrieveResponse { + data: LogRetrieveResponse.Data; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: LogRetrieveResponse.KeyMetadata; +} + +export namespace LogRetrieveResponse { + export interface Data { + /** + * Credits charged for this request. + */ + credits_used: number; + + /** + * The `error_code` from the response, or null on success. + */ + error_code: string | null; + + /** + * What was sent with the request. + */ + input: Data.Input; + + /** + * ID of the API key that made the request. + */ + key_id: string | null; + + /** + * Server-side processing time in milliseconds. + */ + latency_ms: number; + + /** + * HTTP method, or `MONITOR` / `BATCH` for monitor-run and batch-settlement + * entries. + */ + method: string; + + /** + * Endpoint path as called. + */ + path: string; + + /** + * Request ID of the logged API call. + */ + request_id: string; + + /** + * HTTP status code returned. + */ + status_code: number; + + /** + * Request tags supplied by the caller. + */ + tags: Array; + + /** + * When the request completed. + */ + timestamp: string; + + /** + * User-Agent header of the request. + */ + user_agent: string | null; + + /** + * Whether the request was made under zero data retention. + */ + zdr: boolean; + + /** + * The retained JSON response with credentials redacted, or null when unavailable. + */ + response?: unknown; + } + + export namespace Data { + /** + * What was sent with the request. + */ + export interface Input { + /** + * Query parameters as sent. + */ + query: { [key: string]: unknown }; + + /** + * Request body with credentials and uploaded content redacted. + */ + body?: unknown; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface LogListResponse { + /** + * Log entries, newest first. + */ + data: Array; + + /** + * Whether a next page exists. + */ + has_more: boolean; + + /** + * Entries per page. + */ + limit: number; + + /** + * Current page number. + */ + page: number; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: LogListResponse.KeyMetadata; +} + +export namespace LogListResponse { + export interface Data { + /** + * Credits charged for this request. + */ + credits_used: number; + + /** + * The `error_code` from the response, or null on success. + */ + error_code: string | null; + + /** + * ID of the API key that made the request. + */ + key_id: string | null; + + /** + * Server-side processing time in milliseconds. + */ + latency_ms: number; + + /** + * HTTP method, or `MONITOR` / `BATCH` for monitor-run and batch-settlement + * entries. + */ + method: string; + + /** + * Endpoint path as called. + */ + path: string; + + /** + * Request ID of the logged API call. + */ + request_id: string; + + /** + * HTTP status code returned. + */ + status_code: number; + + /** + * Request tags supplied by the caller. + */ + tags: Array; + + /** + * When the request completed. + */ + timestamp: string; + + /** + * Whether the request was made under zero data retention. + */ + zdr: boolean; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface LogListParams { + /** + * Filter by the `error_code` returned in the response. + */ + error_code?: string; + + /** + * Only include requests that returned a 4xx or 5xx status. + */ + errors_only?: boolean; + + /** + * Only include requests at or after this ISO 8601 timestamp. Defaults to 24 hours + * before `to`. + */ + from?: string; + + /** + * Filter by the API key that made the request. + */ + key_id?: string; + + /** + * Number of log entries per page. + */ + limit?: number; + + /** + * Page number, starting at 1. + */ + page?: number; + + /** + * Filter by endpoint path, with or without the /v1 prefix. + */ + path?: string; + + /** + * Case-insensitive substring match against the request query and body, e.g. a + * domain. + */ + search?: string; + + /** + * Filter by exact HTTP status code. + */ + status_code?: number; + + /** + * Comma-separated request tags. Matches requests carrying any of them. Up to 20 + * tags, each 1-50 characters. + */ + tags?: string; + + /** + * Only include requests at or before this ISO 8601 timestamp. Defaults to now. + */ + to?: string; +} + +export declare namespace Logs { + export { + type LogRetrieveResponse as LogRetrieveResponse, + type LogListResponse as LogListResponse, + type LogListParams as LogListParams, + }; +} diff --git a/src/resources/monitors.ts b/src/resources/monitors.ts index e2f6302d..0f234acb 100644 --- a/src/resources/monitors.ts +++ b/src/resources/monitors.ts @@ -2,18 +2,18 @@ import { APIResource } from '../core/resource'; import * as MonitorsAPI from './monitors'; +import * as WebhooksAPI from './webhooks/webhooks'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** - * Monitor pages, sitemaps, and extracted website data for exact or semantic changes. Webhook payloads are documented by the MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload schemas. + * Watch websites for exact or meaningful changes. */ export class Monitors extends APIResource { /** - * Creates a monitor. The request body is a union of the supported target/change - * detection combinations. The monitor runs immediately after creation to create - * its initial baseline. + * Watch a page, URL inventory, or extracted website data on a schedule. A run + * starts immediately to capture the baseline. * * @example * ```ts @@ -36,7 +36,7 @@ export class Monitors extends APIResource { } /** - * Get a monitor + * Retrieve a monitor’s configuration and current state. * * @example * ```ts @@ -48,9 +48,8 @@ export class Monitors extends APIResource { } /** - * Updates a monitor. If `target` or `change_detection` changes, the monitor - * creates a new baseline. Unsupported target/change detection combinations are - * rejected. + * Update a monitor. Changing its target or change detection replaces the baseline + * and queues a new baseline run. * * @example * ```ts @@ -75,9 +74,7 @@ export class Monitors extends APIResource { } /** - * Lists monitors for the authenticated organization. Supports free-text search - * (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus - * status/type/tag filters. Results are paginated via the opaque `cursor`. + * List your monitors with optional search and filters. * * @example * ```ts @@ -92,7 +89,7 @@ export class Monitors extends APIResource { } /** - * Delete a monitor + * Delete a monitor and stop future runs and webhook retries. * * @example * ```ts @@ -104,8 +101,8 @@ export class Monitors extends APIResource { } /** - * Returns credits charged per monitor over an optional [since, until] window, - * newest spenders first. + * Return usage per monitor, highest first, for up to the 10,000 most recent runs + * in the requested window. * * @example * ```ts @@ -120,7 +117,7 @@ export class Monitors extends APIResource { } /** - * Returns how many monitors the account has and the maximum it allows. + * Retrieve your organization’s monitor allowance and usage. * * @example * ```ts @@ -132,7 +129,7 @@ export class Monitors extends APIResource { } /** - * Returns an account-wide feed of detected changes across monitors. + * List full change records across your monitors, newest first. * * @example * ```ts @@ -147,7 +144,7 @@ export class Monitors extends APIResource { } /** - * Returns an account-wide feed of monitor runs across all monitors. + * List runs across your monitors, newest first. * * @example * ```ts @@ -162,7 +159,7 @@ export class Monitors extends APIResource { } /** - * List changes for a monitor + * List full change records for a monitor, newest first. * * @example * ```ts @@ -180,7 +177,7 @@ export class Monitors extends APIResource { } /** - * List monitor runs + * List a monitor’s runs, newest first. * * @example * ```ts @@ -196,7 +193,7 @@ export class Monitors extends APIResource { } /** - * Get a change + * Retrieve a detected change, including its diff and available evidence. * * @example * ```ts @@ -210,8 +207,45 @@ export class Monitors extends APIResource { } /** - * Triggers an immediate run of the monitor outside its normal schedule. The run is - * queued and processed asynchronously. + * Retrieve the status, timing, and results of one monitor run. + * + * @example + * ```ts + * const response = await client.monitors.retrieveRun( + * 'run_123', + * { monitor_id: 'mon_123' }, + * ); + * ``` + */ + retrieveRun( + runID: string, + params: MonitorRetrieveRunParams, + options?: RequestOptions, + ): APIPromise { + const { monitor_id } = params; + return this._client.get(path`/monitors/${monitor_id}/runs/${runID}`, options); + } + + /** + * Generate and return a new signing secret. It takes effect immediately for all + * subsequent delivery attempts. + * + * @example + * ```ts + * const response = await client.monitors.rotateWebhookSecret( + * 'mon_123', + * ); + * ``` + */ + rotateWebhookSecret( + monitorID: string, + options?: RequestOptions, + ): APIPromise { + return this._client.post(path`/monitors/${monitorID}/webhook/rotate-secret`, options); + } + + /** + * Queue a run without changing the regular schedule. Paused monitors return 409. * * @example * ```ts @@ -246,11 +280,14 @@ export interface WebhookDelivery { http_status: number | null; /** - * Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - * response; failed means no HTTP response was received; skipped_unsafe_url means - * the URL failed the public-endpoint safety check. + * Outcome of the delivery attempt. Any 2xx response counts as delivered. */ status: 'delivered' | 'rejected' | 'failed' | 'skipped_unsafe_url'; + + /** + * Delivery ID for status checks and retries, when available. + */ + delivery_id?: string; } export namespace WebhookDelivery { @@ -261,15 +298,12 @@ export namespace WebhookDelivery { } } -/** - * A newly created monitor plus `initial_run_id`, the id of the baseline run queued - * at creation. - */ export interface MonitorCreateResponse { id: string; /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection: | MonitorCreateResponse.MonitorsExactChangeDetection @@ -278,58 +312,58 @@ export interface MonitorCreateResponse { created_at: string; /** - * The baseline run queued by this create call, or null if it could not be queued - * immediately (in which case the baseline runs on the next scheduled tick). Poll - * GET /monitors/{monitor_id}/runs/{run_id}. + * ID of the baseline run queued at creation; null if it will start on the next + * scheduled tick. */ initial_run_id: string | null; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; name: string; /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - schedule: MonitorCreateResponse.Schedule; + request_id: string; /** - * Monitor lifecycle status. `failed` means the most recent run failed (see the - * monitor's `last_error`); failed monitors keep running on schedule and flip back - * to `active` on the next successful run. Monitors are auto-`paused` after - * repeated consecutive failures or insufficient-credit skips; resume by PATCHing - * status to `active`. + * Current state. Failed monitors keep running; paused monitors must be resumed + * with `status: "active"`. */ status: 'active' | 'paused' | 'failed'; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ target: | MonitorCreateResponse.MonitorsPageTarget | MonitorCreateResponse.MonitorsSitemapTarget - | MonitorCreateResponse.MonitorsExtractTarget; + | MonitorCreateResponse.MonitorsExtractTarget + | MonitorCreateResponse.MonitorsSearchTarget; updated_at: string; /** - * Current baseline: the last observed value the monitor compares new snapshots - * against. Its shape follows `target.type` (page/sitemap/extract). Only populated - * on GET /monitors/{monitor_id}; null until the first baseline run completes (and - * after a target or change_detection update, which resets the baseline). + * Comparison baseline, included on Retrieve. Null until capture completes or after + * target changes. */ baseline?: | MonitorCreateResponse.MonitorsPageBaseline | MonitorCreateResponse.MonitorsSitemapBaseline | MonitorCreateResponse.MonitorsExtractBaseline + | MonitorCreateResponse.MonitorsSearchBaseline | null; + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorCreateResponse.KeyMetadata; + last_change_at?: string | null; /** @@ -340,16 +374,30 @@ export interface MonitorCreateResponse { last_run_at?: string | null; /** - * When the next scheduled run is due. + * When the next scheduled run is due; null while paused. */ next_run_at?: string | null; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Access policy IDs applied to every run. + */ + policies?: Array; + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + schedule?: MonitorCreateResponse.Schedule; + + /** + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ webhook?: MonitorCreateResponse.Webhook | null; /** @@ -363,40 +411,30 @@ export interface MonitorCreateResponse { export namespace MonitorCreateResponse { /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; - confidence_threshold?: number; - } - - /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. - */ - export interface Schedule { /** - * Number of units between runs. The resulting interval (frequency × unit) must be - * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; - * maximum 365 when unit is days). + * Minimum confidence required to report a meaningful change, from 0 to 1. */ - frequency: number; - - type: 'interval'; - - unit: 'minutes' | 'hours' | 'days'; + confidence_threshold?: number; } /** @@ -404,10 +442,38 @@ export namespace MonitorCreateResponse { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -420,14 +486,78 @@ export namespace MonitorCreateResponse { normalize_whitespace?: boolean; } + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. + * Watch a site’s URL inventory for confirmed additions and removals. */ export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ type: 'sitemap'; /** @@ -452,11 +582,8 @@ export namespace MonitorCreateResponse { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -465,6 +592,9 @@ export namespace MonitorCreateResponse { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -472,6 +602,9 @@ export namespace MonitorCreateResponse { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -485,18 +618,36 @@ export namespace MonitorCreateResponse { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + /** * Current baseline of a `page` monitor: the visible page text as last observed. */ @@ -544,10 +695,8 @@ export namespace MonitorCreateResponse { captured_at: string; /** - * The extracted structured data, matching the monitor's extraction schema (same - * shape as the /web/extract endpoint's `data`). Refreshed when the monitor - * re-discovers its page set (at most about once a day); `null` when no extraction - * has been captured yet. + * Latest structured snapshot matching the extraction schema, refreshed at most + * daily; `null` before capture. */ data: unknown; @@ -557,6 +706,54 @@ export namespace MonitorCreateResponse { urls_analyzed: Array; } + /** + * Current baseline of a `search` monitor: the search results as last observed. + */ + export interface MonitorsSearchBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Search results as last observed. + */ + results: Array; + } + + export namespace MonitorsSearchBaseline { + export interface Result { + /** + * Result snippet. + */ + description: string; + + /** + * When the result was published, when known. + */ + published_at: string | null; + + title: string; + + url: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -566,26 +763,54 @@ export namespace MonitorCreateResponse { message: string; } + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + export interface Schedule { + /** + * Number of units between runs. The resulting interval (frequency × unit) must be + * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; + * maximum 365 when unit is days). + */ + frequency: number; + + /** + * Use `interval` to run on a repeating schedule. + */ + type: 'interval'; + + /** + * Time unit used with `frequency` to set the run interval. + */ + unit: 'minutes' | 'hours' | 'days'; + } + + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ export interface Webhook { /** - * Webhook URL events are delivered to. + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. */ url: string; /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. */ events?: Array<'change.detected' | 'run.completed'>; /** - * Signing secret used to verify webhook authenticity. Each delivery includes an - * `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over - * `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time - * compare and reject stale timestamps to prevent replay. Generated by the API; - * cannot be set by clients. + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; + + /** + * API-generated signing secret. Visible only with full access or `monitors:write` + * permission. */ secret?: string; } @@ -617,15 +842,12 @@ export namespace MonitorCreateResponse { } } -/** - * A web monitor. `mode` is the constant `web`; behavior is described by `target` - * (page/sitemap/extract) and `change_detection` (exact/semantic). - */ export interface MonitorRetrieveResponse { id: string; /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection: | MonitorRetrieveResponse.MonitorsExactChangeDetection @@ -634,51 +856,52 @@ export interface MonitorRetrieveResponse { created_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; name: string; /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - schedule: MonitorRetrieveResponse.Schedule; + request_id: string; /** - * Monitor lifecycle status. `failed` means the most recent run failed (see the - * monitor's `last_error`); failed monitors keep running on schedule and flip back - * to `active` on the next successful run. Monitors are auto-`paused` after - * repeated consecutive failures or insufficient-credit skips; resume by PATCHing - * status to `active`. + * Current state. Failed monitors keep running; paused monitors must be resumed + * with `status: "active"`. */ status: 'active' | 'paused' | 'failed'; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ target: | MonitorRetrieveResponse.MonitorsPageTarget | MonitorRetrieveResponse.MonitorsSitemapTarget - | MonitorRetrieveResponse.MonitorsExtractTarget; + | MonitorRetrieveResponse.MonitorsExtractTarget + | MonitorRetrieveResponse.MonitorsSearchTarget; updated_at: string; /** - * Current baseline: the last observed value the monitor compares new snapshots - * against. Its shape follows `target.type` (page/sitemap/extract). Only populated - * on GET /monitors/{monitor_id}; null until the first baseline run completes (and - * after a target or change_detection update, which resets the baseline). + * Comparison baseline, included on Retrieve. Null until capture completes or after + * target changes. */ baseline?: | MonitorRetrieveResponse.MonitorsPageBaseline | MonitorRetrieveResponse.MonitorsSitemapBaseline | MonitorRetrieveResponse.MonitorsExtractBaseline + | MonitorRetrieveResponse.MonitorsSearchBaseline | null; + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorRetrieveResponse.KeyMetadata; + last_change_at?: string | null; /** @@ -689,16 +912,30 @@ export interface MonitorRetrieveResponse { last_run_at?: string | null; /** - * When the next scheduled run is due. + * When the next scheduled run is due; null while paused. */ next_run_at?: string | null; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Access policy IDs applied to every run. + */ + policies?: Array; + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + schedule?: MonitorRetrieveResponse.Schedule; + + /** + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ webhook?: MonitorRetrieveResponse.Webhook | null; /** @@ -712,40 +949,30 @@ export interface MonitorRetrieveResponse { export namespace MonitorRetrieveResponse { /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; - confidence_threshold?: number; - } - - /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. - */ - export interface Schedule { /** - * Number of units between runs. The resulting interval (frequency × unit) must be - * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; - * maximum 365 when unit is days). + * Minimum confidence required to report a meaningful change, from 0 to 1. */ - frequency: number; - - type: 'interval'; - - unit: 'minutes' | 'hours' | 'days'; + confidence_threshold?: number; } /** @@ -753,10 +980,38 @@ export namespace MonitorRetrieveResponse { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -769,20 +1024,84 @@ export namespace MonitorRetrieveResponse { normalize_whitespace?: boolean; } - /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. - */ - export interface MonitorsSitemapTarget { - type: 'sitemap'; - + export namespace MonitorsPageTarget { /** - * Sitemap URL to monitor. + * Pause for a fixed number of milliseconds before continuing to the next action. */ - url: string; + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + + /** + * Watch a site’s URL inventory for confirmed additions and removals. + */ + export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ + type: 'sitemap'; + + /** + * Sitemap URL to monitor. + */ + url: string; /** * URL path patterns to exclude (max 50). @@ -801,11 +1120,8 @@ export namespace MonitorRetrieveResponse { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -814,6 +1130,9 @@ export namespace MonitorRetrieveResponse { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -821,6 +1140,9 @@ export namespace MonitorRetrieveResponse { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -834,18 +1156,36 @@ export namespace MonitorRetrieveResponse { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + /** * Current baseline of a `page` monitor: the visible page text as last observed. */ @@ -893,10 +1233,8 @@ export namespace MonitorRetrieveResponse { captured_at: string; /** - * The extracted structured data, matching the monitor's extraction schema (same - * shape as the /web/extract endpoint's `data`). Refreshed when the monitor - * re-discovers its page set (at most about once a day); `null` when no extraction - * has been captured yet. + * Latest structured snapshot matching the extraction schema, refreshed at most + * daily; `null` before capture. */ data: unknown; @@ -906,6 +1244,54 @@ export namespace MonitorRetrieveResponse { urls_analyzed: Array; } + /** + * Current baseline of a `search` monitor: the search results as last observed. + */ + export interface MonitorsSearchBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Search results as last observed. + */ + results: Array; + } + + export namespace MonitorsSearchBaseline { + export interface Result { + /** + * Result snippet. + */ + description: string; + + /** + * When the result was published, when known. + */ + published_at: string | null; + + title: string; + + url: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -915,26 +1301,54 @@ export namespace MonitorRetrieveResponse { message: string; } + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + export interface Schedule { + /** + * Number of units between runs. The resulting interval (frequency × unit) must be + * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; + * maximum 365 when unit is days). + */ + frequency: number; + + /** + * Use `interval` to run on a repeating schedule. + */ + type: 'interval'; + + /** + * Time unit used with `frequency` to set the run interval. + */ + unit: 'minutes' | 'hours' | 'days'; + } + + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ export interface Webhook { /** - * Webhook URL events are delivered to. + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. */ url: string; /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. */ events?: Array<'change.detected' | 'run.completed'>; /** - * Signing secret used to verify webhook authenticity. Each delivery includes an - * `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over - * `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time - * compare and reject stale timestamps to prevent replay. Generated by the API; - * cannot be set by clients. + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; + + /** + * API-generated signing secret. Visible only with full access or `monitors:write` + * permission. */ secret?: string; } @@ -966,15 +1380,12 @@ export namespace MonitorRetrieveResponse { } } -/** - * A web monitor. `mode` is the constant `web`; behavior is described by `target` - * (page/sitemap/extract) and `change_detection` (exact/semantic). - */ export interface MonitorUpdateResponse { id: string; /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection: | MonitorUpdateResponse.MonitorsExactChangeDetection @@ -983,51 +1394,52 @@ export interface MonitorUpdateResponse { created_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; name: string; /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - schedule: MonitorUpdateResponse.Schedule; + request_id: string; /** - * Monitor lifecycle status. `failed` means the most recent run failed (see the - * monitor's `last_error`); failed monitors keep running on schedule and flip back - * to `active` on the next successful run. Monitors are auto-`paused` after - * repeated consecutive failures or insufficient-credit skips; resume by PATCHing - * status to `active`. + * Current state. Failed monitors keep running; paused monitors must be resumed + * with `status: "active"`. */ status: 'active' | 'paused' | 'failed'; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ target: | MonitorUpdateResponse.MonitorsPageTarget | MonitorUpdateResponse.MonitorsSitemapTarget - | MonitorUpdateResponse.MonitorsExtractTarget; + | MonitorUpdateResponse.MonitorsExtractTarget + | MonitorUpdateResponse.MonitorsSearchTarget; updated_at: string; /** - * Current baseline: the last observed value the monitor compares new snapshots - * against. Its shape follows `target.type` (page/sitemap/extract). Only populated - * on GET /monitors/{monitor_id}; null until the first baseline run completes (and - * after a target or change_detection update, which resets the baseline). + * Comparison baseline, included on Retrieve. Null until capture completes or after + * target changes. */ baseline?: | MonitorUpdateResponse.MonitorsPageBaseline | MonitorUpdateResponse.MonitorsSitemapBaseline | MonitorUpdateResponse.MonitorsExtractBaseline + | MonitorUpdateResponse.MonitorsSearchBaseline | null; + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorUpdateResponse.KeyMetadata; + last_change_at?: string | null; /** @@ -1038,16 +1450,30 @@ export interface MonitorUpdateResponse { last_run_at?: string | null; /** - * When the next scheduled run is due. + * When the next scheduled run is due; null while paused. */ next_run_at?: string | null; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Access policy IDs applied to every run. + */ + policies?: Array; + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + schedule?: MonitorUpdateResponse.Schedule; + + /** + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ webhook?: MonitorUpdateResponse.Webhook | null; /** @@ -1061,40 +1487,30 @@ export interface MonitorUpdateResponse { export namespace MonitorUpdateResponse { /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; - confidence_threshold?: number; - } - - /** - * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. - * every 6 hours or every 2 days. The total interval (frequency × unit) must be - * between 10 minutes and 1 year. - */ - export interface Schedule { /** - * Number of units between runs. The resulting interval (frequency × unit) must be - * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; - * maximum 365 when unit is days). + * Minimum confidence required to report a meaningful change, from 0 to 1. */ - frequency: number; - - type: 'interval'; - - unit: 'minutes' | 'hours' | 'days'; + confidence_threshold?: number; } /** @@ -1102,10 +1518,38 @@ export namespace MonitorUpdateResponse { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -1118,14 +1562,78 @@ export namespace MonitorUpdateResponse { normalize_whitespace?: boolean; } + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. + * Watch a site’s URL inventory for confirmed additions and removals. */ export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ type: 'sitemap'; /** @@ -1150,11 +1658,8 @@ export namespace MonitorUpdateResponse { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -1163,6 +1668,9 @@ export namespace MonitorUpdateResponse { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -1170,6 +1678,9 @@ export namespace MonitorUpdateResponse { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -1183,18 +1694,36 @@ export namespace MonitorUpdateResponse { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + /** * Current baseline of a `page` monitor: the visible page text as last observed. */ @@ -1242,10 +1771,8 @@ export namespace MonitorUpdateResponse { captured_at: string; /** - * The extracted structured data, matching the monitor's extraction schema (same - * shape as the /web/extract endpoint's `data`). Refreshed when the monitor - * re-discovers its page set (at most about once a day); `null` when no extraction - * has been captured yet. + * Latest structured snapshot matching the extraction schema, refreshed at most + * daily; `null` before capture. */ data: unknown; @@ -1256,46 +1783,122 @@ export namespace MonitorUpdateResponse { } /** - * Error from the most recent failed run; null when the last run succeeded. + * Current baseline of a `search` monitor: the search results as last observed. */ - export interface LastError { - code: string; - - message: string; - } - - export interface Webhook { + export interface MonitorsSearchBaseline { /** - * Webhook URL events are delivered to. - */ - url: string; - - /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * When this baseline was last captured or replaced. */ - events?: Array<'change.detected' | 'run.completed'>; + captured_at: string; /** - * Signing secret used to verify webhook authenticity. Each delivery includes an - * `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over - * `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time - * compare and reject stale timestamps to prevent replay. Generated by the API; - * cannot be set by clients. + * Search results as last observed. */ - secret?: string; + results: Array; } - /** - * Present while webhook deliveries are failing consecutively; null when deliveries - * are healthy or no webhook is configured. Cleared on the next successful delivery - * and when the webhook URL changes. - */ - export interface WebhookFailure { - /** - * Number of consecutive delivery attempts that did not succeed. + export namespace MonitorsSearchBaseline { + export interface Result { + /** + * Result snippet. + */ + description: string; + + /** + * When the result was published, when known. + */ + published_at: string | null; + + title: string; + + url: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + + /** + * Error from the most recent failed run; null when the last run succeeded. + */ + export interface LastError { + code: string; + + message: string; + } + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + export interface Schedule { + /** + * Number of units between runs. The resulting interval (frequency × unit) must be + * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; + * maximum 365 when unit is days). + */ + frequency: number; + + /** + * Use `interval` to run on a repeating schedule. + */ + type: 'interval'; + + /** + * Time unit used with `frequency` to set the run interval. + */ + unit: 'minutes' | 'hours' | 'days'; + } + + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ + export interface Webhook { + /** + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. + */ + url: string; + + /** + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. + */ + events?: Array<'change.detected' | 'run.completed'>; + + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; + + /** + * API-generated signing secret. Visible only with full access or `monitors:write` + * permission. + */ + secret?: string; + } + + /** + * Present while webhook deliveries are failing consecutively; null when deliveries + * are healthy or no webhook is configured. Cleared on the next successful delivery + * and when the webhook URL changes. + */ + export interface WebhookFailure { + /** + * Number of consecutive delivery attempts that did not succeed. */ consecutive_failures: number; @@ -1321,26 +1924,37 @@ export interface MonitorListResponse { has_more: boolean; next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorListResponse.KeyMetadata; } export namespace MonitorListResponse { /** * A web monitor. `mode` is the constant `web`; behavior is described by `target` - * (page/sitemap/extract) and `change_detection` (exact/semantic). + * (page/sitemap/extract/search) and `change_detection` (exact/semantic). */ export interface Data { id: string; /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection: Data.MonitorsExactChangeDetection | Data.MonitorsSemanticChangeDetection; created_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; @@ -1354,28 +1968,33 @@ export namespace MonitorListResponse { schedule: Data.Schedule; /** - * Monitor lifecycle status. `failed` means the most recent run failed (see the - * monitor's `last_error`); failed monitors keep running on schedule and flip back - * to `active` on the next successful run. Monitors are auto-`paused` after - * repeated consecutive failures or insufficient-credit skips; resume by PATCHing - * status to `active`. + * Current state. Failed monitors keep running; paused monitors must be resumed + * with `status: "active"`. */ status: 'active' | 'paused' | 'failed'; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ - target: Data.MonitorsPageTarget | Data.MonitorsSitemapTarget | Data.MonitorsExtractTarget; + target: + | Data.MonitorsPageTarget + | Data.MonitorsSitemapTarget + | Data.MonitorsExtractTarget + | Data.MonitorsSearchTarget; updated_at: string; /** - * Current baseline: the last observed value the monitor compares new snapshots - * against. Its shape follows `target.type` (page/sitemap/extract). Only populated - * on GET /monitors/{monitor_id}; null until the first baseline run completes (and - * after a target or change_detection update, which resets the baseline). + * Comparison baseline, included on Retrieve. Null until capture completes or after + * target changes. */ - baseline?: Data.MonitorsPageBaseline | Data.MonitorsSitemapBaseline | Data.MonitorsExtractBaseline | null; + baseline?: + | Data.MonitorsPageBaseline + | Data.MonitorsSitemapBaseline + | Data.MonitorsExtractBaseline + | Data.MonitorsSearchBaseline + | null; last_change_at?: string | null; @@ -1387,16 +2006,23 @@ export namespace MonitorListResponse { last_run_at?: string | null; /** - * When the next scheduled run is due. + * When the next scheduled run is due; null while paused. */ next_run_at?: string | null; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Access policy IDs applied to every run. + */ + policies?: Array; + + /** + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ webhook?: Data.Webhook | null; /** @@ -1410,21 +2036,29 @@ export namespace MonitorListResponse { export namespace Data { /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; + /** + * Minimum confidence required to report a meaningful change, from 0 to 1. + */ confidence_threshold?: number; } @@ -1441,8 +2075,14 @@ export namespace MonitorListResponse { */ frequency: number; + /** + * Use `interval` to run on a repeating schedule. + */ type: 'interval'; + /** + * Time unit used with `frequency` to set the run interval. + */ unit: 'minutes' | 'hours' | 'days'; } @@ -1451,10 +2091,38 @@ export namespace MonitorListResponse { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -1467,14 +2135,78 @@ export namespace MonitorListResponse { normalize_whitespace?: boolean; } + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. + * Watch a site’s URL inventory for confirmed additions and removals. */ export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ type: 'sitemap'; /** @@ -1499,11 +2231,8 @@ export namespace MonitorListResponse { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -1512,6 +2241,9 @@ export namespace MonitorListResponse { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -1519,6 +2251,9 @@ export namespace MonitorListResponse { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -1532,18 +2267,36 @@ export namespace MonitorListResponse { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + /** * Current baseline of a `page` monitor: the visible page text as last observed. */ @@ -1591,10 +2344,8 @@ export namespace MonitorListResponse { captured_at: string; /** - * The extracted structured data, matching the monitor's extraction schema (same - * shape as the /web/extract endpoint's `data`). Refreshed when the monitor - * re-discovers its page set (at most about once a day); `null` when no extraction - * has been captured yet. + * Latest structured snapshot matching the extraction schema, refreshed at most + * daily; `null` before capture. */ data: unknown; @@ -1604,6 +2355,39 @@ export namespace MonitorListResponse { urls_analyzed: Array; } + /** + * Current baseline of a `search` monitor: the search results as last observed. + */ + export interface MonitorsSearchBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Search results as last observed. + */ + results: Array; + } + + export namespace MonitorsSearchBaseline { + export interface Result { + /** + * Result snippet. + */ + description: string; + + /** + * When the result was published, when known. + */ + published_at: string | null; + + title: string; + + url: string; + } + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -1613,26 +2397,30 @@ export namespace MonitorListResponse { message: string; } + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ export interface Webhook { /** - * Webhook URL events are delivered to. + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. */ url: string; /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. */ events?: Array<'change.detected' | 'run.completed'>; /** - * Signing secret used to verify webhook authenticity. Each delivery includes an - * `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over - * `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time - * compare and reject stale timestamps to prevent replay. Generated by the API; - * cannot be set by clients. + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; + + /** + * API-generated signing secret. Visible only with full access or `monitors:write` + * permission. */ secret?: string; } @@ -1663,21 +2451,75 @@ export namespace MonitorListResponse { last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; } } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorDeleteResponse { id: string; deleted: boolean; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorDeleteResponse.KeyMetadata; +} + +export namespace MonitorDeleteResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorGetCreditUsageResponse { data: Array; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Sum of credits across all monitors in the window. */ total_credits: number; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorGetCreditUsageResponse.KeyMetadata; } export namespace MonitorGetCreditUsageResponse { @@ -1699,12 +2541,26 @@ export namespace MonitorGetCreditUsageResponse { */ runs: number; } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorGetLimitsResponse { /** - * Maximum number of monitors allowed for the account. Defaults to the plan - * allowance unless a custom limit is set for the organization. + * Most monitors you can have: your plan's allowance or a custom limit. */ monitors_limit: number; @@ -1714,9 +2570,38 @@ export interface MonitorGetLimitsResponse { monitors_used: number; /** - * The plan tier the limit was resolved from. + * `starter` means Developer; `pro` means Pro or Growth; `scale` means Scale or + * Enterprise. */ plan: 'free' | 'starter' | 'pro' | 'scale'; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorGetLimitsResponse.KeyMetadata; +} + +export namespace MonitorGetLimitsResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorListAccountChangesResponse { @@ -1725,15 +2610,22 @@ export interface MonitorListAccountChangesResponse { has_more: boolean; next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorListAccountChangesResponse.KeyMetadata; } export namespace MonitorListAccountChangesResponse { /** - * A lightweight change summary. `mode` is the constant `web`; `target_type` and - * `change_detection_type` describe the change, and which optional fields are - * present depends on them (e.g. sitemap changes include - * `added_url_count`/`removed_url_count`; semantic changes include - * `confidence`/`importance`). + * Detected change, including applicable diffs, URLs, and supporting evidence. */ export interface Data { id: string; @@ -1743,46 +2635,123 @@ export namespace MonitorListAccountChangesResponse { detected_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; monitor_id: string; + /** + * The run that detected this change. + */ + run_id: string; + summary: string; - target_type: 'page' | 'sitemap' | 'extract'; + /** + * Labels for filtering monitors, their changes, and their usage. + */ + tags: Array; + + target_type: 'page' | 'sitemap' | 'extract' | 'search'; title: string; + /** + * The monitored URL. For search targets, the first newly reported result. + */ url: string; added_url_count?: number; + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + added_urls?: Array; + + after_text_excerpt?: string; + + before_text_excerpt?: string; + confidence?: number; + /** + * Text diff between the previous and current page baseline (page targets). + */ + diff?: string; + + evidence?: Array; + importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + matched_urls?: Array; + removed_url_count?: number; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * At most 500 URLs are included; the corresponding count field is always exact. */ - tags?: Array; + removed_urls?: Array; } -} -export interface MonitorListAccountRunsResponse { - data: Array; + export namespace Data { + export interface Evidence { + /** + * Snapshot of the content after the change. + */ + after: string; - has_more: boolean; + /** + * Snapshot of the content before the change. + */ + before: string; - next_cursor: string | null; -} + /** + * Optional URL the evidence relates to. Absent for whole-target diffs. + */ + url?: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface MonitorListAccountRunsResponse { + data: Array; + + has_more: boolean; + + next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorListAccountRunsResponse.KeyMetadata; +} export namespace MonitorListAccountRunsResponse { export interface Data { @@ -1806,7 +2775,7 @@ export namespace MonitorListAccountRunsResponse { monitor_id: string; /** - * The first run after monitor creation is a baseline run. + * A baseline run follows creation or a target or detection change. */ run_type: 'baseline' | 'scheduled'; @@ -1816,7 +2785,7 @@ export namespace MonitorListAccountRunsResponse { */ status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; - target_type: 'page' | 'sitemap' | 'extract'; + target_type: 'page' | 'sitemap' | 'extract' | 'search'; change_id?: string | null; @@ -1839,11 +2808,14 @@ export namespace MonitorListAccountRunsResponse { webhook_deliveries?: Array; /** - * @deprecated Deprecated: use `webhook_deliveries`, which records every attempt - * now that a run can deliver multiple events. Omitted when no webhook was - * attempted, including historical runs created before delivery tracking was added. + * @deprecated Deprecated. Use `webhook_deliveries` for all attempts. */ webhook_delivery?: MonitorsAPI.WebhookDelivery; + + /** + * Webhook delivery IDs for this run. + */ + webhook_delivery_ids?: Array; } export namespace Data { @@ -1853,6 +2825,21 @@ export namespace MonitorListAccountRunsResponse { message: string; } } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorListChangesResponse { @@ -1861,15 +2848,22 @@ export interface MonitorListChangesResponse { has_more: boolean; next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorListChangesResponse.KeyMetadata; } export namespace MonitorListChangesResponse { /** - * A lightweight change summary. `mode` is the constant `web`; `target_type` and - * `change_detection_type` describe the change, and which optional fields are - * present depends on them (e.g. sitemap changes include - * `added_url_count`/`removed_url_count`; semantic changes include - * `confidence`/`importance`). + * Detected change, including applicable diffs, URLs, and supporting evidence. */ export interface Data { id: string; @@ -1879,36 +2873,102 @@ export namespace MonitorListChangesResponse { detected_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; monitor_id: string; + /** + * The run that detected this change. + */ + run_id: string; + summary: string; - target_type: 'page' | 'sitemap' | 'extract'; + /** + * Labels for filtering monitors, their changes, and their usage. + */ + tags: Array; + + target_type: 'page' | 'sitemap' | 'extract' | 'search'; title: string; + /** + * The monitored URL. For search targets, the first newly reported result. + */ url: string; added_url_count?: number; + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + added_urls?: Array; + + after_text_excerpt?: string; + + before_text_excerpt?: string; + confidence?: number; + /** + * Text diff between the previous and current page baseline (page targets). + */ + diff?: string; + + evidence?: Array; + importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + matched_urls?: Array; + removed_url_count?: number; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * At most 500 URLs are included; the corresponding count field is always exact. */ - tags?: Array; + removed_urls?: Array; + } + + export namespace Data { + export interface Evidence { + /** + * Snapshot of the content after the change. + */ + after: string; + + /** + * Snapshot of the content before the change. + */ + before: string; + + /** + * Optional URL the evidence relates to. Absent for whole-target diffs. + */ + url?: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; } } @@ -1918,6 +2978,17 @@ export interface MonitorListRunsResponse { has_more: boolean; next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorListRunsResponse.KeyMetadata; } export namespace MonitorListRunsResponse { @@ -1942,7 +3013,7 @@ export namespace MonitorListRunsResponse { monitor_id: string; /** - * The first run after monitor creation is a baseline run. + * A baseline run follows creation or a target or detection change. */ run_type: 'baseline' | 'scheduled'; @@ -1952,7 +3023,7 @@ export namespace MonitorListRunsResponse { */ status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; - target_type: 'page' | 'sitemap' | 'extract'; + target_type: 'page' | 'sitemap' | 'extract' | 'search'; change_id?: string | null; @@ -1975,11 +3046,14 @@ export namespace MonitorListRunsResponse { webhook_deliveries?: Array; /** - * @deprecated Deprecated: use `webhook_deliveries`, which records every attempt - * now that a run can deliver multiple events. Omitted when no webhook was - * attempted, including historical runs created before delivery tracking was added. + * @deprecated Deprecated. Use `webhook_deliveries` for all attempts. */ webhook_delivery?: MonitorsAPI.WebhookDelivery; + + /** + * Webhook delivery IDs for this run. + */ + webhook_delivery_ids?: Array; } export namespace Data { @@ -1989,15 +3063,23 @@ export namespace MonitorListRunsResponse { message: string; } } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } -/** - * A detected change. `mode` is the constant `web`; `target_type` and - * `change_detection_type` describe the change, and which optional fields are - * present depends on them (page: `diff` + excerpts; sitemap: - * `added_urls`/`removed_urls`; semantic: - * `confidence`/`importance`/`evidence`/`matched_urls`). - */ export interface MonitorRetrieveChangeResponse { id: string; @@ -2006,13 +3088,18 @@ export interface MonitorRetrieveChangeResponse { detected_at: string; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode: 'web'; monitor_id: string; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * The run that detected this change. */ @@ -2021,15 +3108,17 @@ export interface MonitorRetrieveChangeResponse { summary: string; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Labels for filtering monitors, their changes, and their usage. */ tags: Array; - target_type: 'page' | 'sitemap' | 'extract'; + target_type: 'page' | 'sitemap' | 'extract' | 'search'; title: string; + /** + * The monitored URL. For search targets, the first newly reported result. + */ url: string; added_url_count?: number; @@ -2046,45 +3135,701 @@ export interface MonitorRetrieveChangeResponse { confidence?: number; /** - * Text diff between the previous and current page baseline (page targets). + * Text diff between the previous and current page baseline (page targets). + */ + diff?: string; + + evidence?: Array; + + importance?: 'low' | 'medium' | 'high'; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorRetrieveChangeResponse.KeyMetadata; + + matched_url_count?: number; + + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + matched_urls?: Array; + + removed_url_count?: number; + + /** + * At most 500 URLs are included; the corresponding count field is always exact. + */ + removed_urls?: Array; +} + +export namespace MonitorRetrieveChangeResponse { + export interface Evidence { + /** + * Snapshot of the content after the change. + */ + after: string; + + /** + * Snapshot of the content before the change. + */ + before: string; + + /** + * Optional URL the evidence relates to. Absent for whole-target diffs. + */ + url?: string; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface MonitorRetrieveRunResponse { + id: string; + + /** + * True when this run established the monitor's initial baseline; baseline runs + * perform no change detection. + */ + baseline_created: boolean; + + change_detected: boolean; + + change_detection_type: 'exact' | 'semantic'; + + /** + * Credits charged for this run (0 for skipped/failed runs). + */ + credits_charged: number; + + monitor_id: string; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * A baseline run follows creation or a target or detection change. + */ + run_type: 'baseline' | 'scheduled'; + + /** + * Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` + * (insufficient credits, monitor paused, or superseded by a concurrent run). + */ + status: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; + + target_type: 'page' | 'sitemap' | 'extract' | 'search'; + + change_id?: string | null; + + completed_at?: string | null; + + error?: MonitorRetrieveRunResponse.Error | null; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorRetrieveRunResponse.KeyMetadata; + + /** + * Why a skipped run never executed; null unless status is `skipped`. + */ + skip_reason?: 'insufficient_credits' | 'monitor_paused' | 'superseded' | null; + + started_at?: string | null; + + /** + * All webhook deliveries attempted by this run — one per subscribed event that + * fired. Omitted when no webhook was attempted, including runs created before + * event selection was added. + */ + webhook_deliveries?: Array; + + /** + * @deprecated Deprecated. Use `webhook_deliveries` for all attempts. + */ + webhook_delivery?: WebhookDelivery; + + /** + * Webhook delivery IDs for this run. + */ + webhook_delivery_ids?: Array; +} + +export namespace MonitorRetrieveRunResponse { + export interface Error { + code: string; + + message: string; + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface MonitorRotateWebhookSecretResponse { + id: string; + + /** + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. + */ + change_detection: + | MonitorRotateWebhookSecretResponse.MonitorsExactChangeDetection + | MonitorRotateWebhookSecretResponse.MonitorsSemanticChangeDetection; + + created_at: string; + + /** + * Always `web`. Optional. + */ + mode: 'web'; + + name: string; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Current state. Failed monitors keep running; paused monitors must be resumed + * with `status: "active"`. + */ + status: 'active' | 'paused' | 'failed'; + + /** + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. + */ + target: + | MonitorRotateWebhookSecretResponse.MonitorsPageTarget + | MonitorRotateWebhookSecretResponse.MonitorsSitemapTarget + | MonitorRotateWebhookSecretResponse.MonitorsExtractTarget + | MonitorRotateWebhookSecretResponse.MonitorsSearchTarget; + + updated_at: string; + + /** + * Comparison baseline, included on Retrieve. Null until capture completes or after + * target changes. + */ + baseline?: + | MonitorRotateWebhookSecretResponse.MonitorsPageBaseline + | MonitorRotateWebhookSecretResponse.MonitorsSitemapBaseline + | MonitorRotateWebhookSecretResponse.MonitorsExtractBaseline + | MonitorRotateWebhookSecretResponse.MonitorsSearchBaseline + | null; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorRotateWebhookSecretResponse.KeyMetadata; + + last_change_at?: string | null; + + /** + * Error from the most recent failed run; null when the last run succeeded. + */ + last_error?: MonitorRotateWebhookSecretResponse.LastError | null; + + last_run_at?: string | null; + + /** + * When the next scheduled run is due; null while paused. + */ + next_run_at?: string | null; + + /** + * Access policy IDs applied to every run. + */ + policies?: Array; + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + schedule?: MonitorRotateWebhookSecretResponse.Schedule; + + /** + * Labels for filtering monitors, their changes, and their usage. + */ + tags?: Array; + + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ + webhook?: MonitorRotateWebhookSecretResponse.Webhook | null; + + /** + * Present while webhook deliveries are failing consecutively; null when deliveries + * are healthy or no webhook is configured. Cleared on the next successful delivery + * and when the webhook URL changes. + */ + webhook_failure?: MonitorRotateWebhookSecretResponse.WebhookFailure | null; +} + +export namespace MonitorRotateWebhookSecretResponse { + /** + * Detect exact changes. For page targets, this means visible text diffs. For + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. + */ + export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ + type: 'exact'; + } + + /** + * Detect meaningful content changes using the target’s instructions and optional + * schema. + */ + export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ + type: 'semantic'; + + /** + * Minimum confidence required to report a meaningful change, from 0 to 1. + */ + confidence_threshold?: number; + } + + /** + * Watch a single web page. Exact detection reports visible-text diffs; semantic + * detection judges confirmed stable diffs against `instructions`. + */ + export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ + type: 'page'; + + /** + * Public HTTP(S) page URL to monitor. + */ + url: string; + + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + + /** + * Plain-language goal describing which page changes matter. When provided without + * change_detection, semantic detection is inferred. + */ + instructions?: string; + + /** + * Normalize whitespace before comparing or analyzing text. + */ + normalize_whitespace?: boolean; + } + + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + + /** + * Watch a site’s URL inventory for confirmed additions and removals. + */ + export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ + type: 'sitemap'; + + /** + * Sitemap URL to monitor. + */ + url: string; + + /** + * URL path patterns to exclude (max 50). + */ + exclude?: Array; + + /** + * URL path patterns to include (max 50). + */ + include?: Array; + + /** + * Maximum number of sitemap URLs to track (capped at 10,000). + */ + max_urls?: number; + } + + /** + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. + */ + export interface MonitorsExtractTarget { + /** + * Natural-language instructions guiding which pages and facts to track and which + * changes to report. + */ + instructions: string; + + /** + * Use `extract` to watch structured data across selected pages. + */ + type: 'extract'; + + /** + * Root URL to extract structured data from. + */ + url: string; + + /** + * Allow page discovery on subdomains of the target site. + */ + follow_subdomains?: boolean; + + /** + * Optional maximum link depth from the starting URL (0 = only the starting page). + */ + max_depth?: number; + + /** + * Maximum number of pages to track. + */ + max_pages?: number; + + /** + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. + */ + schema?: { [key: string]: unknown }; + } + + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + + /** + * Current baseline of a `page` monitor: the visible page text as last observed. + */ + export interface MonitorsPageBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The page's visible text as last observed. + */ + text: string; + } + + /** + * Current baseline of a `sitemap` monitor: the normalized URL set as last + * observed. + */ + export interface MonitorsSitemapBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Number of URLs in the baseline. + */ + url_count: number; + + /** + * The sitemap URLs as last observed (sorted, normalized). + */ + urls: Array; + } + + /** + * Current baseline of an `extract` monitor: the pages it tracks and the structured + * data as last extracted. + */ + export interface MonitorsExtractBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Latest structured snapshot matching the extraction schema, refreshed at most + * daily; `null` before capture. + */ + data: unknown; + + /** + * The page URLs the monitor tracks and analyzes for changes. + */ + urls_analyzed: Array; + } + + /** + * Current baseline of a `search` monitor: the search results as last observed. + */ + export interface MonitorsSearchBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Search results as last observed. + */ + results: Array; + } + + export namespace MonitorsSearchBaseline { + export interface Result { + /** + * Result snippet. + */ + description: string; + + /** + * When the result was published, when known. + */ + published_at: string | null; + + title: string; + + url: string; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } + + /** + * Error from the most recent failed run; null when the last run succeeded. + */ + export interface LastError { + code: string; + + message: string; + } + + /** + * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. + * every 6 hours or every 2 days. The total interval (frequency × unit) must be + * between 10 minutes and 1 year. + */ + export interface Schedule { + /** + * Number of units between runs. The resulting interval (frequency × unit) must be + * at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; + * maximum 365 when unit is days). + */ + frequency: number; + + /** + * Use `interval` to run on a repeating schedule. + */ + type: 'interval'; + + /** + * Time unit used with `frequency` to set the run interval. + */ + unit: 'minutes' | 'hours' | 'days'; + } + + /** + * Webhook destination and delivery settings. Null means no webhook is configured. */ - diff?: string; - - evidence?: Array; - - importance?: 'low' | 'medium' | 'high'; + export interface Webhook { + /** + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. + */ + url: string; - matched_url_count?: number; + /** + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. + */ + events?: Array<'change.detected' | 'run.completed'>; - /** - * At most 500 URLs are included; the corresponding count field is always exact. - */ - matched_urls?: Array; + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; - removed_url_count?: number; + /** + * API-generated signing secret. Visible only with full access or `monitors:write` + * permission. + */ + secret?: string; + } /** - * At most 500 URLs are included; the corresponding count field is always exact. + * Present while webhook deliveries are failing consecutively; null when deliveries + * are healthy or no webhook is configured. Cleared on the next successful delivery + * and when the webhook URL changes. */ - removed_urls?: Array; -} - -export namespace MonitorRetrieveChangeResponse { - export interface Evidence { + export interface WebhookFailure { /** - * Snapshot of the content after the change. + * Number of consecutive delivery attempts that did not succeed. */ - after: string; + consecutive_failures: number; + + last_failed_at: string; /** - * Snapshot of the content before the change. + * Human-readable description of the most recent failure. */ - before: string; + last_message: string; /** - * Optional URL the evidence relates to. Absent for whole-target diffs. + * Outcome of the most recent failed delivery. rejected means a non-2xx response; + * failed means no HTTP response was received; skipped_unsafe_url means the URL + * failed the public-endpoint safety check. */ - url?: string; + last_status: 'rejected' | 'failed' | 'skipped_unsafe_url'; } } @@ -2094,36 +3839,73 @@ export interface MonitorRunResponse { queued: boolean; /** - * The queued run. Poll GET /monitors/{monitor_id}/runs or use it to correlate - * results. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * ID of the queued run; pass it to Retrieve a monitor run. */ run_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: MonitorRunResponse.KeyMetadata; +} + +export namespace MonitorRunResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } } export interface MonitorCreateParams { + /** + * Display name for the monitor. + */ name: string; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ target: | MonitorCreateParams.MonitorsPageTarget | MonitorCreateParams.MonitorsSitemapTarget - | MonitorCreateParams.MonitorsExtractTarget; + | MonitorCreateParams.MonitorsExtractTarget + | MonitorCreateParams.MonitorsSearchTarget; /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection?: | MonitorCreateParams.MonitorsExactChangeDetection | MonitorCreateParams.MonitorsSemanticChangeDetection; /** - * Top-level monitor category. Always `web` today; the concrete behavior is - * described by `target` and `change_detection`. + * Always `web`. Optional. */ mode?: 'web'; + /** + * Access policy IDs to apply to every run. + */ + policies?: Array; + /** * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. * every 6 hours or every 2 days. The total interval (frequency × unit) must be @@ -2132,11 +3914,13 @@ export interface MonitorCreateParams { schedule?: MonitorCreateParams.Schedule; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ webhook?: MonitorCreateParams.Webhook | null; } @@ -2146,10 +3930,38 @@ export namespace MonitorCreateParams { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -2162,14 +3974,78 @@ export namespace MonitorCreateParams { normalize_whitespace?: boolean; } + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. + * Watch a site’s URL inventory for confirmed additions and removals. */ export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ type: 'sitemap'; /** @@ -2194,11 +4070,8 @@ export namespace MonitorCreateParams { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -2207,6 +4080,9 @@ export namespace MonitorCreateParams { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -2214,6 +4090,9 @@ export namespace MonitorCreateParams { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -2227,35 +4106,61 @@ export namespace MonitorCreateParams { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } + /** + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; + /** + * Minimum confidence required to report a meaningful change, from 0 to 1. + */ confidence_threshold?: number; } @@ -2272,37 +4177,59 @@ export namespace MonitorCreateParams { */ frequency: number; + /** + * Use `interval` to run on a repeating schedule. + */ type: 'interval'; + /** + * Time unit used with `frequency` to set the run interval. + */ unit: 'minutes' | 'hours' | 'days'; } + /** + * Webhook destination and delivery settings. Null means no webhook is configured. + */ export interface Webhook { /** - * Webhook URL events are delivered to. + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. */ url: string; /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. */ events?: Array<'change.detected' | 'run.completed'>; + + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; } } export interface MonitorUpdateParams { /** - * Discriminated union describing how changes are detected. + * How changes are judged. Defaults to `semantic` for extract and search targets + * and page targets with `instructions`, otherwise `exact`. */ change_detection?: | MonitorUpdateParams.MonitorsExactChangeDetection | MonitorUpdateParams.MonitorsSemanticChangeDetection; + /** + * Display name for the monitor. + */ name?: string; + /** + * Access policy IDs to apply to every run. Send an empty list to remove them. + */ + policies?: Array; + /** * Run the monitor on a fixed interval defined by a frequency and a unit, e.g. * every 6 hours or every 2 days. The total interval (frequency × unit) must be @@ -2310,24 +4237,28 @@ export interface MonitorUpdateParams { */ schedule?: MonitorUpdateParams.Schedule; + /** + * Set `paused` to stop scheduled runs or `active` to resume them. + */ status?: 'active' | 'paused'; /** - * User-defined tags for grouping and filtering monitors and their changes. - * Duplicates are removed. + * Labels for filtering monitors, their changes, and their usage. */ tags?: Array; /** - * Discriminated union describing what the monitor watches. + * What to watch: a page, a sitemap, data extracted from a site, or web search + * results. */ target?: | MonitorUpdateParams.MonitorsPageTarget | MonitorUpdateParams.MonitorsSitemapTarget - | MonitorUpdateParams.MonitorsExtractTarget; + | MonitorUpdateParams.MonitorsExtractTarget + | MonitorUpdateParams.MonitorsSearchTarget; /** - * Set to null to remove the webhook. + * Set to null to remove the webhook. Changing `url` issues a new secret. */ webhook?: MonitorUpdateParams.Webhook | null; } @@ -2335,21 +4266,29 @@ export interface MonitorUpdateParams { export namespace MonitorUpdateParams { /** * Detect exact changes. For page targets, this means visible text diffs. For - * sitemap targets, this means URL additions and removals. + * sitemap targets, this means URL additions and removals. For search targets, this + * means every new result. */ export interface MonitorsExactChangeDetection { + /** + * Use `exact` to compare visible text, sitemap URLs, or search results. + */ type: 'exact'; } /** - * Detect meaning-level changes to page content, ignoring cosmetic or - * instruction-irrelevant differences. Which changes are meaningful is judged - * against the page or extract target's `instructions` (and an extract target's - * `schema`, when provided). + * Detect meaningful content changes using the target’s instructions and optional + * schema. */ export interface MonitorsSemanticChangeDetection { + /** + * Use `semantic` to judge changes against the target instructions. + */ type: 'semantic'; + /** + * Minimum confidence required to report a meaningful change, from 0 to 1. + */ confidence_threshold?: number; } @@ -2366,8 +4305,14 @@ export namespace MonitorUpdateParams { */ frequency: number; + /** + * Use `interval` to run on a repeating schedule. + */ type: 'interval'; + /** + * Time unit used with `frequency` to set the run interval. + */ unit: 'minutes' | 'hours' | 'days'; } @@ -2376,10 +4321,38 @@ export namespace MonitorUpdateParams { * detection judges confirmed stable diffs against `instructions`. */ export interface MonitorsPageTarget { + /** + * Use `page` to watch one web page. + */ type: 'page'; + /** + * Public HTTP(S) page URL to monitor. + */ url: string; + /** + * Optional browser actions executed in array order after the page loads, before + * content is captured, on every run. Requires a paid plan. Maximum: 5 actions. + * Changes create a new baseline. + */ + actions?: Array< + | MonitorsPageTarget.WebScrapeWaitAction + | MonitorsPageTarget.WebScrapePerformAction + | MonitorsPageTarget.WebScrapeScrollAction + > | null; + + /** + * Remove matching regions after inclusions. Changes create a new baseline. + */ + exclude_selectors?: Array; + + /** + * Monitor these CSS-selected regions. Empty or omitted uses main content. Changes + * create a new baseline. + */ + include_selectors?: Array; + /** * Plain-language goal describing which page changes matter. When provided without * change_detection, semantic detection is inferred. @@ -2392,14 +4365,78 @@ export namespace MonitorUpdateParams { normalize_whitespace?: boolean; } + export namespace MonitorsPageTarget { + /** + * Pause for a fixed number of milliseconds before continuing to the next action. + */ + export interface WebScrapeWaitAction { + /** + * Use `wait` to pause for a fixed duration. + */ + do: 'wait'; + + /** + * Time to pause in milliseconds before the next action. + */ + timeMs: number; + } + + /** + * Resolve and perform one natural-language browser action. + */ + export interface WebScrapePerformAction { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + do: 'perform'; + } + + /** + * Scroll the page or a selected scrollable container, waiting adaptively for + * content and dimensions to settle after each iteration. + */ + export interface WebScrapeScrollAction { + /** + * Use `scroll` to move through the page or a container. + */ + do: 'scroll'; + + /** + * Pixels per scroll, one visible viewport, or the current scroll boundary. + * Defaults to viewport. + */ + amount?: number | 'viewport' | 'max'; + + /** + * CSS selector for the first matching scroll container. Defaults to the page. + */ + container?: string; + + /** + * Direction to scroll. Defaults to down. + */ + direction?: 'up' | 'down' | 'left' | 'right'; + + /** + * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop + * changing. Defaults to 1. + */ + maxScrolls?: number; + } + } + /** - * Watch a sitemap for URL additions and removals. Crawled URLs are normalized - * (lowercased host, no trailing slash/fragment) and scoped to the monitored site - * and its subdomains before comparison. On a detected difference the sitemap is - * re-fetched within the same run and only URLs both observations agree on are - * reported, suppressing transient crawl flaps. + * Watch a site’s URL inventory for confirmed additions and removals. */ export interface MonitorsSitemapTarget { + /** + * Use `sitemap` to watch a site for added or removed URLs. + */ type: 'sitemap'; /** @@ -2424,11 +4461,8 @@ export namespace MonitorUpdateParams { } /** - * Watch the monitor-relevant pages of a site for meaningful changes. A crawl - * guided by `schema`/`instructions` selects up to `max_pages` relevant pages to - * track; each run re-checks exactly those pages, and confirmed content changes are - * judged for relevance against the monitor's `instructions` (and `schema`, when - * provided). The tracked page set is refreshed by a periodic re-discovery crawl. + * Track relevant pages selected by `schema` and `instructions`; refresh the page + * set periodically. */ export interface MonitorsExtractTarget { /** @@ -2437,6 +4471,9 @@ export namespace MonitorUpdateParams { */ instructions: string; + /** + * Use `extract` to watch structured data across selected pages. + */ type: 'extract'; /** @@ -2444,6 +4481,9 @@ export namespace MonitorUpdateParams { */ url: string; + /** + * Allow page discovery on subdomains of the target site. + */ follow_subdomains?: boolean; /** @@ -2457,34 +4497,56 @@ export namespace MonitorUpdateParams { max_pages?: number; /** - * JSON Schema describing the data you care about. It is used three ways: it guides - * which pages are selected for tracking, it gives the change judge extra context - * on which changes matter (alongside `instructions`), and it defines the shape of - * the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most - * about once a day). It is not a response format for changes: change events and - * webhook payloads always contain diffs, summaries, and evidence excerpts — never - * data in this schema's shape. If omitted, a default summary + key-points schema - * is used. + * JSON Schema for page selection and the baseline snapshot. Changes return diffs + * and evidence. */ schema?: { [key: string]: unknown }; } /** - * Set to null to remove the webhook. + * Search the web on every run and report results not seen before, listed in the + * change’s `matched_urls` and `evidence`. Semantic detection reports only results + * describing a new development that matches `instructions`; exact detection + * reports every new result. + */ + export interface MonitorsSearchTarget { + /** + * Web search query to run on every check. Supports operators such as `site:`, + * `-site:`, and quoted phrases. + */ + query: string; + + /** + * Use `search` to watch the whole web for new results about a topic. + */ + type: 'search'; + + /** + * Plain-language description of which new results matter. Defaults to the query. + */ + instructions?: string; + } + + /** + * Set to null to remove the webhook. Changing `url` issues a new secret. */ export interface Webhook { /** - * Webhook URL events are delivered to. + * Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted + * messages. */ url: string; /** - * Events delivered to this endpoint. `change.detected` fires only when a run - * detects a change; `run.completed` fires on every completed run — including runs - * that detected no change — and embeds the change when one was detected. Defaults - * to `["change.detected"]` when omitted. + * Events to deliver. Defaults to `change.detected`; `run.completed` also includes + * unchanged runs. */ events?: Array<'change.detected' | 'run.completed'>; + + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry?: WebhooksAPI.RetryConfig; } } @@ -2510,8 +4572,8 @@ export interface MonitorListParams { q?: string; /** - * Comma-separated fields to search with `q`. Defaults to all of them. Note - * `instructions` only exists on extract monitors. + * Fields to search with `q`. Defaults to all fields; page, extract, and search + * targets can have instructions, and `url` matches a search target’s query. */ search_by?: Array<'name' | 'url' | 'instructions' | 'tags'> | null; @@ -2539,7 +4601,7 @@ export interface MonitorListParams { /** * Filter by target type. */ - target_type?: 'page' | 'sitemap' | 'extract'; + target_type?: 'page' | 'sitemap' | 'extract' | 'search'; } export interface MonitorGetCreditUsageParams { @@ -2588,7 +4650,7 @@ export interface MonitorListAccountChangesParams { /** * Filter by target type. */ - target_type?: 'page' | 'sitemap' | 'extract'; + target_type?: 'page' | 'sitemap' | 'extract' | 'search'; /** * Only include items before this ISO 8601 timestamp. @@ -2657,6 +4719,13 @@ export interface MonitorListRunsParams { status?: 'queued' | 'running' | 'completed' | 'failed' | 'skipped'; } +export interface MonitorRetrieveRunParams { + /** + * ID of the monitor. + */ + monitor_id: string; +} + export declare namespace Monitors { export { type WebhookDelivery as WebhookDelivery, @@ -2672,6 +4741,8 @@ export declare namespace Monitors { type MonitorListChangesResponse as MonitorListChangesResponse, type MonitorListRunsResponse as MonitorListRunsResponse, type MonitorRetrieveChangeResponse as MonitorRetrieveChangeResponse, + type MonitorRetrieveRunResponse as MonitorRetrieveRunResponse, + type MonitorRotateWebhookSecretResponse as MonitorRotateWebhookSecretResponse, type MonitorRunResponse as MonitorRunResponse, type MonitorCreateParams as MonitorCreateParams, type MonitorUpdateParams as MonitorUpdateParams, @@ -2681,5 +4752,6 @@ export declare namespace Monitors { type MonitorListAccountRunsParams as MonitorListAccountRunsParams, type MonitorListChangesParams as MonitorListChangesParams, type MonitorListRunsParams as MonitorListRunsParams, + type MonitorRetrieveRunParams as MonitorRetrieveRunParams, }; } diff --git a/src/resources/news.ts b/src/resources/news.ts index 015dbc50..a23226f1 100644 --- a/src/resources/news.ts +++ b/src/resources/news.ts @@ -5,22 +5,20 @@ import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; /** - * Search live first-party RSS and free historical news data by company identity. + * Search live and historical news about a company. */ export class News extends APIResource { /** - * Searches live and historical company news for one company, identified in - * searchBy by name, domain, ticker (optionally disambiguated by exchange), or - * ISIN. Results can be filtered by publisher domain, publisher country, article - * language, article type, and published-at date, and include stable story IDs, - * source metadata, verified entity relevance, and cursor pagination. + * Find news about a company by name, domain, ticker, or ISIN, or search all news + * with a natural-language query. Filter articles and continue through results with + * a cursor. * * @example * ```ts * const response = await client.news.search({ * searchBy: { - * entity: { name: 'xx', type: 'name' }, * type: 'entity', + * entity: { type: 'domain', domain: 'stripe.com' }, * }, * }); * ``` @@ -53,8 +51,13 @@ export interface NewsSearchResponse { next_cursor: string | null; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. */ key_metadata?: NewsSearchResponse.KeyMetadata; } @@ -73,7 +76,8 @@ export namespace NewsSearchResponse { authors: Array; /** - * Short summary or excerpt of the article, when the publisher provides one. + * Article summary or excerpt. Natural-language search descriptions include + * matching passages and are capped at 2,000 characters. */ description: string | null; @@ -89,9 +93,10 @@ export namespace NewsSearchResponse { language: string | null; /** - * How the article relates to the company you searched for. + * How the article relates to the company you searched for. Null for + * natural-language searches. */ - match: Data.Match; + match: Data.Match | null; /** * When the article was published, as an ISO 8601 timestamp. Null when the @@ -129,7 +134,8 @@ export namespace NewsSearchResponse { export namespace Data { /** - * How the article relates to the company you searched for. + * How the article relates to the company you searched for. Null for + * natural-language searches. */ export interface Match { /** @@ -176,17 +182,16 @@ export namespace NewsSearchResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -194,9 +199,10 @@ export namespace NewsSearchResponse { export interface NewsSearchParams { /** - * What to search for. + * What to search for: a specific company, or a natural-language query across all + * news. */ - searchBy: NewsSearchParams.SearchBy; + searchBy: NewsSearchParams.NewsSearchByNaturalLanguage | NewsSearchParams.NewsSearchByEntity; /** * Opaque next_cursor from the previous response, or null for the first page. @@ -204,7 +210,9 @@ export interface NewsSearchParams { cursor?: string | null; /** - * Optional result filters. + * Optional result filters. Use at most one of sourceDomain, sourceCountry, + * articleLanguage, or articleType. A date range may accompany that category; + * date.from must not exceed date.to. */ filterBy?: NewsSearchParams.FilterBy; @@ -214,37 +222,60 @@ export interface NewsSearchParams { limit?: number; /** - * Result ordering. Defaults to newest. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Result ordering. Defaults to newest for entity searches. Natural-language + * searches are always ordered by relevance. */ sortBy?: NewsSearchParams.SortBy; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Labels for filtering usage in the dashboard. */ tags?: Array; } export namespace NewsSearchParams { /** - * What to search for. + * Search all news with a plain-language query. Returns up to 100 matches, ordered + * by relevance. + */ + export interface NewsSearchByNaturalLanguage { + /** + * What to search for, in plain language, such as "chip export restrictions to + * China". + */ + query: string; + + /** + * Use `natural_language` to search all news with a plain-language query. + */ + type: 'natural_language'; + } + + /** + * Find news about a specific company. */ - export interface SearchBy { + export interface NewsSearchByEntity { /** * The company to search news for, identified by name, domain, ticker, or ISIN. */ entity: - | SearchBy.NewsSearchEntityByName - | SearchBy.NewsSearchEntityByDomain - | SearchBy.NewsSearchEntityByTicker - | SearchBy.NewsSearchEntityByIsin; + | NewsSearchByEntity.NewsSearchEntityByName + | NewsSearchByEntity.NewsSearchEntityByDomain + | NewsSearchByEntity.NewsSearchEntityByTicker + | NewsSearchByEntity.NewsSearchEntityByIsin; /** - * How to search. Only entity search is supported. + * Use `entity` to find news about a specific company. */ type: 'entity'; } - export namespace SearchBy { + export namespace NewsSearchByEntity { /** * Identify the company by name. */ @@ -254,6 +285,9 @@ export namespace NewsSearchParams { */ name: string; + /** + * Use `name` to identify the company by name. + */ type: 'name'; } @@ -266,6 +300,9 @@ export namespace NewsSearchParams { */ domain: string; + /** + * Use `domain` to identify the company by website domain. + */ type: 'domain'; } @@ -278,6 +315,9 @@ export namespace NewsSearchParams { */ ticker: string; + /** + * Use `ticker` to identify a publicly traded company. + */ type: 'ticker'; /** @@ -368,19 +408,97 @@ export namespace NewsSearchParams { */ isin: string; + /** + * Use `isin` to identify the company by its securities identifier. + */ type: 'isin'; } } /** - * Optional result filters. + * Optional result filters. Use at most one of sourceDomain, sourceCountry, + * articleLanguage, or articleType. A date range may accompany that category; + * date.from must not exceed date.to. */ export interface FilterBy { /** * Article languages to include. Up to 3. */ articleLanguage?: Array< - 'ar' | 'de' | 'en' | 'es' | 'fr' | 'hi' | 'it' | 'ja' | 'ko' | 'nl' | 'pt' | 'ru' | 'zh' + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' >; /** @@ -389,7 +507,7 @@ export namespace NewsSearchParams { articleType?: Array<'editorial' | 'press_release' | 'regulatory_filing' | 'advisory'>; /** - * Published-at window in epoch milliseconds. + * Published-at window in epoch milliseconds. from must be before or equal to to. */ date?: FilterBy.Date; @@ -417,6 +535,7 @@ export namespace NewsSearchParams { | 'mx' | 'ng' | 'nl' + | 'pk' | 'qa' | 'sa' | 'se' @@ -433,7 +552,7 @@ export namespace NewsSearchParams { export namespace FilterBy { /** - * Published-at window in epoch milliseconds. + * Published-at window in epoch milliseconds. from must be before or equal to to. */ export interface Date { /** @@ -449,7 +568,8 @@ export namespace NewsSearchParams { } /** - * Result ordering. Defaults to newest. + * Result ordering. Defaults to newest for entity searches. Natural-language + * searches are always ordered by relevance. */ export interface SortBy { /** diff --git a/src/resources/parse.ts b/src/resources/parse.ts index efb00e0c..53b77fa6 100644 --- a/src/resources/parse.ts +++ b/src/resources/parse.ts @@ -8,8 +8,10 @@ import { RequestOptions } from '../internal/request-options'; export class Parse extends APIResource { /** - * Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes - * into LLM-usable Markdown. + * Convert uploaded file bytes into Markdown and optional HTML. WARC and WARC.GZ + * archives combine HTTP response, resource, and conversion records in archive + * order. Revisit and segmented records are skipped. Decoded WARC content is + * limited to 50 MiB. */ handle( body: Uploadable, @@ -21,6 +23,7 @@ export class Parse extends APIResource { extension, includeImages, includeLinks, + includeNumberedPages, ocr, pdf, shortenBase64Images, @@ -35,6 +38,7 @@ export class Parse extends APIResource { extension, includeImages, includeLinks, + includeNumberedPages, ocr, pdf, shortenBase64Images, @@ -54,6 +58,12 @@ export interface ParseHandleResponse { */ markdown: string; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Indicates success */ @@ -63,6 +73,7 @@ export interface ParseHandleResponse { * Detected content type used for parsing */ type: + | 'warc' | 'html' | 'xml' | 'json' @@ -106,25 +117,23 @@ export interface ParseHandleResponse { | 'pnm'; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: ParseHandleResponse.KeyMetadata; } export namespace ParseHandleResponse { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -138,9 +147,11 @@ export interface ParseHandleParams { /** * Query param: Optional file extension hint, such as pdf, docx, xlsx, pptx, html, - * json, csv, md, py, rtf, jpg, png, or txt. + * json, csv, md, py, rtf, jpg, png, txt, warc, or warc.gz. */ extension?: + | 'warc' + | 'warc.gz' | 'txt' | 'text' | 'md' @@ -223,11 +234,14 @@ export interface ParseHandleParams { includeLinks?: boolean; /** - * Query param: When true for PDF inputs, OCR the selected pages that have no - * usable text layer (scans), replacing each recovered page's text with the OCR - * result while pages with a real text layer keep it. pdf.start/pdf.end limit the - * inclusive page range. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * Query param: Start each PDF page in the Markdown with a `` line, + * where N is the original 1-based page number. + */ + includeNumberedPages?: boolean; + + /** + * Query param: Read text from images and scanned PDF pages. PDF page ranges still + * apply. */ ocr?: boolean; @@ -243,9 +257,8 @@ export interface ParseHandleParams { shortenBase64Images?: boolean; /** - * Query param: Optional comma-separated caller-defined tags for tracking this - * request. Tags are recorded on the request's usage log and can be used to filter - * usage on the dashboard usage page. Up to 20 tags, each 1-50 characters. + * Query param: Comma-separated labels for filtering usage, e.g. + * `production,team-alpha`. */ tags?: Array; @@ -255,11 +268,8 @@ export interface ParseHandleParams { useMainContentOnly?: boolean; /** - * Query param: Set to enabled to bypass shared caches and omit request and - * response content from retained usage logs. Requires zero data retention to be - * enabled for your organization (contact support@context.dev), otherwise the - * request fails with ZDR_NOT_ENABLED. Successful ZDR responses include - * X-Context-ZDR: true. + * Query param: `enabled` turns on zero data retention. Returns 403 + * `ZDR_NOT_ENABLED` unless your organization has ZDR. */ zdr?: 'enabled' | 'disabled'; } @@ -270,13 +280,13 @@ export namespace ParseHandleParams { */ export interface Pdf { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. */ end?: number; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * First 1-based PDF page to parse. */ start?: number; } diff --git a/src/resources/people.ts b/src/resources/people.ts index 89a0b6e2..68b90aa7 100644 --- a/src/resources/people.ts +++ b/src/resources/people.ts @@ -6,10 +6,8 @@ import { RequestOptions } from '../internal/request-options'; export class People extends APIResource { /** - * Finds and normalizes the best available person candidate from additive identity - * clues, then assigns an identity match score from 0 to 100. Available on all paid - * plans. Successful requests cost 20 credits. Disposable and free email addresses - * (like gmail.com, yahoo.com) will throw a 422 error. + * Find a person from identity clues and return their profile with a match score. + * Available on all plans; free or disposable email addresses return 422. * * @example * ```ts @@ -28,6 +26,20 @@ export class People extends APIResource { enrich(body: PersonEnrichParams, options?: RequestOptions): APIPromise { return this._client.post('/people/enrich', { body, ...options }); } + + /** + * Find people with a natural-language query. + * + * @example + * ```ts + * const response = await client.people.search({ + * query: 'VPs of sales at solar companies in California', + * }); + * ``` + */ + search(body: PersonSearchParams, options?: RequestOptions): APIPromise { + return this._client.post('/people/search', { body, ...options }); + } } export interface PersonEnrichResponse { @@ -39,10 +51,21 @@ export interface PersonEnrichResponse { | PersonEnrichResponse.PersonEnrichmentNotFoundMatch; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. */ key_metadata?: PersonEnrichResponse.KeyMetadata; + + /** + * True when the timeout ended processing and this response contains the usable + * data completed so far. Unfinished fields are omitted. + */ + partial?: boolean; } export namespace PersonEnrichResponse { @@ -254,88 +277,419 @@ export namespace PersonEnrichResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface PersonSearchResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Up to 10 matching people, most relevant first. + */ + results: Array; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: PersonSearchResponse.KeyMetadata; + + /** + * Pass as cursor to fetch the next page; null when there are no more results. + */ + next_cursor?: string | null; +} + +export namespace PersonSearchResponse { + /** + * A person matching your search; unavailable details are null or empty lists. + */ + export interface Result { + /** + * What the person does. + */ + description: string | null; + + /** + * Whether the person is currently a founder or co-founder. + */ + is_founder: boolean | null; + + /** + * Where the person lives. + */ + location: Result.Location; + + /** + * Full name. + */ + name: string | null; + + /** + * Public professional profile URLs. + */ + profiles: Array; + + /** + * The person’s current role. + */ + role: Result.Role; + + /** + * Schools attended. + */ + schools: Array; + + /** + * Professional skills. + */ + skills: Array; + + /** + * Years of professional experience. + */ + years_of_experience: number | null; + + /** + * How well the person matches the query. Only returned in `ultra` mode. + */ + match?: Result.Match; + } + + export namespace Result { + /** + * Where the person lives. + */ + export interface Location { + /** + * City. + */ + city: string | null; + + /** + * Country as a two-letter code, such as US or GB. + */ + country_code: string | null; + + /** + * State or region. + */ + region: string | null; + } + + /** + * The person’s current role. + */ + export interface Role { + /** + * Current employer, when known. + */ + company: Role.Company | null; + + /** + * Areas of responsibility. + */ + functions: Array; + + /** + * Seniority level. + */ + seniority: string | null; + + /** + * Role start date (YYYY-MM-DD). + */ + started_on: string | null; + + /** + * Job title. + */ + title: string | null; + } + + export namespace Role { + /** + * Current employer, when known. + */ + export interface Company { + /** + * The company’s website domain. + */ + domain: string | null; + + /** + * Company name. + */ + name: string | null; + } + } + + /** + * How well the person matches the query. Only returned in `ultra` mode. + */ + export interface Match { + /** + * How well the person matches the query, from 0 to 1. + */ + confidence: number; + } + } + + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. */ credits_remaining: number; } } export interface PersonEnrichParams { + /** + * Company context to help identify the person. Provide a name or domain. + */ company?: PersonEnrichParams.Company; + /** + * Education history to help distinguish people with similar names. + */ education?: Array; + /** + * Email address of the person to find. + */ email?: string; + /** + * Location context to help identify the person. Provide a city, region, or + * country. + */ location?: PersonEnrichParams.Location; + /** + * Person name. Without an email or person-profile URL, provide both first and last + * name plus company, education, or location. + */ name?: PersonEnrichParams.Name; + /** + * Public profile URLs for the person. A person-profile URL can identify the person + * without a name. + */ social_urls?: Array; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. + */ + timeoutOpts?: PersonEnrichParams.TimeoutOpts; + + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. */ - timeoutMS?: number; + zdr?: 'enabled' | 'disabled'; } export namespace PersonEnrichParams { + /** + * Company context to help identify the person. Provide a name or domain. + */ export interface Company { + /** + * Website domain of a company associated with the person. + */ domain?: string; + /** + * Name of a company associated with the person. + */ name?: string; } export interface Education { + /** + * Degree or qualification earned. + */ degree?: string; + /** + * Subject or major studied. + */ field_of_study?: string; + /** + * Four-digit graduation year. + */ graduation_year?: number; + /** + * School or university, identified by name or domain. + */ institution?: Education.Institution; } export namespace Education { + /** + * School or university, identified by name or domain. + */ export interface Institution { + /** + * Website domain of the school or university. + */ domain?: string; + /** + * Name of the school or university. + */ name?: string; } } + /** + * Location context to help identify the person. Provide a city, region, or + * country. + */ export interface Location { + /** + * City associated with the person. + */ city?: string; + /** + * Country associated with the person. + */ country?: string; + /** + * State, province, or region associated with the person. + */ region?: string; } + /** + * Person name. Without an email or person-profile URL, provide both first and last + * name plus company, education, or location. + */ export interface Name { + /** + * First or given name. + */ first?: string; + /** + * Last or family name. + */ last?: string; } + + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } +} + +export interface PersonSearchParams { + /** + * Describe the people to find. Up to 500 characters in `fast` mode and 5000 in + * `ultra` mode. + */ + query: string; + + /** + * Use next_cursor with the same query, mode and filters to fetch the next page. + */ + cursor?: string; + + /** + * Additional constraints every result must match. + */ + filters?: PersonSearchParams.Filters; + + /** + * `fast` matches people on basic criteria (e.g. their role, location or + * background); `ultra` plans a deeper search, judges each candidate against every + * criterion in the query. Complex `ultra` searches can take up to 30 seconds to + * complete, so allow for that in your client timeout. + */ + mode?: 'fast' | 'ultra'; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} + +export namespace PersonSearchParams { + /** + * Additional constraints every result must match. + */ + export interface Filters { + /** + * Countries people live in as two-letter codes, such as US or GB. + */ + countries?: Array; + + /** + * Maximum years of professional experience. + */ + years_of_experience_max?: number; + + /** + * Minimum years of professional experience. + */ + years_of_experience_min?: number; + } } export declare namespace People { - export { type PersonEnrichResponse as PersonEnrichResponse, type PersonEnrichParams as PersonEnrichParams }; + export { + type PersonEnrichResponse as PersonEnrichResponse, + type PersonSearchResponse as PersonSearchResponse, + type PersonEnrichParams as PersonEnrichParams, + type PersonSearchParams as PersonSearchParams, + }; } diff --git a/src/resources/utility.ts b/src/resources/utility.ts index b972fe9c..7a7fa097 100644 --- a/src/resources/utility.ts +++ b/src/resources/utility.ts @@ -6,16 +6,12 @@ import { RequestOptions } from '../internal/request-options'; export class Utility extends APIResource { /** - * Signal that you may fetch data soon to improve latency. The type field selects - * what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a - * styleguide extraction) and identifier carries exactly one lookup key: a domain, - * or an email whose domain is extracted and validated (free email providers and - * disposable email addresses are not allowed). + * Queue brand or styleguide data so a later lookup can return sooner. * * @example * ```ts * const response = await client.utility.prefetch({ - * identifier: { domain: 'xxx' }, + * identifier: { domain: 'stripe.com' }, * type: 'brand', * }); * ``` @@ -26,14 +22,19 @@ export class Utility extends APIResource { } export interface UtilityPrefetchResponse { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * The domain that was queued for prefetching */ domain?: string; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: UtilityPrefetchResponse.KeyMetadata; @@ -43,7 +44,7 @@ export interface UtilityPrefetchResponse { message?: string; /** - * Status of the response, e.g., 'ok' + * Always `ok` on success. */ status?: string; @@ -55,17 +56,16 @@ export interface UtilityPrefetchResponse { export namespace UtilityPrefetchResponse { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -80,22 +80,24 @@ export interface UtilityPrefetchParams { | UtilityPrefetchParams.UtilityPrefetchEmailIdentifier; /** - * What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the - * styleguide cache. + * Data to prefetch. */ type: 'brand' | 'styleguide'; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; + + /** + * Labels for filtering usage in the dashboard. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + timeoutOpts?: UtilityPrefetchParams.TimeoutOpts; } export namespace UtilityPrefetchParams { @@ -104,7 +106,7 @@ export namespace UtilityPrefetchParams { */ export interface UtilityPrefetchDomainIdentifier { /** - * Domain name to prefetch data for + * Domain, e.g. `stripe.com`. */ domain: string; } @@ -120,6 +122,21 @@ export namespace UtilityPrefetchParams { */ email: string; } + + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * Only "fail" is supported: return 408 at the deadline. + */ + behavior?: 'fail'; + } } export declare namespace Utility { diff --git a/src/resources/web.ts b/src/resources/web.ts index 1950467b..f178d53d 100644 --- a/src/resources/web.ts +++ b/src/resources/web.ts @@ -6,24 +6,23 @@ import { RequestOptions } from '../internal/request-options'; export class Web extends APIResource { /** - * Crawl a website, use the provided JSON Schema and instructions to prioritize - * relevant internal links, and extract structured data from the selected pages. + * Research the web and return a sourced answer in your JSON shape. Choose `fast` + * for a short task or `ultra` for deeper research. * * @example * ```ts - * const response = await client.web.extract({ - * schema: { - * type: 'bar', - * properties: 'bar', - * required: 'bar', - * additionalProperties: 'bar', + * const response = await client.web.answers({ + * task: 'Find the pricing page URL and plan names for context.dev.', + * json_format: { + * pricing_page_url: '', + * plans: [{ name: '' }], * }, - * url: 'https://example.com', + * mode: 'fast', * }); * ``` */ - extract(body: WebExtractParams, options?: RequestOptions): APIPromise { - return this._client.post('/web/extract', { body, ...options }); + answers(body: WebAnswersParams, options?: RequestOptions): APIPromise { + return this._client.post('/web/answers', { body, ...options }); } /** @@ -45,24 +44,7 @@ export class Web extends APIResource { } /** - * Scrape font information from a website including font families, usage - * statistics, fallbacks, and element/word counts. - * - * @example - * ```ts - * const response = await client.web.extractFonts(); - * ``` - */ - extractFonts( - query: WebExtractFontsParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get('/web/fonts', { query, ...options }); - } - - /** - * Extract a comprehensive design system from a website including colors, - * typography, spacing, shadows, and UI components. + * Extract colors, typography, spacing, and component styles from a website. * * @example * ```ts @@ -77,266 +59,126 @@ export class Web extends APIResource { } /** - * Capture a screenshot of a website. - * - * @example - * ```ts - * const response = await client.web.screenshot(); - * ``` - */ - screenshot( - query: WebScreenshotParams | null | undefined = {}, - options?: RequestOptions, - ): APIPromise { - return this._client.get('/web/screenshot', { query, ...options }); - } - - /** - * Search the web and optionally scrape each result to Markdown in one round-trip. - * - * @example - * ```ts - * const response = await client.web.search({ query: 'x' }); - * ``` - */ - search(body: WebSearchParams, options?: RequestOptions): APIPromise { - return this._client.post('/web/search', { body, ...options }); - } - - /** - * Performs a crawl starting from a given URL, extracts page content as Markdown, - * and returns results for all crawled pages. + * Discover a site's URLs, with page titles, descriptions, keywords, and language + * when available. Metadata can be missing on newly discovered URLs. * * @example * ```ts - * const response = await client.web.webCrawlMd({ - * url: 'https://example.com', + * const response = await client.web.mapUrls({ + * domain: 'stripe.com', * }); * ``` */ - webCrawlMd(body: WebWebCrawlMdParams, options?: RequestOptions): APIPromise { - return this._client.post('/web/crawl', { body, ...options }); + mapUrls(query: WebMapURLsParams, options?: RequestOptions): APIPromise { + return this._client.get('/web/urls', { query, ...options }); } /** - * Scrapes the given URL and returns the raw HTML content of the page. The base - * request costs 1 credit; requests with browser actions cost 2 credits. + * Scrape anything from a URL on the internet. Returns the outputs you enable in + * formats. Handles PDFs, DOCX, PPT, XLSX, and 40 other file formats. * * @example * ```ts - * const response = await client.web.webScrapeHTML({ + * const response = await client.web.scrape({ + * formats: { markdown: true }, * url: 'https://example.com', * }); * ``` */ - webScrapeHTML( - query: WebWebScrapeHTMLParams, - options?: RequestOptions, - ): APIPromise { - return this._client.get('/web/scrape/html', { query, ...options }); + scrape(body: WebScrapeParams, options?: RequestOptions): APIPromise { + return this._client.post('/web/scrape', { body, ...options }); } /** - * Extract image assets from a web page, including standard URLs, inline SVGs, data - * URIs, responsive image sources, metadata, CSS backgrounds, video posters, and - * embeds. The base request costs 1 credit, or 2 credits with browser actions. When - * enrichment is enabled, the entire call costs 5 credits, including requests that - * also use actions. + * Capture a screenshot of a website. * * @example * ```ts - * const response = await client.web.webScrapeImages({ - * url: 'https://example.com', - * }); + * const response = await client.web.screenshot(); * ``` */ - webScrapeImages( - query: WebWebScrapeImagesParams, + screenshot( + query: WebScreenshotParams | null | undefined = {}, options?: RequestOptions, - ): APIPromise { - return this._client.get('/web/scrape/images', { query, ...options }); + ): APIPromise { + return this._client.get('/web/screenshot', { query, ...options }); } /** - * Scrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON - * responses from a recognized API key; use error_code to distinguish stable - * failure categories. - * - * ### YouTube - * - * YouTube URLs return the video or channel itself rather than the surrounding - * player and navigation chrome. A URL addressing a single video (`/watch`, - * `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, - * view count, keywords, full description, and the transcript when the video has - * captions that can be retrieved; videos without captions return everything except - * the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) - * returns its name, handle, subscriber count, video count, and full description. - * When `includeImages=true`, video responses also include the thumbnail and - * channel responses include the avatar. Costs the same as any other scrape. - * - * ### Billing & errors - * - * | HTTP status | Billed? | Meaning | - * | ----------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing | - * | 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds | - * | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | - * | 404 | No | Target page returned or fingerprinted as not found | - * | 408 | No | Request timed out | - * | 413 | No | Target content exceeds the maximum supported size (20 MB) | - * | 415 | No | Unsupported content type | - * | 429 | No | Per-minute rate limit exceeded; honor Retry-After | - * | 500 | No | Internal error | + * Search the web and optionally return page content or relevant passages with each + * result. * * @example * ```ts - * const response = await client.web.webScrapeMd({ - * url: 'https://example.com', + * const response = await client.web.search({ + * query: 'Stripe API authentication', + * numResults: 10, * }); * ``` */ - webScrapeMd(query: WebWebScrapeMdParams, options?: RequestOptions): APIPromise { - return this._client.get('/web/scrape/markdown', { query, ...options }); + search(body: WebSearchParams, options?: RequestOptions): APIPromise { + return this._client.post('/web/search', { body, ...options }); } /** - * Crawl an entire website's sitemap and return all discovered page URLs. Pass - * `search` to have the crawled sitemap filtered down to the pages about a phrase - * (for example `pricing and plans` or `api authentication docs`), most relevant - * first — a searched crawl scans the whole sitemap and costs 2 credits instead - * of 1. + * Crawl a website and return page content as Markdown. Use a batch for crawls + * beyond 500 pages. * * @example * ```ts - * const response = await client.web.webScrapeSitemap({ - * domain: 'xxx', + * const response = await client.web.webCrawlMd({ + * url: 'https://example.com', + * maxPages: 10, * }); * ``` */ - webScrapeSitemap( - query: WebWebScrapeSitemapParams, - options?: RequestOptions, - ): APIPromise { - return this._client.get('/web/scrape/sitemap', { query, ...options }); + webCrawlMd(body: WebWebCrawlMdParams, options?: RequestOptions): APIPromise { + return this._client.post('/web/crawl', { body, ...options }); } } -export interface WebExtractResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: WebExtractResponse.CacheMetadata; - +export interface WebAnswersResponse { /** - * Extracted data matching the request schema + * The answer, in the shape requested by json_format. */ - data: { [key: string]: unknown }; - - metadata: WebExtractResponse.Metadata; + json_content: { [key: string]: unknown }; /** - * Status of the response, e.g., 'ok' + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - status: string; + request_id: string; /** - * The starting URL that was analyzed + * URLs of the pages and company/profile records read for the answer, followed by + * URLs cited in json_content. */ - url: string; + sources: Array; /** - * List of URLs whose Markdown was used for extraction + * Credits this request used and your remaining balance. */ - urls_analyzed: Array; + key_metadata?: WebAnswersResponse.KeyMetadata; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * True when the request deadline ended research and the answer uses the evidence + * collected so far. */ - key_metadata?: WebExtractResponse.KeyMetadata; + partial?: boolean; } -export namespace WebExtractResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; - - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } - - export interface Metadata { - maxCrawlDepth: number; - - /** - * Number of crawled pages excluded because they were anti-bot challenges, error - * pages, or parked-domain placeholders. - */ - numBlocked: number; - - numFailed: number; - - numSkipped: number; - - numSucceeded: number; - - numUrls: number; - - /** - * One verified outcome per requested browser action, in request order. - */ - actionsApplied?: Array; - } - - export namespace Metadata { - export interface ActionsApplied { - instruction: string; - - /** - * Applied means the requested page state was visibly verified. Failed means it was - * not verified. Skipped means it was not attempted. - */ - status: 'applied' | 'failed' | 'skipped'; - - /** - * Visible page evidence used to verify an applied action. - */ - completionEvidence?: string; - - durationMs?: number; - - error?: string; - - method?: string; - - targetDescription?: string; - } - } - +export namespace WebAnswersResponse { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -353,6 +195,12 @@ export interface WebExtractCompetitorsResponse { */ domain: string; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + /** * Status of the response. */ @@ -364,10 +212,15 @@ export interface WebExtractCompetitorsResponse { target: WebExtractCompetitorsResponse.Target; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ key_metadata?: WebExtractCompetitorsResponse.KeyMetadata; + + /** + * True when the timeout ended processing and this response contains only usable + * results completed so far. Unfinished results are omitted. + */ + partial?: boolean; } export namespace WebExtractCompetitorsResponse { @@ -429,167 +282,32 @@ export namespace WebExtractCompetitorsResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } -export interface WebExtractFontsResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: WebExtractFontsResponse.CacheMetadata; - - /** - * HTTP status code, e.g., 200 - */ - code: number; - - /** - * The normalized domain that was processed - */ - domain: string; - - /** - * Array of font usage information - */ - fonts: Array; - - /** - * Status of the response, e.g., 'ok' - */ - status: string; - - /** - * Font assets keyed by family name as it appears in the fonts array (non-generic - * names only). Clients match entries in fonts to pick a file URL from files. - * Omitted when no families resolve to Google or custom @font-face URLs. - */ - fontLinks?: { [key: string]: WebExtractFontsResponse.FontLinks }; - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: WebExtractFontsResponse.KeyMetadata; -} - -export namespace WebExtractFontsResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; - - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } - - export interface Font { - /** - * Array of fallback font families - */ - fallbacks: Array; - - /** - * Font family name - */ - font: string; - - /** - * Number of elements using this font - */ - num_elements: number; - - /** - * Number of words using this font - */ - num_words: number; - - /** - * Percentage of elements using this font - */ - percent_elements: number; - - /** - * Percentage of words using this font - */ - percent_words: number; - - /** - * Array of CSS selectors or element types where this font is used - */ - uses: Array; - } - - export interface FontLinks { - /** - * Upright font files keyed by weight string (e.g. "400" for regular, "500", - * "700"). Values are absolute URLs. - */ - files: { [key: string]: string }; - - type: 'google' | 'custom'; - - /** - * Google Fonts category when type is google (e.g. sans-serif, serif, monospace, - * display, handwriting). Omitted for custom fonts when unknown. - */ - category?: string; - - /** - * Present when type is custom: human-readable name derived from the fontLinks key - * (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). - * Google entries omit this. - */ - displayName?: string; - } - +export interface WebExtractStyleguideResponse { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Whether this response came from cache. */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; - - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } -} + cache_metadata: WebExtractStyleguideResponse.CacheMetadata; -export interface WebExtractStyleguideResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - cache_metadata: WebExtractStyleguideResponse.CacheMetadata; + request_id: string; /** * HTTP status code @@ -602,13 +320,18 @@ export interface WebExtractStyleguideResponse { domain?: string; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * `loaded`, or `still-loading` when capture ended before the page finished + * loading. + */ + finalDOMState?: 'loaded' | 'still-loading'; + + /** + * Credits this request used and your remaining balance. */ key_metadata?: WebExtractStyleguideResponse.KeyMetadata; /** - * Status of the response, e.g., 'ok' + * Always `ok` on success. */ status?: string; @@ -620,9 +343,7 @@ export interface WebExtractStyleguideResponse { export namespace WebExtractStyleguideResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ export interface CacheMetadata { /** @@ -638,17 +359,16 @@ export namespace WebExtractStyleguideResponse { } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } @@ -674,8 +394,8 @@ export namespace WebExtractStyleguideResponse { /** * Font assets keyed by family name as it appears in fontFamily/fontFallbacks - * (non-generic names only). Clients match typography.fontFamily / fontWeight or - * button styles to pick a file URL from files. + * (non-generic names only). Match font style and weight against faces to select a + * file URL. */ fontLinks: { [key: string]: Styleguide.FontLinks }; @@ -781,7 +501,7 @@ export namespace WebExtractStyleguideResponse { minHeight: string; /** - * Sampled minimum width of the button box (typically px) + * Minimum width (usually px). */ minWidth: string; @@ -842,7 +562,7 @@ export namespace WebExtractStyleguideResponse { minHeight: string; /** - * Sampled minimum width of the button box (typically px) + * Minimum width (usually px). */ minWidth: string; @@ -903,7 +623,7 @@ export namespace WebExtractStyleguideResponse { minHeight: string; /** - * Sampled minimum width of the button box (typically px) + * Minimum width (usually px). */ minWidth: string; @@ -975,12 +695,6 @@ export namespace WebExtractStyleguideResponse { } export interface FontLinks { - /** - * Upright font files keyed by weight string (e.g. "400" for regular, "500", - * "700"). Values are absolute URLs. - */ - files: { [key: string]: string }; - type: 'google' | 'custom'; /** @@ -990,11 +704,53 @@ export namespace WebExtractStyleguideResponse { category?: string; /** - * Present when type is custom: human-readable name derived from the fontLinks key - * (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). - * Google entries omit this. + * Human-readable family name. For custom fonts, derived from the fontLinks key; + * for Google fonts, the canonical Google Fonts family name. */ displayName?: string; + + /** + * Discovered font faces, including style, weight, and distinct Unicode subsets. + */ + faces?: Array; + + /** + * @deprecated Deprecated upright font lookup keyed by weight string. A variable + * font can map several standard weight keys to the same URL; faces retains its + * actual weight range. + */ + files?: { [key: string]: string }; + } + + export namespace FontLinks { + export interface Face { + /** + * CSS font-style descriptor: normal, italic, or oblique, including an optional + * oblique angle or angle range (e.g. oblique 10deg 20deg). + */ + style: string; + + /** + * Preferred font file URL or inline font data URL. + */ + url: string; + + /** + * CSS font-weight descriptor. A variable font file can have a range such as "300 + * 500", covering intermediate weights without separate files. + */ + weight: string; + + /** + * CSS unicode-range descriptor. + */ + unicodeRange?: string; + + /** + * CSS font-width or font-stretch descriptor. + */ + width?: string; + } } /** @@ -1046,7 +802,7 @@ export namespace WebExtractStyleguideResponse { fontFallbacks: Array; /** - * Primary face (first family in the computed stack) + * First font in the stack. */ fontFamily: string; @@ -1066,7 +822,7 @@ export namespace WebExtractStyleguideResponse { fontFallbacks: Array; /** - * Primary face (first family in the computed stack) + * First font in the stack. */ fontFamily: string; @@ -1086,7 +842,7 @@ export namespace WebExtractStyleguideResponse { fontFallbacks: Array; /** - * Primary face (first family in the computed stack) + * First font in the stack. */ fontFamily: string; @@ -1106,7 +862,7 @@ export namespace WebExtractStyleguideResponse { fontFallbacks: Array; /** - * Primary face (first family in the computed stack) + * First font in the stack. */ fontFamily: string; @@ -1127,7 +883,7 @@ export namespace WebExtractStyleguideResponse { fontFallbacks: Array; /** - * Primary face (first family in the computed stack) + * First font in the stack. */ fontFamily: string; @@ -1143,120 +899,197 @@ export namespace WebExtractStyleguideResponse { } } -export interface WebScreenshotResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: WebScreenshotResponse.CacheMetadata; +export interface WebMapURLsResponse { + domain: string; /** - * HTTP status code + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - code?: number; + request_id: string; - /** - * The normalized domain that was processed - */ - domain?: string; + success: true; - /** - * Height in pixels of the returned screenshot image - */ - height?: number; + urls: Array; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ - key_metadata?: WebScreenshotResponse.KeyMetadata; + key_metadata?: WebMapURLsResponse.KeyMetadata; - /** - * Public image URL for standard requests, or an in-memory data URL when ZDR is - * enabled. - */ - screenshot?: string; + partial?: boolean; +} - /** - * Type of screenshot that was captured - */ - screenshotType?: 'viewport' | 'fullPage'; +export namespace WebMapURLsResponse { + export interface URL { + url: string; - /** - * Status of the response, e.g., 'ok' - */ - status?: string; + description?: string; - /** - * Width in pixels of the returned screenshot image - */ - width?: number; -} + keywords?: Array; -export namespace WebScreenshotResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; + language?: string; - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; + title?: string; } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } -export interface WebSearchResponse { +export interface WebScrapeResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * The original HTTP response body, unchanged by waits, actions, and filters. */ - cache_metadata: WebSearchResponse.CacheMetadata; + bytes: WebScrapeResponse.Bytes; /** - * Echo of the original query (useful when fanout was enabled). + * Whether this response came from cache. */ - query: string; + cache_metadata: WebScrapeResponse.CacheMetadata; - results: Array; + /** + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. + */ + highlights: WebScrapeResponse.Highlights; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Rendered HTML after content filters. */ - key_metadata?: WebSearchResponse.KeyMetadata; + html: WebScrapeResponse.HTML; + + /** + * Images after content filters. `[]` when none are found. + */ + images: WebScrapeResponse.Images; + + /** + * Object matching `jsonParams.schema`. + */ + json: WebScrapeResponse.Json; + + /** + * Markdown after content filters. + */ + markdown: WebScrapeResponse.Markdown; + + /** + * Page metadata. Fields are omitted when not found. + */ + metadata: WebScrapeResponse.Metadata; + + /** + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. + */ + parsed: WebScrapeResponse.Parsed; + + /** + * Product details found on the page. + */ + product: WebScrapeResponse.Product; + + /** + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. + */ + profile: WebScrapeResponse.Profile | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Screenshot as a base64 image data URL. + */ + screenshot: WebScrapeResponse.Screenshot; + + /** + * Final URL after redirects and browser actions. + */ + url: string; + + /** + * True when at least one requested output succeeds but the response has failed or + * incomplete outputs. Absent when all requested outputs fail. + */ + isPartial?: true; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: WebScrapeResponse.KeyMetadata; } -export namespace WebSearchResponse { +export namespace WebScrapeResponse { + /** + * The original HTTP response body, unchanged by waits, actions, and filters. + */ + export interface Bytes { + data: Bytes.Data | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Bytes { + export interface Data { + /** + * Body as base64, after HTTP decompression. Up to 50 MiB decoded. + */ + base64: string; + + contentType: string; + } + } + /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ export interface CacheMetadata { /** @@ -1271,397 +1104,645 @@ export namespace WebSearchResponse { status: 'hit' | 'miss' | 'zdr'; } - export interface Result { + /** + * Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks + * omitted text. + */ + export interface Highlights { + data: Array | null; + + requested: boolean; + /** - * Snippet excerpt from the page. + * `true` if returned, `false` if it failed, `null` if not requested. */ - description: string; + success: boolean | null; /** - * Markdown scrape status and content for this result. + * Why the output failed. Present only when `success` is `false`. */ - markdown: Result.Markdown; + error_code?: string; /** - * Relevance to the original query. + * Explanation of the failure and possible next steps. */ - relevance: 'high' | 'medium' | 'low'; + message?: string; + } + + /** + * Rendered HTML after content filters. + */ + export interface HTML { + data: string | null; + + requested: boolean; /** - * Page title. + * `true` if returned, `false` if it failed, `null` if not requested. */ - title: string; + success: boolean | null; /** - * Canonical result URL. + * Why the output failed. Present only when `success` is `false`. */ - url: string; + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; } - export namespace Result { + /** + * Images after content filters. `[]` when none are found. + */ + export interface Images { + data: Array | null; + + requested: boolean; + /** - * Markdown scrape status and content for this result. + * `true` if returned, `false` if it failed, `null` if not requested. */ - export interface Markdown { + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + export namespace Images { + export interface Data { /** - * Per-result scrape outcome. Inspect this before reading `markdown`. + * Alt text, if present. */ - code: 'SUCCESS' | 'NOT_REQUESTED' | 'TIMEOUT' | 'CONTENT_TOO_LARGE' | 'WEBSITE_ACCESS_ERROR' | 'ERROR'; + alt: string | null; /** - * GFM Markdown of the page. Null unless markdownOptions.enabled is true and - * scraping succeeded. + * Image URL, or a data URI for inline images. */ - markdown: string | null; + url: string; + + classification?: + | 'photography' + | 'illustration' + | 'logo' + | 'wordmark' + | 'icon' + | 'pattern' + | 'graphic' + | 'other'; + + /** + * Hosted image URL, valid for 24 hours after capture. Requires `file` enrichment + * and ZDR disabled. + */ + fileUrl?: string; + + height?: number; + + width?: number; } } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Object matching `jsonParams.schema`. */ - export interface KeyMetadata { + export interface Json { + data: { [key: string]: unknown } | null; + + requested: boolean; + /** - * The number of credits consumed by this request. + * `true` if returned, `false` if it failed, `null` if not requested. */ - credits_consumed: number; + success: boolean | null; /** - * The number of credits remaining for your organization after this request. + * Why the output failed. Present only when `success` is `false`. */ - credits_remaining: number; + error_code?: string; + + /** + * True when the page was too long to read in full, so values found only in the + * unread parts may be missing. + */ + isTruncated?: true; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; } -} -export interface WebWebCrawlMdResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Markdown after content filters. */ - cache_metadata: WebWebCrawlMdResponse.CacheMetadata; - - metadata: WebWebCrawlMdResponse.Metadata; + export interface Markdown { + data: string | null; - results: Array; + requested: boolean; - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: WebWebCrawlMdResponse.KeyMetadata; -} + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; -export namespace WebWebCrawlMdResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. + * Why the output failed. Present only when `success` is `false`. */ - age_ms: number; + error_code?: string; /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. + * Explanation of the failure and possible next steps. */ - status: 'hit' | 'miss' | 'zdr'; + message?: string; } + /** + * Page metadata. Fields are omitted when not found. + */ export interface Metadata { /** - * Maximum crawl depth reached during the crawl + * Additional non-social meta tags not promoted to top-level metadata fields. */ - maxCrawlDepth: number; + additionalMeta?: { [key: string]: string | Array }; /** - * Number of pages that failed to crawl + * Resolved alternate links from link rel=alternate tags. */ - numFailed: number; + alternates?: Array; /** - * Number of URLs skipped (PDFs when pdf.shouldParse=false, or URLs not matching - * urlRegex) + * Author metadata, when present. */ - numSkipped: number; + author?: string; /** - * Number of pages successfully crawled + * Resolved canonical URL, when present. */ - numSucceeded: number; + canonicalUrl?: string; /** - * Total number of URLs crawled + * Best description extracted from standard, Open Graph, or Twitter metadata. */ - numUrls: number; - } + description?: string; - export interface Result { /** - * Extracted page content as Markdown (empty string on failure) + * Resolved favicon URL, when present. */ - markdown: string; + favicon?: string; - metadata: Result.Metadata; - } + /** + * Up to 500 h1–h6 headings in document order, before content filtering. + */ + headings?: Array; - export namespace Result { - export interface Metadata { - /** - * Depth relative to the start URL. 0 = start URL, 1 = one link away. - */ - crawlDepth: number; + /** + * Primary resolved preview image from Open Graph, Twitter, or image metadata. + */ + image?: string; - /** - * Final URL scraped after redirects or scraper fallback, when known. Falls back to - * sourceUrl when unavailable. - */ - finalUrl: string; + /** + * JSON-LD structured data blocks parsed from the page. + */ + jsonLd?: Array<{ [key: string]: unknown }>; - /** - * Original URL requested by the caller. - */ - sourceUrl: string; + /** + * Keywords extracted from the page's keywords meta tag. + */ + keywords?: Array; - /** - * HTTP status code of the response - */ - statusCode: number; + /** + * Language extracted from html lang or language meta tags. + */ + language?: string; - /** - * true if the page was fetched and parsed successfully - */ - success: boolean; + /** + * Modified timestamp/date from page metadata, when present. + */ + modifiedTime?: string; - /** - * Best page title extracted from the page (empty string if unavailable). - */ - title: string; + /** + * Open Graph metadata with the og: prefix removed and keys camel-cased. + */ + openGraph?: { [key: string]: string | Array }; - /** - * The crawl URL fetched for this page. - */ - url: string; + /** + * Published timestamp/date from page metadata, when present. + */ + publishedTime?: string; - /** - * Additional non-social meta tags not promoted to top-level metadata fields. - */ - additionalMeta?: { [key: string]: string | Array }; + /** + * Robots meta directive, when present. + */ + robots?: string; - /** - * Resolved alternate links from link rel=alternate tags. - */ - alternates?: Array; + /** + * Site or application name from page metadata. + */ + siteName?: string; - /** - * Author metadata, when present. - */ - author?: string; + /** + * Best title extracted from the page. + */ + title?: string; - /** - * Resolved canonical URL, when present. - */ - canonicalUrl?: string; + /** + * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + */ + twitter?: { [key: string]: string | Array }; + } + export namespace Metadata { + export interface Alternate { /** - * Best description extracted from standard, Open Graph, or Twitter metadata. + * Resolved alternate URL. */ - description?: string; + href: string; /** - * Resolved favicon URL, when present. + * Language or locale for the alternate URL, when present. */ - favicon?: string; + hreflang?: string; /** - * Page headings (h1–h6) in document order, extracted from the unfiltered document. - * Capped at the first 500 headings. Omitted when the page has none. + * Alternate resource title, when present. */ - headings?: Array; + title?: string; /** - * Primary resolved preview image from Open Graph, Twitter, or image metadata. + * Alternate resource MIME type, when present. */ - image?: string; + type?: string; + } + export interface Heading { /** - * JSON-LD structured data blocks parsed from the page. + * Heading level, 1–6 (from h1–h6). */ - jsonLd?: Array<{ [key: string]: unknown }>; + level: number; /** - * Keywords extracted from the page's keywords meta tag. + * Heading text with whitespace collapsed, truncated to 1000 characters. */ - keywords?: Array; + text: string; + } + } - /** - * Language extracted from html lang or language meta tags. - */ - language?: string; + /** + * Custom rules return fields after content filters; unmatched fields are null ([] + * for lists). The google-maps parser returns business records in data.results, + * google-maps-reviews returns data.reviews, and the google-play parser returns one + * app record as data, google-play-reviews returns data.reviews, app-store and + * app-store-reviews do the same for the App Store, g2-reviews returns data.reviews + * for a G2 product, instagram-profile and instagram-post return one record as + * data, instagram-feed returns data.posts, tiktok-profile and tiktok-video return + * one record as data, tiktok-feed returns data.videos, tiktok-comments returns + * data.comments, tiktok-followers, tiktok-following, and tiktok-user-search return + * data.users, yelp-search returns up to 20 ranked organic businesses in + * data.businesses, plus total and pagination, from a Yelp search URL; yelp-reviews + * returns up to 20 latest public reviews in data.reviews, with business details + * and next_offset, from a Yelp business URL; tripadvisor-reviews returns 20 + * reviews in data.reviews, with data.location and next_offset, from a Tripadvisor + * hotel, restaurant, or attraction review URL; emails, phone-numbers, and links + * return data.emails, data.phone_numbers, and data.links from the rendered page; + * the store, Maps, G2, Instagram, and TikTok parsers read their data directly, + * independently of DOM filters and other outputs. + */ + export interface Parsed { + data: { [key: string]: unknown } | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * The selected prebuilt parser name, or custom when type is omitted, custom rules + * are used, or parsing is not requested. + */ + type: + | 'custom' + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } - /** - * Modified timestamp/date from page metadata, when present. - */ - modifiedTime?: string; + /** + * Product details found on the page. + */ + export interface Product { + data: Product.Data | null; - /** - * Open Graph metadata with the og: prefix removed and keys camel-cased. - */ - openGraph?: { [key: string]: string | Array }; + requested: boolean; - /** - * Published timestamp/date from page metadata, when present. - */ - publishedTime?: string; + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + export namespace Product { + export interface Data { /** - * Robots meta directive, when present. + * Whether the page is a product detail page. */ - robots?: string; + isProductPage: boolean; /** - * Site or application name from page metadata. + * The extracted product, or null when the page is not a product detail page. */ - siteName?: string; + product: Data.Product | null; + } + export namespace Data { /** - * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + * The extracted product, or null when the page is not a product detail page. */ - twitter?: { [key: string]: string | Array }; - } + export interface Product { + /** + * Stock or ordering availability. + */ + availability: + | 'in_stock' + | 'out_of_stock' + | 'limited_availability' + | 'preorder' + | 'backorder' + | 'made_to_order' + | 'discontinued' + | null; - export namespace Metadata { - export interface Alternate { /** - * Resolved alternate URL. + * Brand or vendor. */ - href: string; + brand: string | null; /** - * Language or locale for the alternate URL, when present. + * Product category. */ - hreflang?: string; + category: string | null; /** - * Alternate resource title, when present. + * ISO 4217 currency code. */ - title?: string; + currency: string | null; /** - * Alternate resource MIME type, when present. + * Product description. */ - type?: string; - } + description: string | null; - export interface Heading { /** - * Heading level, 1–6 (from h1–h6). + * Product dimensions as shown on the page. */ - level: number; + dimensions: Array; /** - * Heading text with whitespace collapsed, truncated to 1000 characters. + * Key features and specifications. */ - text: string; + features: Array; + + /** + * Product image URLs, main image first. + */ + images: Array; + + /** + * Main product image URL. + */ + imageUrl: string | null; + + /** + * Product name. + */ + name: string; + + /** + * Current price. + */ + price: number | null; + + /** + * List price before any discount. + */ + regularPrice: number | null; + + /** + * Product identifier such as a SKU or model number. + */ + sku: string | null; + + /** + * Product tags. + */ + tags: Array; + + /** + * Intended audience. + */ + targetAudience: Array; + + /** + * Product variations, such as different colors or sizes, with their attributes and + * images. Empty if none are found. May not include every variation offered by the + * store. + */ + variants: Array; + } + + export namespace Product { + export interface Variant { + /** + * Explicit variant attributes such as color, size, material, pattern and + * properties declared by page. + */ + attributes: { [key: string]: string }; + + /** + * Original source image URLs explicitly attached to this variant. + */ + images: Array; + + sku: string | null; + + /** + * Variant or offer URL when provided by the source. May be shared by variants. + */ + url: string | null; + } } } } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Authenticated browser profile used for this scrape, or null when no profile was + * requested. New and existing profile requests both return the profile ID. + */ + export interface Profile { + /** + * Save this ID after creating a profile, then reuse it as + * sharedParams.profile.profileId with type "existing". + */ + id: string; + } + + /** + * Screenshot as a base64 image data URL. + */ + export interface Screenshot { + data: string | null; + + requested: boolean; + + /** + * `true` if returned, `false` if it failed, `null` if not requested. + */ + success: boolean | null; + + /** + * Why the output failed. Present only when `success` is `false`. + */ + error_code?: string; + + /** + * Explanation of the failure and possible next steps. + */ + message?: string; + } + + /** + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } -export interface WebWebScrapeHTMLResponse { +export interface WebScreenshotResponse { + /** + * Whether this response came from cache. + */ + cache_metadata: WebScreenshotResponse.CacheMetadata; + /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - cache_metadata: WebWebScrapeHTMLResponse.CacheMetadata; + request_id: string; /** - * The scraped content of the page. For normal pages this is the raw HTML. When the - * page is a sitemap or feed served behind an XSL stylesheet (which browsers render - * into HTML), this is the underlying XML instead — see the `type` field. + * HTTP status code */ - html: string; + code?: number; /** - * Metadata extracted from the scraped page HTML. + * The normalized domain that was processed */ - metadata: WebWebScrapeHTMLResponse.Metadata; + domain?: string; /** - * Indicates success + * `loaded`, or `still-loading` when capture ended before the page finished + * loading. */ - success: true; + finalDOMState?: 'loaded' | 'still-loading'; /** - * Detected content type of the returned `html` field. Sitemaps and feeds are - * surfaced as `xml`; ordinary pages are `html`. Excel workbooks are surfaced as - * `xlsx`/`xls` with the extracted sheets as HTML tables; PowerPoint presentations - * are surfaced as `pptx`/`ppt` with the extracted slides as HTML. + * Height in pixels of the returned screenshot image */ - type: - | 'html' - | 'xml' - | 'json' - | 'text' - | 'csv' - | 'markdown' - | 'svg' - | 'pdf' - | 'docx' - | 'doc' - | 'xlsx' - | 'xls' - | 'pptx' - | 'ppt'; + height?: number; /** - * The URL that was scraped + * Credits this request used and your remaining balance. */ - url: string; + key_metadata?: WebScreenshotResponse.KeyMetadata; + + /** + * Public image URL for standard requests, or an in-memory data URL when ZDR or + * non-empty custom headers are supplied. + */ + screenshot?: string; /** - * One verified outcome per requested browser action, in request order. + * Type of screenshot that was captured */ - actionsApplied?: Array; + screenshotType?: 'viewport' | 'fullPage'; /** - * True when an action was applied but the returned content could not be refreshed - * afterward. + * Always `ok` on success. */ - actionsHtmlStale?: boolean; + status?: string; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Width in pixels of the returned screenshot image */ - key_metadata?: WebWebScrapeHTMLResponse.KeyMetadata; + width?: number; } -export namespace WebWebScrapeHTMLResponse { +export namespace WebScreenshotResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ export interface CacheMetadata { /** @@ -1677,228 +1758,205 @@ export namespace WebWebScrapeHTMLResponse { } /** - * Metadata extracted from the scraped page HTML. + * Credits this request used and your remaining balance. */ - export interface Metadata { + export interface KeyMetadata { /** - * Final URL scraped after redirects or scraper fallback, when known. Falls back to - * sourceUrl when unavailable. + * Credits charged for this request. */ - finalUrl: string; + credits_consumed: number; /** - * Original URL requested by the caller. + * Credits remaining for your organization. */ - sourceUrl: string; + credits_remaining: number; + } +} - /** - * Additional non-social meta tags not promoted to top-level metadata fields. - */ - additionalMeta?: { [key: string]: string | Array }; +export interface WebSearchResponse { + /** + * Whether this response came from cache. + */ + cache_metadata: WebSearchResponse.CacheMetadata; - /** - * Resolved alternate links from link rel=alternate tags. - */ - alternates?: Array; + /** + * Echo of the original query (useful when fanout was enabled). + */ + query: string; - /** - * Author metadata, when present. - */ - author?: string; + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; - /** - * Resolved canonical URL, when present. - */ - canonicalUrl?: string; + results: Array; - /** - * Best description extracted from standard, Open Graph, or Twitter metadata. - */ - description?: string; + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: WebSearchResponse.KeyMetadata; - /** - * Resolved favicon URL, when present. - */ - favicon?: string; - - /** - * Page headings (h1–h6) in document order, extracted from the unfiltered document. - * Capped at the first 500 headings. Omitted when the page has none. - */ - headings?: Array; - - /** - * Primary resolved preview image from Open Graph, Twitter, or image metadata. - */ - image?: string; - - /** - * JSON-LD structured data blocks parsed from the page. - */ - jsonLd?: Array<{ [key: string]: unknown }>; + /** + * True when timeoutOpts.behavior=return-partial returned the usable results + * collected before the deadline. Partial collections are not cached as complete + * results. + */ + partial?: boolean; +} +export namespace WebSearchResponse { + /** + * Whether this response came from cache. + */ + export interface CacheMetadata { /** - * Keywords extracted from the page's keywords meta tag. + * Age of the cached data in milliseconds. Zero for miss and zdr responses. */ - keywords?: Array; + age_ms: number; /** - * Language extracted from html lang or language meta tags. + * Whether the response was served from cache, required fresh work, or honored + * zero-data-retention cache bypass. */ - language?: string; + status: 'hit' | 'miss' | 'zdr'; + } + export interface Result { /** - * Modified timestamp/date from page metadata, when present. + * Snippet excerpt from the page. Empty string when the search provider does not + * supply a snippet. */ - modifiedTime?: string; + description: string; /** - * Open Graph metadata with the og: prefix removed and keys camel-cased. + * Highlights status and passages for this result. */ - openGraph?: { [key: string]: string | Array }; + highlights: Result.Highlights; /** - * Published timestamp/date from page metadata, when present. + * Markdown scrape status and content for this result. */ - publishedTime?: string; + markdown: Result.Markdown; /** - * Robots meta directive, when present. + * Relevance to the original query. */ - robots?: string; + relevance: 'high' | 'medium' | 'low'; /** - * Site or application name from page metadata. + * Page title. */ - siteName?: string; + title: string; /** - * Best title extracted from the page. + * Canonical result URL. */ - title?: string; + url: string; + } + export namespace Result { /** - * Twitter card metadata with the twitter: prefix removed and keys camel-cased. + * Highlights status and passages for this result. */ - twitter?: { [key: string]: string | Array }; - } - - export namespace Metadata { - export interface Alternate { - /** - * Resolved alternate URL. - */ - href: string; - + export interface Highlights { /** - * Language or locale for the alternate URL, when present. + * Per-result highlights outcome. Inspect this before reading `highlights`. */ - hreflang?: string; + code: + | 'SUCCESS' + | 'NOT_REQUESTED' + | 'TIMEOUT' + | 'CONTENT_TOO_LARGE' + | 'WEBSITE_ACCESS_ERROR' + | 'WEBSITE_BLOCKED' + | 'ERROR'; /** - * Alternate resource title, when present. + * Passages relevant to the query, in page order. Null unless + * highlightsOptions.enabled is true and the page was read. */ - title?: string; + highlights: Array | null; + } + /** + * Markdown scrape status and content for this result. + */ + export interface Markdown { /** - * Alternate resource MIME type, when present. + * Per-result scrape outcome. Inspect this before reading `markdown`. */ - type?: string; - } + code: + | 'SUCCESS' + | 'NOT_REQUESTED' + | 'TIMEOUT' + | 'CONTENT_TOO_LARGE' + | 'WEBSITE_ACCESS_ERROR' + | 'WEBSITE_BLOCKED' + | 'ERROR'; - export interface Heading { /** - * Heading level, 1–6 (from h1–h6). + * GFM Markdown of the page. Null unless markdownOptions.enabled is true and + * scraping succeeded. */ - level: number; + markdown: string | null; /** - * Heading text with whitespace collapsed, truncated to 1000 characters. + * `loaded`, or `still-loading` when capture ended before the page finished + * loading. */ - text: string; + finalDOMState?: 'loaded' | 'still-loading'; } } - export interface ActionsApplied { - instruction: string; - - /** - * Applied means the requested page state was visibly verified. Failed means it was - * not verified. Skipped means it was not attempted. - */ - status: 'applied' | 'failed' | 'skipped'; - - /** - * Visible page evidence used to verify an applied action. - */ - completionEvidence?: string; - - durationMs?: number; - - error?: string; - - method?: string; - - targetDescription?: string; - } - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } -export interface WebWebScrapeImagesResponse { +export interface WebWebCrawlMdResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ - cache_metadata: WebWebScrapeImagesResponse.CacheMetadata; + cache_metadata: WebWebCrawlMdResponse.CacheMetadata; - /** - * Images found on the page. - */ - images: Array; + metadata: WebWebCrawlMdResponse.Metadata; /** - * Always true on success. + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. */ - success: true; + request_id: string; - /** - * Page URL that was scraped. - */ - url: string; + results: Array; /** - * One verified outcome per requested browser action, in request order. + * Credits this request used and your remaining balance. */ - actionsApplied?: Array; + key_metadata?: WebWebCrawlMdResponse.KeyMetadata; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * True when timeoutOpts.behavior=return-partial returned the usable results + * collected before the deadline. Partial collections are not cached as complete + * results. */ - key_metadata?: WebWebScrapeImagesResponse.KeyMetadata; + partial?: boolean; } -export namespace WebWebScrapeImagesResponse { +export namespace WebWebCrawlMdResponse { /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. + * Whether this response came from cache. */ export interface CacheMetadata { /** @@ -1913,1445 +1971,1241 @@ export namespace WebWebScrapeImagesResponse { status: 'hit' | 'miss' | 'zdr'; } - export interface Image { + export interface Metadata { /** - * Image alt text, or null when unavailable. + * Maximum crawl depth reached during the crawl */ - alt: string | null; + maxCrawlDepth: number; /** - * Where the image was found. + * Number of pages that failed to crawl */ - element: 'img' | 'svg' | 'link' | 'source' | 'video' | 'css' | 'object' | 'meta' | 'background'; + numFailed: number; /** - * Original image value: URL, inline SVG or HTML, or base64 data URI. + * Number of URLs skipped (PDFs when pdf.shouldParse=false, URLs not matching + * urlRegex, or URLs matching excludeUrlRegex) */ - src: string; + numSkipped: number; /** - * Format of src. + * Number of pages successfully crawled */ - type: 'url' | 'html' | 'base64'; + numSucceeded: number; /** - * Requested metadata for images that could be processed. + * Total number of URLs crawled */ - enrichment?: Image.Enrichment; + numUrls: number; } - export namespace Image { + export interface Result { /** - * Requested metadata for images that could be processed. + * Extracted page content as Markdown (empty string on failure) */ - export interface Enrichment { + markdown: string; + + metadata: Result.Metadata; + } + + export namespace Result { + export interface Metadata { /** - * Image height in pixels, when measured. + * Depth relative to the start URL. 0 = start URL, 1 = one link away. */ - height?: number; + crawlDepth: number; /** - * Detected MIME type, when hosted. + * Final URL scraped after redirects or scraper fallback, when known. Falls back to + * sourceUrl when unavailable. */ - mimetype?: string; + finalUrl: string; /** - * Visual asset category, when classified. + * Original URL requested by the caller. */ - type?: 'photography' | 'illustration' | 'logo' | 'wordmark' | 'icon' | 'pattern' | 'graphic' | 'other'; + sourceUrl: string; /** - * Brand.dev CDN URL, when hosted. + * HTTP status code of the response */ - url?: string; + statusCode: number; /** - * Image width in pixels, when measured. + * true if the page was fetched and parsed successfully */ - width?: number; - } - } + success: boolean; - export interface ActionsApplied { - instruction: string; + /** + * Best page title extracted from the page (empty string if unavailable). + */ + title: string; - /** - * Applied means the requested page state was visibly verified. Failed means it was - * not verified. Skipped means it was not attempted. - */ - status: 'applied' | 'failed' | 'skipped'; + /** + * The crawl URL fetched for this page. + */ + url: string; - /** - * Visible page evidence used to verify an applied action. - */ - completionEvidence?: string; + /** + * Additional non-social meta tags not promoted to top-level metadata fields. + */ + additionalMeta?: { [key: string]: string | Array }; - durationMs?: number; + /** + * Resolved alternate links from link rel=alternate tags. + */ + alternates?: Array; - error?: string; + /** + * Author metadata, when present. + */ + author?: string; - method?: string; + /** + * Resolved canonical URL, when present. + */ + canonicalUrl?: string; - targetDescription?: string; - } + /** + * Best description extracted from standard, Open Graph, or Twitter metadata. + */ + description?: string; - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - export interface KeyMetadata { - /** - * The number of credits consumed by this request. - */ - credits_consumed: number; + /** + * Resolved favicon URL, when present. + */ + favicon?: string; - /** - * The number of credits remaining for your organization after this request. - */ - credits_remaining: number; - } -} + /** + * Page headings (h1–h6) in document order, extracted from the unfiltered document. + * Capped at the first 500 headings. Omitted when the page has none. + */ + headings?: Array; -export interface WebWebScrapeMdResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - cache_metadata: WebWebScrapeMdResponse.CacheMetadata; + /** + * Primary resolved preview image from Open Graph, Twitter, or image metadata. + */ + image?: string; - /** - * UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result - * and compare small values against your workload's minimum useful-content - * threshold. - */ - contentLength: number; + /** + * JSON-LD structured data blocks parsed from the page. + */ + jsonLd?: Array<{ [key: string]: unknown }>; - /** - * Page content converted to GitHub Flavored Markdown - */ - markdown: string; + /** + * Keywords extracted from the page's keywords meta tag. + */ + keywords?: Array; - /** - * Metadata extracted from the scraped page HTML. - */ - metadata: WebWebScrapeMdResponse.Metadata; + /** + * Language extracted from html lang or language meta tags. + */ + language?: string; - /** - * Indicates success - */ - success: true; + /** + * Modified timestamp/date from page metadata, when present. + */ + modifiedTime?: string; - /** - * The URL that was scraped - */ - url: string; + /** + * Open Graph metadata with the og: prefix removed and keys camel-cased. + */ + openGraph?: { [key: string]: string | Array }; - /** - * One verified outcome per requested browser action, in request order. - */ - actionsApplied?: Array; + /** + * Published timestamp/date from page metadata, when present. + */ + publishedTime?: string; - /** - * True when an action was applied but the returned content could not be refreshed - * afterward. - */ - actionsHtmlStale?: boolean; + /** + * Robots meta directive, when present. + */ + robots?: string; - /** - * Only present when includeHTML=true: the page HTML the Markdown was converted - * from — the same body the Scrape HTML endpoint returns for the equivalent - * request. - */ - html?: string; - - /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. - */ - key_metadata?: WebWebScrapeMdResponse.KeyMetadata; -} - -export namespace WebWebScrapeMdResponse { - /** - * Cache outcome for this response. Composite responses are hits only when every - * cache-controlled fetch contributing to the output was a hit; age_ms is the - * oldest contributing hit. - */ - export interface CacheMetadata { - /** - * Age of the cached data in milliseconds. Zero for miss and zdr responses. - */ - age_ms: number; - - /** - * Whether the response was served from cache, required fresh work, or honored - * zero-data-retention cache bypass. - */ - status: 'hit' | 'miss' | 'zdr'; - } - - /** - * Metadata extracted from the scraped page HTML. - */ - export interface Metadata { - /** - * Final URL scraped after redirects or scraper fallback, when known. Falls back to - * sourceUrl when unavailable. - */ - finalUrl: string; - - /** - * Original URL requested by the caller. - */ - sourceUrl: string; - - /** - * Additional non-social meta tags not promoted to top-level metadata fields. - */ - additionalMeta?: { [key: string]: string | Array }; - - /** - * Resolved alternate links from link rel=alternate tags. - */ - alternates?: Array; - - /** - * Author metadata, when present. - */ - author?: string; - - /** - * Resolved canonical URL, when present. - */ - canonicalUrl?: string; - - /** - * Best description extracted from standard, Open Graph, or Twitter metadata. - */ - description?: string; - - /** - * Resolved favicon URL, when present. - */ - favicon?: string; - - /** - * Page headings (h1–h6) in document order, extracted from the unfiltered document. - * Capped at the first 500 headings. Omitted when the page has none. - */ - headings?: Array; - - /** - * Primary resolved preview image from Open Graph, Twitter, or image metadata. - */ - image?: string; - - /** - * JSON-LD structured data blocks parsed from the page. - */ - jsonLd?: Array<{ [key: string]: unknown }>; - - /** - * Keywords extracted from the page's keywords meta tag. - */ - keywords?: Array; - - /** - * Language extracted from html lang or language meta tags. - */ - language?: string; - - /** - * Modified timestamp/date from page metadata, when present. - */ - modifiedTime?: string; - - /** - * Open Graph metadata with the og: prefix removed and keys camel-cased. - */ - openGraph?: { [key: string]: string | Array }; - - /** - * Published timestamp/date from page metadata, when present. - */ - publishedTime?: string; - - /** - * Robots meta directive, when present. - */ - robots?: string; - - /** - * Site or application name from page metadata. - */ - siteName?: string; - - /** - * Best title extracted from the page. - */ - title?: string; - - /** - * Twitter card metadata with the twitter: prefix removed and keys camel-cased. - */ - twitter?: { [key: string]: string | Array }; - } - - export namespace Metadata { - export interface Alternate { - /** - * Resolved alternate URL. - */ - href: string; - - /** - * Language or locale for the alternate URL, when present. - */ - hreflang?: string; - - /** - * Alternate resource title, when present. - */ - title?: string; - - /** - * Alternate resource MIME type, when present. - */ - type?: string; - } - - export interface Heading { - /** - * Heading level, 1–6 (from h1–h6). - */ - level: number; + /** + * Site or application name from page metadata. + */ + siteName?: string; /** - * Heading text with whitespace collapsed, truncated to 1000 characters. + * Twitter card metadata with the twitter: prefix removed and keys camel-cased. */ - text: string; + twitter?: { [key: string]: string | Array }; } - } - export interface ActionsApplied { - instruction: string; - - /** - * Applied means the requested page state was visibly verified. Failed means it was - * not verified. Skipped means it was not attempted. - */ - status: 'applied' | 'failed' | 'skipped'; + export namespace Metadata { + export interface Alternate { + /** + * Resolved alternate URL. + */ + href: string; - /** - * Visible page evidence used to verify an applied action. - */ - completionEvidence?: string; + /** + * Language or locale for the alternate URL, when present. + */ + hreflang?: string; - durationMs?: number; + /** + * Alternate resource title, when present. + */ + title?: string; - error?: string; + /** + * Alternate resource MIME type, when present. + */ + type?: string; + } - method?: string; + export interface Heading { + /** + * Heading level, 1–6 (from h1–h6). + */ + level: number; - targetDescription?: string; + /** + * Heading text with whitespace collapsed, truncated to 1000 characters. + */ + text: string; + } + } } /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Credits this request used and your remaining balance. */ export interface KeyMetadata { /** - * The number of credits consumed by this request. + * Credits charged for this request. */ credits_consumed: number; /** - * The number of credits remaining for your organization after this request. + * Credits remaining for your organization. */ credits_remaining: number; } } -export interface WebWebScrapeSitemapResponse { +export interface WebAnswersParams { /** - * The normalized domain that was crawled + * Research task. The agent selects company/profile lookups, web searches, or page + * reads. Include domains or URLs to focus the research. */ - domain: string; + task: string; /** - * Metadata about the sitemap crawl operation + * Example answer object, not JSON Schema. Up to 8 levels, 500 values, and 16000 + * characters; unknowns may be null. */ - meta: WebWebScrapeSitemapResponse.Meta; + json_format?: { [key: string]: unknown }; /** - * Indicates success + * `fast` prioritizes speed, with extra verification for people and companies; + * `ultra` supports deeper research (default). */ - success: true; + mode?: 'fast' | 'ultra'; /** - * Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set - * these are only the matching pages, most relevant first. + * Access policy IDs to apply. A URL must pass every policy. */ - urls: Array; + policies?: Array; /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Labels for filtering usage in the dashboard. */ - key_metadata?: WebWebScrapeSitemapResponse.KeyMetadata; -} + tags?: Array; -export namespace WebWebScrapeSitemapResponse { /** - * Metadata about the sitemap crawl operation + * Request deadline and what to return when it passes. */ - export interface Meta { - /** - * Number of errors encountered during crawling - */ - errors: number; - - /** - * Total number of sitemap files discovered - */ - sitemapsDiscovered: number; + timeoutOpts?: WebAnswersParams.TimeoutOpts; - /** - * Number of sitemap files successfully fetched and parsed - */ - sitemapsFetched: number; - - /** - * Number of sitemap files skipped (due to errors, timeouts, or limits) - */ - sitemapsSkipped: number; - } + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} +export namespace WebAnswersParams { /** - * Metadata about the API key used for the request. Included in every response - * whenever a valid API key is provided, even when the response status is not 200. + * Request deadline and what to return when it passes. */ - export interface KeyMetadata { + export interface TimeoutOpts { /** - * The number of credits consumed by this request. + * Deadline in milliseconds. */ - credits_consumed: number; + milliseconds: number; /** - * The number of credits remaining for your organization after this request. + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. */ - credits_remaining: number; + behavior?: 'fail' | 'return-partial'; } } -export interface WebExtractParams { +export interface WebExtractCompetitorsParams { /** - * JSON Schema for the returned data object. Image fields such as `image_urls` or - * `product_photos` automatically make page image references available to - * extraction, so product data and photos can be returned in one call. TypeScript - * Zod users can pass a JSON Schema generated from a Zod object; Python users can - * pass the equivalent JSON Schema object. + * Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted + * and normalized to their domain. */ - schema: { [key: string]: unknown }; + domain: string; /** - * The starting website URL to crawl and extract from. Must include http:// or - * https://. + * Exact number of direct competitors to return. Defaults to 5. */ - url: string; + numCompetitors?: number; /** - * Optional browser actions executed in order on the requested page after it loads, - * before links are discovered or additional pages are crawled. Requires a paid - * plan. When actions are provided and stopAfterMs is omitted, the crawl budget - * defaults to 110000 ms. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ - actions?: Array< - | WebExtractParams.WebScrapeWaitAction - | WebExtractParams.WebScrapePerformAction - | WebExtractParams.WebScrapeScrollAction - >; + tags?: Array; /** - * When true, every returned value must be grounded in facts stated on the page; - * fields that cannot be supported by the page are returned as null/empty. When - * false (default), the model may make reasonable inferences and derivations from - * the page content (e.g. ideal customer, competitor analysis, recommendations) - * while keeping verifiable specifics (names, quotes, URLs, dates, metrics) - * faithful to the source. + * Request deadline and what to return when it passes. */ - factCheck?: boolean; + timeoutOpts?: WebExtractCompetitorsParams.TimeoutOpts; /** - * When true, follow links on subdomains of the starting URL's domain. + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. */ - followSubdomains?: boolean; + zdr?: 'enabled' | 'disabled'; +} +export namespace WebExtractCompetitorsParams { /** - * When true, iframe contents are included in Markdown before extraction. + * Request deadline and what to return when it passes. */ - includeFrames?: boolean; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; - /** - * Optional extraction guidance, such as which facts to prioritize or how to - * interpret fields in the schema. - */ - instructions?: string; + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } +} +export interface WebExtractStyleguideParams { /** - * Return cached scrape results if a prior scrape for the same parameters is - * younger than this many milliseconds. Defaults to 7 days (604800000 ms). + * Optional browser color scheme to emulate for websites that respond to + * prefers-color-scheme. This value is part of the styleguide cache key. */ - maxAgeMs?: number; + colorScheme?: 'light' | 'dark'; /** - * Optional maximum link depth from the starting URL (0 = only the starting page). - * If omitted, there is no crawl depth limit. + * Exact URL to inspect. Provide either `domain` or `directUrl`, not both. */ - maxDepth?: number; + directUrl?: string; /** - * Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. + * Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The + * domain will be automatically normalized and validated. You must provide either + * 'domain' or 'directUrl', but not both. */ - maxPages?: number; - - pdf?: WebExtractParams.Pdf; + domain?: string; /** - * When true, waits briefly for CSS and transition animations to settle before - * extracting each crawled page. Defaults to false. This adds a bit of latency in - * exchange for more stable output on animated pages. + * Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 + * year. `0` refreshes. */ - settleAnimations?: boolean; + maxAgeMs?: number | null; /** - * Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 - * (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are - * provided. + * Comma-separated access policy IDs to apply. A URL must pass every policy. */ - stopAfterMs?: number; + policies?: Array; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Request deadline and what to return when it passes. */ - timeoutMS?: number; + timeoutOpts?: WebExtractStyleguideParams.TimeoutOpts; /** - * Optional browser wait time in milliseconds after initial page load for each - * crawled page. + * `enabled` disables request logs and traces and omits request and response + * content from usage logs. Brand data and hosted assets may still be stored. + * Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. */ - waitForMs?: number; + zdr?: 'enabled' | 'disabled'; } -export namespace WebExtractParams { +export namespace WebExtractStyleguideParams { /** - * Pause for a fixed number of milliseconds before continuing to the next action. + * Request deadline and what to return when it passes. */ - export interface WebScrapeWaitAction { - do: 'wait'; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; - timeMs: number; + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. + */ + behavior?: 'fail' | 'return-partial'; } +} +export interface WebMapURLsParams { /** - * Resolve and perform one natural-language browser action. + * Domain to map, e.g. `stripe.com`. */ - export interface WebScrapePerformAction { - action: string; + domain: string; - do: 'perform'; - } + /** + * Regex pattern. URLs matching this pattern are not returned, even when they match + * urlRegex. + */ + excludeUrlRegex?: string; /** - * Scroll the page or a selected scrollable container, waiting adaptively for - * content and dimensions to settle after each iteration. + * HTTP headers for the target origin. Non-empty headers bypass caching. */ - export interface WebScrapeScrollAction { - do: 'scroll'; + headers?: { [key: string]: string }; - /** - * Pixels per scroll, one visible viewport, or the current scroll boundary. - * Defaults to viewport. - */ - amount?: number | 'viewport' | 'max'; + /** + * Include URLs on subdomains. + */ + includeSubdomains?: boolean; - /** - * CSS selector for the first matching scroll container. Defaults to the page. - */ - container?: string; + /** + * Maximum number of URLs to return. + */ + maxLinks?: number; - /** - * Direction to scroll. Defaults to down. - */ - direction?: 'up' | 'down' | 'left' | 'right'; + /** + * Comma-separated access policy IDs to apply. A URL must pass every policy. + */ + policies?: Array; - /** - * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop - * changing. Defaults to 1. - */ - maxScrolls?: number; - } + /** + * Filter URLs by a topic or phrase, most relevant first. + */ + search?: string; - export interface Pdf { - /** - * Last 1-based PDF page to parse. Must be greater than or equal to start when both - * are provided. - */ - end?: number; + /** + * Fetch this sitemap instead of discovering sitemaps. Must belong to the domain or + * a subdomain. + */ + sitemapUrl?: string; + + /** + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. + */ + tags?: Array; + + /** + * Request deadline and what to return when it passes. + */ + timeoutOpts?: WebMapURLsParams.TimeoutOpts; + + /** + * Regex pattern. Only URLs matching this pattern are returned and counted against + * maxLinks. + */ + urlRegex?: string; + + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} +export namespace WebMapURLsParams { + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { /** - * When true, PDF pages are fetched and parsed. When false, PDF pages are skipped. + * Deadline in milliseconds. */ - shouldParse?: boolean; + milliseconds: number; /** - * First 1-based PDF page to parse. + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. */ - start?: number; + behavior?: 'fail' | 'return-partial'; } } -export interface WebExtractCompetitorsParams { +export interface WebScrapeParams { /** - * Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted - * and normalized to their domain. + * Outputs to return. Set at least one to `true`. */ - domain: string; + formats: WebScrapeParams.Formats; /** - * Exact number of direct competitors to return. Defaults to 5. + * Public HTTP or HTTPS URL to scrape. */ - numCompetitors?: number; + url: string; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Requires `formats.highlights: true`; required when it is set. */ - tags?: Array; + highlightsParams?: WebScrapeParams.HighlightsParams; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Image options. Requires formats.images: true. */ - timeoutMS?: number; -} + imageParams?: WebScrapeParams.ImageParams; -export interface WebExtractFontsParams { /** - * A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., - * 'https://example.com/design-system'). When provided, fonts are extracted from - * this exact URL. You must provide either 'domain' or 'directUrl', but not both. + * Requires `formats.json: true`; required when it is set. */ - directUrl?: string; + jsonParams?: WebScrapeParams.JsonParams; /** - * Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The - * domain will be automatically normalized and validated. You must provide either - * 'domain' or 'directUrl', but not both. + * Markdown options. Requires `formats.markdown`. */ - domain?: string; + markdownParams?: WebScrapeParams.MarkdownParams; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to + * 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). */ - maxAgeMs?: number | null; + maxAgeMs?: number; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Requires `formats.parse: true`; required when it is set. */ - tags?: Array; + parseParams?: WebScrapeParams.CustomParser | WebScrapeParams.PrebuiltParser; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Access policy IDs to apply. A URL must pass every policy. */ - timeoutMS?: number; -} + policies?: Array; -export interface WebExtractStyleguideParams { /** - * Optional browser color scheme to emulate for websites that respond to - * prefers-color-scheme. This value is part of the styleguide cache key. + * Product options. Requires formats.product: true. */ - colorScheme?: 'light' | 'dark'; + productParams?: WebScrapeParams.ProductParams; /** - * A specific URL to fetch the styleguide from directly, bypassing domain - * resolution (e.g., 'https://example.com/design-system'). When provided, the - * styleguide is extracted from this exact URL. You must provide either 'domain' or - * 'directUrl', but not both. + * Screenshot options. Requires formats.screenshot: true. */ - directUrl?: string; + screenshotParams?: WebScrapeParams.ScreenshotParams; /** - * Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The - * domain will be automatically normalized and validated. You must provide either - * 'domain' or 'directUrl', but not both. + * Browser and content settings shared by all outputs. */ - domain?: string; + sharedParams?: WebScrapeParams.SharedParams; /** - * Maximum age in milliseconds for cached brand data before the API performs a hard - * refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) - * are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 - * year. + * Labels for filtering usage in the dashboard. */ - maxAgeMs?: number | null; + tags?: Array; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Request deadline and what to return when it passes. */ - tags?: Array; + timeoutOpts?: WebScrapeParams.TimeoutOpts; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * `enabled` turns on zero data retention. Your organization must have ZDR enabled. */ - timeoutMS?: number; + zdr?: 'enabled' | 'disabled'; } -export interface WebScreenshotParams { +export namespace WebScrapeParams { /** - * Optional parameter for comprehensive popup cleanup. If 'true', the browser - * dismisses detected cookie/consent UI and clears other detected obstructive - * popups and overlays before capture. If 'false' or not provided, this parameter - * requests no cleanup; handleCookiePopup can still request cookie/consent handling - * independently. + * Outputs to return. Set at least one to `true`. */ - clearPopups?: boolean; + export interface Formats { + /** + * The original HTTP response body. + */ + bytes?: boolean; + + /** + * Markdown excerpts relevant to `highlightsParams.query`. + */ + highlights?: boolean; + + /** + * Rendered HTML. + */ + html?: boolean; + + /** + * Images found on the page. + */ + images?: boolean; + + /** + * An object matching `jsonParams.schema`, extracted from the page text and its + * embedded data (JSON-LD, meta tags, framework state). + */ + json?: boolean; + + /** + * Page content or video transcript as Markdown. + */ + markdown?: boolean; + + /** + * Fields extracted with custom rules or a prebuilt parser, returned as `parsed`. + */ + parse?: boolean; + + /** + * Product details such as name, price, and availability. + */ + product?: boolean; + + /** + * A screenshot of the page. + */ + screenshot?: boolean; + } /** - * Optional parameter to choose the site's visual theme in the screenshot. Use - * 'light' or 'dark' when the site offers both appearances. + * Requires `formats.highlights: true`; required when it is set. */ - colorScheme?: 'light' | 'dark'; + export interface HighlightsParams { + /** + * The question or topic to find passages for. + */ + query: string; + + /** + * Maximum combined length of returned passages. + */ + maxCharacters?: number; + } /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Image options. Requires formats.images: true. */ - country?: - | 'ad' - | 'ae' - | 'af' - | 'ag' - | 'ai' - | 'al' - | 'am' - | 'ao' - | 'ar' - | 'at' - | 'au' - | 'aw' - | 'az' - | 'ba' - | 'bb' - | 'bd' - | 'be' - | 'bf' - | 'bg' - | 'bh' - | 'bi' - | 'bj' - | 'bm' - | 'bn' - | 'bo' - | 'bq' - | 'br' - | 'bs' - | 'bw' - | 'by' - | 'bz' - | 'ca' - | 'cd' - | 'cf' - | 'cg' - | 'ch' - | 'ci' - | 'cl' - | 'cm' - | 'cn' - | 'co' - | 'cr' - | 'cv' - | 'cw' - | 'cy' - | 'cz' - | 'de' - | 'dj' - | 'dk' - | 'dm' - | 'do' - | 'dz' - | 'ec' - | 'ee' - | 'eg' - | 'es' - | 'et' - | 'fi' - | 'fj' - | 'fr' - | 'ga' - | 'gb' - | 'gd' - | 'ge' - | 'gf' - | 'gg' - | 'gh' - | 'gm' - | 'gn' - | 'gp' - | 'gq' - | 'gr' - | 'gt' - | 'gu' - | 'gw' - | 'gy' - | 'hk' - | 'hn' - | 'hr' - | 'ht' - | 'hu' - | 'id' - | 'ie' - | 'il' - | 'im' - | 'in' - | 'iq' - | 'ir' - | 'is' - | 'it' - | 'je' - | 'jm' - | 'jo' - | 'jp' - | 'ke' - | 'kg' - | 'kh' - | 'kn' - | 'kr' - | 'kw' - | 'ky' - | 'kz' - | 'la' - | 'lb' - | 'lc' - | 'lk' - | 'lr' - | 'ls' - | 'lt' - | 'lu' - | 'lv' - | 'ly' - | 'ma' - | 'mc' - | 'md' - | 'me' - | 'mf' - | 'mg' - | 'mk' - | 'ml' - | 'mm' - | 'mn' - | 'mo' - | 'mq' - | 'mr' - | 'mt' - | 'mu' - | 'mv' - | 'mw' - | 'mx' - | 'my' - | 'mz' - | 'na' - | 'nc' - | 'ne' - | 'ng' - | 'ni' - | 'nl' - | 'no' - | 'np' - | 'nz' - | 'om' - | 'pa' - | 'pe' - | 'pf' - | 'pg' - | 'ph' - | 'pk' - | 'pl' - | 'pr' - | 'ps' - | 'pt' - | 'py' - | 'qa' - | 're' - | 'ro' - | 'rs' - | 'ru' - | 'rw' - | 'sa' - | 'sc' - | 'sd' - | 'se' - | 'sg' - | 'si' - | 'sk' - | 'sl' - | 'sm' - | 'sn' - | 'so' - | 'sr' - | 'ss' - | 'st' - | 'sv' - | 'sx' - | 'sy' - | 'sz' - | 'tc' - | 'td' - | 'tg' - | 'th' - | 'tj' - | 'tl' - | 'tm' - | 'tn' - | 'tr' - | 'tt' - | 'tw' - | 'tz' - | 'ua' - | 'ug' - | 'us' - | 'uy' - | 'uz' - | 'vc' - | 've' - | 'vg' - | 'vi' - | 'vn' - | 'ye' - | 'yt' - | 'za' - | 'zm' - | 'zw'; + export interface ImageParams { + /** + * Set `visual` to drop visual duplicates, keeping the largest copy. + */ + dedupe?: 'none' | 'visual'; - /** - * A specific URL to screenshot directly, bypassing domain resolution (e.g., - * 'https://example.com/pricing'). When provided, the screenshot is taken of this - * exact URL. You must provide either 'domain' or 'directUrl', but not both. - */ - directUrl?: string; + /** + * Extra data per image: `dimensions`, `classification`, or a hosted `file` URL. + */ + enrich?: Array<'dimensions' | 'classification' | 'file'>; + } /** - * Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The - * domain will be automatically normalized and validated. You must provide either - * 'domain' or 'directUrl', but not both. + * Requires `formats.json: true`; required when it is set. */ - domain?: string; + export interface JsonParams { + /** + * JSON Schema (not an example object) for a top-level object, up to 50 KB. Use + * optional or nullable fields for missing facts. + */ + schema: { [key: string]: unknown }; - /** - * Optional parameter to determine screenshot type. If 'true', takes a full page - * screenshot capturing all content. If 'false' or not provided, takes a viewport - * screenshot (standard browser view). - */ - fullScreenshot?: 'true' | 'false'; + /** + * Extra guidance, such as which facts to prefer or how to read a field. + */ + instructions?: string; + } /** - * Optional parameter to control cookie/consent popup handling. If 'true', we - * dismiss cookie banner before capture. If 'false' or not provided, captures the - * page without that step. + * Markdown options. Requires `formats.markdown`. */ - handleCookiePopup?: boolean; + export interface MarkdownParams { + /** + * Include images in the Markdown (`html-conversion` only). + */ + includeImages?: boolean; - /** - * Return a cached screenshot if a prior screenshot for the same parameters exists - * and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh. - */ - maxAgeMs?: number | null; + /** + * Keep link URLs in the Markdown (`html-conversion` only). + */ + includeLinks?: boolean; - /** - * Optional parameter to specify which page type to screenshot. If provided, the - * system will scrape the domain's links and use heuristics to find the most - * appropriate URL for the specified page type (30 supported languages). If not - * provided, screenshots the main domain landing page. Only applicable when using - * 'domain', not 'directUrl'. - */ - page?: 'login' | 'signup' | 'blog' | 'careers' | 'pricing' | 'terms' | 'privacy' | 'contact'; + /** + * How base64 images appear when `includeImages` is set (`html-conversion` only). + */ + inlineImages?: 'placeholder' | 'preserve'; - /** - * Optional vertical scroll offset in pixels for capturing a long page in - * viewport-sized chunks. When provided, the full page is captured once and the - * returned image is the viewport-sized slice that begins at this Y offset (e.g. - * request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page - * top to bottom). The final slice may be shorter than the viewport height. Takes - * precedence over fullScreenshot. Max: 100000. - */ - scrollOffset?: number | null; + /** + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. + */ + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; + } - /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. - */ - tags?: Array; + export interface CustomParser { + /** + * Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100 + * fields, 5 levels. + */ + rules: { [key: string]: string | CustomParser.UnionMember1 }; - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; + /** + * Extract fields using custom CSS rules. This is the default when type is omitted. + */ + type?: 'custom'; + } - /** - * Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. - */ - viewport?: WebScreenshotParams.Viewport; + export namespace CustomParser { + export interface UnionMember1 { + /** + * CSS selector to match within the current page or parent rule. + */ + selector: string; - /** - * Optional browser wait time in milliseconds after initial page load before taking - * the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when - * omitted. - */ - waitForMs?: number | null; + /** + * Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults + * to text. + */ + output?: 'text' | 'html' | string | unknown; - /** - * Set to enabled to bypass shared caches and omit request and response content - * from retained usage logs. Requires zero data retention to be enabled for your - * organization (contact support@context.dev), otherwise the request fails with - * ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. - */ - zdr?: 'enabled' | 'disabled'; -} + /** + * Return the first match with `item` or all matches with `list`. + */ + type?: 'item' | 'list'; + } + } + + export interface PrebuiltParser { + /** + * google-maps parses Google Maps business data into data.results. Accepts Maps + * place, search, and internal data URLs. Uses a US exit and English labels + * regardless of hl or Accept-Language. google-maps-reviews returns the reviews of + * a place in data.reviews, in the same shape as the Serper reviews API (rating, + * date, isoDate, snippet, translatedSnippet, likes, user, media, response, link, + * id), plus language, guided ratings in details, and user.isLocalGuide; data also + * carries the place featureId, cid, and sort. sort and limit pick the order and + * count, and oldest is exact. It accepts Maps place, search, and ?cid= URLs, plus + * search.google.com/local/reviews URLs, so the google_maps_url and + * google_reviews_url fields of google-maps results work as input. An unknown place + * returns no reviews. google-play parses a Play Store app into data: details, + * developer contact, ratings, price, permissions, and data safety. + * google-play-reviews returns the 200 newest reviews of the app, with developer + * replies, in data.reviews. Both Play parsers accept app details URLs + * (play.google.com/store/apps/details?id=…); hl and gl set the language and + * storefront, defaulting to en and us. app-store parses an App Store app into + * data: details, developer, ratings, price, version, and screenshots. + * app-store-reviews returns up to the 500 newest reviews in data.reviews. Both App + * Store parsers accept app URLs (apps.apple.com/us/app/…/id…); the country in the + * path sets the storefront, defaulting to us. g2-reviews returns the 25 most + * recently published reviews of a G2 product in data.reviews (rating, title, + * likes, dislikes, problems_solved, reviewer role, company size, and industry), + * plus data.product. It accepts G2 product URLs (g2.com/products/…), follows + * renamed products, and keeps star-rating filters from the URL + * (filters[nps_score][]=1 to 5); other filters, sort orders, and pages are + * ignored. instagram-profile parses a public profile (instagram.com/{username}) + * into data: bio, links, follower and post counts, category, business address, + * similar_accounts, and latest_posts (up to the 12 posts at the top of the + * profile, newest first). Instagram lists pinned posts there ahead of newer ones, + * so posts with is_pinned true can be older; when Instagram shows only a rounded + * post count (32K), post_count is that rounded number and is_post_count_rounded is + * true. instagram-post parses a post or reel (/p/…, /reel/…) into data: caption, + * hashtags, mentions, like, comment, and view counts (like_count and view_count + * are null when the owner hides them), media URLs, tagged users, collaborators, + * location, and the top ~14 comments in data.comments. instagram-feed returns the + * top posts for a hashtag or keyword (/explore/tags/…, /popular/…) or the recent + * posts at a location (/explore/locations/{id}/…) in data.posts; keyword posts + * carry only the shortcode, owner, thumbnail, and views, plus the caption when + * Instagram shows it. All three Instagram parsers read public data without logging + * in, so private accounts return no posts and follower lists are unavailable. + * tiktok-profile parses a public profile (tiktok.com/@{username}) into data: + * nickname, bio, bio link, follower, following, like, and video counts, verified, + * private, and business flags, and business category; it does not list videos. + * tiktok-video parses a video or photo post (/@{username}/video/{id} or + * /@{username}/photo/{id}) into data: caption, hashtags, mentions, author, view, + * like, comment, share, save, and repost counts, duration, thumbnail, a video_url + * that downloads without cookies, image_urls for photo posts, music, location, and + * ad, paid-partnership, and AI-generated flags. tiktok-feed returns videos in the + * tiktok-video shape as data.videos: the latest 15 from a profile URL, the top 30 + * from a hashtag URL (/tag/{name}), or the top 12 from a search URL + * (/search?q={query}). tiktok-comments returns the first 20 comments of a video or + * photo post as data.comments: text, posted_at, like and reply counts, whether the + * author liked it, and the commenter. tiktok-followers and tiktok-following return + * up to 30 accounts of a profile as data.users, in the tiktok-profile shape. + * tiktok-user-search returns the top 10 accounts for a user search URL + * (/search/user?q={query}) as data.users: id, username, nickname, biography, + * avatar_url, sec_uid, follower_count, like_count, and is_verified. The TikTok + * parsers accept tiktok.com, www.tiktok.com, and m.tiktok.com URLs but not short + * links (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…). reddit-post parses a post + * (reddit.com/r/{subreddit}/comments/{id}, reddit.com/comments/{id}, or + * redd.it/{id}) into data.post: title, body as Markdown, type (text, link, image, + * gallery, or video), link_url, subreddit, author, flairs, score, upvote_ratio, + * comment and crosspost counts, NSFW, spoiler, locked, stickied, and archived + * flags, images (every gallery image in order), and video (an MP4 url plus an + * hls_url that carries the audio). data.comments holds the comment tree, each + * comment with id, author, body as Markdown, score, posted_at, depth, parent_id, + * url, is_submitter, is_deleted, and its replies; limit caps the total number of + * comments (default 100), filled shallowest first so whole conversations are kept, + * and data.has_more_comments says whether the thread has more. The sort query of + * the URL (best, top, new, controversial, old, qa) orders the comments. + * reddit-search returns search results for a search URL + * (reddit.com/search?q={query}, or reddit.com/r/{subreddit}/search?q={query} to + * search one subreddit). With type=link or no type it returns posts in the + * reddit-post shape as data.posts, ordered by the sort (relevance, hot, top, new, + * comments) and limited to the t time range (hour, day, week, month, year, all) of + * the URL; type=sr returns communities as data.communities (name, title, + * description, sidebar, subscriber_count, created_at, type, NSFW and quarantine + * flags, language, category, icon and banner URLs, and allowed post types); + * type=user returns accounts as data.users (username, display_name, bio, + * created_at, post and comment karma, avatar and banner URLs, and verified, + * employee, moderator, premium, and NSFW flags). limit caps the number of results + * (default 100), in the order Reddit returns them, and data.has_more says whether + * Reddit has more. reddit-subreddit reads a subreddit URL + * (reddit.com/r/{subreddit}, optionally followed by /hot, /new, /top, /rising, or + * /controversial, with t setting the time range of top and controversial, default + * day) into data.subreddit in the community shape of reddit-search, data.rules + * (name, description, applies_to, violation_reason, created_at), and data.posts in + * the reddit-post shape, ordered like the tab (default hot) and with stickied + * posts flagged; r/all and r/popular return posts with a null subreddit and rules. + * limit caps the posts (default 100) and data.has_more says whether Reddit has + * more. Private and quarantined subreddits return WEBSITE_ACCESS_ERROR. + * reddit-user reads a profile URL (reddit.com/user/{username} or + * reddit.com/u/{username}, optionally followed by /overview, /submitted, or + * /comments, with sort set to new, hot, top, or controversial and t setting the + * time range of top and controversial, default all) into data.user (id, username, + * display_name, bio, created_at, total, post, comment, awardee, and awarder karma, + * avatar and banner URLs, and verified, suspended, employee, moderator, premium, + * and NSFW flags), data.trophies (name, description, icon_url, granted_at, url), + * data.moderated_communities (name, title, url, subscriber_count, icon_url, + * is_nsfw), data.posts in the reddit-post shape, and data.comments, each with id, + * author, body as Markdown, score, posted_at, edited_at, url, subreddit, parent_id + * (null for a top-level comment), is_submitter, is_stickied, distinguished, + * award_count, and the post it was left on (id, title, url, author, is_nsfw). The + * overview tab returns both posts and comments; submitted returns null comments + * and comments returns null posts. limit caps the posts and comments together + * (default 100) and data.has_more says whether Reddit has more. Users who hide + * their activity return empty lists, and suspended accounts return their profile + * with null posts and comments. yelp-search accepts Yelp search URLs with + * find_desc and find_loc, reads start as the result offset, and returns up to 20 + * ranked organic businesses in data.businesses with total and pagination. + * yelp-reviews accepts a Yelp business URL (yelp.com/biz/{alias}), uses optional + * start for the offset, and always sorts newest first; unsupported sort and review + * filters are rejected, while tracking params are ignored. It returns up to 20 + * latest public reviews in data.reviews with business details and + * pagination.next_offset. Each review has rating, full text, updated_at, and + * author (id is the Yelp user id from the reviewer profile URL, url links to that + * profile, plus name, location, and review_count); owner replies and photos are + * not included. tripadvisor-reviews accepts a Tripadvisor hotel, restaurant, or + * attraction review URL (tripadvisor.com/Hotel_Review-g{geo}-d{id}-Reviews-….html, + * on any Tripadvisor country domain), reads -or{N}- in the path as the offset, and + * returns 20 reviews in data.reviews in the order Tripadvisor shows them, with + * data.location (id, name, type, url, review_count) and pagination.next_offset. + * Each review has id, url, title, full text, rating, language, published_at, + * visit_month, helpful_votes, subratings, photo_urls, owner_response (text, + * published_at, author_name), and author (id, username, name, url, + * contribution_count); an unknown location returns no reviews. emails accepts any + * page and returns its email addresses as data.emails ([{ email }]), read from + * mailto links, Cloudflare-protected addresses, and visible text. phone-numbers + * accepts any page and returns its valid phone numbers in E.164 as + * data.phone_numbers ([{ phone }]), read from tel links and visible text; numbers + * without a country code are read for the country of the site TLD, defaulting to + * US. links accepts any page and returns its unique http(s) links as data.links + * ([{ url, text }]), with absolute URLs; text falls back to aria-label or image + * alt and is null when a link has none. The emails parser reads the rendered page + * and respects content filters; the other prebuilt parsers read their data + * independently of DOM filters. + */ + parser: + | 'google-maps' + | 'google-maps-reviews' + | 'google-play' + | 'google-play-reviews' + | 'app-store' + | 'app-store-reviews' + | 'g2-reviews' + | 'instagram-profile' + | 'instagram-post' + | 'instagram-feed' + | 'tiktok-profile' + | 'tiktok-video' + | 'tiktok-feed' + | 'tiktok-comments' + | 'tiktok-followers' + | 'tiktok-following' + | 'tiktok-user-search' + | 'reddit-post' + | 'reddit-search' + | 'reddit-subreddit' + | 'reddit-user' + | 'yelp-search' + | 'yelp-reviews' + | 'tripadvisor-reviews' + | 'emails' + | 'phone-numbers' + | 'links'; + + /** + * Use a prebuilt parser instead of custom rules. + */ + type: 'prebuilt'; + + /** + * google-maps-reviews and reddit parsers only. Maximum number of reviews + * (google-maps-reviews, default 100), comments (reddit-post, default 100), or + * results (reddit-search, reddit-subreddit, and reddit-user, default 100) to + * return; maximum 1000. + */ + limit?: number; + + /** + * google-maps-reviews only. Order of data.reviews. newest, relevant, highest, and + * lowest follow Google; oldest returns the earliest reviews first, which Google + * itself does not offer. + */ + sort?: 'newest' | 'oldest' | 'relevant' | 'highest' | 'lowest'; + } -export namespace WebScreenshotParams { /** - * Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. + * Product options. Requires formats.product: true. */ - export interface Viewport { + export interface ProductParams { /** - * Viewport height in pixels. + * Drop visually duplicate product images, keeping the largest copy. */ - height?: number; + dedupeImages?: boolean; /** - * Viewport width in pixels. + * @deprecated Ignored. The AI fallback runs automatically. */ - width?: number; + useAIFallback?: boolean; } -} -export interface WebSearchParams { /** - * Search query. Accepts natural language as well as Google-style search operators - * such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`. + * Screenshot options. Requires formats.screenshot: true. */ - query: string; + export interface ScreenshotParams { + /** + * What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40 + * megapixels. + */ + area?: 'viewport' | 'fullPage' | ScreenshotParams.Element | ScreenshotParams.Rectangle; - /** - * Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific - * country (maps to Google's `gl` parameter). Example: "us", "gb", "de". - */ - country?: - | 'af' - | 'al' - | 'dz' - | 'as' - | 'ad' - | 'ao' - | 'ai' - | 'aq' - | 'ag' - | 'ar' - | 'am' - | 'aw' - | 'au' - | 'at' - | 'az' - | 'bs' - | 'bh' - | 'bd' - | 'bb' - | 'by' - | 'be' - | 'bz' - | 'bj' - | 'bm' - | 'bt' - | 'bo' - | 'ba' - | 'bw' - | 'bv' - | 'br' - | 'io' - | 'bn' - | 'bg' - | 'bf' - | 'bi' - | 'kh' - | 'cm' - | 'ca' - | 'cv' - | 'ky' - | 'cf' - | 'td' - | 'cl' - | 'cn' - | 'cx' - | 'cc' - | 'co' - | 'km' - | 'cg' - | 'cd' - | 'ck' - | 'cr' - | 'ci' - | 'hr' - | 'cu' - | 'cy' - | 'cz' - | 'dk' - | 'dj' - | 'dm' - | 'do' - | 'ec' - | 'eg' - | 'sv' - | 'gq' - | 'er' - | 'ee' - | 'et' - | 'fk' - | 'fo' - | 'fj' - | 'fi' - | 'fr' - | 'gf' - | 'pf' - | 'tf' - | 'ga' - | 'gm' - | 'ge' - | 'de' - | 'gh' - | 'gi' - | 'gr' - | 'gl' - | 'gd' - | 'gp' - | 'gu' - | 'gt' - | 'gn' - | 'gw' - | 'gy' - | 'ht' - | 'hm' - | 'va' - | 'hn' - | 'hk' - | 'hu' - | 'is' - | 'in' - | 'id' - | 'ir' - | 'iq' - | 'ie' - | 'il' - | 'it' - | 'jm' - | 'jp' - | 'jo' - | 'kz' - | 'ke' - | 'ki' - | 'kp' - | 'kr' - | 'kw' - | 'kg' - | 'la' - | 'lv' - | 'lb' - | 'ls' - | 'lr' - | 'ly' - | 'li' - | 'lt' - | 'lu' - | 'mo' - | 'mk' - | 'mg' - | 'mw' - | 'my' - | 'mv' - | 'ml' - | 'mt' - | 'mh' - | 'mq' - | 'mr' - | 'mu' - | 'yt' - | 'mx' - | 'fm' - | 'md' - | 'mc' - | 'mn' - | 'ms' - | 'ma' - | 'mz' - | 'mm' - | 'na' - | 'nr' - | 'np' - | 'nl' - | 'an' - | 'nc' - | 'nz' - | 'ni' - | 'ne' - | 'ng' - | 'nu' - | 'nf' - | 'mp' - | 'no' - | 'om' - | 'pk' - | 'pw' - | 'ps' - | 'pa' - | 'pg' - | 'py' - | 'pe' - | 'ph' - | 'pn' - | 'pl' - | 'pt' - | 'pr' - | 'qa' - | 're' - | 'ro' - | 'ru' - | 'rw' - | 'sh' - | 'kn' - | 'lc' - | 'pm' - | 'vc' - | 'ws' - | 'sm' - | 'st' - | 'sa' - | 'sn' - | 'rs' - | 'sc' - | 'sl' - | 'sg' - | 'sk' - | 'si' - | 'sb' - | 'so' - | 'za' - | 'gs' - | 'es' - | 'lk' - | 'sd' - | 'sr' - | 'sj' - | 'sz' - | 'se' - | 'ch' - | 'sy' - | 'tw' - | 'tj' - | 'tz' - | 'th' - | 'tl' - | 'tg' - | 'tk' - | 'to' - | 'tt' - | 'tn' - | 'tr' - | 'tm' - | 'tc' - | 'tv' - | 'ug' - | 'ua' - | 'ae' - | 'gb' - | 'us' - | 'um' - | 'uy' - | 'uz' - | 'vu' - | 've' - | 'vn' - | 'vg' - | 'vi' - | 'wf' - | 'eh' - | 'ye' - | 'zm' - | 'zw'; + /** + * Image format for the screenshot. + */ + format?: 'png' | 'jpeg' | 'webp'; + } - /** - * Blocklist — drop results from these domains. Example: ["pinterest.com", - * "reddit.com"]. - */ - excludeDomains?: Array; + export namespace ScreenshotParams { + export interface Element { + /** + * CSS selector matching exactly one visible element. + */ + selector: string; + } + + /** + * Pixels from the document origin. + */ + export interface Rectangle { + /** + * Height of the capture in pixels. + */ + height: number; - /** - * Restrict results to content published within this window. - */ - freshness?: 'last_24_hours' | 'last_week' | 'last_month' | 'last_year'; + /** + * Width of the capture in pixels. + */ + width: number; - /** - * Allowlist — only return results from these domains. Example: ["arxiv.org", - * "github.com"]. - */ - includeDomains?: Array; + /** + * Left edge of the capture, in pixels from the document origin. + */ + x: number; - /** - * Inline Markdown scraping for each result. Set `enabled: true` to activate. - */ - markdownOptions?: WebSearchParams.MarkdownOptions; + /** + * Top edge of the capture, in pixels from the document origin. + */ + y: number; + } + } /** - * Number of results to request and return (10–100). Defaults to 10. + * Browser and content settings shared by all outputs. */ - numResults?: number; + export interface SharedParams { + /** + * Browser steps run in order before capture. Requires a paid plan. Skips the + * cache. + */ + actions?: Array; - /** - * Expand the query into multiple parallel variants for broader recall. - */ - queryFanout?: boolean; + /** + * Proxy country as a two-letter code, such as `US`. Case-insensitive. + */ + country?: string; - /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. - */ - tags?: Array; + /** + * Accept cookie banners before actions and capture. + */ + dismissCookies?: boolean; - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; -} + /** + * Close other popups before actions and capture. + */ + dismissPopups?: boolean; -export namespace WebSearchParams { - /** - * Inline Markdown scraping for each result. Set `enabled: true` to activate. - */ - export interface MarkdownOptions { /** - * Scrape each result to Markdown. Off by default to keep search cheap and fast. + * Remove elements matching these CSS selectors. Overrides `includeSelectors`. */ - enabled?: boolean; + excludeSelectors?: Array; /** - * Render iframe contents into the Markdown. + * HTTP headers to send to the target site. Requests with headers skip the cache. + */ + headers?: { [key: string]: string }; + + /** + * Include iframe content in HTML and text outputs. Screenshots always show visible + * frames. */ includeFrames?: boolean; /** - * Emit image references in the Markdown. + * Keep only elements matching these CSS selectors. */ - includeImages?: boolean; + includeSelectors?: Array; /** - * Keep hyperlinks in the Markdown. + * Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`. */ - includeLinks?: boolean; + mainContentOnly?: boolean; /** - * Cache TTL in ms for scraped Markdown keyed by URL + options. Default 1 day, max - * 30 days. Set to 0 to force a fresh scrape. + * Document parsing options. */ - maxAgeMs?: number; + parsers?: SharedParams.Parsers; /** - * PDF handling. Use start/end to bound text extraction and OCR to a page range. + * Create or reuse an authenticated browser profile. Requires a paid plan and an + * HTTPS target. Profiles persist session state, bypass shared caches, and cannot + * be combined with ZDR, custom headers, raw bytes, or prebuilt parsers. */ - pdf?: MarkdownOptions.Pdf; + profile?: SharedParams.Existing | SharedParams.New; /** - * Truncate inline base64 image payloads to keep responses small. + * Wait for CSS animations to finish before capture. Defaults to `true` when + * `screenshot` is requested. */ - shortenBase64Images?: boolean; + settleAnimations?: boolean; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Emulate a light or dark color scheme. */ - timeoutMS?: number; + theme?: 'light' | 'dark'; /** - * Strip nav, header, footer, and sidebar — keep only the primary article content. + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. */ - useMainContentOnly?: boolean; + viewport?: SharedParams.Viewport; /** - * Extra wait after page load before rendering, in ms (0–30000). Useful for - * JS-heavy pages. + * Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500 + * (2000 with frames or XML). */ - waitForMs?: number; + waitFor?: number | string; } - export namespace MarkdownOptions { + export namespace SharedParams { + export interface Perform { + /** + * One browser instruction, such as clicking a button or entering text. + */ + action: string; + + /** + * Use `perform` for a plain-language browser instruction. + */ + type: 'perform'; + } + + export interface Scroll { + /** + * Use `scroll` to move through the page or a container. + */ + type: 'scroll'; + + /** + * Distance per scroll: pixels, one `viewport`, or `max` to reach the end. + */ + amount?: number | 'viewport' | 'max'; + + /** + * Direction to scroll. + */ + direction?: 'down' | 'up' | 'left' | 'right'; + + /** + * Maximum number of scroll steps for this action. + */ + maxScrolls?: number; + + /** + * Scroll this container. Omit to scroll the page. + */ + selector?: string; + } + + export interface Wait { + /** + * Time to pause in milliseconds before the next action. + */ + milliseconds: number; + + /** + * Use `wait` to pause for a fixed duration. + */ + type: 'wait'; + } + + export interface WaitFor { + /** + * CSS selector to wait for before continuing. + */ + selector: string; + + /** + * Use `waitFor` to wait for a matching element. + */ + type: 'waitFor'; + } + /** - * PDF handling. Use start/end to bound text extraction and OCR to a page range. + * Document parsing options. */ - export interface Pdf { + export interface Parsers { /** - * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must - * be >= start. + * PDF page range and OCR. */ - end?: number; + pdf?: Parsers.Pdf; + } + export namespace Parsers { /** - * Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR. + * PDF page range and OCR. */ - shouldParse?: boolean; + export interface Pdf { + /** + * Last page to parse. Must be at least `startPage`. + */ + endPage?: number; + + /** + * Start each page in the Markdown with a `` line using its original + * 1-based page number; these responses are never served from cache. + */ + includeNumberedPages?: boolean; + + /** + * Set `auto` to read scanned pages with OCR. + */ + ocr?: 'off' | 'auto'; + + /** + * First page to parse, starting at 1. + */ + startPage?: number; + } + } + export interface Existing { /** - * First PDF page to parse (1-based, inclusive). Defaults to page 1. + * The ID returned in profile.id by an earlier scrape. */ - start?: number; + profileId: string; + + /** + * Reuse a saved browser profile. + */ + type: 'existing'; + } + + export interface New { + /** + * Username or email for the target website. + */ + identifier: string; + + /** + * Password used to sign in. It is never stored in the profile. + */ + password: string; + + /** + * Sign in and create a browser profile. + */ + type: 'new'; + + /** + * Optional label shown when listing profiles with `GET /org/browser/profiles`. + */ + description?: string; + } + + /** + * Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions + * default to 1440 × 900. + */ + export interface Viewport { + /** + * Browser viewport height in pixels. + */ + height?: number; + + /** + * Browser viewport width in pixels. + */ + width?: number; } } + + /** + * Request deadline and what to return when it passes. + */ + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. + */ + behavior?: 'fail' | 'return-partial'; + } } -export interface WebWebCrawlMdParams { +export interface WebScreenshotParams { + /** + * Optional parameter for comprehensive popup cleanup. If 'true', the browser + * dismisses detected cookie/consent UI and clears other detected obstructive + * popups and overlays before capture. If 'false' or not provided, this parameter + * requests no cleanup; handleCookiePopup can still request cookie/consent handling + * independently. + */ + clearPopups?: boolean; + /** - * The starting URL for the crawl (must include http:// or https:// protocol) + * Optional parameter to choose the site's visual theme in the screenshot. Use + * 'light' or 'dark' when the site offers both appearances. */ - url: string; + colorScheme?: 'light' | 'dark'; /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -3560,711 +3414,674 @@ export interface WebWebCrawlMdParams { | 'zw'; /** - * CSS selectors to remove before each crawled page is converted to Markdown. - * Applied after includeSelectors. Exclusion takes precedence: an element matching - * both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]". - */ - excludeSelectors?: Array; - - /** - * When true, follow links on subdomains of the starting URL's domain (e.g. - * docs.example.com when starting from example.com). www and apex are always - * treated as equivalent. - */ - followSubdomains?: boolean; - - /** - * When true, the contents of iframes are rendered to Markdown for each crawled - * page. - */ - includeFrames?: boolean; - - /** - * Include image references in the Markdown output - */ - includeImages?: boolean; - - /** - * Preserve hyperlinks in the Markdown output - */ - includeLinks?: boolean; - - /** - * CSS selectors. When provided, only matching HTML subtrees (and their - * descendants) are kept before each crawled page is converted to Markdown. When - * omitted, the entire document is kept. Examples: "article.main", "#content", - * "[role=main]". + * A specific URL to screenshot directly, bypassing domain resolution (e.g., + * 'https://example.com/pricing'). When provided, the screenshot is taken of this + * exact URL. You must provide either 'domain' or 'directUrl', but not both. */ - includeSelectors?: Array; + directUrl?: string; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The + * domain will be automatically normalized and validated. You must provide either + * 'domain' or 'directUrl', but not both. */ - maxAgeMs?: number; + domain?: string; /** - * Maximum link depth from the starting URL (0 = only the starting page) + * Optional parameter to determine screenshot type. If 'true', takes a full page + * screenshot capturing all content. If 'false' or not provided, takes a viewport + * screenshot (standard browser view). */ - maxDepth?: number; + fullScreenshot?: 'true' | 'false'; /** - * Maximum number of pages to crawl. Hard cap: 500. + * Optional parameter to control cookie/consent popup handling. If 'true', we + * dismiss cookie banner before capture. If 'false' or not provided, captures the + * page without that step. */ - maxPages?: number; + handleCookiePopup?: boolean; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * Optional outbound HTTP headers, using the same JSON object or deep-object query + * format as other scrape endpoints (for example headers[Authorization]=Bearer + * token). Headers are scoped to the target origin during capture. For domain/page + * requests, discovery receives no custom headers and only pages on the resolved + * origin are eligible. Non-empty headers bypass screenshot caching and return an + * in-memory data URL; no screenshot is uploaded. Empty objects behave like omitted + * headers. */ - pdf?: WebWebCrawlMdParams.Pdf; + headers?: { [key: string]: string }; /** - * When true, waits briefly for CSS and transition animations to settle before - * extracting each crawled page. Defaults to false. This adds a bit of latency in - * exchange for more stable output on animated pages. + * Return a cached screenshot if a prior screenshot for the same parameters exists + * and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when + * omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh. */ - settleAnimations?: boolean; + maxAgeMs?: number | null; /** - * Truncate base64-encoded image data in the Markdown output + * Optional parameter to specify which page type to screenshot. If provided, the + * system will scrape the domain's links and use heuristics to find the most + * appropriate URL for the specified page type (30 supported languages). If not + * provided, screenshots the main domain landing page. Only applicable when using + * 'domain', not 'directUrl'. */ - shortenBase64Images?: boolean; + page?: 'login' | 'signup' | 'blog' | 'careers' | 'pricing' | 'terms' | 'privacy' | 'contact'; /** - * Soft time budget for the crawl in milliseconds. After each scrape, the crawler - * checks the elapsed time and, if exceeded, returns the pages collected so far - * instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 - * (80s). + * Optional vertical scroll offset in pixels for capturing a long page in + * viewport-sized chunks. When provided, the full page is captured once and the + * returned image is the viewport-sized slice that begins at this Y offset (e.g. + * request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page + * top to bottom). The final slice may be shorter than the viewport height. Takes + * precedence over fullScreenshot. Max: 100000. */ - stopAfterMs?: number; + scrollOffset?: number | null; /** - * Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. */ tags?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; - - /** - * Regex pattern. Only URLs matching this pattern will be followed and scraped. An - * automatic prefix scope in the form ^ follows a redirect of the - * starting page. + * Request deadline and what to return when it passes. */ - urlRegex?: string; + timeoutOpts?: WebScreenshotParams.TimeoutOpts; /** - * Extract only the main content, stripping headers, footers, sidebars, and - * navigation + * Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. */ - useMainContentOnly?: boolean; + viewport?: WebScreenshotParams.Viewport; /** - * Browser wait time in milliseconds after initial page load for each crawled page. - * Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds). + * Optional browser wait time in milliseconds after initial page load before taking + * the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + * omitted. When combined with timeoutOpts, timeoutOpts.milliseconds must be at + * least waitForMs + 10000 ms; a shorter deadline is rejected with 400 + * TIMEOUT_TOO_SHORT_FOR_WAIT. */ - waitForMs?: number; + waitForMs?: number | null; /** - * Set to enabled to bypass shared caches and omit request and response content - * from retained usage logs. Requires zero data retention to be enabled for your - * organization (contact support@context.dev), otherwise the request fails with - * ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. */ zdr?: 'enabled' | 'disabled'; } -export namespace WebWebCrawlMdParams { +export namespace WebScreenshotParams { /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * Request deadline and what to return when it passes. */ - export interface Pdf { + export interface TimeoutOpts { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Deadline in milliseconds. */ - end?: number; + milliseconds: number; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. */ - ocr?: boolean; + behavior?: 'fail' | 'return-partial'; + } + /** + * Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. + */ + export interface Viewport { /** - * When true, PDF pages are fetched and parsed. When false, PDF pages are skipped - * entirely (not included in results and not counted as failures). + * Viewport height in pixels. */ - shouldParse?: boolean; + height?: number; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * Viewport width in pixels. */ - start?: number; + width?: number; } } -export interface WebWebScrapeHTMLParams { - /** - * Full URL to scrape (must include http:// or https:// protocol) - */ - url: string; - +export interface WebSearchParams { /** - * Optional browser actions executed in array order after the page loads and before - * content is captured. Requires a paid plan. Send a JSON array in the query - * parameter. Maximum: 5 actions. + * Search query. Accepts natural language as well as Google-style search operators + * such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`. */ - actions?: Array< - | WebWebScrapeHTMLParams.WebScrapeWaitAction - | WebWebScrapeHTMLParams.WebScrapePerformAction - | WebWebScrapeHTMLParams.WebScrapeScrollAction - > | null; + query: string; /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific + * country (maps to Google's `gl` parameter). Example: "us", "gb", "de". */ country?: - | 'ad' - | 'ae' | 'af' - | 'ag' - | 'ai' | 'al' - | 'am' + | 'dz' + | 'as' + | 'ad' | 'ao' + | 'ai' + | 'aq' + | 'ag' | 'ar' - | 'at' - | 'au' + | 'am' | 'aw' + | 'au' + | 'at' | 'az' - | 'ba' - | 'bb' + | 'bs' + | 'bh' | 'bd' + | 'bb' + | 'by' | 'be' - | 'bf' - | 'bg' - | 'bh' - | 'bi' + | 'bz' | 'bj' | 'bm' - | 'bn' + | 'bt' | 'bo' - | 'bq' - | 'br' - | 'bs' + | 'ba' | 'bw' - | 'by' - | 'bz' + | 'bv' + | 'br' + | 'io' + | 'bn' + | 'bg' + | 'bf' + | 'bi' + | 'kh' + | 'cm' | 'ca' - | 'cd' + | 'cv' + | 'ky' | 'cf' - | 'cg' - | 'ch' - | 'ci' + | 'td' | 'cl' - | 'cm' | 'cn' + | 'cx' + | 'cc' | 'co' + | 'km' + | 'cg' + | 'cd' + | 'ck' | 'cr' - | 'cv' - | 'cw' + | 'ci' + | 'hr' + | 'cu' | 'cy' | 'cz' - | 'de' - | 'dj' | 'dk' + | 'dj' | 'dm' | 'do' - | 'dz' | 'ec' - | 'ee' | 'eg' - | 'es' + | 'sv' + | 'gq' + | 'er' + | 'ee' | 'et' - | 'fi' + | 'fk' + | 'fo' | 'fj' + | 'fi' | 'fr' + | 'gf' + | 'pf' + | 'tf' | 'ga' - | 'gb' - | 'gd' + | 'gm' | 'ge' - | 'gf' - | 'gg' + | 'de' | 'gh' - | 'gm' - | 'gn' - | 'gp' - | 'gq' + | 'gi' | 'gr' - | 'gt' + | 'gl' + | 'gd' + | 'gp' | 'gu' + | 'gt' + | 'gn' | 'gw' | 'gy' - | 'hk' - | 'hn' - | 'hr' | 'ht' + | 'hm' + | 'va' + | 'hn' + | 'hk' | 'hu' + | 'is' + | 'in' | 'id' + | 'ir' + | 'iq' | 'ie' | 'il' - | 'im' - | 'in' - | 'iq' - | 'ir' - | 'is' | 'it' - | 'je' | 'jm' - | 'jo' | 'jp' + | 'jo' + | 'kz' | 'ke' - | 'kg' - | 'kh' - | 'kn' + | 'ki' + | 'kp' | 'kr' | 'kw' - | 'ky' - | 'kz' + | 'kg' | 'la' + | 'lv' | 'lb' - | 'lc' - | 'lk' - | 'lr' | 'ls' + | 'lr' + | 'ly' + | 'li' | 'lt' | 'lu' - | 'lv' - | 'ly' - | 'ma' - | 'mc' - | 'md' - | 'me' - | 'mf' - | 'mg' + | 'mo' | 'mk' + | 'mg' + | 'mw' + | 'my' + | 'mv' | 'ml' - | 'mm' - | 'mn' - | 'mo' + | 'mt' + | 'mh' | 'mq' | 'mr' - | 'mt' | 'mu' - | 'mv' - | 'mw' + | 'yt' | 'mx' - | 'my' + | 'fm' + | 'md' + | 'mc' + | 'mn' + | 'ms' + | 'ma' | 'mz' + | 'mm' | 'na' + | 'nr' + | 'np' + | 'nl' + | 'an' | 'nc' + | 'nz' + | 'ni' | 'ne' | 'ng' - | 'ni' - | 'nl' + | 'nu' + | 'nf' + | 'mp' | 'no' - | 'np' - | 'nz' | 'om' + | 'pk' + | 'pw' + | 'ps' | 'pa' - | 'pe' - | 'pf' | 'pg' + | 'py' + | 'pe' | 'ph' - | 'pk' + | 'pn' | 'pl' - | 'pr' - | 'ps' | 'pt' - | 'py' + | 'pr' | 'qa' | 're' | 'ro' - | 'rs' | 'ru' | 'rw' + | 'sh' + | 'kn' + | 'lc' + | 'pm' + | 'vc' + | 'ws' + | 'sm' + | 'st' | 'sa' + | 'sn' + | 'rs' | 'sc' - | 'sd' - | 'se' + | 'sl' | 'sg' - | 'si' | 'sk' - | 'sl' - | 'sm' - | 'sn' + | 'si' + | 'sb' | 'so' + | 'za' + | 'gs' + | 'es' + | 'lk' + | 'sd' | 'sr' - | 'ss' - | 'st' - | 'sv' - | 'sx' - | 'sy' + | 'sj' | 'sz' - | 'tc' - | 'td' - | 'tg' - | 'th' + | 'se' + | 'ch' + | 'sy' + | 'tw' | 'tj' + | 'tz' + | 'th' | 'tl' - | 'tm' + | 'tg' + | 'tk' + | 'to' + | 'tt' | 'tn' | 'tr' - | 'tt' - | 'tw' - | 'tz' - | 'ua' + | 'tm' + | 'tc' + | 'tv' | 'ug' + | 'ua' + | 'ae' + | 'gb' | 'us' + | 'um' | 'uy' | 'uz' - | 'vc' + | 'vu' | 've' + | 'vn' | 'vg' | 'vi' - | 'vn' + | 'wf' + | 'eh' | 'ye' - | 'yt' - | 'za' | 'zm' | 'zw'; /** - * CSS selectors to remove from the result. Applied after includeSelectors. - * Exclusion takes precedence: an element matching both is removed. Examples: - * "nav", "footer", ".ad-banner", "[aria-hidden=true]". + * Maximum length of each result's `description`, in characters. */ - excludeSelectors?: Array | null; + descriptionMaxCharacters?: number | null; /** - * Optional outbound HTTP headers forwarded only to the target URL, sent as - * deep-object query params such as headers[X-Custom]=value. When provided, caching - * is bypassed: the result is neither read from nor written to cache. + * Blocklist — drop results from these domains. Up to 100 domains. Example: + * ["pinterest.com", "reddit.com"]. */ - headers?: { [key: string]: string }; + excludeDomains?: Array; /** - * When true, iframes are rendered inline into the returned HTML. + * Restrict results to content published within this window. */ - includeFrames?: boolean; + freshness?: 'last_24_hours' | 'last_week' | 'last_month' | 'last_year'; /** - * CSS selectors. When provided, only matching subtrees (and their descendants) are - * kept and everything else is dropped. When omitted, the entire document is kept. - * Examples: "article.main", "#content", "[role=main]". + * Passages from each result page that are relevant to the query. Pages are read + * with the `markdownOptions` settings. */ - includeSelectors?: Array | null; + highlightsOptions?: WebSearchParams.HighlightsOptions | null; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Allowlist — only return results from these domains. Up to 100 domains. Example: + * ["arxiv.org", "github.com"]. */ - maxAgeMs?: number | null; + includeDomains?: Array; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. - */ - pdf?: WebWebScrapeHTMLParams.Pdf; + * Languages to return results in, as BCP 47 language codes such as `en` or `de`, + * or "all" for any language. Defaults to "all". Example: ["en", "de"]. + */ + languages?: + | 'all' + | Array< + | 'am' + | 'ar' + | 'az' + | 'be' + | 'bg' + | 'bn' + | 'ca' + | 'ceb' + | 'cs' + | 'cy' + | 'da' + | 'de' + | 'el' + | 'en' + | 'es' + | 'et' + | 'eu' + | 'fa' + | 'fi' + | 'fr' + | 'gu' + | 'ha' + | 'haw' + | 'he' + | 'hi' + | 'hr' + | 'hu' + | 'hy' + | 'id' + | 'is' + | 'it' + | 'ja' + | 'ka' + | 'kk' + | 'kn' + | 'ko' + | 'ku' + | 'ky' + | 'lo' + | 'lt' + | 'lv' + | 'mk' + | 'ml' + | 'mn' + | 'mr' + | 'ms' + | 'ne' + | 'nl' + | 'no' + | 'or' + | 'pa' + | 'pl' + | 'ps' + | 'pt' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'so' + | 'sq' + | 'sr' + | 'sv' + | 'sw' + | 'ta' + | 'te' + | 'th' + | 'tl' + | 'tr' + | 'uk' + | 'ur' + | 'uz' + | 'vi' + | 'yo' + | 'zh' + >; /** - * When true, waits briefly for CSS and transition animations to settle before - * extracting HTML. Defaults to false. This adds a bit of latency in exchange for - * more stable output on animated pages. + * Inline Markdown scraping for each result. Set `enabled: true` to activate. */ - settleAnimations?: boolean; + markdownOptions?: WebSearchParams.MarkdownOptions | null; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Number of results to request and return (1–100). Defaults to 10. */ - tags?: Array; + numResults?: number; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Access policy IDs to apply. A URL must pass every policy. */ - timeoutMS?: number; + policies?: Array; /** - * When true, return only the page's main content in the HTML response, excluding - * headers, footers, sidebars, and navigation when detectable. + * Currently has no effect. */ - useMainContentOnly?: boolean; + queryFanout?: boolean; /** - * Optional browser wait time in milliseconds after initial page load. Min: 0. Max: - * 30000 (30 seconds). + * Labels for filtering usage in the dashboard. */ - waitForMs?: number | null; + tags?: Array; /** - * Set to enabled to bypass shared caches and omit request and response content - * from retained usage logs. Requires zero data retention to be enabled for your - * organization (contact support@context.dev), otherwise the request fails with - * ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + * Request deadline and what to return when it passes. */ - zdr?: 'enabled' | 'disabled'; -} + timeoutOpts?: WebSearchParams.TimeoutOpts; -export namespace WebWebScrapeHTMLParams { /** - * Pause for a fixed number of milliseconds before continuing to the next action. + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. */ - export interface WebScrapeWaitAction { - do: 'wait'; - - timeMs: number; - } + zdr?: 'enabled' | 'disabled'; +} +export namespace WebSearchParams { /** - * Resolve and perform one natural-language browser action. + * Passages from each result page that are relevant to the query. Pages are read + * with the `markdownOptions` settings. */ - export interface WebScrapePerformAction { - action: string; + export interface HighlightsOptions { + /** + * Return relevant passages for each result. Adds 1 credit per 10 results. + */ + enabled?: boolean; - do: 'perform'; + /** + * Maximum combined length of passages per result. + */ + maxCharacters?: number; } /** - * Scroll the page or a selected scrollable container, waiting adaptively for - * content and dimensions to settle after each iteration. + * Inline Markdown scraping for each result. Set `enabled: true` to activate. */ - export interface WebScrapeScrollAction { - do: 'scroll'; - + export interface MarkdownOptions { /** - * Pixels per scroll, one visible viewport, or the current scroll boundary. - * Defaults to viewport. + * Scrape each result to Markdown. Adds 1 credit per result with Markdown. */ - amount?: number | 'viewport' | 'max'; + enabled?: boolean; /** - * CSS selector for the first matching scroll container. Defaults to the page. + * Render iframe contents into the Markdown. */ - container?: string; + includeFrames?: boolean; /** - * Direction to scroll. Defaults to down. + * Emit image references in the Markdown. */ - direction?: 'up' | 'down' | 'left' | 'right'; + includeImages?: boolean; /** - * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop - * changing. Defaults to 1. + * Keep hyperlinks in the Markdown. */ - maxScrolls?: number; - } + includeLinks?: boolean; - /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. - */ - export interface Pdf { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Maximum cache age in milliseconds for result page content. Defaults to 180 days + * (15552000000 ms) when Markdown is requested, or 365 days (31536000000 ms) when + * only highlights are requested. Explicit values override either default. Maximum: + * 365 days. Set to 0 to force a fresh scrape. */ - end?: number; + maxAgeMs?: number | null; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ - ocr?: boolean; + pdf?: MarkdownOptions.Pdf; /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * Truncate inline base64 image payloads to keep responses small. */ - shouldParse?: boolean; + shortenBase64Images?: boolean; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * Request deadline and what to return when it passes. */ - start?: number; - } -} - -export interface WebWebScrapeImagesParams { - /** - * Page URL to inspect. Must include http:// or https://. - */ - url: string; - - /** - * Optional browser actions executed in array order after the page loads and before - * content is captured. Requires a paid plan. Send a JSON array in the query - * parameter. Maximum: 5 actions. - */ - actions?: Array< - | WebWebScrapeImagesParams.WebScrapeWaitAction - | WebWebScrapeImagesParams.WebScrapePerformAction - | WebWebScrapeImagesParams.WebScrapeScrollAction - > | null; - - /** - * When true, visually duplicate images are removed: every image is loaded and - * perceptually hashed, and only the highest-resolution copy of each duplicate - * group is kept. Images that cannot be downloaded or hashed are kept. Default: - * false. - */ - dedupe?: boolean; - - /** - * Optional per-image processing, sent as deep-object query params such as - * enrichment[resolution]=true. - */ - enrichment?: WebWebScrapeImagesParams.Enrichment | null; - - /** - * Optional outbound HTTP headers forwarded only to the target URL, sent as - * deep-object query params such as headers[X-Custom]=value. When provided, caching - * is bypassed: the result is neither read from nor written to cache. - */ - headers?: { [key: string]: string }; - - /** - * Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 - * day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). - */ - maxAgeMs?: number | null; - - /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. - */ - tags?: Array; - - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; - - /** - * Optional browser wait time in milliseconds after initial page load before - * collecting images. Min: 0. Max: 30000 (30 seconds). - */ - waitForMs?: number | null; -} - -export namespace WebWebScrapeImagesParams { - /** - * Pause for a fixed number of milliseconds before continuing to the next action. - */ - export interface WebScrapeWaitAction { - do: 'wait'; - - timeMs: number; - } - - /** - * Resolve and perform one natural-language browser action. - */ - export interface WebScrapePerformAction { - action: string; - - do: 'perform'; - } - - /** - * Scroll the page or a selected scrollable container, waiting adaptively for - * content and dimensions to settle after each iteration. - */ - export interface WebScrapeScrollAction { - do: 'scroll'; + timeoutOpts?: MarkdownOptions.TimeoutOpts; /** - * Pixels per scroll, one visible viewport, or the current scroll boundary. - * Defaults to viewport. + * Strip nav, header, footer, and sidebar — keep only the primary article content. */ - amount?: number | 'viewport' | 'max'; + useMainContentOnly?: boolean; /** - * CSS selector for the first matching scroll container. Defaults to the page. + * Extra wait after page load before rendering, in ms (0–30000). Useful for + * JS-heavy pages. */ - container?: string; + waitForMs?: number | null; + } + export namespace MarkdownOptions { /** - * Direction to scroll. Defaults to down. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ - direction?: 'up' | 'down' | 'left' | 'right'; + export interface Pdf { + /** + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. + */ + end?: number; + + /** + * Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR. + */ + shouldParse?: boolean; + + /** + * First 1-based PDF page to parse. + */ + start?: number; + } /** - * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop - * changing. Defaults to 1. + * Request deadline and what to return when it passes. */ - maxScrolls?: number; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; + + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. "return-partial" requires at least 5000 ms. + */ + behavior?: 'fail' | 'return-partial'; + } } /** - * Optional per-image processing, sent as deep-object query params such as - * enrichment[resolution]=true. + * Request deadline and what to return when it passes. */ - export interface Enrichment { - /** - * Classify each image by visual asset type. - */ - classification?: boolean; - - /** - * Host materializable images on the Brand.dev CDN and return their URL and MIME - * type. - */ - hostedUrl?: boolean; - + export interface TimeoutOpts { /** - * Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000. + * Deadline in milliseconds. */ - maxTimePerMs?: number; + milliseconds: number; /** - * Measure image width and height when possible. + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. */ - resolution?: boolean; + behavior?: 'fail' | 'return-partial'; } } -export interface WebWebScrapeMdParams { +export interface WebWebCrawlMdParams { /** - * Full URL to scrape into LLM usable Markdown (must include http:// or https:// - * protocol) + * Start URL, including `http://` or `https://`. */ url: string; /** - * Optional browser actions executed in array order after the page loads and before - * content is captured. Requires a paid plan. Send a JSON array in the query - * parameter. Maximum: 5 actions. - */ - actions?: Array< - | WebWebScrapeMdParams.WebScrapeWaitAction - | WebWebScrapeMdParams.WebScrapePerformAction - | WebWebScrapeMdParams.WebScrapeScrollAction - > | null; - - /** - * Fetch the target page through a residential proxy in this country (ISO 3166-1 - * alpha-2). + * Fetch from this country (ISO 3166-1 alpha-2). */ country?: | 'ad' @@ -4473,273 +4290,191 @@ export interface WebWebScrapeMdParams { | 'zw'; /** - * CSS selectors to remove before conversion to Markdown. Applied after - * includeSelectors. Exclusion takes precedence: an element matching both is - * removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]". + * Remove matching elements after inclusions. Exclusions take precedence. */ excludeSelectors?: Array | null; /** - * Optional outbound HTTP headers forwarded only to the target URL, sent as - * deep-object query params such as headers[X-Custom]=value. When provided, caching - * is bypassed: the result is neither read from nor written to cache. + * Regex pattern. URLs matching this pattern are never followed or scraped, even + * when they match urlRegex. The starting URL is always scraped. */ - headers?: { [key: string]: string }; + excludeUrlRegex?: string; /** - * When true, the contents of iframes are rendered to Markdown. + * When true, follow links on subdomains of the starting URL's domain (e.g. + * docs.example.com when starting from example.com). www and apex are always + * treated as equivalent. */ - includeFrames?: boolean; + followSubdomains?: boolean; /** - * When true, the response also includes an `html` field with the page HTML the - * Markdown was converted from — the same body the Scrape HTML endpoint returns for - * the equivalent request. + * When true, the contents of iframes are rendered to Markdown for each crawled + * page. */ - includeHTML?: boolean; + includeFrames?: boolean; /** - * Include image references in Markdown output + * Include image references in the Markdown output (`html-conversion` only). */ includeImages?: boolean; /** - * Preserve hyperlinks in Markdown output + * Preserve hyperlinks in the Markdown output (`html-conversion` only). */ includeLinks?: boolean; /** - * CSS selectors. When provided, only matching HTML subtrees (and their - * descendants) are kept before conversion to Markdown. When omitted, the entire - * document is kept. Examples: "article.main", "#content", "[role=main]". + * Keep matching HTML subtrees before converting each page to Markdown. */ includeSelectors?: Array | null; /** - * Return a cached result if a prior scrape for the same parameters exists and is - * younger than this many milliseconds. Defaults to 1 day (86400000 ms) when - * omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. + * Maximum cache age in milliseconds. Defaults to 1 day; `0` fetches fresh. */ maxAgeMs?: number | null; /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * Maximum link depth from the starting URL (0 = only the starting page) */ - pdf?: WebWebScrapeMdParams.Pdf; + maxDepth?: number; /** - * When true, waits briefly for CSS and transition animations to settle before - * converting to Markdown. Defaults to false. This adds a bit of latency in - * exchange for more stable output on animated pages. + * Maximum pages to crawl. */ - settleAnimations?: boolean; + maxPages?: number; /** - * Shorten base64-encoded image data in the Markdown output + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ - shortenBase64Images?: boolean; + pdf?: WebWebCrawlMdParams.Pdf; /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. + * Access policy IDs to apply. A URL must pass every policy. */ - tags?: Array; + policies?: Array; /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). + * Wait briefly for CSS animations and transitions to settle before reading each + * page. */ - timeoutMS?: number; + settleAnimations?: boolean; /** - * Extract only the main content of the page, excluding headers, footers, sidebars, - * and navigation + * Truncate base64-encoded image data in the Markdown output (`html-conversion` + * only). */ - useMainContentOnly?: boolean; + shortenBase64Images?: boolean; /** - * Optional browser wait time in milliseconds after initial page load before - * converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + * Markdown sources in order of preference: `html-conversion` converts the page + * HTML, `markdown-direct` uses Markdown the site publishes. */ - waitForMs?: number | null; + sourcePreference?: Array<'html-conversion' | 'markdown-direct'>; /** - * Set to enabled to bypass shared caches and omit request and response content - * from retained usage logs. Requires zero data retention to be enabled for your - * organization (contact support@context.dev), otherwise the request fails with - * ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + * Soft crawl deadline in milliseconds. Returns pages collected before the next + * deadline check. */ - zdr?: 'enabled' | 'disabled'; -} + stopAfterMs?: number; -export namespace WebWebScrapeMdParams { /** - * Pause for a fixed number of milliseconds before continuing to the next action. + * Labels for filtering usage in the dashboard. */ - export interface WebScrapeWaitAction { - do: 'wait'; - - timeMs: number; - } + tags?: Array; /** - * Resolve and perform one natural-language browser action. + * Request deadline and what to return when it passes. */ - export interface WebScrapePerformAction { - action: string; - - do: 'perform'; - } + timeoutOpts?: WebWebCrawlMdParams.TimeoutOpts; /** - * Scroll the page or a selected scrollable container, waiting adaptively for - * content and dimensions to settle after each iteration. + * Regex pattern. Only URLs matching this pattern will be followed and scraped. An + * automatic prefix scope in the form ^ follows a redirect of the + * starting page. */ - export interface WebScrapeScrollAction { - do: 'scroll'; - - /** - * Pixels per scroll, one visible viewport, or the current scroll boundary. - * Defaults to viewport. - */ - amount?: number | 'viewport' | 'max'; + urlRegex?: string; - /** - * CSS selector for the first matching scroll container. Defaults to the page. - */ - container?: string; + /** + * Extract only the main content, stripping headers, footers, sidebars, and + * navigation + */ + useMainContentOnly?: boolean; - /** - * Direction to scroll. Defaults to down. - */ - direction?: 'up' | 'down' | 'left' | 'right'; + /** + * Browser wait time in milliseconds after initial page load for each crawled page. + * Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds). + */ + waitForMs?: number | null; - /** - * Maximum scroll iterations. Stops early when scrolling and scrollable extent stop - * changing. Defaults to 1. - */ - maxScrolls?: number; - } + /** + * `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless + * your organization has ZDR. + */ + zdr?: 'enabled' | 'disabled'; +} +export namespace WebWebCrawlMdParams { /** - * PDF parsing controls. Use start/end to limit text extraction and embedded-image - * detection/OCR to an inclusive 1-based page range. + * PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. */ export interface Pdf { /** - * Last 1-based PDF page to parse. When omitted, parsing ends at the last page. - * Must be greater than or equal to start when both are provided. + * Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must + * be >= start. */ end?: number; /** - * When true, OCR the selected PDF pages that have no usable text layer (scans), - * replacing each recovered page's text with the OCR result while pages with a real - * text layer keep it. Billed at 1 credit per page OCR actually recovered, on top - * of the base request cost. When false, no OCR runs. + * Read scanned PDF pages with OCR; preserve pages that already have text. */ ocr?: boolean; /** - * When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and - * a 400 PDF_SKIPPED is returned. + * When true, PDF pages are fetched and parsed. When false, PDF pages are skipped + * entirely (not included in results and not counted as failures). */ shouldParse?: boolean; /** - * First 1-based PDF page to parse. When omitted, parsing starts at the first page. + * First 1-based PDF page to parse. */ start?: number; } -} - -export interface WebWebScrapeSitemapParams { - /** - * Domain to build a sitemap for - */ - domain: string; /** - * Optional outbound HTTP headers forwarded only to the target URL, sent as - * deep-object query params such as headers[X-Custom]=value. When provided, caching - * is bypassed: the result is neither read from nor written to cache. + * Request deadline and what to return when it passes. */ - headers?: { [key: string]: string }; - - /** - * Maximum number of links to return from the sitemap crawl. Defaults to 10,000. - * Minimum is 1, maximum is 100,000. - */ - maxLinks?: number; - - /** - * Optional search phrase. When provided, the crawled sitemap is filtered to the - * pages whose URLs are about that phrase, most relevant first, and the request - * costs 2 credits instead of 1. - */ - search?: string; - - /** - * Optional explicit sitemap URL. When provided, exactly this sitemap is crawled - * instead of discovering the domain's sitemaps. - */ - sitemapUrl?: string; - - /** - * Optional comma-separated caller-defined tags for tracking this request. Tags are - * recorded on the request's usage log and can be used to filter usage on the - * dashboard usage page. Up to 20 tags, each 1-50 characters. - */ - tags?: Array; - - /** - * Optional timeout in milliseconds for the request. If the request takes longer - * than this value, it will be aborted with a 408 status code. Maximum allowed - * value is 300000ms (5 minutes). - */ - timeoutMS?: number; - - /** - * Optional RE2-compatible regex pattern. Only URLs matching this pattern are - * returned and counted against maxLinks. - */ - urlRegex?: string; + export interface TimeoutOpts { + /** + * Deadline in milliseconds. + */ + milliseconds: number; - /** - * Set to enabled to bypass shared caches and omit request and response content - * from retained usage logs. Requires zero data retention to be enabled for your - * organization (contact support@context.dev), otherwise the request fails with - * ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. - */ - zdr?: 'enabled' | 'disabled'; + /** + * "fail" returns 408 at the deadline. "return-partial" returns available results; + * inspect the response’s partial flag. + */ + behavior?: 'fail' | 'return-partial'; + } } export declare namespace Web { export { - type WebExtractResponse as WebExtractResponse, + type WebAnswersResponse as WebAnswersResponse, type WebExtractCompetitorsResponse as WebExtractCompetitorsResponse, - type WebExtractFontsResponse as WebExtractFontsResponse, type WebExtractStyleguideResponse as WebExtractStyleguideResponse, + type WebMapURLsResponse as WebMapURLsResponse, + type WebScrapeResponse as WebScrapeResponse, type WebScreenshotResponse as WebScreenshotResponse, type WebSearchResponse as WebSearchResponse, type WebWebCrawlMdResponse as WebWebCrawlMdResponse, - type WebWebScrapeHTMLResponse as WebWebScrapeHTMLResponse, - type WebWebScrapeImagesResponse as WebWebScrapeImagesResponse, - type WebWebScrapeMdResponse as WebWebScrapeMdResponse, - type WebWebScrapeSitemapResponse as WebWebScrapeSitemapResponse, - type WebExtractParams as WebExtractParams, + type WebAnswersParams as WebAnswersParams, type WebExtractCompetitorsParams as WebExtractCompetitorsParams, - type WebExtractFontsParams as WebExtractFontsParams, type WebExtractStyleguideParams as WebExtractStyleguideParams, + type WebMapURLsParams as WebMapURLsParams, + type WebScrapeParams as WebScrapeParams, type WebScreenshotParams as WebScreenshotParams, type WebSearchParams as WebSearchParams, type WebWebCrawlMdParams as WebWebCrawlMdParams, - type WebWebScrapeHTMLParams as WebWebScrapeHTMLParams, - type WebWebScrapeImagesParams as WebWebScrapeImagesParams, - type WebWebScrapeMdParams as WebWebScrapeMdParams, - type WebWebScrapeSitemapParams as WebWebScrapeSitemapParams, }; } diff --git a/src/resources/webhooks.ts b/src/resources/webhooks.ts new file mode 100644 index 00000000..8aad965f --- /dev/null +++ b/src/resources/webhooks.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './webhooks/index'; diff --git a/src/resources/webhooks/deliveries.ts b/src/resources/webhooks/deliveries.ts new file mode 100644 index 00000000..f8ac98f4 --- /dev/null +++ b/src/resources/webhooks/deliveries.ts @@ -0,0 +1,655 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as WebhooksAPI from './webhooks'; +import { APIPromise } from '../../core/api-promise'; +import { buildHeaders } from '../../internal/headers'; +import { RequestOptions } from '../../internal/request-options'; +import { path } from '../../internal/utils/path'; + +/** + * Inspect and retry batch and monitor webhook deliveries. + */ +export class Deliveries extends APIResource { + /** + * Retrieve a webhook delivery’s status and original payload. + * + * @example + * ```ts + * const delivery = await client.webhooks.deliveries.retrieve( + * 'whd_210b9798eb53baa4e69d31c1071cf03d', + * ); + * ``` + */ + retrieve( + deliveryID: string, + query: DeliveryRetrieveParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get(path`/webhooks/deliveries/${deliveryID}`, { query, ...options }); + } + + /** + * List batch and monitor webhook deliveries from the last 30 days. + * + * @example + * ```ts + * const deliveries = await client.webhooks.deliveries.list({ + * type: 'batch', + * limit: 25, + * status: 'failed', + * }); + * ``` + */ + list(body: DeliveryListParams, options?: RequestOptions): APIPromise { + return this._client.post('/webhooks/deliveries', { body, ...options }); + } + + /** + * List a delivery’s attempts, newest first. + * + * @example + * ```ts + * const response = + * await client.webhooks.deliveries.listAttempts( + * 'whd_210b9798eb53baa4e69d31c1071cf03d', + * ); + * ``` + */ + listAttempts( + deliveryID: string, + query: DeliveryListAttemptsParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get(path`/webhooks/deliveries/${deliveryID}/attempts`, { query, ...options }); + } + + /** + * Resend the original payload using the source’s current URL and secret. Available + * for 7 days after the event. + * + * @example + * ```ts + * const response = await client.webhooks.deliveries.retry( + * 'whd_210b9798eb53baa4e69d31c1071cf03d', + * ); + * ``` + */ + retry( + deliveryID: string, + params: DeliveryRetryParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + const { 'Idempotency-Key': idempotencyKey, ...body } = params ?? {}; + return this._client.post(path`/webhooks/deliveries/${deliveryID}/retry`, { + body, + ...options, + headers: buildHeaders([ + { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) }, + options?.headers, + ]), + }); + } +} + +export interface Attempt { + /** + * Attempt number, starting at 1. + */ + attempt: number; + + /** + * Completion time, or null while in progress. + */ + completed_at: string | null; + + /** + * Attempt error, or null if none. + */ + error: Attempt.Error | null; + + /** + * HTTP response status, or null if no response was received. + */ + http_status: number | null; + + /** + * Attempt start time. + */ + started_at: string; + + /** + * `initial`, `automatic` (scheduled retry), or `manual` (Retry endpoint). + */ + trigger: 'initial' | 'automatic' | 'manual'; + + /** + * URL used for this attempt. + */ + url: string; +} + +export namespace Attempt { + /** + * Attempt error, or null if none. + */ + export interface Error { + /** + * Error code. + */ + code: string; + + /** + * Error details. + */ + message: string; + } +} + +export interface Delivery { + /** + * Delivery ID. + */ + id: string; + + /** + * Event creation time. + */ + created_at: string; + + /** + * Last successful delivery time, or null if never delivered. + */ + delivered_at: string | null; + + /** + * Webhook event type. + */ + event: 'batch.completed' | 'batch.failed' | 'batch.cancelled' | 'change.detected' | 'run.completed'; + + /** + * Stable event ID for deduplicating received webhooks. + */ + event_id: string; + + /** + * Latest attempt, or null if none. + */ + last_attempt: Attempt | null; + + /** + * Latest delivery error, or null if none. + */ + last_error: Delivery.LastError | null; + + /** + * Next scheduled attempt, or null if none. + */ + next_attempt_at: string | null; + + /** + * Webhook retry settings. Use {} for the default schedule. + */ + retry: WebhooksAPI.RetryConfig; + + /** + * Last time you can retry manually (7 days after the event). + */ + retry_expires_at: string; + + /** + * Batch or monitor run that produced the event. + */ + source: Delivery.Batch | Delivery.Monitor; + + /** + * `pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled` + * (source or its webhook was removed). + */ + status: 'pending' | 'delivering' | 'retrying' | 'delivered' | 'failed' | 'cancelled'; + + /** + * Webhook destination URL. + */ + url: string; +} + +export namespace Delivery { + /** + * Latest delivery error, or null if none. + */ + export interface LastError { + /** + * Error code. + */ + code: string; + + /** + * Error details. + */ + message: string; + } + + export interface Batch { + /** + * Batch ID. + */ + batch_id: string; + + /** + * Which deliveries to list: `batch` or `monitor`. + */ + type: 'batch'; + } + + export interface Monitor { + /** + * Monitor ID. + */ + monitor_id: string; + + /** + * Monitor run ID. + */ + run_id: string; + + /** + * Which deliveries to list: `batch` or `monitor`. + */ + type: 'monitor'; + } +} + +export interface DeliverySummary { + /** + * Delivery ID. + */ + id: string; + + /** + * Event creation time. + */ + created_at: string; + + /** + * Last successful delivery time, or null if never delivered. + */ + delivered_at: string | null; + + /** + * Webhook event type. + */ + event: 'batch.completed' | 'batch.failed' | 'batch.cancelled' | 'change.detected' | 'run.completed'; + + /** + * Latest delivery error, or null if none. + */ + last_error: DeliverySummary.LastError | null; + + /** + * Next scheduled attempt, or null if none. + */ + next_attempt_at: string | null; + + /** + * Last time you can retry manually (7 days after the event). + */ + retry_expires_at: string; + + /** + * Batch or monitor run that produced the event. + */ + source: DeliverySummary.Batch | DeliverySummary.Monitor; + + /** + * `pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled` + * (source or its webhook was removed). + */ + status: 'pending' | 'delivering' | 'retrying' | 'delivered' | 'failed' | 'cancelled'; + + /** + * Webhook destination URL. + */ + url: string; +} + +export namespace DeliverySummary { + /** + * Latest delivery error, or null if none. + */ + export interface LastError { + /** + * Error code. + */ + code: string; + + /** + * Error details. + */ + message: string; + } + + export interface Batch { + /** + * Batch ID. + */ + batch_id: string; + + /** + * Which deliveries to list: `batch` or `monitor`. + */ + type: 'batch'; + } + + export interface Monitor { + /** + * Monitor ID. + */ + monitor_id: string; + + /** + * Monitor run ID. + */ + run_id: string; + + /** + * Which deliveries to list: `batch` or `monitor`. + */ + type: 'monitor'; + } +} + +export interface DeliveryRetrieveResponse extends Delivery { + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: DeliveryRetrieveResponse.KeyMetadata; +} + +export namespace DeliveryRetrieveResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface DeliveryListResponse { + /** + * Webhook deliveries. + */ + data: Array; + + /** + * Whether more deliveries are available. + */ + has_more: boolean; + + /** + * Next page cursor, or null on the last page. + */ + next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: DeliveryListResponse.KeyMetadata; +} + +export namespace DeliveryListResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface DeliveryListAttemptsResponse { + /** + * Delivery attempts. + */ + data: Array; + + /** + * Whether more attempts are available. + */ + has_more: boolean; + + /** + * Next page cursor, or null on the last page. + */ + next_cursor: string | null; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: DeliveryListAttemptsResponse.KeyMetadata; +} + +export namespace DeliveryListAttemptsResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface DeliveryRetryResponse { + /** + * Delivery ID. + */ + id: string; + + /** + * Unique ID of this request, also in `X-Request-Id`. Include it when contacting + * support. + */ + request_id: string; + + /** + * Credits this request used and your remaining balance. + */ + key_metadata?: DeliveryRetryResponse.KeyMetadata; +} + +export namespace DeliveryRetryResponse { + /** + * Credits this request used and your remaining balance. + */ + export interface KeyMetadata { + /** + * Credits charged for this request. + */ + credits_consumed: number; + + /** + * Credits remaining for your organization. + */ + credits_remaining: number; + } +} + +export interface DeliveryRetrieveParams { + /** + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. + */ + tags?: Array; +} + +export type DeliveryListParams = DeliveryListParams.ByBatch | DeliveryListParams.ByMonitor; + +export declare namespace DeliveryListParams { + export interface ByBatch { + /** + * Delivery source. + */ + type: 'batch'; + + /** + * Filter by batch ID. + */ + batch_id?: string; + + /** + * Only include events created after this ISO 8601 timestamp. + */ + created_after?: string; + + /** + * The next_cursor from the previous response. + */ + cursor?: string; + + /** + * Number of deliveries to return. + */ + limit?: number; + + /** + * Filter by delivery status. + */ + status?: 'pending' | 'delivering' | 'retrying' | 'delivered' | 'failed' | 'cancelled'; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + } + + export interface ByMonitor { + /** + * Delivery source. + */ + type: 'monitor'; + + /** + * Only include events created after this ISO 8601 timestamp. + */ + created_after?: string; + + /** + * The next_cursor from the previous response. + */ + cursor?: string; + + /** + * Number of deliveries to return. + */ + limit?: number; + + /** + * Filter by monitor ID. + */ + monitor_id?: string; + + /** + * Filter by monitor run ID. + */ + run_id?: string; + + /** + * Filter by delivery status. + */ + status?: 'pending' | 'delivering' | 'retrying' | 'delivered' | 'failed' | 'cancelled'; + + /** + * Labels for filtering usage in the dashboard. + */ + tags?: Array; + } +} + +export interface DeliveryListAttemptsParams { + /** + * The next_cursor from the previous response. + */ + cursor?: string; + + /** + * Number of attempts to return. + */ + limit?: number; + + /** + * Comma-separated labels for filtering usage, e.g. `production,team-alpha`. + */ + tags?: Array; +} + +export interface DeliveryRetryParams { + /** + * Body param: Resend even if the delivery already succeeded. Defaults to false. + */ + force?: boolean; + + /** + * Body param: Labels for filtering usage in the dashboard. + */ + tags?: Array; + + /** + * Header param: Unique key to prevent duplicate retry requests. + */ + 'Idempotency-Key'?: string; +} + +export declare namespace Deliveries { + export { + type Attempt as Attempt, + type Delivery as Delivery, + type DeliverySummary as DeliverySummary, + type DeliveryRetrieveResponse as DeliveryRetrieveResponse, + type DeliveryListResponse as DeliveryListResponse, + type DeliveryListAttemptsResponse as DeliveryListAttemptsResponse, + type DeliveryRetryResponse as DeliveryRetryResponse, + type DeliveryRetrieveParams as DeliveryRetrieveParams, + type DeliveryListParams as DeliveryListParams, + type DeliveryListAttemptsParams as DeliveryListAttemptsParams, + type DeliveryRetryParams as DeliveryRetryParams, + }; +} diff --git a/src/resources/webhooks/index.ts b/src/resources/webhooks/index.ts new file mode 100644 index 00000000..ba38693c --- /dev/null +++ b/src/resources/webhooks/index.ts @@ -0,0 +1,17 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Deliveries, + type Attempt, + type Delivery, + type DeliverySummary, + type DeliveryRetrieveResponse, + type DeliveryListResponse, + type DeliveryListAttemptsResponse, + type DeliveryRetryResponse, + type DeliveryRetrieveParams, + type DeliveryListParams, + type DeliveryListAttemptsParams, + type DeliveryRetryParams, +} from './deliveries'; +export { Webhooks, type RetryConfig } from './webhooks'; diff --git a/src/resources/webhooks/webhooks.ts b/src/resources/webhooks/webhooks.ts new file mode 100644 index 00000000..e21a221a --- /dev/null +++ b/src/resources/webhooks/webhooks.ts @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import * as DeliveriesAPI from './deliveries'; +import { + Attempt, + Deliveries, + Delivery, + DeliveryListAttemptsParams, + DeliveryListAttemptsResponse, + DeliveryListParams, + DeliveryListResponse, + DeliveryRetrieveParams, + DeliveryRetrieveResponse, + DeliveryRetryParams, + DeliveryRetryResponse, + DeliverySummary, +} from './deliveries'; + +export class Webhooks extends APIResource { + deliveries: DeliveriesAPI.Deliveries = new DeliveriesAPI.Deliveries(this._client); +} + +/** + * Webhook retry settings. Use {} for the default schedule. + */ +export interface RetryConfig { + /** + * Retry delays in seconds, totaling at most 72 hours. Use [] to disable automatic + * retries. + */ + delays_seconds?: Array; +} + +Webhooks.Deliveries = Deliveries; + +export declare namespace Webhooks { + export { type RetryConfig as RetryConfig }; + + export { + Deliveries as Deliveries, + type Attempt as Attempt, + type Delivery as Delivery, + type DeliverySummary as DeliverySummary, + type DeliveryRetrieveResponse as DeliveryRetrieveResponse, + type DeliveryListResponse as DeliveryListResponse, + type DeliveryListAttemptsResponse as DeliveryListAttemptsResponse, + type DeliveryRetryResponse as DeliveryRetryResponse, + type DeliveryRetrieveParams as DeliveryRetrieveParams, + type DeliveryListParams as DeliveryListParams, + type DeliveryListAttemptsParams as DeliveryListAttemptsParams, + type DeliveryRetryParams as DeliveryRetryParams, + }; +} diff --git a/src/version.ts b/src/version.ts index 22e51840..c5853f42 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.14.0'; // x-release-please-version +export const VERSION = '3.30.0'; // x-release-please-version diff --git a/tests/api-resources/batch.test.ts b/tests/api-resources/batch.test.ts index 737d2843..36e4c04c 100644 --- a/tests/api-resources/batch.test.ts +++ b/tests/api-resources/batch.test.ts @@ -42,7 +42,8 @@ describe('resource batch', () => { limit: 1, q: 'batch_1a2b', search_type: 'exact', - status: 'queued', + shouldIncludeUnified: true, + status: 'pending', tags: 'docs,competitor', }, { path: '/_stainless_unknown_path' }, @@ -92,7 +93,7 @@ describe('resource batch', () => { await expect( client.batch.getResults( 'batch_9f2c8a', - { cursor: 'cursor', limit: 1 }, + { cursor: '321669910225:155771193', limit: 1 }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(ContextDev.NotFoundError); @@ -103,7 +104,7 @@ describe('resource batch', () => { const responsePromise = client.batch.submit({ input: { data: { - format: 'markdown', + formats: {}, urls: [ { url: 'https://example.com/products/anvil' }, { url: 'https://example.com/products/hammer' }, @@ -126,7 +127,17 @@ describe('resource batch', () => { const response = await client.batch.submit({ input: { data: { - format: 'markdown', + formats: { + bytes: true, + highlights: true, + html: true, + images: true, + json: true, + markdown: true, + parse: true, + product: true, + screenshot: true, + }, urls: [ { url: 'https://example.com/products/anvil', @@ -139,30 +150,74 @@ describe('resource batch', () => { meta: { foo: 'bar' }, }, ], - options: { - country: 'de', - excludeSelectors: ['x'], - includeHTML: true, + highlightsParams: { query: 'x', maxCharacters: 100 }, + imageParams: { dedupe: 'none', enrich: ['dimensions'] }, + jsonParams: { + schema: { + type: 'bar', + properties: 'bar', + required: 'bar', + additionalProperties: 'bar', + }, + instructions: 'instructions', + }, + markdownParams: { includeImages: true, includeLinks: true, - includeSelectors: ['x'], - maxAgeMs: 0, - pdf: { - end: 1, - ocr: true, - shouldParse: true, - start: 1, + inlineImages: 'placeholder', + sourcePreference: ['html-conversion'], + }, + maxAgeMs: 0, + parseParams: { + rules: { + title: 'h1', + links: { + selector: 'a', + output: '@href', + type: 'list', + }, }, + type: 'custom', + }, + productParams: { dedupeImages: true, useAIFallback: true }, + screenshotParams: { area: 'viewport', format: 'png' }, + sharedParams: { + actions: [{ action: 'Click the product details tab', type: 'perform' }], + country: 'US', + dismissCookies: true, + dismissPopups: true, + excludeSelectors: ['P'], + headers: { 'Accept-Language': 'en-US' }, + includeFrames: true, + includeSelectors: ['P'], + mainContentOnly: true, + parsers: { + pdf: { + endPage: 1, + includeNumberedPages: true, + ocr: 'off', + startPage: 1, + }, + }, + profile: { profileId: 'prof_210b9798eb53baa4e69d31c1071cf03d', type: 'existing' }, settleAnimations: true, - shortenBase64Images: true, - useMainContentOnly: true, - waitForMs: 0, + theme: 'light', + viewport: { height: 240, width: 240 }, + waitFor: 500, }, + tags: ['production', 'team-alpha'], + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, + zdr: 'disabled', }, mode: 'scrape', }, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], tags: ['docs', 'competitor'], - webhookUrl: 'webhookUrl', + webhook: { + url: 'https://example.com', + retry: { delays_seconds: [10, 60, 300, 1800, 7200, 21600, 57600] }, + }, + webhookUrl: 'https://example.com', 'Idempotency-Key': 'Idempotency-Key', }); }); diff --git a/tests/api-resources/brand.test.ts b/tests/api-resources/brand.test.ts index 5722af22..434fd0fb 100644 --- a/tests/api-resources/brand.test.ts +++ b/tests/api-resources/brand.test.ts @@ -28,31 +28,10 @@ describe('resource brand', () => { force_language: 'afrikaans', maxAgeMs: 0, maxSpeed: true, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], tags: ['production', 'team-alpha'], - timeoutMS: 1000, - }); - }); - - // Mock server tests are disabled - test.skip('retrieveSimplified: only required params', async () => { - const responsePromise = client.brand.retrieveSimplified({ domain: 'xxx' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('retrieveSimplified: required and optional params', async () => { - const response = await client.brand.retrieveSimplified({ - domain: 'xxx', - maxAgeMs: 0, - tags: ['production', 'team-alpha'], - theme: 'light', - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, + zdr: 'enabled', }); }); @@ -73,6 +52,8 @@ describe('resource brand', () => { const response = await client.brand.search({ query: 'x', autocomplete: true, + country: 'US', + language: 'afrikaans', queryBy: ['name'], tags: ['production', 'team-alpha'], typoTolerance: 0, diff --git a/tests/api-resources/browser/profiles.test.ts b/tests/api-resources/browser/profiles.test.ts new file mode 100644 index 00000000..e34e2591 --- /dev/null +++ b/tests/api-resources/browser/profiles.test.ts @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import ContextDev from 'context.dev'; + +const client = new ContextDev({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource profiles', () => { + // Mock server tests are disabled + test.skip('list', async () => { + const responsePromise = client.browser.profiles.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.browser.profiles.list( + { cursor: 'prof_210b9798eb53baa4e69d31c1071cf03d', limit: 1 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(ContextDev.NotFoundError); + }); +}); diff --git a/tests/api-resources/feedback.test.ts b/tests/api-resources/feedback.test.ts new file mode 100644 index 00000000..243d0f0d --- /dev/null +++ b/tests/api-resources/feedback.test.ts @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import ContextDev from 'context.dev'; + +const client = new ContextDev({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource feedback', () => { + // Mock server tests are disabled + test.skip('submit: only required params', async () => { + const responsePromise = client.feedback.submit({ + category: 'bug', + note: 'Markdown drops the plan comparison table; expected all 4 rows.', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('submit: required and optional params', async () => { + const response = await client.feedback.submit({ + category: 'bug', + note: 'Markdown drops the plan comparison table; expected all 4 rows.', + request_id: '3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91', + tags: ['production', 'team-alpha'], + url: 'https://stripe.com/pricing', + }); + }); +}); diff --git a/tests/api-resources/industry.test.ts b/tests/api-resources/industry.test.ts index 6d0a4a3e..ed136672 100644 --- a/tests/api-resources/industry.test.ts +++ b/tests/api-resources/industry.test.ts @@ -27,7 +27,8 @@ describe('resource industry', () => { maxResults: 1, minResults: 1, tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, + zdr: 'enabled', }); }); @@ -50,8 +51,9 @@ describe('resource industry', () => { maxResults: 1, minResults: 1, tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, type: 'original_sic', + zdr: 'enabled', }); }); }); diff --git a/tests/api-resources/ai.test.ts b/tests/api-resources/logs.test.ts similarity index 54% rename from tests/api-resources/ai.test.ts rename to tests/api-resources/logs.test.ts index 72464aad..4227b6f8 100644 --- a/tests/api-resources/ai.test.ts +++ b/tests/api-resources/logs.test.ts @@ -7,10 +7,10 @@ const client = new ContextDev({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource ai', () => { +describe('resource logs', () => { // Mock server tests are disabled - test.skip('extractProduct: only required params', async () => { - const responsePromise = client.ai.extractProduct({ url: 'https://example.com' }); + test.skip('retrieve', async () => { + const responsePromise = client.logs.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,18 +21,8 @@ describe('resource ai', () => { }); // Mock server tests are disabled - test.skip('extractProduct: required and optional params', async () => { - const response = await client.ai.extractProduct({ - url: 'https://example.com', - maxAgeMs: 0, - tags: ['production', 'team-alpha'], - timeoutMS: 1000, - }); - }); - - // Mock server tests are disabled - test.skip('extractProducts: only required params', async () => { - const responsePromise = client.ai.extractProducts({ domain: 'domain' }); + test.skip('list', async () => { + const responsePromise = client.logs.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,13 +33,25 @@ describe('resource ai', () => { }); // Mock server tests are disabled - test.skip('extractProducts: required and optional params', async () => { - const response = await client.ai.extractProducts({ - domain: 'domain', - maxAgeMs: 0, - maxProducts: 1, - tags: ['production', 'team-alpha'], - timeoutMS: 1000, - }); + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.logs.list( + { + error_code: 'WEBSITE_ACCESS_ERROR', + errors_only: true, + from: '2026-09-10T00:00:00Z', + key_id: 'x', + limit: 1, + page: 1, + path: '/brand/retrieve', + search: 'acme.com', + status_code: 500, + tags: 'nightly-import,team-alpha', + to: '2026-09-11T00:00:00Z', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(ContextDev.NotFoundError); }); }); diff --git a/tests/api-resources/monitors.test.ts b/tests/api-resources/monitors.test.ts index cd7c9604..0e7feee7 100644 --- a/tests/api-resources/monitors.test.ts +++ b/tests/api-resources/monitors.test.ts @@ -30,19 +30,27 @@ describe('resource monitors', () => { target: { type: 'page', url: 'https://acme.com/pricing', + actions: [{ do: 'wait', timeMs: 0 }], + exclude_selectors: ['.carousel', '[id^="TA_"]'], + include_selectors: ['#attraction-details'], instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true, }, change_detection: { type: 'exact' }, mode: 'web', + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], schedule: { frequency: 6, type: 'interval', unit: 'hours', }, tags: ['pricing', 'competitor'], - webhook: { url: 'https://example.com/webhook', events: ['change.detected', 'run.completed'] }, + webhook: { + url: 'https://example.com/webhook', + events: ['change.detected', 'run.completed'], + retry: { delays_seconds: [10, 60, 300, 1800, 7200, 21600, 57600] }, + }, }); }); @@ -280,6 +288,35 @@ describe('resource monitors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // Mock server tests are disabled + test.skip('retrieveRun: only required params', async () => { + const responsePromise = client.monitors.retrieveRun('run_123', { monitor_id: 'mon_123' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieveRun: required and optional params', async () => { + const response = await client.monitors.retrieveRun('run_123', { monitor_id: 'mon_123' }); + }); + + // Mock server tests are disabled + test.skip('rotateWebhookSecret', async () => { + const responsePromise = client.monitors.rotateWebhookSecret('mon_123'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // Mock server tests are disabled test.skip('run', async () => { const responsePromise = client.monitors.run('mon_123'); diff --git a/tests/api-resources/news.test.ts b/tests/api-resources/news.test.ts index 0cc48978..c16a3e78 100644 --- a/tests/api-resources/news.test.ts +++ b/tests/api-resources/news.test.ts @@ -12,7 +12,7 @@ describe('resource news', () => { test.skip('search: only required params', async () => { const responsePromise = client.news.search({ searchBy: { - entity: { name: 'xx', type: 'name' }, + entity: { domain: 'stripe.com', type: 'domain' }, type: 'entity', }, }); @@ -29,18 +29,19 @@ describe('resource news', () => { test.skip('search: required and optional params', async () => { const response = await client.news.search({ searchBy: { - entity: { name: 'xx', type: 'name' }, + entity: { domain: 'stripe.com', type: 'domain' }, type: 'entity', }, cursor: 'cursor', filterBy: { - articleLanguage: ['ar'], + articleLanguage: ['am'], articleType: ['editorial'], date: { from: 0, to: 0 }, sourceCountry: ['ae'], sourceDomain: ['x'], }, limit: 1, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], sortBy: { type: 'relevance' }, tags: ['production', 'team-alpha'], }); diff --git a/tests/api-resources/people.test.ts b/tests/api-resources/people.test.ts index ecb969f7..10746f53 100644 --- a/tests/api-resources/people.test.ts +++ b/tests/api-resources/people.test.ts @@ -19,4 +19,32 @@ describe('resource people', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('search: only required params', async () => { + const responsePromise = client.people.search({ query: 'VPs of sales at solar companies in California' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('search: required and optional params', async () => { + const response = await client.people.search({ + query: 'VPs of sales at solar companies in California', + cursor: 'cursor', + filters: { + countries: ['SE'], + years_of_experience_max: 0, + years_of_experience_min: 0, + }, + mode: 'fast', + tags: ['production', 'team-alpha'], + zdr: 'enabled', + }); + }); }); diff --git a/tests/api-resources/utility.test.ts b/tests/api-resources/utility.test.ts index 63476b03..078c75e1 100644 --- a/tests/api-resources/utility.test.ts +++ b/tests/api-resources/utility.test.ts @@ -11,7 +11,7 @@ describe('resource utility', () => { // Mock server tests are disabled test.skip('prefetch: only required params', async () => { const responsePromise = client.utility.prefetch({ - identifier: { domain: 'xxx' }, + identifier: { domain: 'stripe.com' }, type: 'brand', }); const rawResponse = await responsePromise.asResponse(); @@ -26,10 +26,11 @@ describe('resource utility', () => { // Mock server tests are disabled test.skip('prefetch: required and optional params', async () => { const response = await client.utility.prefetch({ - identifier: { domain: 'xxx' }, + identifier: { domain: 'stripe.com' }, type: 'brand', + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, }); }); }); diff --git a/tests/api-resources/web.test.ts b/tests/api-resources/web.test.ts index ab05d344..d8d47a4a 100644 --- a/tests/api-resources/web.test.ts +++ b/tests/api-resources/web.test.ts @@ -9,15 +9,9 @@ const client = new ContextDev({ describe('resource web', () => { // Mock server tests are disabled - test.skip('extract: only required params', async () => { - const responsePromise = client.web.extract({ - schema: { - type: 'bar', - properties: 'bar', - required: 'bar', - additionalProperties: 'bar', - }, - url: 'https://example.com', + test.skip('answers: only required params', async () => { + const responsePromise = client.web.answers({ + task: 'Find the pricing page URL and plan names for context.dev.', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,33 +23,15 @@ describe('resource web', () => { }); // Mock server tests are disabled - test.skip('extract: required and optional params', async () => { - const response = await client.web.extract({ - schema: { - type: 'bar', - properties: 'bar', - required: 'bar', - additionalProperties: 'bar', - }, - url: 'https://example.com', - actions: [{ do: 'wait', timeMs: 0 }], - factCheck: true, - followSubdomains: true, - includeFrames: true, - instructions: 'instructions', - maxAgeMs: 0, - maxDepth: 0, - maxPages: 1, - pdf: { - end: 1, - shouldParse: true, - start: 1, - }, - settleAnimations: true, - stopAfterMs: 10000, + test.skip('answers: required and optional params', async () => { + const response = await client.web.answers({ + task: 'Find the pricing page URL and plan names for context.dev.', + json_format: { pricing_page_url: 'bar', plans: 'bar' }, + mode: 'fast', + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], tags: ['production', 'team-alpha'], - timeoutMS: 1000, - waitForMs: 0, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, + zdr: 'enabled', }); }); @@ -77,13 +53,14 @@ describe('resource web', () => { domain: 'xxx', numCompetitors: 1, tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, + zdr: 'enabled', }); }); // Mock server tests are disabled - test.skip('extractFonts', async () => { - const responsePromise = client.web.extractFonts(); + test.skip('extractStyleguide', async () => { + const responsePromise = client.web.extractStyleguide(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -94,16 +71,19 @@ describe('resource web', () => { }); // Mock server tests are disabled - test.skip('extractFonts: request options and params are passed correctly', async () => { + test.skip('extractStyleguide: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.web.extractFonts( + client.web.extractStyleguide( { + colorScheme: 'light', directUrl: 'https://example.com', domain: 'xxx', maxAgeMs: 0, + policies: ['string'], tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, + zdr: 'enabled', }, { path: '/_stainless_unknown_path' }, ), @@ -111,8 +91,8 @@ describe('resource web', () => { }); // Mock server tests are disabled - test.skip('extractStyleguide', async () => { - const responsePromise = client.web.extractStyleguide(); + test.skip('mapUrls: only required params', async () => { + const responsePromise = client.web.mapUrls({ domain: 'stripe.com' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -123,21 +103,113 @@ describe('resource web', () => { }); // Mock server tests are disabled - test.skip('extractStyleguide: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.web.extractStyleguide( - { - colorScheme: 'light', - directUrl: 'https://example.com', - domain: 'xxx', - maxAgeMs: 0, - tags: ['production', 'team-alpha'], - timeoutMS: 1000, + test.skip('mapUrls: required and optional params', async () => { + const response = await client.web.mapUrls({ + domain: 'stripe.com', + excludeUrlRegex: '/tag/|/author/', + headers: { foo: 'J!' }, + includeSubdomains: true, + maxLinks: 1, + policies: ['string'], + search: 'help center and troubleshooting articles', + sitemapUrl: 'https://example.com', + tags: ['production', 'team-alpha'], + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, + urlRegex: '^https?://[^/]+/blog/', + zdr: 'enabled', + }); + }); + + // Mock server tests are disabled + test.skip('scrape: only required params', async () => { + const responsePromise = client.web.scrape({ + formats: {}, + url: 'https://example.com', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('scrape: required and optional params', async () => { + const response = await client.web.scrape({ + formats: { + bytes: true, + highlights: true, + html: true, + images: true, + json: true, + markdown: true, + parse: true, + product: true, + screenshot: true, + }, + url: 'https://example.com', + highlightsParams: { query: 'x', maxCharacters: 100 }, + imageParams: { dedupe: 'none', enrich: ['dimensions'] }, + jsonParams: { + schema: { + type: 'bar', + properties: 'bar', + required: 'bar', + additionalProperties: 'bar', }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(ContextDev.NotFoundError); + instructions: 'instructions', + }, + markdownParams: { + includeImages: true, + includeLinks: true, + inlineImages: 'placeholder', + sourcePreference: ['html-conversion'], + }, + maxAgeMs: 0, + parseParams: { + rules: { + title: 'h1', + links: { + selector: 'a', + output: '@href', + type: 'list', + }, + }, + type: 'custom', + }, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], + productParams: { dedupeImages: true, useAIFallback: true }, + screenshotParams: { area: 'viewport', format: 'png' }, + sharedParams: { + actions: [{ action: 'Click the product details tab', type: 'perform' }], + country: 'US', + dismissCookies: true, + dismissPopups: true, + excludeSelectors: ['P'], + headers: { 'Accept-Language': 'en-US' }, + includeFrames: true, + includeSelectors: ['P'], + mainContentOnly: true, + parsers: { + pdf: { + endPage: 1, + includeNumberedPages: true, + ocr: 'off', + startPage: 1, + }, + }, + profile: { profileId: 'prof_210b9798eb53baa4e69d31c1071cf03d', type: 'existing' }, + settleAnimations: true, + theme: 'light', + viewport: { height: 240, width: 240 }, + waitFor: 500, + }, + tags: ['production', 'team-alpha'], + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, + zdr: 'enabled', + }); }); // Mock server tests are disabled @@ -165,11 +237,12 @@ describe('resource web', () => { domain: 'xxx', fullScreenshot: 'true', handleCookiePopup: true, + headers: { foo: 'J!' }, maxAgeMs: 0, page: 'login', scrollOffset: 0, tags: ['production', 'team-alpha'], - timeoutMS: 1, + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, viewport: { height: 240, width: 240 }, waitForMs: 0, zdr: 'enabled', @@ -181,7 +254,7 @@ describe('resource web', () => { // Mock server tests are disabled test.skip('search: only required params', async () => { - const responsePromise = client.web.search({ query: 'x' }); + const responsePromise = client.web.search({ query: 'Stripe API authentication' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -194,11 +267,14 @@ describe('resource web', () => { // Mock server tests are disabled test.skip('search: required and optional params', async () => { const response = await client.web.search({ - query: 'x', + query: 'Stripe API authentication', country: 'af', - excludeDomains: ['string'], + descriptionMaxCharacters: 0, + excludeDomains: ['xxx'], freshness: 'last_24_hours', - includeDomains: ['string'], + highlightsOptions: { enabled: true, maxCharacters: 100 }, + includeDomains: ['xxx'], + languages: 'all', markdownOptions: { enabled: true, includeFrames: true, @@ -211,14 +287,16 @@ describe('resource web', () => { start: 1, }, shortenBase64Images: true, - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1, behavior: 'fail' }, useMainContentOnly: true, waitForMs: 0, }, numResults: 10, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], queryFanout: true, tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, + zdr: 'enabled', }); }); @@ -239,169 +317,33 @@ describe('resource web', () => { const response = await client.web.webCrawlMd({ url: 'https://example.com', country: 'de', - excludeSelectors: ['string'], + excludeSelectors: ['x'], + excludeUrlRegex: '/tag/|/author/', followSubdomains: true, includeFrames: true, includeImages: true, includeLinks: true, - includeSelectors: ['string'], + includeSelectors: ['x'], maxAgeMs: 0, maxDepth: 0, - maxPages: 1, + maxPages: 10, pdf: { end: 1, ocr: true, shouldParse: true, start: 1, }, + policies: ['pol_3f9c2a7e5b8d4c1f9a6e0b2d7c4f8a1e'], settleAnimations: true, shortenBase64Images: true, + sourcePreference: ['html-conversion'], stopAfterMs: 10000, tags: ['production', 'team-alpha'], - timeoutMS: 1000, + timeoutOpts: { milliseconds: 1000, behavior: 'fail' }, urlRegex: '^https?://[^/]+/blog/', useMainContentOnly: true, waitForMs: 0, zdr: 'enabled', }); }); - - // Mock server tests are disabled - test.skip('webScrapeHTML: only required params', async () => { - const responsePromise = client.web.webScrapeHTML({ url: 'https://example.com' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('webScrapeHTML: required and optional params', async () => { - const response = await client.web.webScrapeHTML({ - url: 'https://example.com', - actions: [{ do: 'wait', timeMs: 0 }], - country: 'de', - excludeSelectors: ['x'], - headers: { foo: 'J!' }, - includeFrames: true, - includeSelectors: ['x'], - maxAgeMs: 0, - pdf: { - end: 1, - ocr: true, - shouldParse: true, - start: 1, - }, - settleAnimations: true, - tags: ['production', 'team-alpha'], - timeoutMS: 1, - useMainContentOnly: true, - waitForMs: 0, - zdr: 'enabled', - }); - }); - - // Mock server tests are disabled - test.skip('webScrapeImages: only required params', async () => { - const responsePromise = client.web.webScrapeImages({ url: 'https://example.com' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('webScrapeImages: required and optional params', async () => { - const response = await client.web.webScrapeImages({ - url: 'https://example.com', - actions: [{ do: 'wait', timeMs: 0 }], - dedupe: true, - enrichment: { - classification: true, - hostedUrl: true, - maxTimePerMs: 1, - resolution: true, - }, - headers: { foo: 'J!' }, - maxAgeMs: 0, - tags: ['production', 'team-alpha'], - timeoutMS: 1, - waitForMs: 0, - }); - }); - - // Mock server tests are disabled - test.skip('webScrapeMd: only required params', async () => { - const responsePromise = client.web.webScrapeMd({ url: 'https://example.com' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('webScrapeMd: required and optional params', async () => { - const response = await client.web.webScrapeMd({ - url: 'https://example.com', - actions: [{ do: 'wait', timeMs: 0 }], - country: 'de', - excludeSelectors: ['x'], - headers: { foo: 'J!' }, - includeFrames: true, - includeHTML: true, - includeImages: true, - includeLinks: true, - includeSelectors: ['x'], - maxAgeMs: 0, - pdf: { - end: 1, - ocr: true, - shouldParse: true, - start: 1, - }, - settleAnimations: true, - shortenBase64Images: true, - tags: ['production', 'team-alpha'], - timeoutMS: 1, - useMainContentOnly: true, - waitForMs: 0, - zdr: 'enabled', - }); - }); - - // Mock server tests are disabled - test.skip('webScrapeSitemap: only required params', async () => { - const responsePromise = client.web.webScrapeSitemap({ domain: 'xxx' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // Mock server tests are disabled - test.skip('webScrapeSitemap: required and optional params', async () => { - const response = await client.web.webScrapeSitemap({ - domain: 'xxx', - headers: { foo: 'J!' }, - maxLinks: 1, - search: 'help center and troubleshooting articles', - sitemapUrl: 'https://example.com', - tags: ['production', 'team-alpha'], - timeoutMS: 1, - urlRegex: '^https?://[^/]+/blog/', - zdr: 'enabled', - }); - }); }); diff --git a/tests/api-resources/webhooks/deliveries.test.ts b/tests/api-resources/webhooks/deliveries.test.ts new file mode 100644 index 00000000..a04ea49f --- /dev/null +++ b/tests/api-resources/webhooks/deliveries.test.ts @@ -0,0 +1,115 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import ContextDev from 'context.dev'; + +const client = new ContextDev({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource deliveries', () => { + // Mock server tests are disabled + test.skip('retrieve', async () => { + const responsePromise = client.webhooks.deliveries.retrieve('whd_210b9798eb53baa4e69d31c1071cf03d'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retrieve: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.webhooks.deliveries.retrieve( + 'whd_210b9798eb53baa4e69d31c1071cf03d', + { tags: ['production', 'team-alpha'] }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(ContextDev.NotFoundError); + }); + + // Mock server tests are disabled + test.skip('list: only required params', async () => { + const responsePromise = client.webhooks.deliveries.list({ type: 'batch' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('list: required and optional params', async () => { + const response = await client.webhooks.deliveries.list({ + type: 'batch', + batch_id: 'batch_id', + created_after: '2026-09-01T00:00:00Z', + cursor: 'whd_210b9798eb53baa4e69d31c1071cf03d', + limit: 1, + status: 'pending', + tags: ['production', 'team-alpha'], + }); + }); + + // Mock server tests are disabled + test.skip('listAttempts', async () => { + const responsePromise = client.webhooks.deliveries.listAttempts('whd_210b9798eb53baa4e69d31c1071cf03d'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('listAttempts: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.webhooks.deliveries.listAttempts( + 'whd_210b9798eb53baa4e69d31c1071cf03d', + { + cursor: 'wha_210b9798eb53baa4e69d31c1071cf03d', + limit: 1, + tags: ['production', 'team-alpha'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(ContextDev.NotFoundError); + }); + + // Mock server tests are disabled + test.skip('retry', async () => { + const responsePromise = client.webhooks.deliveries.retry('whd_210b9798eb53baa4e69d31c1071cf03d'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('retry: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.webhooks.deliveries.retry( + 'whd_210b9798eb53baa4e69d31c1071cf03d', + { + force: true, + tags: ['production', 'team-alpha'], + 'Idempotency-Key': 'Idempotency-Key', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(ContextDev.NotFoundError); + }); +}); diff --git a/yarn.lock b/yarn.lock index f16b683a..bac6f2fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1228,9 +1228,9 @@ baseline-browser-mapping@^2.9.0: integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== brace-expansion@^2.0.2: - version "2.1.4" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.4.tgz#589dab11c0018d0366be64cd8bf12c8dbecc8326" - integrity sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg== + version "2.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.8.tgz#b4cf1e18069418e97732d5f30b39bb321c41bd9b" + integrity sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig== dependencies: balanced-match "^1.0.0"