-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Merged
Merged
Helpscout new components #17637
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4c5f008
Adding new webhook source
GTFalcao 1320057
package version bump
GTFalcao ede3f24
Adding new actions
GTFalcao 9d23d21
Version bumps
GTFalcao a68c532
version bump
GTFalcao 2320d5b
Adding page prop to 'get conversation threads'
GTFalcao 3a7e1b8
Merge branch 'master' into 17431-helpscout
GTFalcao c8a069c
pnpm
GTFalcao 54d8b9a
Adjusting embed parameter
GTFalcao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
components/help_scout/actions/get-conversation-details/get-conversation-details.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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, | ||
}, | ||
}); | ||
|
||
$.export("$summary", `Successfully retrieved conversation details (ID: ${this.conversationId})`); | ||
return response; | ||
}, | ||
}; |
27 changes: 27 additions & 0 deletions
27
components/help_scout/actions/get-conversation-threads/get-conversation-threads.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = (await this.helpScout.getConversationThreads({ | ||
$, | ||
conversationId: this.conversationId, | ||
}))?._embedded?.threads; | ||
|
||
$.export("$summary", `Successfully retrieved ${response?.length || 0} threads for conversation ID: ${this.conversationId}`); | ||
return response; | ||
}, | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...scout/sources/conversation-status-updated-instant/conversation-status-updated-instant.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
|
||
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, | ||
}; |
144 changes: 144 additions & 0 deletions
144
components/help_scout/sources/conversation-status-updated-instant/test-event.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It looks from the docs like maybe this can be paginated? If so, we should offer a
maxResults
prop and return a paginated list.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.
Good call - it seems the Helpscout API only supports passing a 'page' parameter though, and the page size for this endpoint is fixed at 25 entries. I've added a 'page' prop with this information so users can retrieve older entries if needed