Skip to content

Commit 25acc0c

Browse files
Merge branch 'master' into danny/connect-react/gh-17399
2 parents 7fa33d9 + fb9dc84 commit 25acc0c

File tree

18 files changed

+282
-17
lines changed

18 files changed

+282
-17
lines changed

components/help_scout/actions/add-note/add-note.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "help_scout-add-note",
55
name: "Add Note to Conversation",
66
description: "Adds a note to an existing conversation in Help Scout. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/note/)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
helpScout,

components/help_scout/actions/create-customer/create-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
key: "help_scout-create-customer",
1414
name: "Create Customer",
1515
description: "Creates a new customer record in Help Scout. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/customers/create/)",
16-
version: "0.0.1",
16+
version: "0.0.2",
1717
type: "action",
1818
props: {
1919
helpScout,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import helpScout from "../../help_scout.app.mjs";
2+
3+
export default {
4+
key: "help_scout-get-conversation-details",
5+
name: "Get Conversation Details",
6+
description: "Retrieves the details of a specific conversation. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/get/)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpScout,
11+
conversationId: {
12+
propDefinition: [
13+
helpScout,
14+
"conversationId",
15+
],
16+
},
17+
embed: {
18+
type: "boolean",
19+
label: "Embed",
20+
description: "If true, the response will include the threads of the conversation.",
21+
optional: true,
22+
},
23+
},
24+
async run({ $ }) {
25+
const response = await this.helpScout.getConversation({
26+
$,
27+
conversationId: this.conversationId,
28+
params: {
29+
embed: this.embed
30+
? "threads"
31+
: undefined,
32+
},
33+
});
34+
35+
$.export("$summary", `Successfully retrieved conversation details (ID: ${this.conversationId})`);
36+
return response;
37+
},
38+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import helpScout from "../../help_scout.app.mjs";
2+
3+
export default {
4+
key: "help_scout-get-conversation-threads",
5+
name: "Get Conversation Threads",
6+
description: "Retrieves the threads of a specific conversation. [See the documentation](https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/list/)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
helpScout,
11+
conversationId: {
12+
propDefinition: [
13+
helpScout,
14+
"conversationId",
15+
],
16+
},
17+
page: {
18+
type: "integer",
19+
label: "Page",
20+
description: "Page number to retrieve. By default, the 25 most recent threads are retrieved (page 1)",
21+
optional: true,
22+
default: 1,
23+
min: 1,
24+
},
25+
},
26+
async run({ $ }) {
27+
const response = await this.helpScout.getConversationThreads({
28+
$,
29+
conversationId: this.conversationId,
30+
params: {
31+
page: this.page,
32+
},
33+
});
34+
35+
const threads = response?._embedded?.threads;
36+
const pageInfo = response?.page;
37+
38+
$.export("$summary", `Successfully retrieved ${threads?.length || 0} threads for conversation ID: ${this.conversationId} (Page ${pageInfo?.number + 1 || this.page} of ${pageInfo?.totalPages || "unknown"})`);
39+
return {
40+
threads,
41+
pagination: pageInfo,
42+
};
43+
},
44+
};

components/help_scout/actions/send-reply/send-reply.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "help_scout-send-reply",
55
name: "Send Reply",
66
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/)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
helpScout,

components/help_scout/help_scout.app.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,21 @@ export default {
146146
...opts,
147147
});
148148
},
149+
getConversation({
150+
conversationId, ...opts
151+
}) {
152+
return this._makeRequest({
153+
path: `/conversations/${conversationId}`,
154+
...opts,
155+
});
156+
},
157+
getConversationThreads({
158+
conversationId, ...opts
159+
}) {
160+
return this._makeRequest({
161+
path: `/conversations/${conversationId}/threads`,
162+
...opts,
163+
});
164+
},
149165
},
150166
};

components/help_scout/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/help_scout",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Pipedream Help Scout Components",
55
"main": "help_scout.app.mjs",
66
"keywords": [
@@ -13,8 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^3.0.3",
16+
"@pipedream/platform": "^3.1.0",
1717
"crypto": "^1.0.1"
1818
}
1919
}
20-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "help_scout-conversation-status-updated-instant",
7+
name: "Conversation Status Updated (Instant)",
8+
description: "Emit new event when a conversation has its status updated. [See the documentation](https://developer.helpscout.com/webhooks/)",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
...common.methods,
14+
getEventType() {
15+
return [
16+
"convo.status",
17+
];
18+
},
19+
getSummary(body) {
20+
return `Conversation status updated: ${body.subject} (${body.status})`;
21+
},
22+
},
23+
sampleEmit,
24+
};
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
export default {
2+
"id": 291938,
3+
"type": "email",
4+
"folderId": "1234",
5+
"isDraft": "false",
6+
"number": 349,
7+
"owner": {
8+
"id": 1234,
9+
"firstName": "Jack",
10+
"lastName": "Sprout",
11+
"email": "[email protected]",
12+
"phone": null,
13+
"type": "user"
14+
},
15+
"mailbox": {
16+
"id": 1234,
17+
"name": "My Mailbox"
18+
},
19+
"customer": {
20+
"id": 29418,
21+
"firstName": "Vernon",
22+
"lastName": "Bear",
23+
"email": "[email protected]",
24+
"phone": "800-555-1212",
25+
"type": "customer"
26+
},
27+
"threadCount": 4,
28+
"status": "closed",
29+
"subject": "I need help!",
30+
"preview": "Hello, I tried to download the file off your site...",
31+
"createdBy": {
32+
"id": 29418,
33+
"firstName": "Vernon",
34+
"lastName": "Bear",
35+
"email": "[email protected]",
36+
"phone": null,
37+
"type": "customer"
38+
},
39+
"createdAt": "2012-07-23T12:34:12Z",
40+
"modifiedAt": "2012-07-24T20:18:33Z",
41+
"closedAt": "2012-07-24T20:18:33Z",
42+
"closedBy": {
43+
"id": 1234,
44+
"firstName": "Jack",
45+
"lastName": "Sprout",
46+
"email": "[email protected]",
47+
"phone": null,
48+
"type": "user"
49+
},
50+
"source": {
51+
"type": "email",
52+
"via": "customer"
53+
},
54+
"cc": [
55+
56+
57+
],
58+
"bcc": [
59+
60+
61+
],
62+
"tags": [
63+
"tag1",
64+
"tag2"
65+
],
66+
"customFields": [
67+
{
68+
"fieldId": 1,
69+
"name": "Team",
70+
"value": "Development"
71+
},
72+
{
73+
"fieldId": 2,
74+
"name": "Customer Disposition",
75+
"value": "Happy"
76+
}
77+
],
78+
"threads": [
79+
{
80+
"id": 88171881,
81+
"assignedTo": {
82+
"id": 1234,
83+
"firstName": "Jack",
84+
"lastName": "Sprout",
85+
"email": "[email protected]",
86+
"phone": null,
87+
"type": "user"
88+
},
89+
"status": "closed",
90+
"createdAt": "2012-07-23T12:34:12Z",
91+
"createdBy": {
92+
"id": 1234,
93+
"firstName": "Jack",
94+
"lastName": "Sprout",
95+
"email": "[email protected]",
96+
"phone": null,
97+
"type": "user"
98+
},
99+
"source": {
100+
"type": "web",
101+
"via": "user"
102+
},
103+
"type": "message",
104+
"state": "published",
105+
"customer": {
106+
"id": 29418,
107+
"firstName": "Vernon",
108+
"lastName": "Bear",
109+
"email": "[email protected]",
110+
"phone": "800-555-1212",
111+
"type": "customer"
112+
},
113+
"fromMailbox": null,
114+
"body": "This is what I have to say. Thank you.",
115+
"to": [
116+
117+
],
118+
"cc": [
119+
120+
121+
],
122+
"bcc": [
123+
124+
125+
],
126+
"attachments": [
127+
{
128+
"id": 12391,
129+
"mimeType": "image/jpeg",
130+
"filename": "logo.jpg",
131+
"size": 22,
132+
"width": 160,
133+
"height": 160,
134+
"url": "https://secure.helpscout.net/some-url/logo.jpg"
135+
}
136+
],
137+
"tags": [
138+
"tag1",
139+
"tag2",
140+
"tag3"
141+
]
142+
}
143+
]
144+
}

components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "help_scout-new-agent-reply-instant",
66
name: "New Agent Reply (Instant)",
77
description: "Emit new event when an agent replies to a conversation.",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

0 commit comments

Comments
 (0)