Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/frontapp/actions/add-comment/add-comment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/frontapp/actions/create-draft/create-draft.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/frontapp/actions/create-inbox/create-inbox.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "frontapp-create-inbox",
name: "Create Inbox",
description: "Create an inbox in the default team (workspace). [See the documentation](https://dev.frontapp.com/reference/create-inbox).",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "frontapp-create-message-template",
name: "Create Message Template",
description: "Create a new message template. [See the documentation](https://dev.frontapp.com/reference/create-message-template).",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "frontapp-create-message",
name: "Create Message",
description: "Send a new message from a channel. [See the documentation](https://dev.frontapp.com/reference/create-message).",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "frontapp-delete-message-template",
name: "Delete Message Template",
description: "Delete a message template. [See the documentation](https://dev.frontapp.com/reference/delete-message-template).",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import fs from "fs";
import path from "path";
import frontapp from "../../frontapp.app.mjs";

export default {
key: "frontapp-download-article-attachment",
name: "Download Article Attachment",
description: "Downloads the attachment from an article. [See the documentation](https://dev.frontapp.com/reference/download-attachment-from-an-article)",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
frontapp,
knowledgeBaseId: {
propDefinition: [
frontapp,
"knowledgeBaseId",
],
},
articleId: {
propDefinition: [
frontapp,
"articleId",
({ knowledgeBaseId }) => ({
knowledgeBaseId,
}),
],
},
attachmentId: {
type: "string",
label: "Attachment ID",
description: "The ID of the file to download",
},
filename: {
type: "string",
label: "Filename",
description: "The filename to save the file as in the `/tmp` directory",
optional: true,
},
syncDir: {
type: "dir",
accessMode: "write",
sync: true,
},
},
async run({ $ }) {
const response = await this.frontapp.downloadArticleAttachment({
$,
articleId: this.articleId,
attachmentId: this.attachmentId,
responseType: "arraybuffer",
});

// Extract filename from content-disposition header or use provided filename
const contentDisposition = response.headers["content-disposition"];
const headerFileName = contentDisposition?.match(/filename\*?=(?:UTF-8'')?([^;]+)/)?.[1]?.replace(/['"]/g, "");
const fileName = this.filename || headerFileName || this.attachmentId;
const filePath = path.join("/tmp", fileName);

// The response.data contains the binary content of the attachment file
const buffer = Buffer.isBuffer(response.data)
? response.data
: Buffer.from(response.data);
fs.writeFileSync(filePath, buffer);

// Get file size from content-length header or buffer
const fileSize = response.headers["content-length"] || buffer.length;

$.export("$summary", `Successfully downloaded attachment: ${fileName} (${fileSize} bytes)`);

return filePath;
},
};
2 changes: 1 addition & 1 deletion components/frontapp/actions/get-comment/get-comment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "frontapp-get-conversation",
name: "Get Conversation",
description: "Retrieve a conversation by its ID from Front. [See the documentation](https://dev.frontapp.com/reference/get-conversation-by-id)",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import frontapp from "../../frontapp.app.mjs";

export default {
key: "frontapp-get-knowledge-base-article",
name: "Get Knowledge Base Article",
description: "Fetches a knowledge base article. [See the documentation](https://dev.frontapp.com/reference/get-a-knowledge-base-article)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
frontapp,
knowledgeBaseId: {
propDefinition: [
frontapp,
"knowledgeBaseId",
],
},
articleId: {
propDefinition: [
frontapp,
"articleId",
({ knowledgeBaseId }) => ({
knowledgeBaseId,
}),
],
},
},
async run({ $ }) {
const article = await this.frontapp.getKnowledgeBaseArticle({
$,
articleId: this.articleId,
});

$.export("$summary", `Successfully retrieved knowledge base article with ID: ${this.articleId}`);

return article;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import frontapp from "../../frontapp.app.mjs";

export default {
key: "frontapp-get-knowledge-base",
name: "Get Knowledge Base",
description: "Fetches a knowledge base. [See the documentation](https://dev.frontapp.com/reference/get-a-knowledge-base)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
frontapp,
knowledgeBaseId: {
propDefinition: [
frontapp,
"knowledgeBaseId",
],
},
},
async run({ $ }) {
const knowledgeBase = await this.frontapp.getKnowledgeBase({
$,
knowledgeBaseId: this.knowledgeBaseId,
});

$.export("$summary", `Successfully retrieved knowledge base with ID: ${this.knowledgeBaseId}`);

return knowledgeBase;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import frontapp from "../../frontapp.app.mjs";

export default {
key: "frontapp-get-message-template-folder",
name: "Get Message Template Folder",
description: "Fetch a message template folder. [See the documentation](https://dev.frontapp.com/reference/get-folder)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
frontapp,
folderId: {
propDefinition: [
frontapp,
"folderId",
],
},
},
async run({ $ }) {
const folder = await this.frontapp.getMessageTemplateFolder({
$,
folderId: this.folderId,
});

$.export("$summary", `Successfully retrieved message template folder with ID: ${this.folderId}`);

return folder;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import frontapp from "../../frontapp.app.mjs";

export default {
key: "frontapp-get-message-template",
name: "Get Message Template",
description: "Fetch a message template. [See the documentation](https://dev.frontapp.com/reference/get-message-template)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
frontapp,
messageTemplateId: {
propDefinition: [
frontapp,
"messageTemplateId",
],
},
},
async run({ $ }) {
const messageTemplate = await this.frontapp.getMessageTemplate({
$,
messageTemplateId: this.messageTemplateId,
});

$.export("$summary", `Successfully retrieved message template with ID: ${this.messageTemplateId}`);

return messageTemplate;
},
};
2 changes: 1 addition & 1 deletion components/frontapp/actions/get-message/get-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "frontapp-get-message",
name: "Get Message",
description: "Retrieve a message by its ID. [See the documentation](https://dev.frontapp.com/reference/get-message)",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/frontapp/actions/get-teammate/get-teammate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "frontapp-import-message",
name: "Import Message",
description: "Appends a new message into an inbox. [See the documentation](https://dev.frontapp.com/reference/import-inbox-message).",
version: "0.1.11",
version: "0.1.12",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Loading
Loading