feat(adapter-notion): extract canonical Notion query helpers#27
Merged
khaliqgant merged 3 commits intomainfrom Apr 26, 2026
Merged
feat(adapter-notion): extract canonical Notion query helpers#27khaliqgant merged 3 commits intomainfrom
khaliqgant merged 3 commits intomainfrom
Conversation
Tracks relayfile-adapters#24 - one canonical home for Notion API request knowledge so cloud route.ts, cloud api fallback, and sage nango-integrations syncs all consume the same operation builders instead of holding duplicate request-shape logic. New exports under @relayfile/adapter-notion: - searchPages(), searchDatabases(), queryDatabase() - getPage(), getBlockChildren() - buildDatabaseFilter() for Notion database query filters - Response types for Notion list, page, database, block, and generic objects Operation payloads are the UNION of what cloud + sage consumers need. Validated against: 1. Nango integration-templates for Notion (canonical baseline) 2. sage nango-integrations/notion-sage/syncs/*.ts (production-proven) 3. cloud packages/web/app/api/v1/notion/query/route.ts + api fallback Live verification: Search helpers were POSTed through the real Nango proxy using sage NANGO_SECRET_KEY, with connection IDs dynamically discovered via nango.listConnections(). Optional env-provided page/database/block IDs verify the ID-specific helpers when available. Version: minor bump (additive - new exports, no breaking changes). Follow-up PRs (tracked in relayfile-adapters#24): - cloud refactor: import from @relayfile/adapter-notion, drop local copies - sage refactor: same for nango-integrations/notion-sage/syncs/* Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 1 extract PR for relayfile-adapters#24. Adds a canonical Notion REST operation builders + database filter helpers + response types module under .
Bump: minor -> 0.1.4.
What changed
Sources
Live verification
Search helpers were run through the real Nango proxy using sage NANGO_SECRET_KEY, with the connection ID dynamically discovered via nango.listConnections(). Optional NOTION_VERIFY_DATABASE_ID, NOTION_VERIFY_PAGE_ID, and NOTION_VERIFY_BLOCK_ID extend live coverage for ID-specific helpers when available.
Follow-up PRs
After this PR merges and republishes:
Validation
TAP version 13
Subtest: block tree ingestion
ok 1 - block tree ingestion
duration_ms: 1.825
type: 'suite'
...
Subtest: NotionApiClient
ok 2 - NotionApiClient
duration_ms: 18.825625
type: 'suite'
...
Subtest: content metadata discovery
ok 3 - content metadata discovery
duration_ms: 3.000792
type: 'suite'
...
Subtest: path mapping
ok 4 - path mapping
duration_ms: 0.843542
type: 'suite'
...
Subtest: property serialization
ok 5 - property serialization
duration_ms: 2.362458
type: 'suite'
...
Subtest: Notion query helpers
ok 6 - Notion query helpers
duration_ms: 5.626625
type: 'suite'
...
Subtest: database query builder
ok 7 - database query builder
duration_ms: 2.087375
type: 'suite'
...
Subtest: blocks to markdown renderer
ok 8 - blocks to markdown renderer
duration_ms: 1.127042
type: 'suite'
...
Subtest: sync change detection
ok 9 - sync change detection
duration_ms: 1.9265
type: 'suite'
...
Subtest: writeback rule matching
ok 10 - writeback rule matching
duration_ms: 1.379084
type: 'suite'
...
1..10
tests 26
suites 10
pass 26
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 375.335458 green
Generated with agent-relay.