diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index abb6b46..5a61cf3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,7 @@ include: - github-action - ai-action - discord-action + - notion-action .rust-actions: - cron-action diff --git a/actions/notion-action/.dockerignore b/actions/notion-action/.dockerignore new file mode 100644 index 0000000..838ab51 --- /dev/null +++ b/actions/notion-action/.dockerignore @@ -0,0 +1,6 @@ +node_modules +dist +.env +.env.* +src/tests +coverage diff --git a/actions/notion-action/.example.env b/actions/notion-action/.example.env new file mode 100644 index 0000000..7d4bd9e --- /dev/null +++ b/actions/notion-action/.example.env @@ -0,0 +1,7 @@ +HERCULES_AUTH_TOKEN= +HERCULES_AQUILA_URL=localhost:50051 +HERCULES_ACTION_ID=notion-action +HERCULES_SDK_VERSION=1.0.0 +# Optional: default poll interval for the triggers in milliseconds (default 60000, minimum 10000). +# Each trigger can override it with its pollIntervalSeconds setting. +NOTION_POLL_INTERVAL_MS= diff --git a/actions/notion-action/Dockerfile b/actions/notion-action/Dockerfile new file mode 100644 index 0000000..0b5abe6 --- /dev/null +++ b/actions/notion-action/Dockerfile @@ -0,0 +1,16 @@ +FROM node:24.10.0-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci +COPY tsconfig.json vite.config.ts ./ +COPY src ./src +RUN npm run build + +FROM node:24.10.0-alpine +WORKDIR /app +ENV NODE_ENV=production +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev +COPY --from=build /app/dist ./dist +USER node +CMD ["node", "dist/index.js"] diff --git a/actions/notion-action/README.md b/actions/notion-action/README.md new file mode 100644 index 0000000..dbfa9d2 --- /dev/null +++ b/actions/notion-action/README.md @@ -0,0 +1,85 @@ +# Notion action + +Read and write Notion pages, use databases as a backing store, and start Hercules flows when database entries change. + +## Setup + +Use Node.js 24 (matching the other action containers). + +```sh +npm ci +cp .example.env .env +# Fill in the Hercules connection settings. +npm run dev +``` + +On PowerShell, use `Copy-Item .example.env .env`. The dev/start scripts load `.env` if present. For a compiled process, run `npm run build` followed by `npm start`. + +Create a Notion internal integration with read, insert and update content capabilities. Share each target database/page with that integration via **Add connections**. An integration token alone does not grant access to all workspace content. + +The action has no project configuration. Every function and every trigger takes the integration token it works with as its first parameter, a plain text value, so one running action serves as many Notion integrations as its flows use. Tokens are never cached globally and never put in exported module defaults; an empty token is rejected. + +Each trigger additionally has an optional **Poll interval (seconds)** setting (`pollIntervalSeconds`, minimum 10 seconds). Without it the trigger uses `NOTION_POLL_INTERVAL_MS` of the action process (default 60 seconds). + +Shared environment variables: `HERCULES_AUTH_TOKEN`, `HERCULES_AQUILA_URL` (default `localhost:50051`), `HERCULES_ACTION_ID` (default `notion-action`), `HERCULES_SDK_VERSION` (default `1.0.0`, used as the module version like the other actions). + +## Functions + +| Identifier | Parameters | Result | +| --- | --- | --- | +| `notionCreatePage` | `integrationToken, parentId, title, markdown?` | `NOTION_PAGE` | +| `notionUpdatePage` | `integrationToken, pageId, title?, markdown?` | `NOTION_PAGE` | +| `notionGetPage` | `integrationToken, pageId` | `NOTION_PAGE` | +| `notionArchivePage` | `integrationToken, pageId` | `boolean` (Hercules BOOLEAN) | +| `notionSearch` | `integrationToken, query` | `NOTION_SEARCH_RESULT` | + +Create adds a page with a title and optional content under `parentId`: a database ID makes it a new entry, a page ID a subpage. The action first looks the ID up as a database; if Notion answers 400 or 404 (e.g. because it is a page), it creates the page under a parent page instead. Update changes the title and/or replaces the whole content; an empty title or content stays unchanged. The title is written by the property ID `title`, so the name of a database's title column (usually Name) does not matter; other columns are not written. Get retrieves the page with its properties and its content as Notion-flavored Markdown in `markdown` (two parallel requests: the page and `GET /pages/{id}/markdown` with `markdown_version: "v2"`). `markdown` is an optional field of `NOTION_PAGE` that Get and an update with content fill in; other functions and the triggers return pages without content. Archive moves the page to the trash (`in_trash`) and returns the state confirmed by Notion. + +Search collects **all pages** of results into one response (`has_more: false`, `next_cursor: null`); large workspaces consume corresponding time and memory. It matches page and database titles, not full page text; an empty search text lists everything the integration can access. + +Create and update take page content as Markdown (`markdown`), sent as [Notion-flavored Markdown](https://developers.notion.com/guides/data-apis/migrate-to-notion-flavored-markdown) (`markdown_version: "v2"`); Notion converts it into blocks such as headings, lists, to-dos (`- [ ]`), quotes, code blocks and links. Update replaces the content (`PATCH /pages/{id}/markdown`, `replace_content`) without allowing Notion to delete child pages or databases. Without content, create makes an empty page. API calls time out after 30 seconds. HTTP 429 is retried at most twice using `Retry-After` (up to 60 seconds); ambiguous network failures on writes are not automatically retried. + +## Polling events + +| Event | Settings | Flow input | +| --- | --- | --- | +| `NotionDatabaseItemCreated` | `integrationToken, databaseId, pollIntervalSeconds?` | The new `NOTION_PAGE` | +| `NotionDatabaseItemUpdated` | `integrationToken, databaseId, pollIntervalSeconds?` | The edited `NOTION_PAGE` | +| `NotionPagePropertyChanged` | `integrationToken, databaseId, propertyName, pollIntervalSeconds?` | The changed `NOTION_PAGE` | + +Hercules registers each class as a RuntimeEvent **and** its matching Event definition. The poller reads the token, database and interval from Aquila's flow settings. It calls `action.fire(flowId, page)` only for the matching flow; it does not broadcast to every flow of that event type. + +- Polling runs immediately after connection. Each flow is then polled every `pollIntervalSeconds` of its own settings (minimum 10 seconds), falling back to `NOTION_POLL_INTERVAL_MS` of the action process (default 60 seconds); a base timer checks every 10 seconds which flows are due. Poll cycles do not overlap. After a flow establishes its baseline, one extra poll follows after 10 seconds so a first change shows up quickly. Changing the interval keeps the baseline. Each poll is one Notion API request per watched flow, so keep intervals and the number of flows per integration within Notion's rate limit (about three requests per second). API calls and flow acknowledgements can make a cycle take longer. +- Notion rounds `created_time` down to the minute; item-created watches therefore count pages from the start of the activation minute. +- The first successful, fully paginated query establishes a baseline and emits no historical pages. Created detects newly observed pages whose creation time is at or after watch activation; moving an old page into a database is not a creation event. +- Updated detects increasing `last_edited_time`. A newly observed page that has already been edited can also trigger it. A new, unedited page is handled by Created. +- PropertyChanged compares the exact, case-sensitive property's API value against the previous snapshot. Other property edits do not trigger it. The first observation of a page establishes its property baseline. Removing/clearing a previously present value also triggers it. The payload is the current page, not a before/after diff. +- Subsequent queries use an inclusive `last_edited_time` cursor with a 60-second overlap. Per-page snapshots suppress repeats, including timestamp ties. This covers short indexing delays, not arbitrarily delayed updates. +- Pagination failures do not commit a new cursor. Delivery failures retry without refiring already acknowledged pages in that batch. A missing acknowledgement times out after 60 seconds. Delivery is **at least once**: a flow may have run even if its acknowledgement was lost, so downstream side effects should be idempotent. +- Checkpoints and property snapshots are **in memory**. Restart/reconnect, changed credentials, or changed watch settings establish a new baseline. Changes during downtime are not replayed. Use one action process for a given set of flows; this action has no distributed lock or shared durable checkpoint. +- Polling observes states, not every intermediate edit. A value changed and reverted between polls is not detectable. Archived/deleted pages disappear from database queries and do not emit a deletion event. Large/truncated relation or rollup properties are limited to what Notion returns in page properties. + +No inbound HTTP server, public webhook URL or cron-action dependency is required. + +## Data types and compatibility + +Each data type has its own file under `src/data_types/`. Zod schemas describe common fields and preserve additional Notion fields. They are deliberately extensible, not exhaustive validators for every Notion block or property subtype. No `z.custom()` schemas are used. Zod is pinned to `4.4.3`, the version Hercules' embedded schema exporter is built against. + +Points in time in responses (`created_time`, `last_edited_time`, file `expiry_time`, calendar `start_time`/`end_time`) are `DATE` values, i.e. Unix microseconds (UTC); the client converts Notion's ISO 8601 strings before validating a response. The triggers' query filters send timestamps to Notion as ISO 8601 text. + +The API is pinned to [`2025-09-03`](https://developers.notion.com/guides/get-started/upgrade-guide-2025-09-03), where a database is a container of one or more data sources and pages live in a data source. Functions and triggers keep taking a `databaseId`: the action resolves the database's data source (`GET /databases/{id}`) and then queries or creates pages in it. Databases with several data sources are ambiguous and fail with `NOTION_MULTIPLE_DATA_SOURCES`; the triggers resolve the data source once per watch. + +Notion now also supports [native webhooks](https://developers.notion.com/reference/webhooks). This action intentionally implements the requested polling triggers. + +## Verification and container + +```sh +npm run typecheck +npm test +npm run build +npx hercules export dist/index.js --compact +docker build -t notion-action . +docker run --env-file .env notion-action +``` + +Tests live under `src/tests/`. They use mocked HTTP calls and flow dispatch, covering request mapping, pagination, retries, builders, polling state and actual Hercules module registration. No live Notion or Aquila credentials are required. A live end-to-end test requires a shared Notion database and a configured Aquila instance. diff --git a/actions/notion-action/manifest.json b/actions/notion-action/manifest.json new file mode 100644 index 0000000..9be7c62 --- /dev/null +++ b/actions/notion-action/manifest.json @@ -0,0 +1,10 @@ +{ + "name": "notion", + "identifier": "notion-action", + "description": "Notion integration: read and write pages, query databases, search, and poll for changes.", + "deployment": { + "docker": { + "image": "ghcr.io/code0-tech/centaurus/ci-builds/notion-action" + } + } +} diff --git a/actions/notion-action/package-lock.json b/actions/notion-action/package-lock.json new file mode 100644 index 0000000..c681e0c --- /dev/null +++ b/actions/notion-action/package-lock.json @@ -0,0 +1,3798 @@ +{ + "name": "@code0-tech/notion-action", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@code0-tech/notion-action", + "version": "1.0.0", + "dependencies": { + "@code0-tech/hercules": "^1.9.0", + "@code0-tech/tucana": "^0.0.86", + "@notionhq/client": "^5.31.1", + "reflect-metadata": "^0.2.2", + "zod": "4.4.3" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "typescript-json-schema": "0.68.0", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } + }, + "node_modules/@clack/core": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.0.0-alpha.4.tgz", + "integrity": "sha512-VCtU+vjyKPMSakVrB9q1bOnXN7QW/w4+YQDQCOF59GrzydW+169i0fVx/qzRRXJgt8KGj/pZZ/JxXroFZIDByg==", + "license": "MIT", + "peer": true, + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.0.0-alpha.4.tgz", + "integrity": "sha512-KnmtDF2xQGoI5AlBme9akHtvCRV0RKAARUXHBQO2tMwnY8B08/4zPWigT7uLK25UPrMCEqnyQPkKRjNdhPbf8g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/core": "1.0.0-alpha.4", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@code0-tech/hercules": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.9.0.tgz", + "integrity": "sha512-Hd5MzOz+qT+3HF0nUHNIHMPVlXwogOmtZp4guiTlo5cW/x/i5sBWs9PB6VX6aKjsNbDmPehNR+PzpB45Ncl4NA==", + "license": "ISC", + "bin": { + "hercules": "bin/hercules.js" + }, + "peerDependencies": { + "@code0-tech/tucana": "0.0.86", + "@grpc/grpc-js": "^1.14.3", + "@protobuf-ts/grpc-backend": "^2.11.1", + "@protobuf-ts/grpc-transport": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "reflect-metadata": "^0.2.2", + "ts-morph": "^28.0.0", + "ts-to-zod": "^5.1.0", + "zod": "^4.4.3", + "zod-to-ts": "^2.1.0" + } + }, + "node_modules/@code0-tech/tucana": { + "version": "0.0.86", + "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.86.tgz", + "integrity": "sha512-CUIjP837mXM8T6ILwRCZNKTTARt/i12JxjQw3YPB03Hn2L96aineDVOE4XxjxCRzMJRE9+aZZtwh0jZuzbKWVg==", + "license": "MIT" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.4.tgz", + "integrity": "sha512-k9Dj3DV/itK9D06Y8f190Qgop7/Ui+D0njFV3LHMPwPT75DpXLQohE9Wmz0QElrJnzsjB7KPWiKJbOl7IPDArQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz", + "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@notionhq/client": { + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/@notionhq/client/-/client-5.31.1.tgz", + "integrity": "sha512-LuVlgHTkHPZf0LOILKVaDboYOyIXNHP9x2DSMhrJzUJjB7GzWjves1OA+8iqJxn1QPW6OqXdp0sS/z0Vh+JACA==", + "license": "MIT", + "engines": { + "node": ">=22" + } + }, + "node_modules/@oclif/core": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.14.0.tgz", + "integrity": "sha512-QCJIZoVJxV7jywgVAUlsQwl3dr3Sa21kfi5z9KrYolbexWJUtFSEtMoNiBWojD05mYycLnB50gp/VxlGdaOCRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^4.3.2", + "ansis": "^3.17.0", + "clean-stack": "^3.0.1", + "cli-spinners": "^2.9.2", + "debug": "^4.4.3", + "ejs": "^6", + "get-package-type": "^0.1.0", + "indent-string": "^4.0.0", + "lilconfig": "^3.1.3", + "minimatch": "^10.2.5", + "semver": "^7.8.1", + "string-width": "^4.2.3", + "supports-color": "^8", + "tinyglobby": "^0.2.17", + "widest-line": "^3.1.0", + "wordwrap": "^1.0.0", + "wrap-ansi": "^7.0.0", + "wsl-utils": "^0.4.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.149.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.149.0.tgz", + "integrity": "sha512-Efcc+iF0j3Bf67YjEqIqWXbX5XddXoK/Mw4K1/JuXwRCZ8N16VR7iT23nlCc9XrveFVh/E5Rqs2StT0V8v9LdA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@protobuf-ts/grpc-backend": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-backend/-/grpc-backend-2.11.1.tgz", + "integrity": "sha512-llAkJ03SlR/+p70YBTMOAQqdkXWghsTWwlPuGXC+Hj99hDQq6fa2CoVePPqbcn7A7/aLBcPG/9Ag3yqlltldxw==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.8.22" + } + }, + "node_modules/@protobuf-ts/grpc-transport": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.11.1.tgz", + "integrity": "sha512-l6wrcFffY+tuNnuyrNCkRM8hDIsAZVLA8Mn7PKdVyYxITosYh60qW663p9kL6TWXYuDCL3oxH8ih3vLKTDyhtg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.6.0" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz", + "integrity": "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==", + "license": "(Apache-2.0 AND BSD-3-Clause)", + "peer": true + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz", + "integrity": "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz", + "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz", + "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.8.tgz", + "integrity": "sha512-tN5aztYkKCte4i5SIrrz5yK/HMjEuCqCSCJa418jOV8tZ1cBY3YF2otxB1ktPxzsLA1BeTqwapK0bfjxNvHJVw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.8.tgz", + "integrity": "sha512-dIYTWl9XprMUiQFoc55KUyk/oS8SKYH3zFl0LTR7RT0Xj4hgSVyuJcroH8JUu8RcpF8fTB6E0aOwCkZoYPcDSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.8.tgz", + "integrity": "sha512-PCSDQGXD2IyTEFrcgPyBM8jJuGmrbCMuoIOXdbEGVemruKACXoLQJrb+A45Z0L5t1RQkdfJprAYPkikbh7dzdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.8.tgz", + "integrity": "sha512-Uk7lRsGhPFHVX/sAUC6D5H9Ol30dFHd6iquokll2th3LpdJ3F5CzQB+7DHn0Ri2mG+U7k2zXiPHDrwZenXhwSA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.8.tgz", + "integrity": "sha512-DjszaTEVogPqA5bYzsEeqDCQxbcp2fexQwKcRspYji2yzR68fCf+e4fx6kBSRDwX5/brZaHw/hWS9+A/+/w9sQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.8.tgz", + "integrity": "sha512-zmwa7FTmdzB6aaEEuuls18H6Ap5JmJPSoPTuXixeJZV6tG40SyLkApQtz1g8ptZtiEKqj9OM0oNLPh1AgvE31Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.8.tgz", + "integrity": "sha512-KdYQDPHwJVnbFwdTGMgxsI9SqblBlz6STGM+w1We/d5B8OWWidYH0MwkU/uA1wM5fIpO2MkOVxXrNzzuZhw9ew==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.8.tgz", + "integrity": "sha512-jFJTifHnNPY+yzOoNZQfSIysrVyXzEQPhPnOUjmD1bcQGHH6s7c8cViKWar8YplQImE5N9JRqMCLrM2CdxOrZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.8.tgz", + "integrity": "sha512-FhiOziBDWPBjbcmRzfLyIJnaP7AVMFXT7YCXPjXxj7wKU3vx24RjrCNN/zjvVa+N2vVoHJwCoUBvsrN/DG3zIA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.8.tgz", + "integrity": "sha512-WnHfADMzOV2Y55wlx1hzzQnar/wDt/VdvWSD99r18Mz9ylNieIGOkRx3UV21h7m/eJvjySYJkO26VvGNFkwsIQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.8.tgz", + "integrity": "sha512-H9tRr5ibfXFVLxbPOseVewewFpl28zcEdjRDt2FTUZU7odxP0gEv1ki4/kGmcGOh78oRwZuuQllGLZ9zTJp84g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.8.tgz", + "integrity": "sha512-UefiqfM3D6IVNlZ8tSGs9+Ejjud2T+oxO0IHADU45Y+lyEjD2dVFyZHbkfX0LUb5Zugo/oIv1eCO/KVYhgYJYA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.8.tgz", + "integrity": "sha512-637Ke4kWSy6rp9cxQ9gMOXlxPgIw/c1beASV4M//3+9I4uwBVOOl74G+e3zyU3u19U7RkRl/HuewixZ/Z6+Rjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.8.tgz", + "integrity": "sha512-xWBkPOF1Q9k/Gv1nQXnVdLxKu74jXppuOM4Z3mnypVUJJJwLsMl7hNJGRAUJoG8A5MgOI1ACKM+wBFxSJzKy4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.8.tgz", + "integrity": "sha512-uz2ZvfgXbxqNwijjjbxrnvALwpyODDcgc1T1N8N3rf/DXKQmaFwmB4LX4yyjggpwN2obdQLb2rgirX5ffCWYng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ts-morph/common": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", + "integrity": "sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^10.0.1", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.14" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.13.tgz", + "integrity": "sha512-gcLdvR9HO1ZJBypsOGqaP6TFEzb6vIta0KSTLt9NAQ6pXQO3cRgSVyCN6pzYqI9DlJgY71XKO0dpDhCf08b3pg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.2.tgz", + "integrity": "sha512-xlvWf4Vs9n1PEVYwP1n4vvG07M6y8WgvJ2t0vbrWTmijsIHp1cS+uJ2kMIRdY3nHZK0nCYKrPeD171+SzF4/zw==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.4.tgz", + "integrity": "sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.3" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz", + "integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz", + "integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.11", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz", + "integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz", + "integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.11", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz", + "integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "@vitest/utils": "4.1.11", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz", + "integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz", + "integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz", + "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansis": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", + "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "license": "MIT", + "peer": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", + "license": "MIT", + "peer": true, + "dependencies": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT", + "peer": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT", + "peer": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/ejs": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz", + "integrity": "sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.12.18" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "peer": true + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT", + "peer": true + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "peer": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", + "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "license": "MIT", + "peer": true, + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/lru-cache": { + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.19", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", + "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT", + "peer": true + }, + "node_modules/path-equal": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.8.tgz", + "integrity": "sha512-rCJWMlXlk9lZ2FEllgvh2IgPj/kxMx2sOeqtFNLO8dxEY0I4hBTa+ZW3JAsgeiTe8vL4MifATVDwxF9nGUI7HQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", + "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.18", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/powershell-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz", + "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/protobufjs": { + "version": "7.6.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz", + "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.1", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "license": "MIT", + "peer": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT", + "peer": true + }, + "node_modules/rolldown": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.8.tgz", + "integrity": "sha512-Z67nTmhZe7anqnM/EjI392w5i/ANUinjip7QYsOyN37oayduxt3ksdX0hf5OOamkAd53BiIHfbfSzfUmzKFQqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.149.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.8", + "@rolldown/binding-android-arm64": "1.2.8", + "@rolldown/binding-darwin-arm64": "1.2.8", + "@rolldown/binding-darwin-x64": "1.2.8", + "@rolldown/binding-freebsd-x64": "1.2.8", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.8", + "@rolldown/binding-linux-arm64-gnu": "1.2.8", + "@rolldown/binding-linux-arm64-musl": "1.2.8", + "@rolldown/binding-linux-ppc64-gnu": "1.2.8", + "@rolldown/binding-linux-s390x-gnu": "1.2.8", + "@rolldown/binding-linux-x64-gnu": "1.2.8", + "@rolldown/binding-linux-x64-musl": "1.2.8", + "@rolldown/binding-openharmony-arm64": "1.2.8", + "@rolldown/binding-win32-arm64-msvc": "1.2.8", + "@rolldown/binding-win32-x64-msvc": "1.2.8" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/slice-ansi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-camel-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-camel-case/-/text-camel-case-1.2.11.tgz", + "integrity": "sha512-2ZsM/gOlB1tyza+8lGLvs6gtPuZ9qEYuKPa+gwo38m65wkY4k323SK4hT7ku8r5wIKyspUYIWSk1aB9/Jjxr7A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-pascal-case": "^1.2.11" + } + }, + "node_modules/text-capital-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-capital-case/-/text-capital-case-1.2.11.tgz", + "integrity": "sha512-30A7B7+VUvevEmPE0xWK1Z2z0ncl/JTjSUBLfjpoXrkwuPpmNTVbjHShRTN3cX9GIuZn/P3jvR+TO9JiTZcl8A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-case/-/text-case-1.2.11.tgz", + "integrity": "sha512-LbdWNQeuXWbfav+pxBxvaefkziffMYeSA53BHp52cgJa9rjiC0dkjum9AKrH8iQWoQJ4InGPSGexLeerGFaZ1Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-camel-case": "^1.2.11", + "text-capital-case": "^1.2.11", + "text-constant-case": "^1.2.11", + "text-dot-case": "^1.2.11", + "text-header-case": "^1.2.11", + "text-is-lower-case": "^1.2.11", + "text-is-upper-case": "^1.2.11", + "text-kebab-case": "^1.2.11", + "text-lower-case": "^1.2.11", + "text-lower-case-first": "^1.2.11", + "text-no-case": "^1.2.11", + "text-param-case": "^1.2.11", + "text-pascal-case": "^1.2.11", + "text-path-case": "^1.2.11", + "text-sentence-case": "^1.2.11", + "text-snake-case": "^1.2.11", + "text-swap-case": "^1.2.11", + "text-title-case": "^1.2.11", + "text-upper-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-constant-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-constant-case/-/text-constant-case-1.2.11.tgz", + "integrity": "sha512-XnTBILsa7UpMWncUCchqIybZlg15FUcrlyNaWIJ8ybPy54qcoN513EXFswueyizuAgyJFXPCwwSFbSji6kw/Uw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case": "^1.2.11" + } + }, + "node_modules/text-dot-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-dot-case/-/text-dot-case-1.2.11.tgz", + "integrity": "sha512-7SLKiT45KZO0qad0+p+GvC0+F+6pZ851HJcTcBJiSF88HsK/e1qErlGLtVBT6hkTHIaAj48WfSyQr4lZRv1xJQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-header-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-header-case/-/text-header-case-1.2.11.tgz", + "integrity": "sha512-7OBHd2g7X+aH6rXMC3cANFh6yvhXjXkyumw2NaRwJRIk343pP2e1SQCTCfowPDmmi8wkZVqz1fdWNq5LwvcBOQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-capital-case": "^1.2.11" + } + }, + "node_modules/text-is-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-lower-case/-/text-is-lower-case-1.2.11.tgz", + "integrity": "sha512-dBqPAkNmX7eTM7ZbS3D/UBCQ5i9EXt5tujF2wIGGbZ1+aN8bY7Qda4mDpxgd6Hbzf/z10uQWRNzupl99wFQ8CQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-is-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-upper-case/-/text-is-upper-case-1.2.11.tgz", + "integrity": "sha512-MZeUIYEYfKZ2FSeg0vnHCH4mHXLgGzes+iz2K+4BYnhnkEa2svKA1nNjQAqTUiVNHOPqPCuzmUr1LsyQZ73uyA==", + "license": "MIT", + "peer": true + }, + "node_modules/text-kebab-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-kebab-case/-/text-kebab-case-1.2.11.tgz", + "integrity": "sha512-RIg9iN6VwH+JrX9dFdm1nd1efPGR9LjNc0CiQz496sQETeKGkDEzxES/ZzxbkerrAL2DFEMGdLXckzDz1OEDBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case/-/text-lower-case-1.2.11.tgz", + "integrity": "sha512-txTy6y0y8M23Lhf0mk8WcvXTqlf4OQ3AGnDsRB6o3uMNfIa0CJDol2s1PdKNa63rt5B2277zkZCCn6Xeq//big==", + "license": "MIT", + "peer": true + }, + "node_modules/text-lower-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case-first/-/text-lower-case-first-1.2.11.tgz", + "integrity": "sha512-QR483XLyuyIpq8tKu1ds3Q1jfsgfaa/p9rtoQKHe6Rv5ah9ic/SUzTGN0MQ7UIS9APADd8SUPn5TTh1Z2/ACyg==", + "license": "MIT", + "peer": true + }, + "node_modules/text-no-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-no-case/-/text-no-case-1.2.11.tgz", + "integrity": "sha512-wazS7FEq0Ct3aJzeE8MEMcSs0eW4+/X/fwdotv/rG66bLS+g1T0pa0gUsbBGjjLFs191AIXVIry+bYE0uaaBBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-lower-case": "^1.2.11" + } + }, + "node_modules/text-param-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-param-case/-/text-param-case-1.2.11.tgz", + "integrity": "sha512-3EMMAMLSz/mJXOnATNnrS+dZAvghpq09VhOVYDOkUnbm5zlYc6iU5AZOKVDpiAVVllQ9P1h5IKVZzsEYrdIRGw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-pascal-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-pascal-case/-/text-pascal-case-1.2.11.tgz", + "integrity": "sha512-BNhQ1O/g/Q4dH5gPyLIJLDLDknl2dipBwV629ScsiZCKJaCLGXYhTXp23rp9Htg3O5OSSsiU3mqDKq+pBmwTSw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-path-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-path-case/-/text-path-case-1.2.11.tgz", + "integrity": "sha512-FsJU4BmMdtLtmnBK/XRJPqTwLF8yFiTEClHjxlQjSAG5Xt9R4p6D1WNaM1CI2dG5Lr4rsFM4jiVC620m0AsRbw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-sentence-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-sentence-case/-/text-sentence-case-1.2.11.tgz", + "integrity": "sha512-ApiVsvdLy+Wb8x7mZRVuoy8VO12jJ22G2djVM3ZZbUhXVIkqGgHxmiXRwdhRPoWGojK9n53m7jviJgBVNdRn+g==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-snake-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-snake-case/-/text-snake-case-1.2.11.tgz", + "integrity": "sha512-NOEQvjyyVABB41SS8dUx423Y6hWS+Z4TrAAJg1xzCkOD3q9y0JtdJjCvCA1FWI8oDu+HiIOp/N446uDM8j54XQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-swap-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-swap-case/-/text-swap-case-1.2.11.tgz", + "integrity": "sha512-PBmC5xvZdDZ4suikydpeXH0s4JV2XHelMj9/OEXEbA3oLpdV2A+B4BspVDWVw7C2Gi5eCareqk/7EE8I1/WwgQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-title-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-title-case/-/text-title-case-1.2.11.tgz", + "integrity": "sha512-V1GZy0XlqdkYUQm0tqm1jqtYlXJqFVMreBCTUReOaz8d/JbozTSpZrcakIeV8+1bN7LsvfhPFhA5zREiax6YIA==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case/-/text-upper-case-1.2.11.tgz", + "integrity": "sha512-BfTL7yB1YIRlVGNdZUvno013hOq2cRs07fDR2ApppOXRDuKrEmsLDEY82xXlDzQHELp0jexqkI+NeyPIl6MtMw==", + "license": "MIT", + "peer": true + }, + "node_modules/text-upper-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case-first/-/text-upper-case-first-1.2.11.tgz", + "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", + "license": "MIT", + "peer": true + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz", + "integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ts-morph": { + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", + "integrity": "sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@ts-morph/common": "~0.29.0", + "code-block-writer": "^13.0.3" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "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" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-to-zod": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-5.1.0.tgz", + "integrity": "sha512-giqqlvRHunlJqG9tBL/KAO3wWIVZGF//mZiWLKm/fdQnKnz4EN2mtiK5cugN9slytBkdMEXQIaLvMzIScbhhFw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/prompts": "1.0.0-alpha.4", + "@oclif/core": "^4.5.4", + "@typescript/vfs": "^1.5.0", + "chokidar": "^4.0.3", + "listr2": "^9.0.4", + "slash": "^5.1.0", + "text-case": "^1.2.4", + "tslib": "^2.3.1", + "tsutils": "^3.21.0", + "typescript": "^5.2.2", + "zod": "^4.1.5" + }, + "bin": { + "ts-to-zod": "bin/run" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "peer": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD", + "peer": true + }, + "node_modules/tsx": { + "version": "4.23.13", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.13.tgz", + "integrity": "sha512-BL5MGkRln6aDYhb0xbQlEAGw743BaZYWdbWtdJOBriYJboKgUUYCadFp2/FpBBZquBC/ezNBn7wMMPx7FDZUDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-json-schema": { + "version": "0.68.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.68.0.tgz", + "integrity": "sha512-1X60xXxkZpLAr125Jt5MT9VJTTxT0xfafbjdcbtml26nvpUr2p/P4V34JEXa+ObrHc71W9ksH5pemstY6y+SEw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@types/json-schema": "^7.0.15", + "@types/node": "^24.10.2", + "glob": "^13.0.6", + "path-equal": "^1.2.5", + "safe-stable-stringify": "^2.5.0", + "ts-node": "^10.9.2", + "typescript": "~5.9.3", + "yargs": "^18.0.0" + }, + "bin": { + "typescript-json-schema": "bin/typescript-json-schema" + } + }, + "node_modules/typescript-json-schema/node_modules/@types/node": { + "version": "24.13.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.4.tgz", + "integrity": "sha512-YJ7EqCstVTzIr0fMr7qul/977en+pQHrfmuKIo6Zr9i75Be21dr3MovcfvGtyvi2HAUrRerWps5sMO9I7WaxDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/typescript-json-schema/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/typescript-json-schema/node_modules/cliui/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-json-schema/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/typescript-json-schema/node_modules/string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-json-schema/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/typescript-json-schema/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/typescript-json-schema/node_modules/wrap-ansi/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript-json-schema/node_modules/yargs": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.1.0.tgz", + "integrity": "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^8.2.1", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/typescript-json-schema/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.0.tgz", + "integrity": "sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.28", + "rolldown": "~1.2.6", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz", + "integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.11", + "@vitest/mocker": "4.1.11", + "@vitest/pretty-format": "4.1.11", + "@vitest/runner": "4.1.11", + "@vitest/snapshot": "4.1.11", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.11", + "@vitest/browser-preview": "4.1.11", + "@vitest/browser-webdriverio": "4.1.11", + "@vitest/coverage-istanbul": "4.1.11", + "@vitest/coverage-v8": "4.1.11", + "@vitest/ui": "4.1.11", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "license": "MIT", + "peer": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "license": "MIT", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wsl-utils": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.4.0.tgz", + "integrity": "sha512-9YmF+2sFEd+T7TkwlmE337F0IVzfDvDknhtpBQxxXzEOfgPphGlFYpyx0cTuCIFj8/p+sqwBYAeGxOMNSzPPDA==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-wsl": "^3.1.0", + "powershell-utils": "^0.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "peer": true, + "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" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-ts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-2.1.0.tgz", + "integrity": "sha512-jZP1GokTqR99FLmtGU+B9acjD9u/R++b++Vxe1sWpBQDd82/9/j5LyLZZ7/Oy3h2nxcz5NihikgX4D0hhdu3+g==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": "^5 || ^6", + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/actions/notion-action/package.json b/actions/notion-action/package.json new file mode 100644 index 0000000..0ea2921 --- /dev/null +++ b/actions/notion-action/package.json @@ -0,0 +1,31 @@ +{ + "name": "@code0-tech/notion-action", + "version": "1.0.0", + "private": true, + "type": "module", + "main": "dist/index.js", + "scripts": { + "dev": "tsx watch src/index.ts", + "typecheck": "tsc --noEmit", + "generate:notion-schemas": "node scripts/generate-openapi.mjs && node ../../scripts/openapi-to-zod.mjs schemas/notion-openapi.json src/generated/notion-schemas.ts", + "build": "vite build", + "test": "vitest run", + "test:watch": "vitest", + "start": "node --env-file-if-exists=.env dist/index.js" + }, + "dependencies": { + "@code0-tech/hercules": "^1.9.0", + "@code0-tech/tucana": "^0.0.86", + "@notionhq/client": "^5.31.1", + "reflect-metadata": "^0.2.2", + "zod": "4.4.3" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "typescript-json-schema": "0.68.0", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } +} diff --git a/actions/notion-action/schemas/notion-openapi.json b/actions/notion-action/schemas/notion-openapi.json new file mode 100644 index 0000000..0173ee7 --- /dev/null +++ b/actions/notion-action/schemas/notion-openapi.json @@ -0,0 +1,4518 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Notion action schemas", + "version": "2025-09-03", + "description": "Generated from @notionhq/client 5.31.1. The public Notion MCP OpenAPI spec lacks complete response schemas; these components are derived from the official SDK instead. Do not edit by hand.", + "license": { + "name": "MIT", + "url": "https://github.com/makenotion/notion-sdk-js/blob/main/LICENSE" + } + }, + "x-source": { + "package": "@notionhq/client", + "version": "5.31.1", + "aliases": "schemas/notion-types.ts" + }, + "paths": {}, + "components": { + "schemas": { + "ApiColor": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`, `default_background`, `gray_background`, `brown_background`,\n`orange_background`, `yellow_background`, `green_background`, `blue_background`,\n`purple_background`, `pink_background`, `red_background`", + "enum": [ + "blue", + "blue_background", + "brown", + "brown_background", + "default", + "default_background", + "gray", + "gray_background", + "green", + "green_background", + "orange", + "orange_background", + "pink", + "pink_background", + "purple", + "purple_background", + "red", + "red_background", + "yellow", + "yellow_background" + ], + "type": "string" + }, + "EmptyObject": { + "type": "object", + "additionalProperties": false + }, + "NoticonColor": { + "description": "One of: `gray`, `lightgray`, `brown`, `yellow`, `orange`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "gray", + "green", + "lightgray", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "NotionDatabase": { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "database" + }, + "id": { + "type": "string" + }, + "title": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "description": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "parent": { + "$ref": "#/components/schemas/ParentOfDatabaseResponse" + }, + "is_inline": { + "type": "boolean" + }, + "database_type": { + "anyOf": [ + { + "enum": [ + "docs", + "github_prs", + "meeting_notes", + "meetings", + "projects", + "skills", + "sprints", + "tasks", + "wiki" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "is_locked": { + "type": "boolean" + }, + "show_data_source_title": { + "type": "boolean" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "data_sources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + } + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "cover", + "created_time", + "data_sources", + "description", + "icon", + "id", + "in_trash", + "is_inline", + "last_edited_time", + "object", + "parent", + "public_url", + "title", + "url" + ] + }, + "NotionPage": { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "page" + }, + "id": { + "type": "string" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "is_archived": { + "type": "boolean" + }, + "is_locked": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + }, + "parent": { + "$ref": "#/components/schemas/ParentForBlockBasedObjectResponse" + }, + "properties": { + "$ref": "#/components/schemas/Record_string_PagePropertyValueWithIdResponse_" + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "last_edited_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + } + }, + "required": [ + "cover", + "created_by", + "created_time", + "icon", + "id", + "in_trash", + "last_edited_by", + "last_edited_time", + "object", + "parent", + "properties", + "public_url", + "url" + ] + }, + "NotionProperties": { + "$ref": "#/components/schemas/PagePropertiesRequest" + }, + "NotionPropertyValue": { + "anyOf": [ + { + "type": "object", + "properties": { + "title": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemRequest" + } + }, + "type": { + "const": "title", + "type": "string" + } + }, + "required": [ + "title" + ] + }, + { + "type": "object", + "properties": { + "rich_text": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemRequest" + } + }, + "type": { + "const": "rich_text", + "type": "string" + } + }, + "required": [ + "rich_text" + ] + }, + { + "type": "object", + "properties": { + "number": { + "type": [ + "null", + "number" + ] + }, + "type": { + "const": "number", + "type": "string" + } + }, + "required": [ + "number" + ] + }, + { + "type": "object", + "properties": { + "url": { + "type": [ + "null", + "string" + ] + }, + "type": { + "const": "url", + "type": "string" + } + }, + "required": [ + "url" + ] + }, + { + "type": "object", + "properties": { + "select": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "id" + ] + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "name" + ] + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "select", + "type": "string" + } + }, + "required": [ + "select" + ] + }, + { + "type": "object", + "properties": { + "multi_select": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "id" + ] + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "name" + ] + } + ] + } + }, + "type": { + "const": "multi_select", + "type": "string" + } + }, + "required": [ + "multi_select" + ] + }, + { + "type": "object", + "properties": { + "people": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "object": { + "const": "group", + "type": "string" + } + }, + "required": [ + "id" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "const": "user", + "type": "string" + } + }, + "required": [ + "id" + ] + } + ] + } + }, + "type": { + "const": "people", + "type": "string" + } + }, + "required": [ + "people" + ] + }, + { + "type": "object", + "properties": { + "email": { + "type": [ + "null", + "string" + ] + }, + "type": { + "const": "email", + "type": "string" + } + }, + "required": [ + "email" + ] + }, + { + "type": "object", + "properties": { + "phone_number": { + "type": [ + "null", + "string" + ] + }, + "type": { + "const": "phone_number", + "type": "string" + } + }, + "required": [ + "phone_number" + ] + }, + { + "type": "object", + "properties": { + "date": { + "anyOf": [ + { + "type": "object", + "properties": { + "start": { + "type": "string" + }, + "end": { + "type": [ + "null", + "string" + ] + }, + "time_zone": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "start" + ] + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "date", + "type": "string" + } + }, + "required": [ + "date" + ] + }, + { + "type": "object", + "properties": { + "checkbox": { + "type": "boolean" + }, + "type": { + "const": "checkbox", + "type": "string" + } + }, + "required": [ + "checkbox" + ] + }, + { + "type": "object", + "properties": { + "relation": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "type": { + "const": "relation", + "type": "string" + } + }, + "required": [ + "relation" + ] + }, + { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "file_upload": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "type": { + "const": "file_upload", + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "file_upload" + ] + }, + { + "type": "object", + "properties": { + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + "name": { + "type": "string" + }, + "type": { + "const": "file", + "type": "string" + } + }, + "required": [ + "file", + "name" + ] + }, + { + "type": "object", + "properties": { + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + "name": { + "type": "string" + }, + "type": { + "const": "external", + "type": "string" + } + }, + "required": [ + "external", + "name" + ] + } + ] + } + }, + "type": { + "const": "files", + "type": "string" + } + }, + "required": [ + "files" + ] + }, + { + "type": "object", + "properties": { + "status": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "id" + ] + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`", + "enum": [ + "blue", + "brown", + "default", + "gray", + "green", + "orange", + "pink", + "purple", + "red", + "yellow" + ], + "type": "string" + }, + "description": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "name" + ] + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "status", + "type": "string" + } + }, + "required": [ + "status" + ] + }, + { + "type": "object", + "properties": { + "place": { + "anyOf": [ + { + "type": "object", + "properties": { + "lat": { + "type": "number" + }, + "lon": { + "type": "number" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "address": { + "type": [ + "null", + "string" + ] + }, + "aws_place_id": { + "type": [ + "null", + "string" + ] + }, + "google_place_id": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "lat", + "lon" + ] + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "place", + "type": "string" + } + }, + "required": [ + "place" + ] + }, + { + "type": "object", + "properties": { + "verification": { + "anyOf": [ + { + "type": "object", + "properties": { + "state": { + "type": "string", + "const": "verified" + }, + "date": { + "type": "object", + "properties": { + "start": { + "type": "string" + }, + "end": { + "type": [ + "null", + "string" + ] + }, + "time_zone": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "start" + ] + } + }, + "required": [ + "state" + ] + }, + { + "type": "object", + "properties": { + "state": { + "type": "string", + "const": "unverified" + } + }, + "required": [ + "state" + ] + } + ] + }, + "type": { + "const": "verification", + "type": "string" + } + }, + "required": [ + "verification" + ] + } + ] + }, + "NotionQueryResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page_or_data_source" + }, + "page_or_data_source": { + "$ref": "#/components/schemas/EmptyObject" + }, + "object": { + "type": "string", + "const": "list" + }, + "next_cursor": { + "type": [ + "null", + "string" + ] + }, + "has_more": { + "type": "boolean" + }, + "results": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "page" + }, + "id": { + "type": "string" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "is_archived": { + "type": "boolean" + }, + "is_locked": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + }, + "parent": { + "$ref": "#/components/schemas/ParentForBlockBasedObjectResponse" + }, + "properties": { + "$ref": "#/components/schemas/Record_string_PagePropertyValueWithIdResponse_" + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "last_edited_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + } + }, + "required": [ + "cover", + "created_by", + "created_time", + "icon", + "id", + "in_trash", + "last_edited_by", + "last_edited_time", + "object", + "parent", + "properties", + "public_url", + "url" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "page" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id", + "object" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "data_source" + }, + "id": { + "type": "string" + }, + "title": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "description": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "parent": { + "$ref": "#/components/schemas/ParentOfDataSourceResponse" + }, + "database_parent": { + "$ref": "#/components/schemas/ParentOfDatabaseResponse" + }, + "is_inline": { + "type": "boolean" + }, + "database_type": { + "anyOf": [ + { + "enum": [ + "docs", + "github_prs", + "meeting_notes", + "meetings", + "projects", + "skills", + "sprints", + "tasks", + "wiki" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "last_edited_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "properties": { + "$ref": "#/components/schemas/Record_string_DatabasePropertyConfigResponse_" + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "cover", + "created_by", + "created_time", + "database_parent", + "description", + "icon", + "id", + "in_trash", + "is_inline", + "last_edited_by", + "last_edited_time", + "object", + "parent", + "properties", + "public_url", + "title", + "url" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "data_source" + }, + "id": { + "type": "string" + }, + "properties": { + "$ref": "#/components/schemas/Record_string_DatabasePropertyConfigResponse_" + } + }, + "required": [ + "id", + "object", + "properties" + ] + } + ] + } + }, + "request_status": { + "type": "object", + "properties": { + "type": { + "enum": [ + "complete", + "incomplete" + ], + "type": "string" + }, + "incomplete_reason": { + "const": "query_result_limit_reached", + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "has_more", + "next_cursor", + "object", + "page_or_data_source", + "results", + "type" + ] + }, + "NotionRichText": { + "$ref": "#/components/schemas/RichTextItemRequest" + }, + "NotionSearchResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page_or_data_source" + }, + "page_or_data_source": { + "$ref": "#/components/schemas/EmptyObject" + }, + "object": { + "type": "string", + "const": "list" + }, + "next_cursor": { + "type": [ + "null", + "string" + ] + }, + "has_more": { + "type": "boolean" + }, + "results": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "page" + }, + "id": { + "type": "string" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "is_archived": { + "type": "boolean" + }, + "is_locked": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + }, + "parent": { + "$ref": "#/components/schemas/ParentForBlockBasedObjectResponse" + }, + "properties": { + "$ref": "#/components/schemas/Record_string_PagePropertyValueWithIdResponse_" + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "last_edited_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + } + }, + "required": [ + "cover", + "created_by", + "created_time", + "icon", + "id", + "in_trash", + "last_edited_by", + "last_edited_time", + "object", + "parent", + "properties", + "public_url", + "url" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "page" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id", + "object" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "data_source" + }, + "id": { + "type": "string" + }, + "title": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "description": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RichTextItemResponse" + } + }, + "parent": { + "$ref": "#/components/schemas/ParentOfDataSourceResponse" + }, + "database_parent": { + "$ref": "#/components/schemas/ParentOfDatabaseResponse" + }, + "is_inline": { + "type": "boolean" + }, + "database_type": { + "anyOf": [ + { + "enum": [ + "docs", + "github_prs", + "meeting_notes", + "meetings", + "projects", + "skills", + "sprints", + "tasks", + "wiki" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "in_trash": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "created_time": { + "x-hercules-schema": "dateSchema" + }, + "last_edited_time": { + "x-hercules-schema": "dateSchema" + }, + "created_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "last_edited_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + "properties": { + "$ref": "#/components/schemas/Record_string_DatabasePropertyConfigResponse_" + }, + "icon": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "emoji" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "emoji", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "icon" + }, + "icon": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "color": { + "$ref": "#/components/schemas/NoticonColor" + } + }, + "required": [ + "color", + "name" + ] + } + }, + "required": [ + "icon", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "cover": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "external" + }, + "external": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "external", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "file" + }, + "file": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "expiry_time": { + "x-hercules-schema": "dateSchema" + } + }, + "required": [ + "expiry_time", + "url" + ] + } + }, + "required": [ + "file", + "type" + ] + }, + { + "type": "null" + } + ] + }, + "url": { + "type": "string" + }, + "public_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "cover", + "created_by", + "created_time", + "database_parent", + "description", + "icon", + "id", + "in_trash", + "is_inline", + "last_edited_by", + "last_edited_time", + "object", + "parent", + "properties", + "public_url", + "title", + "url" + ] + }, + { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "data_source" + }, + "id": { + "type": "string" + }, + "properties": { + "$ref": "#/components/schemas/Record_string_DatabasePropertyConfigResponse_" + } + }, + "required": [ + "id", + "object", + "properties" + ] + } + ] + } + }, + "request_status": { + "type": "object", + "properties": { + "type": { + "enum": [ + "complete", + "incomplete" + ], + "type": "string" + }, + "incomplete_reason": { + "const": "query_result_limit_reached", + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "has_more", + "next_cursor", + "object", + "page_or_data_source", + "results", + "type" + ] + }, + "NotionUser": { + "$ref": "#/components/schemas/UserObjectResponse" + }, + "PagePropertiesRequest": { + "type": "object" + }, + "ParentForBlockBasedObjectResponse": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "agent_id" + }, + "agent_id": { + "type": "string" + } + }, + "required": [ + "agent_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "block_id" + }, + "block_id": { + "type": "string" + } + }, + "required": [ + "block_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "data_source_id" + }, + "data_source_id": { + "type": "string" + }, + "database_id": { + "type": "string" + } + }, + "required": [ + "data_source_id", + "database_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "database_id" + }, + "database_id": { + "type": "string" + } + }, + "required": [ + "database_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page_id" + }, + "page_id": { + "type": "string" + } + }, + "required": [ + "page_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "workspace" + }, + "workspace": { + "type": "boolean", + "const": true + } + }, + "required": [ + "type", + "workspace" + ] + } + ] + }, + "ParentOfDataSourceResponse": { + "description": "The parent of the data source. This is typically a database (`database_id`), but for\nexternally synced data sources, can be another data source (`data_source_id`).", + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "data_source_id" + }, + "data_source_id": { + "type": "string" + }, + "database_id": { + "type": "string" + } + }, + "required": [ + "data_source_id", + "database_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "database_id" + }, + "database_id": { + "type": "string" + } + }, + "required": [ + "database_id", + "type" + ] + } + ] + }, + "ParentOfDatabaseResponse": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "block_id" + }, + "block_id": { + "type": "string" + } + }, + "required": [ + "block_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "database_id" + }, + "database_id": { + "type": "string" + } + }, + "required": [ + "database_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page_id" + }, + "page_id": { + "type": "string" + } + }, + "required": [ + "page_id", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "workspace" + }, + "workspace": { + "type": "boolean", + "const": true + } + }, + "required": [ + "type", + "workspace" + ] + } + ] + }, + "Record_string_DatabasePropertyConfigResponse_": { + "type": "object" + }, + "Record_string_PagePropertyValueWithIdResponse_": { + "type": "object" + }, + "RichTextItemRequest": { + "anyOf": [ + { + "allOf": [ + { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`, `default_background`, `gray_background`, `brown_background`,\n`orange_background`, `yellow_background`, `green_background`, `blue_background`,\n`purple_background`, `pink_background`, `red_background`", + "enum": [ + "blue", + "blue_background", + "brown", + "brown_background", + "default", + "default_background", + "gray", + "gray_background", + "green", + "green_background", + "orange", + "orange_background", + "pink", + "pink_background", + "purple", + "purple_background", + "red", + "red_background", + "yellow", + "yellow_background" + ], + "type": "string" + } + } + } + } + }, + { + "type": "object", + "properties": { + "type": { + "const": "text", + "type": "string" + }, + "text": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "link": { + "anyOf": [ + { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "text" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`, `default_background`, `gray_background`, `brown_background`,\n`orange_background`, `yellow_background`, `green_background`, `blue_background`,\n`purple_background`, `pink_background`, `red_background`", + "enum": [ + "blue", + "blue_background", + "brown", + "brown_background", + "default", + "default_background", + "gray", + "gray_background", + "green", + "green_background", + "orange", + "orange_background", + "pink", + "pink_background", + "purple", + "purple_background", + "red", + "red_background", + "yellow", + "yellow_background" + ], + "type": "string" + } + } + } + } + }, + { + "type": "object", + "properties": { + "type": { + "const": "mention", + "type": "string" + }, + "mention": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "const": "user", + "type": "string" + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "const": "user", + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "user" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "date", + "type": "string" + }, + "date": { + "type": "object", + "properties": { + "start": { + "type": "string" + }, + "end": { + "type": [ + "null", + "string" + ] + }, + "time_zone": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "start" + ] + } + }, + "required": [ + "date" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "page", + "type": "string" + }, + "page": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "page" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "database", + "type": "string" + }, + "database": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "database" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "template_mention", + "type": "string" + }, + "template_mention": { + "$ref": "#/components/schemas/TemplateMentionRequest" + } + }, + "required": [ + "template_mention" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "custom_emoji", + "type": "string" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "custom_emoji" + ] + } + ] + } + }, + "required": [ + "mention" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "description": "One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,\n`pink`, `red`, `default_background`, `gray_background`, `brown_background`,\n`orange_background`, `yellow_background`, `green_background`, `blue_background`,\n`purple_background`, `pink_background`, `red_background`", + "enum": [ + "blue", + "blue_background", + "brown", + "brown_background", + "default", + "default_background", + "gray", + "gray_background", + "green", + "green_background", + "orange", + "orange_background", + "pink", + "pink_background", + "purple", + "purple_background", + "red", + "red_background", + "yellow", + "yellow_background" + ], + "type": "string" + } + } + } + } + }, + { + "type": "object", + "properties": { + "type": { + "const": "equation", + "type": "string" + }, + "equation": { + "type": "object", + "properties": { + "expression": { + "type": "string" + } + }, + "required": [ + "expression" + ] + } + }, + "required": [ + "equation" + ] + } + ] + } + ] + }, + "RichTextItemResponse": { + "anyOf": [ + { + "allOf": [ + { + "type": "object", + "properties": { + "plain_text": { + "type": "string" + }, + "href": { + "type": [ + "null", + "string" + ] + }, + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/ApiColor" + } + }, + "required": [ + "bold", + "code", + "color", + "italic", + "strikethrough", + "underline" + ] + } + }, + "required": [ + "annotations", + "href", + "plain_text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "equation" + }, + "equation": { + "type": "object", + "properties": { + "expression": { + "type": "string" + } + }, + "required": [ + "expression" + ] + } + }, + "required": [ + "equation", + "type" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "plain_text": { + "type": "string" + }, + "href": { + "type": [ + "null", + "string" + ] + }, + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/ApiColor" + } + }, + "required": [ + "bold", + "code", + "color", + "italic", + "strikethrough", + "underline" + ] + } + }, + "required": [ + "annotations", + "href", + "plain_text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "mention" + }, + "mention": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "user" + }, + "user": { + "$ref": "#/components/schemas/UserValueResponse" + } + }, + "required": [ + "type", + "user" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "date" + }, + "date": { + "type": "object", + "properties": { + "start": { + "type": "string" + }, + "end": { + "type": [ + "null", + "string" + ] + }, + "time_zone": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "end", + "start", + "time_zone" + ] + } + }, + "required": [ + "date", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "link_preview" + }, + "link_preview": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + } + }, + "required": [ + "link_preview", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "link_mention" + }, + "link_mention": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "link_author": { + "type": "string" + }, + "link_provider": { + "type": "string" + }, + "thumbnail_url": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "iframe_url": { + "type": "string" + }, + "height": { + "type": "number" + }, + "padding": { + "type": "number" + }, + "padding_top": { + "type": "number" + } + }, + "required": [ + "href" + ] + } + }, + "required": [ + "link_mention", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "page" + }, + "page": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "page", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "database" + }, + "database": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "database", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "template_mention" + }, + "template_mention": { + "$ref": "#/components/schemas/TemplateMentionResponse" + } + }, + "required": [ + "template_mention", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "custom_emoji" + }, + "custom_emoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "url" + ] + } + }, + "required": [ + "custom_emoji", + "type" + ] + } + ] + } + }, + "required": [ + "mention", + "type" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "plain_text": { + "type": "string" + }, + "href": { + "type": [ + "null", + "string" + ] + }, + "annotations": { + "type": "object", + "properties": { + "bold": { + "type": "boolean" + }, + "italic": { + "type": "boolean" + }, + "strikethrough": { + "type": "boolean" + }, + "underline": { + "type": "boolean" + }, + "code": { + "type": "boolean" + }, + "color": { + "$ref": "#/components/schemas/ApiColor" + } + }, + "required": [ + "bold", + "code", + "color", + "italic", + "strikethrough", + "underline" + ] + } + }, + "required": [ + "annotations", + "href", + "plain_text" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "link": { + "anyOf": [ + { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "content", + "link" + ] + } + }, + "required": [ + "text", + "type" + ] + } + ] + } + ] + }, + "TemplateMentionRequest": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "const": "template_mention_date", + "type": "string" + }, + "template_mention_date": { + "enum": [ + "now", + "today" + ], + "type": "string" + } + }, + "required": [ + "template_mention_date" + ] + }, + { + "type": "object", + "properties": { + "type": { + "const": "template_mention_user", + "type": "string" + }, + "template_mention_user": { + "type": "string", + "const": "me" + } + }, + "required": [ + "template_mention_user" + ] + } + ] + }, + "TemplateMentionResponse": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "template_mention_date" + }, + "template_mention_date": { + "enum": [ + "now", + "today" + ], + "type": "string" + } + }, + "required": [ + "template_mention_date", + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "template_mention_user" + }, + "template_mention_user": { + "type": "string", + "const": "me" + } + }, + "required": [ + "template_mention_user", + "type" + ] + } + ] + }, + "UserObjectResponse": { + "anyOf": [ + { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "person" + }, + "person": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "email_verified": { + "type": "boolean" + } + } + } + }, + "required": [ + "person", + "type" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "bot" + }, + "bot": { + "anyOf": [ + { + "type": "object", + "properties": { + "owner": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "user" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + }, + "type": { + "type": "string", + "const": "person" + }, + "person": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "email_verified": { + "type": "boolean" + } + } + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object", + "person", + "type" + ] + } + ] + } + }, + "required": [ + "type", + "user" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "workspace" + }, + "workspace": { + "type": "boolean", + "const": true + } + }, + "required": [ + "type", + "workspace" + ] + } + ] + }, + "workspace_id": { + "type": "string" + }, + "workspace_limits": { + "type": "object", + "properties": { + "max_file_upload_size_in_bytes": { + "type": "number" + } + }, + "required": [ + "max_file_upload_size_in_bytes" + ] + }, + "workspace_name": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "owner", + "workspace_id", + "workspace_limits", + "workspace_name" + ] + }, + { + "$ref": "#/components/schemas/EmptyObject" + } + ] + } + }, + "required": [ + "bot", + "type" + ] + } + ] + } + ] + }, + "UserValueResponse": { + "anyOf": [ + { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "person" + }, + "person": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "email_verified": { + "type": "boolean" + } + } + } + }, + "required": [ + "person", + "type" + ] + } + ] + }, + { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "bot" + }, + "bot": { + "anyOf": [ + { + "type": "object", + "properties": { + "owner": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "user" + }, + "user": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "avatar_url": { + "type": [ + "null", + "string" + ] + }, + "type": { + "type": "string", + "const": "person" + }, + "person": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "email_verified": { + "type": "boolean" + } + } + } + }, + "required": [ + "avatar_url", + "id", + "name", + "object", + "person", + "type" + ] + } + ] + } + }, + "required": [ + "type", + "user" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "workspace" + }, + "workspace": { + "type": "boolean", + "const": true + } + }, + "required": [ + "type", + "workspace" + ] + } + ] + }, + "workspace_id": { + "type": "string" + }, + "workspace_limits": { + "type": "object", + "properties": { + "max_file_upload_size_in_bytes": { + "type": "number" + } + }, + "required": [ + "max_file_upload_size_in_bytes" + ] + }, + "workspace_name": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "owner", + "workspace_id", + "workspace_limits", + "workspace_name" + ] + }, + { + "$ref": "#/components/schemas/EmptyObject" + } + ] + } + }, + "required": [ + "bot", + "type" + ] + } + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "const": "user" + } + }, + "required": [ + "id", + "object" + ] + } + ] + } + } + } +} diff --git a/actions/notion-action/schemas/notion-types.ts b/actions/notion-action/schemas/notion-types.ts new file mode 100644 index 0000000..01d7c2d --- /dev/null +++ b/actions/notion-action/schemas/notion-types.ts @@ -0,0 +1,16 @@ +// Source aliases only: every API shape comes from the pinned official SDK. +// These aliases are converted into OpenAPI components before Zod generation. +import type { + CreatePageParameters, DatabaseObjectResponse, PageObjectResponse, + QueryDataSourceResponse, SearchResponse, + UserObjectResponse, +} from "@notionhq/client/build/src/api-endpoints.js"; + +export type NotionPage = PageObjectResponse; +export type NotionDatabase = DatabaseObjectResponse; +export type NotionUser = UserObjectResponse; +export type NotionQueryResult = QueryDataSourceResponse; +export type NotionSearchResult = SearchResponse; +export type NotionProperties = NonNullable; +export type NotionPropertyValue = NotionProperties[string]; +export type NotionRichText = Extract["rich_text"][number]; diff --git a/actions/notion-action/scripts/generate-openapi.mjs b/actions/notion-action/scripts/generate-openapi.mjs new file mode 100644 index 0000000..0514a88 --- /dev/null +++ b/actions/notion-action/scripts/generate-openapi.mjs @@ -0,0 +1,108 @@ +import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { createRequire } from "node:module"; +import { buildGenerator, getProgramFromFiles } from "typescript-json-schema"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const require = createRequire(import.meta.url); +const sdk = JSON.parse(readFileSync(require.resolve("@notionhq/client/package.json"), "utf8")); +const aliases = resolve(root, "schemas/notion-types.ts"); +const roots = [...readFileSync(aliases, "utf8").matchAll(/export type (Notion\w+)\s*=/g)].map((match) => match[1]); +const program = getProgramFromFiles([aliases], { strictNullChecks: true, skipLibCheck: true }, root); +// Keep generic aliases expanded: aliasRef would turn nested Record +// instances into a reference to the unspecialized (empty) Record definition. +const generator = buildGenerator(program, { required: true, ref: true, aliasRef: false, topRef: true }); +if (!generator) throw new Error("Could not compile the official Notion SDK types."); +// typescript-json-schema drops the `never` index signature of the SDK's +// EmptyObject. Preserve its actual meaning: no keys are allowed. +generator.setSchemaOverride("EmptyObject", { type: "object", additionalProperties: false }); +const jsonSchema = generator.getSchemaForSymbols(roots); + +// JSON Schema draft-07 definitions map directly to OpenAPI 3.1 components. +// Normalize compiler-derived names to stable names supported by our shared +// generator, preserving every reference and nullable/union/recursive shape. +const definitions = jsonSchema.definitions ?? {}; +const names = new Map(Object.keys(definitions).sort().map((name) => [name, name.replace(/[^a-zA-Z0-9_]/g, "_")])); +if (new Set(names.values()).size !== names.size) throw new Error("OpenAPI component name collision."); +// The SDK types describe every Notion-Version at once: `archived` is only sent +// before 2026-03-11, while `is_archived`, `is_locked` and the newer database +// fields only appear in later versions. Keep them typed but optional, so a +// response for the pinned version is not rejected for lacking them. +const VERSION_DEPENDENT_FIELDS = new Set(["archived", "is_archived", "is_locked", "database_type", "show_data_source_title"]); +function normalize(value) { + if (Array.isArray(value)) return value.map(normalize); + if (value && typeof value === "object") { + return Object.fromEntries(Object.entries(value).filter(([key]) => key !== "$schema").map(([key, entry]) => { + if (key === "$ref") { + const name = decodeURIComponent(entry.replace(/^#\/definitions\//, "")).replace(/~1/g, "/").replace(/~0/g, "~"); + if (!names.has(name)) throw new Error(`Unresolved reference: ${entry}`); + return [key, `#/components/schemas/${names.get(name)}`]; + } + if (key === "required" && Array.isArray(entry)) { + return [key, entry.filter((field) => !VERSION_DEPENDENT_FIELDS.has(field))]; + } + return [key, normalize(entry)]; + })); + } + return value; +} +const schemas = Object.fromEntries([...names].map(([name, normalized]) => [normalized, normalize(definitions[name])])); +for (const name of roots) if (!schemas[name]) throw new Error(`Missing root schema: ${name}`); + +// Points in time Notion sends as ISO 8601 strings become hercules DATE values +// (Unix microseconds); the client converts them before validating a response. +// Only response components are typed this way: request shapes keep the strings +// Notion expects (e.g. a file property's `expiry_time`). +const DATE_FIELDS = ["created_time", "last_edited_time", "expiry_time", "start_time", "end_time"]; +const REQUEST_ROOTS = ["NotionProperties", "NotionPropertyValue", "NotionRichText"]; +const referencedBy = (name) => [...JSON.stringify(schemas[name]).matchAll(/"\$ref":"#\/components\/schemas\/([^"]+)"/g)].map((match) => match[1]); +const requestComponents = new Set(); +for (const pending = [...REQUEST_ROOTS]; pending.length;) { + const name = pending.pop(); + if (requestComponents.has(name)) continue; + requestComponents.add(name); + pending.push(...referencedBy(name)); +} +function markDates(value) { + if (Array.isArray(value)) return value.forEach(markDates); + if (!value || typeof value !== "object") return; + for (const field of DATE_FIELDS) { + const property = value.properties?.[field]; + if (property?.type === "string" && !property.enum && property.const === undefined) { + value.properties[field] = { "x-hercules-schema": "dateSchema" }; + } + } + Object.values(value).forEach(markDates); +} +for (const [name, schema] of Object.entries(schemas)) if (!requestComponents.has(name)) markDates(schema); +const spec = { + openapi: "3.1.0", + info: { + title: "Notion action schemas", version: "2025-09-03", + description: `Generated from @notionhq/client ${sdk.version}. The public Notion MCP OpenAPI spec lacks complete response schemas; these components are derived from the official SDK instead. Do not edit by hand.`, + license: { name: "MIT", url: "https://github.com/makenotion/notion-sdk-js/blob/main/LICENSE" }, + }, + "x-source": { package: sdk.name, version: sdk.version, aliases: "schemas/notion-types.ts" }, + paths: {}, + components: { schemas }, +}; +mkdirSync(resolve(root, "schemas"), { recursive: true }); +writeFileSync(resolve(root, "schemas/notion-openapi.json"), JSON.stringify(spec, null, 2) + "\n"); +// Register shared components before their consumers so Hercules exports named +// references instead of repeatedly expanding the full Notion object graph. +const order = []; +const visited = new Set(); +function visit(name) { + if (visited.has(name)) return; + visited.add(name); + for (const match of JSON.stringify(schemas[name]).matchAll(/"\$ref":"#\/components\/schemas\/([^"]+)"/g)) visit(match[1]); + order.push(name); +} +for (const name of Object.keys(schemas).sort()) visit(name); +mkdirSync(resolve(root, "src/generated"), { recursive: true }); +writeFileSync(resolve(root, "src/generated/notion-schema-order.ts"), + "// AUTO-GENERATED by scripts/generate-openapi.mjs. Do not edit.\n" + + `export const supportingSchemaNames = ${JSON.stringify(order.filter((name) => !roots.includes(name)), null, 2)} as const;\n` + + `export const notionDateFields = ${JSON.stringify(DATE_FIELDS)} as const;\n`); +console.log(`Generated ${names.size} OpenAPI components from ${sdk.name}@${sdk.version}`); diff --git a/actions/notion-action/src/client.ts b/actions/notion-action/src/client.ts new file mode 100644 index 0000000..bda1da0 --- /dev/null +++ b/actions/notion-action/src/client.ts @@ -0,0 +1,231 @@ +import { RuntimeError } from "@code0-tech/hercules"; +import { APIResponseError, Client, isNotionClientError, UnknownHTTPResponseError } from "@notionhq/client"; +import { z } from "zod"; +import { NotionPageSchema } from "./data_types/notionPage.js"; +import { schemas } from "./generated/notion-schemas.js"; +import { NotionSearchResultSchema } from "./data_types/notionSearchResult.js"; +import { notionDateFields } from "./generated/notion-schema-order.js"; + +const DATE_FIELDS = new Set(notionDateFields); + +/** An ISO 8601 timestamp as a hercules DATE: Unix microseconds (UTC). */ +export function toNotionDate(iso: string): number | string { + const milliseconds = Date.parse(iso); + // Unparseable values stay as they are and fail response validation. + return Number.isNaN(milliseconds) ? iso : milliseconds * 1000; +} + +/** + * Notion sends points in time as ISO 8601 strings, while the response data + * types declare them as DATE. Converts every known timestamp field in a + * response before it is validated. + */ +export function withNotionDates(value: unknown): unknown { + if (Array.isArray(value)) return value.map(withNotionDates); + if (!value || typeof value !== "object") return value; + return Object.fromEntries(Object.entries(value).map(([key, entry]) => [ + key, + DATE_FIELDS.has(key) && typeof entry === "string" ? toNotionDate(entry) : withNotionDates(entry), + ])); +} + +// Only the data source references are needed to resolve a database. +const DatabaseDataSourcesSchema = z.looseObject({ data_sources: z.array(z.looseObject({ id: z.string() })) }); +// Only the Markdown text of a page's content is used. +const PageMarkdownSchema = z.looseObject({ markdown: z.string() }); +/** + * The title column of a page, addressed by its ID: Notion gives the title + * column of every database and page the property ID "title", whatever its name. + */ +function titleProperty(title: string) { + return { title: { title: title ? [{ type: "text" as const, text: { content: title } }] : [] } }; +} + +function optionalText(value: unknown, code: string, message: string): string | undefined { + if (value == null || value === "") return undefined; + if (typeof value !== "string") throw new RuntimeError(code, message); + return value; +} + +// Request and response shapes differ between Notion versions (e.g. databases +// vs. data sources), so the version is pinned to the one the bundled SDK +// types and our schemas describe rather than being configurable. +export const NOTION_VERSION = "2025-09-03"; + +/** Validates the integration token a function or trigger was given. */ +export function notionCredentials(integrationToken: unknown) { + if (typeof integrationToken !== "string" || !integrationToken.trim()) { + throw new RuntimeError("NOTION_MISSING_TOKEN", "No Notion integration token given. Set the integration token to your secret_... or ntn_... token."); + } + return { token: integrationToken.trim(), version: NOTION_VERSION }; +} + +type SdkFilter = Parameters[0]["filter"]; +type SdkSorts = NonNullable[0]["sorts"]>; + +function notionId(id: string): string { + if (!id.trim()) throw new RuntimeError("NOTION_INVALID_ID", "A Notion page or database ID is required."); + // The SDK interpolates IDs into paths without encoding them itself. + return encodeURIComponent(id.trim()); +} + +export class NotionClient { + private readonly sdk: Client; + + constructor(integrationToken: string) { + const { token, version } = notionCredentials(integrationToken); + this.sdk = new Client({ + auth: token, + notionVersion: version, + timeoutMs: 30_000, + // Rate limits are retried below with a bounded Retry-After. + retry: false, + // Errors are sanitized below rather than logged with request details. + logger: () => {}, + fetch: (url, init) => fetch(url, { ...init, redirect: "error" }), + }); + } + + private async request(call: () => Promise, schema: z.ZodType): Promise { + for (let attempt = 0; ; attempt++) { + try { + return schema.parse(withNotionDates(await call())); + } catch (error) { + if (isNotionClientError(error)) { + const response = APIResponseError.isAPIResponseError(error) || UnknownHTTPResponseError.isUnknownHTTPResponseError(error) ? error : undefined; + const status = response?.status; + const retryAfter = Number(response?.headers instanceof Headers ? response.headers.get("retry-after") ?? 1 : 1); + if (status === 429 && attempt < 2 && Number.isFinite(retryAfter) && retryAfter >= 0 && retryAfter <= 60) { + await new Promise((resolve) => setTimeout(resolve, Math.max(1, retryAfter) * 1000)); + continue; + } + // Never forward raw SDK errors or response bodies into a flow. + throw new RuntimeError(status ? `NOTION_HTTP_${status}` : "NOTION_NETWORK_ERROR", + status ? `Notion returned HTTP ${status}. Check permissions, IDs and request values.` : "The Notion API request failed or timed out."); + } + if (error instanceof z.ZodError) { + throw new RuntimeError("NOTION_INVALID_RESPONSE", "Notion returned an unexpected response shape."); + } + throw new RuntimeError("NOTION_NETWORK_ERROR", "The Notion API request failed or timed out."); + } + } + } + + /** + * Creates a page with a title and optional content written as + * Notion-flavored Markdown (`markdown_version` v2, as v1 is deprecated): + * an entry if the parent is a database, otherwise a subpage of the parent page. + */ + async createPage(parentId: string, title: string, markdown?: string | null) { + if (typeof title !== "string") throw new RuntimeError("NOTION_INVALID_TITLE", "The title must be text."); + const content = optionalText(markdown, "NOTION_INVALID_MARKDOWN", "Page content must be Markdown text."); + const parent = await this.resolveParent(parentId); + return this.request(() => this.sdk.pages.create({ + parent, properties: titleProperty(title.trim()), + ...(content ? { markdown: content, markdown_version: "v2" as const } : {}), + }), NotionPageSchema); + } + + /** + * Changes the title and/or replaces the whole content of a page with + * Markdown (v2). Empty values leave the title or content unchanged. Child + * pages and databases are never deleted: Notion rejects such a replacement. + */ + async updatePage(pageId: string, title?: string | null, markdown?: string | null) { + const page_id = notionId(pageId); + const newTitle = optionalText(title, "NOTION_INVALID_TITLE", "The title must be text.")?.trim(); + const content = optionalText(markdown, "NOTION_INVALID_MARKDOWN", "Page content must be Markdown text."); + const page = newTitle + ? await this.request(() => this.sdk.pages.update({ page_id, properties: titleProperty(newTitle) }), NotionPageSchema) + : await this.request(() => this.sdk.pages.retrieve({ page_id }), NotionPageSchema); + if (content === undefined) return page; + const updated = await this.request(() => this.sdk.pages.updateMarkdown({ + page_id, markdown_version: "v2", type: "replace_content", replace_content: { new_str: content }, + }), PageMarkdownSchema); + return { ...page, markdown: updated.markdown }; + } + + /** Retrieves a page with its properties and its content as Notion-flavored Markdown (v2). */ + async getPage(pageId: string) { + const page_id = notionId(pageId); + const [page, content] = await Promise.all([ + this.request(() => this.sdk.pages.retrieve({ page_id }), NotionPageSchema), + this.request(() => this.sdk.pages.retrieveMarkdown({ page_id, markdown_version: "v2" }), PageMarkdownSchema), + ]); + return { ...page, markdown: content.markdown }; + } + + async archivePage(pageId: string): Promise { + const page_id = notionId(pageId); + const page = await this.request(() => this.sdk.pages.update({ page_id, in_trash: true }), NotionPageSchema); + return page.in_trash; + } + + /** + * Since Notion-Version 2025-09-03 a database is a container of data sources, + * and pages live in a data source. Flows keep addressing the database, so + * resolve its single data source; multi-source databases are ambiguous. + */ + async resolveDataSourceId(databaseId: string): Promise { + const database_id = notionId(databaseId); + const database = await this.request(() => this.sdk.databases.retrieve({ database_id }), DatabaseDataSourcesSchema); + if (database.data_sources.length !== 1) { + throw new RuntimeError(database.data_sources.length ? "NOTION_MULTIPLE_DATA_SOURCES" : "NOTION_NO_DATA_SOURCE", + database.data_sources.length + ? "The Notion database has several data sources. Use a database with a single data source." + : "The Notion database has no data source the integration can access."); + } + // Raw ID: callers encode it for paths, request bodies take it as is. + return database.data_sources[0].id; + } + + /** + * The parent of a new page: the data source of a database, or else a page. + * Notion answers the database lookup of a page ID with 400 (a page, not a + * database) or 404, so those fall back to the page; if the ID is no + * accessible page either, creating the page fails with Notion's error. + */ + private async resolveParent(parentId: string): Promise<{ data_source_id: string } | { page_id: string }> { + try { + return { data_source_id: await this.resolveDataSourceId(parentId) }; + } catch (error) { + if (error instanceof RuntimeError && (error.code === "NOTION_HTTP_400" || error.code === "NOTION_HTTP_404")) { + return { page_id: parentId.trim() }; + } + throw error; + } + } + + /** Queries all matching pages of a data source, in the given order (used by the triggers). */ + queryDataSource(dataSourceId: string, filter?: SdkFilter | null, sorts?: SdkSorts | null) { + const data_source_id = notionId(dataSourceId); + return this.paginate((start_cursor) => this.request(() => this.sdk.dataSources.query({ + data_source_id, + page_size: 100, ...(filter == null ? {} : { filter }), ...(sorts == null ? {} : { sorts }), + ...(start_cursor ? { start_cursor } : {}), + }), schemas.NotionQueryResult)); + } + + /** Searches page and database titles the integration can access. */ + search(query: string) { + return this.paginate((start_cursor) => this.request(() => this.sdk.search({ + query, page_size: 100, ...(start_cursor ? { start_cursor } : {}), + }), NotionSearchResultSchema)); + } + + private async paginate(fetchPage: (cursor?: string) => Promise): Promise { + const first = await fetchPage(); + const results = [...first.results]; + const cursors = new Set(); + let page = first; + while (page.has_more) { + if (!page.next_cursor || cursors.has(page.next_cursor)) { + throw new RuntimeError("NOTION_INVALID_CURSOR", "Notion returned a missing or repeated pagination cursor."); + } + cursors.add(page.next_cursor); + page = await fetchPage(page.next_cursor); + results.push(...page.results); + } + return { ...first, results, has_more: false, next_cursor: null }; + } +} diff --git a/actions/notion-action/src/data_types/generatedSupportingDataTypes.ts b/actions/notion-action/src/data_types/generatedSupportingDataTypes.ts new file mode 100644 index 0000000..310547f --- /dev/null +++ b/actions/notion-action/src/data_types/generatedSupportingDataTypes.ts @@ -0,0 +1,19 @@ +import { Action, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { createHash } from "node:crypto"; +import { schemas } from "../generated/notion-schemas.js"; +import { supportingSchemaNames } from "../generated/notion-schema-order.js"; + +// Like Stripe's generated support types: name shared schema components so the +// Hercules type export retains references instead of expanding every block, +// rich-text and emoji union at each occurrence in a page/query response. +export function registerNotionSupportingDataTypes(action: Action) { + for (const name of supportingSchemaNames) { + const full = `NOTION_SCHEMA_${name.toUpperCase()}`; + const identifier = full.length <= 50 ? full : `${full.slice(0, 37)}_${createHash("sha256").update(name).digest("hex").slice(0, 12).toUpperCase()}`; + class SupportingDataType {} + Identifier(identifier)(SupportingDataType); + Name({ code: "en-US", content: `Notion ${name}` })(SupportingDataType); + Schema(schemas[name])(SupportingDataType); + action.registerDataTypeClass(SupportingDataType); + } +} diff --git a/actions/notion-action/src/data_types/notionDatabase.ts b/actions/notion-action/src/data_types/notionDatabase.ts new file mode 100644 index 0000000..aefb0a4 --- /dev/null +++ b/actions/notion-action/src/data_types/notionDatabase.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +export const NotionDatabaseSchema = schemas.NotionDatabase; +export type NotionDatabase = z.infer; + +@Identifier("NOTION_DATABASE") +@Name({ code: "en-US", content: "Notion database" }) +@DisplayMessage({ code: "en-US", content: "Notion database" }) +@Schema(NotionDatabaseSchema) +export class NotionDatabaseDataType {} diff --git a/actions/notion-action/src/data_types/notionPage.ts b/actions/notion-action/src/data_types/notionPage.ts new file mode 100644 index 0000000..0a66283 --- /dev/null +++ b/actions/notion-action/src/data_types/notionPage.ts @@ -0,0 +1,19 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +/** + * A page as Notion returns it, plus its content as Markdown. Only Get Notion + * page fills in `markdown`; other functions and the triggers return the page + * without content, which would cost an extra request per page. + */ +export const NotionPageSchema = schemas.NotionPage.unwrap().extend({ + markdown: z.string().optional().describe("The page content as Notion-flavored Markdown. Only set by Get Notion page."), +}); +export type NotionPage = z.infer; + +@Identifier("NOTION_PAGE") +@Name({ code: "en-US", content: "Notion page" }) +@DisplayMessage({ code: "en-US", content: "Notion page" }) +@Schema(NotionPageSchema) +export class NotionPageDataType {} diff --git a/actions/notion-action/src/data_types/notionPropertyValue.ts b/actions/notion-action/src/data_types/notionPropertyValue.ts new file mode 100644 index 0000000..21c71f3 --- /dev/null +++ b/actions/notion-action/src/data_types/notionPropertyValue.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +export const NotionPropertyValueSchema = schemas.NotionPropertyValue; +export type NotionPropertyValue = z.infer; + +@Identifier("NOTION_PROPERTY_VALUE") +@Name({ code: "en-US", content: "Notion property value" }) +@DisplayMessage({ code: "en-US", content: "Notion property value" }) +@Schema(NotionPropertyValueSchema) +export class NotionPropertyValueDataType {} diff --git a/actions/notion-action/src/data_types/notionRichText.ts b/actions/notion-action/src/data_types/notionRichText.ts new file mode 100644 index 0000000..e6fac88 --- /dev/null +++ b/actions/notion-action/src/data_types/notionRichText.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +export const NotionRichTextSchema = schemas.NotionRichText; +export type NotionRichText = z.infer; + +@Identifier("NOTION_RICH_TEXT") +@Name({ code: "en-US", content: "Notion rich text" }) +@DisplayMessage({ code: "en-US", content: "Notion rich text" }) +@Schema(NotionRichTextSchema) +export class NotionRichTextDataType {} diff --git a/actions/notion-action/src/data_types/notionSearchResult.ts b/actions/notion-action/src/data_types/notionSearchResult.ts new file mode 100644 index 0000000..a32a4bf --- /dev/null +++ b/actions/notion-action/src/data_types/notionSearchResult.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +export const NotionSearchResultSchema = schemas.NotionSearchResult; +export type NotionSearchResult = z.infer; + +@Identifier("NOTION_SEARCH_RESULT") +@Name({ code: "en-US", content: "Notion search result" }) +@DisplayMessage({ code: "en-US", content: "Notion search result" }) +@Schema(NotionSearchResultSchema) +export class NotionSearchResultDataType {} diff --git a/actions/notion-action/src/data_types/notionUser.ts b/actions/notion-action/src/data_types/notionUser.ts new file mode 100644 index 0000000..ec3574a --- /dev/null +++ b/actions/notion-action/src/data_types/notionUser.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; +import { schemas } from "../generated/notion-schemas.js"; + +export const NotionUserSchema = schemas.NotionUser; +export type NotionUser = z.infer; + +@Identifier("NOTION_USER") +@Name({ code: "en-US", content: "Notion user" }) +@DisplayMessage({ code: "en-US", content: "Notion user" }) +@Schema(NotionUserSchema) +export class NotionUserDataType {} diff --git a/actions/notion-action/src/events/notionDatabaseItemCreated.ts b/actions/notion-action/src/events/notionDatabaseItemCreated.ts new file mode 100644 index 0000000..0ccebb7 --- /dev/null +++ b/actions/notion-action/src/events/notionDatabaseItemCreated.ts @@ -0,0 +1,15 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Signature } from "@code0-tech/hercules"; +import { INTEGRATION_TOKEN_SETTING, POLL_INTERVAL_SETTING } from "../integrationToken.js"; +import { DATABASE_ID_SETTING } from "../parameters.js"; + +@Identifier("NotionDatabaseItemCreated") +@Name({ code: "en-US", content: "Notion database item created" }) +@Description({ code: "en-US", content: "Poll for newly created pages in a database. The initial poll establishes a baseline without firing." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Notion database item created in ${databaseId}" }) +@Signature("(integrationToken: string, databaseId: string, pollIntervalSeconds?: number): NOTION_PAGE") +@EventSetting(INTEGRATION_TOKEN_SETTING) +@EventSetting(DATABASE_ID_SETTING) +@EventSetting(POLL_INTERVAL_SETTING) +export class NotionDatabaseItemCreated {} + diff --git a/actions/notion-action/src/events/notionDatabaseItemUpdated.ts b/actions/notion-action/src/events/notionDatabaseItemUpdated.ts new file mode 100644 index 0000000..79ded19 --- /dev/null +++ b/actions/notion-action/src/events/notionDatabaseItemUpdated.ts @@ -0,0 +1,15 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Signature } from "@code0-tech/hercules"; +import { INTEGRATION_TOKEN_SETTING, POLL_INTERVAL_SETTING } from "../integrationToken.js"; +import { DATABASE_ID_SETTING } from "../parameters.js"; + +@Identifier("NotionDatabaseItemUpdated") +@Name({ code: "en-US", content: "Notion database item updated" }) +@Description({ code: "en-US", content: "Poll for page edits in a database, including edits to content. The initial poll establishes a baseline without firing." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Notion database item updated in ${databaseId}" }) +@Signature("(integrationToken: string, databaseId: string, pollIntervalSeconds?: number): NOTION_PAGE") +@EventSetting(INTEGRATION_TOKEN_SETTING) +@EventSetting(DATABASE_ID_SETTING) +@EventSetting(POLL_INTERVAL_SETTING) +export class NotionDatabaseItemUpdated {} + diff --git a/actions/notion-action/src/events/notionPagePropertyChanged.ts b/actions/notion-action/src/events/notionPagePropertyChanged.ts new file mode 100644 index 0000000..05a6fd2 --- /dev/null +++ b/actions/notion-action/src/events/notionPagePropertyChanged.ts @@ -0,0 +1,21 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Signature } from "@code0-tech/hercules"; +import { INTEGRATION_TOKEN_SETTING, POLL_INTERVAL_SETTING } from "../integrationToken.js"; +import { DATABASE_ID_SETTING } from "../parameters.js"; + +@Identifier("NotionPagePropertyChanged") +@Name({ code: "en-US", content: "Notion page property changed" }) +@Description({ code: "en-US", content: "Poll for changes to one property of existing pages in a database. The initial poll establishes a baseline without firing." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Notion page property changed in ${databaseId}" }) +@Signature("(integrationToken: string, databaseId: string, propertyName: string, pollIntervalSeconds?: number): NOTION_PAGE") +@EventSetting(INTEGRATION_TOKEN_SETTING) +@EventSetting(DATABASE_ID_SETTING) +@EventSetting({ + identifier: "propertyName", + name: [{ code: "en-US", content: "Property name" }], + description: [{ code: "en-US", content: "Exact name of the property to watch (case-sensitive)." }], + linkedDataTypeIdentifiers: ["TEXT"], +}) +@EventSetting(POLL_INTERVAL_SETTING) +export class NotionPagePropertyChanged {} + diff --git a/actions/notion-action/src/functions/notionArchivePageFunction.ts b/actions/notion-action/src/functions/notionArchivePageFunction.ts new file mode 100644 index 0000000..0efc190 --- /dev/null +++ b/actions/notion-action/src/functions/notionArchivePageFunction.ts @@ -0,0 +1,20 @@ +import { Description, DisplayIcon, DisplayMessage, Identifier, Name, Parameter, Signature, type FunctionContext } from "@code0-tech/hercules"; +import { NotionClient } from "../client.js"; +import { INTEGRATION_TOKEN_PARAMETER } from "../integrationToken.js"; +import { PAGE_ID_PARAMETER } from "../parameters.js"; + + +@Identifier("notionArchivePage") +@Name({ code: "en-US", content: "Archive Notion page" }) +@Description({ code: "en-US", content: "Archive a page; returns whether Notion confirmed it is archived." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Archive Notion page" }) +@Signature("(integrationToken: string, pageId: string): boolean") +@Parameter(INTEGRATION_TOKEN_PARAMETER) +@Parameter(PAGE_ID_PARAMETER) +export class NotionArchivePageFunction { + run(_context: FunctionContext, integrationToken: string, pageId: string) { + return new NotionClient(integrationToken).archivePage(pageId); + } +} + diff --git a/actions/notion-action/src/functions/notionCreatePageFunction.ts b/actions/notion-action/src/functions/notionCreatePageFunction.ts new file mode 100644 index 0000000..0eb7d0e --- /dev/null +++ b/actions/notion-action/src/functions/notionCreatePageFunction.ts @@ -0,0 +1,32 @@ +import { Description, DisplayIcon, DisplayMessage, Identifier, Name, Parameter, Signature, type FunctionContext } from "@code0-tech/hercules" +import { NotionClient } from "../client.js" +import { INTEGRATION_TOKEN_PARAMETER } from "../integrationToken.js" +import { PARENT_ID_PARAMETER } from "../parameters.js" + +@Identifier("notionCreatePage") +@Name({ code: "en-US", content: "Create Notion page" }) +@Description({ + code: "en-US", + content: "Create an entry in a Notion database or a subpage of a Notion page, with a title and optional content written as Markdown.", +}) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Create Notion page" }) +@Signature("(integrationToken: string, parentId: string, title: string, markdown?: string): NOTION_PAGE") +@Parameter(INTEGRATION_TOKEN_PARAMETER) +@Parameter(PARENT_ID_PARAMETER) +@Parameter({ + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "Title of the new page, written to the title column (usually Name) when the parent is a database." }], +}) +@Parameter({ + runtimeName: "markdown", + name: [{ code: "en-US", content: "Content" }], + description: [{ code: "en-US", content: "Optional page content as Markdown, e.g. headings, lists, to-dos (- [ ]), code blocks and links." }], + optional: true, +}) +export class NotionCreatePageFunction { + run(_context: FunctionContext, integrationToken: string, parentId: string, title: string, markdown?: string | null) { + return new NotionClient(integrationToken).createPage(parentId, title, markdown) + } +} diff --git a/actions/notion-action/src/functions/notionGetPageFunction.ts b/actions/notion-action/src/functions/notionGetPageFunction.ts new file mode 100644 index 0000000..4b566bc --- /dev/null +++ b/actions/notion-action/src/functions/notionGetPageFunction.ts @@ -0,0 +1,19 @@ +import { Description, DisplayIcon, DisplayMessage, Identifier, Name, Parameter, Signature, type FunctionContext } from "@code0-tech/hercules"; +import { NotionClient } from "../client.js"; +import { INTEGRATION_TOKEN_PARAMETER } from "../integrationToken.js"; +import { PAGE_ID_PARAMETER } from "../parameters.js"; + +@Identifier("notionGetPage") +@Name({ code: "en-US", content: "Get Notion page" }) +@Description({ code: "en-US", content: "Retrieve a page with its properties and its content as Markdown (in markdown)." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Get Notion page" }) +@Signature("(integrationToken: string, pageId: string): NOTION_PAGE") +@Parameter(INTEGRATION_TOKEN_PARAMETER) +@Parameter(PAGE_ID_PARAMETER) +export class NotionGetPageFunction { + run(_context: FunctionContext, integrationToken: string, pageId: string) { + return new NotionClient(integrationToken).getPage(pageId); + } +} + diff --git a/actions/notion-action/src/functions/notionSearchFunction.ts b/actions/notion-action/src/functions/notionSearchFunction.ts new file mode 100644 index 0000000..e84ea9b --- /dev/null +++ b/actions/notion-action/src/functions/notionSearchFunction.ts @@ -0,0 +1,17 @@ +import { Description, DisplayIcon, DisplayMessage, Identifier, Name, Parameter, Signature, type FunctionContext } from "@code0-tech/hercules"; +import { NotionClient } from "../client.js"; +import { INTEGRATION_TOKEN_PARAMETER } from "../integrationToken.js"; + +@Identifier("notionSearch") +@Name({ code: "en-US", content: "Search Notion" }) +@Description({ code: "en-US", content: "Search accessible page and database titles, following every pagination cursor." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Search Notion" }) +@Signature("(integrationToken: string, query: string): NOTION_SEARCH_RESULT") +@Parameter(INTEGRATION_TOKEN_PARAMETER) +@Parameter({ runtimeName: "query", name: [{ code: "en-US", content: "Search text" }], description: [{ code: "en-US", content: "Text to search for in page and database titles. Leave empty to list everything the integration can access." }] }) +export class NotionSearchFunction { + run(_context: FunctionContext, integrationToken: string, query: string) { + return new NotionClient(integrationToken).search(query); + } +} diff --git a/actions/notion-action/src/functions/notionUpdatePageFunction.ts b/actions/notion-action/src/functions/notionUpdatePageFunction.ts new file mode 100644 index 0000000..53c8132 --- /dev/null +++ b/actions/notion-action/src/functions/notionUpdatePageFunction.ts @@ -0,0 +1,36 @@ +import { Description, DisplayIcon, DisplayMessage, Identifier, Name, Parameter, Signature, type FunctionContext } from "@code0-tech/hercules" +import { NotionClient } from "../client.js" +import { INTEGRATION_TOKEN_PARAMETER } from "../integrationToken.js" +import { PAGE_ID_PARAMETER } from "../parameters.js" + +@Identifier("notionUpdatePage") +@Name({ code: "en-US", content: "Update Notion page" }) +@Description({ code: "en-US", content: "Change the title and/or replace the content of a page. Empty fields stay unchanged." }) +@DisplayIcon("simple:notion") +@DisplayMessage({ code: "en-US", content: "Update Notion page" }) +@Signature("(integrationToken: string, pageId: string, title?: string, markdown?: string): NOTION_PAGE") +@Parameter(INTEGRATION_TOKEN_PARAMETER) +@Parameter(PAGE_ID_PARAMETER) +@Parameter({ + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "New title of the page. Leave empty to keep the current title." }], + optional: true, +}) +@Parameter({ + runtimeName: "markdown", + name: [{ code: "en-US", content: "Content" }], + description: [ + { + code: "en-US", + content: + "New page content as Markdown; replaces the entire current content. Leave empty to keep the current content. Child pages and databases are kept: Notion rejects content that would delete them.", + }, + ], + optional: true, +}) +export class NotionUpdatePageFunction { + run(_context: FunctionContext, integrationToken: string, pageId: string, title?: string | null, markdown?: string | null) { + return new NotionClient(integrationToken).updatePage(pageId, title, markdown) + } +} diff --git a/actions/notion-action/src/generated/notion-schema-order.ts b/actions/notion-action/src/generated/notion-schema-order.ts new file mode 100644 index 0000000..f03bd8c --- /dev/null +++ b/actions/notion-action/src/generated/notion-schema-order.ts @@ -0,0 +1,19 @@ +// AUTO-GENERATED by scripts/generate-openapi.mjs. Do not edit. +export const supportingSchemaNames = [ + "ApiColor", + "EmptyObject", + "NoticonColor", + "UserValueResponse", + "TemplateMentionResponse", + "RichTextItemResponse", + "ParentOfDatabaseResponse", + "ParentForBlockBasedObjectResponse", + "Record_string_PagePropertyValueWithIdResponse_", + "PagePropertiesRequest", + "TemplateMentionRequest", + "RichTextItemRequest", + "ParentOfDataSourceResponse", + "Record_string_DatabasePropertyConfigResponse_", + "UserObjectResponse" +] as const; +export const notionDateFields = ["created_time","last_edited_time","expiry_time","start_time","end_time"] as const; diff --git a/actions/notion-action/src/generated/notion-schemas.ts b/actions/notion-action/src/generated/notion-schemas.ts new file mode 100644 index 0000000..32b15c9 --- /dev/null +++ b/actions/notion-action/src/generated/notion-schemas.ts @@ -0,0 +1,57 @@ +// AUTO-GENERATED by scripts/openapi-to-zod.mjs. Do not edit by hand. +// Regenerate with the action's `generate:*-schemas` npm script. +import {z} from "zod"; +import {dateSchema} from "@code0-tech/hercules"; + +const ApiColor = z.lazy(() => z.enum(["blue", "blue_background", "brown", "brown_background", "default", "default_background", "gray", "gray_background", "green", "green_background", "orange", "orange_background", "pink", "pink_background", "purple", "purple_background", "red", "red_background", "yellow", "yellow_background"])); +const EmptyObject = z.lazy(() => z.object({}).strict()); +const NoticonColor = z.lazy(() => z.enum(["blue", "brown", "gray", "green", "lightgray", "orange", "pink", "purple", "red", "yellow"])); +const NotionDatabase = z.lazy(() => z.object({"object": z.literal("database"), "id": z.string(), "title": z.array(RichTextItemResponse), "description": z.array(RichTextItemResponse), "parent": ParentOfDatabaseResponse, "is_inline": z.boolean(), "database_type": z.union([z.enum(["docs", "github_prs", "meeting_notes", "meetings", "projects", "skills", "sprints", "tasks", "wiki"]), z.null()]).optional(), "in_trash": z.boolean(), "archived": z.boolean().optional(), "is_locked": z.boolean().optional(), "show_data_source_title": z.boolean().optional(), "created_time": dateSchema, "last_edited_time": dateSchema, "data_sources": z.array(z.object({"id": z.string(), "name": z.string()}).passthrough()), "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "url": z.string(), "public_url": z.string().nullable()}).passthrough()); +const NotionPage = z.lazy(() => z.object({"object": z.literal("page"), "id": z.string(), "created_time": dateSchema, "last_edited_time": dateSchema, "in_trash": z.boolean(), "archived": z.boolean().optional(), "is_archived": z.boolean().optional(), "is_locked": z.boolean().optional(), "url": z.string(), "public_url": z.string().nullable(), "parent": ParentForBlockBasedObjectResponse, "properties": Record_string_PagePropertyValueWithIdResponse_, "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "created_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "last_edited_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough()}).passthrough()); +const NotionProperties = z.lazy(() => PagePropertiesRequest); +const NotionPropertyValue = z.lazy(() => z.union([z.object({"title": z.array(RichTextItemRequest), "type": z.literal("title").optional()}).passthrough(), z.object({"rich_text": z.array(RichTextItemRequest), "type": z.literal("rich_text").optional()}).passthrough(), z.object({"number": z.number().nullable(), "type": z.literal("number").optional()}).passthrough(), z.object({"url": z.string().nullable(), "type": z.literal("url").optional()}).passthrough(), z.object({"select": z.union([z.object({"id": z.string(), "name": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough(), z.object({"name": z.string(), "id": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough(), z.null()]), "type": z.literal("select").optional()}).passthrough(), z.object({"multi_select": z.array(z.union([z.object({"id": z.string(), "name": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough(), z.object({"name": z.string(), "id": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough()])), "type": z.literal("multi_select").optional()}).passthrough(), z.object({"people": z.array(z.union([z.object({"id": z.string(), "name": z.string().nullable().optional(), "object": z.literal("group").optional()}).passthrough(), z.object({"id": z.string(), "object": z.literal("user").optional()}).passthrough()])), "type": z.literal("people").optional()}).passthrough(), z.object({"email": z.string().nullable(), "type": z.literal("email").optional()}).passthrough(), z.object({"phone_number": z.string().nullable(), "type": z.literal("phone_number").optional()}).passthrough(), z.object({"date": z.union([z.object({"start": z.string(), "end": z.string().nullable().optional(), "time_zone": z.string().nullable().optional()}).passthrough(), z.null()]), "type": z.literal("date").optional()}).passthrough(), z.object({"checkbox": z.boolean(), "type": z.literal("checkbox").optional()}).passthrough(), z.object({"relation": z.array(z.object({"id": z.string()}).passthrough()), "type": z.literal("relation").optional()}).passthrough(), z.object({"files": z.array(z.union([z.object({"file_upload": z.object({"id": z.string()}).passthrough(), "type": z.literal("file_upload").optional(), "name": z.string().optional()}).passthrough(), z.object({"file": z.object({"url": z.string(), "expiry_time": z.string().optional()}).passthrough(), "name": z.string(), "type": z.literal("file").optional()}).passthrough(), z.object({"external": z.object({"url": z.string()}).passthrough(), "name": z.string(), "type": z.literal("external").optional()}).passthrough()])), "type": z.literal("files").optional()}).passthrough(), z.object({"status": z.union([z.object({"id": z.string(), "name": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough(), z.object({"name": z.string(), "id": z.string().optional(), "color": z.enum(["blue", "brown", "default", "gray", "green", "orange", "pink", "purple", "red", "yellow"]).optional(), "description": z.string().nullable().optional()}).passthrough(), z.null()]), "type": z.literal("status").optional()}).passthrough(), z.object({"place": z.union([z.object({"lat": z.number(), "lon": z.number(), "name": z.string().nullable().optional(), "address": z.string().nullable().optional(), "aws_place_id": z.string().nullable().optional(), "google_place_id": z.string().nullable().optional()}).passthrough(), z.null()]), "type": z.literal("place").optional()}).passthrough(), z.object({"verification": z.union([z.object({"state": z.literal("verified"), "date": z.object({"start": z.string(), "end": z.string().nullable().optional(), "time_zone": z.string().nullable().optional()}).passthrough().optional()}).passthrough(), z.object({"state": z.literal("unverified")}).passthrough()]), "type": z.literal("verification").optional()}).passthrough()])); +const NotionQueryResult = z.lazy(() => z.object({"type": z.literal("page_or_data_source"), "page_or_data_source": EmptyObject, "object": z.literal("list"), "next_cursor": z.string().nullable(), "has_more": z.boolean(), "results": z.array(z.union([z.object({"object": z.literal("page"), "id": z.string(), "created_time": dateSchema, "last_edited_time": dateSchema, "in_trash": z.boolean(), "archived": z.boolean().optional(), "is_archived": z.boolean().optional(), "is_locked": z.boolean().optional(), "url": z.string(), "public_url": z.string().nullable(), "parent": ParentForBlockBasedObjectResponse, "properties": Record_string_PagePropertyValueWithIdResponse_, "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "created_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "last_edited_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough()}).passthrough(), z.object({"object": z.literal("page"), "id": z.string()}).passthrough(), z.object({"object": z.literal("data_source"), "id": z.string(), "title": z.array(RichTextItemResponse), "description": z.array(RichTextItemResponse), "parent": ParentOfDataSourceResponse, "database_parent": ParentOfDatabaseResponse, "is_inline": z.boolean(), "database_type": z.union([z.enum(["docs", "github_prs", "meeting_notes", "meetings", "projects", "skills", "sprints", "tasks", "wiki"]), z.null()]).optional(), "in_trash": z.boolean(), "archived": z.boolean().optional(), "created_time": dateSchema, "last_edited_time": dateSchema, "created_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "last_edited_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "properties": Record_string_DatabasePropertyConfigResponse_, "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "url": z.string(), "public_url": z.string().nullable()}).passthrough(), z.object({"object": z.literal("data_source"), "id": z.string(), "properties": Record_string_DatabasePropertyConfigResponse_}).passthrough()])), "request_status": z.object({"type": z.enum(["complete", "incomplete"]), "incomplete_reason": z.literal("query_result_limit_reached").optional()}).passthrough().optional()}).passthrough()); +const NotionRichText = z.lazy(() => RichTextItemRequest); +const NotionSearchResult = z.lazy(() => z.object({"type": z.literal("page_or_data_source"), "page_or_data_source": EmptyObject, "object": z.literal("list"), "next_cursor": z.string().nullable(), "has_more": z.boolean(), "results": z.array(z.union([z.object({"object": z.literal("page"), "id": z.string(), "created_time": dateSchema, "last_edited_time": dateSchema, "in_trash": z.boolean(), "archived": z.boolean().optional(), "is_archived": z.boolean().optional(), "is_locked": z.boolean().optional(), "url": z.string(), "public_url": z.string().nullable(), "parent": ParentForBlockBasedObjectResponse, "properties": Record_string_PagePropertyValueWithIdResponse_, "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "created_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "last_edited_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough()}).passthrough(), z.object({"object": z.literal("page"), "id": z.string()}).passthrough(), z.object({"object": z.literal("data_source"), "id": z.string(), "title": z.array(RichTextItemResponse), "description": z.array(RichTextItemResponse), "parent": ParentOfDataSourceResponse, "database_parent": ParentOfDatabaseResponse, "is_inline": z.boolean(), "database_type": z.union([z.enum(["docs", "github_prs", "meeting_notes", "meetings", "projects", "skills", "sprints", "tasks", "wiki"]), z.null()]).optional(), "in_trash": z.boolean(), "archived": z.boolean().optional(), "created_time": dateSchema, "last_edited_time": dateSchema, "created_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "last_edited_by": z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), "properties": Record_string_DatabasePropertyConfigResponse_, "icon": z.union([z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("emoji"), "emoji": z.string()}).passthrough(), z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.object({"type": z.literal("icon"), "icon": z.object({"name": z.string(), "color": NoticonColor}).passthrough()}).passthrough(), z.null()]), "cover": z.union([z.object({"type": z.literal("external"), "external": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("file"), "file": z.object({"url": z.string(), "expiry_time": dateSchema}).passthrough()}).passthrough(), z.null()]), "url": z.string(), "public_url": z.string().nullable()}).passthrough(), z.object({"object": z.literal("data_source"), "id": z.string(), "properties": Record_string_DatabasePropertyConfigResponse_}).passthrough()])), "request_status": z.object({"type": z.enum(["complete", "incomplete"]), "incomplete_reason": z.literal("query_result_limit_reached").optional()}).passthrough().optional()}).passthrough()); +const NotionUser = z.lazy(() => UserObjectResponse); +const PagePropertiesRequest = z.lazy(() => z.record(z.string(), z.any())); +const ParentForBlockBasedObjectResponse = z.lazy(() => z.union([z.object({"type": z.literal("agent_id"), "agent_id": z.string()}).passthrough(), z.object({"type": z.literal("block_id"), "block_id": z.string()}).passthrough(), z.object({"type": z.literal("data_source_id"), "data_source_id": z.string(), "database_id": z.string()}).passthrough(), z.object({"type": z.literal("database_id"), "database_id": z.string()}).passthrough(), z.object({"type": z.literal("page_id"), "page_id": z.string()}).passthrough(), z.object({"type": z.literal("workspace"), "workspace": z.literal(true)}).passthrough()])); +const ParentOfDataSourceResponse = z.lazy(() => z.union([z.object({"type": z.literal("data_source_id"), "data_source_id": z.string(), "database_id": z.string()}).passthrough(), z.object({"type": z.literal("database_id"), "database_id": z.string()}).passthrough()])); +const ParentOfDatabaseResponse = z.lazy(() => z.union([z.object({"type": z.literal("block_id"), "block_id": z.string()}).passthrough(), z.object({"type": z.literal("database_id"), "database_id": z.string()}).passthrough(), z.object({"type": z.literal("page_id"), "page_id": z.string()}).passthrough(), z.object({"type": z.literal("workspace"), "workspace": z.literal(true)}).passthrough()])); +const Record_string_DatabasePropertyConfigResponse_ = z.lazy(() => z.record(z.string(), z.any())); +const Record_string_PagePropertyValueWithIdResponse_ = z.lazy(() => z.record(z.string(), z.any())); +const RichTextItemRequest = z.lazy(() => z.union([z.intersection(z.object({"annotations": z.object({"bold": z.boolean().optional(), "italic": z.boolean().optional(), "strikethrough": z.boolean().optional(), "underline": z.boolean().optional(), "code": z.boolean().optional(), "color": z.enum(["blue", "blue_background", "brown", "brown_background", "default", "default_background", "gray", "gray_background", "green", "green_background", "orange", "orange_background", "pink", "pink_background", "purple", "purple_background", "red", "red_background", "yellow", "yellow_background"]).optional()}).passthrough().optional()}).passthrough(), z.object({"type": z.literal("text").optional(), "text": z.object({"content": z.string(), "link": z.union([z.object({"url": z.string()}).passthrough(), z.null()]).optional()}).passthrough()}).passthrough()), z.intersection(z.object({"annotations": z.object({"bold": z.boolean().optional(), "italic": z.boolean().optional(), "strikethrough": z.boolean().optional(), "underline": z.boolean().optional(), "code": z.boolean().optional(), "color": z.enum(["blue", "blue_background", "brown", "brown_background", "default", "default_background", "gray", "gray_background", "green", "green_background", "orange", "orange_background", "pink", "pink_background", "purple", "purple_background", "red", "red_background", "yellow", "yellow_background"]).optional()}).passthrough().optional()}).passthrough(), z.object({"type": z.literal("mention").optional(), "mention": z.union([z.object({"type": z.literal("user").optional(), "user": z.object({"id": z.string(), "object": z.literal("user").optional()}).passthrough()}).passthrough(), z.object({"type": z.literal("date").optional(), "date": z.object({"start": z.string(), "end": z.string().nullable().optional(), "time_zone": z.string().nullable().optional()}).passthrough()}).passthrough(), z.object({"type": z.literal("page").optional(), "page": z.object({"id": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("database").optional(), "database": z.object({"id": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("template_mention").optional(), "template_mention": TemplateMentionRequest}).passthrough(), z.object({"type": z.literal("custom_emoji").optional(), "custom_emoji": z.object({"id": z.string(), "name": z.string().optional(), "url": z.string().optional()}).passthrough()}).passthrough()])}).passthrough()), z.intersection(z.object({"annotations": z.object({"bold": z.boolean().optional(), "italic": z.boolean().optional(), "strikethrough": z.boolean().optional(), "underline": z.boolean().optional(), "code": z.boolean().optional(), "color": z.enum(["blue", "blue_background", "brown", "brown_background", "default", "default_background", "gray", "gray_background", "green", "green_background", "orange", "orange_background", "pink", "pink_background", "purple", "purple_background", "red", "red_background", "yellow", "yellow_background"]).optional()}).passthrough().optional()}).passthrough(), z.object({"type": z.literal("equation").optional(), "equation": z.object({"expression": z.string()}).passthrough()}).passthrough())])); +const RichTextItemResponse = z.lazy(() => z.union([z.intersection(z.object({"plain_text": z.string(), "href": z.string().nullable(), "annotations": z.object({"bold": z.boolean(), "italic": z.boolean(), "strikethrough": z.boolean(), "underline": z.boolean(), "code": z.boolean(), "color": ApiColor}).passthrough()}).passthrough(), z.object({"type": z.literal("equation"), "equation": z.object({"expression": z.string()}).passthrough()}).passthrough()), z.intersection(z.object({"plain_text": z.string(), "href": z.string().nullable(), "annotations": z.object({"bold": z.boolean(), "italic": z.boolean(), "strikethrough": z.boolean(), "underline": z.boolean(), "code": z.boolean(), "color": ApiColor}).passthrough()}).passthrough(), z.object({"type": z.literal("mention"), "mention": z.union([z.object({"type": z.literal("user"), "user": UserValueResponse}).passthrough(), z.object({"type": z.literal("date"), "date": z.object({"start": z.string(), "end": z.string().nullable(), "time_zone": z.string().nullable()}).passthrough()}).passthrough(), z.object({"type": z.literal("link_preview"), "link_preview": z.object({"url": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("link_mention"), "link_mention": z.object({"href": z.string(), "title": z.string().optional(), "description": z.string().optional(), "link_author": z.string().optional(), "link_provider": z.string().optional(), "thumbnail_url": z.string().optional(), "icon_url": z.string().optional(), "iframe_url": z.string().optional(), "height": z.number().optional(), "padding": z.number().optional(), "padding_top": z.number().optional()}).passthrough()}).passthrough(), z.object({"type": z.literal("page"), "page": z.object({"id": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("database"), "database": z.object({"id": z.string()}).passthrough()}).passthrough(), z.object({"type": z.literal("template_mention"), "template_mention": TemplateMentionResponse}).passthrough(), z.object({"type": z.literal("custom_emoji"), "custom_emoji": z.object({"id": z.string(), "name": z.string(), "url": z.string()}).passthrough()}).passthrough()])}).passthrough()), z.intersection(z.object({"plain_text": z.string(), "href": z.string().nullable(), "annotations": z.object({"bold": z.boolean(), "italic": z.boolean(), "strikethrough": z.boolean(), "underline": z.boolean(), "code": z.boolean(), "color": ApiColor}).passthrough()}).passthrough(), z.object({"type": z.literal("text"), "text": z.object({"content": z.string(), "link": z.union([z.object({"url": z.string()}).passthrough(), z.null()])}).passthrough()}).passthrough())])); +const TemplateMentionRequest = z.lazy(() => z.union([z.object({"type": z.literal("template_mention_date").optional(), "template_mention_date": z.enum(["now", "today"])}).passthrough(), z.object({"type": z.literal("template_mention_user").optional(), "template_mention_user": z.literal("me")}).passthrough()])); +const TemplateMentionResponse = z.lazy(() => z.union([z.object({"type": z.literal("template_mention_date"), "template_mention_date": z.enum(["now", "today"])}).passthrough(), z.object({"type": z.literal("template_mention_user"), "template_mention_user": z.literal("me")}).passthrough()])); +const UserObjectResponse = z.lazy(() => z.union([z.intersection(z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable()}).passthrough(), z.object({"type": z.literal("person"), "person": z.object({"email": z.string().optional(), "email_verified": z.boolean().optional()}).passthrough()}).passthrough()), z.intersection(z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable()}).passthrough(), z.object({"type": z.literal("bot"), "bot": z.union([z.object({"owner": z.union([z.object({"type": z.literal("user"), "user": z.union([z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable(), "type": z.literal("person"), "person": z.object({"email": z.string().optional(), "email_verified": z.boolean().optional()}).passthrough()}).passthrough()])}).passthrough(), z.object({"type": z.literal("workspace"), "workspace": z.literal(true)}).passthrough()]), "workspace_id": z.string(), "workspace_limits": z.object({"max_file_upload_size_in_bytes": z.number()}).passthrough(), "workspace_name": z.string().nullable()}).passthrough(), EmptyObject])}).passthrough())])); +const UserValueResponse = z.lazy(() => z.union([z.intersection(z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable()}).passthrough(), z.object({"type": z.literal("person"), "person": z.object({"email": z.string().optional(), "email_verified": z.boolean().optional()}).passthrough()}).passthrough()), z.intersection(z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable()}).passthrough(), z.object({"type": z.literal("bot"), "bot": z.union([z.object({"owner": z.union([z.object({"type": z.literal("user"), "user": z.union([z.object({"id": z.string(), "object": z.literal("user")}).passthrough(), z.object({"id": z.string(), "object": z.literal("user"), "name": z.string().nullable(), "avatar_url": z.string().nullable(), "type": z.literal("person"), "person": z.object({"email": z.string().optional(), "email_verified": z.boolean().optional()}).passthrough()}).passthrough()])}).passthrough(), z.object({"type": z.literal("workspace"), "workspace": z.literal(true)}).passthrough()]), "workspace_id": z.string(), "workspace_limits": z.object({"max_file_upload_size_in_bytes": z.number()}).passthrough(), "workspace_name": z.string().nullable()}).passthrough(), EmptyObject])}).passthrough()), z.object({"id": z.string(), "object": z.literal("user")}).passthrough()])); + +export const schemas = { + ApiColor, + EmptyObject, + NoticonColor, + NotionDatabase, + NotionPage, + NotionProperties, + NotionPropertyValue, + NotionQueryResult, + NotionRichText, + NotionSearchResult, + NotionUser, + PagePropertiesRequest, + ParentForBlockBasedObjectResponse, + ParentOfDataSourceResponse, + ParentOfDatabaseResponse, + Record_string_DatabasePropertyConfigResponse_, + Record_string_PagePropertyValueWithIdResponse_, + RichTextItemRequest, + RichTextItemResponse, + TemplateMentionRequest, + TemplateMentionResponse, + UserObjectResponse, + UserValueResponse, +}; + +export const recursiveSchemaNames = [ +] as const; diff --git a/actions/notion-action/src/index.ts b/actions/notion-action/src/index.ts new file mode 100644 index 0000000..64a9d0e --- /dev/null +++ b/actions/notion-action/src/index.ts @@ -0,0 +1,85 @@ +import "reflect-metadata" +import { Action, CodeZeroEvent, isExportMode } from "@code0-tech/hercules" +import { registerNotionSupportingDataTypes } from "./data_types/generatedSupportingDataTypes.js" +import { NotionRichTextDataType } from "./data_types/notionRichText.js" +import { NotionPropertyValueDataType } from "./data_types/notionPropertyValue.js" +import { NotionUserDataType } from "./data_types/notionUser.js" +import { NotionPageDataType } from "./data_types/notionPage.js" +import { NotionDatabaseDataType } from "./data_types/notionDatabase.js" +import { NotionSearchResultDataType } from "./data_types/notionSearchResult.js" +import { NotionCreatePageFunction } from "./functions/notionCreatePageFunction.js" +import { NotionUpdatePageFunction } from "./functions/notionUpdatePageFunction.js" +import { NotionGetPageFunction } from "./functions/notionGetPageFunction.js" +import { NotionArchivePageFunction } from "./functions/notionArchivePageFunction.js" +import { NotionSearchFunction } from "./functions/notionSearchFunction.js" +import { NotionDatabaseItemCreated } from "./events/notionDatabaseItemCreated.js" +import { NotionDatabaseItemUpdated } from "./events/notionDatabaseItemUpdated.js" +import { NotionPagePropertyChanged } from "./events/notionPagePropertyChanged.js" +import { NotionPoller, pollIntervalFromEnv } from "./polling.js" + +export const action = new Action( + process.env.HERCULES_ACTION_ID ?? "notion-action", + process.env.HERCULES_SDK_VERSION ?? "1.0.0", + process.env.HERCULES_AQUILA_URL ?? "127.0.0.1:8081", + "code0-tech", + "simple:notion", + "Create, read, update and search Notion pages, and trigger flows by polling databases for changes.", + [{ code: "en-US", content: "Notion" }], + [] +) + +registerNotionSupportingDataTypes(action) +action.registerDataTypeClass(NotionRichTextDataType) +action.registerDataTypeClass(NotionPropertyValueDataType) +action.registerDataTypeClass(NotionUserDataType) +action.registerDataTypeClass(NotionPageDataType) +action.registerDataTypeClass(NotionDatabaseDataType) +action.registerDataTypeClass(NotionSearchResultDataType) +action.registerRuntimeFunction(NotionCreatePageFunction) +action.registerRuntimeFunction(NotionUpdatePageFunction) +action.registerRuntimeFunction(NotionGetPageFunction) +action.registerRuntimeFunction(NotionArchivePageFunction) +action.registerRuntimeFunction(NotionSearchFunction) +// Hercules registers both the runtime event and its public event definition. +action.registerRuntimeEventClass(NotionDatabaseItemCreated) +action.registerRuntimeEventClass(NotionDatabaseItemUpdated) +action.registerRuntimeEventClass(NotionPagePropertyChanged) + +if (!isExportMode()) { + const poller = new NotionPoller(action, pollIntervalFromEnv()) + let retry: ReturnType | undefined + let stopping = false + + const connect = () => { + if (!stopping) + void action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((error: Error) => { + action.emit(CodeZeroEvent.error, error) + }) + } + + action.on(CodeZeroEvent.connected, () => { + if (retry) clearTimeout(retry) + retry = undefined + console.log("Notion action connected to Aquila") + poller.start() + }) + action.on(CodeZeroEvent.error, (error: Error) => { + console.error("Aquila connection failed; reconnecting in 5 seconds.", error?.message ?? error) + poller.stop() + if (!stopping && !retry) + retry = setTimeout(() => { + retry = undefined + connect() + }, 5000) + }) + const shutdown = () => { + stopping = true + if (retry) clearTimeout(retry) + poller.stop() + // The Hercules SDK has no public disconnect method. + process.exit(0) + } + process.once("SIGINT", shutdown) + process.once("SIGTERM", shutdown) + connect() +} diff --git a/actions/notion-action/src/integrationToken.ts b/actions/notion-action/src/integrationToken.ts new file mode 100644 index 0000000..d1b1fc7 --- /dev/null +++ b/actions/notion-action/src/integrationToken.ts @@ -0,0 +1,37 @@ +/** + * The action holds no credentials of its own: every function and every trigger + * takes the integration token it works with as its first parameter, a plain + * text value, so one running action serves as many Notion integrations as its + * flows use. + */ +const TOKEN_HINT = "The internal integration secret (ntn_... or secret_...). Find it under Settings > Connections > Develop or manage integrations, and share the pages and databases with the integration."; + +/** The first parameter of every Notion function. */ +export const INTEGRATION_TOKEN_PARAMETER = { + runtimeName: "integrationToken", + name: [{ code: "en-US", content: "Notion integration token" }], + description: [{ code: "en-US", content: TOKEN_HINT }], +}; + +/** The first setting of every Notion trigger. */ +export const INTEGRATION_TOKEN_SETTING = { + identifier: "integrationToken", + name: [{ code: "en-US", content: "Notion integration token" }], + description: [{ code: "en-US", content: TOKEN_HINT }], + linkedDataTypeIdentifiers: ["TEXT"], +}; + +/** The optional poll interval of every Notion trigger. */ +export const POLL_INTERVAL_SETTING = { + identifier: "pollIntervalSeconds", + name: [{ code: "en-US", content: "Poll interval (seconds)" }], + description: [ + { + code: "en-US", + content: + "How often this trigger checks Notion for changes. Minimum 10 seconds; defaults to 60 seconds. Each check is one Notion API request, and Notion allows about three requests per second per integration.", + }, + ], + linkedDataTypeIdentifiers: ["NUMBER"], + optional: true, +}; diff --git a/actions/notion-action/src/parameters.ts b/actions/notion-action/src/parameters.ts new file mode 100644 index 0000000..d97a54a --- /dev/null +++ b/actions/notion-action/src/parameters.ts @@ -0,0 +1,19 @@ +/** Shared labels and descriptions, so every Notion node explains IDs the same way. */ + +const text = (content: string) => [{ code: "en-US", content }]; + +const DATABASE_ID_HINT = "The ID of the database: the 32-character code in its URL, e.g. notion.so/workspace/?v=... Share the database with the integration (... > Connections)."; +const PAGE_ID_HINT = "The ID of the page: the 32-character code at the end of its URL, or the id of a page from another Notion node. Share the page with the integration."; + +/** The page ID parameter of a function. */ +export const PAGE_ID_PARAMETER = { runtimeName: "pageId", name: text("Page ID"), description: text(PAGE_ID_HINT) }; + +/** The parent of a new page: a database or a page. */ +export const PARENT_ID_PARAMETER = { + runtimeName: "parentId", + name: text("Parent ID"), + description: text("The ID of a database (the new page becomes an entry) or a page (the new page becomes a subpage): the 32-character code in its URL. Share the parent with the integration (... > Connections)."), +}; + +/** The database ID setting of every trigger. */ +export const DATABASE_ID_SETTING = { identifier: "databaseId", name: text("Database ID"), description: text(DATABASE_ID_HINT), linkedDataTypeIdentifiers: ["TEXT"] }; diff --git a/actions/notion-action/src/polling.ts b/actions/notion-action/src/polling.ts new file mode 100644 index 0000000..a89e9d8 --- /dev/null +++ b/actions/notion-action/src/polling.ts @@ -0,0 +1,293 @@ +import { Action, CodeZeroEvent, RuntimeError } from "@code0-tech/hercules" +import type { ActionFlow } from "@code0-tech/tucana/aquila" +import { toAllowedValue } from "@code0-tech/tucana/helpers" +import { createHash } from "node:crypto" +import { isDeepStrictEqual } from "node:util" +import { NotionClient, notionCredentials } from "./client.js" +import { NotionPageSchema, type NotionPage } from "./data_types/notionPage.js" + +export const NOTION_EVENT_TYPES = ["NotionDatabaseItemCreated", "NotionDatabaseItemUpdated", "NotionPagePropertyChanged"] as const +type EventType = (typeof NOTION_EVENT_TYPES)[number] +// Page timestamps are DATE values (Unix microseconds); the cursor stays an +// ISO 8601 string because it is sent back to Notion as a filter value. +interface Snapshot { + edited: number + property: unknown +} +interface WatchState { + fingerprint: string + activatedAt: number + cursor?: string + dataSourceId?: string + pages: Map +} + +export const DEFAULT_POLL_INTERVAL_MS = 60_000 +export const MIN_POLL_INTERVAL_MS = 10_000 +// After a new baseline, poll again soon so a first test change shows up quickly. +const FOLLOW_UP_DELAY_MS = 10_000 +const MINUTE_MS = 60_000 +// Timers drift by a few milliseconds; a flow counts as due slightly early. +const SCHEDULE_TOLERANCE_MS = 1_000 +export const POLL_INTERVAL_SETTING = "pollIntervalSeconds" + +/** Reads the action-wide default NOTION_POLL_INTERVAL_MS; invalid or too small values fall back to a safe interval. */ +export function pollIntervalFromEnv(value = process.env.NOTION_POLL_INTERVAL_MS, warn: (message: string) => void = console.warn): number { + if (value === undefined || value.trim() === "") return DEFAULT_POLL_INTERVAL_MS + const interval = Number(value) + if (!Number.isInteger(interval) || interval <= 0) { + warn(`Notion polling: ignoring invalid NOTION_POLL_INTERVAL_MS "${value}"; using ${DEFAULT_POLL_INTERVAL_MS}ms.`) + return DEFAULT_POLL_INTERVAL_MS + } + if (interval < MIN_POLL_INTERVAL_MS) { + warn(`Notion polling: NOTION_POLL_INTERVAL_MS ${interval}ms is below the minimum; using ${MIN_POLL_INTERVAL_MS}ms.`) + return MIN_POLL_INTERVAL_MS + } + return interval +} + +function rawSetting(flow: ActionFlow, name: string): unknown { + const encoded = flow.settings.find((entry) => entry.flowSettingId === name)?.value + return encoded ? toAllowedValue(encoded) : undefined +} + +function setting(flow: ActionFlow, name: string): string { + const value = rawSetting(flow, name) + if (typeof value !== "string" || !value.trim()) { + throw new RuntimeError("NOTION_INVALID_SETTING", `Flow ${flow.flowId} requires ${name}.`) + } + return value.trim() +} + +/** In-memory checkpoints, isolated per flow and integration token. */ +export class NotionPoller { + private readonly states = new Map() + // When each flow was last polled and whether its follow-up poll is pending. + private readonly schedule = new Map() + private timer?: ReturnType + private running = false + private stopped = false + // Status messages already logged, so each one appears once per flow and state. + private readonly announced = new Set() + + constructor( + private readonly action: Action, + /** Default interval for flows without a pollIntervalSeconds setting. */ + private readonly intervalMs = DEFAULT_POLL_INTERVAL_MS, + private readonly reportError: (error: unknown) => void = (error) => + console.error("Notion polling:", error instanceof Error ? error.message : "Poll failed"), + private readonly now: () => Date = () => new Date(), + private readonly log: (message: string) => void = (message) => console.log("Notion polling:", message) + ) { + if (!Number.isFinite(intervalMs) || intervalMs < 1000) throw new Error("Notion polling interval must be at least 1000ms.") + } + + start() { + if (this.timer) return + this.stopped = false + this.action.on(CodeZeroEvent.flowDeleted, this.forget) + this.action.on(CodeZeroEvent.flowUpdated, this.flowUpdated) + // A short base timer; each flow is only polled once its own interval is due. + this.timer = setInterval(this.pollDue, Math.min(MIN_POLL_INTERVAL_MS, this.intervalMs)) + this.pollDue() + } + + stop() { + this.stopped = true + if (this.timer) clearInterval(this.timer) + this.timer = undefined + this.action.off(CodeZeroEvent.flowDeleted, this.forget) + this.action.off(CodeZeroEvent.flowUpdated, this.flowUpdated) + this.states.clear() + this.schedule.clear() + this.announced.clear() + } + + private info(key: string, message: string) { + if (this.announced.has(key)) return + this.announced.add(key) + this.log(message) + } + + private readonly pollDue = () => { + void this.tick(false) + } + private readonly forget = (flowId: bigint) => { + this.states.delete(flowId) + this.schedule.delete(flowId) + } + private reset(flowId: bigint) { + // A changed watch gets a new baseline right away instead of waiting for its interval. + this.states.delete(flowId) + this.schedule.delete(flowId) + } + private readonly flowUpdated = (flow: ActionFlow) => { + const state = this.states.get(flow.flowId) + if (state && !this.isCurrent(flow.flowId, state)) this.reset(flow.flowId) + this.pollDue() + } + + /** The flow's pollIntervalSeconds setting, falling back to the action-wide default. */ + private interval(flow: ActionFlow): number { + const raw = rawSetting(flow, POLL_INTERVAL_SETTING) + if (raw === undefined || raw === null || raw === "") return this.intervalMs + const seconds = Number(raw) + if (!Number.isFinite(seconds) || seconds <= 0) { + this.info(`interval:${flow.flowId}:${String(raw)}`, + `Flow ${flow.flowId}: ignoring invalid ${POLL_INTERVAL_SETTING} "${String(raw)}"; using ${this.intervalMs / 1000}s.`) + return this.intervalMs + } + if (seconds * 1000 < MIN_POLL_INTERVAL_MS) { + this.info(`interval:${flow.flowId}:${seconds}`, + `Flow ${flow.flowId}: ${POLL_INTERVAL_SETTING} ${seconds}s is below the minimum; using ${MIN_POLL_INTERVAL_MS / 1000}s.`) + return MIN_POLL_INTERVAL_MS + } + return seconds * 1000 + } + + private isDue(flow: ActionFlow, now: number): boolean { + const entry = this.schedule.get(flow.flowId) + if (!entry) return true + const elapsed = now - entry.at + SCHEDULE_TOLERANCE_MS + return (entry.followUp && elapsed >= FOLLOW_UP_DELAY_MS) || elapsed >= this.interval(flow) + } + + /** + * Polls the watched flows. The base timer only polls flows whose interval is + * due (force = false); a forced tick polls every flow immediately. + */ + async tick(force = true): Promise { + if (this.running || this.stopped) return + this.running = true + try { + for (const id of this.states.keys()) if (!this.action.flows.has(id)) this.states.delete(id) + for (const id of this.schedule.keys()) if (!this.action.flows.has(id)) this.schedule.delete(id) + for (const flow of this.action.flows.values()) { + if (this.stopped) break + if (!NOTION_EVENT_TYPES.includes(flow.type as EventType)) { + this.info(`ignored:${flow.flowId}:${flow.type}`, `Ignoring flow ${flow.flowId} of type ${flow.type}; expected one of ${NOTION_EVENT_TYPES.join(", ")}.`) + continue + } + const now = this.now().getTime() + if (!force && !this.isDue(flow, now)) continue + // Failed polls also wait for the next interval instead of retrying every tick. + const entry = { at: now, followUp: false } + this.schedule.set(flow.flowId, entry) + try { + entry.followUp = await this.poll(flow) + } catch (error) { + this.reportError(error) + } + } + } finally { + this.running = false + } + } + + private watch(flow: ActionFlow) { + const { token } = notionCredentials(rawSetting(flow, "integrationToken")) + const databaseId = setting(flow, "databaseId") + const propertyName = flow.type === "NotionPagePropertyChanged" ? setting(flow, "propertyName") : undefined + const fingerprint = createHash("sha256") + .update(JSON.stringify([flow.projectId.toString(), flow.type, databaseId, propertyName, token])) + .digest("hex") + return { token, databaseId, propertyName, fingerprint } + } + + private isCurrent(id: bigint, state: WatchState): boolean { + if (this.stopped || this.states.get(id) !== state) return false + const flow = this.action.flows.get(id) + try { + return !!flow && this.watch(flow).fingerprint === state.fingerprint + } catch { + return false + } + } + + /** Polls one flow; returns true when this poll established a new baseline. */ + private async poll(flow: ActionFlow): Promise { + const watch = this.watch(flow) + const now = this.now() + const startedAt = now.toISOString() + let state = this.states.get(flow.flowId) + if (!state || state.fingerprint !== watch.fingerprint) { + // Notion rounds created_time down to the minute, so a page created in the + // activation minute would otherwise look older than the watch. + const activatedAt = Math.floor(now.getTime() / MINUTE_MS) * MINUTE_MS * 1000 + state = { fingerprint: watch.fingerprint, activatedAt, pages: new Map() } + this.states.set(flow.flowId, state) + } + const baseline = state.cursor === undefined + // Inclusive cursor plus overlap covers equal timestamps and short indexing delays. + const since = state.cursor ? new Date(Date.parse(state.cursor) - 60_000).toISOString() : undefined + const client = new NotionClient(watch.token) + const dataSourceId = state.dataSourceId ?? (await client.resolveDataSourceId(watch.databaseId)) + if (!this.isCurrent(flow.flowId, state)) return false + state.dataSourceId = dataSourceId + const result = await client.queryDataSource( + dataSourceId, + since ? { timestamp: "last_edited_time", last_edited_time: { on_or_after: since } } : undefined, + [{ timestamp: "last_edited_time", direction: "ascending" }] + ) + if (!this.isCurrent(flow.flowId, state)) return false + const columns = new Set() + for (const item of result.results) { + if (item.object !== "page") continue // Wiki data sources may also return data sources. + // SDK responses can include partial objects without accessible properties. + const parsed = NotionPageSchema.safeParse(item) + if (!parsed.success) continue + const page = parsed.data + for (const name of Object.keys(page.properties)) columns.add(name) + const previous = state.pages.get(page.id) + const snapshot = { edited: page.last_edited_time, property: watch.propertyName ? (page.properties[watch.propertyName] ?? null) : null } + let changed = false + if (!baseline) { + if (flow.type === "NotionDatabaseItemCreated") changed = !previous && page.created_time >= state.activatedAt + if (flow.type === "NotionDatabaseItemUpdated") + changed = previous + ? page.last_edited_time > previous.edited + : page.last_edited_time >= Date.parse(state.cursor!) * 1000 && page.last_edited_time > page.created_time + if (flow.type === "NotionPagePropertyChanged") changed = !!previous && !isDeepStrictEqual(previous.property, snapshot.property) + } + if (changed) { + if (!this.isCurrent(flow.flowId, state)) return false + // A class-wide fire would incorrectly dispatch to other databases/projects. + await this.fire(flow.flowId, page) + this.log(`Triggered flow ${flow.flowId} (${flow.type}) for page ${page.id}.`) + if (!this.isCurrent(flow.flowId, state)) return false + } + // Advance only after successful delivery. Already acknowledged pages are + // retained if a later page fails; the cursor itself stays unchanged. + state.pages.set(page.id, snapshot) + } + state.cursor = startedAt + if (baseline && watch.propertyName && columns.size > 0 && !columns.has(watch.propertyName)) { + // Property names are case-sensitive; a typo would otherwise never fire. + this.info(`missing:${flow.flowId}:${watch.fingerprint}`, + `Flow ${flow.flowId}: database ${watch.databaseId} has no property "${watch.propertyName}". Available: ${[...columns].join(", ")}.`) + } + if (baseline) { + const property = watch.propertyName ? `, property "${watch.propertyName}"` : "" + this.info(`baseline:${flow.flowId}:${watch.fingerprint}`, + `Flow ${flow.flowId} (${flow.type}) watches database ${watch.databaseId}${property}; baseline of ${state.pages.size} page(s), changes from now on trigger it.`) + } + return baseline + } + + private async fire(flowId: bigint, page: NotionPage): Promise { + let timer: ReturnType | undefined + try { + await Promise.race([ + this.action.fire(flowId, page), + new Promise((_, reject) => { + timer = setTimeout( + () => reject(new RuntimeError("NOTION_FLOW_TIMEOUT", "Flow acknowledgement timed out; delivery will be retried.")), + 60_000 + ) + }), + ]) + } finally { + if (timer) clearTimeout(timer) + } + } +} diff --git a/actions/notion-action/src/tests/action.test.ts b/actions/notion-action/src/tests/action.test.ts new file mode 100644 index 0000000..42a9791 --- /dev/null +++ b/actions/notion-action/src/tests/action.test.ts @@ -0,0 +1,48 @@ +import { describe, expect, it, vi } from "vitest"; +import { action } from "../index.js"; +import { supportingSchemaNames } from "../generated/notion-schema-order.js"; + +vi.mock("@code0-tech/hercules", async (importOriginal) => { + const actual = await importOriginal(); + return { ...actual, isExportMode: () => true }; +}); + +describe("Hercules registration", () => { + it("builds a module with all functions, data types and matching runtime events", () => { + expect(action.runtimeFunctions.size).toBe(5); + expect(action.dataTypes.size).toBe(6 + supportingSchemaNames.length); + expect(action.events.size).toBe(3); + expect(action.runtimeEvents.size).toBe(3); + for (const event of action.events.values()) { + const runtime = action.runtimeEvents.get(event.runtimeIdentifier!); + expect(runtime?.signature).toBe(event.signature); + expect(runtime?.settings).toEqual(event.settings); + expect(event.signature).toContain("NOTION_PAGE"); + } + const propertyEvent = action.events.get("NotionPagePropertyChanged"); + expect(propertyEvent?.settings?.map((setting) => setting.identifier).sort()).toEqual(["databaseId", "integrationToken", "pollIntervalSeconds", "propertyName"]); + expect(() => action.buildModule()).not.toThrow(); + }); + + it("takes the integration token per function and trigger instead of a module configuration", () => { + expect(action.dataTypes.has("NOTION_INTEGRATION_TOKEN")).toBe(false); + for (const fn of action.runtimeFunctions.values()) { + expect(fn.signature).toMatch(/^\(integrationToken: string, /); + // A closed parameter list followed by the return type. + expect(fn.signature).toMatch(/^\(.*\): [A-Z_a-z]+$/); + expect(fn.signature.split("(").length).toBe(fn.signature.split(")").length); + } + for (const event of action.events.values()) { + expect(event.signature).toMatch(/^\(integrationToken: string, /); + expect(event.settings?.find((setting) => setting.identifier === "pollIntervalSeconds")?.optional).toBe(true); + } + expect(action.buildModule().configurations ?? []).toHaveLength(0); + }); + + it("types response timestamps as DATE but keeps request timestamps as text", () => { + const page = action.dataTypes.get("NOTION_PAGE")!.type; + expect(page).toContain("created_time: DATE"); + expect(page).toContain("last_edited_time: DATE"); + expect(action.dataTypes.get("NOTION_PROPERTY_VALUE")!.type).toMatch(/expiry_time\??: string/); + }); +}); diff --git a/actions/notion-action/src/tests/client.test.ts b/actions/notion-action/src/tests/client.test.ts new file mode 100644 index 0000000..5bb5fbc --- /dev/null +++ b/actions/notion-action/src/tests/client.test.ts @@ -0,0 +1,144 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { NotionClient, withNotionDates } from "../client.js"; +import { list, page, parsed, TOKEN } from "./fixtures.js"; +import { mockDataSources, mockNotionHttp } from "./httpMock.js"; + +const http = vi.hoisted(() => ({ request: vi.fn() })); +let fetchMock: ReturnType; +beforeEach(() => { vi.clearAllMocks(); http.request.mockReset(); fetchMock = mockNotionHttp(http.request); }); +afterEach(() => { vi.useRealTimers(); vi.unstubAllEnvs(); vi.unstubAllGlobals(); }); + +describe("Notion timestamps", () => { + it("converts ISO timestamps of known fields into DATE microseconds", () => { + expect(withNotionDates({ + created_time: "2026-09-01T10:00:00.000Z", + nested: [{ last_edited_time: "2026-09-01T10:00:00.500Z", file: { expiry_time: "2026-09-01T11:00:00.000Z" } }], + date: { start: "2026-09-01", end: null }, + title: "2026-09-01T10:00:00.000Z", + })).toEqual({ + created_time: 1788256800000000, + nested: [{ last_edited_time: 1788256800500000, file: { expiry_time: 1788260400000000 } }], + date: { start: "2026-09-01", end: null }, + title: "2026-09-01T10:00:00.000Z", + }); + }); + + it("leaves unparseable timestamps for response validation to reject", () => { + expect(withNotionDates({ created_time: "yesterday" })).toEqual({ created_time: "yesterday" }); + }); +}); + +describe("Notion API client", () => { + it("uses the given integration token and the pinned header", async () => { + http.request.mockResolvedValue({ data: page() }); + await new NotionClient(TOKEN).getPage("page"); + await new NotionClient("other-token").getPage("page"); + const first = new Headers(fetchMock.mock.calls[0][1]?.headers); + const second = new Headers(fetchMock.mock.lastCall?.[1]?.headers); + expect(first.get("authorization")).toBe("Bearer test-token"); + expect(first.get("notion-version")).toBe("2025-09-03"); + expect(second.get("authorization")).toBe("Bearer other-token"); + expect(fetchMock.mock.calls[0][1]?.redirect).toBe("error"); + }); + + it("rejects a missing integration token", () => { + expect(() => new NotionClient("")).toThrow(/integration token/); + expect(() => new NotionClient(" ")).toThrow(/integration token/); + }); + + it("collects data source pages and preserves the filter and sort across cursors", async () => { + http.request.mockResolvedValueOnce({ data: list([page()], "cursor-2") }).mockResolvedValueOnce({ data: list([page("page-2")]) }); + const filter = { timestamp: "last_edited_time" as const, last_edited_time: { on_or_after: "2026-09-01T00:00:00.000Z" } }; + const sorts = [{ timestamp: "last_edited_time" as const, direction: "ascending" as const }]; + const result = await new NotionClient(TOKEN).queryDataSource("ds/1", filter, sorts); + expect(result.results).toHaveLength(2); + expect(result).toMatchObject({ has_more: false, next_cursor: null }); + expect(http.request).toHaveBeenNthCalledWith(2, { method: "POST", url: "/data_sources/ds%2F1/query", data: { page_size: 100, filter, sorts, start_cursor: "cursor-2" } }); + }); + + it("paginates search even when an intermediate page has no results", async () => { + http.request.mockResolvedValueOnce({ data: list([], "cursor-2") }).mockResolvedValueOnce({ data: list([page()]) }); + expect((await new NotionClient(TOKEN).search("Tasks")).results).toHaveLength(1); + expect(http.request).toHaveBeenLastCalledWith({ method: "POST", url: "/search", data: { query: "Tasks", page_size: 100, start_cursor: "cursor-2" } }); + }); + + it("rejects looping or missing pagination cursors", async () => { + http.request.mockResolvedValue({ data: list([], "same") }); + await expect(new NotionClient(TOKEN).queryDataSource("ds")).rejects.toMatchObject({ code: "NOTION_INVALID_CURSOR" }); + expect(http.request).toHaveBeenCalledTimes(2); + http.request.mockResolvedValue({ data: { ...list([]), has_more: true } }); + await expect(new NotionClient(TOKEN).search("")).rejects.toMatchObject({ code: "NOTION_INVALID_CURSOR" }); + }); + + it("omits optional arguments that a flow passes as null", async () => { + const client = new NotionClient(TOKEN); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await client.queryDataSource("ds", null, null); + expect(http.request).toHaveBeenLastCalledWith({ method: "POST", url: "/data_sources/ds/query", data: { page_size: 100 } }); + http.request.mockResolvedValueOnce({ data: page() }); + await client.createPage("db", "", null); + expect(http.request).toHaveBeenLastCalledWith({ method: "POST", url: "/pages", data: { parent: { data_source_id: "db-ds" }, properties: { title: { title: [] } } } }); + }); + + it("sends page content as Notion-flavored Markdown", async () => { + const client = new NotionClient(TOKEN); + http.request.mockResolvedValueOnce({ data: page() }); + await client.createPage("db", "Summary", "# Summary\n\n- [ ] Ship"); + expect(http.request).toHaveBeenLastCalledWith({ method: "POST", url: "/pages", data: { parent: { data_source_id: "db-ds" }, properties: { title: { title: [{ type: "text", text: { content: "Summary" } }] } }, markdown: "# Summary\n\n- [ ] Ship", markdown_version: "v2" } }); + http.request.mockResolvedValueOnce({ data: page() }); + await client.createPage("db", "Summary", ""); + expect(http.request.mock.lastCall?.[0].data).not.toHaveProperty("markdown"); + await expect(client.createPage("db", "Summary", 1 as unknown as string)).rejects.toMatchObject({ code: "NOTION_INVALID_MARKDOWN" }); + await expect(client.createPage("db", null as unknown as string)).rejects.toMatchObject({ code: "NOTION_INVALID_TITLE" }); + }); + + it("validates responses without dropping nested Notion fields", async () => { + const original = page("page-1", { icon: { type: "emoji", emoji: "🚀" }, properties: { Count: { id: "count", type: "formula", formula: { type: "number", number: 7 } } } }); + http.request.mockResolvedValueOnce({ data: original }).mockResolvedValueOnce({ data: { object: "page" } }); + const client = new NotionClient(TOKEN); + expect(await client.getPage("page-1")).toEqual({ ...parsed(original), markdown: "# Page content" }); + await expect(client.getPage("page-2")).rejects.toMatchObject({ code: "NOTION_INVALID_RESPONSE" }); + }); + + it("rejects empty IDs before issuing requests", async () => { + const client = new NotionClient(TOKEN); + await expect(client.getPage(" ")).rejects.toThrow(); + expect(http.request).not.toHaveBeenCalled(); + expect(fetchMock.databaseLookups).not.toHaveBeenCalled(); + }); + + it("rejects databases without exactly one data source before writing", async () => { + const client = new NotionClient(TOKEN); + mockDataSources.resolve = () => ["ds-1", "ds-2"]; + await expect(client.resolveDataSourceId("db")).rejects.toMatchObject({ code: "NOTION_MULTIPLE_DATA_SOURCES" }); + await expect(client.createPage("db", "Task")).rejects.toMatchObject({ code: "NOTION_MULTIPLE_DATA_SOURCES" }); + mockDataSources.resolve = () => []; + await expect(client.resolveDataSourceId("db")).rejects.toMatchObject({ code: "NOTION_NO_DATA_SOURCE" }); + expect(http.request).not.toHaveBeenCalled(); + }); + + it("honors Retry-After for 429 and retries only a bounded number of times", async () => { + vi.useFakeTimers(); + const error = { status: 429, headers: { "retry-after": "2" }, data: { object: "error", status: 429, code: "rate_limited", message: "Rate limited" } }; + http.request.mockResolvedValueOnce(error).mockResolvedValueOnce({ data: page() }); + const request = new NotionClient(TOKEN).getPage("page"); + await vi.advanceTimersByTimeAsync(1999); + expect(http.request).toHaveBeenCalledTimes(1); + await vi.advanceTimersByTimeAsync(1); + await expect(request).resolves.toMatchObject({ id: "page-1" }); + http.request.mockResolvedValue(error); + const rejected = expect(new NotionClient(TOKEN).getPage("page")).rejects.toMatchObject({ code: "NOTION_HTTP_429" }); + await vi.runAllTimersAsync(); + await rejected; + expect(http.request).toHaveBeenCalledTimes(5); + }); + + it("does not retry writes on ambiguous network failures or disclose credentials", async () => { + http.request.mockRejectedValue(new Error("Bearer secret-token")); + let failure: unknown; + try { await new NotionClient(TOKEN).createPage("db", "Task"); } catch (error) { failure = error; } + expect(failure).toMatchObject({ code: "NOTION_NETWORK_ERROR" }); + expect(JSON.stringify(failure)).not.toContain("secret-token"); + expect(http.request).toHaveBeenCalledTimes(1); + }); +}); diff --git a/actions/notion-action/src/tests/fixtures.ts b/actions/notion-action/src/tests/fixtures.ts new file mode 100644 index 0000000..e80f0b1 --- /dev/null +++ b/actions/notion-action/src/tests/fixtures.ts @@ -0,0 +1,36 @@ +import type { FunctionContext, ProjectConfiguration } from "@code0-tech/hercules"; +import { withNotionDates } from "../client.js"; +import type { NotionPage } from "../data_types/notionPage.js"; + +/** A page as the Notion API sends it: timestamps are ISO 8601 strings. */ +type ApiPage = Omit & { created_time: string; last_edited_time: string }; + +/** The integration token the tests call Notion with. */ +export const TOKEN = "test-token"; + +export function config(values: Record = {}, projectId = 1n): ProjectConfiguration { + return { projectId, configValues: Object.entries(values).map(([identifier, value]) => ({ identifier, value })), findConfig: (key) => values[key] }; +} + +export function context(values?: Record): FunctionContext { + return { projectId: 1n, executionId: "test", matchedConfig: config(values), executeFlow: async () => null }; +} + +export function page(id = "page-1", overrides: Partial = {}): ApiPage { + return { + object: "page", id, created_time: "2026-09-01T10:00:00.000Z", last_edited_time: "2026-09-01T10:00:00.000Z", + archived: false, url: `https://www.notion.so/${id}`, parent: { type: "database_id", database_id: "database-1" }, + icon: null, cover: null, in_trash: false, public_url: null, + created_by: { object: "user", id: "user-1" }, last_edited_by: { object: "user", id: "user-1" }, + properties: { Done: { id: "done", type: "checkbox", checkbox: false } }, ...overrides, + }; +} + +export function list(results: unknown[], next_cursor: string | null = null, type = "page_or_data_source") { + return { object: "list", type, [type]: {}, results, has_more: next_cursor !== null, next_cursor }; +} + +/** What the action hands to flows for an API response: timestamps as DATE values. */ +export function parsed(response: T): T { + return withNotionDates(response) as T; +} diff --git a/actions/notion-action/src/tests/functions/notionFunctions.test.ts b/actions/notion-action/src/tests/functions/notionFunctions.test.ts new file mode 100644 index 0000000..71a8eb9 --- /dev/null +++ b/actions/notion-action/src/tests/functions/notionFunctions.test.ts @@ -0,0 +1,82 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { NotionCreatePageFunction } from "../../functions/notionCreatePageFunction.js"; +import { NotionUpdatePageFunction } from "../../functions/notionUpdatePageFunction.js"; +import { NotionGetPageFunction } from "../../functions/notionGetPageFunction.js"; +import { NotionArchivePageFunction } from "../../functions/notionArchivePageFunction.js"; +import { NotionSearchFunction } from "../../functions/notionSearchFunction.js"; +import { context, list, page, parsed, TOKEN } from "../fixtures.js"; +import { mockDataSources, mockNotionHttp, mockPageMarkdown } from "../httpMock.js"; + +const http = vi.hoisted(() => ({ request: vi.fn() })); +let fetchMock: ReturnType; +beforeEach(() => { http.request.mockReset(); fetchMock = mockNotionHttp(http.request); }); +afterEach(() => vi.unstubAllGlobals()); + +describe("Notion functions", () => { + const markdown = "## Notes\n\nSome **bold** text"; + const titled = (content: string) => ({ title: { title: [{ type: "text", text: { content } }] } }); + + it("creates a database entry with a title and Markdown content", async () => { + http.request.mockResolvedValue({ data: page() }); + expect(await new NotionCreatePageFunction().run(context(), TOKEN, "database-1", " Task ", markdown)).toEqual(parsed(page())); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "POST", url: "/pages", data: { parent: { data_source_id: "database-1-ds" }, properties: titled("Task"), markdown, markdown_version: "v2" } }); + await new NotionCreatePageFunction().run(context(), TOKEN, "database-1", "Task", null); + expect(http.request.mock.lastCall?.[0].data).not.toHaveProperty("markdown"); + }); + + it("creates a subpage when the parent is a page", async () => { + http.request.mockResolvedValue({ data: page() }); + mockDataSources.resolve = (id) => id === "page-1" ? null : [`${id}-ds`]; + await new NotionCreatePageFunction().run(context(), TOKEN, "page-1", "Notes", markdown); + expect(fetchMock.databaseLookups).toHaveBeenCalledExactlyOnceWith("page-1"); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "POST", url: "/pages", data: { parent: { page_id: "page-1" }, properties: titled("Notes"), markdown, markdown_version: "v2" } }); + }); + + it("does not fall back to a page for other lookup failures", async () => { + mockDataSources.resolve = () => ["ds-1", "ds-2"]; + await expect(new NotionCreatePageFunction().run(context(), TOKEN, "database-1", "Task")).rejects.toMatchObject({ code: "NOTION_MULTIPLE_DATA_SOURCES" }); + expect(http.request).not.toHaveBeenCalled(); + }); + + it("changes the title and replaces the content as Markdown", async () => { + http.request.mockResolvedValue({ data: page() }); + expect(await new NotionUpdatePageFunction().run(context(), TOKEN, "page-1", "Renamed", markdown)).toEqual({ ...parsed(page()), markdown }); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "PATCH", url: "/pages/page-1", data: { properties: titled("Renamed") } }); + expect(fetchMock.markdownUpdates).toHaveBeenCalledExactlyOnceWith("page-1", { markdown_version: "v2", type: "replace_content", replace_content: { new_str: markdown } }); + }); + + it("leaves an empty title or content unchanged", async () => { + http.request.mockResolvedValue({ data: page() }); + const update = new NotionUpdatePageFunction(); + expect(await update.run(context(), TOKEN, "page-1", "", markdown)).toEqual({ ...parsed(page()), markdown }); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "GET", url: "/pages/page-1", data: undefined }); + http.request.mockClear(); + expect(await update.run(context(), TOKEN, "page-1", "Renamed", "")).toEqual(parsed(page())); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "PATCH", url: "/pages/page-1", data: { properties: titled("Renamed") } }); + await update.run(context(), TOKEN, "page-1", null, null); + expect(fetchMock.markdownUpdates).toHaveBeenCalledOnce(); + }); + + it("retrieves the requested page with its content as Markdown", async () => { + http.request.mockResolvedValue({ data: page() }); + mockPageMarkdown.value = "## Notes\n\n- [ ] Ship"; + expect(await new NotionGetPageFunction().run(context(), TOKEN, "page-1")).toEqual({ ...parsed(page()), markdown: "## Notes\n\n- [ ] Ship" }); + expect(http.request).toHaveBeenCalledWith({ method: "GET", url: "/pages/page-1", data: undefined }); + expect(fetchMock.markdownLookups).toHaveBeenCalledExactlyOnceWith("page-1", expect.any(URLSearchParams)); + expect(fetchMock.markdownLookups.mock.lastCall?.[1].get("markdown_version")).toBe("v2"); + }); + + it("returns the archive state confirmed by Notion", async () => { + http.request.mockResolvedValueOnce({ data: page("page-1", { in_trash: true }) }).mockResolvedValueOnce({ data: page() }); + const fn = new NotionArchivePageFunction(); + expect(await fn.run(context(), TOKEN, "page-1")).toBe(true); + expect(http.request).toHaveBeenCalledWith({ method: "PATCH", url: "/pages/page-1", data: { in_trash: true } }); + expect(await fn.run(context(), TOKEN, "page-1")).toBe(false); + }); + + it("searches titles for the given text", async () => { + http.request.mockResolvedValue({ data: list([page()]) }); + expect((await new NotionSearchFunction().run(context(), TOKEN, "Task")).results).toHaveLength(1); + expect(http.request).toHaveBeenCalledExactlyOnceWith({ method: "POST", url: "/search", data: { query: "Task", page_size: 100 } }); + }); +}); diff --git a/actions/notion-action/src/tests/httpMock.ts b/actions/notion-action/src/tests/httpMock.ts new file mode 100644 index 0000000..19e00d5 --- /dev/null +++ b/actions/notion-action/src/tests/httpMock.ts @@ -0,0 +1,62 @@ +import { vi } from "vitest"; + +type NotionRequest = { method?: string; url: string; data: unknown }; + +/** + * Data source IDs a mocked database resolves to. By default every database + * holds exactly one data source, `-ds`, so tests about other + * behaviour don't have to answer the lookup that precedes database requests. + * `null` answers the lookup as Notion does for a page ID. + */ +export const mockDataSources = { resolve: (databaseId: string): string[] | null => [`${databaseId}-ds`] }; + +/** + * The Markdown content every mocked page has (GET /pages/{id}/markdown). + * Content updates (PATCH /pages/{id}/markdown) answer with the new content. + */ +export const mockPageMarkdown = { value: "# Page content" }; + +// Exercise the real Notion SDK, replacing only its network boundary. +export function mockNotionHttp(request: (args: NotionRequest) => Promise<{ data: unknown; status?: number; headers?: HeadersInit }>) { + mockDataSources.resolve = (databaseId) => [`${databaseId}-ds`]; + mockPageMarkdown.value = "# Page content"; + const databaseLookups = vi.fn<(databaseId: string) => void>(); + const markdownLookups = vi.fn<(pageId: string, query: URLSearchParams) => void>(); + const markdownUpdates = vi.fn<(pageId: string, body: unknown) => void>(); + const fetchMock = vi.fn(async (url: string | URL | Request, init?: RequestInit) => { + const args = { + method: init?.method, + url: new URL(String(url)).pathname.replace(/^\/v1/, ""), + data: init?.body ? JSON.parse(String(init.body)) : undefined, + }; + const lookup = args.method === "GET" ? /^\/databases\/([^/]+)$/.exec(args.url) : null; + if (lookup) { + const databaseId = decodeURIComponent(lookup[1]); + databaseLookups(databaseId); + const sources = mockDataSources.resolve(databaseId); + if (sources === null) { + // Notion's answer for the ID of a page. + return new Response(JSON.stringify({ object: "error", status: 400, code: "validation_error", message: "Provided ID is a page, not a database." }), { status: 400 }); + } + const data_sources = sources.map((id) => ({ id, name: id })); + return new Response(JSON.stringify({ object: "database", id: databaseId, data_sources }), { status: 200 }); + } + const markdownUpdate = args.method === "PATCH" ? /^\/pages\/([^/]+)\/markdown$/.exec(args.url) : null; + if (markdownUpdate) { + const pageId = decodeURIComponent(markdownUpdate[1]); + markdownUpdates(pageId, args.data); + const content = (args.data as { replace_content?: { new_str?: string } }).replace_content?.new_str ?? ""; + return new Response(JSON.stringify({ object: "page_markdown", id: pageId, markdown: content, truncated: false, unknown_block_ids: [] }), { status: 200 }); + } + const markdown = args.method === "GET" ? /^\/pages\/([^/]+)\/markdown$/.exec(args.url) : null; + if (markdown) { + const pageId = decodeURIComponent(markdown[1]); + markdownLookups(pageId, new URL(String(url)).searchParams); + return new Response(JSON.stringify({ object: "page_markdown", id: pageId, markdown: mockPageMarkdown.value, truncated: false, unknown_block_ids: [] }), { status: 200 }); + } + const response = await request(args); + return new Response(JSON.stringify(response.data), { status: response.status ?? 200, headers: response.headers }); + }); + vi.stubGlobal("fetch", fetchMock); + return Object.assign(fetchMock, { databaseLookups, markdownLookups, markdownUpdates }); +} diff --git a/actions/notion-action/src/tests/polling.test.ts b/actions/notion-action/src/tests/polling.test.ts new file mode 100644 index 0000000..0a2b660 --- /dev/null +++ b/actions/notion-action/src/tests/polling.test.ts @@ -0,0 +1,327 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { Action, CodeZeroEvent } from "@code0-tech/hercules"; +import { ActionFlow } from "@code0-tech/tucana/aquila"; +import { constructValue } from "@code0-tech/tucana/helpers"; +import { NotionPoller, pollIntervalFromEnv } from "../polling.js"; +import { list, page, parsed, TOKEN } from "./fixtures.js"; +import { mockNotionHttp } from "./httpMock.js"; + +const http = vi.hoisted(() => ({ request: vi.fn() })); + +interface Watch { token?: string | null; interval?: number | string } + +function flow(type = "NotionDatabaseItemCreated", flowId = 1n, projectId = 1n, databaseId = "db-1", propertyName = "Done", watch: Watch = {}) { + const token = watch.token === undefined ? TOKEN : watch.token; + return ActionFlow.create({ + flowId, projectId, type, + settings: [ + ...(token === null ? [] : [{ flowSettingId: "integrationToken", value: constructValue(token) }]), + { flowSettingId: "databaseId", value: constructValue(databaseId) }, + ...(type === "NotionPagePropertyChanged" ? [{ flowSettingId: "propertyName", value: constructValue(propertyName) }] : []), + ...(watch.interval === undefined ? [] : [{ flowSettingId: "pollIntervalSeconds", value: constructValue(watch.interval) }]), + ], + }); +} + +function setup(type?: string, options: { realClock?: boolean; watch?: Watch } = {}) { + const action = new Action("notion-test", "1.0.0", "localhost:50051", "code0-tech", "simple:notion", "", []); + action.flows.set(1n, flow(type, 1n, 1n, "db-1", "Done", options.watch)); + const fire = vi.spyOn(action, "fire").mockResolvedValue(null); + const errors = vi.fn(); + const log = vi.fn(); + let now = new Date("2026-09-14T10:00:00.000Z"); + // Timer tests need a running clock (faked by vi.useFakeTimers) for the per-flow schedule. + const poller = new NotionPoller(action, 60_000, errors, options.realClock ? () => new Date() : () => now, log); + return { action, fire, errors, log, poller, setTime: (time: string) => { now = new Date(time); } }; +} + +let fetchMock: ReturnType; +beforeEach(() => { vi.clearAllMocks(); http.request.mockReset(); fetchMock = mockNotionHttp(http.request); }); +afterEach(() => { vi.useRealTimers(); vi.unstubAllGlobals(); }); + +describe("Notion polling", () => { + it("baselines all pages, then fires only newly created pages once", async () => { + const { poller, fire, setTime } = setup(); + http.request.mockResolvedValueOnce({ data: list([page()], "next") }).mockResolvedValueOnce({ data: list([page("old-2")]) }); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + expect(http.request).toHaveBeenCalledTimes(2); + const added = page("new", { created_time: "2026-09-14T10:00:30.000Z", last_edited_time: "2026-09-14T10:00:30.000Z" }); + setTime("2026-09-14T10:01:00.000Z"); + http.request.mockResolvedValue({ data: list([page(), added]) }); + await poller.tick(); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(added)); + expect(http.request.mock.calls[2][0].data.filter).toEqual({ timestamp: "last_edited_time", last_edited_time: { on_or_after: "2026-09-14T09:59:00.000Z" } }); + }); + + it("fires updates but not repeated timestamps or initial history", async () => { + const { poller, fire } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + const edited = page("page-1", { last_edited_time: "2026-09-14T10:00:30.000Z" }); + http.request.mockResolvedValue({ data: list([edited]) }); + await poller.tick(); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(edited)); + }); + + it("detects property changes including clearing but ignores other edits and object key order", async () => { + const { poller, fire } = setup("NotionPagePropertyChanged"); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + const reordered = page("page-1", { last_edited_time: "2026-09-14T10:01:00.000Z", properties: { Done: { checkbox: false, type: "checkbox", id: "done" }, Other: { number: 1 } } }); + http.request.mockResolvedValueOnce({ data: list([reordered]) }); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + const edited = page("page-1", { last_edited_time: "2026-09-14T10:01:00.000Z", properties: { Done: { id: "done", type: "checkbox", checkbox: true } } }); + http.request.mockResolvedValue({ data: list([edited]) }); + await poller.tick(); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(edited)); + const cleared = page("page-1", { properties: {} }); + http.request.mockResolvedValueOnce({ data: list([cleared]) }); + await poller.tick(); + expect(fire).toHaveBeenCalledTimes(2); + }); + + it("uses first observation of a new page as its property baseline", async () => { + const { poller, fire } = setup("NotionPagePropertyChanged"); + http.request.mockResolvedValueOnce({ data: list([]) }).mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + }); + + it("delivers two pages with identical timestamps and deduplicates overlapping polls", async () => { + const { poller, fire } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page("a"), page("b")]) }); + await poller.tick(); + const changed = ["a", "b"].map((id) => page(id, { last_edited_time: "2026-09-14T10:00:30.000Z" })); + http.request.mockResolvedValue({ data: list(changed) }); + await poller.tick(); + await poller.tick(); + expect(fire).toHaveBeenCalledTimes(2); + }); + + it("retries failed delivery without refiring pages already acknowledged", async () => { + const { poller, fire, errors } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page("a"), page("b")]) }); + await poller.tick(); + const changed = ["a", "b"].map((id) => page(id, { last_edited_time: "2026-09-14T10:00:30.000Z" })); + http.request.mockResolvedValue({ data: list(changed) }); + fire.mockResolvedValueOnce(null).mockRejectedValueOnce(new Error("Flow failed")); + await poller.tick(); + expect(errors).toHaveBeenCalledTimes(1); + await poller.tick(); + expect(fire.mock.calls.map((call) => (call[1] as { id: string }).id)).toEqual(["a", "b", "b"]); + }); + + it("does not advance state or deliver a partial batch if pagination fails", async () => { + const { poller, fire, errors } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + const edited = page("page-1", { last_edited_time: "2026-09-14T10:00:30.000Z" }); + http.request.mockResolvedValueOnce({ data: list([edited], "next") }).mockRejectedValueOnce(new Error("Network failure")); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + expect(errors).toHaveBeenCalledTimes(1); + http.request.mockResolvedValueOnce({ data: list([edited]) }); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(edited)); + }); + + it("isolates flows and projects with the same page IDs", async () => { + const { action, poller, fire } = setup("NotionDatabaseItemUpdated"); + action.flows.set(2n, flow("NotionDatabaseItemUpdated", 2n, 2n, "db-2", "Done", { token: "project-2" })); + http.request.mockResolvedValue({ data: list([page()]) }); + await poller.tick(); + const edited = page("page-1", { last_edited_time: "2026-09-14T10:00:30.000Z" }); + http.request.mockResolvedValueOnce({ data: list([edited]) }).mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(edited)); + expect(http.request.mock.calls.map((call) => call[0].url)).toEqual(["/data_sources/db-1-ds/query", "/data_sources/db-2-ds/query", "/data_sources/db-1-ds/query", "/data_sources/db-2-ds/query"]); + }); + + it("resolves the database's data source once per watch", async () => { + const { action, poller } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValue({ data: list([page()]) }); + await poller.tick(); + await poller.tick(); + expect(fetchMock.databaseLookups).toHaveBeenCalledExactlyOnceWith("db-1"); + action.flows.set(1n, flow("NotionDatabaseItemUpdated", 1n, 1n, "new-db")); + await poller.tick(); + expect(fetchMock.databaseLookups).toHaveBeenLastCalledWith("new-db"); + expect(fetchMock.databaseLookups).toHaveBeenCalledTimes(2); + }); + + it("logs the watch state once per flow instead of skipping silently", async () => { + const { action, poller, log, errors } = setup("NotionPagePropertyChanged"); + action.flows.set(2n, flow("SomethingElse", 2n)); + action.flows.set(3n, flow("NotionDatabaseItemCreated", 3n, 1n, "db-1", "Done", { token: null })); + http.request.mockResolvedValue({ data: list([page()]) }); + await poller.tick(); + await poller.tick(); + const messages = log.mock.calls.map(([message]) => message); + expect(messages.filter((message) => message.includes("Ignoring flow 2 of type SomethingElse"))).toHaveLength(1); + expect(errors).toHaveBeenCalledWith(expect.objectContaining({ code: "NOTION_MISSING_TOKEN" })); + expect(messages.filter((message) => message.includes("Flow 1 (NotionPagePropertyChanged) watches database db-1, property \"Done\"; baseline of 1 page(s)"))).toHaveLength(1); + }); + + it("reports a watched property the database does not have", async () => { + const { action, poller, log } = setup("NotionPagePropertyChanged"); + action.flows.set(1n, flow("NotionPagePropertyChanged", 1n, 1n, "db-1", "done")); + http.request.mockResolvedValue({ data: list([page()]) }); + await poller.tick(); + expect(log.mock.calls.map(([message]) => message)).toContainEqual(expect.stringMatching(/has no property "done"\. Available: .*Done/)); + }); + + it("skips flows without an integration token and ignores unrelated events", async () => { + const { action, poller, errors } = setup(undefined, { watch: { token: null } }); + await poller.tick(); + expect(http.request).not.toHaveBeenCalled(); + expect(errors).toHaveBeenCalledWith(expect.objectContaining({ code: "NOTION_MISSING_TOKEN" })); + action.flows.set(1n, flow("Unrelated")); + await poller.tick(); + expect(http.request).not.toHaveBeenCalled(); + }); + + it("rebaselines when credentials or watched settings change", async () => { + const { action, poller, fire } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + action.flows.set(1n, flow("NotionDatabaseItemUpdated", 1n, 1n, "db-1", "Done", { token: "rotated" })); + http.request.mockResolvedValue({ data: list([page("page-1", { last_edited_time: "2026-09-14T10:00:30.000Z" })]) }); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + expect(http.request.mock.lastCall?.[0].data.filter).toBeUndefined(); + action.flows.set(1n, flow("NotionDatabaseItemUpdated", 1n, 1n, "new-db")); + await poller.tick(); + expect(fire).not.toHaveBeenCalled(); + expect(http.request.mock.lastCall?.[0].url).toBe("/data_sources/new-db-ds/query"); + }); + + it("rejects overlapping polls and discards results for a deleted flow", async () => { + const { action, poller, fire } = setup(); + let resolve!: (value: unknown) => void; + http.request.mockReturnValue(new Promise((done) => { resolve = done; })); + const first = poller.tick(); + // The data source lookup precedes the query; wait until it is in flight. + await vi.waitFor(() => expect(http.request).toHaveBeenCalledTimes(1)); + await poller.tick(); + expect(http.request).toHaveBeenCalledTimes(1); + action.flows.delete(1n); + resolve({ data: list([page()]) }); + await first; + expect(fire).not.toHaveBeenCalled(); + }); + + it("does not stall all subsequent polls on a missing flow acknowledgement", async () => { + vi.useFakeTimers(); + const { poller, fire, errors } = setup("NotionDatabaseItemUpdated"); + http.request.mockResolvedValueOnce({ data: list([page()]) }); + await poller.tick(); + http.request.mockResolvedValue({ data: list([page("page-1", { last_edited_time: "2026-09-14T10:00:30.000Z" })]) }); + fire.mockImplementationOnce(() => new Promise(() => {})); + const tick = poller.tick(); + await vi.advanceTimersByTimeAsync(60_000); + await tick; + expect(errors).toHaveBeenCalledWith(expect.objectContaining({ code: "NOTION_FLOW_TIMEOUT" })); + await poller.tick(); + expect(fire).toHaveBeenCalledTimes(2); + }); + + it("starts one timer and removes listeners and stops requests on shutdown", async () => { + vi.useFakeTimers(); + const { action, poller } = setup(undefined, { realClock: true }); + http.request.mockResolvedValue({ data: list([]) }); + poller.start(); + poller.start(); + // Baseline, then the follow-up after 10s; the regular 60s interval is not due yet. + await vi.advanceTimersByTimeAsync(60_000); + expect(http.request).toHaveBeenCalledTimes(2); + expect(action.listenerCount(CodeZeroEvent.flowDeleted)).toBe(1); + poller.stop(); + await vi.advanceTimersByTimeAsync(120_000); + await poller.tick(); + expect(http.request).toHaveBeenCalledTimes(2); + expect(action.listenerCount(CodeZeroEvent.flowDeleted)).toBe(0); + }); + + it("polls again 10 seconds after a new baseline, then only on the interval", async () => { + vi.useFakeTimers(); + const { poller } = setup(undefined, { realClock: true }); + http.request.mockResolvedValue({ data: list([]) }); + poller.start(); + await vi.advanceTimersByTimeAsync(0); + expect(http.request).toHaveBeenCalledTimes(1); + await vi.advanceTimersByTimeAsync(10_000); + expect(http.request).toHaveBeenCalledTimes(2); + // No further follow-up once the baseline exists; the next poll is 60s after the follow-up. + await vi.advanceTimersByTimeAsync(50_000); + expect(http.request).toHaveBeenCalledTimes(2); + await vi.advanceTimersByTimeAsync(10_000); + expect(http.request).toHaveBeenCalledTimes(3); + poller.stop(); + }); + + it("uses each flow's own pollIntervalSeconds", async () => { + vi.useFakeTimers(); + const { action, poller } = setup(undefined, { realClock: true, watch: { interval: 20 } }); + action.flows.set(2n, flow("NotionDatabaseItemCreated", 2n, 2n, "db-1", "Done", { token: "other-token" })); + http.request.mockResolvedValue({ data: list([]) }); + poller.start(); + await vi.advanceTimersByTimeAsync(10_000); // baselines and follow-ups of both flows + const afterFollowUps = http.request.mock.calls.length; + expect(afterFollowUps).toBe(4); + await vi.advanceTimersByTimeAsync(20_000); // flow 1 is due every 20s, flow 2 every 60s + expect(http.request.mock.calls.length - afterFollowUps).toBe(1); + await vi.advanceTimersByTimeAsync(40_000); + // 70s: flow 1 polled at 30s, 50s and 70s; flow 2 once at 70s. + expect(http.request.mock.calls.length - afterFollowUps).toBe(4); + poller.stop(); + }); + + it("falls back for invalid or too small intervals and keeps the baseline on changes", async () => { + vi.useFakeTimers(); + const { action, poller, log } = setup(undefined, { realClock: true, watch: { interval: 3 } }); + http.request.mockResolvedValue({ data: list([]) }); + poller.start(); + await vi.advanceTimersByTimeAsync(30_000); + expect(log.mock.calls.map(([message]) => message)).toContainEqual(expect.stringContaining("pollIntervalSeconds 3s is below the minimum; using 10s")); + // Changing only the interval must not start a new baseline. + const updated = flow(undefined, 1n, 1n, "db-1", "Done", { interval: "soon" }); + action.flows.set(1n, updated); + action.emit(CodeZeroEvent.flowUpdated, updated); + await vi.advanceTimersByTimeAsync(60_000); + const messages = log.mock.calls.map(([message]) => message); + expect(messages).toContainEqual(expect.stringContaining('ignoring invalid pollIntervalSeconds "soon"; using 60s')); + expect(messages.filter((message) => message.includes("baseline of"))).toHaveLength(1); + poller.stop(); + }); + + it("fires for a page created in the activation minute despite Notion's minute rounding", async () => { + const { poller, fire, setTime } = setup(); + setTime("2026-09-14T10:00:20.000Z"); + http.request.mockResolvedValueOnce({ data: list([]) }); + await poller.tick(); + // Created at 10:00:40, which Notion reports as 10:00:00. + const added = page("new", { created_time: "2026-09-14T10:00:00.000Z", last_edited_time: "2026-09-14T10:00:00.000Z" }); + setTime("2026-09-14T10:01:00.000Z"); + http.request.mockResolvedValue({ data: list([added]) }); + await poller.tick(); + expect(fire).toHaveBeenCalledExactlyOnceWith(1n, parsed(added)); + }); + + it("reads the poll interval from the environment with a 10 second minimum", () => { + const warn = vi.fn(); + expect(pollIntervalFromEnv(undefined, warn)).toBe(60_000); + expect(pollIntervalFromEnv("", warn)).toBe(60_000); + expect(pollIntervalFromEnv("15000", warn)).toBe(15_000); + expect(warn).not.toHaveBeenCalled(); + expect(pollIntervalFromEnv("2000", warn)).toBe(10_000); + expect(pollIntervalFromEnv("soon", warn)).toBe(60_000); + expect(pollIntervalFromEnv("-5", warn)).toBe(60_000); + expect(warn).toHaveBeenCalledTimes(3); + }); +}); diff --git a/actions/notion-action/tsconfig.json b/actions/notion-action/tsconfig.json new file mode 100644 index 0000000..4f8a418 --- /dev/null +++ b/actions/notion-action/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "noEmit": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "types": ["node"] + }, + "include": ["src/**/*", "vite.config.ts"] +} diff --git a/actions/notion-action/vite.config.ts b/actions/notion-action/vite.config.ts new file mode 100644 index 0000000..ac9c7cd --- /dev/null +++ b/actions/notion-action/vite.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "vite"; +import { fileURLToPath } from "node:url"; + +export default defineConfig({ + build: { + target: "node22", + ssr: fileURLToPath(new URL("./src/index.ts", import.meta.url)), + rollupOptions: { + external: (id) => ["@code0-tech/hercules", "@code0-tech/tucana/helpers", "@notionhq/client", "zod", "reflect-metadata"].includes(id) || id.startsWith("node:"), + }, + }, +}); diff --git a/scripts/openapi-to-zod.mjs b/scripts/openapi-to-zod.mjs index a6cac29..d683cdf 100644 --- a/scripts/openapi-to-zod.mjs +++ b/scripts/openapi-to-zod.mjs @@ -76,6 +76,12 @@ const IGNORED_KEYWORDS = new Set([ "dependentRequired", "dependentSchemas", "unevaluatedProperties", ]); +// `x-hercules-schema: ""` replaces a node with a schema exported by +// @code0-tech/hercules (e.g. "dateSchema"), so the hercules type export +// references that data type (e.g. DATE) by identifier. Sibling `type` keywords +// are ignored; nullability still applies. +const herculesImports = new Set(); + // Component names may contain characters invalid in JS identifiers // (e.g. "billing.credit_grant", "test_helpers.test_clock"). const ident = (name) => name.replace(/[^a-zA-Z0-9_$]/g, "_"); @@ -307,7 +313,12 @@ function toZod(node) { return "z.any()"; } assertKnown(node); - let expr = coreExpr(node); + const hercules = node["x-hercules-schema"]; + if (hercules !== undefined && !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(hercules)) { + throw new Error(`Invalid x-hercules-schema export name: ${JSON.stringify(hercules)}`); + } + if (hercules) herculesImports.add(hercules); + let expr = hercules ?? coreExpr(node); if (isNullable(node) && expr !== "z.null()") { expr = `${expr}.nullable()`; } @@ -425,6 +436,10 @@ for (const name of names) { lines.push(`const ${ident(name)}${annotation} = z.lazy(() => ${toZod(schemas[name])});`); } +if (herculesImports.size > 0) { + lines.splice(3, 0, `import {${[...herculesImports].sort().join(", ")}} from "@code0-tech/hercules";`); +} + lines.push(""); lines.push("export const schemas = {"); for (const name of names) {