diff --git a/components/frontapp/actions/add-comment/add-comment.mjs b/components/frontapp/actions/add-comment/add-comment.mjs new file mode 100644 index 0000000000000..399742563e934 --- /dev/null +++ b/components/frontapp/actions/add-comment/add-comment.mjs @@ -0,0 +1,61 @@ +import frontApp from "../../frontapp.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "frontapp-add-comment", + name: "Add Comment", + description: "Add a comment to a conversation. [See the documentation](https://dev.frontapp.com/reference/add-comment)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + body: { + type: "string", + label: "Body", + description: "Content of the comment. Can include markdown formatting.", + }, + authorId: { + propDefinition: [ + frontApp, + "teammateId", + ], + label: "Author ID", + optional: true, + }, + isPinned: { + type: "boolean", + label: "Is Pinned?", + description: "Whether or not the comment is pinned in its conversation", + optional: true, + }, + attachments: { + propDefinition: [ + frontApp, + "attachments", + ], + }, + }, + async run({ $ }) { + const response = await this.frontApp.addComment({ + $, + conversationId: this.conversationId, + data: { + body: this.body, + author_id: this.authorId, + is_pinned: this.isPinned, + attachments: this.attachments, + }, + headers: utils.hasArrayItems(this.attachments) && { + "Content-Type": "multipart/form-data", + }, + }); + $.export("$summary", `Successfully created comment with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/frontapp/actions/archive-conversation/archive-conversation.mjs b/components/frontapp/actions/archive-conversation/archive-conversation.mjs new file mode 100644 index 0000000000000..ea17d398d66b3 --- /dev/null +++ b/components/frontapp/actions/archive-conversation/archive-conversation.mjs @@ -0,0 +1,29 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-archive-conversation", + name: "Archive Conversation", + description: "Archives a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + }, + async run({ $ }) { + const response = await this.frontApp.updateConversation({ + $, + conversationId: this.conversationId, + data: { + status: "archived", + }, + }); + $.export("$summary", `Successfully archived conversation with ID: ${this.conversationId}`); + return response; + }, +}; diff --git a/components/frontapp/actions/assign-conversation/assign-conversation.mjs b/components/frontapp/actions/assign-conversation/assign-conversation.mjs new file mode 100644 index 0000000000000..2332fa1c45639 --- /dev/null +++ b/components/frontapp/actions/assign-conversation/assign-conversation.mjs @@ -0,0 +1,37 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-assign-conversation", + name: "Assign Conversation", + description: "Assign or unassign a conversation. [See the documentation](https://dev.frontapp.com/reference/update-conversation-assignee)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + assigneeId: { + propDefinition: [ + frontApp, + "teammateId", + ], + label: "Assignee ID", + description: "ID of the contact to assign", + }, + }, + async run({ $ }) { + const response = await this.frontApp.updateConversationAssignee({ + $, + conversationId: this.conversationId, + data: { + assignee_id: this.assigneeId, + }, + }); + $.export("$summary", `Successfully assigned contact to conversation with ID: ${this.conversationId}`); + return response; + }, +}; diff --git a/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs b/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs new file mode 100644 index 0000000000000..56fa9c241505a --- /dev/null +++ b/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs @@ -0,0 +1,126 @@ +import frontApp from "../../frontapp.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "frontapp-create-draft-reply", + name: "Create Draft Reply", + description: "Create a new draft as a reply to the last message in the conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft-reply)", + version: "0.0.1", + type: "action", + props: { + frontApp, + teamId: { + propDefinition: [ + frontApp, + "teamId", + ], + }, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + channelId: { + propDefinition: [ + frontApp, + "channelId", + ], + }, + body: { + type: "string", + label: "Body", + description: "Body of the draft reply. Accepts HTML", + }, + subject: { + type: "string", + label: "Subject", + description: "Subject of the draft reply", + optional: true, + }, + authorId: { + propDefinition: [ + frontApp, + "teammateId", + ], + label: "Author ID", + }, + to: { + propDefinition: [ + frontApp, + "to", + ], + optional: true, + }, + cc: { + propDefinition: [ + frontApp, + "cc", + ], + }, + bcc: { + propDefinition: [ + frontApp, + "bcc", + ], + }, + attachments: { + propDefinition: [ + frontApp, + "attachments", + ], + }, + mode: { + propDefinition: [ + frontApp, + "mode", + ], + }, + signatureId: { + propDefinition: [ + frontApp, + "signatureId", + (c) => ({ + teamId: c.teamId, + }), + ], + }, + shouldAddDefaultSignature: { + propDefinition: [ + frontApp, + "shouldAddDefaultSignature", + ], + }, + quoteBody: { + propDefinition: [ + frontApp, + "quoteBody", + ], + }, + }, + async run({ $ }) { + const response = await this.frontApp.createDraftReply({ + $, + conversationId: this.conversationId, + data: { + channel_id: this.channelId, + body: this.body, + subject: this.subject, + author_id: this.authorId, + to: this.to, + cc: this.cc, + bcc: this.bcc, + attachments: this.attachments, + mode: this.mode, + signature_id: this.signatureId, + should_add_default_signature: this.shouldAddDefaultSignature, + quote_body: this.quoteBody, + }, + headers: utils.hasArrayItems(this.attachments) && { + "Content-Type": "multipart/form-data", + }, + }); + $.export("$summary", `Successfully created draft reply with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/frontapp/actions/create-draft/create-draft.mjs b/components/frontapp/actions/create-draft/create-draft.mjs new file mode 100644 index 0000000000000..c324eac39cd55 --- /dev/null +++ b/components/frontapp/actions/create-draft/create-draft.mjs @@ -0,0 +1,119 @@ +import frontApp from "../../frontapp.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "frontapp-create-draft", + name: "Create Draft", + description: "Create a draft message which is the first message of a new conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft)", + version: "0.0.1", + type: "action", + props: { + frontApp, + teamId: { + propDefinition: [ + frontApp, + "teamId", + ], + }, + channelId: { + propDefinition: [ + frontApp, + "channelId", + ], + }, + body: { + type: "string", + label: "Body", + description: "Body of the draft message. Accepts HTML", + }, + subject: { + type: "string", + label: "Subject", + description: "Subject of the draft", + optional: true, + }, + authorId: { + propDefinition: [ + frontApp, + "teammateId", + ], + label: "Author ID", + }, + to: { + propDefinition: [ + frontApp, + "to", + ], + optional: true, + }, + cc: { + propDefinition: [ + frontApp, + "cc", + ], + }, + bcc: { + propDefinition: [ + frontApp, + "bcc", + ], + }, + attachments: { + propDefinition: [ + frontApp, + "attachments", + ], + }, + mode: { + propDefinition: [ + frontApp, + "mode", + ], + }, + signatureId: { + propDefinition: [ + frontApp, + "signatureId", + (c) => ({ + teamId: c.teamId, + }), + ], + }, + shouldAddDefaultSignature: { + propDefinition: [ + frontApp, + "shouldAddDefaultSignature", + ], + }, + quoteBody: { + propDefinition: [ + frontApp, + "quoteBody", + ], + }, + }, + async run({ $ }) { + const response = await this.frontApp.createDraft({ + $, + channelId: this.channelId, + data: { + body: this.body, + subject: this.subject, + author_id: this.authorId, + to: this.to, + cc: this.cc, + bcc: this.bcc, + attachments: this.attachments, + mode: this.mode, + signature_id: this.signatureId, + should_add_default_signature: this.shouldAddDefaultSignature, + quote_body: this.quoteBody, + }, + headers: utils.hasArrayItems(this.attachments) && { + "Content-Type": "multipart/form-data", + }, + }); + $.export("$summary", `Successfully created draft with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/frontapp/actions/get-comment/get-comment.mjs b/components/frontapp/actions/get-comment/get-comment.mjs new file mode 100644 index 0000000000000..c51214587acdf --- /dev/null +++ b/components/frontapp/actions/get-comment/get-comment.mjs @@ -0,0 +1,35 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-get-comment", + name: "Get Comment", + description: "Retrieve a comment from a conversation. [See the documentation](https://dev.frontapp.com/reference/get-comment)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + commentId: { + propDefinition: [ + frontApp, + "commentId", + (c) => ({ + conversationId: c.conversationId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.frontApp.getComment({ + $, + commentId: this.commentId, + }); + $.export("$summary", `Successfully retrieved comment with ID: ${this.commentId}`); + return response; + }, +}; diff --git a/components/frontapp/actions/get-teammate/get-teammate.mjs b/components/frontapp/actions/get-teammate/get-teammate.mjs new file mode 100644 index 0000000000000..c0cac11fc155c --- /dev/null +++ b/components/frontapp/actions/get-teammate/get-teammate.mjs @@ -0,0 +1,27 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-get-teammate", + name: "Get Teammate", + description: "Retrieve a teammate by ID. [See the documentation](https://dev.frontapp.com/reference/get-teammate)", + version: "0.0.1", + type: "action", + props: { + frontApp, + teammateId: { + propDefinition: [ + frontApp, + "teammateId", + ], + description: "ID of the teammate to get details of", + }, + }, + async run({ $ }) { + const response = await this.frontApp.getTeammate({ + $, + teammateId: this.teammateId, + }); + $.export("$summary", `Successfully retrieved teammate with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/frontapp/actions/import-message/import-message.mjs b/components/frontapp/actions/import-message/import-message.mjs index b90279f7d30e8..7d21b63cac714 100644 --- a/components/frontapp/actions/import-message/import-message.mjs +++ b/components/frontapp/actions/import-message/import-message.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-import-message", name: "Import Message", description: "Appends a new message into an inbox. [See the docs here](https://dev.frontapp.com/reference/import-inbox-message).", - version: "0.1.6", + version: "0.1.7", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs b/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs new file mode 100644 index 0000000000000..f371f9009d5c4 --- /dev/null +++ b/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs @@ -0,0 +1,50 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-list-comment-mentions", + name: "List Comment Mentions", + description: "List the teammates mentioned in a comment. [See the documentation](https://dev.frontapp.com/reference/list-comment-mentions)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + commentId: { + propDefinition: [ + frontApp, + "commentId", + (c) => ({ + conversationId: c.conversationId, + }), + ], + }, + maxResults: { + propDefinition: [ + frontApp, + "maxResults", + ], + }, + }, + async run({ $ }) { + const items = this.frontApp.paginate({ + fn: this.frontApp.listCommentMentions, + maxResults: this.maxResults, + $, + commentId: this.commentId, + }); + + const results = []; + for await (const item of items) { + results.push(item); + } + $.export("$summary", `Successfully retrieved ${results?.length} mention${results?.length === 1 + ? "" + : "s"}`); + return results; + }, +}; diff --git a/components/frontapp/actions/list-comments/list-comments.mjs b/components/frontapp/actions/list-comments/list-comments.mjs new file mode 100644 index 0000000000000..72331db31cea7 --- /dev/null +++ b/components/frontapp/actions/list-comments/list-comments.mjs @@ -0,0 +1,42 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-list-comments", + name: "List Conversation Comments", + description: "List the comments in a conversation. [See the documentation](https://dev.frontapp.com/reference/list-conversation-comments)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + maxResults: { + propDefinition: [ + frontApp, + "maxResults", + ], + }, + }, + async run({ $ }) { + const items = this.frontApp.paginate({ + fn: this.frontApp.listComments, + maxResults: this.maxResults, + $, + conversationId: this.conversationId, + }); + + const results = []; + for await (const item of items) { + results.push(item); + } + + $.export("$summary", `Successfully retrieved ${results.length} comment${results.length === 1 + ? "" + : "s"}`); + return results; + }, +}; diff --git a/components/frontapp/actions/list-conversations/list-conversations.mjs b/components/frontapp/actions/list-conversations/list-conversations.mjs new file mode 100644 index 0000000000000..ee19fe0e67ad9 --- /dev/null +++ b/components/frontapp/actions/list-conversations/list-conversations.mjs @@ -0,0 +1,35 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-list-conversations", + name: "List Conversations", + description: "List conversations in the company. [See the documentation](https://dev.frontapp.com/reference/list-conversations)", + version: "0.0.1", + type: "action", + props: { + frontApp, + maxResults: { + propDefinition: [ + frontApp, + "maxResults", + ], + }, + }, + async run({ $ }) { + const items = this.frontApp.paginate({ + fn: this.frontApp.listConversations, + maxResults: this.maxResults, + $, + }); + + const results = []; + for await (const item of items) { + results.push(item); + } + + $.export("$summary", `Successfully retrieved ${results.length} conversation${results.length === 1 + ? "" + : "s"}`); + return results; + }, +}; diff --git a/components/frontapp/actions/list-teammates/list-teammates.mjs b/components/frontapp/actions/list-teammates/list-teammates.mjs new file mode 100644 index 0000000000000..5c1076b955cda --- /dev/null +++ b/components/frontapp/actions/list-teammates/list-teammates.mjs @@ -0,0 +1,35 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-list-teammates", + name: "List Teammate", + description: "List teammates in the company. [See the documentation](https://dev.frontapp.com/reference/list-teammates)", + version: "0.0.1", + type: "action", + props: { + frontApp, + maxResults: { + propDefinition: [ + frontApp, + "maxResults", + ], + }, + }, + async run({ $ }) { + const items = this.frontApp.paginate({ + fn: this.frontApp.listTeammates, + maxResults: this.maxResults, + $, + }); + + const results = []; + for await (const item of items) { + results.push(item); + } + + $.export("$summary", `Successfully retrieved ${results.length} teammate${results.length === 1 + ? "" + : "s"}`); + return results; + }, +}; diff --git a/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs b/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs index c6fa47efe8007..294c0d1df55d6 100644 --- a/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs +++ b/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-receive-custom-messages", name: "Receive Custom Messages", description: "Receive a custom message in Front. [See the docs here](https://dev.frontapp.com/reference/post_channels-channel-id-incoming-messages).", - version: "0.0.3", + version: "0.0.4", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs b/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs index 8df375375d0bd..4f227cc4cc884 100644 --- a/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs +++ b/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-reply-to-conversation", name: "Reply To Conversation", description: "Reply to a conversation by sending a message and appending it to the conversation. [See the docs here](https://dev.frontapp.com/reference/post_conversations-conversation-id-messages).", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/send-new-message/send-new-message.mjs b/components/frontapp/actions/send-new-message/send-new-message.mjs index 257b2e8949631..748f86e65af4e 100644 --- a/components/frontapp/actions/send-new-message/send-new-message.mjs +++ b/components/frontapp/actions/send-new-message/send-new-message.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-send-new-message", name: "Send New Message", description: "Sends a new message from a channel. It will create a new conversation. [See the docs here](https://dev.frontapp.com/reference/post_channels-channel-id-messages).", - version: "0.2.5", + version: "0.2.6", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/tag-conversation/tag-conversation.mjs b/components/frontapp/actions/tag-conversation/tag-conversation.mjs new file mode 100644 index 0000000000000..cda17006754ff --- /dev/null +++ b/components/frontapp/actions/tag-conversation/tag-conversation.mjs @@ -0,0 +1,53 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-tag-conversation", + name: "Tag Conversation", + description: "Add tags to a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id)", + version: "0.0.1", + type: "action", + props: { + frontApp, + conversationId: { + propDefinition: [ + frontApp, + "conversationId", + ], + }, + tagIds: { + propDefinition: [ + frontApp, + "tagIds", + ], + description: "List of the tag IDs to add", + }, + }, + async run({ $ }) { + const { + frontApp, conversationId, tagIds, + } = this; + + const { tags } = await frontApp.getConversation({ + $, + conversationId, + }); + + const existingTagIds = tags?.map(({ id }) => id); + const merged = [ + ...new Set([ + ...existingTagIds, + ...tagIds, + ]), + ]; + + const response = await frontApp.updateConversation({ + $, + conversationId, + data: { + tag_ids: merged, + }, + }); + $.export("$summary", `Successfully added tags to conversation with ID: ${conversationId}`); + return response; + }, +}; diff --git a/components/frontapp/actions/update-conversation/update-conversation.mjs b/components/frontapp/actions/update-conversation/update-conversation.mjs index 4be9fa155e006..4d69740438a6a 100644 --- a/components/frontapp/actions/update-conversation/update-conversation.mjs +++ b/components/frontapp/actions/update-conversation/update-conversation.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-update-conversation", name: "Update Conversation", description: "Updates a conversation. [See the docs here](https://dev.frontapp.com/reference/patch_conversations-conversation-id).", - version: "0.1.5", + version: "0.1.6", type: "action", props: { frontApp, diff --git a/components/frontapp/frontapp.app.mjs b/components/frontapp/frontapp.app.mjs index a41b42d5a394a..8d3f031c4db91 100644 --- a/components/frontapp/frontapp.app.mjs +++ b/components/frontapp/frontapp.app.mjs @@ -68,9 +68,9 @@ export default { listResourcesFn: this.listChannels, filter, mapper: ({ - id, address, + id, name, }) => ({ - label: address, + label: name, value: id, }), }); @@ -165,6 +165,90 @@ export default { }); }, }, + commentId: { + type: "string", + label: "Comment ID", + description: "ID of the comment to retrieve", + async options({ + prevContext, conversationId, + }) { + return this.paginateOptions({ + prevContext, + listResourcesFn: this.listComments, + mapper: ({ + id, body, + }) => ({ + label: body.slice(0, 50), + value: id, + }), + args: { + conversationId, + }, + }); + }, + }, + teamId: { + type: "string", + label: "Team ID", + description: "ID of a team", + async options({ prevContext }) { + return this.paginateOptions({ + prevContext, + listResourcesFn: this.listTeams, + mapper: ({ + id, name, + }) => ({ + label: name, + value: id, + }), + }); + }, + }, + signatureId: { + type: "string", + label: "Signature ID", + description: "ID of the signature to attach. If ommited, no signature is attached.", + optional: true, + async options({ + teamId, prevContext, + }) { + return this.paginateOptions({ + prevContext, + listResourcesFn: this.listSignatures, + mapper: ({ + id, name, + }) => ({ + label: name, + value: id, + }), + args: { + teamId, + }, + }); + }, + }, + mode: { + type: "string", + label: "Mode", + description: "Mode of the draft to create. Can be 'private' (draft is visible to the author only) or 'shared' (draft is visible to all teammates with access to the conversation).", + options: [ + "private", + "shared", + ], + optional: true, + }, + shouldAddDefaultSignature: { + type: "boolean", + label: "Should Add Default Signature", + description: "Whether or not Front should try to resolve a signature for the message. Is ignored if signature_id is included. Default `false`", + optional: true, + }, + quoteBody: { + type: "string", + label: "Quote Body", + description: "Body for the quote that the message is referencing. Only available on email channels.", + optional: true, + }, to: { type: "string[]", label: "To", @@ -182,6 +266,13 @@ export default { description: "List of the recipeient handles who received a blind copy of the message.", optional: true, }, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of results to return", + default: 100, + optional: true, + }, }, methods: { getUrl(path, url) { @@ -199,10 +290,10 @@ export default { }; }, getConfig({ - headers, path, url, data: oriignalData, ...args + headers, path, url, data: originalData, ...args } = {}) { const hasMultipartHeader = this.hasMultipartHeader(headers); - const data = hasMultipartHeader && utils.getFormData(oriignalData) || oriignalData; + const data = hasMultipartHeader && utils.getFormData(originalData) || originalData; const currentHeaders = this.getHeaders(headers); const builtHeaders = hasMultipartHeader ? { @@ -329,12 +420,103 @@ export default { ...args, }); }, + getTeammate({ + teammateId, ...args + }) { + return this.makeRequest({ + path: `/teammates/${teammateId}`, + ...args, + }); + }, + getConversation({ + conversationId, ...args + }) { + return this.makeRequest({ + path: `/conversations/${conversationId}`, + ...args, + }); + }, + getComment({ + commentId, ...args + }) { + return this.makeRequest({ + path: `/comments/${commentId}`, + ...args, + }); + }, + listComments({ + conversationId, ...args + }) { + return this.makeRequest({ + path: `/conversations/${conversationId}/comments`, + ...args, + }); + }, + listTeams(args = {}) { + return this.makeRequest({ + path: "/teams", + ...args, + }); + }, + listSignatures({ + teamId, ...args + }) { + return this.makeRequest({ + path: `/teams/${teamId}/signatures`, + ...args, + }); + }, + listCommentMentions({ + commentId, ...args + }) { + return this.makeRequest({ + path: `/comments/${commentId}/mentions`, + ...args, + }); + }, + addComment({ + conversationId, ...args + }) { + return this.makeRequest({ + method: constants.METHOD.POST, + path: `/conversations/${conversationId}/comments`, + ...args, + }); + }, + createDraft({ + channelId, ...args + }) { + return this.makeRequest({ + method: constants.METHOD.POST, + path: `/channels/${channelId}/drafts`, + ...args, + }); + }, + createDraftReply({ + conversationId, ...args + }) { + return this.makeRequest({ + method: constants.METHOD.POST, + path: `/conversations/${conversationId}/drafts`, + ...args, + }); + }, + updateConversationAssignee({ + conversationId, ...args + }) { + return this.makeRequest({ + method: constants.METHOD.PUT, + path: `/conversations/${conversationId}/assignee`, + ...args, + }); + }, async paginateOptions({ prevContext, listResourcesFn, filter = () => true, mapper = (resource) => resource, appendNull = false, + args = {}, } = {}) { const { pageToken } = prevContext; @@ -353,7 +535,9 @@ export default { _pagination: { next: nextPageToken }, _results: resources, } = await listResourcesFn({ + ...args, params: { + ...args?.params, page_token: pageToken, }, }); diff --git a/components/frontapp/package.json b/components/frontapp/package.json index 8c608f79bf12d..f46650a4cda8d 100644 --- a/components/frontapp/package.json +++ b/components/frontapp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/frontapp", - "version": "0.5.1", + "version": "0.6.0", "description": "Pipedream Frontapp Components", "main": "frontapp.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/frontapp", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^0.10.0", + "@pipedream/platform": "^3.0.3", "form-data": "^4.0.0" }, "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535", diff --git a/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs b/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs index d73c3797b7f85..edc90a1610223 100644 --- a/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs +++ b/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs @@ -7,7 +7,7 @@ export default { key: "frontapp-new-conversation-state-change", name: "New Conversation State Change", description: "Emit new event when a conversation reaches a specific state. [See the docs](https://dev.frontapp.com/reference/list-conversations)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { diff --git a/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs b/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs index a23a4eb997cc9..f3a71bffa3ee9 100644 --- a/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs +++ b/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs @@ -6,7 +6,7 @@ export default { key: "frontapp-new-conversation-tag", name: "New Conversation Tag", description: "Emit new event when a conversation is tagged with a specific tag or any tag. [See the documentation](https://dev.frontapp.com/reference/events)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e0dd3ec1296f..60d5e5480caa5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4845,8 +4845,8 @@ importers: components/frontapp: dependencies: '@pipedream/platform': - specifier: ^0.10.0 - version: 0.10.0 + specifier: ^3.0.3 + version: 3.0.3 form-data: specifier: ^4.0.0 version: 4.0.1 @@ -4922,8 +4922,7 @@ importers: components/gatekeeper: {} - components/gather: - specifiers: {} + components/gather: {} components/gatherup: dependencies: @@ -8822,8 +8821,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/onehash: - specifiers: {} + components/onehash: {} components/onelogin: {} @@ -10162,8 +10160,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/public_record: - specifiers: {} + components/public_record: {} components/publisherkit: dependencies: @@ -10213,8 +10210,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/pushengage: - specifiers: {} + components/pushengage: {} components/pusher: dependencies: @@ -27894,22 +27890,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} @@ -34502,6 +34498,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: