Skip to content

Commit ae337a2

Browse files
Merge branch 'ticketsauce-components' of https://github.com/sergio-eliot-rodriguez/sergio_wong_does_pipedream into ticketsauce-components
syncing upstream with my fork addressing ticketsauce components
2 parents a9fffb6 + 92856bc commit ae337a2

File tree

10 files changed

+831
-13
lines changed

10 files changed

+831
-13
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import ticketsauce from "../../ticketsauce.app.mjs";
2+
3+
export default {
4+
key: "ticketsauce-get-event-details",
5+
name: "Get Event Details",
6+
description: "Get details for a specified event. [See documentation](https://speca.io/ticketsauce/ticketsauce-public-api?key=204000d6bda66da78315e721920f43aa#event-details)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ticketsauce,
16+
partnerId: {
17+
propDefinition: [
18+
ticketsauce,
19+
"partnerId",
20+
],
21+
},
22+
organizationId: {
23+
propDefinition: [
24+
ticketsauce,
25+
"organizationId",
26+
],
27+
},
28+
eventId: {
29+
propDefinition: [
30+
ticketsauce,
31+
"eventId",
32+
(c) => ({
33+
partnerId: c.partnerId,
34+
organizationId: c.organizationId,
35+
}),
36+
],
37+
},
38+
photos: {
39+
type: "string",
40+
label: "Photos",
41+
description: "Whether or not to return the event's photo gallery records.",
42+
optional: true,
43+
default: "0",
44+
options: [
45+
"0",
46+
"1",
47+
],
48+
},
49+
includePerformers: {
50+
propDefinition: [
51+
ticketsauce,
52+
"includePerformers",
53+
],
54+
},
55+
},
56+
async run({ $ }) {
57+
const params = {
58+
photos: parseInt(this.photos) === 1,
59+
include_performers: parseInt(this.includePerformers) === 1,
60+
};
61+
62+
return this.ticketsauce.getEventDetails($, {
63+
eventId: this.eventId,
64+
params,
65+
});
66+
},
67+
};
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
import ticketsauce from "../../ticketsauce.app.mjs";
2+
3+
export default {
4+
key: "ticketsauce-get-events",
5+
name: "Get Events",
6+
description: "Get a list of all events owned by the authenticated account. [See documentation](https://speca.io/ticketsauce/ticketsauce-public-api?key=204000d6bda66da78315e721920f43aa#list-of-events)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ticketsauce,
16+
partnerId: {
17+
propDefinition: [
18+
ticketsauce,
19+
"partnerId",
20+
],
21+
},
22+
organizationId: {
23+
propDefinition: [
24+
ticketsauce,
25+
"organizationId",
26+
],
27+
},
28+
startAfter: {
29+
type: "string",
30+
label: "Start After",
31+
description: "Only retrieve events that start AFTER the specified UTC date (format: `YYYY-MM-DD`).",
32+
optional: true,
33+
},
34+
endBefore: {
35+
type: "string",
36+
label: "End Before",
37+
description: "Only retrieve events that end BEFORE the specified UTC date (format: `YYYY-MM-DD`).",
38+
optional: true,
39+
},
40+
activeOnly: {
41+
type: "string",
42+
label: "Active Only",
43+
description: "Leaving this as true will restrict retrieved events to only 'active' events. Setting to false will allow the retrieval of both active and inactive events.",
44+
optional: true,
45+
default: "1",
46+
options: [
47+
"0",
48+
"1",
49+
],
50+
},
51+
privacyType: {
52+
type: "string",
53+
label: "Privacy Type",
54+
description: "Filter events by privacy type.",
55+
optional: true,
56+
default: "public",
57+
options: [
58+
{
59+
label: "Public events only",
60+
value: "public",
61+
},
62+
{
63+
label: "All events (no restriction)",
64+
value: "all",
65+
},
66+
{
67+
label: "Unlisted events only",
68+
value: "unlisted",
69+
},
70+
],
71+
},
72+
sortBy: {
73+
type: "string",
74+
label: "Sort By",
75+
description: "Field to sort events by.",
76+
optional: true,
77+
options: [
78+
{
79+
label: "Event start date",
80+
value: "date",
81+
},
82+
{
83+
label: "Event name",
84+
value: "name",
85+
},
86+
{
87+
label: "City location",
88+
value: "city",
89+
},
90+
],
91+
},
92+
sortDir: {
93+
type: "string",
94+
label: "Sort Direction",
95+
description: "Direction to sort results.",
96+
optional: true,
97+
options: [
98+
{
99+
label: "Ascending",
100+
value: "asc",
101+
},
102+
{
103+
label: "Descending",
104+
value: "desc",
105+
},
106+
],
107+
},
108+
includePerformers: {
109+
propDefinition: [
110+
ticketsauce,
111+
"includePerformers",
112+
],
113+
},
114+
},
115+
async run({ $ }) {
116+
const params = {
117+
partner_id: this.partnerId,
118+
organization_id: this.organizationId,
119+
start_after: this.startAfter,
120+
end_before: this.endBefore,
121+
active_only: parseInt(this.activeOnly) === 1,
122+
privacy_type: this.privacyType,
123+
sort_by: this.sortBy,
124+
sort_dir: this.sortDir,
125+
include_performers: parseInt(this.includePerformers) === 1,
126+
};
127+
128+
return this.ticketsauce.listEvents($, {
129+
params,
130+
});
131+
},
132+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import ticketsauce from "../../ticketsauce.app.mjs";
2+
3+
export default {
4+
key: "ticketsauce-get-order-details",
5+
name: "Get Order Details",
6+
description: "Get details for the specified order. [See documentation](https://speca.io/ticketsauce/ticketsauce-public-api?key=204000d6bda66da78315e721920f43aa#order-details)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
ticketsauce,
16+
partnerId: {
17+
propDefinition: [
18+
ticketsauce,
19+
"partnerId",
20+
],
21+
},
22+
organizationId: {
23+
propDefinition: [
24+
ticketsauce,
25+
"organizationId",
26+
],
27+
},
28+
eventId: {
29+
propDefinition: [
30+
ticketsauce,
31+
"eventId",
32+
(c) => ({
33+
partnerId: c.partnerId,
34+
organizationId: c.organizationId,
35+
}),
36+
],
37+
},
38+
orderId: {
39+
propDefinition: [
40+
ticketsauce,
41+
"orderId",
42+
(c) => ({
43+
eventId: c.eventId,
44+
}),
45+
],
46+
},
47+
},
48+
async run({ $ }) {
49+
return this.ticketsauce.getOrderDetails($, {
50+
orderId: this.orderId,
51+
});
52+
},
53+
};

0 commit comments

Comments
 (0)