-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - goto_meeting #15392
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
Open
luancazarine
wants to merge
3
commits into
master
Choose a base branch
from
issue-15169
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
67 changes: 67 additions & 0 deletions
67
components/goto_meeting/actions/create-meeting/create-meeting.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,67 @@ | ||
import { MEETING_TYPE_OPTIONS } from "../../common/constants.mjs"; | ||
import { parseObject } from "../../common/utils.mjs"; | ||
import app from "../../goto_meeting.app.mjs"; | ||
|
||
export default { | ||
key: "goto_meeting-create-meeting", | ||
name: "Create Meeting", | ||
description: "Creates a scheduled meeting in GoTo Meeting. [See the documentation](https://developer.goto.com/GoToMeetingV1#tag/Meetings/operation/createMeeting)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
subject: { | ||
type: "string", | ||
label: "Subject", | ||
description: "The subject of the meeting", | ||
}, | ||
startTime: { | ||
type: "string", | ||
label: "Start Time", | ||
description: "The start time of the meeting in ISO 8601 format", | ||
}, | ||
endTime: { | ||
type: "string", | ||
label: "End Time", | ||
description: "The end time of the meeting in ISO 8601 format", | ||
}, | ||
passwordRequired: { | ||
type: "boolean", | ||
label: "Password Required", | ||
description: "Whether a password is required to join the meeting", | ||
}, | ||
conferenceCallInfo: { | ||
type: "string", | ||
label: "Conference Call Info", | ||
description: "Information for the conference call", | ||
}, | ||
meetingType: { | ||
type: "string", | ||
label: "Meeting Type", | ||
description: "The type of the meeting", | ||
options: MEETING_TYPE_OPTIONS, | ||
}, | ||
coorganizerKeys: { | ||
type: "string[]", | ||
label: "Co-Organizer Keys", | ||
description: "Keys of the co-organizers for the meeting", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const meeting = await this.app.createScheduledMeeting({ | ||
$, | ||
data: { | ||
subject: this.subject, | ||
startTime: this.startTime, | ||
endTime: this.endTime, | ||
passwordRequired: this.passwordRequired, | ||
conferenceCallInfo: this.conferenceCallInfo, | ||
meetingType: this.meetingType, | ||
coorganizerKeys: parseObject(this.coorganizerKeys), | ||
}, | ||
}); | ||
$.export("$summary", `Meeting Created: ${meeting[0].meetingid}`); | ||
return meeting; | ||
}, | ||
}; |
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,14 @@ | ||
export const MEETING_TYPE_OPTIONS = [ | ||
{ | ||
label: "Scheduled", | ||
value: "scheduled", | ||
}, | ||
{ | ||
label: "Instant", | ||
value: "instant", | ||
}, | ||
{ | ||
label: "Recurring", | ||
value: "recurring", | ||
}, | ||
]; |
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,24 @@ | ||
export const parseObject = (obj) => { | ||
if (!obj) return undefined; | ||
|
||
if (Array.isArray(obj)) { | ||
return obj.map((item) => { | ||
if (typeof item === "string") { | ||
try { | ||
return JSON.parse(item); | ||
} catch (e) { | ||
return item; | ||
} | ||
} | ||
return item; | ||
}); | ||
} | ||
if (typeof obj === "string") { | ||
try { | ||
return JSON.parse(obj); | ||
} catch (e) { | ||
return obj; | ||
} | ||
} | ||
return obj; | ||
}; |
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,11 +1,38 @@ | ||
import { axios } from "@pipedream/platform"; | ||
|
||
export default { | ||
type: "app", | ||
app: "goto_meeting", | ||
propDefinitions: {}, | ||
methods: { | ||
// this.$auth contains connected account data | ||
authKeys() { | ||
console.log(Object.keys(this.$auth)); | ||
_baseUrl() { | ||
return "https://api.goto.com/meeting/v1"; | ||
}, | ||
_headers() { | ||
return { | ||
"Authorization": `Bearer ${this.$auth.oauth_access_token}`, | ||
}; | ||
}, | ||
_makeRequest({ | ||
$ = this, path, ...opts | ||
}) { | ||
return axios($, { | ||
url: this._baseUrl() + path, | ||
headers: this._headers(), | ||
...opts, | ||
}); | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
createScheduledMeeting(opts = {}) { | ||
return this._makeRequest({ | ||
method: "POST", | ||
path: "/meetings", | ||
...opts, | ||
}); | ||
}, | ||
listUpcomingMeetings(opts = {}) { | ||
return this._makeRequest({ | ||
path: "/upcomingMeetings", | ||
...opts, | ||
}); | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
}; |
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,6 +1,6 @@ | ||
{ | ||
"name": "@pipedream/goto_meeting", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Pipedream GoTo Meeting Components", | ||
"main": "goto_meeting.app.mjs", | ||
"keywords": [ | ||
|
@@ -11,5 +11,8 @@ | |
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pipedream/platform": "^3.0.3" | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
components/goto_meeting/sources/new-meeting/new-meeting.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,42 @@ | ||
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; | ||
import app from "../../goto_meeting.app.mjs"; | ||
|
||
export default { | ||
key: "goto_meeting-new-meeting", | ||
name: "New Meeting Created", | ||
description: "Emit new event when a meeting is created in your GoToMeeting account.", | ||
version: "0.0.1", | ||
type: "source", | ||
dedupe: "unique", | ||
props: { | ||
app, | ||
db: "$.service.db", | ||
timer: { | ||
type: "$.interface.timer", | ||
default: { | ||
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, | ||
}, | ||
}, | ||
}, | ||
methods: { | ||
async emitEvent() { | ||
const response = await this.app.listUpcomingMeetings(); | ||
|
||
for (const item of response) { | ||
this.$emit(item, { | ||
id: item.meetingId, | ||
summary: `Meeting Created: ${item.meetingId}`, | ||
ts: Date.now(), | ||
}); | ||
} | ||
}, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
hooks: { | ||
async deploy() { | ||
await this.emitEvent(); | ||
}, | ||
}, | ||
async run() { | ||
await this.emitEvent(); | ||
}, | ||
}; |
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.