Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions components/aevent/aevent.app.mjs
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);
},
},
};
5 changes: 4 additions & 1 deletion components/aevent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/aevent",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream AEvent Components",
"main": "aevent.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.1.1"
}
}
67 changes: 67 additions & 0 deletions components/aevent/sources/new-registrant/new-registrant.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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 = this.aevent.paginate({
fn: this.aevent.listRegistrants,
params: {
lastDate,
},
maxResults,
});

let responseArray = [];
for await (const item of response) {
if (item.registrationTime <= lastDate) break;
responseArray.push(item);
}

if (responseArray.length) {
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,
};
86 changes: 86 additions & 0 deletions components/aevent/sources/new-registrant/test-event.mjs
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"
}
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading