@seatmap.pro/renderer 1.72.3 → 1.73.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -4079,6 +4079,123 @@ declare class SeatmapBookingRenderer extends Renderer {
4079
4079
  */
4080
4080
  declare const VERSION: string;
4081
4081
 
4082
+ /**
4083
+ * State machine of a booking session. Only `ACTIVE` and `PENDING_PAYMENT` hold inventory.
4084
+ */
4085
+ type BookingSessionState = 'ACTIVE' | 'PENDING_PAYMENT' | 'CONFIRMED' | 'CANCELLED' | 'EXPIRED';
4086
+ /**
4087
+ * One seat held by a session, with the price captured when it was locked.
4088
+ */
4089
+ interface ISessionCartSeat {
4090
+ id: number;
4091
+ priceId?: number;
4092
+ priceName?: string;
4093
+ }
4094
+ /**
4095
+ * General-admission capacity held by a session in one area.
4096
+ */
4097
+ interface ISessionCartGa {
4098
+ id: number;
4099
+ capacity: number;
4100
+ priceId?: number;
4101
+ priceName?: string;
4102
+ }
4103
+ /**
4104
+ * Everything a session currently holds.
4105
+ */
4106
+ interface ISessionCart {
4107
+ seats: ISessionCartSeat[];
4108
+ groupOfSeats: ISessionCartGa[];
4109
+ }
4110
+ /**
4111
+ * Seats and general-admission capacities a lock, unlock or checkout call applies to.
4112
+ * `capacity` is the desired total for that area in this session, not a delta.
4113
+ */
4114
+ interface ISessionSelection {
4115
+ seats?: number[];
4116
+ groupOfSeats?: {
4117
+ id: number;
4118
+ capacity: number;
4119
+ }[];
4120
+ }
4121
+ /**
4122
+ * A booking session as the public API reports it.
4123
+ */
4124
+ interface IBookingSession {
4125
+ sessionId: string;
4126
+ eventId: string;
4127
+ state: BookingSessionState;
4128
+ cart: ISessionCart;
4129
+ total: number;
4130
+ expiresAt: string;
4131
+ expiresInSeconds: number;
4132
+ serverTime: string;
4133
+ }
4134
+ /**
4135
+ * The response to opening a session, carrying the limits the client must respect.
4136
+ */
4137
+ interface ICreatedBookingSession {
4138
+ sessionId: string;
4139
+ expiresAt: string;
4140
+ serverTime: string;
4141
+ maxSeats: number;
4142
+ ttlSeconds: number;
4143
+ }
4144
+ /**
4145
+ * The lines that could not be acquired when a lock or checkout call was refused.
4146
+ */
4147
+ interface ISessionConflicts {
4148
+ seats: number[];
4149
+ groupOfSeats: number[];
4150
+ }
4151
+
4152
+ /**
4153
+ * Error thrown when the session API refuses a call. `code` carries the backend error
4154
+ * code (`SEAT_CONFLICT`, `SESSION_DEAD`, `SESSION_FROZEN`, `CAP_SEATS`, `NOT_ENABLED`,
4155
+ * `START_OVER_REQUIRED`) and `conflicts` the lines that could not be acquired.
4156
+ */
4157
+ declare class BookingSessionError extends Error {
4158
+ readonly status: number;
4159
+ readonly code: string | undefined;
4160
+ readonly conflicts: ISessionConflicts | undefined;
4161
+ constructor(status: number, message: string, code?: string, conflicts?: ISessionConflicts);
4162
+ }
4163
+ /**
4164
+ * Settings for {@link BookingSessionClient}. `baseUrl` and `publicKey` are the same
4165
+ * values the renderer is constructed with.
4166
+ */
4167
+ interface IBookingSessionClientSettings {
4168
+ baseUrl: string;
4169
+ publicKey: string;
4170
+ }
4171
+ /**
4172
+ * Client for the public booking session API. The session id returned by
4173
+ * {@link BookingSessionClient.create} is the credential for every later call, so the
4174
+ * caller is responsible for storing it across page loads.
4175
+ */
4176
+ declare class BookingSessionClient {
4177
+ private readonly settings;
4178
+ constructor(settings: IBookingSessionClientSettings);
4179
+ create(eventId: string, idempotencyKey?: string): Promise<ICreatedBookingSession>;
4180
+ get(sessionId: string): Promise<IBookingSession>;
4181
+ lock(sessionId: string, selection: ISessionSelection): Promise<IBookingSession>;
4182
+ unlock(sessionId: string, selection: ISessionSelection): Promise<IBookingSession>;
4183
+ checkout(sessionId: string, selection?: ISessionSelection): Promise<IBookingSession>;
4184
+ cancel(sessionId: string, startOver?: boolean): Promise<IBookingSession>;
4185
+ private send;
4186
+ }
4187
+
4188
+ /**
4189
+ * Converts a renderer cart into the selection shape the session API expects. Seats and
4190
+ * general-admission areas the renderer could not identify are dropped.
4191
+ */
4192
+ declare const selectionFromCart: (cart: ICart) => ISessionSelection;
4193
+ /**
4194
+ * Builds the selection that releases everything a session currently holds, for passing to
4195
+ * {@link BookingSessionClient.unlock}. General-admission areas release by dropping to zero.
4196
+ */
4197
+ declare const selectionFromSession: (session: IBookingSession | null) => ISessionSelection;
4198
+
4082
4199
  type AdminHotkeyAction = 'pan' | 'clearSelection' | 'selectAll' | 'zoomIn' | 'zoomOut' | 'zoomToFit' | 'flatSection';
4083
4200
 
4084
4201
  declare const defaultZoomSettings: IZoomSettings;
@@ -4122,4 +4239,4 @@ declare class RotationAnimation {
4122
4239
  getAnimation(): IRotationAnimation | null;
4123
4240
  }
4124
4241
 
4125
- export { type AdminHotkeyAction, ApiError, BookingApiClient, type BrandingLevel, type BuiltinSeatStateKey, type ById, type ColorById, type ColorSequenceSettings, DataManager, type DataManagerEvent, type DataManagerEventCallback, type DeepPartial, type DestEvent, DestEventType, type HotkeysSetting, type IAdminRenderer, type IAdminRendererSettings, type IAssignmentListDTO, type IAvailabilityDTO, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartChangeResult, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type ICustomSeatStyle, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IEntityStates, type IErrorMessage, type IExtendedSeat, type ILabelStyle, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMarker, type IMarkerSettings, type IMinimapSettings, type IMouseMoveSrcEvent, type IOrphanGroupStyle, type IOrphanSeatsBlockedEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IResolvedMarker, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMetadata, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStateRenderArgs, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionGridDTO, type ISectionMetadata, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionPhoto, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type IShapeMetadata, type ISpecialPrice, type ISpecialState, type ISvgSectionStateStyles, type ISvgSectionStyle, type ITileGrid, type IVenueDTO, type IVisibilitySettings, type IWatermarkSettings, type IZoomSettings, type InteractionZoomStrategy, type InteractionZoomStrategyType, type LoaderStyle, type LoadingPhase, type MarkerAppearance, type MarkerTarget, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, type SeatStylesMap, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, StateManager, type StateManagerEvent, type StateManagerEventCallback, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, emptyPriceList, mergeSettings, preconnectToApi, sortPrices };
4242
+ export { type AdminHotkeyAction, ApiError, BookingApiClient, BookingSessionClient, BookingSessionError, type BookingSessionState, type BrandingLevel, type BuiltinSeatStateKey, type ById, type ColorById, type ColorSequenceSettings, DataManager, type DataManagerEvent, type DataManagerEventCallback, type DeepPartial, type DestEvent, DestEventType, type HotkeysSetting, type IAdminRenderer, type IAdminRendererSettings, type IAssignmentListDTO, type IAvailabilityDTO, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type IBookingSession, type IBookingSessionClientSettings, type ICart, type ICartChangeResult, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type ICreatedBookingSession, type ICustomSeatStyle, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IEntityStates, type IErrorMessage, type IExtendedSeat, type ILabelStyle, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMarker, type IMarkerSettings, type IMinimapSettings, type IMouseMoveSrcEvent, type IOrphanGroupStyle, type IOrphanSeatsBlockedEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IResolvedMarker, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMetadata, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStateRenderArgs, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionGridDTO, type ISectionMetadata, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionPhoto, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISessionCart, type ISessionCartGa, type ISessionCartSeat, type ISessionConflicts, type ISessionSelection, type IShapeMetadata, type ISpecialPrice, type ISpecialState, type ISvgSectionStateStyles, type ISvgSectionStyle, type ITileGrid, type IVenueDTO, type IVisibilitySettings, type IWatermarkSettings, type IZoomSettings, type InteractionZoomStrategy, type InteractionZoomStrategyType, type LoaderStyle, type LoadingPhase, type MarkerAppearance, type MarkerTarget, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, type SeatStylesMap, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, StateManager, type StateManagerEvent, type StateManagerEventCallback, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, emptyPriceList, mergeSettings, preconnectToApi, selectionFromCart, selectionFromSession, sortPrices };