Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c5ecc7ebf5 | ||
![]() |
c625e03bf8 | ||
![]() |
c7604fa785 | ||
![]() |
a77ac9a3f9 | ||
![]() |
6062cfafaf | ||
![]() |
5263e774d2 |
@@ -0,0 +1,157 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
import isEmpty from 'lodash/isEmpty.js';
|
||||
import omitBy from 'lodash/omitBy.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create event',
|
||||
key: 'createEvent',
|
||||
description: 'Creates a new event.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Name',
|
||||
key: 'name',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Summary',
|
||||
key: 'summary',
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Event Start',
|
||||
key: 'eventStart',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'e.g. 2018-05-12T02:00:00Z',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Event End',
|
||||
key: 'eventEnd',
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'e.g. 2018-05-12T02:00:00Z',
|
||||
variables: true,
|
||||
},
|
||||
{
|
||||
label: 'Venue',
|
||||
key: 'venueId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listVenues',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Currency',
|
||||
key: 'currencyId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: 'The ISO 4217 currency code.',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listCurrency',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Listed?',
|
||||
key: 'listed',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: 'Can this event be found on Eventbrite?',
|
||||
variables: true,
|
||||
options: [
|
||||
{ label: 'Yes', value: 'true' },
|
||||
{ label: 'No', value: 'false' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const {
|
||||
organizationId,
|
||||
name,
|
||||
summary,
|
||||
eventStart,
|
||||
eventEnd,
|
||||
venueId,
|
||||
currencyId,
|
||||
listed,
|
||||
} = $.step.parameters;
|
||||
|
||||
const fields = {
|
||||
name: {
|
||||
html: name,
|
||||
},
|
||||
summary,
|
||||
start: {
|
||||
timezone: 'UTC',
|
||||
utc: eventStart,
|
||||
},
|
||||
end: {
|
||||
timezone: 'UTC',
|
||||
utc: eventEnd,
|
||||
},
|
||||
currency: currencyId,
|
||||
venue_id: venueId,
|
||||
listed,
|
||||
};
|
||||
|
||||
const filteredFields = omitBy(fields, isEmpty);
|
||||
|
||||
const { data } = await $.http.post(
|
||||
`/v3/organizations/${organizationId}/events/`,
|
||||
{
|
||||
event: filteredFields,
|
||||
}
|
||||
);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
4
packages/backend/src/apps/eventbrite/actions/index.js
Normal file
4
packages/backend/src/apps/eventbrite/actions/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import createEvent from './create-event/index.js';
|
||||
import publishEvent from './publish-event/index.js';
|
||||
|
||||
export default [createEvent, publishEvent];
|
@@ -0,0 +1,63 @@
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Publish event',
|
||||
key: 'publishEvent',
|
||||
description: 'Publishes a draft event.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Event',
|
||||
key: 'eventId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listEvents',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
{
|
||||
name: 'parameters.unpublished',
|
||||
value: 'true',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const { eventId } = $.step.parameters;
|
||||
|
||||
const { data } = await $.http.post(`/v3/events/${eventId}/publish/`);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
@@ -0,0 +1,5 @@
|
||||
import listEvents from './list-events/index.js';
|
||||
import listOrganizations from './list-organizations/index.js';
|
||||
import listVenues from './list-venues/index.js';
|
||||
|
||||
export default [listEvents, listOrganizations, listVenues];
|
@@ -0,0 +1,49 @@
|
||||
export default {
|
||||
name: 'List events',
|
||||
key: 'listEvents',
|
||||
|
||||
async run($) {
|
||||
const events = {
|
||||
data: [],
|
||||
};
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
const unpublished = $.step.parameters.unpublished === 'true';
|
||||
|
||||
if (!organizationId) {
|
||||
return events;
|
||||
}
|
||||
|
||||
const params = {
|
||||
continuation: undefined,
|
||||
order_by: 'created_desc',
|
||||
};
|
||||
|
||||
if (unpublished) {
|
||||
params.status = 'draft';
|
||||
}
|
||||
|
||||
do {
|
||||
const { data } = await $.http.get(
|
||||
`/v3/organizations/${organizationId}/events/`,
|
||||
{
|
||||
params,
|
||||
}
|
||||
);
|
||||
|
||||
if (data.pagination.has_more_items) {
|
||||
params.continuation = data.pagination.continuation;
|
||||
}
|
||||
|
||||
if (data.events) {
|
||||
for (const event of data.events) {
|
||||
events.data.push({
|
||||
value: event.id,
|
||||
name: `${event.name.text} (${event.status})`,
|
||||
});
|
||||
}
|
||||
}
|
||||
} while (params.continuation);
|
||||
|
||||
return events;
|
||||
},
|
||||
};
|
@@ -0,0 +1,35 @@
|
||||
export default {
|
||||
name: 'List organizations',
|
||||
key: 'listOrganizations',
|
||||
|
||||
async run($) {
|
||||
const organizations = {
|
||||
data: [],
|
||||
};
|
||||
|
||||
const params = {
|
||||
continuation: undefined,
|
||||
};
|
||||
|
||||
do {
|
||||
const { data } = await $.http.get('/v3/users/me/organizations', {
|
||||
params,
|
||||
});
|
||||
|
||||
if (data.pagination.has_more_items) {
|
||||
params.continuation = data.pagination.continuation;
|
||||
}
|
||||
|
||||
if (data.organizations) {
|
||||
for (const organization of data.organizations) {
|
||||
organizations.data.push({
|
||||
value: organization.id,
|
||||
name: organization.name,
|
||||
});
|
||||
}
|
||||
}
|
||||
} while (params.continuation);
|
||||
|
||||
return organizations;
|
||||
},
|
||||
};
|
@@ -0,0 +1,43 @@
|
||||
export default {
|
||||
name: 'List venues',
|
||||
key: 'listVenues',
|
||||
|
||||
async run($) {
|
||||
const venues = {
|
||||
data: [],
|
||||
};
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
if (!organizationId) {
|
||||
return venues;
|
||||
}
|
||||
|
||||
const params = {
|
||||
continuation: undefined,
|
||||
};
|
||||
|
||||
do {
|
||||
const { data } = await $.http.get(
|
||||
`/v3/organizations/${organizationId}/venues/`,
|
||||
{
|
||||
params,
|
||||
}
|
||||
);
|
||||
|
||||
if (data.pagination.has_more_items) {
|
||||
params.continuation = data.pagination.continuation;
|
||||
}
|
||||
|
||||
if (data.venues) {
|
||||
for (const venue of data.venues) {
|
||||
venues.data.push({
|
||||
value: venue.id,
|
||||
name: venue.name,
|
||||
});
|
||||
}
|
||||
}
|
||||
} while (params.continuation);
|
||||
|
||||
return venues;
|
||||
},
|
||||
};
|
@@ -1,6 +1,9 @@
|
||||
import defineApp from '../../helpers/define-app.js';
|
||||
import addAuthHeader from './common/add-auth-header.js';
|
||||
import auth from './auth/index.js';
|
||||
import dynamicData from './dynamic-data/index.js';
|
||||
import triggers from './triggers/index.js';
|
||||
import actions from './actions/index.js';
|
||||
|
||||
export default defineApp({
|
||||
name: 'Eventbrite',
|
||||
@@ -13,4 +16,7 @@ export default defineApp({
|
||||
supportsConnections: true,
|
||||
beforeRequest: [addAuthHeader],
|
||||
auth,
|
||||
dynamicData,
|
||||
triggers,
|
||||
actions,
|
||||
});
|
||||
|
11
packages/backend/src/apps/eventbrite/triggers/index.js
Normal file
11
packages/backend/src/apps/eventbrite/triggers/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import newAttendeeCheckIn from './new-attendee-check-in/index.js';
|
||||
import newAttendeeRegistered from './new-attendee-registered/index.js';
|
||||
import newEvents from './new-events/index.js';
|
||||
import updatedAttendee from './updated-attendee/index.js';
|
||||
|
||||
export default [
|
||||
updatedAttendee,
|
||||
newAttendeeCheckIn,
|
||||
newAttendeeRegistered,
|
||||
newEvents,
|
||||
];
|
@@ -0,0 +1,120 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New attendee check in',
|
||||
key: 'newAttendeeCheckIn',
|
||||
type: 'webhook',
|
||||
description: "Triggers when an attendee's barcode is scanned in.",
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Event',
|
||||
key: 'eventId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listEvents',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const eventId = $.step.parameters.eventId;
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const params = {
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const {
|
||||
data: { orders },
|
||||
} = await $.http.get(`/v3/events/${eventId}/orders/`, params);
|
||||
|
||||
if (orders.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const computedWebhookEvent = {
|
||||
config: {
|
||||
action: 'barcode.checked_in',
|
||||
user_id: organizationId,
|
||||
webhook_id: '11111111',
|
||||
endpoint_url: $.webhookUrl,
|
||||
},
|
||||
api_url: orders[0].resource_uri,
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: computedWebhookEvent,
|
||||
meta: {
|
||||
internalId: computedWebhookEvent.user_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
const eventId = $.step.parameters.eventId;
|
||||
|
||||
const payload = {
|
||||
endpoint_url: $.webhookUrl,
|
||||
actions: 'attendee.checked_in',
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(
|
||||
`/v3/organizations/${organizationId}/webhooks/`,
|
||||
payload
|
||||
);
|
||||
|
||||
await $.flow.setRemoteWebhookId(data.id);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(`/v3/webhooks/${$.flow.remoteWebhookId}/`);
|
||||
},
|
||||
});
|
@@ -0,0 +1,120 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New attendee registered',
|
||||
key: 'newAttendeeRegistered',
|
||||
type: 'webhook',
|
||||
description: 'Triggers when an attendee orders a ticket for an event.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Event',
|
||||
key: 'eventId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listEvents',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const eventId = $.step.parameters.eventId;
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const params = {
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const {
|
||||
data: { orders },
|
||||
} = await $.http.get(`/v3/events/${eventId}/orders/`, params);
|
||||
|
||||
if (orders.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const computedWebhookEvent = {
|
||||
config: {
|
||||
action: 'order.placed',
|
||||
user_id: organizationId,
|
||||
webhook_id: '11111111',
|
||||
endpoint_url: $.webhookUrl,
|
||||
},
|
||||
api_url: orders[0].resource_uri,
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: computedWebhookEvent,
|
||||
meta: {
|
||||
internalId: computedWebhookEvent.user_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
const eventId = $.step.parameters.eventId;
|
||||
|
||||
const payload = {
|
||||
endpoint_url: $.webhookUrl,
|
||||
actions: 'order.placed',
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(
|
||||
`/v3/organizations/${organizationId}/webhooks/`,
|
||||
payload
|
||||
);
|
||||
|
||||
await $.flow.setRemoteWebhookId(data.id);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(`/v3/webhooks/${$.flow.remoteWebhookId}/`);
|
||||
},
|
||||
});
|
@@ -0,0 +1,98 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'New events',
|
||||
key: 'newEvents',
|
||||
type: 'webhook',
|
||||
description:
|
||||
'Triggers when a new event is published and live within an organization.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const params = {
|
||||
orderBy: 'created_desc',
|
||||
status: 'all',
|
||||
};
|
||||
|
||||
const {
|
||||
data: { events },
|
||||
} = await $.http.get(`/v3/organizations/${organizationId}/events/`, params);
|
||||
|
||||
if (events.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const computedWebhookEvent = {
|
||||
config: {
|
||||
action: 'event.published',
|
||||
user_id: events[0].organization_id,
|
||||
webhook_id: '11111111',
|
||||
endpoint_url: $.webhookUrl,
|
||||
},
|
||||
api_url: events[0].resource_uri,
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: computedWebhookEvent,
|
||||
meta: {
|
||||
internalId: computedWebhookEvent.user_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const payload = {
|
||||
endpoint_url: $.webhookUrl,
|
||||
actions: 'event.published',
|
||||
event_id: '',
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(
|
||||
`/v3/organizations/${organizationId}/webhooks/`,
|
||||
payload
|
||||
);
|
||||
|
||||
await $.flow.setRemoteWebhookId(data.id);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(`/v3/webhooks/${$.flow.remoteWebhookId}/`);
|
||||
},
|
||||
});
|
@@ -0,0 +1,120 @@
|
||||
import Crypto from 'crypto';
|
||||
import defineTrigger from '../../../../helpers/define-trigger.js';
|
||||
|
||||
export default defineTrigger({
|
||||
name: 'Updated Attendee',
|
||||
key: 'updatedAttendee',
|
||||
type: 'webhook',
|
||||
description: 'Triggers when attendee data is updated.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'Organization',
|
||||
key: 'organizationId',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listOrganizations',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Event',
|
||||
key: 'eventId',
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
source: {
|
||||
type: 'query',
|
||||
name: 'getDynamicData',
|
||||
arguments: [
|
||||
{
|
||||
name: 'key',
|
||||
value: 'listEvents',
|
||||
},
|
||||
{
|
||||
name: 'parameters.organizationId',
|
||||
value: '{parameters.organizationId}',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
async run($) {
|
||||
const dataItem = {
|
||||
raw: $.request.body,
|
||||
meta: {
|
||||
internalId: Crypto.randomUUID(),
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async testRun($) {
|
||||
const eventId = $.step.parameters.eventId;
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
|
||||
const params = {
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const {
|
||||
data: { attendees },
|
||||
} = await $.http.get(`/v3/events/${eventId}/attendees/`, params);
|
||||
|
||||
if (attendees.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const computedWebhookEvent = {
|
||||
config: {
|
||||
action: 'attendee.updated',
|
||||
user_id: organizationId,
|
||||
webhook_id: '11111111',
|
||||
endpoint_url: $.webhookUrl,
|
||||
},
|
||||
api_url: attendees[0].resource_uri,
|
||||
};
|
||||
|
||||
const dataItem = {
|
||||
raw: computedWebhookEvent,
|
||||
meta: {
|
||||
internalId: computedWebhookEvent.user_id,
|
||||
},
|
||||
};
|
||||
|
||||
$.pushTriggerItem(dataItem);
|
||||
},
|
||||
|
||||
async registerHook($) {
|
||||
const organizationId = $.step.parameters.organizationId;
|
||||
const eventId = $.step.parameters.eventId;
|
||||
|
||||
const payload = {
|
||||
endpoint_url: $.webhookUrl,
|
||||
actions: 'attendee.updated',
|
||||
event_id: eventId,
|
||||
};
|
||||
|
||||
const { data } = await $.http.post(
|
||||
`/v3/organizations/${organizationId}/webhooks/`,
|
||||
payload
|
||||
);
|
||||
|
||||
await $.flow.setRemoteWebhookId(data.id);
|
||||
},
|
||||
|
||||
async unregisterHook($) {
|
||||
await $.http.delete(`/v3/webhooks/${$.flow.remoteWebhookId}/`);
|
||||
},
|
||||
});
|
@@ -117,7 +117,11 @@ export default defineConfig({
|
||||
text: 'Eventbrite',
|
||||
collapsible: true,
|
||||
collapsed: true,
|
||||
items: [{ text: 'Connection', link: '/apps/eventbrite/connection' }],
|
||||
items: [
|
||||
{ text: 'Triggers', link: '/apps/eventbrite/triggers' },
|
||||
{ text: 'Actions', link: '/apps/eventbrite/actions' },
|
||||
{ text: 'Connection', link: '/apps/eventbrite/connection' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Filter',
|
||||
|
14
packages/docs/pages/apps/eventbrite/actions.md
Normal file
14
packages/docs/pages/apps/eventbrite/actions.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
favicon: /favicons/eventbrite.svg
|
||||
items:
|
||||
- name: Create event
|
||||
desc: Creates a new event.
|
||||
- name: Publish event
|
||||
desc: Publishes a draft event.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import CustomListing from '../../components/CustomListing.vue'
|
||||
</script>
|
||||
|
||||
<CustomListing />
|
18
packages/docs/pages/apps/eventbrite/triggers.md
Normal file
18
packages/docs/pages/apps/eventbrite/triggers.md
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
favicon: /favicons/eventbrite.svg
|
||||
items:
|
||||
- name: New attendee check in
|
||||
desc: Triggers when an attendee's barcode is scanned in.
|
||||
- name: New attendee registered
|
||||
desc: Triggers when an attendee orders a ticket for an event.
|
||||
- name: New events
|
||||
desc: Triggers when a new event is published and live within an organization.
|
||||
- name: Updated Attendee
|
||||
desc: Triggers when attendee data is updated.
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import CustomListing from '../../components/CustomListing.vue'
|
||||
</script>
|
||||
|
||||
<CustomListing />
|
@@ -11,6 +11,7 @@ The following integrations are currently supported by Automatisch.
|
||||
- [Discord](/apps/discord/actions)
|
||||
- [Disqus](/apps/disqus/triggers)
|
||||
- [Dropbox](/apps/dropbox/actions)
|
||||
- [Eventbrite](/apps/eventbrite/triggers)
|
||||
- [Filter](/apps/filter/actions)
|
||||
- [Flickr](/apps/flickr/triggers)
|
||||
- [Formatter](/apps/formatter/actions)
|
||||
|
Reference in New Issue
Block a user