Skip to content

feat: introduce DETECT_FIELDS for automatic detection of flattened fields#27

Merged
bendersej merged 54 commits intomainfrom
replace-create-fields-with-detect-fields
Mar 20, 2026
Merged

feat: introduce DETECT_FIELDS for automatic detection of flattened fields#27
bendersej merged 54 commits intomainfrom
replace-create-fields-with-detect-fields

Conversation

@bendersej
Copy link
Member

@bendersej bendersej commented Mar 20, 2026

Background

CREATE_FIELD required callers to manually specify each field's type, position, dimensions, and page - making programmatic field creation tedious and error-prone. DETECT_FIELDS replaces this by automatically detecting flattened form fields in a document.

Changes

  • Replace createField with detectFields() in the React embed component (EmbedActions, useEmbed, EmbedPDF)
  • Remove CreateFieldOptions discriminated union types and CreateFieldResult
  • Replace CREATE_FIELD with DETECT_FIELDS in iframe documentation
  • Simplify Playwright automation example: accept document URL/path inline, load local files via LOAD_DOCUMENT data URL, log detected field count
  • Remove config file indirection, zod dependency, and schema from automation example
  • Update all tests and type assertions
  • Update README docs across react, documentation, and root

Notes

Breaking change in theory but practically no usage for createField - safe to release as major.

- Remove fetch_pdf / reqwest (URL passthrough instead of re-upload)
- Fix ConnectInfo extraction (into_make_service_with_connect_info)
- Remove dead cleanup method from RateLimiter
- Add Content-Disposition: attachment to S3 uploads
- Remove unused aws-config and reqwest dependencies
- Pin all dependencies to latest versions
- Extract AgentResponse::new to deduplicate response building
- Bump JSON body limit from 64KB to 1MB
…point

- GET / serves SKILL.md as text/markdown for agent discovery
- POST /agents accepts ?companyIdentifier to route to custom portals
- Default editor: embed.simplepdf.com, with identifier: <id>.simplepdf.com
- Rename SIMPLEPDF_URL env to DEFAULT_EDITOR_HOST
- Enable axum multipart feature (required for Multipart extractor)
- Make rate limiter proxy-aware via X-Forwarded-For header
- URL-encode the open parameter to handle signed URLs correctly
- Fix react snippet to use EmbedPDF with documentURL prop
- Enable axum multipart feature (build fix)
- Fix tracing_subscriber::fmt::init() (build fix)
- Proxy-aware rate limiting with TRUST_PROXY env + bounded bucket eviction
- Validate companyIdentifier (subdomain pattern) and url (http/https only)
- HTML-escape all values in iframe/react snippets
- Include companyIdentifier in react snippet when present
- Correct privacy statement: file uploads stored temporarily (1hr)
- URL case is now GET /?url=... (no POST needed for URL passthrough)
- POST / reserved for file uploads only
- Rename agents.simplepdf.com -> agent.simplepdf.com
- Add Cargo.lock for reproducible builds
- Add .gitignore for target/
- Add GitHub Actions workflow (fmt, clippy, build)
Paketo Rust buildpack does not find Cargo.toml with source_dir.
Dockerfile gives full control over the build.
… hosts

- POST with JSON body for signed/sensitive URLs (keeps them out of logs)
- Default TRUST_PROXY to false, explicitly enable in production
- Use rightmost X-Forwarded-For hop instead of leftmost
- Remove agent.simplepdf.com from response example (implementation detail)
- Document GET vs POST URL choice in SKILL.md
- Add TRUST_PROXY to app.yaml reference config
- DEFAULT_EDITOR_HOST now ai.simplepdf.com (was embed.simplepdf.com)
- React snippet always includes companyIdentifier ("ai" as default)
- All response fields (url, iframe, react) point to same host
@cloudflare-workers-and-pages
Copy link

Deploying web-embed with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5ab91fc
Status: ✅  Deploy successful!
Preview URL: https://a930b31c.simplepdf-embed.pages.dev
Branch Preview URL: https://replace-create-fields-with-d.simplepdf-embed.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
simplepdf-webhooks 5ab91fc Commit Preview URL

Branch Preview URL
Mar 20 2026, 02:27 PM

@bendersej bendersej changed the title fix: replace CREATE_FIELD with DETECT_FIELDS across embed artifacts feat: introduce DETECT_FIELDS for automatic detection of flattened fields Mar 20, 2026
@bendersej bendersej merged commit 9069558 into main Mar 20, 2026
2 checks passed
@bendersej bendersej deleted the replace-create-fields-with-detect-fields branch March 20, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant