File tree Expand file tree Collapse file tree 3 files changed +72
-1
lines changed Expand file tree Collapse file tree 3 files changed +72
-1
lines changed Original file line number Diff line number Diff line change 1+ import frontApp from "../../frontapp.app.mjs" ;
2+
3+ export default {
4+ key : "frontapp-get-conversation" ,
5+ name : "Get Conversation" ,
6+ description : "Retrieve a conversation by its ID from Front. [See the documentation](https://dev.frontapp.com/reference/get-conversation-by-id)" ,
7+ version : "0.0.1" ,
8+ type : "action" ,
9+ props : {
10+ frontApp,
11+ conversationId : {
12+ propDefinition : [
13+ frontApp ,
14+ "conversationId" ,
15+ ] ,
16+ } ,
17+ includeMessages : {
18+ type : "boolean" ,
19+ label : "Include Messages" ,
20+ description : "Whether to include all messages from the conversation" ,
21+ default : false ,
22+ optional : true ,
23+ } ,
24+ } ,
25+ async run ( { $ } ) {
26+ const conversation = await this . frontApp . getConversation ( {
27+ $,
28+ conversationId : this . conversationId ,
29+ } ) ;
30+
31+ if ( this . includeMessages ) {
32+ const messages = [ ] ;
33+ for await ( const message of this . frontapp . paginate ( {
34+ fn : this . frontapp . makeRequest ,
35+ path : `/conversations/${ this . conversationId } /messages` ,
36+ } ) ) {
37+ messages . push ( message ) ;
38+ }
39+ conversation . messages = messages ;
40+ }
41+
42+ $ . export ( "$summary" , `Successfully retrieved conversation with ID: ${ this . conversationId } ` ) ;
43+
44+ return conversation ;
45+ } ,
46+ } ;
Original file line number Diff line number Diff line change 1+ import frontApp from "../../frontapp.app.mjs" ;
2+
3+ export default {
4+ key : "frontapp-get-message" ,
5+ name : "Get Message" ,
6+ description : "Retrieve a message by its ID. [See the documentation](https://dev.frontapp.com/reference/get-message)" ,
7+ version : "0.0.1" ,
8+ type : "action" ,
9+ props : {
10+ frontApp,
11+ messageId : {
12+ type : "string" ,
13+ label : "Message ID" ,
14+ description : "The unique identifier of the message to retrieve" ,
15+ } ,
16+ } ,
17+ async run ( { $ } ) {
18+ const response = await this . frontApp . makeRequest ( {
19+ $,
20+ path : `/messages/${ this . messageId } ` ,
21+ } ) ;
22+ $ . export ( "$summary" , `Successfully retrieved message with ID: ${ this . messageId } ` ) ;
23+ return response ;
24+ } ,
25+ } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/frontapp" ,
3- "version" : " 0.7.0 " ,
3+ "version" : " 0.7.1 " ,
44 "description" : " Pipedream Frontapp Components" ,
55 "main" : " frontapp.app.mjs" ,
66 "keywords" : [
You can’t perform that action at this time.
0 commit comments