Skip to content

Commit 7db2dc4

Browse files
Merging pull request #16185
* [TRIGGER] Cliniko #12462 Sources - New Appointment Updated * pnpm update * pnpm update * pnpm update * Update components/cliniko/sources/new-appointment-updated/new-appointment-updated.mjs --------- Co-authored-by: michelle0927 <[email protected]>
1 parent a34b8f1 commit 7db2dc4

File tree

8 files changed

+126
-7
lines changed

8 files changed

+126
-7
lines changed

components/cliniko/actions/get-patient/get-patient.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
name: "Get Patient",
55
key: "cliniko-get-patient",
66
description: "Get the details of a patient by patient ID.",
7-
version: "0.1.0",
7+
version: "0.1.1",
88
type: "action",
99
props: {
1010
app,

components/cliniko/cliniko.app.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,11 @@ export default {
102102
...args,
103103
});
104104
},
105+
listAppointments(args = {}) {
106+
return this.makeRequest({
107+
path: "/appointments",
108+
...args,
109+
});
110+
},
105111
},
106112
};

components/cliniko/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/cliniko",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Pipedream Cliniko Components",
55
"main": "cliniko.app.mjs",
66
"keywords": [

components/cliniko/sources/common/polling.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ export default {
2828
getResourcesFn() {
2929
throw new ConfigurationError("getResourcesFn is not implemented");
3030
},
31+
getSort() {
32+
return "created_at:desc";
33+
},
3134
getResourcesFnArgs() {
3235
return {
3336
debug: true,
3437
params: {
3538
per_page: constants.DEFAULT_LIMIT,
36-
sort: "created_at:desc",
39+
sort: this.getSort(),
3740
},
3841
};
3942
},
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import common from "../common/polling.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "cliniko-new-appointment-updated",
7+
name: "New Appointment Updated",
8+
description: "Emit new event when an appointment is updated in Cliniko.",
9+
type: "source",
10+
version: "0.0.1",
11+
dedupe: "unique",
12+
methods: {
13+
...common.methods,
14+
getResourceName() {
15+
return "appointments";
16+
},
17+
getResourcesFn() {
18+
return this.app.listAppointments;
19+
},
20+
generateMeta(resource) {
21+
return {
22+
id: `${resource.id}-${resource.updated_at}`,
23+
summary: `Appointment updated: ${resource.id}`,
24+
ts: Date.parse(resource.updated_at),
25+
};
26+
},
27+
getSort() {
28+
return "updated_at:desc";
29+
},
30+
},
31+
sampleEmit,
32+
};
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
export default {
2+
"appointment_type": {
3+
"links": {
4+
"self": "https://api.au1.cliniko.com/v1/appointment_types/1"
5+
}
6+
},
7+
"archived_at": "2019-08-24T14:15:22Z",
8+
"attendees": {
9+
"links": {
10+
"self": "https://api.au1.cliniko.com/v1/individual_appointments/1/attendees"
11+
}
12+
},
13+
"booking_ip_address": "10.0.0.43",
14+
"business": {
15+
"links": {
16+
"self": "https://api.au1.cliniko.com/v1/businesses/1"
17+
}
18+
},
19+
"cancellation_note": "string",
20+
"cancellation_reason": 0,
21+
"cancellation_reason_description": "Feeling Better",
22+
"cancelled_at": "2019-08-24T14:15:22Z",
23+
"conflicts": {
24+
"links": {
25+
"self": "https://api.au1.cliniko.com/v1/individual_appointments/1/conflicts"
26+
}
27+
},
28+
"created_at": "2019-08-24T14:15:22Z",
29+
"deleted_at": "2019-08-24T14:15:22Z",
30+
"did_not_arrive": true,
31+
"email_reminder_sent": true,
32+
"ends_at": "2019-08-24T14:15:22Z",
33+
"has_patient_appointment_notes": true,
34+
"id": "string",
35+
"invoice_status": 0,
36+
"links": {
37+
"self": "https://api.au1.cliniko.com/v1/individual_appointments/1"
38+
},
39+
"notes": "string",
40+
"online_booking_policy_accepted": true,
41+
"patient": {
42+
"links": {
43+
"self": "https://api.au1.cliniko.com/v1/patients/1"
44+
}
45+
},
46+
"patient_arrived": true,
47+
"patient_case": {
48+
"links": {
49+
"self": "https://api.au1.cliniko.com/v1/patient_cases/1"
50+
}
51+
},
52+
"patient_name": "string",
53+
"practitioner": {
54+
"links": {
55+
"self": "https://api.au1.cliniko.com/v1/practitioners/1"
56+
}
57+
},
58+
"repeat_rule": {
59+
"number_of_repeats": 0,
60+
"repeat_type": "Daily",
61+
"repeating_interval": 0
62+
},
63+
"repeated_from": {
64+
"links": {
65+
"self": "https://api.au1.cliniko.com/v1/individual_appointments/1"
66+
}
67+
},
68+
"repeats": {
69+
"links": {
70+
"self": "https://api.au1.cliniko.com/v1/individual_appointments?q[]=repeated_from_id:=1"
71+
}
72+
},
73+
"sms_reminder_sent": true,
74+
"starts_at": "2019-08-24T14:15:22Z",
75+
"telehealth_url": "http://example.com",
76+
"treatment_note_status": 0,
77+
"updated_at": "2019-08-24T14:15:22Z"
78+
}

components/cliniko/sources/new-booking-created/new-booking-created.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export default {
55
...common,
66
key: "cliniko-new-booking-created",
77
name: "New Booking Created",
8-
description: "Emit new event when a booking is created in Cliniko. [See the documentation]()",
8+
description: "Emit new event when a booking is created in Cliniko.",
99
type: "source",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
dedupe: "unique",
1212
methods: {
1313
...common.methods,

components/cliniko/sources/new-contact-created/new-contact-created.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export default {
55
...common,
66
key: "cliniko-new-contact-created",
77
name: "New Contact Created",
8-
description: "Emit new event when a contact is created in Cliniko. [See the documentation]()",
8+
description: "Emit new event when a contact is created in Cliniko.",
99
type: "source",
10-
version: "0.0.1",
10+
version: "0.0.2",
1111
dedupe: "unique",
1212
methods: {
1313
...common.methods,

0 commit comments

Comments
 (0)