[Components] emboss - new app actions#21152
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
|
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
📝 WalkthroughWalkthroughThis PR adds a full Emboss integration: an API client, shared utilities, three Pipedream actions (create-fillable-form, fill-from-pdf-context, fill-existing-form) with polling and PDF output, package dependency updates, and README documentation. ChangesEmboss Component Integration
Sequence DiagramsequenceDiagram
participant Action as Pipedream Action
participant App as Emboss App
participant Flow as $.flow
participant FS as writePdf
Action->>App: createForm / createWithContext / fillExistingForm (multipart)
App-->>Action: job_id / form_id
Action->>Flow: rerun(delay, job_id/form_id)
loop Polling (bounded)
Action->>App: getForm / getContextJob
App-->>Action: status
alt ready
Action->>App: fillSession
App-->>Action: session_id
Action->>App: getSessionPdf / getFillablePdf
App-->>Action: pdf_bytes
Action->>FS: writePdf(pdf_bytes)
else not ready
Action->>Flow: rerun(delay, job_id/form_id)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/emboss/actions/fill-existing-form/fill-existing-form.mjs`:
- Around line 30-41: Update the prop descriptions for contextText and
contextFile to include concrete inline examples so AI agents can infer expected
formats: modify the description for contextText (symbol: contextText) to append
an example like "e.g., 'Customer name: John Doe, Order ID: 12345, Amount:
$99.99'" and update contextFile (symbol: contextFile) description to include
file-ref examples such as 'e.g., "/tmp/customer_data.pdf" or
"https://example.com/invoice.pdf" while keeping format: "file-ref" intact;
ensure the wording remains concise and optional: true unchanged.
- Line 14: Update the component's "description" string in fill-existing-form.mjs
to the expanded, agent-friendly version: state primary purpose, when to use,
cross-tool prerequisite (Create Fillable Form), required parameters (at least
one context input: text or file), behavior/gotcha (polls until fill job
completes with ~12 minute timeout), and keep the documentation link; replace the
current short description with the suggested full sentence so AI agents get
purpose, usage, parameter notes, and polling caveat.
In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs`:
- Around line 11-21: The action's description string (in the exported object
with key "emboss-fill-from-pdf-context" and name "Fill PDF From Context") is too
minimal for AI agents; replace the current description value with an expanded,
agent-friendly sentence that follows the pattern: primary purpose → when to use
(include job poll time ~12 minutes) → cross-tool alternatives (mention "Fill
Existing Form" and "Create Fillable Form") → any parameter notes (accepts flat
PDF + context text/file) → gotchas → docs link (https://getemboss.ai/docs).
Ensure the new text remains a single string assigned to the description property
of the default export.
- Around line 30-35: The description for the contextText property lacks an
inline example; update the contextText descriptor (property name: contextText)
by appending a short concrete example to its description string showing the
expected input format (e.g., a one- or two-sentence excerpt or bulleted lines
such as "Client: Acme Corp; Invoice: 12345; Notes: deliver by 6/1") so consumers
know how to structure the text; modify the description field inside the
fill-from-pdf-context module where contextText is defined to include that
example.
In `@components/emboss/common/utils.mjs`:
- Around line 52-58: The writePdf function concatenates name into /tmp without
validation; sanitize the name parameter in writePdf to prevent path traversal by
rejecting or normalizing inputs that contain directory separators or absolute
paths (e.g., strip path separators, use the basename-equivalent, or validate
against a safe filename regex), ensure the resulting filepath is strictly within
/tmp, and then write the buffer to that sanitized filepath before returning {
filepath }.
In `@components/emboss/README.md`:
- Around line 38-40: Update the "Step times out while polling" recommendation in
the README: change the suggested workflow execution timeout from "300 seconds"
to at least "720–750 seconds" (or state "at least 12–13 minutes") so polling can
complete; edit the text under the "Step times out while polling" paragraph in
components/emboss/README.md to reflect the new timeout guidance.
- Around line 35-37: Update the README text to match the actual polling budget
used by the Emboss actions: replace the "up to 5 minutes" wording with the real
duration computed from MAX_RETRIES = 144 and POLL_DELAY_MS = 5000 (approximately
12 minutes / 720 seconds); reference the constants MAX_RETRIES and POLL_DELAY_MS
and note that all three Emboss actions use them so the README and the actions'
error messages remain consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: c7cd75f7-f91f-4aef-9eed-5257244150eb
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
components/emboss/README.mdcomponents/emboss/actions/create-fillable-form/create-fillable-form.mjscomponents/emboss/actions/fill-existing-form/fill-existing-form.mjscomponents/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjscomponents/emboss/common/utils.mjscomponents/emboss/emboss.app.mjscomponents/emboss/package.json
…ePdf sanitization, README timing fixes
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/emboss/actions/create-fillable-form/create-fillable-form.mjs (1)
57-60: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winShared root cause: polling success branches omit
$summaryin all three Emboss actions.
create-fillable-form,fill-existing-form, andfill-from-pdf-contexteach have successful rerun branches that return without calling$.export("$summary", ...). Add one concise summary call in every successful return branch for each file.As per coding guidelines,
run()must call$.export("$summary", ...)on every successful execution path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/emboss/actions/create-fillable-form/create-fillable-form.mjs` around lines 57 - 60, Polling success branches that call $.flow.rerun(...) and then return (e.g., the branch using $.flow.rerun(POLL_DELAY_MS, { form_id: created.form_id }, MAX_RETRIES)) are missing the required summary export; add a concise $.export("$summary", "...") call immediately before each return in all three actions (create-fillable-form, fill-existing-form, fill-from-pdf-context) so every successful execution path calls $.export("$summary", ...) — include a short, clear message (e.g., "Polling scheduled for form {form_id}" or final success text when appropriate) referencing the form_id where available.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@components/emboss/actions/create-fillable-form/create-fillable-form.mjs`:
- Around line 57-60: Polling success branches that call $.flow.rerun(...) and
then return (e.g., the branch using $.flow.rerun(POLL_DELAY_MS, { form_id:
created.form_id }, MAX_RETRIES)) are missing the required summary export; add a
concise $.export("$summary", "...") call immediately before each return in all
three actions (create-fillable-form, fill-existing-form, fill-from-pdf-context)
so every successful execution path calls $.export("$summary", ...) — include a
short, clear message (e.g., "Polling scheduled for form {form_id}" or final
success text when appropriate) referencing the form_id where available.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e352763f-a31a-4110-84ad-73be4996c09c
📒 Files selected for processing (5)
components/emboss/README.mdcomponents/emboss/actions/create-fillable-form/create-fillable-form.mjscomponents/emboss/actions/fill-existing-form/fill-existing-form.mjscomponents/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjscomponents/emboss/common/utils.mjs
|
Addressed the outside-diff comment in e262f75 — all six polling branches (initial submit + re-poll, across the three actions) now export an interim $summary before returning, so every successful execution path exports one; the final ready-branch export overwrites it on completion. Nice side effect: the paused step now shows live progress text while polling. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs (1)
24-47: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winCentralize these reused props in
emboss.app.mjspropDefinitions.
file,contextText,contextFile, andsyncDirare defined inline here even though equivalent definitions are reused across Emboss actions. Move shared definitions to app-levelpropDefinitionsand reference them viapropDefinitionto avoid drift.As per coding guidelines, props used in more than one component must be defined in the app file
propDefinitionsand referenced viapropDefinition.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs` around lines 24 - 47, The props file, contextText, contextFile and syncDir are duplicated here and should be centralized in the app-level propDefinitions to prevent drift; update emboss.app.mjs to add canonical definitions for these props (names: file, contextText, contextFile, syncDir) under propDefinitions, then in fill-from-pdf-context.mjs remove the inline prop blocks and replace them with propDefinition references (propDefinition: "file", etc.) so the action uses the shared definitions; ensure formats/accessMode/sync and optional flags match the original definitions when moving them.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@components/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs`:
- Around line 24-47: The props file, contextText, contextFile and syncDir are
duplicated here and should be centralized in the app-level propDefinitions to
prevent drift; update emboss.app.mjs to add canonical definitions for these
props (names: file, contextText, contextFile, syncDir) under propDefinitions,
then in fill-from-pdf-context.mjs remove the inline prop blocks and replace them
with propDefinition references (propDefinition: "file", etc.) so the action uses
the shared definitions; ensure formats/accessMode/sync and optional flags match
the original definitions when moving them.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8d281113-c419-46dd-8ba1-4b5f6259c2bf
📒 Files selected for processing (3)
components/emboss/actions/create-fillable-form/create-fillable-form.mjscomponents/emboss/actions/fill-existing-form/fill-existing-form.mjscomponents/emboss/actions/fill-from-pdf-context/fill-from-pdf-context.mjs
Summary
New app components for Emboss (https://pipedream.com/apps/emboss) — requested and integrated in #21116 (thanks @sergio-eliot-rodriguez!).
Emboss turns flat PDFs into fillable forms and fills them with AI. This PR adds the app file and three actions:
emboss-create-fillable-form) — flat PDF in, fillable PDF + form ID outemboss-fill-from-pdf-context) — flat PDF + context (text and/or a file) in; Emboss detects the fields, fills them, and returns the completed PDFemboss-fill-existing-form) — fill a previously created form (async-options dropdown backed by the account's forms) from contextImplementation notes:
$.flow.rerun(5s cadence, ~12-minute budget) and throw a clear error at exhaustion rather than letting the workflow proceed silently.format: "file-ref"string props +syncDir(read-write, sync), read withgetFileStreamAndMetadata; output written to/tmpand returned asfilepath.form-datawithknownLength+maxBodyLength: Infinity(convertapi precedent).ConfigurationErrorguards for missing file and for fills with no context at all (prevents a billable no-op).annotations;eslint components/embossis clean.Testing
All three actions were tested end-to-end against the production Emboss API from a Pipedream workspace (dev-published versions of this exact code):
form_id,status: ready,filepathout.session_id, fillreport, and the completed PDF'sfilepath.session_id+filepath.$auth.api_key) verified live.Checklist
Versioning
0.0.1for new ones)package.json's version updated (0.0.1scaffold →0.1.0)New app
CodeRabbit review
Summary by CodeRabbit