-
Notifications
You must be signed in to change notification settings - Fork 5.5k
CalendarHero new components #15921
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
CalendarHero new components #15921
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2b563ff
pnpm
GTFalcao 286225b
CalendarHero app/package
GTFalcao e4c4bab
pnpm
GTFalcao 88c8412
Adding 'List Meetings' action
GTFalcao 8efadb0
Adding 'List Meeting Types' action
GTFalcao 13eaccc
Adding 'new event' webhook source
GTFalcao 701bd16
Small adjustments
GTFalcao a3745b1
adjustment
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 was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
components/calendarhero/actions/list-meeting-types/list-meeting-types.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,22 @@ | ||
| import app from "../../calendarhero.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "calendarhero-list-meeting-types", | ||
| name: "List Meeting Types", | ||
| description: "Get the user's meeting types. [See the documentation](https://api.calendarhero.com/documentation#/user/getUserMeeting).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.listMeetingTypes({ | ||
| $, | ||
| }); | ||
| const { length } = Object.keys(response ?? {}); | ||
| $.export("$summary", `Successfully listed ${length} meeting type${length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return response; | ||
| }, | ||
| }; |
36 changes: 36 additions & 0 deletions
36
components/calendarhero/actions/list-meetings/list-meetings.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 app from "../../calendarhero.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "calendarhero-list-meetings", | ||
| name: "List Meetings", | ||
| description: "Get the user's meetings within a timeframe. [See the documentation](https://api.calendarhero.com/documentation#/meeting/getMeeting).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| start: { | ||
| type: "string", | ||
| label: "Start Date/Time", | ||
| description: "Initial date/time of the period to list events, in ISO 8601 format, e.g. `2025-03-10T09:00:00Z`", | ||
| }, | ||
| end: { | ||
| type: "string", | ||
| label: "End Date/Time", | ||
| description: "End date/time of the period to list events, in ISO 8601 format, e.g. `2025-03-14T18:00:00Z`", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, ...params | ||
| } = this; | ||
| const response = await app.listMeetings({ | ||
| $, | ||
| params, | ||
| }); | ||
| const { length } = response; | ||
| $.export("$summary", `Successfully listed ${length} meeting${length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return response; | ||
| }, | ||
| }; |
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "calendarhero", | ||
| propDefinitions: {}, | ||
| methods: { | ||
| async _makeRequest({ | ||
| $ = this, headers, ...args | ||
| } = {}) { | ||
| return axios($, { | ||
| baseURL: "https://api.calendarhero.com", | ||
| headers: { | ||
| ...headers, | ||
| Authorization: `${this.$auth.api_key}`, | ||
| }, | ||
| ...args, | ||
| }); | ||
| }, | ||
| listMeetings(args) { | ||
| return this._makeRequest({ | ||
| url: "/meeting", | ||
| ...args, | ||
| }); | ||
| }, | ||
| listMeetingTypes(args) { | ||
| return this._makeRequest({ | ||
| url: "/user/meeting", | ||
| ...args, | ||
| }); | ||
| }, | ||
| createWebhook({ | ||
| event, ...args | ||
| }) { | ||
| return this._makeRequest({ | ||
| method: "post", | ||
| url: `webhook/${event}`, | ||
| ...args, | ||
| }); | ||
| }, | ||
| deleteWebhook(event) { | ||
| return this._makeRequest({ | ||
| method: "delete", | ||
| url: `webhook/${event}`, | ||
| }); | ||
| }, | ||
| }, | ||
| }; |
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,34 @@ | ||
| export const WEBHOOK_EVENT_TYPE_OPTIONS = [ | ||
| { | ||
| label: "New Meeting Request", | ||
| value: "new_meeting_request", | ||
| }, | ||
| { | ||
| label: "Meeting Request Succeeded", | ||
| value: "meeting_request_success", | ||
| }, | ||
| { | ||
| label: "Meeting Request Expired", | ||
| value: "meeting_request_expired", | ||
| }, | ||
| { | ||
| label: "Meeting Request Cancelled", | ||
| value: "meeting_request_cancelled", | ||
| }, | ||
| { | ||
| label: "Meeting Rescheduled", | ||
| value: "meeting_rescheduled", | ||
| }, | ||
| { | ||
| label: "Meeting Started", | ||
| value: "meeting_started", | ||
| }, | ||
| { | ||
| label: "Meeting Completed", | ||
| value: "meeting_completed", | ||
| }, | ||
| { | ||
| label: "New Contact Added", | ||
| value: "new_contact_added", | ||
| }, | ||
| ]; |
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 |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| { | ||
| "name": "@pipedream/calendarhero", | ||
| "version": "0.0.3", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream CalendarHero Components", | ||
| "main": "dist/app/calendarhero.app.mjs", | ||
| "main": "calendarhero.app.mjs", | ||
| "keywords": [ | ||
| "pipedream", | ||
| "calendarhero" | ||
| ], | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "homepage": "https://pipedream.com/apps/calendarhero", | ||
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.0.3" | ||
| } | ||
| } |
61 changes: 61 additions & 0 deletions
61
components/calendarhero/sources/new-event-instant/new-event-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,61 @@ | ||
| import app from "../../calendarhero.app.mjs"; | ||
| import { WEBHOOK_EVENT_TYPE_OPTIONS } from "../../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| key: "calendarhero-new-event-instant", | ||
| name: "New Event (Instant)", | ||
| description: | ||
| "Emit new event when a selected type of CalendarHero event occurs. [See the documentation](https://api.calendarhero.com/documentation#/webhook/postWebhookEvent)", | ||
| type: "source", | ||
| version: "0.0.1", | ||
| dedupe: "unique", | ||
| props: { | ||
| app, | ||
| http: "$.interface.http", | ||
| event: { | ||
| type: "string", | ||
| label: "Event Type", | ||
| description: "Select the type of event that will trigger this source", | ||
| options: WEBHOOK_EVENT_TYPE_OPTIONS, | ||
| }, | ||
| }, | ||
| hooks: { | ||
| async activate() { | ||
| const { | ||
| app, | ||
| event, | ||
| http: { endpoint: hookUrl }, | ||
| } = this; | ||
| await app.createWebhook({ | ||
| event, | ||
| data: { | ||
| hookUrl, | ||
| }, | ||
| }); | ||
| }, | ||
| async deactivate() { | ||
| const { | ||
| app, | ||
| event, | ||
| http: { endpoint: hookUrl }, | ||
| } = this; | ||
| await app.deleteWebhook({ | ||
| event, | ||
| data: { | ||
| hookUrl, | ||
| }, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ body }) { | ||
| const ts = Date.now(); | ||
| const id = body.id ?? ts; | ||
| this.$emit(body, { | ||
| id, | ||
| summary: `New event${id | ||
| ? ` (ID ${id})` | ||
| : ""}`, | ||
| ts, | ||
| }); | ||
| }, | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.