-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[ACTION] Front - Articles #19228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[ACTION] Front - Articles #19228
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds FrontApp knowledge-base and message-template actions, a new action to download article attachments (writes binary to /tmp), extends the FrontApp client with propDefinitions and API methods for knowledge bases/templates/attachments, and bumps the frontapp package version. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Caller
participant Action as download-article-attachment
participant Client as FrontApp client
participant FS as File System
participant Context as Execution Context
Caller->>Action: invoke(articleId, attachmentId, [filename])
Action->>Client: downloadArticleAttachment(articleId, attachmentId, responseType=arraybuffer)
Client-->>Action: response { data: ArrayBuffer, headers }
Note right of Action: Determine filename\n(Content-Disposition → provided → attachmentId)
Action->>FS: write file to /tmp/<filename> (binary)
FS-->>Action: file written
Note right of Action: Determine size (Content-Length or buffer.length)
Action->>Context: export "$summary" = "Successfully downloaded attachment: <filename> (<size> bytes)"
Action-->>Caller: return { path: "/tmp/<filename>" }
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ 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 |
82018d8 to
968083e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (40)
components/frontapp/actions/add-comment/add-comment.mjs(1 hunks)components/frontapp/actions/archive-conversation/archive-conversation.mjs(1 hunks)components/frontapp/actions/assign-conversation/assign-conversation.mjs(1 hunks)components/frontapp/actions/create-draft-reply/create-draft-reply.mjs(1 hunks)components/frontapp/actions/create-draft/create-draft.mjs(1 hunks)components/frontapp/actions/create-inbox/create-inbox.mjs(1 hunks)components/frontapp/actions/create-message-template/create-message-template.mjs(1 hunks)components/frontapp/actions/create-message/create-message.mjs(1 hunks)components/frontapp/actions/delete-message-template/delete-message-template.mjs(1 hunks)components/frontapp/actions/download-article-attachment/download-article-attachment.mjs(1 hunks)components/frontapp/actions/get-comment/get-comment.mjs(1 hunks)components/frontapp/actions/get-conversation/get-conversation.mjs(1 hunks)components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs(1 hunks)components/frontapp/actions/get-knowledge-base/get-knowledge-base.mjs(1 hunks)components/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs(1 hunks)components/frontapp/actions/get-message-template/get-message-template.mjs(1 hunks)components/frontapp/actions/get-message/get-message.mjs(1 hunks)components/frontapp/actions/get-teammate/get-teammate.mjs(1 hunks)components/frontapp/actions/import-message/import-message.mjs(1 hunks)components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs(1 hunks)components/frontapp/actions/list-comments/list-comments.mjs(1 hunks)components/frontapp/actions/list-conversations/list-conversations.mjs(1 hunks)components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs(1 hunks)components/frontapp/actions/list-knowledge-base-categories/list-knowledge-base-categories.mjs(1 hunks)components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs(1 hunks)components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs(1 hunks)components/frontapp/actions/list-message-templates/list-message-templates.mjs(1 hunks)components/frontapp/actions/list-teammates/list-teammates.mjs(1 hunks)components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs(1 hunks)components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs(1 hunks)components/frontapp/actions/send-new-message/send-new-message.mjs(1 hunks)components/frontapp/actions/tag-conversation/tag-conversation.mjs(1 hunks)components/frontapp/actions/update-conversation/update-conversation.mjs(1 hunks)components/frontapp/actions/update-teammate/update-teammate.mjs(1 hunks)components/frontapp/frontapp.app.mjs(2 hunks)components/frontapp/package.json(1 hunks)components/frontapp/sources/new-conversation-created/new-conversation-created.mjs(1 hunks)components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs(1 hunks)components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs(1 hunks)components/frontapp/sources/new-message-template-created/new-message-template-created.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/frontapp/actions/get-message/get-message.mjscomponents/frontapp/actions/send-new-message/send-new-message.mjscomponents/frontapp/actions/tag-conversation/tag-conversation.mjscomponents/frontapp/actions/archive-conversation/archive-conversation.mjscomponents/frontapp/actions/add-comment/add-comment.mjscomponents/frontapp/actions/list-message-templates/list-message-templates.mjscomponents/frontapp/actions/get-comment/get-comment.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/frontapp/actions/get-message/get-message.mjscomponents/frontapp/actions/get-message-template-folder/get-message-template-folder.mjscomponents/frontapp/actions/get-message-template/get-message-template.mjscomponents/frontapp/actions/list-message-template-folders/list-message-template-folders.mjscomponents/frontapp/actions/list-message-templates/list-message-templates.mjs
🧬 Code graph analysis (4)
components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs (1)
components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs (1)
article(33-36)
components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs (1)
components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs (1)
response(18-20)
components/frontapp/actions/download-article-attachment/download-article-attachment.mjs (5)
components/frontapp/actions/archive-conversation/archive-conversation.mjs (1)
response(24-30)components/frontapp/actions/create-draft/create-draft.mjs (1)
response(101-120)components/frontapp/actions/create-inbox/create-inbox.mjs (1)
response(44-47)components/frontapp/actions/create-message/create-message.mjs (1)
response(67-71)components/frontapp/actions/get-comment/get-comment.mjs (1)
response(33-36)
components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs (16)
components/frontapp/actions/add-comment/add-comment.mjs (1)
response(50-62)components/frontapp/actions/archive-conversation/archive-conversation.mjs (1)
response(24-30)components/frontapp/actions/assign-conversation/assign-conversation.mjs (1)
response(32-38)components/frontapp/actions/create-draft-reply/create-draft-reply.mjs (1)
response(107-127)components/frontapp/actions/create-draft/create-draft.mjs (1)
response(101-120)components/frontapp/actions/create-inbox/create-inbox.mjs (1)
response(44-47)components/frontapp/actions/create-message-template/create-message-template.mjs (1)
response(121-125)components/frontapp/actions/create-message/create-message.mjs (1)
response(67-71)components/frontapp/actions/delete-message-template/delete-message-template.mjs (1)
response(30-33)components/frontapp/actions/download-article-attachment/download-article-attachment.mjs (1)
response(42-47)components/frontapp/actions/get-comment/get-comment.mjs (1)
response(33-36)components/frontapp/actions/get-message/get-message.mjs (1)
response(23-26)components/frontapp/actions/get-teammate/get-teammate.mjs (1)
response(25-28)components/frontapp/actions/import-message/import-message.mjs (1)
response(191-195)components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs (1)
response(43-46)components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs (1)
response(142-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (38)
components/frontapp/actions/update-teammate/update-teammate.mjs (1)
7-7: Version bump is consistent and non-breakingOnly the
versionmetadata changed to"0.0.5"with no behavioral modifications. This is appropriate given the broader PR’s patch-level version bumps for actions.components/frontapp/actions/create-inbox/create-inbox.mjs (1)
7-7: Version bump is appropriate.The patch version increment aligns with the broader FrontApp package version update to 0.9.0 mentioned in the PR context.
components/frontapp/actions/list-comments/list-comments.mjs (2)
7-7: Version bump is appropriate for this release.The version increment from 0.0.5 to 0.0.6 is consistent with the broader PR scope, which includes new FrontApp actions and a package version bump to 0.9.0.
29-46: LGTM!The pagination and result collection logic is correct. The async iteration pattern is properly implemented, and the summary export with plural handling follows Pipedream conventions.
components/frontapp/actions/get-teammate/get-teammate.mjs (2)
7-7: Version bump is appropriate as part of the package release.The version bump from 0.0.5 to 0.0.6 is consistent with the broader package version update (0.8.4 → 0.9.0) and aligns with adding new functionality to the FrontApp app.
1-32: Implementation is solid.The action follows Pipedream conventions and best practices. Props are properly defined, the async run method is correct, and the summary export is well-formatted. No concerns with the existing logic or structure.
components/frontapp/actions/add-comment/add-comment.mjs (1)
8-8: Version bump is appropriate.The patch version update (0.0.5 → 0.0.6) aligns with the broader FrontApp package release. Code logic remains unchanged and the implementation is solid.
components/frontapp/actions/assign-conversation/assign-conversation.mjs (2)
1-42: Code implementation looks sound.The action logic remains functionally intact. The prop definitions are correct, the API call is properly structured, and error handling follows the existing patterns.
7-7: Verify version bump strategy for unchanged actions.This action's logic is unchanged, yet the version has been bumped from 0.0.5 to 0.0.6 as part of the package version update to 0.9.0. Please confirm whether this coordinated version bump for all existing actions (even those with no functional changes) is intentional and aligns with Pipedream's versioning guidelines.
components/frontapp/actions/get-message/get-message.mjs (1)
7-7: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/sources/new-conversation-created/new-conversation-created.mjs (1)
9-9: Version metadata updated.The source version is incremented as part of the coordinated release.
components/frontapp/actions/list-teammates/list-teammates.mjs (1)
7-7: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/package.json (1)
3-3: Version bump reflects new feature additions.The minor version increment (0.8.4 → 0.9.0) appropriately signals the addition of new FrontApp actions for knowledge bases, articles, and message templates as defined in PR objectives. Dependencies remain stable.
components/frontapp/actions/create-draft/create-draft.mjs (1)
8-8: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/actions/list-conversations/list-conversations.mjs (1)
7-7: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/actions/get-conversation/get-conversation.mjs (1)
7-7: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/actions/get-comment/get-comment.mjs (1)
7-7: Version metadata updated.The action version is incremented as part of the coordinated release.
components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs (1)
8-8: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/import-message/import-message.mjs (1)
8-8: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/create-draft-reply/create-draft-reply.mjs (1)
8-8: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/list-message-templates/list-message-templates.mjs (1)
7-7: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/archive-conversation/archive-conversation.mjs (1)
7-7: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/create-message-template/create-message-template.mjs (1)
9-9: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs (1)
8-8: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs (1)
9-9: LGTM!Version bump aligns with the package-wide update to 0.9.0.
components/frontapp/actions/create-message/create-message.mjs (1)
7-7: Version metadata bump only; behavior unchangedThe version increment is consistent with the broader FrontApp package bump and does not affect runtime behavior.
components/frontapp/actions/delete-message-template/delete-message-template.mjs (1)
7-7: Patch version increment for delete-message-templateVersion bump only; destructive behavior and props remain unchanged.
components/frontapp/actions/tag-conversation/tag-conversation.mjs (1)
7-7: Tag-conversation action version updated without behavior changeThe new version value aligns with the global FrontApp component versioning; logic is intact.
components/frontapp/sources/new-message-template-created/new-message-template-created.mjs (1)
9-9: Source version bump onlyThe source version is incremented to 0.0.6 with no change to hooks or methods; this is safe.
components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs (1)
7-7: List-comment-mentions: metadata-only version updateVersion bump keeps behavior and API usage identical; no issues spotted.
components/frontapp/actions/update-conversation/update-conversation.mjs (1)
8-8: Update-conversation: patch version incrementOnly the action version changes; existing updateConversation call pattern and utils.parse usage remain as before.
components/frontapp/actions/send-new-message/send-new-message.mjs (1)
8-8: Send-new-message: metadata version bumpThe change is limited to the version string; the send flow and summary export remain untouched.
components/frontapp/actions/get-message-template/get-message-template.mjs (1)
1-33: LGTM!The action is well-structured, follows Pipedream conventions, and correctly implements the message template fetch functionality. The annotations accurately reflect the read-only nature of this operation, and the summary message is properly formatted.
components/frontapp/frontapp.app.mjs (2)
326-351: LGTM!The
articleIdprop definition correctly implements pagination and has an appropriate guard clause whenknowledgeBaseIdis not provided.
685-746: LGTM!The new API methods follow the established patterns in this file. Path templates correctly use the destructured parameters, and the methods are consistent with existing implementations.
components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs (1)
10-10: LGTM!Version bump aligns with the package-level version update to 0.9.0.
components/frontapp/actions/get-knowledge-base/get-knowledge-base.mjs (1)
3-32: Get Knowledge Base action aligns well with existing patterns.Props, annotations, and the
runimplementation cleanly wrapfrontapp.getKnowledgeBase, pass$correctly, and export a useful summary before returning the retrieved object. This is consistent with other Front actions in the repo.components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs (1)
3-41: Get Knowledge Base Article action is well-structured and props are wired coherently.The action metadata, annotations, and
runimplementation look solid. UsingknowledgeBaseIdsolely to scope thearticleIdoptions makes sense, and the call tothis.frontapp.getKnowledgeBaseArticle({ $, articleId: this.articleId })plus the summary export matches the expected Front pattern.
components/frontapp/actions/download-article-attachment/download-article-attachment.mjs
Show resolved
Hide resolved
components/frontapp/actions/download-article-attachment/download-article-attachment.mjs
Show resolved
Hide resolved
components/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs
Show resolved
Hide resolved
components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs
Show resolved
Hide resolved
components/frontapp/actions/list-knowledge-base-categories/list-knowledge-base-categories.mjs
Show resolved
Hide resolved
components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs
Show resolved
Hide resolved
components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs
Show resolved
Hide resolved
luancazarine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jcortes, LGTM! Ready for QA!
|
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check test reports below for more information:
|
968083e to
d6c8d8a
Compare
There was a problem hiding this 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
components/frontapp/actions/list-teammates/list-teammates.mjs (1)
3-39: Version bump looks good; consider pluralizing the action nameThe version update to
"0.0.6"is consistent with the rest of the FrontApp actions and the existing implementation remains sound.
Minor UX nit: thenameis"List Teammate"but the action and summary operate on multiple teammates; consider"List Teammates"for consistency.components/frontapp/actions/update-teammate/update-teammate.mjs (1)
3-81: Version bump is fine; fix small description typoThe bump to
"0.0.5"is appropriate and does not change behavior.
Minor nit: in theusernameprop description (Line 26),"can only contains"should be"can only contain"to read cleanly in the UI.components/frontapp/actions/update-conversation/update-conversation.mjs (1)
4-88: Version bump ok; consider passing$intoupdateConversationfor consistencyThe version change to
"0.1.11"is straightforward and non-breaking.
For consistency with other FrontApp actions (e.g.,updateTeammate,createMessageTemplate) that pass$into app methods, consider updating:await this.frontApp.updateConversation({ conversationId, data, $, });to maintain uniform logging/metrics behavior across actions.
♻️ Duplicate comments (7)
components/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs (1)
16-20: ThefolderIdprop is marked as optional in the base definition, but is required for this action.The
folderIdpropDefinition infrontapp.app.mjshasoptional: true, but this action cannot function without it. Override the optional flag to make it required.Apply this diff to make the prop required:
folderId: { propDefinition: [ frontapp, "folderId", ], + optional: false, },components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs (1)
17-24: Verify if pagination is needed for knowledge bases.This action returns
response._resultsdirectly without using thepaginatehelper. If the Front API's/knowledge_basesendpoint is paginated, this will only return the first page of results. Consider using the same pagination pattern aslist-knowledge-base-categoriesandlist-knowledge-base-articlesfor consistency.Front API list knowledge bases paginationcomponents/frontapp/frontapp.app.mjs (1)
312-325: Consider pagination forknowledgeBaseIdoptions.This prop definition fetches all knowledge bases without pagination support, unlike
articleIdwhich usespaginateOptions. For consistency and to handle large result sets, consider using the same pagination pattern.knowledgeBaseId: { type: "string", label: "Knowledge Base ID", description: "The ID of the knowledge base", - async options() { - const { _results: bases } = await this.listKnowledgeBases(); - return bases.map(({ - id, type, - }) => ({ - label: `${id} (${type})`, - value: id, - })); + async options({ prevContext }) { + return this.paginateOptions({ + prevContext, + listResourcesFn: this.listKnowledgeBases, + mapper: ({ + id, type, + }) => ({ + label: `${id} (${type})`, + value: id, + }), + }); }, },components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs (1)
16-21: Add options constraint forsortBy.The
sortByprop is documented to accept onlycreated_atorupdated_at, but currently allows any string. Add explicit options for consistency withsortOrderand to prevent invalid inputs.sortBy: { type: "string", label: "Sort By", description: "Field used to sort the message template folders. Either `created_at` or `updated_at`.", optional: true, + options: [ + "created_at", + "updated_at", + ], },components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs (1)
32-38: Forward execution context$to the paginate method.The
paginatecall should receive the$context parameter for proper execution tracking, consistent with other actions in this PR (e.g.,get-knowledge-base-article.mjspasses$togetKnowledgeBaseArticle).Apply this diff:
for await (const article of this.frontapp.paginate({ + $, fn: this.frontapp.listKnowledgeBaseArticles, args: { knowledgeBaseId: this.knowledgeBaseId, }, maxResults: this.maxResults, })) {components/frontapp/actions/download-article-attachment/download-article-attachment.mjs (2)
44-48: UnusedsyncDirprop declared but never referenced.The
syncDirprop is defined but not used in therunmethod (line 62 uses hardcoded/tmp). Based on learnings, files written to/tmpwith returned file path will sync properly, so the current implementation works. However, the unusedsyncDirprop is misleading.Either remove the unused prop or use it:
- const filePath = path.join("/tmp", fileName); + const filePath = path.join(this.syncDir, fileName);Or remove it entirely:
- syncDir: { - type: "dir", - accessMode: "write", - sync: true, - },Based on learnings, the '/tmp' approach with returned filepath works for file sync.
58-62: Consider URL-decoding RFC 5987 encoded filenames.The regex handles
filename*=UTF-8''...format, but RFC 5987 filenames are percent-encoded. A filename likefile%20name.pdfwould remain encoded without decoding.- const headerFileName = contentDisposition?.match(/filename\*?=(?:UTF-8'')?([^;]+)/)?.[1]?.replace(/['"]/g, ""); + let headerFileName = contentDisposition?.match(/filename\*?=(?:UTF-8'')?([^;]+)/)?.[1]?.replace(/['"]/g, ""); + if (headerFileName) { + try { + headerFileName = decodeURIComponent(headerFileName); + } catch (e) { + // Keep original if decoding fails + } + } const fileName = this.filename || headerFileName || this.attachmentId;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (40)
components/frontapp/actions/add-comment/add-comment.mjs(1 hunks)components/frontapp/actions/archive-conversation/archive-conversation.mjs(1 hunks)components/frontapp/actions/assign-conversation/assign-conversation.mjs(1 hunks)components/frontapp/actions/create-draft-reply/create-draft-reply.mjs(1 hunks)components/frontapp/actions/create-draft/create-draft.mjs(1 hunks)components/frontapp/actions/create-inbox/create-inbox.mjs(1 hunks)components/frontapp/actions/create-message-template/create-message-template.mjs(1 hunks)components/frontapp/actions/create-message/create-message.mjs(1 hunks)components/frontapp/actions/delete-message-template/delete-message-template.mjs(1 hunks)components/frontapp/actions/download-article-attachment/download-article-attachment.mjs(1 hunks)components/frontapp/actions/get-comment/get-comment.mjs(1 hunks)components/frontapp/actions/get-conversation/get-conversation.mjs(1 hunks)components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs(1 hunks)components/frontapp/actions/get-knowledge-base/get-knowledge-base.mjs(1 hunks)components/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs(1 hunks)components/frontapp/actions/get-message-template/get-message-template.mjs(1 hunks)components/frontapp/actions/get-message/get-message.mjs(1 hunks)components/frontapp/actions/get-teammate/get-teammate.mjs(1 hunks)components/frontapp/actions/import-message/import-message.mjs(1 hunks)components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs(1 hunks)components/frontapp/actions/list-comments/list-comments.mjs(1 hunks)components/frontapp/actions/list-conversations/list-conversations.mjs(1 hunks)components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs(1 hunks)components/frontapp/actions/list-knowledge-base-categories/list-knowledge-base-categories.mjs(1 hunks)components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs(1 hunks)components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs(1 hunks)components/frontapp/actions/list-message-templates/list-message-templates.mjs(1 hunks)components/frontapp/actions/list-teammates/list-teammates.mjs(1 hunks)components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs(1 hunks)components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs(1 hunks)components/frontapp/actions/send-new-message/send-new-message.mjs(1 hunks)components/frontapp/actions/tag-conversation/tag-conversation.mjs(1 hunks)components/frontapp/actions/update-conversation/update-conversation.mjs(1 hunks)components/frontapp/actions/update-teammate/update-teammate.mjs(1 hunks)components/frontapp/frontapp.app.mjs(2 hunks)components/frontapp/package.json(1 hunks)components/frontapp/sources/new-conversation-created/new-conversation-created.mjs(1 hunks)components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs(1 hunks)components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs(1 hunks)components/frontapp/sources/new-message-template-created/new-message-template-created.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/frontapp/actions/get-message/get-message.mjscomponents/frontapp/actions/add-comment/add-comment.mjscomponents/frontapp/actions/send-new-message/send-new-message.mjscomponents/frontapp/actions/receive-custom-messages/receive-custom-messages.mjscomponents/frontapp/actions/list-message-templates/list-message-templates.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/frontapp/actions/get-message/get-message.mjscomponents/frontapp/actions/list-message-template-folders/list-message-template-folders.mjscomponents/frontapp/actions/get-message-template/get-message-template.mjscomponents/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs
📚 Learning: 2025-07-01T16:56:20.177Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/tinypng/actions/convert-image/convert-image.mjs:33-37
Timestamp: 2025-07-01T16:56:20.177Z
Learning: 'dir' props with sync functionality do not expose a path to the sync directory directly. For files to be synced, they must be either: (1) written to `process.env.STASH_DIR` (`/tmp/__stash`), or (2) written to `/tmp` and have their file path returned from the `run` method as a string, `[filepath]`, `[_, filepath]`, `{ filePath }`, `{ filepath }`, or `{ path }`.
Applied to files:
components/frontapp/actions/download-article-attachment/download-article-attachment.mjs
📚 Learning: 2025-07-01T17:01:46.327Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/tinypng/actions/compress-image/compress-image.mjs:18-23
Timestamp: 2025-07-01T17:01:46.327Z
Learning: In TinyPNG compress-image action (components/tinypng/actions/compress-image/compress-image.mjs), the syncDir property uses accessMode: "read" because this action only reads input files and returns API responses without writing files to /tmp, unlike other TinyPNG actions that save processed files to disk.
Applied to files:
components/frontapp/actions/download-article-attachment/download-article-attachment.mjs
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.
Applied to files:
components/frontapp/actions/download-article-attachment/download-article-attachment.mjscomponents/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs
🧬 Code graph analysis (2)
components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs (1)
components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjs (1)
response(18-20)
components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs (1)
components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs (1)
article(33-36)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (39)
components/frontapp/actions/delete-message-template/delete-message-template.mjs (1)
7-7: Version bump is appropriate.The patch version increment (0.0.4 → 0.0.5) aligns with the broader package versioning updates across the PR (frontapp: 0.8.4 → 0.9.0).
Please verify that the
frontApp.deleteMessageTemplate()method and themessageTemplateIdpropDefinition (imported from../../frontapp.app.mjs) remain stable and are not affected by the new changes introduced in this PR. Given that reviewer vunguyenhung reported test failures, confirm this action's tests continue to pass and that no breaking changes were introduced to the app module.components/frontapp/actions/create-draft-reply/create-draft-reply.mjs (1)
8-8: Version bump aligns with PR's coordinated versioning update.The patch version increment (0.0.5 → 0.0.6) is consistent with the broader versioning updates across actions and the frontapp package version bump to 0.9.0 mentioned in the PR.
The PR objectives mention that test failures were reported by the reviewer. Please verify that this action still passes tests after the version bump.
components/frontapp/actions/get-conversation/get-conversation.mjs (1)
1-51: All referenced methods are properly implemented in the FrontApp app module.Verification confirms that
getConversation()(line 559),makeRequest()(line 390), andpaginate()(line 795) are all implemented infrontapp.app.mjs. The action code correctly uses these methods with appropriate parameters. The version bump to 0.0.6 aligns with coordinated versioning across the FrontApp action suite per the PR objectives. No functional issues detected.components/frontapp/actions/get-message/get-message.mjs (1)
7-7: LGTM!Version bump aligns with the package version update to 0.9.0. No logic changes.
components/frontapp/actions/archive-conversation/archive-conversation.mjs (1)
7-7: LGTM!Version bump aligns with the package version update to 0.9.0. No logic changes.
components/frontapp/package.json (1)
3-3: LGTM!Minor version bump to 0.9.0 is appropriate for the new knowledge base and message template actions being added in this PR.
components/frontapp/actions/add-comment/add-comment.mjs (1)
8-8: LGTM!Version bump aligns with the package version update to 0.9.0. No logic changes.
components/frontapp/actions/create-draft/create-draft.mjs (1)
8-8: LGTM!Version bump aligns with the package version update to 0.9.0. No logic changes.
components/frontapp/actions/list-message-templates/list-message-templates.mjs (1)
3-74: Metadata-only version bump; action logic still solidThe bump to
"0.0.5"matches the broader FrontApp release. Sorting, pagination, and summary behavior remain correct and consistent with other list actions.components/frontapp/actions/get-teammate/get-teammate.mjs (1)
3-31: Get teammate action version bump is safeUpdating the version to
"0.0.6"preserves existing behavior; the props,getTeammatecall, and summary remain consistent and correct.components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs (1)
5-44: Source version increment only; behavior unchangedThe version update to
"0.0.8"is aligned with the rest of the FrontApp package changes. The polling params and emit logic remain consistent with prior behavior.components/frontapp/actions/create-message-template/create-message-template.mjs (1)
5-129: Create message template version bump preserves existing behaviorThe change to
"0.0.5"is metadata-only; the existing JSON vs multipart handling, attachment streaming, and summary export remain valid and consistent with other actions.components/frontapp/actions/create-message/create-message.mjs (1)
3-75: Create message action version update is non-breakingThe version bump to
"0.0.4"is consistent with the wider release. The payload construction andcreateMessageinvocation are unchanged and look correct.components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs (1)
8-8: LGTM!Version bump aligns with the package-wide release for the new Articles functionality.
components/frontapp/sources/new-message-template-created/new-message-template-created.mjs (1)
9-9: LGTM!Version bump is consistent with the coordinated release.
components/frontapp/sources/new-conversation-created/new-conversation-created.mjs (1)
9-9: LGTM!Version bump aligns with the package release.
components/frontapp/actions/list-comments/list-comments.mjs (1)
7-7: LGTM!Version bump is consistent with the release cadence.
components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs (1)
9-9: LGTM!Version bump aligns with the coordinated release.
components/frontapp/actions/create-inbox/create-inbox.mjs (1)
7-7: LGTM!Version bump is consistent with the package release.
components/frontapp/actions/assign-conversation/assign-conversation.mjs (1)
7-7: LGTM!Version bump aligns with the release.
components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs (1)
8-8: LGTM!Version bump is consistent with the coordinated package release.
components/frontapp/actions/import-message/import-message.mjs (1)
8-8: LGTM!Version bump is consistent with the broader package release.
components/frontapp/actions/get-comment/get-comment.mjs (1)
7-7: LGTM!Version bump aligns with the package release.
components/frontapp/actions/send-new-message/send-new-message.mjs (1)
8-8: LGTM!Version bump is consistent with the package release.
components/frontapp/actions/list-conversations/list-conversations.mjs (1)
7-7: LGTM!Version bump aligns with the broader release.
components/frontapp/actions/tag-conversation/tag-conversation.mjs (1)
7-7: LGTM!Version bump is consistent with the package release.
components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs (1)
7-7: LGTM!Version bump aligns with the broader release.
components/frontapp/actions/get-message-template-folder/get-message-template-folder.mjs (1)
23-32: LGTM!The action implementation follows the standard pattern for FrontApp "get" actions.
components/frontapp/actions/get-message-template/get-message-template.mjs (2)
23-32: LGTM!The action implementation follows the standard pattern and the summary message is correctly formatted.
16-20: Based on my verification, I can now rewrite the review comment:The
messageTemplateIdprop is already required and does not need an override.The base propDefinition in
frontapp.app.mjs(lines 277–289) does not includeoptional: true, which means it defaults to required. UnlikefolderId(which is marked asoptional: truein the base definition),messageTemplateIdis correctly configured as a required prop and will work as expected in this action without any changes.components/frontapp/frontapp.app.mjs (2)
326-351: LGTM!The
articleIdprop definition correctly implements pagination withpaginateOptionsand properly handles the case whenknowledgeBaseIdis not provided by returning an empty array.
739-746: Original review concern is incorrect—binary response handling is already properly implemented.The action file (line 55) already passes
responseType: "arraybuffer"when callingdownloadArticleAttachment. Since the method definition uses...args, this parameter is automatically forwarded tomakeRequest, allowing the method to handle binary downloads correctly. The action then processes the binary data as expected (lines 64-68). No changes are required.components/frontapp/actions/list-knowledge-base-categories/list-knowledge-base-categories.mjs (1)
1-45: LGTM!The action correctly implements pagination using
this.frontapp.paginate, follows the established pattern for list actions, and includes appropriate annotations for a read-only operation.components/frontapp/actions/get-knowledge-base/get-knowledge-base.mjs (1)
1-33: LGTM!The action is well-structured, correctly uses the
propDefinitionforknowledgeBaseId, and follows the established pattern for get actions with proper context passing and summary export.components/frontapp/actions/list-knowledge-base-articles/list-knowledge-base-articles.mjs (1)
1-28: Action metadata and props are well-structured.The action follows standard conventions with appropriate annotations (destructiveHint: false, openWorldHint: true, readOnlyHint: true) and leverages propDefinitions for knowledgeBaseId and maxResults.
components/frontapp/actions/get-knowledge-base-article/get-knowledge-base-article.mjs (2)
1-31: Well-structured action with proper dynamic prop configuration.The action metadata follows conventions, and the articleId prop correctly uses a resolver to pass knowledgeBaseId, enabling dynamic option loading based on the selected knowledge base.
32-41: Clean implementation with proper context handling.The run method correctly passes the execution context
$to the API method and provides a clear summary of the operation.components/frontapp/actions/download-article-attachment/download-article-attachment.mjs (2)
1-15: Appropriate imports and metadata for file download action.The action correctly imports fs and path for file operations and uses proper annotations for a read-only download operation.
63-76: File write and return logic is correct.The buffer handling accounts for both Buffer and ArrayBuffer responses, uses synchronous write appropriately, and returns the file path to enable file sync (per learnings, files written to /tmp with returned filepath will be synced).
| const response = await this.frontapp.listMessageTemplateFolders({ | ||
| $, | ||
| params, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response._results.length} message template folders`); | ||
|
|
||
| return response._results; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's understand the structure of the codebase
git ls-files | head -20Repository: PipedreamHQ/pipedream
Length of output: 1211
🏁 Script executed:
# Find the frontapp module and other list actions for comparison
fd "list-" components/frontapp/actions/ --type dRepository: PipedreamHQ/pipedream
Length of output: 529
🏁 Script executed:
# Examine the file in question
cat -n components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjsRepository: PipedreamHQ/pipedream
Length of output: 1718
🏁 Script executed:
# Search for paginate helper usage in similar list actions
rg "paginate" components/frontapp/actions/ -A 2 -B 2 --type jsRepository: PipedreamHQ/pipedream
Length of output: 47
🏁 Script executed:
# Find the frontapp.app.mjs file
fd "frontapp.app.mjs" components/Repository: PipedreamHQ/pipedream
Length of output: 101
🏁 Script executed:
# Check list-knowledge-bases for comparison
cat -n components/frontapp/actions/list-knowledge-bases/list-knowledge-bases.mjsRepository: PipedreamHQ/pipedream
Length of output: 926
🏁 Script executed:
# Check list-conversations for comparison
cat -n components/frontapp/actions/list-conversations/list-conversations.mjsRepository: PipedreamHQ/pipedream
Length of output: 1286
🏁 Script executed:
# Search for paginate usage across all frontapp actions
rg "paginate" components/frontapp/ --type js -B 3 -A 3Repository: PipedreamHQ/pipedream
Length of output: 47
🏁 Script executed:
# Check the frontapp app module
wc -l components/frontapp/frontapp.app.mjsRepository: PipedreamHQ/pipedream
Length of output: 105
🏁 Script executed:
# View the listMessageTemplateFolders method in frontapp.app.mjs
rg "listMessageTemplateFolders" components/frontapp/frontapp.app.mjs -A 10 -B 2Repository: PipedreamHQ/pipedream
Length of output: 662
🏁 Script executed:
# View the listKnowledgeBases method for comparison
rg "listKnowledgeBases" components/frontapp/frontapp.app.mjs -A 10 -B 2Repository: PipedreamHQ/pipedream
Length of output: 719
🏁 Script executed:
# View the listConversations method for comparison
rg "listConversations" components/frontapp/frontapp.app.mjs -A 10 -B 2Repository: PipedreamHQ/pipedream
Length of output: 941
🏁 Script executed:
# Check if there's a paginate method definition
rg "paginate\s*\(" components/frontapp/frontapp.app.mjs -A 5 -B 2Repository: PipedreamHQ/pipedream
Length of output: 253
🏁 Script executed:
# Find the makeRequest method implementation
rg "async makeRequest" components/frontapp/frontapp.app.mjs -A 20 -B 2Repository: PipedreamHQ/pipedream
Length of output: 987
🏁 Script executed:
# Search for pagination-related code in the frontapp module
rg "pageToken|_links|pagination" components/frontapp/frontapp.app.mjs -B 2 -A 2Repository: PipedreamHQ/pipedream
Length of output: 1376
🏁 Script executed:
# Look at more context around the paginate method
rg "async \*paginate" components/frontapp/frontapp.app.mjs -A 30Repository: PipedreamHQ/pipedream
Length of output: 927
🏁 Script executed:
# Search for any test files or examples with message_template_folders responses
rg "_pagination" components/frontapp/ --type js -B 5 -A 5 | head -50Repository: PipedreamHQ/pipedream
Length of output: 47
🏁 Script executed:
# Check if there are any message_template related tests
fd "test" components/frontapp/ -type f | grep -i templateRepository: PipedreamHQ/pipedream
Length of output: 235
🏁 Script executed:
# Look for any references to message_template_folders in docs or comments
rg "message_template_folders" components/frontapp/ -B 2 -A 2Repository: PipedreamHQ/pipedream
Length of output: 717
🏁 Script executed:
# Check the Front API documentation URL mentioned in the action
rg "dev.frontapp.com" components/frontapp/actions/list-message-template-folders/ -A 1 -B 1Repository: PipedreamHQ/pipedream
Length of output: 527
🌐 Web query:
Front API list message template folders pagination support dev.frontapp.com
💡 Result:
Short answer: Yes — Front’s Core API uses the page_token / _pagination pattern for list endpoints, and the message template endpoints (including message_template_folders) are part of the Core API surface added in the message-templates changelog. So call GET /message_template_folders with limit and page_token and inspect the response’s _pagination / next link to iterate pages. [1][2]
Sources:
- Pagination docs (page_token / _pagination usage). [1]
- Core API changelog listing the message_template_folders endpoints. [2]
Implement pagination support for the message template folders endpoint.
The Front API's /message_template_folders endpoint supports pagination via the page_token parameter and returns results in the _pagination structure. The current implementation returns only the first page of results. Add the maxResults prop and use the paginate helper, following the pattern used in list-conversations.mjs, to retrieve all available message template folders.
🤖 Prompt for AI Agents
In
components/frontapp/actions/list-message-template-folders/list-message-template-folders.mjs
around lines 43 to 50, the action only returns the first page of
/message_template_folders; implement pagination by accepting a maxResults prop
and using the existing paginate helper (same pattern as list-conversations.mjs)
to iterate using the page_token/_pagination structure from the API, aggregating
all _results into a single array, export a summary with the total combined
count, and return the full combined results array.
WHY
Resolves #19180
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.