pretix: per-event API key + live organizer/event picker
Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
0ad02970a0
commit
f74db9dc26
5 files changed
+228
-47
No files matched your search
@@ -8,6 +8,7 @@ import type {
|
||||
Feedback,
|
||||
LeaderboardRow,
|
||||
PointsLogRow,
|
||||
PretixOptions,
|
||||
PretixSyncResult,
|
||||
Registration,
|
||||
ResetQrResult,
|
||||
@@ -168,6 +169,7 @@ export async function upsertEvent(
|
||||
sessionize_endpoint?: string | null;
|
||||
pretix_organizer?: string | null;
|
||||
pretix_event_slug?: string | null;
|
||||
pretix_api_key?: string | null;
|
||||
use_realtime_clock?: boolean;
|
||||
},
|
||||
): Promise<void> {
|
||||
@@ -209,6 +211,14 @@ export const runSessionizeSync = (eventId: string) =>
|
||||
export const runPretixSync = (eventId: string) =>
|
||||
sidecarFetch<PretixSyncResult>('/run-pretix', { method: 'POST', body: JSON.stringify({ event_id: eventId }) });
|
||||
|
||||
/**
|
||||
* Ask the sidecar to list the given Pretix API key's organizers + their active
|
||||
* events. Used by the event-settings "paste the API key" flow to populate the
|
||||
* organizer + event-slug dropdowns from real data.
|
||||
*/
|
||||
export const fetchPretixOptions = (apiKey: string) =>
|
||||
sidecarFetch<PretixOptions>('/pretix-options', { method: 'POST', body: JSON.stringify({ api_key: apiKey }) });
|
||||
|
||||
/**
|
||||
* Upload the Sessionize "Sessions and speakers (advanced)" .xlsx for an event.
|
||||
* The sidecar parses it and imports speakers/sessions/agenda + speaker
|
||||
|
||||
@@ -39,6 +39,8 @@ export interface Event {
|
||||
pretix_organizer?: string | null;
|
||||
/** Pretix event slug for this event (e.g. `tickets`). */
|
||||
pretix_event_slug?: string | null;
|
||||
/** Pretix API token for this event (stored in plain text, visible in settings). */
|
||||
pretix_api_key?: string | null;
|
||||
/** When the Sessionize sync last ran for this event. */
|
||||
last_synced_at: string | null;
|
||||
avg_feedback: number | null;
|
||||
@@ -138,6 +140,24 @@ export interface PretixRun {
|
||||
/** The response of POST /run-pretix (same shape as a successful PretixRun). */
|
||||
export type PretixSyncResult = PretixRun;
|
||||
|
||||
/** A Pretix event (slug + name) under an organizer. */
|
||||
export interface PretixEventOption {
|
||||
slug: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** A Pretix organizer + its active events, from POST /pretix-options. */
|
||||
export interface PretixOrganizerOption {
|
||||
slug: string;
|
||||
name: string;
|
||||
events: PretixEventOption[];
|
||||
}
|
||||
|
||||
/** The response of POST /pretix-options. */
|
||||
export interface PretixOptions {
|
||||
organizers: PretixOrganizerOption[];
|
||||
}
|
||||
|
||||
/** The sidecar's /status response. */
|
||||
export interface SidecarStatus {
|
||||
ok: boolean;
|
||||
|
||||
Reference in new issue
Block a user