-
Notifications
You must be signed in to change notification settings - Fork 5.5k
13286 components aevent #19030
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
13286 components aevent #19030
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d092bb7
Implement AEvent component with registrant listing and new registrant…
luancazarine 28df127
pnpm update
luancazarine f03fecf
Update components/aevent/sources/new-registrant/new-registrant.mjs
luancazarine b8f820d
Refactor new-registrant.mjs to remove redundant check for responseArr…
luancazarine 3fbdab7
Update components/aevent/sources/new-registrant/new-registrant.mjs
michelle0927 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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,58 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "aevent", | ||
| propDefinitions: {}, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _apiUrl() { | ||
| return "https://app.aevent.com/api"; | ||
| }, | ||
| _getHeaders() { | ||
| return { | ||
| "Authorization": `Bearer ${this.$auth.api_token}`, | ||
| "Accept": "application/json", | ||
| "Content-Type": "application/json", | ||
| }; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, ...opts | ||
| }) { | ||
| return axios($, { | ||
| url: `${this._apiUrl()}/${path}`, | ||
| headers: this._getHeaders(), | ||
| ...opts, | ||
| }); | ||
| }, | ||
| listRegistrants(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "registrants", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async *paginate({ | ||
| fn, params = {}, maxResults = null, | ||
| }) { | ||
| let hasMore = false; | ||
| let count = 0; | ||
| let page = 0; | ||
|
|
||
| do { | ||
| params.page = page++; | ||
| const { success: data } = await fn({ | ||
| params, | ||
| }); | ||
|
|
||
| for (const d of data) { | ||
| yield d; | ||
|
|
||
| if (maxResults && ++count === maxResults) { | ||
| return count; | ||
| } | ||
| } | ||
|
|
||
| hasMore = data.length; | ||
|
|
||
| } while (hasMore); | ||
| }, | ||
| }, | ||
| }; |
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
70 changes: 70 additions & 0 deletions
70
components/aevent/sources/new-registrant/new-registrant.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,70 @@ | ||
| import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; | ||
| import aevent from "../../aevent.app.mjs"; | ||
| import sampleEmit from "./test-event.mjs"; | ||
|
|
||
| export default { | ||
| key: "aevent-new-registrant", | ||
| name: "New Registrant", | ||
| description: "Emit new event when a new registrant is added. [See the Documentation](https://app.aevent.com/#/settings)", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| aevent, | ||
| db: "$.service.db", | ||
| timer: { | ||
| type: "$.interface.timer", | ||
| default: { | ||
| intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| _getLastDate() { | ||
| return this.db.get("lastDate") || 0; | ||
| }, | ||
| _setLastDate(lastDate) { | ||
| this.db.set("lastDate", lastDate); | ||
| }, | ||
| async emitEvent(maxResults = false) { | ||
| const lastDate = this._getLastDate(); | ||
| const response = await this.aevent.paginate({ | ||
michelle0927 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fn: this.aevent.listRegistrants, | ||
| params: { | ||
| lastDate, | ||
| }, | ||
| maxResults, | ||
| }); | ||
|
|
||
| let responseArray = []; | ||
| for await (const item of response) { | ||
| if (item.registrationTime <= lastDate) break; | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| responseArray.push(item); | ||
| } | ||
|
|
||
| if (responseArray.length) { | ||
| if (maxResults && (responseArray.length > maxResults)) { | ||
| responseArray.length = maxResults; | ||
| } | ||
luancazarine marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this._setLastDate(responseArray[0].registrationTime); | ||
| } | ||
|
|
||
| for (const item of responseArray.reverse()) { | ||
| this.$emit(item, { | ||
| id: item.uuid, | ||
| summary: `New registrant: ${item.email || item.uuid}`, | ||
| ts: item.registrationTime, | ||
| }); | ||
| } | ||
| }, | ||
| }, | ||
| hooks: { | ||
| async deploy() { | ||
| await this.emitEvent(25); | ||
| }, | ||
| }, | ||
| async run() { | ||
| await this.emitEvent(); | ||
| }, | ||
| sampleEmit, | ||
| }; | ||
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,86 @@ | ||
| export default { | ||
| "email": "email@example.com", | ||
| "firstName": "Test", | ||
| "lastName": "Example", | ||
| "phone": "+12342342323", | ||
| "uuid": "unique-id", | ||
| "customFields": { | ||
| "Field": "" | ||
| }, | ||
| "integrations": "{\"registration\": {\"agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0\", \"browser\": \"Chrome\", \"operating_system\": \"Windows\"}}", | ||
| "webinarID": "webinar-id", | ||
| "joinURL": "https://aevent.stream/123abc/123abc", | ||
| "webinarTimeline": "timeline-id", | ||
| "uniqueID":1, | ||
| "unsub":0, | ||
| "registrationTime":1762884255, | ||
| "timeline": { | ||
| "uniqueID":2, | ||
| "webinarTimeline": "timeline-id", | ||
| "nodeID": "events", | ||
| "blocks": "{\"0\": [{\"id\": \"_cxkn4qzpt\", \"day\": \"0\", \"key\": \"0\", \"tag\": null, \"amPm\": 1, \"days\": \"0\", \"hours\": null, \"model\": {\"id\": \"_cxkn4qzpt\", \"message\": \"Welcome to the event everyone, so glad you made it here !\\n\\n\", \"isDelete\": false, \"imagefile\": null, \"action_days\": \"0\", \"fromEventID\": [], \"action_hours\": null, \"fromEventName\": \"\", \"action_groupID\": \"3\", \"action_isAfter\": 1, \"action_isExact\": false, \"action_minutes\": \"5\", \"action_actionTitle\": \"Auto Chat to Audience\"}, \"action\": \"webinar-livechat\", \"dayKey\": \"0\", \"nodeID\": 5, \"groupID\": \"3\", \"isAfter\": 1, \"isExact\": false, \"minutes\": \"5\", \"groupName\": \"Registrants\", \"actionIcon\": \"message-processing\", \"actionTitle\": \"Auto Chat to Audience\", \"insertDayKey\": 0, \"integrationID\": \"adminwebinar\", \"integrationName\": \"LIVE Event Automations\", \"integrationType\": \"WEBINAR\"}, {\"id\": \"_125f969xg\", \"day\": \"0\", \"key\": \"0\", \"tag\": null, \"amPm\": 1, \"days\": \"0\", \"hours\": null, \"model\": {\"id\": \"_125f969xg\", \"message\": \"Welcome to the event everyone, so glad you made it here !\\nHere's the link to join:\\nwww.yourctapage.com\\n\\n\", \"isDelete\": false, \"imagefile\": null, \"action_days\": \"0\", \"fromEventID\": [], \"action_hours\": null, \"action_nodeID\": 5, \"fromEventName\": \"\", \"action_groupID\": \"3\", \"action_isAfter\": 1, \"action_isExact\": false, \"action_minutes\": \"30\", \"action_groupName\": \"Registrants\", \"action_actionTitle\": \"Auto Chat to Audience\"}, \"action\": \"webinar-livechat\", \"dayKey\": \"0\", \"nodeID\": 30, \"groupID\": \"3\", \"isAfter\": 1, \"isExact\": false, \"minutes\": \"30\", \"groupName\": \"Registrants\", \"nodeIdKey\": \"_125f969xg\", \"actionIcon\": \"message-processing\", \"actionTitle\": \"Auto Chat to Audience\", \"insertDayKey\": 0, \"integrationID\": \"adminwebinar\", \"integrationName\": \"LIVE Event Automations\", \"integrationType\": \"WEBINAR\"}], \"+1\": [], \"+2\": [], \"+3\": [], \"+4\": [], \"+5\": [], \"+6\": [], \"+7\": [], \"+8\": [], \"+9\": [], \"-1\": [], \"-2\": [], \"-3\": [], \"-4\": [], \"-5\": [], \"-6\": [], \"-7\": [], \"-8\": [], \"-9\": [], \"+10\": [], \"+11\": [], \"+12\": [], \"+13\": [], \"+14\": [], \"+15\": [], \"+16\": [], \"+17\": [], \"+18\": [], \"+19\": [], \"+20\": [], \"+21\": [], \"+22\": [], \"+23\": [], \"+24\": [], \"+25\": [], \"+26\": [], \"+27\": [], \"+28\": [], \"+29\": [], \"+30\": [], \"+31\": [], \"+32\": [], \"+33\": [], \"+34\": [], \"+35\": [], \"+36\": [], \"+37\": [], \"+38\": [], \"+39\": [], \"+40\": [], \"+41\": [], \"+42\": [], \"+43\": [], \"+44\": [], \"+45\": [], \"-10\": [], \"-11\": [], \"-12\": [], \"-13\": [], \"-14\": [], \"-15\": [], \"-16\": [], \"-17\": [], \"-18\": [], \"-19\": [], \"-20\": [], \"-21\": [], \"-22\": [], \"-23\": [], \"-24\": [], \"-25\": [], \"-26\": [], \"-27\": [], \"-28\": [], \"-29\": [], \"-30\": [], \"-31\": [], \"-32\": [], \"-33\": [], \"-34\": [], \"-35\": [], \"-36\": [], \"-37\": [], \"-38\": [], \"-39\": [], \"-40\": [], \"-41\": [], \"-42\": [], \"-43\": [], \"-44\": [], \"-45\": []}", | ||
| "created_at": "2025-05-13T22:47:28.000000Z", | ||
| "updated_at": "2025-11-11T17:57:18.000000Z", | ||
| "version": null, | ||
| "deleted_at": null, | ||
| "level": null, | ||
| "registration_setting": { | ||
| "uniqueID":5, | ||
| "generalSettingID": "general-setting-id", | ||
| "nodeID": "registration", | ||
| "blocks": "{\"type\": \"multi-option\", \"block\": 0, \"joinStart\": \"15\", \"setupType\": \"page\", \"whitelist\": {\"domains\": \"\", \"enabled\": false}, \"buttonType\": \"defaultButton\", \"customForms\": [{\"name\": \"Field\", \"type\": \"custom_form\"}], \"replayStart\": \"45\", \"customeEnable\": false, \"registrationBody\": \"Test\", \"registrationStart\": \"15\", \"isInnerPageEnabled\": true, \"registrationSubject\": \"Test\"}", | ||
| "created_at": "2025-05-13T22:47:27.000000Z", | ||
| "updated_at": "2025-11-11T18:03:02.000000Z", | ||
| "version": null, | ||
| "deleted_at": null, | ||
| "timelineID": "timeline-id", | ||
| "type": "multi-option", | ||
| "block":0, | ||
| "joinStart": "15", | ||
| "setupType": "page", | ||
| "whitelist": { | ||
| "domains": "", | ||
| "enabled":false | ||
| }, | ||
| "buttonType": "defaultButton", | ||
| "customForms":[ | ||
| { | ||
| "name": "Field", | ||
| "type": "custom_form" | ||
| } | ||
| ], | ||
| "replayStart": "45", | ||
| "customeEnable":false, | ||
| "registrationBody": "registration-body", | ||
| "registrationStart": "15", | ||
| "isInnerPageEnabled":true, | ||
| "registrationSubject": "registration-subject", | ||
| "timeline": { | ||
| "uniqueID":2, | ||
| "webinarTimeline": "unique-timeline-id", | ||
| "nodeID": "events", | ||
| "blocks": "{\"0\": [{\"id\": \"_cxkn4qzpt\", \"day\": \"0\", \"key\": \"0\", \"tag\": null, \"amPm\": 1, \"days\": \"0\", \"hours\": null, \"model\": {\"id\": \"_cxkn4qzpt\", \"message\": \"Welcome to the event everyone, so glad you made it here !\\n\\n\", \"isDelete\": false, \"imagefile\": null, \"action_days\": \"0\", \"fromEventID\": [], \"action_hours\": null, \"fromEventName\": \"\", \"action_groupID\": \"3\", \"action_isAfter\": 1, \"action_isExact\": false, \"action_minutes\": \"5\", \"action_actionTitle\": \"Auto Chat to Audience\"}, \"action\": \"webinar-livechat\", \"dayKey\": \"0\", \"nodeID\": 5, \"groupID\": \"3\", \"isAfter\": 1, \"isExact\": false, \"minutes\": \"5\", \"groupName\": \"Registrants\", \"actionIcon\": \"message-processing\", \"actionTitle\": \"Auto Chat to Audience\", \"insertDayKey\": 0, \"integrationID\": \"adminwebinar\", \"integrationName\": \"LIVE Event Automations\", \"integrationType\": \"WEBINAR\"}, {\"id\": \"_125f969xg\", \"day\": \"0\", \"key\": \"0\", \"tag\": null, \"amPm\": 1, \"days\": \"0\", \"hours\": null, \"model\": {\"id\": \"_125f969xg\", \"message\": \"Welcome to the event everyone, so glad you made it here !\\nHere's the link to join:\\nwww.yourctapage.com\\n\\n\", \"isDelete\": false, \"imagefile\": null, \"action_days\": \"0\", \"fromEventID\": [], \"action_hours\": null, \"action_nodeID\": 5, \"fromEventName\": \"\", \"action_groupID\": \"3\", \"action_isAfter\": 1, \"action_isExact\": false, \"action_minutes\": \"30\", \"action_groupName\": \"Registrants\", \"action_actionTitle\": \"Auto Chat to Audience\"}, \"action\": \"webinar-livechat\", \"dayKey\": \"0\", \"nodeID\": 30, \"groupID\": \"3\", \"isAfter\": 1, \"isExact\": false, \"minutes\": \"30\", \"groupName\": \"Registrants\", \"nodeIdKey\": \"_125f969xg\", \"actionIcon\": \"message-processing\", \"actionTitle\": \"Auto Chat to Audience\", \"insertDayKey\": 0, \"integrationID\": \"adminwebinar\", \"integrationName\": \"LIVE Event Automations\", \"integrationType\": \"WEBINAR\"}], \"+1\": [], \"+2\": [], \"+3\": [], \"+4\": [], \"+5\": [], \"+6\": [], \"+7\": [], \"+8\": [], \"+9\": [], \"-1\": [], \"-2\": [], \"-3\": [], \"-4\": [], \"-5\": [], \"-6\": [], \"-7\": [], \"-8\": [], \"-9\": [], \"+10\": [], \"+11\": [], \"+12\": [], \"+13\": [], \"+14\": [], \"+15\": [], \"+16\": [], \"+17\": [], \"+18\": [], \"+19\": [], \"+20\": [], \"+21\": [], \"+22\": [], \"+23\": [], \"+24\": [], \"+25\": [], \"+26\": [], \"+27\": [], \"+28\": [], \"+29\": [], \"+30\": [], \"+31\": [], \"+32\": [], \"+33\": [], \"+34\": [], \"+35\": [], \"+36\": [], \"+37\": [], \"+38\": [], \"+39\": [], \"+40\": [], \"+41\": [], \"+42\": [], \"+43\": [], \"+44\": [], \"+45\": [], \"-10\": [], \"-11\": [], \"-12\": [], \"-13\": [], \"-14\": [], \"-15\": [], \"-16\": [], \"-17\": [], \"-18\": [], \"-19\": [], \"-20\": [], \"-21\": [], \"-22\": [], \"-23\": [], \"-24\": [], \"-25\": [], \"-26\": [], \"-27\": [], \"-28\": [], \"-29\": [], \"-30\": [], \"-31\": [], \"-32\": [], \"-33\": [], \"-34\": [], \"-35\": [], \"-36\": [], \"-37\": [], \"-38\": [], \"-39\": [], \"-40\": [], \"-41\": [], \"-42\": [], \"-43\": [], \"-44\": [], \"-45\": []}", | ||
| "created_at": "2025-05-13T22:47:28.000000Z", | ||
| "updated_at": "2025-11-11T17:57:18.000000Z", | ||
| "version": null, | ||
| "deleted_at": null, | ||
| "level": null | ||
| } | ||
| } | ||
| }, | ||
| "attendance": { | ||
| "groups":[ | ||
| "Registrants", | ||
| "Non-Attendee" | ||
| ] | ||
| }, | ||
| "added":[ | ||
| "AEvent.Stream" | ||
| ], | ||
| "pending":[], | ||
| "timelineName": "timeline-name", | ||
| "failed":false, | ||
| "banned":false, | ||
| "webinarSubject": "webinar-subject", | ||
| "registrationDate": "11/11/2025 - 1:04 PM EST" | ||
| } |
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.