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
71 changes: 71 additions & 0 deletions components/xola/actions/add-event-guide/add-event-guide.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import app from "../../xola.app.mjs";

export default {
key: "xola-add-event-guide",
name: "Add Event Guide",
description: "Adds a guide to an event. [See the documentation](https://xola.github.io/xola-docs/#tag/events/operation/addEventGuide)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
sellerId: {
label: "Seller ID",
description: "The unique identifier of the seller",
propDefinition: [
app,
"userId",
],
},
eventId: {
propDefinition: [
app,
"eventId",
({ sellerId }) => ({
sellerId,
}),
],
},
guideId: {
propDefinition: [
app,
"guideId",
({ sellerId }) => ({
sellerId,
}),
],
},
forceConfirm: {
type: "boolean",
label: "Force Confirm",
description: "Force assignment even if guide has conflicts",
optional: true,
},
},
async run({ $ }) {
const {
app,
eventId,
guideId,
forceConfirm,
} = this;

const response = await app.addEventGuide({
$,
eventId,
data: {
guide: {
id: guideId,
forceConfirm,
},
},
});

$.export("$summary", "Successfully added guide to event");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import app from "../../xola.app.mjs";

export default {
key: "xola-create-experience-schedule",
name: "Create Experience Schedule",
description: "Creates a new schedule for an experience. [See the documentation](https://xola.github.io/xola-docs/#tag/schedules/operation/createExperienceSchedule)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
sellerId: {
label: "Seller ID",
description: "The unique identifier of the seller",
propDefinition: [
app,
"userId",
],
},
experienceId: {
propDefinition: [
app,
"experienceId",
({ sellerId }) => ({
sellerId,
}),
],
},
name: {
propDefinition: [
app,
"name",
],
},
type: {
propDefinition: [
app,
"type",
],
},
days: {
propDefinition: [
app,
"days",
],
},
departure: {
propDefinition: [
app,
"departure",
],
},
times: {
propDefinition: [
app,
"times",
],
},
priceDelta: {
propDefinition: [
app,
"priceDelta",
],
},
repeat: {
propDefinition: [
app,
"repeat",
],
},
start: {
propDefinition: [
app,
"start",
],
},
end: {
propDefinition: [
app,
"end",
],
},
dates: {
propDefinition: [
app,
"dates",
],
},
},
async run({ $ }) {
const {
app,
experienceId,
name,
type,
days,
times,
departure,
priceDelta,
repeat,
start,
end,
dates,
} = this;

const response = await app.createExperienceSchedule({
$,
experienceId,
data: {
start,
end,
dates,
type,
name,
repeat,
days,
times,
departure,
priceDelta,
},
});

$.export("$summary", `Successfully created schedule for experience with ID \`${response.id}\``);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import app from "../../xola.app.mjs";

export default {
key: "xola-delete-experience-schedule",
name: "Delete Experience Schedule",
description: "Deletes a schedule from an experience. [See the documentation](https://xola.github.io/xola-docs/#tag/schedules/operation/deleteExperienceSchedule)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
sellerId: {
label: "Seller ID",
description: "The unique identifier of the seller",
propDefinition: [
app,
"userId",
],
},
experienceId: {
propDefinition: [
app,
"experienceId",
({ sellerId }) => ({
sellerId,
}),
],
},
scheduleId: {
propDefinition: [
app,
"scheduleId",
({ experienceId }) => ({
experienceId,
}),
],
},
},
async run({ $ }) {
const {
app,
experienceId,
scheduleId,
} = this;

await app.deleteExperienceSchedule({
$,
experienceId,
scheduleId,
});

$.export("$summary", "Successfully deleted schedule");
return {
success: true,
};
},
};
66 changes: 66 additions & 0 deletions components/xola/actions/patch-event/patch-event.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import app from "../../xola.app.mjs";

export default {
key: "xola-patch-event",
name: "Patch Event",
description: "Partially update an event's properties. [See the documentation](https://xola.github.io/xola-docs/#tag/events/operation/patchEvent)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
sellerId: {
label: "Seller ID",
description: "The unique identifier of the seller",
propDefinition: [
app,
"userId",
],
},
eventId: {
propDefinition: [
app,
"eventId",
({ sellerId }) => ({
sellerId,
}),
],
},
max: {
type: "integer",
label: "Max",
description: "Maximum capacity override",
min: 0,
},
manual: {
type: "boolean",
label: "Manual",
description: "Flag to reopen a closed event as manual",
optional: true,
},
},
async run({ $ }) {
const {
app,
eventId,
max,
manual,
} = this;

const response = await app.patchEvent({
$,
eventId,
data: {
max,
manual,
},
});

$.export("$summary", "Successfully patched event");
return response;
},
};
59 changes: 59 additions & 0 deletions components/xola/actions/remove-event-guide/remove-event-guide.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import app from "../../xola.app.mjs";

export default {
key: "xola-remove-event-guide",
name: "Remove Event Guide",
description: "Removes a guide from an event. [See the documentation](https://xola.github.io/xola-docs/#tag/events/operation/removeEventGuide)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
sellerId: {
label: "Seller ID",
description: "The unique identifier of the seller",
propDefinition: [
app,
"userId",
],
},
eventId: {
propDefinition: [
app,
"eventId",
({ sellerId }) => ({
sellerId,
}),
],
},
guideId: {
propDefinition: [
app,
"guideId",
({ sellerId }) => ({
sellerId,
}),
],
},
},
async run({ $ }) {
const {
app,
eventId,
guideId,
} = this;

const response = await app.removeEventGuide({
$,
eventId,
guideId,
});

$.export("$summary", "Successfully removed guide from event");
return response;
},
};
Loading
Loading