File tree Expand file tree Collapse file tree 7 files changed +31
-32
lines changed 
components/the_magic_drip 
mark_campaign_active_or_inactive Expand file tree Collapse file tree 7 files changed +31
-32
lines changed Original file line number Diff line number Diff line change 1- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
1+ import  app  from  "../../the_magic_drip.app.mjs" ; 
22
33export  default  { 
44  key : "the_magic_drip-add-lead-to-campaign" , 
@@ -7,30 +7,30 @@ export default {
77  version : "0.0.{{ts}}" , 
88  type : "action" , 
99  props : { 
10-     the_magic_drip , 
10+     app , 
1111    campaignId : { 
1212      propDefinition : [ 
13-         the_magic_drip , 
13+         app , 
1414        "campaignId" , 
1515      ] , 
1616    } , 
1717    company : { 
1818      propDefinition : [ 
19-         the_magic_drip , 
19+         app , 
2020        "company" , 
2121      ] , 
2222      optional : true , 
2323    } , 
2424    linkedinUrl : { 
2525      propDefinition : [ 
26-         the_magic_drip , 
26+         app , 
2727        "linkedinUrl" , 
2828      ] , 
2929      optional : true , 
3030    } , 
3131  } , 
3232  async  run ( {  $ } )  { 
33-     const  response  =  await  this . the_magic_drip . addLeadToCampaign ( { 
33+     const  response  =  await  this . app . addLeadToCampaign ( { 
3434      campaignId : this . campaignId , 
3535      company : this . company , 
3636      linkedinUrl : this . linkedinUrl , 
Original file line number Diff line number Diff line change 1- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
1+ import  app  from  "../../the_magic_drip.app.mjs" ; 
22
33export  default  { 
44  key : "the_magic_drip-list-campaigns" , 
55  name : "List Campaigns" , 
6-   description : "Lists  all available campaigns. [See the documentation](https://docs.themagicdrip.com/api-reference/introduction )" , 
7-   version : "0.0.{{ts}} " , 
6+   description : "Retrieve  all available campaigns. [See the documentation](https://docs.themagicdrip.com/api-reference/endpoint/get-v1campaign )" , 
7+   version : "0.0.1 " , 
88  type : "action" , 
99  props : { 
10-     the_magic_drip , 
10+     app , 
1111  } , 
1212  async  run ( {  $ } )  { 
13-     const  response   =  await  this . the_magic_drip . listCampaigns ( ) ; 
14-     $ . export ( "$summary" ,  `Listed  ${ response . campaigns . length }   campaigns` ) ; 
15-     return  response . campaigns ; 
13+     const  {  campaigns  }   =  await  this . app . listCampaigns ( ) ; 
14+     $ . export ( "$summary" ,  `Sucessfully retrieved  ${ campaigns ? .length   ??   0 }   campaigns` ) ; 
15+     return  campaigns ; 
1616  } , 
1717} ; 
Original file line number Diff line number Diff line change 1- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
1+ import  app  from  "../../the_magic_drip.app.mjs" ; 
22
33export  default  { 
44  key : "the_magic_drip-list-templates" , 
55  name : "List Templates" , 
6-   description : "Lists  all available templates. [See the documentation]()" , 
7-   version : "0.0.{{ts}} " , 
6+   description : "Retrieve  all available templates. [See the documentation](https://docs.themagicdrip.com/api-reference/endpoint/get-v1templates )" , 
7+   version : "0.0.1 " , 
88  type : "action" , 
99  props : { 
10-     the_magic_drip , 
10+     app , 
1111  } , 
1212  async  run ( {  $ } )  { 
13-     const  templates  =  await  this . the_magic_drip . listTemplates ( ) ; 
14-     $ . export ( "$summary" ,  `Listed  ${ templates . templates . length }   templates` ) ; 
13+     const  {   templates }   =  await  this . app . listTemplates ( ) ; 
14+     $ . export ( "$summary" ,  `Sucessfully retrieved  ${ templates ?. length   ??   0 }   templates` ) ; 
1515    return  templates ; 
1616  } , 
1717} ; 
Original file line number Diff line number Diff line change 1- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
1+ import  app  from  "../../the_magic_drip.app.mjs" ; 
22
33export  default  { 
44  key : "the_magic_drip-mark-campaign-active-inactive" , 
@@ -7,10 +7,10 @@ export default {
77  version : "0.0.{{ts}}" , 
88  type : "action" , 
99  props : { 
10-     the_magic_drip , 
10+     app , 
1111    campaignId : { 
1212      propDefinition : [ 
13-         the_magic_drip , 
13+         app , 
1414        "campaignId" , 
1515      ] , 
1616    } , 
@@ -21,7 +21,7 @@ export default {
2121    } , 
2222  } , 
2323  async  run ( {  $ } )  { 
24-     const  response  =  await  this . the_magic_drip . markCampaignActiveInactive ( { 
24+     const  response  =  await  this . app . markCampaignActiveInactive ( { 
2525      campaignId : this . campaignId , 
2626      desiredState : this . desiredState , 
2727    } ) ; 
Original file line number Diff line number Diff line change 11import  {  DEFAULT_POLLING_SOURCE_TIMER_INTERVAL  }  from  "@pipedream/platform" ; 
2- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
2+ import  app  from  "../../the_magic_drip.app.mjs" ; 
33
44export  default  { 
55  key : "the_magic_drip-new-campaign-created" , 
@@ -9,7 +9,7 @@ export default {
99  type : "source" , 
1010  dedupe : "unique" , 
1111  props : { 
12-     the_magic_drip , 
12+     app , 
1313    db : "$.service.db" , 
1414    timer : { 
1515      type : "$.interface.timer" , 
@@ -21,7 +21,7 @@ export default {
2121  hooks : { 
2222    async  deploy ( )  { 
2323      const  lastRunAt  =  new  Date ( 0 ) . toISOString ( ) ; 
24-       const  newCampaigns  =  await  this . the_magic_drip . pollNewCampaigns ( lastRunAt ) ; 
24+       const  newCampaigns  =  await  this . app . pollNewCampaigns ( lastRunAt ) ; 
2525      const  sortedCampaigns  =  newCampaigns . sort ( 
2626        ( a ,  b )  =>  new  Date ( b . createdAt )  -  new  Date ( a . createdAt ) , 
2727      ) . slice ( 0 ,  50 ) ; 
@@ -51,7 +51,7 @@ export default {
5151  } , 
5252  async  run ( )  { 
5353    const  lastRunAt  =  ( await  this . db . get ( "lastRunAt" ) )  ||  new  Date ( 0 ) . toISOString ( ) ; 
54-     const  newCampaigns  =  await  this . the_magic_drip . pollNewCampaigns ( lastRunAt ) ; 
54+     const  newCampaigns  =  await  this . app . pollNewCampaigns ( lastRunAt ) ; 
5555    const  sortedCampaigns  =  newCampaigns . sort ( 
5656      ( a ,  b )  =>  new  Date ( b . createdAt )  -  new  Date ( a . createdAt ) , 
5757    ) ; 
Original file line number Diff line number Diff line change 11import  {  DEFAULT_POLLING_SOURCE_TIMER_INTERVAL  }  from  "@pipedream/platform" ; 
2- import  the_magic_drip  from  "../../the_magic_drip.app.mjs" ; 
2+ import  app  from  "../../the_magic_drip.app.mjs" ; 
33
44export  default  { 
55  key : "the_magic_drip-new-template-created" , 
@@ -9,7 +9,7 @@ export default {
99  type : "source" , 
1010  dedupe : "unique" , 
1111  props : { 
12-     the_magic_drip , 
12+     app , 
1313    db : "$.service.db" , 
1414    timer : { 
1515      type : "$.interface.timer" , 
@@ -29,7 +29,7 @@ export default {
2929  hooks : { 
3030    async  deploy ( )  { 
3131      const  lastRunAt  =  new  Date ( 0 ) . toISOString ( ) ; 
32-       const  newTemplates  =  await  this . the_magic_drip . pollNewTemplates ( lastRunAt ) ; 
32+       const  newTemplates  =  await  this . app . pollNewTemplates ( lastRunAt ) ; 
3333      const  sortedTemplates  =  newTemplates . sort ( 
3434        ( a ,  b )  =>  new  Date ( b . createdAt )  -  new  Date ( a . createdAt ) , 
3535      ) ; 
@@ -56,7 +56,7 @@ export default {
5656  } , 
5757  async  run ( )  { 
5858    const  lastRunAt  =  await  this . _getLastRunAt ( ) ; 
59-     const  newTemplates  =  await  this . the_magic_drip . pollNewTemplates ( lastRunAt ) ; 
59+     const  newTemplates  =  await  this . app . pollNewTemplates ( lastRunAt ) ; 
6060    const  sortedNewTemplates  =  newTemplates . sort ( 
6161      ( a ,  b )  =>  new  Date ( a . createdAt )  -  new  Date ( b . createdAt ) , 
6262    ) ; 
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { axios } from "@pipedream/platform";
33export  default  { 
44  type : "app" , 
55  app : "the_magic_drip" , 
6-   version : "0.0.{{ts}}" , 
76  propDefinitions : { 
87    campaignId : { 
98      type : "string" , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments