-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] Xola - new components #18788
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
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions
71
components/xola/actions/add-event-guide/add-event-guide.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,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; | ||
| }, | ||
| }; | ||
130 changes: 130 additions & 0 deletions
130
components/xola/actions/create-experience-schedule/create-experience-schedule.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,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; | ||
| }, | ||
| }; |
61 changes: 61 additions & 0 deletions
61
components/xola/actions/delete-experience-schedule/delete-experience-schedule.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,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, | ||
| }; | ||
| }, | ||
| }; |
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,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, | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
59 changes: 59 additions & 0 deletions
59
components/xola/actions/remove-event-guide/remove-event-guide.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,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; | ||
| }, | ||
| }; |
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.