findings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v26View latest version
Webhook handlers for Notion integrations.
POST /tasks/blob
- Process PDF extraction and blob storage for Notion pagesPOST /tasks/dupe
- Duplicate Notion page to final reports database with content filteringPOST /tasks/notion-webhook
- General Notion webhook handlerPOST /tasks/test
- Test endpoint for webhook authenticationGET /tasks/debug-webhook
- Debug endpoint to check webhook configuration
Routes handle HTTP request/response only. Business logic is delegated to:
tasks.controller.ts
- Orchestrates PDF extraction, blob storage, page duplication, and Notion updatesnotion.service.ts
- Handles Notion API callspdfExtractor.ts
- Handles PDF text extraction
The /tasks/dupe
endpoint duplicates a Notion page from any database to the final reports database (FINDINGS_REPORTS_FINAL_DB_ID
) with content filtering:
- Removes: Callout blocks, code blocks, divider blocks, blocks containing "Evidence summary", blocks containing "Methodology", blocks containing "Executive summary"
- Preserves: All other content blocks in original order
- Source: Original page remains unchanged
Expects Notion webhook with page ID in data.id
:
{ "data": { "id": "page-id-here" } }
{ "success": true, "sourcePageId": "source-page-id", "targetPageId": "new-page-id", "blocksCopied": 15, "blocksFiltered": 3, "timestamp": "2025-08-15T22:25:47.000Z" }