feat: Add plugin to list squadup tickets#41
Conversation
🦋 Changeset detectedLatest commit: d80fbd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| session: RequiredSuperTokensSession, | ||
| userContext?: SuperTokensUserContext, | ||
| ): Promise<string | undefined> { | ||
| const user = await SuperTokens.getUser(session.getUserId(), userContext); |
There was a problem hiding this comment.
Could we include this in the token or cache this somehow to avoid a server lookup on every request?
| } | ||
|
|
||
| const pageSize = Number(rawPageSize); | ||
| if (!Number.isInteger(pageSize) || pageSize <= 0) { |
There was a problem hiding this comment.
we should probably set a max as well.
| const isFutureTicket = | ||
| typeof ticketStart === "string" && | ||
| new Date(ticketStart).getTime() > Date.now() + ticketAvailabilityWindowMs; |
There was a problem hiding this comment.
Does this apply to all tickets?
| throw new Error("defaultPageSize must be a positive integer"); | ||
| } | ||
|
|
||
| const ticketAvailabilityWindowMs = |
There was a problem hiding this comment.
Could this be a customizable function instead that knows some things about the event?
There was a problem hiding this comment.
The default should definitely be a simple number, though.
|
|
||
| export const { logDebugMessage, enableDebugLogs } = buildLogger( | ||
| PLUGIN_ID, | ||
| PLUGIN_SDK_VERSION, |
There was a problem hiding this comment.
shouldn't this be the plugin version instead?
Adds a SquadUp integration endpoint that lists the tickets for a user. The route is meant to be used together with the Rownd JS SDK to list the available tickets for an authenticated user.