Skip to content

Conversation

docugenerate
Copy link

@docugenerate docugenerate commented Aug 24, 2025

Summary

This PR updates the DocuGenerate integration to Pipedream with the following actions:

Actions

  • List Templates - Retrieves a list of all templates
  • Get Template - Retrieves a specific template
  • Generate Document - Generates a document from a template
  • List Documents - Retrieves a list of documents generated from a template
  • Get Document - Retrieves a specific document
  • Update Document - Updates a specific document
  • Delete Template - Deletes a specific template
  • Delete Document - Deletes a specific document

Features

  • Support for multiple output formats (PDF, DOCX, DOC, ODT, TXT, PNG)
  • Template selection via dropdown populated from user's account
  • JSON data input for template variables and merge tags
  • Optional document naming and format selection
  • Comprehensive error handling and user feedback

Testing

All actions have been tested and published successfully using the Pipedream CLI.

Summary by CodeRabbit

  • New Features
    • Added DocuGenerate actions to generate, list, retrieve, update, and delete templates and documents; added listing of templates and documents.
    • Introduced a dynamic Template selector with live options and improved API integration for document/template workflows.
  • Documentation
    • Added a Getting Started guide: obtain API key, connect via Pipedream, and generate your first document (includes example payload).
  • Chores
    • Bumped package version to 1.0.0 and updated author metadata.

Copy link

vercel bot commented Aug 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Aug 25, 2025 5:45am
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 25, 2025 5:45am

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Aug 24, 2025
Copy link
Contributor

coderabbitai bot commented Aug 24, 2025

Walkthrough

Adds a DocuGenerate integration: an axios-based HTTP client and API methods in the app, new actions for templates and documents (list, get, delete, update, generate), README Getting Started content, and package metadata updates.

Changes

Cohort / File(s) Summary
Documentation
components/docugenerate/README.md
Adds a Getting Started section describing API key retrieval, connecting DocuGenerate in Pipedream, and generating the first document with an example JSON payload.
App Core & HTTP Client
components/docugenerate/docugenerate.app.mjs
Introduces axios-based makeRequest, getBaseUrl/getHeaders helpers, dynamic templateId prop options, and API wrapper methods: list/get/delete templates; list/get/update/delete documents; generateDocument. Removes authKeys.
Actions — Templates
components/docugenerate/actions/get-template.mjs, components/docugenerate/actions/list-templates.mjs, components/docugenerate/actions/delete-template.mjs
Adds actions to list templates, get a template, and delete a template. Each calls the app methods, exports a $summary, and returns API responses.
Actions — Documents
components/docugenerate/actions/generate-document.mjs, components/docugenerate/actions/list-documents.mjs, components/docugenerate/actions/get-document.mjs, components/docugenerate/actions/update-document.mjs, components/docugenerate/actions/delete-document.mjs
Adds actions to generate, list, get, update (name), and delete documents. They build request bodies or params, invoke app methods, export $summary messages, and return responses.
Package Metadata
components/docugenerate/package.json
Bumps package version to 1.0.0 and updates author to DocuGenerate.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant PD as Pipedream Action
  participant App as DocuGenerate App Adapter
  participant API as DocuGenerate API

  rect rgba(200,230,255,0.25)
  note over User,PD: Generate Document flow
  User->>PD: Provide templateId, data, name?, format?
  PD->>App: generateDocument($, {template_id, name, output_format, data})
  App->>App: makeRequest(POST /v1/documents)
  App->>API: Authorization + JSON body
  API-->>App: 201 Created { id, ... }
  App-->>PD: Response
  PD-->>User: $summary "Successfully generated document <id>"
  end
Loading
sequenceDiagram
  autonumber
  participant UI as Pipedream UI (Prop Options)
  participant App as DocuGenerate App Adapter
  participant API as DocuGenerate API

  rect rgba(220,255,220,0.25)
  note over UI,App: Dynamic Template selector
  UI->>App: options() for templateId
  App->>App: listTemplates()
  App->>API: GET /v1/templates
  API-->>App: [ {id,name}, ... ]
  App-->>UI: Map to [{label:name, value:id}]
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant PD as Pipedream Action
  participant App as DocuGenerate App Adapter
  participant API as DocuGenerate API

  rect rgba(255,235,200,0.25)
  note over User,API: Document update and delete
  User->>PD: Update Document (documentId, name)
  PD->>App: updateDocument($, documentId, {name})
  App->>API: PATCH /v1/documents/:id
  API-->>App: 200 OK
  App-->>PD: Response
  User->>PD: Delete Document (documentId)
  PD->>App: deleteDocument($, documentId)
  App->>API: DELETE /v1/documents/:id
  API-->>App: 204 No Content
  App-->>PD: Response
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I hop with keys and headers bright,
I stitch templates in the night.
Documents sprout from data seeds,
I nibble logs and chase new feeds.
A rabbit coder, hopping fine—cheers to the new pipeline! 🐇📄✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

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:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (19)
components/docugenerate/package.json (1)

11-11: Add repository and license metadata.

Helps consumers trace issues and ensures license compliance in registries.

Apply this diff:

   "homepage": "https://pipedream.com/apps/docugenerate",
   "author": "DocuGenerate <support@docugenerate.com> (https://www.docugenerate.com/)",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/PipedreamHQ/pipedream.git"
+  },
+  "license": "MIT",
components/docugenerate/docugenerate.app.mjs (5)

36-43: Add sane defaults for timeout and transient-retry.

Network hiccups and brief rate limits (429/5xx) are common. Pipedream Axios supports retry and retryDelay.

Apply this diff:

   const config = {
     method,
     url: `${this.getBaseUrl()}${path}`,
     headers: this.getHeaders(),
+    timeout: 30_000,
+    retry: 3,
+    retryDelay: 1000,
     ...args,
   };

11-17: Harden options() for response shape and large accounts; bind through app.

If the API wraps results (e.g., { data: [...] }) this will throw. Also, some orgs have many templates—consider supporting pagination and search.

Apply this diff:

       async options() {
-        const response = await this.listTemplates();
-        return response.map(template => ({
-          label: template.name,
-          value: template.id,
-        }));
+        // Ensure we call through the app (safe in all contexts)
+        const response = await this.listTemplates?.() ?? await this.app.listTemplates();
+        const templates = Array.isArray(response)
+          ? response
+          : Array.isArray(response?.data)
+            ? response.data
+            : Array.isArray(response?.templates)
+              ? response.templates
+              : [];
+        return templates.map((t) => ({
+          label: t.name ?? t.id,
+          value: t.id,
+        }));
       },

If DocuGenerate supports server-side pagination or search, we can switch to the paged options pattern:

async options({ page = 0, search } = {}) {
  const res = await this.app.listTemplates(this, { params: { page, search } });
  const items = res.data ?? res;
  return {
    options: items.map(t => ({ label: t.name, value: t.id })),
    nextPageToken: items.length ? page + 1 : null,
  };
}

63-67: Use Axios params to ensure proper URL encoding.

Safer than string concatenation, prevents encoding bugs.

Apply this diff:

-      return this.makeRequest({
-        $,
-        path: `/document?template_id=${templateId}`,
-      });
+      return this.makeRequest({
+        $,
+        path: `/document`,
+        params: { template_id: templateId },
+      });

90-96: Binary downloads and Accept header (for formats like PDF/PNG).

If generateDocument or getDocument returns binary content, you’ll need responseType: "arraybuffer" and an Accept header, otherwise Axios will try to parse as JSON. If the API returns JSON metadata only, ignore.

Example change (only if API returns binary):

   async generateDocument($ = this, body) {
     return this.makeRequest({
       $,
       method: "POST",
       path: "/document",
-      data: body,
+      data: body,
+      headers: { ...this.getHeaders(), Accept: "*/*" },
+      responseType: "arraybuffer",
     });
   },

Alternatively, gate via an action prop (e.g., download: boolean) and conditionally set responseType.


24-29: Authorization header needs Bearer scheme

Docugenerate’s getHeaders() currently emits:

getHeaders() {
  return {
    "Authorization": `${this.$auth.api_key}`,
    "Content-Type": "application/json",
  };
}

However, nearly every other component prefixes its auth key with Bearer , for example:

// Frontapp
"Authorization": `Bearer ${this.$auth.oauth_access_token}`,

// Fullenrich
"Authorization": `Bearer ${this.$auth.api_key}`,

To align with this convention and support APIs expecting the standard Bearer <token> format, update getHeaders() to:

getHeaders() {
  return {
-   "Authorization": `${this.$auth.api_key}`,
+   "Authorization": this.$auth?.api_key?.startsWith("Bearer ")
+     ? this.$auth.api_key
+     : `Bearer ${this.$auth.api_key}`,
    "Content-Type": "application/json",
  };
}

This defensively prepends Bearer only when it’s missing.

components/docugenerate/actions/delete-template.mjs (1)

19-22: Surface clearer summaries on common failure modes (404/409).

Optional: wrap with try/catch to emit user-friendly summaries while preserving error context.

Apply this diff:

   async run({ $ }) {
-    const response = await this.app.deleteTemplate($, this.templateId);
-    
-    $.export("$summary", `Successfully deleted the template ${this.templateId}`);
-    return response;
+    try {
+      const response = await this.app.deleteTemplate($, this.templateId);
+      $.export("$summary", `Successfully deleted template ${this.templateId}`);
+      return response;
+    } catch (err) {
+      if (err?.response?.status === 404) {
+        $.export("$summary", `Template not found: ${this.templateId}`);
+      }
+      throw err;
+    }
   },
components/docugenerate/actions/get-document.mjs (2)

11-16: Provide a dropdown for documents (and filter by template).

Typing raw IDs isn’t ergonomic. Recommend adding an optional templateId and binding documentId options to listDocuments.

Apply this diff:

   props: {
     app,
+    templateId: {
+      propDefinition: [
+        app,
+        "templateId",
+      ],
+      optional: true,
+    },
-    documentId: {
-      type: "string",
-      label: "Document",
-      description: "The ID of the document",
-    },
+    documentId: {
+      type: "string",
+      label: "Document",
+      description: "Select a document or enter an ID",
+      async options() {
+        if (!this.templateId) return [];
+        const res = await this.app.listDocuments($, this.templateId);
+        const docs = Array.isArray(res?.data) ? res.data : res;
+        return docs.map((d) => ({
+          label: d.name ? `${d.name} (${d.id})` : d.id,
+          value: d.id,
+        }));
+      },
+    },
   },

Also consider a boolean prop like downloadFile to switch the underlying getDocument call to responseType: "arraybuffer" when retrieving binaries.


18-21: Avoid returning large/binary payloads directly.

Returning full document bytes can bloat step results. Consider returning metadata and, if downloading, writing to a temporary file and returning a path or emitting as a file.

Example pattern:

const res = await this.app.getDocument($, this.documentId, { responseType: "arraybuffer" });
// write to tmp file using fs, then return { file_path, content_type }
components/docugenerate/actions/delete-document.mjs (2)

1-23: Action is clean and consistent; minor UX upgrades possible.

Looks good. Consider mirroring the document dropdown enhancement from Get Document for consistency (add optional templateId and dynamic documentId).


17-21: Handle 404 with a clearer summary; avoid empty response confusion (204).

DELETE commonly returns 204 with no body. Make the summary explicit and handle not-found errors gracefully.

Apply this diff:

   async run({ $ }) {
-    const response = await this.app.deleteDocument($, this.documentId);
-    
-    $.export("$summary", `Successfully deleted the document ${this.documentId}`);
-    return response;
+    try {
+      const response = await this.app.deleteDocument($, this.documentId);
+      $.export("$summary", `Deleted document ${this.documentId}`);
+      // Some APIs return 204 No Content; normalize truthy result for UI
+      return response ?? { success: true, id: this.documentId };
+    } catch (err) {
+      if (err?.response?.status === 404) {
+        $.export("$summary", `Document not found: ${this.documentId}`);
+      }
+      throw err;
+    }
   },
components/docugenerate/actions/get-template.mjs (1)

18-23: Prefer showing template name in the summary when available

If the API returns a name, use it; otherwise fall back to the ID.

Apply this diff:

-    const response = await this.app.getTemplate($, this.templateId);
-    
-    $.export("$summary", `Successfully retrieved the template ${this.templateId}`);
-    return response;
+    const response = await this.app.getTemplate($, this.templateId);
+    const display = response?.name || this.templateId;
+    $.export("$summary", `Successfully retrieved the template ${display}`);
+    return response;
components/docugenerate/actions/list-documents.mjs (1)

18-23: Harden summary and return shape; support future pagination (optional)

The run method in components/docugenerate/actions/list-documents.mjs currently does:

const response = await this.app.listDocuments($, this.templateId);
$.export("$summary", `Successfully retrieved ${response?.length || 0} documents`);
return response;
  • listDocuments simply forwards to makeRequest, which uses Pipedream’s axios wrapper and returns only the response body (data) of the API call (pipedream.com).
  • There’s no pagination support (page, limit, or cursor) in the SDK, so if the API later wraps results in { data: [...] } or adds metadata, the current summary/count will break or misreport.

Optional refactor to future-proof:

-    const response = await this.app.listDocuments($, this.templateId);
-    $.export("$summary", `Successfully retrieved ${response?.length || 0} documents`);
-    return response;
+    const response = await this.app.listDocuments($, this.templateId);
+    // Normalize array vs. wrapped { data: [...] } shape
+    const items = Array.isArray(response) ? response : (response?.data ?? []);
+    const count = items.length;
+    $.export("$summary", `Successfully retrieved ${count} document${count === 1 ? "" : "s"}`);
+    return items;
components/docugenerate/actions/update-document.mjs (2)

22-29: Validate non-empty name and trim before sending

Prevent accidental blank names and reduce downstream API errors.

Apply this diff:

-    const response = await this.app.updateDocument($, this.documentId, {
-      name: this.name
-    });
-    
-    $.export("$summary", `Successfully updated the document ${this.documentId}`);
+    if (!this.name || !this.name.trim()) {
+      throw new Error("Name is required and cannot be empty.");
+    }
+    const response = await this.app.updateDocument($, this.documentId, {
+      name: this.name.trim(),
+    });
+    const display = response?.name || this.documentId;
+    $.export("$summary", `Successfully updated the document ${display}`);
     return response;

11-15: Add a shared documentId propDefinition for better UX

To enable a dropdown when selecting an existing document (similar to templateId), let’s define documentId once in your app’s propDefinitions and then reference it in each action.

Points of attention:

  • File: components/docugenerate/docugenerate.app.mjs
    • Under propDefinitions, alongside templateId
  • File: components/docugenerate/actions/update-document.mjs (and any other actions using documentId)
    • Replace the inline schema with a propDefinition reference

Example diff in docugenerate.app.mjs:

 propDefinitions: {
   templateId: {
     type: "string",
     label: "Template",
     description: "The ID of the template",
   },
+  documentId: {
+    type: "string",
+    label: "Document",
+    description: "The ID of the document",
+  },
 },

Example diff in update-document.mjs (lines 11–15):

-    documentId: {
-      type: "string",
-      label: "Document",
-      description: "The ID of the document",
-    },
+    documentId: {
+      propDefinition: [APP, "documentId"],
+    },

This optional refactor centralizes your schema, reduces duplication, and enables a dropdown selector for better usability. Let me know if you’d like me to implement these changes!

components/docugenerate/actions/generate-document.mjs (2)

43-55: Default format to .docx in code and improve summary fallback

Description says it defaults to .docx, but the code passes undefined if not set. Also, if response.id is absent, summary becomes “undefined”.

Apply this diff:

-    const body = {
-      template_id: this.templateId,
-      name: this.name,
-      output_format: this.format,
-      data: this.data,
-    };
+    const outputFormat = this.format || ".docx";
+    const body = {
+      template_id: this.templateId,
+      ...(this.name ? { name: this.name } : {}),
+      output_format: outputFormat,
+      data: this.data,
+    };
@@
-    $.export("$summary", `Successfully generated the document ${response.id}`);
-    return response;
+    const display = response?.id || this.name || this.templateId;
+    $.export("$summary", `Successfully generated the document ${display}`);
+    return response;

23-36: Confirm API’s expected format key and value mapping

Our inspection shows that the generateDocument client method simply forwards the format field (including its leading dot) as-is—there’s no output_format mapping in the client code. You’ll need to verify against the backend’s API specification whether:

  • The request payload should use a format key or an output_format key.
  • The value should include the leading dot (e.g. .pdf) or be the bare extension (e.g. pdf) or even a MIME type (e.g. application/pdf).

If the API does expect a different field name or value format, add a small mapping in components/docugenerate/actions/generate-document.mjs to transform the user-selected option before invoking generateDocument. For example:

--- a/components/docugenerate/actions/generate-document.mjs
+++ b/components/docugenerate/actions/generate-document.mjs
@@ (inside the action handler)
- const response = await client.generateDocument({ documentId }, { format });
+ const apiBody = {
+   // map “format” → “output_format” and strip leading dot if needed
+   output_format: format.replace(/^\./, ''),
+ };
+ const response = await client.generateDocument({ documentId }, apiBody);

• File: components/docugenerate/actions/generate-document.mjs
• Section: format.options → mapping before generateDocument call

components/docugenerate/README.md (2)

23-26: Clarify auth flow and add a short security note

Recommend explicitly stating that users should authenticate via a Pipedream connection and avoid pasting keys in step inputs/logs.

Apply this diff:

 1. In your Pipedream workflow, add a DocuGenerate action
 2. When prompted for authentication, paste your API Key
 3. Test the connection by using the "List Templates" action
+
+> Security note: Pipedream stores connected accounts encrypted. Avoid pasting API keys into step inputs or logs—use the connected DocuGenerate account for all actions.

29-33: Enumerate supported output formats, improve list rendering, and show a JSON example

This makes the action options unambiguous and addresses the minor grammar warning flagged by tooling by inserting a blank line after the intro line.

Apply this diff:

-Use the "Generate Document" action with:
+Use the "Generate Document" action with:
+
-- **Template**: Select from your available templates
-- **Data**: Provide JSON data matching your template merge tags (e.g., `{ "name": "John Doe" }`)
+- **Template**: Select from your available templates (the dropdown is populated from your DocuGenerate account)
+- **Data**: Provide JSON data matching your template merge tags. Example:
+
+```json
+{
+  "name": "John Doe"
+}
+```
 - **Name**: Set a custom document name (optional)
-- **Format**: Choose your desired output format (optional)
+- **Format**: Choose your desired output format (optional). Supported formats: PDF, DOCX, DOC, ODT, TXT, PNG.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cf9efd3 and 7957346.

📒 Files selected for processing (11)
  • components/docugenerate/README.md (1 hunks)
  • components/docugenerate/actions/delete-document.mjs (1 hunks)
  • components/docugenerate/actions/delete-template.mjs (1 hunks)
  • components/docugenerate/actions/generate-document.mjs (1 hunks)
  • components/docugenerate/actions/get-document.mjs (1 hunks)
  • components/docugenerate/actions/get-template.mjs (1 hunks)
  • components/docugenerate/actions/list-documents.mjs (1 hunks)
  • components/docugenerate/actions/list-templates.mjs (1 hunks)
  • components/docugenerate/actions/update-document.mjs (1 hunks)
  • components/docugenerate/docugenerate.app.mjs (1 hunks)
  • components/docugenerate/package.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
components/docugenerate/actions/list-documents.mjs (8)
components/docugenerate/actions/delete-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/delete-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/generate-document.mjs (1)
  • response (51-51)
components/docugenerate/actions/get-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/actions/update-document.mjs (1)
  • response (23-25)
components/docugenerate/docugenerate.app.mjs (1)
  • response (12-12)
components/docugenerate/actions/get-document.mjs (6)
components/docugenerate/actions/delete-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/generate-document.mjs (1)
  • response (51-51)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-documents.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/actions/update-document.mjs (1)
  • response (23-25)
components/docugenerate/actions/list-templates.mjs (4)
components/docugenerate/actions/generate-document.mjs (1)
  • response (51-51)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-documents.mjs (1)
  • response (19-19)
components/docugenerate/docugenerate.app.mjs (1)
  • response (12-12)
components/docugenerate/actions/get-template.mjs (3)
components/docugenerate/actions/delete-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/get-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/actions/delete-document.mjs (8)
components/docugenerate/actions/delete-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/generate-document.mjs (1)
  • response (51-51)
components/docugenerate/actions/get-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-documents.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/actions/update-document.mjs (1)
  • response (23-25)
components/docugenerate/docugenerate.app.mjs (1)
  • response (12-12)
components/docugenerate/actions/delete-template.mjs (3)
components/docugenerate/actions/delete-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/docugenerate.app.mjs (8)
components/docugenerate/actions/delete-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/delete-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/generate-document.mjs (2)
  • response (51-51)
  • body (44-49)
components/docugenerate/actions/get-document.mjs (1)
  • response (18-18)
components/docugenerate/actions/get-template.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-documents.mjs (1)
  • response (19-19)
components/docugenerate/actions/list-templates.mjs (1)
  • response (13-13)
components/docugenerate/actions/update-document.mjs (1)
  • response (23-25)
🪛 LanguageTool
components/docugenerate/README.md

[grammar] ~29-~29: There might be a mistake here.
Context: ...Use the "Generate Document" action with: - Template: Select from your available t...

(QB_NEW_EN)

🔇 Additional comments (10)
components/docugenerate/package.json (1)

3-3: Version bump to 1.0.0 makes sense (new public API surface).

No issues. Semantic versioning aligns with the added actions and app client.

components/docugenerate/docugenerate.app.mjs (1)

75-81: Confirm update verb and partial update semantics (PUT vs PATCH).

If the API performs partial updates, PATCH is usually the correct verb. If PUT requires the full resource, callers may inadvertently clear fields.

Apply this diff if the API supports partial updates:

   async updateDocument($ = this, documentId, body) {
     return this.makeRequest({
       $,
-      method: "PUT",
+      method: "PATCH",
       path: `/document/${documentId}`,
       data: body,
     });
   },
components/docugenerate/actions/delete-template.mjs (1)

1-24: Action structure looks solid and consistent with others.

Good use of app propDefinition, versioning, and summary export.

components/docugenerate/actions/list-templates.mjs (2)

3-11: Action skeleton and props look good

Key/name/description/type/props align with Pipedream conventions. Import path is correct.


13-16: Verify DocuGenerate GET /template response shape
Pipedream’s axios($, config) wrapper returns only the HTTP response body (the JSON payload) by default (pipedream.com). In our listTemplates() method, that means we get back exactly what the /template endpoint returns. If it always returns an array of template objects—as implied by the options() call on it in propDefinitions—then response?.length is correct. However, if that endpoint ever switches to wrapping its array in an object (for example, { data: […] }), both the summary and the .map() in options() will break (docugenerate.com).

To guard against a future change in response shape, you can apply this optional refactor:

-    const response = await this.app.listTemplates($);
-    $.export("$summary", `Successfully retrieved ${response?.length || 0} templates`);
-    return response;
+    const response = await this.app.listTemplates($);
+    // Ensure we always work with the array of templates, whether the API returns [] or { data: [] }
+    const items = Array.isArray(response) ? response : response?.data ?? [];
+    const count = items.length;
+    $.export(
+      "$summary",
+      `Successfully retrieved ${count} template${count === 1 ? "" : "s"}`
+    );
+    return items;

Please confirm the actual shape of the /template response in the DocuGenerate API docs or via a quick test before merging.

components/docugenerate/actions/get-template.mjs (1)

3-17: Solid action definition

Props reuse the app’s templateId propDefinition—good for UX consistency. No issues spotted here.

components/docugenerate/actions/list-documents.mjs (1)

3-17: Good alignment with templateId propDefinition

The action structure mirrors List Templates/Get Template—consistent and clear.

components/docugenerate/actions/update-document.mjs (1)

3-21: Action definition is straightforward

Minimal props and a clear contract. Looks good as a base.

components/docugenerate/actions/generate-document.mjs (1)

3-16: Well-structured action with dynamic template selection

Props and overall wiring look correct. Good coverage of common fields.

components/docugenerate/README.md (1)

13-14: Nice addition: clear "Getting Started" anchor for new users

Adding this section improves onboarding flow and complements the new actions well. No changes needed here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
components/docugenerate/README.md (1)

17-19: Tighten wording and standardize “API key” casing

Minor phrasing/casing tweak and preposition fix.

Apply this diff:

-1. Sign up for a [DocuGenerate](https://www.docugenerate.com/) account
-2. Get your unique API Key from the Developers tab in the [Settings](https://app.docugenerate.com/settings/developers) page
-3. Copy the API Key for use in Pipedream
+1. Sign up for a [DocuGenerate](https://www.docugenerate.com/) account
+2. Get your API key from the Developers tab on the [Settings](https://app.docugenerate.com/settings/developers) page
+3. Copy the API key for use in Pipedream
🧹 Nitpick comments (2)
components/docugenerate/README.md (2)

23-25: Clarify action example and verb choice

Use “run” for actions and provide an inline example to guide first-time users.

Apply this diff:

-1. In your Pipedream workflow, add a DocuGenerate action
-2. When prompted for authentication, paste your API Key
-3. Test the connection by using the "List Templates" action
+1. In your Pipedream workflow, add a DocuGenerate action (e.g., List Templates)
+2. When prompted for authentication, paste your API key
+3. Test the connection by running the "List Templates" action

29-33: Improve readability and surface supported formats inline

Use backticks for UI action names, move JSON into a fenced block, and explicitly list supported formats.

Apply this diff:

-Use the "Generate Document" action with:
+Use the `Generate Document` action with:
 - **Template**: Select from your available templates
-- **Data**: Provide JSON data matching your template merge tags (e.g., `{ "name": "John Doe" }`)
+- **Data**: Provide JSON matching your template merge tags, for example:
+
+```json
+{ "name": "John Doe" }
+```
 - **Name**: Set a custom document name (optional)
-- **Format**: Choose your desired output format (optional)
+- **Format**: Choose your desired output format (optional). Supported: PDF, DOCX, DOC, ODT, TXT, PNG
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7957346 and 86b0a53.

📒 Files selected for processing (1)
  • components/docugenerate/README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
components/docugenerate/README.md

[grammar] ~29-~29: There might be a mistake here.
Context: ...Use the "Generate Document" action with: - Template: Select from your available t...

(QB_NEW_EN)

🔇 Additional comments (1)
components/docugenerate/README.md (1)

13-16: Getting Started section reads well and aligns with the new actions

Clear structure and headings; matches the integration surface described in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User submitted Submitted by a user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants