@seatlayer/js 0.24.0 → 0.26.0
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/dist/index.cjs +228 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -4
- package/dist/index.d.ts +66 -4
- package/dist/index.js +228 -47
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -18,7 +18,7 @@ interface HoldConflict {
|
|
|
18
18
|
interface HoldLineItem {
|
|
19
19
|
label: string;
|
|
20
20
|
objectId: string;
|
|
21
|
-
objectType: 'seat' | 'booth' | 'ga';
|
|
21
|
+
objectType: 'seat' | 'booth' | 'ga' | 'table';
|
|
22
22
|
categoryKey: string;
|
|
23
23
|
tierId: string | null;
|
|
24
24
|
/** Price in major currency units (for example 45 means $45.00). */
|
|
@@ -151,6 +151,7 @@ declare class SeatingChart {
|
|
|
151
151
|
private mount;
|
|
152
152
|
private hostEl;
|
|
153
153
|
private rendered;
|
|
154
|
+
private mode_;
|
|
154
155
|
private tipEl;
|
|
155
156
|
private tipPos;
|
|
156
157
|
private onTipMove;
|
|
@@ -168,14 +169,47 @@ declare class SeatingChart {
|
|
|
168
169
|
private buildBadge;
|
|
169
170
|
private placeTooltip;
|
|
170
171
|
private updateTooltip;
|
|
172
|
+
/**
|
|
173
|
+
* Whether the SERVED event is a live or a test event (`sk_test_` keys create
|
|
174
|
+
* test events, which never book real inventory). `null` before render()
|
|
175
|
+
* resolves — the mode comes from the server with the chart, not from options.
|
|
176
|
+
*
|
|
177
|
+
* The widget already surfaces this visually with the test-mode ribbon; this
|
|
178
|
+
* getter is for hosts that draw their own chrome — notably a native WebView
|
|
179
|
+
* wrapper, which must be able to tell an integrator that the build they are
|
|
180
|
+
* about to ship is pointed at a test event.
|
|
181
|
+
*/
|
|
182
|
+
getMode(): 'live' | 'test' | null;
|
|
171
183
|
/** Current selection with prices resolved from the chart categories. */
|
|
172
184
|
getSelection(): SelectedSeat[];
|
|
173
185
|
/** Hold the current selection. Resolves the hold, or null on a 409 conflict. */
|
|
174
186
|
hold(options?: {
|
|
175
187
|
ttlMs?: number;
|
|
176
188
|
}): Promise<HoldResult | null>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal Like {@link hold} but RE-THROWS the structured API error (409
|
|
191
|
+
* `reason`/`code` + `conflicts`) instead of swallowing it into `onError` +
|
|
192
|
+
* `null`. The native WebView host adapter needs the throw so it can answer the
|
|
193
|
+
* originating command with a correlated error carrying the SPECIFIC reason
|
|
194
|
+
* (`sold_out` vs `not_enough_together`); the public method above keeps the
|
|
195
|
+
* catch-and-onError contract that direct web consumers rely on. Not a stable
|
|
196
|
+
* part of the embed API.
|
|
197
|
+
*/
|
|
198
|
+
holdOrThrow(options?: {
|
|
199
|
+
ttlMs?: number;
|
|
200
|
+
}): Promise<HoldResult | null>;
|
|
177
201
|
/** Restore an active hold by its opaque id without extending its expiry. */
|
|
178
202
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
203
|
+
/** @internal Throwing variant of {@link resumeHold} for the native host adapter. See {@link holdOrThrow}. */
|
|
204
|
+
resumeHoldOrThrow(holdId: string): Promise<HoldResult | null>;
|
|
205
|
+
/**
|
|
206
|
+
* Push the OPEN hold's expiry out ("need more time?"). Resolves the refreshed
|
|
207
|
+
* hold, or `null` when there is nothing held or the server refused (the hold
|
|
208
|
+
* is gone, already expired, or at its renewal cap) — refusal is a normal
|
|
209
|
+
* outcome, not an error, so the host decides the copy. The client-side expiry
|
|
210
|
+
* timer is re-armed to match, so `onHoldExpired` won't fire early.
|
|
211
|
+
*/
|
|
212
|
+
extendHold(ttlMs?: number): Promise<HoldResult | null>;
|
|
179
213
|
/** Current active hold known to this chart, if any. */
|
|
180
214
|
getCurrentHold(): HoldResult | null;
|
|
181
215
|
getGAAreas(): GAAreaAvailability[];
|
|
@@ -183,8 +217,15 @@ declare class SeatingChart {
|
|
|
183
217
|
tierId?: string | null;
|
|
184
218
|
ttlMs?: number;
|
|
185
219
|
}): Promise<HoldResult | null>;
|
|
220
|
+
/** @internal Throwing variant of {@link holdGA} for the native host adapter. See {@link holdOrThrow}. */
|
|
221
|
+
holdGAOrThrow(areaId: string, qty: number, options?: {
|
|
222
|
+
tierId?: string | null;
|
|
223
|
+
ttlMs?: number;
|
|
224
|
+
}): Promise<HoldResult | null>;
|
|
186
225
|
/** Ask the server for the `qty` best free seats and hold them atomically. */
|
|
187
226
|
bestAvailable(qty: number, categoryKey?: string): Promise<BestAvailableResult | null>;
|
|
227
|
+
/** @internal Throwing variant of {@link bestAvailable} for the native host adapter. See {@link holdOrThrow}. */
|
|
228
|
+
bestAvailableOrThrow(qty: number, categoryKey?: string): Promise<BestAvailableResult | null>;
|
|
188
229
|
/**
|
|
189
230
|
* Choose a ticket tier for a selected seat (e.g. Adult → Child). The seat's
|
|
190
231
|
* available `tiers` are on each `SelectedSeat` from `getSelection()` /
|
|
@@ -488,11 +529,11 @@ declare class EmbeddedDesigner {
|
|
|
488
529
|
* per-line tier + price) and never changes shape across minor releases.
|
|
489
530
|
*/
|
|
490
531
|
interface CheckoutLineItem {
|
|
491
|
-
/** Seat
|
|
532
|
+
/** Seat, table-group, or GA synthetic-unit label. */
|
|
492
533
|
label: string;
|
|
493
534
|
/** Chart object id (row/booth/GA area) the unit belongs to. */
|
|
494
535
|
objectId: string;
|
|
495
|
-
objectType: 'seat' | 'booth' | 'ga';
|
|
536
|
+
objectType: 'seat' | 'booth' | 'ga' | 'table';
|
|
496
537
|
categoryKey: string;
|
|
497
538
|
/** Chosen ticket tier id (Adult/Child/…), or null when the category has no tiers. */
|
|
498
539
|
tierId: string | null;
|
|
@@ -684,6 +725,8 @@ declare class SeatPicker {
|
|
|
684
725
|
private srEl;
|
|
685
726
|
private baQty;
|
|
686
727
|
private baCat;
|
|
728
|
+
/** "★ Best seats" premium quick-pick toggle — biases best-available to premium seats. */
|
|
729
|
+
private baPremium;
|
|
687
730
|
private bestAvailableConfirm;
|
|
688
731
|
private releasingHold;
|
|
689
732
|
/** Event sales window is closed (read-only load state / live close). */
|
|
@@ -736,6 +779,20 @@ declare class SeatPicker {
|
|
|
736
779
|
* sightline" line — the premium at-a-glance moment; click opens the 360.
|
|
737
780
|
*/
|
|
738
781
|
private confirmThumbHtml;
|
|
782
|
+
/** Minimal HTML/attribute escaper for buyer-authored commercial text (notes). */
|
|
783
|
+
private escCx;
|
|
784
|
+
/** Localized "Restricted view" / "Obstructed view" label for a seat's flags,
|
|
785
|
+
* or '' when neither is set. Restricted takes precedence when both are on. */
|
|
786
|
+
private limitedViewLabel;
|
|
787
|
+
/**
|
|
788
|
+
* Commercial flags block for the confirm/detail surface: a subtle ★ Premium
|
|
789
|
+
* tag plus an amber ◐ limited-view caution (with the organizer's note when
|
|
790
|
+
* present). '' when the seat carries no surfaced commercial flag.
|
|
791
|
+
*/
|
|
792
|
+
private commercialConfirmHtml;
|
|
793
|
+
/** Small ◐ limited-view marker for a cart chip; title/aria uses the seat's
|
|
794
|
+
* note when present, else the generic view label. '' for a clear-view seat. */
|
|
795
|
+
private commercialChipMarker;
|
|
739
796
|
/** True when the picker is rendered inside an iframe (snippet embed at /e/:key). */
|
|
740
797
|
private isFramed;
|
|
741
798
|
/**
|
|
@@ -997,6 +1054,9 @@ declare class SeatPicker {
|
|
|
997
1054
|
* the prefix is exact (won't touch "1040-A" under section "104"); otherwise
|
|
998
1055
|
* the label is shown verbatim.
|
|
999
1056
|
*/
|
|
1057
|
+
/** Buyer-facing type word for the row/table key label — the designer's
|
|
1058
|
+
* per-object "Displayed type" override, or the default "Row". */
|
|
1059
|
+
private rowTypeWord;
|
|
1000
1060
|
private rowShort;
|
|
1001
1061
|
private updateTooltip;
|
|
1002
1062
|
getSelection(): PickerSeat[];
|
|
@@ -1006,7 +1066,9 @@ declare class SeatPicker {
|
|
|
1006
1066
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
1007
1067
|
/** Remove one server-held ticket while keeping the rest of the hold active. */
|
|
1008
1068
|
removeHeldTicket(label: string): Promise<boolean>;
|
|
1009
|
-
bestAvailable(qty: number, categoryKey?: string
|
|
1069
|
+
bestAvailable(qty: number, categoryKey?: string, opts?: {
|
|
1070
|
+
preferPremium?: boolean;
|
|
1071
|
+
}): Promise<HoldResult | null>;
|
|
1010
1072
|
release(): Promise<void>;
|
|
1011
1073
|
destroy(): void;
|
|
1012
1074
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface HoldConflict {
|
|
|
18
18
|
interface HoldLineItem {
|
|
19
19
|
label: string;
|
|
20
20
|
objectId: string;
|
|
21
|
-
objectType: 'seat' | 'booth' | 'ga';
|
|
21
|
+
objectType: 'seat' | 'booth' | 'ga' | 'table';
|
|
22
22
|
categoryKey: string;
|
|
23
23
|
tierId: string | null;
|
|
24
24
|
/** Price in major currency units (for example 45 means $45.00). */
|
|
@@ -151,6 +151,7 @@ declare class SeatingChart {
|
|
|
151
151
|
private mount;
|
|
152
152
|
private hostEl;
|
|
153
153
|
private rendered;
|
|
154
|
+
private mode_;
|
|
154
155
|
private tipEl;
|
|
155
156
|
private tipPos;
|
|
156
157
|
private onTipMove;
|
|
@@ -168,14 +169,47 @@ declare class SeatingChart {
|
|
|
168
169
|
private buildBadge;
|
|
169
170
|
private placeTooltip;
|
|
170
171
|
private updateTooltip;
|
|
172
|
+
/**
|
|
173
|
+
* Whether the SERVED event is a live or a test event (`sk_test_` keys create
|
|
174
|
+
* test events, which never book real inventory). `null` before render()
|
|
175
|
+
* resolves — the mode comes from the server with the chart, not from options.
|
|
176
|
+
*
|
|
177
|
+
* The widget already surfaces this visually with the test-mode ribbon; this
|
|
178
|
+
* getter is for hosts that draw their own chrome — notably a native WebView
|
|
179
|
+
* wrapper, which must be able to tell an integrator that the build they are
|
|
180
|
+
* about to ship is pointed at a test event.
|
|
181
|
+
*/
|
|
182
|
+
getMode(): 'live' | 'test' | null;
|
|
171
183
|
/** Current selection with prices resolved from the chart categories. */
|
|
172
184
|
getSelection(): SelectedSeat[];
|
|
173
185
|
/** Hold the current selection. Resolves the hold, or null on a 409 conflict. */
|
|
174
186
|
hold(options?: {
|
|
175
187
|
ttlMs?: number;
|
|
176
188
|
}): Promise<HoldResult | null>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal Like {@link hold} but RE-THROWS the structured API error (409
|
|
191
|
+
* `reason`/`code` + `conflicts`) instead of swallowing it into `onError` +
|
|
192
|
+
* `null`. The native WebView host adapter needs the throw so it can answer the
|
|
193
|
+
* originating command with a correlated error carrying the SPECIFIC reason
|
|
194
|
+
* (`sold_out` vs `not_enough_together`); the public method above keeps the
|
|
195
|
+
* catch-and-onError contract that direct web consumers rely on. Not a stable
|
|
196
|
+
* part of the embed API.
|
|
197
|
+
*/
|
|
198
|
+
holdOrThrow(options?: {
|
|
199
|
+
ttlMs?: number;
|
|
200
|
+
}): Promise<HoldResult | null>;
|
|
177
201
|
/** Restore an active hold by its opaque id without extending its expiry. */
|
|
178
202
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
203
|
+
/** @internal Throwing variant of {@link resumeHold} for the native host adapter. See {@link holdOrThrow}. */
|
|
204
|
+
resumeHoldOrThrow(holdId: string): Promise<HoldResult | null>;
|
|
205
|
+
/**
|
|
206
|
+
* Push the OPEN hold's expiry out ("need more time?"). Resolves the refreshed
|
|
207
|
+
* hold, or `null` when there is nothing held or the server refused (the hold
|
|
208
|
+
* is gone, already expired, or at its renewal cap) — refusal is a normal
|
|
209
|
+
* outcome, not an error, so the host decides the copy. The client-side expiry
|
|
210
|
+
* timer is re-armed to match, so `onHoldExpired` won't fire early.
|
|
211
|
+
*/
|
|
212
|
+
extendHold(ttlMs?: number): Promise<HoldResult | null>;
|
|
179
213
|
/** Current active hold known to this chart, if any. */
|
|
180
214
|
getCurrentHold(): HoldResult | null;
|
|
181
215
|
getGAAreas(): GAAreaAvailability[];
|
|
@@ -183,8 +217,15 @@ declare class SeatingChart {
|
|
|
183
217
|
tierId?: string | null;
|
|
184
218
|
ttlMs?: number;
|
|
185
219
|
}): Promise<HoldResult | null>;
|
|
220
|
+
/** @internal Throwing variant of {@link holdGA} for the native host adapter. See {@link holdOrThrow}. */
|
|
221
|
+
holdGAOrThrow(areaId: string, qty: number, options?: {
|
|
222
|
+
tierId?: string | null;
|
|
223
|
+
ttlMs?: number;
|
|
224
|
+
}): Promise<HoldResult | null>;
|
|
186
225
|
/** Ask the server for the `qty` best free seats and hold them atomically. */
|
|
187
226
|
bestAvailable(qty: number, categoryKey?: string): Promise<BestAvailableResult | null>;
|
|
227
|
+
/** @internal Throwing variant of {@link bestAvailable} for the native host adapter. See {@link holdOrThrow}. */
|
|
228
|
+
bestAvailableOrThrow(qty: number, categoryKey?: string): Promise<BestAvailableResult | null>;
|
|
188
229
|
/**
|
|
189
230
|
* Choose a ticket tier for a selected seat (e.g. Adult → Child). The seat's
|
|
190
231
|
* available `tiers` are on each `SelectedSeat` from `getSelection()` /
|
|
@@ -488,11 +529,11 @@ declare class EmbeddedDesigner {
|
|
|
488
529
|
* per-line tier + price) and never changes shape across minor releases.
|
|
489
530
|
*/
|
|
490
531
|
interface CheckoutLineItem {
|
|
491
|
-
/** Seat
|
|
532
|
+
/** Seat, table-group, or GA synthetic-unit label. */
|
|
492
533
|
label: string;
|
|
493
534
|
/** Chart object id (row/booth/GA area) the unit belongs to. */
|
|
494
535
|
objectId: string;
|
|
495
|
-
objectType: 'seat' | 'booth' | 'ga';
|
|
536
|
+
objectType: 'seat' | 'booth' | 'ga' | 'table';
|
|
496
537
|
categoryKey: string;
|
|
497
538
|
/** Chosen ticket tier id (Adult/Child/…), or null when the category has no tiers. */
|
|
498
539
|
tierId: string | null;
|
|
@@ -684,6 +725,8 @@ declare class SeatPicker {
|
|
|
684
725
|
private srEl;
|
|
685
726
|
private baQty;
|
|
686
727
|
private baCat;
|
|
728
|
+
/** "★ Best seats" premium quick-pick toggle — biases best-available to premium seats. */
|
|
729
|
+
private baPremium;
|
|
687
730
|
private bestAvailableConfirm;
|
|
688
731
|
private releasingHold;
|
|
689
732
|
/** Event sales window is closed (read-only load state / live close). */
|
|
@@ -736,6 +779,20 @@ declare class SeatPicker {
|
|
|
736
779
|
* sightline" line — the premium at-a-glance moment; click opens the 360.
|
|
737
780
|
*/
|
|
738
781
|
private confirmThumbHtml;
|
|
782
|
+
/** Minimal HTML/attribute escaper for buyer-authored commercial text (notes). */
|
|
783
|
+
private escCx;
|
|
784
|
+
/** Localized "Restricted view" / "Obstructed view" label for a seat's flags,
|
|
785
|
+
* or '' when neither is set. Restricted takes precedence when both are on. */
|
|
786
|
+
private limitedViewLabel;
|
|
787
|
+
/**
|
|
788
|
+
* Commercial flags block for the confirm/detail surface: a subtle ★ Premium
|
|
789
|
+
* tag plus an amber ◐ limited-view caution (with the organizer's note when
|
|
790
|
+
* present). '' when the seat carries no surfaced commercial flag.
|
|
791
|
+
*/
|
|
792
|
+
private commercialConfirmHtml;
|
|
793
|
+
/** Small ◐ limited-view marker for a cart chip; title/aria uses the seat's
|
|
794
|
+
* note when present, else the generic view label. '' for a clear-view seat. */
|
|
795
|
+
private commercialChipMarker;
|
|
739
796
|
/** True when the picker is rendered inside an iframe (snippet embed at /e/:key). */
|
|
740
797
|
private isFramed;
|
|
741
798
|
/**
|
|
@@ -997,6 +1054,9 @@ declare class SeatPicker {
|
|
|
997
1054
|
* the prefix is exact (won't touch "1040-A" under section "104"); otherwise
|
|
998
1055
|
* the label is shown verbatim.
|
|
999
1056
|
*/
|
|
1057
|
+
/** Buyer-facing type word for the row/table key label — the designer's
|
|
1058
|
+
* per-object "Displayed type" override, or the default "Row". */
|
|
1059
|
+
private rowTypeWord;
|
|
1000
1060
|
private rowShort;
|
|
1001
1061
|
private updateTooltip;
|
|
1002
1062
|
getSelection(): PickerSeat[];
|
|
@@ -1006,7 +1066,9 @@ declare class SeatPicker {
|
|
|
1006
1066
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
1007
1067
|
/** Remove one server-held ticket while keeping the rest of the hold active. */
|
|
1008
1068
|
removeHeldTicket(label: string): Promise<boolean>;
|
|
1009
|
-
bestAvailable(qty: number, categoryKey?: string
|
|
1069
|
+
bestAvailable(qty: number, categoryKey?: string, opts?: {
|
|
1070
|
+
preferPremium?: boolean;
|
|
1071
|
+
}): Promise<HoldResult | null>;
|
|
1010
1072
|
release(): Promise<void>;
|
|
1011
1073
|
destroy(): void;
|
|
1012
1074
|
}
|