Skip to content

Helpscout new components #17637

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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/help_scout/actions/add-note/add-note.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "help_scout-add-note",
name: "Add Note to Conversation",
description: "Adds a note to an existing conversation in Help Scout. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/note/)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
helpScout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
key: "help_scout-create-customer",
name: "Create Customer",
description: "Creates a new customer record in Help Scout. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/customers/create/)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
helpScout,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import helpScout from "../../help_scout.app.mjs";

export default {
key: "help_scout-get-conversation-details",
name: "Get Conversation Details",
description: "Retrieves the details of a specific conversation. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/get/)",
version: "0.0.1",
type: "action",
props: {
helpScout,
conversationId: {
propDefinition: [
helpScout,
"conversationId",
],
},
embed: {
type: "boolean",
label: "Embed",
description: "If true, the response will include the threads of the conversation.",
optional: true,
},
},
async run({ $ }) {
const response = await this.helpScout.getConversation({
$,
conversationId: this.conversationId,
params: {
embed: this.embed
? "threads"
: undefined,
},
});

$.export("$summary", `Successfully retrieved conversation details (ID: ${this.conversationId})`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import helpScout from "../../help_scout.app.mjs";

export default {
key: "help_scout-get-conversation-threads",
name: "Get Conversation Threads",
description: "Retrieves the threads of a specific conversation. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/list/)",
version: "0.0.1",
type: "action",
props: {
helpScout,
conversationId: {
propDefinition: [
helpScout,
"conversationId",
],
},
page: {
type: "integer",
label: "Page",
description: "Page number to retrieve. By default, the 25 most recent threads are retrieved (page 1)",
optional: true,
default: 1,
min: 1,
},
},
async run({ $ }) {
const response = await this.helpScout.getConversationThreads({
$,
conversationId: this.conversationId,
params: {
page: this.page,
},
});

const threads = response?._embedded?.threads;
const pageInfo = response?.page;

$.export("$summary", `Successfully retrieved ${threads?.length || 0} threads for conversation ID: ${this.conversationId} (Page ${pageInfo?.number + 1 || this.page} of ${pageInfo?.totalPages || "unknown"})`);
return {
threads,
pagination: pageInfo,
};
},
};
2 changes: 1 addition & 1 deletion components/help_scout/actions/send-reply/send-reply.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "help_scout-send-reply",
name: "Send Reply",
description: "Sends a reply to a conversation. Be careful as this sends an actual email to the customer. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/reply/)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
helpScout,
Expand Down
16 changes: 16 additions & 0 deletions components/help_scout/help_scout.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,21 @@ export default {
...opts,
});
},
getConversation({
conversationId, ...opts
}) {
return this._makeRequest({
path: `/conversations/${conversationId}`,
...opts,
});
},
getConversationThreads({
conversationId, ...opts
}) {
return this._makeRequest({
path: `/conversations/${conversationId}/threads`,
...opts,
});
},
},
};
5 changes: 2 additions & 3 deletions components/help_scout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/help_scout",
"version": "0.1.1",
"version": "0.2.0",
"description": "Pipedream Help Scout Components",
"main": "help_scout.app.mjs",
"keywords": [
Expand All @@ -13,8 +13,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3",
"@pipedream/platform": "^3.1.0",
"crypto": "^1.0.1"
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
...common,
key: "help_scout-conversation-status-updated-instant",
name: "Conversation Status Updated (Instant)",

Check warning on line 7 in components/help_scout/sources/conversation-status-updated-instant/conversation-status-updated-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a conversation has its status updated. [See the documentation](https://developer.helpscout.com/webhooks/)",
version: "0.0.1",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getEventType() {
return [
"convo.status",
];
},
getSummary(body) {
return `Conversation status updated: ${body.subject} (${body.status})`;
},
},
sampleEmit,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
export default {
"id": 291938,
"type": "email",
"folderId": "1234",
"isDraft": "false",
"number": 349,
"owner": {
"id": 1234,
"firstName": "Jack",
"lastName": "Sprout",
"email": "jack.sprout@gmail.com",
"phone": null,
"type": "user"
},
"mailbox": {
"id": 1234,
"name": "My Mailbox"
},
"customer": {
"id": 29418,
"firstName": "Vernon",
"lastName": "Bear",
"email": "vbear@mywork.com",
"phone": "800-555-1212",
"type": "customer"
},
"threadCount": 4,
"status": "closed",
"subject": "I need help!",
"preview": "Hello, I tried to download the file off your site...",
"createdBy": {
"id": 29418,
"firstName": "Vernon",
"lastName": "Bear",
"email": "vbear@mywork.com",
"phone": null,
"type": "customer"
},
"createdAt": "2012-07-23T12:34:12Z",
"modifiedAt": "2012-07-24T20:18:33Z",
"closedAt": "2012-07-24T20:18:33Z",
"closedBy": {
"id": 1234,
"firstName": "Jack",
"lastName": "Sprout",
"email": "jack.sprout@gmail.com",
"phone": null,
"type": "user"
},
"source": {
"type": "email",
"via": "customer"
},
"cc": [
"cc1@somewhere.com",
"cc2@somewhere.com"
],
"bcc": [
"bcc1@somewhere.com",
"bcc2@somewhere.com"
],
"tags": [
"tag1",
"tag2"
],
"customFields": [
{
"fieldId": 1,
"name": "Team",
"value": "Development"
},
{
"fieldId": 2,
"name": "Customer Disposition",
"value": "Happy"
}
],
"threads": [
{
"id": 88171881,
"assignedTo": {
"id": 1234,
"firstName": "Jack",
"lastName": "Sprout",
"email": "jack.sprout@gmail.com",
"phone": null,
"type": "user"
},
"status": "closed",
"createdAt": "2012-07-23T12:34:12Z",
"createdBy": {
"id": 1234,
"firstName": "Jack",
"lastName": "Sprout",
"email": "jack.sprout@gmail.com",
"phone": null,
"type": "user"
},
"source": {
"type": "web",
"via": "user"
},
"type": "message",
"state": "published",
"customer": {
"id": 29418,
"firstName": "Vernon",
"lastName": "Bear",
"email": "vbear@mywork.com",
"phone": "800-555-1212",
"type": "customer"
},
"fromMailbox": null,
"body": "This is what I have to say. Thank you.",
"to": [
"customer@somewhere.com"
],
"cc": [
"cc1@somewhere.com",
"cc2@somewhere.com"
],
"bcc": [
"bcc1@somewhere.com",
"bcc2@somewhere.com"
],
"attachments": [
{
"id": 12391,
"mimeType": "image/jpeg",
"filename": "logo.jpg",
"size": 22,
"width": 160,
"height": 160,
"url": "https://secure.helpscout.net/some-url/logo.jpg"
}
],
"tags": [
"tag1",
"tag2",
"tag3"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "help_scout-new-agent-reply-instant",
name: "New Agent Reply (Instant)",
description: "Emit new event when an agent replies to a conversation.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-conversation-assigned-instant",
name: "New Conversation Assigned (Instant)",
description: "Emit new event when a conversation is assigned to an agent. [See the documentation](https://developer.helpscout.com/)",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-conversation-created-instant",
name: "New Conversation Created (Instant)",
description: "Emit new event when a new conversation is created.",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "help_scout-new-customer-instant",
name: "New Customer Added (Instant)",
description: "Emit new event when a new customer is added.",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "help_scout-new-customer-reply-instant",
name: "New Customer Reply (Instant)",
description: "Emit new event when a customer replies to a conversation.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "help_scout-new-note-created-instant",
name: "New Note Created (Instant)",
description: "Emit new event when a note is added to a conversation.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Loading
Loading