File tree Expand file tree Collapse file tree 6 files changed +102
-10
lines changed
components/acuity_scheduling
appointment-canceled-instant
appointment-rescheduled-instant Expand file tree Collapse file tree 6 files changed +102
-10
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pipedream/acuity_scheduling" ,
3- "version" : " 0.2 .0" ,
3+ "version" : " 0.3 .0" ,
44 "description" : " Pipedream Acuity Scheduling Components" ,
55 "main" : " acuity_scheduling.app.mjs" ,
66 "keywords" : [
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ export default {
66 key : "acuity_scheduling-appointment-canceled-instant" ,
77 name : "New Appointment Canceled (Instant)" ,
88 description : "Emit new event when an appointment is canceled." ,
9- version : "0.0.2 " ,
9+ version : "0.0.3 " ,
1010 type : "source" ,
1111 dedupe : "unique" ,
1212 methods : {
13+ ...common . methods ,
1314 getEvent ( ) {
1415 return "appointment.canceled" ;
1516 } ,
Original file line number Diff line number Diff line change 1+ import common from "../common/base.mjs" ;
2+ import sampleEmit from "./test-event.mjs" ;
3+
4+ export default {
5+ ...common ,
6+ key : "acuity_scheduling-appointment-rescheduled-instant" ,
7+ name : "New Appointment Rescheduled (Instant)" ,
8+ description : "Emit new event when an appointment is rescheduled." ,
9+ version : "0.0.1" ,
10+ type : "source" ,
11+ dedupe : "unique" ,
12+ methods : {
13+ ...common . methods ,
14+ getEvent ( ) {
15+ return "appointment.rescheduled" ;
16+ } ,
17+ getSummary ( details ) {
18+ return `Appointment rescheduled with ID: ${ details . id } ` ;
19+ } ,
20+ generateMeta ( details ) {
21+ const ts = Date . parse ( details . datetime ) || Date . now ( ) ;
22+ return {
23+ id : `${ details . id } -${ ts } ` ,
24+ summary : this . getSummary ( details ) ,
25+ ts,
26+ } ;
27+ } ,
28+ } ,
29+ sampleEmit,
30+ } ;
Original file line number Diff line number Diff line change 1+ export default {
2+ "id" : 54321 ,
3+ "firstName" : "Bob" ,
4+ "lastName" : "McTest" ,
5+ "phone" : "" ,
6+ 7+ "date" : "June 17, 2013" ,
8+ "time" : "10:15am" ,
9+ "endTime" : "11:15am" ,
10+ "dateCreated" : "July 2, 2013" ,
11+ "datetime" : "2013-06-17T10:15:00-0700" ,
12+ "price" : "10.00" ,
13+ "paid" : "no" ,
14+ "amountPaid" : "0.00" ,
15+ "type" : "Regular Visit" ,
16+ "appointmentTypeID" : 1 ,
17+ "classID" : null ,
18+ "duration" : "60" ,
19+ "calendar" : "My Calendar" ,
20+ "calendarID" : 27238 ,
21+ "canClientCancel" : false ,
22+ "canClientReschedule" : false ,
23+ "location" : "" ,
24+ "certificate" : null ,
25+ "confirmationPage" : "https://acuityscheduling.com/schedule.php?owner=11145481&id[]=1220aa9f41091c50c0cc659385cfa1d0&action=appt" ,
26+ "formsText" : "..." ,
27+ "notes" : "Notes" ,
28+ "timezone" : "America/New_York" ,
29+ "scheduledBy" : null ,
30+ "forms" : [
31+ {
32+ "id" : 1 ,
33+ "name" : "Example Intake Form" ,
34+ "values" : [
35+ {
36+ "value" : "yes" ,
37+ "name" : "Is this your first visit?" ,
38+ "fieldID" : 1 ,
39+ "id" : 21502993 ,
40+ } ,
41+ {
42+ "value" : "Ninja" ,
43+ "name" : "What is your goal for this appointment?" ,
44+ "fieldID" : 2 ,
45+ "id" : 21502994 ,
46+ } ,
47+ ] ,
48+ } ,
49+ ] ,
50+ "labels" : [
51+ {
52+ "id" : 3 ,
53+ "name" : "Completed" ,
54+ "color" : "pink" ,
55+ } ,
56+ ] ,
57+ } ;
Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ export default {
2424 await this . acuityScheduling . deleteHook ( webhookId ) ;
2525 } ,
2626 } ,
27+ methods : {
28+ generateMeta ( details ) {
29+ return {
30+ id : details . id ,
31+ summary : this . getSummary ( details ) ,
32+ ts : Date . parse ( details . datetime ) || Date . now ( ) ,
33+ } ;
34+ } ,
35+ } ,
2736 async run ( event ) {
2837 const { body } = event ;
2938
@@ -36,12 +45,6 @@ export default {
3645 body : "Success" ,
3746 } ) ;
3847
39- const ts = Date . parse ( details . datetime ) || Date . now ( ) ;
40-
41- this . $emit ( details , {
42- id : details . id ,
43- summary : this . getSummary ( details ) ,
44- ts : ts ,
45- } ) ;
48+ this . $emit ( details , this . generateMeta ( details ) ) ;
4649 } ,
4750} ;
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ export default {
66 key : "acuity_scheduling-new-appointment-instant" ,
77 name : "New Appointment (Instant)" ,
88 description : "Emit new event when an appointment is scheduled." ,
9- version : "0.0.2 " ,
9+ version : "0.0.3 " ,
1010 type : "source" ,
1111 dedupe : "unique" ,
1212 methods : {
13+ ...common . methods ,
1314 getEvent ( ) {
1415 return "appointment.scheduled" ;
1516 } ,
You can’t perform that action at this time.
0 commit comments