@seatlayer/js 0.38.0 → 0.39.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 +216 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -2
- package/dist/index.d.ts +89 -2
- package/dist/index.js +218 -52
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2946,13 +2946,39 @@ declare class SeatManager {
|
|
|
2946
2946
|
private labelToId;
|
|
2947
2947
|
private labelToSeat;
|
|
2948
2948
|
private allIds;
|
|
2949
|
+
/**
|
|
2950
|
+
* GA inventory units — real sellable labels the server counts, with NO seat
|
|
2951
|
+
* geometry and therefore no renderer binding. They live here rather than in
|
|
2952
|
+
* `labelToId`/`allIds` so every paint path keeps addressing paintable nodes
|
|
2953
|
+
* only, while the tally denominator finally covers the same universe the
|
|
2954
|
+
* numerator does. Without them a GA sale hit `booked` but not `total`:
|
|
2955
|
+
* Free under-reported by GA capacity and SOLD% could exceed 100%.
|
|
2956
|
+
*/
|
|
2957
|
+
private gaUnitLabelSet;
|
|
2949
2958
|
private status;
|
|
2959
|
+
/** Live non-free counters, moved by each delta rather than re-walked. */
|
|
2960
|
+
private counts;
|
|
2961
|
+
/** Bumped whenever the seat model is replaced wholesale (a full snapshot). */
|
|
2962
|
+
private modelVersion;
|
|
2950
2963
|
private currency;
|
|
2951
2964
|
private authoritativeGrossRevenue;
|
|
2952
2965
|
private revenueStatus;
|
|
2953
2966
|
private revenueRequest;
|
|
2954
|
-
private revenueRefreshTimer;
|
|
2955
2967
|
private controlRoomSnapshot;
|
|
2968
|
+
/**
|
|
2969
|
+
* The server's own totals, pinned to the client model they were read against.
|
|
2970
|
+
* Display = server baseline + (client now − client then), so the authoritative
|
|
2971
|
+
* numbers land exactly on arrival and deltas still move them between reads.
|
|
2972
|
+
* A wholesale model replacement invalidates the pairing (`model`), and the
|
|
2973
|
+
* client tallies — themselves a fresh authenticated read — take over.
|
|
2974
|
+
*/
|
|
2975
|
+
private serverBaseline;
|
|
2976
|
+
/** Latest presence frame, held whether or not a snapshot has landed yet. */
|
|
2977
|
+
private livePresence;
|
|
2978
|
+
/** Latest cumulative booked gross pushed on a delta frame. */
|
|
2979
|
+
private liveGross;
|
|
2980
|
+
/** Coalesces a burst of deltas into one KPI/rail repaint. */
|
|
2981
|
+
private paintHandle;
|
|
2956
2982
|
private trendWindowMinutes;
|
|
2957
2983
|
private heatEnabled;
|
|
2958
2984
|
private followLive;
|
|
@@ -3082,6 +3108,22 @@ declare class SeatManager {
|
|
|
3082
3108
|
private selectableStatuses;
|
|
3083
3109
|
private updateRendererInteraction;
|
|
3084
3110
|
private handleSeatSelect;
|
|
3111
|
+
/**
|
|
3112
|
+
* Build the client's inventory universe from the chart.
|
|
3113
|
+
*
|
|
3114
|
+
* `expandChart` yields SEATS — it has no output for a GA area, whose capacity
|
|
3115
|
+
* is sold as N synthetic unit labels. The server's seat map keys, its deltas
|
|
3116
|
+
* and its `totals` all speak those labels, so a client that only knows seats
|
|
3117
|
+
* counts GA sales in the numerator (every key of the snapshot is written into
|
|
3118
|
+
* `status`) while leaving them out of the denominator. Registering the GA
|
|
3119
|
+
* units here — labels only, never a render binding — is what makes the two
|
|
3120
|
+
* agree.
|
|
3121
|
+
*/
|
|
3122
|
+
private buildUnitUniverse;
|
|
3123
|
+
/** Every sellable unit the client knows: seats + GA capacity. */
|
|
3124
|
+
private unitTotal;
|
|
3125
|
+
/** Every label the client models, whether or not it can be painted. */
|
|
3126
|
+
private knownLabels;
|
|
3085
3127
|
private repaintAll;
|
|
3086
3128
|
/**
|
|
3087
3129
|
* Open the cockpit's realtime socket AS THE ORGANIZER.
|
|
@@ -3101,6 +3143,16 @@ declare class SeatManager {
|
|
|
3101
3143
|
private connect;
|
|
3102
3144
|
private scheduleReconnect;
|
|
3103
3145
|
private onMessage;
|
|
3146
|
+
/**
|
|
3147
|
+
* Adopt the cumulative booked gross a delta frame carried.
|
|
3148
|
+
*
|
|
3149
|
+
* Stashed with its arrival time so an in-flight control-room read can decide
|
|
3150
|
+
* whether it is holding the newer number: a frame that landed after the
|
|
3151
|
+
* request started is newer than the response, one that landed before is not.
|
|
3152
|
+
*/
|
|
3153
|
+
private applyLiveGross;
|
|
3154
|
+
/** The single writer for a label's status, so the counters never drift. */
|
|
3155
|
+
private setStatusLabel;
|
|
3104
3156
|
private resnapshot;
|
|
3105
3157
|
/**
|
|
3106
3158
|
* Replace the whole seat model.
|
|
@@ -3111,6 +3163,8 @@ declare class SeatManager {
|
|
|
3111
3163
|
* the mode really is free, wrong the moment it is not.
|
|
3112
3164
|
*/
|
|
3113
3165
|
private applySnapshot;
|
|
3166
|
+
/** The one O(n) walk left: a wholesale model replacement re-bases the counters. */
|
|
3167
|
+
private recountAll;
|
|
3114
3168
|
/** Optimistic local write shared by organizer actions. Paint and tally once,
|
|
3115
3169
|
* even when an arena-sized operation changes hundreds of seats. */
|
|
3116
3170
|
private setSeatsLocal;
|
|
@@ -3125,9 +3179,39 @@ declare class SeatManager {
|
|
|
3125
3179
|
private locateActivity;
|
|
3126
3180
|
private showLiveEvent;
|
|
3127
3181
|
private applyReportRevenue;
|
|
3182
|
+
/**
|
|
3183
|
+
* Read the server's own control-room projection.
|
|
3184
|
+
*
|
|
3185
|
+
* Called on mount, on every socket (re)connect and after an organizer action —
|
|
3186
|
+
* never on a timer and never per delta frame. Presence and gross that arrived
|
|
3187
|
+
* on the socket AFTER this request started are newer than the response, so
|
|
3188
|
+
* they survive it; anything older defers to the read.
|
|
3189
|
+
*/
|
|
3128
3190
|
private refreshControlRoom;
|
|
3129
|
-
|
|
3191
|
+
/** Pin the server's totals to the client model they were read against. */
|
|
3192
|
+
private rebaseServerTotals;
|
|
3193
|
+
/** What the client's own model says — GA units included since `render()`. */
|
|
3194
|
+
private clientTallies;
|
|
3195
|
+
/**
|
|
3196
|
+
* The numbers the KPI bar and rail render.
|
|
3197
|
+
*
|
|
3198
|
+
* The server is the authority: its totals land exactly as read, and the
|
|
3199
|
+
* delta-driven client model carries them forward until the next read. Before
|
|
3200
|
+
* the first snapshot — and after a wholesale model replacement invalidates the
|
|
3201
|
+
* pairing — the client model stands alone.
|
|
3202
|
+
*/
|
|
3203
|
+
private buildTallies;
|
|
3204
|
+
/**
|
|
3205
|
+
* Queue one KPI/rail repaint for this burst of changes.
|
|
3206
|
+
*
|
|
3207
|
+
* A delta frame can carry hundreds of seats and `paintKpis` rebuilds eight
|
|
3208
|
+
* nodes from scratch, so painting per change is what made an arena-sized
|
|
3209
|
+
* frame expensive. Coalescing on a frame keeps the burst to a single rebuild;
|
|
3210
|
+
* without `requestAnimationFrame` (SSR, an older test env) it paints inline
|
|
3211
|
+
* rather than dropping the update.
|
|
3212
|
+
*/
|
|
3130
3213
|
private recomputeTallies;
|
|
3214
|
+
private flushTallies;
|
|
3131
3215
|
private verbFor;
|
|
3132
3216
|
private pushActivity;
|
|
3133
3217
|
private seedFeed;
|
|
@@ -3150,6 +3234,9 @@ declare class SeatManager {
|
|
|
3150
3234
|
private paintKpis;
|
|
3151
3235
|
private paintRail;
|
|
3152
3236
|
private renderViewRail;
|
|
3237
|
+
/** Live presence wins over the snapshot's copy — it is the fresher channel,
|
|
3238
|
+
* and it exists from the first frame rather than the first fetch. */
|
|
3239
|
+
private presenceCounts;
|
|
3153
3240
|
private paintMonitorInsights;
|
|
3154
3241
|
private applyHeatOverlay;
|
|
3155
3242
|
private renderInspectRail;
|
package/dist/index.d.ts
CHANGED
|
@@ -2946,13 +2946,39 @@ declare class SeatManager {
|
|
|
2946
2946
|
private labelToId;
|
|
2947
2947
|
private labelToSeat;
|
|
2948
2948
|
private allIds;
|
|
2949
|
+
/**
|
|
2950
|
+
* GA inventory units — real sellable labels the server counts, with NO seat
|
|
2951
|
+
* geometry and therefore no renderer binding. They live here rather than in
|
|
2952
|
+
* `labelToId`/`allIds` so every paint path keeps addressing paintable nodes
|
|
2953
|
+
* only, while the tally denominator finally covers the same universe the
|
|
2954
|
+
* numerator does. Without them a GA sale hit `booked` but not `total`:
|
|
2955
|
+
* Free under-reported by GA capacity and SOLD% could exceed 100%.
|
|
2956
|
+
*/
|
|
2957
|
+
private gaUnitLabelSet;
|
|
2949
2958
|
private status;
|
|
2959
|
+
/** Live non-free counters, moved by each delta rather than re-walked. */
|
|
2960
|
+
private counts;
|
|
2961
|
+
/** Bumped whenever the seat model is replaced wholesale (a full snapshot). */
|
|
2962
|
+
private modelVersion;
|
|
2950
2963
|
private currency;
|
|
2951
2964
|
private authoritativeGrossRevenue;
|
|
2952
2965
|
private revenueStatus;
|
|
2953
2966
|
private revenueRequest;
|
|
2954
|
-
private revenueRefreshTimer;
|
|
2955
2967
|
private controlRoomSnapshot;
|
|
2968
|
+
/**
|
|
2969
|
+
* The server's own totals, pinned to the client model they were read against.
|
|
2970
|
+
* Display = server baseline + (client now − client then), so the authoritative
|
|
2971
|
+
* numbers land exactly on arrival and deltas still move them between reads.
|
|
2972
|
+
* A wholesale model replacement invalidates the pairing (`model`), and the
|
|
2973
|
+
* client tallies — themselves a fresh authenticated read — take over.
|
|
2974
|
+
*/
|
|
2975
|
+
private serverBaseline;
|
|
2976
|
+
/** Latest presence frame, held whether or not a snapshot has landed yet. */
|
|
2977
|
+
private livePresence;
|
|
2978
|
+
/** Latest cumulative booked gross pushed on a delta frame. */
|
|
2979
|
+
private liveGross;
|
|
2980
|
+
/** Coalesces a burst of deltas into one KPI/rail repaint. */
|
|
2981
|
+
private paintHandle;
|
|
2956
2982
|
private trendWindowMinutes;
|
|
2957
2983
|
private heatEnabled;
|
|
2958
2984
|
private followLive;
|
|
@@ -3082,6 +3108,22 @@ declare class SeatManager {
|
|
|
3082
3108
|
private selectableStatuses;
|
|
3083
3109
|
private updateRendererInteraction;
|
|
3084
3110
|
private handleSeatSelect;
|
|
3111
|
+
/**
|
|
3112
|
+
* Build the client's inventory universe from the chart.
|
|
3113
|
+
*
|
|
3114
|
+
* `expandChart` yields SEATS — it has no output for a GA area, whose capacity
|
|
3115
|
+
* is sold as N synthetic unit labels. The server's seat map keys, its deltas
|
|
3116
|
+
* and its `totals` all speak those labels, so a client that only knows seats
|
|
3117
|
+
* counts GA sales in the numerator (every key of the snapshot is written into
|
|
3118
|
+
* `status`) while leaving them out of the denominator. Registering the GA
|
|
3119
|
+
* units here — labels only, never a render binding — is what makes the two
|
|
3120
|
+
* agree.
|
|
3121
|
+
*/
|
|
3122
|
+
private buildUnitUniverse;
|
|
3123
|
+
/** Every sellable unit the client knows: seats + GA capacity. */
|
|
3124
|
+
private unitTotal;
|
|
3125
|
+
/** Every label the client models, whether or not it can be painted. */
|
|
3126
|
+
private knownLabels;
|
|
3085
3127
|
private repaintAll;
|
|
3086
3128
|
/**
|
|
3087
3129
|
* Open the cockpit's realtime socket AS THE ORGANIZER.
|
|
@@ -3101,6 +3143,16 @@ declare class SeatManager {
|
|
|
3101
3143
|
private connect;
|
|
3102
3144
|
private scheduleReconnect;
|
|
3103
3145
|
private onMessage;
|
|
3146
|
+
/**
|
|
3147
|
+
* Adopt the cumulative booked gross a delta frame carried.
|
|
3148
|
+
*
|
|
3149
|
+
* Stashed with its arrival time so an in-flight control-room read can decide
|
|
3150
|
+
* whether it is holding the newer number: a frame that landed after the
|
|
3151
|
+
* request started is newer than the response, one that landed before is not.
|
|
3152
|
+
*/
|
|
3153
|
+
private applyLiveGross;
|
|
3154
|
+
/** The single writer for a label's status, so the counters never drift. */
|
|
3155
|
+
private setStatusLabel;
|
|
3104
3156
|
private resnapshot;
|
|
3105
3157
|
/**
|
|
3106
3158
|
* Replace the whole seat model.
|
|
@@ -3111,6 +3163,8 @@ declare class SeatManager {
|
|
|
3111
3163
|
* the mode really is free, wrong the moment it is not.
|
|
3112
3164
|
*/
|
|
3113
3165
|
private applySnapshot;
|
|
3166
|
+
/** The one O(n) walk left: a wholesale model replacement re-bases the counters. */
|
|
3167
|
+
private recountAll;
|
|
3114
3168
|
/** Optimistic local write shared by organizer actions. Paint and tally once,
|
|
3115
3169
|
* even when an arena-sized operation changes hundreds of seats. */
|
|
3116
3170
|
private setSeatsLocal;
|
|
@@ -3125,9 +3179,39 @@ declare class SeatManager {
|
|
|
3125
3179
|
private locateActivity;
|
|
3126
3180
|
private showLiveEvent;
|
|
3127
3181
|
private applyReportRevenue;
|
|
3182
|
+
/**
|
|
3183
|
+
* Read the server's own control-room projection.
|
|
3184
|
+
*
|
|
3185
|
+
* Called on mount, on every socket (re)connect and after an organizer action —
|
|
3186
|
+
* never on a timer and never per delta frame. Presence and gross that arrived
|
|
3187
|
+
* on the socket AFTER this request started are newer than the response, so
|
|
3188
|
+
* they survive it; anything older defers to the read.
|
|
3189
|
+
*/
|
|
3128
3190
|
private refreshControlRoom;
|
|
3129
|
-
|
|
3191
|
+
/** Pin the server's totals to the client model they were read against. */
|
|
3192
|
+
private rebaseServerTotals;
|
|
3193
|
+
/** What the client's own model says — GA units included since `render()`. */
|
|
3194
|
+
private clientTallies;
|
|
3195
|
+
/**
|
|
3196
|
+
* The numbers the KPI bar and rail render.
|
|
3197
|
+
*
|
|
3198
|
+
* The server is the authority: its totals land exactly as read, and the
|
|
3199
|
+
* delta-driven client model carries them forward until the next read. Before
|
|
3200
|
+
* the first snapshot — and after a wholesale model replacement invalidates the
|
|
3201
|
+
* pairing — the client model stands alone.
|
|
3202
|
+
*/
|
|
3203
|
+
private buildTallies;
|
|
3204
|
+
/**
|
|
3205
|
+
* Queue one KPI/rail repaint for this burst of changes.
|
|
3206
|
+
*
|
|
3207
|
+
* A delta frame can carry hundreds of seats and `paintKpis` rebuilds eight
|
|
3208
|
+
* nodes from scratch, so painting per change is what made an arena-sized
|
|
3209
|
+
* frame expensive. Coalescing on a frame keeps the burst to a single rebuild;
|
|
3210
|
+
* without `requestAnimationFrame` (SSR, an older test env) it paints inline
|
|
3211
|
+
* rather than dropping the update.
|
|
3212
|
+
*/
|
|
3130
3213
|
private recomputeTallies;
|
|
3214
|
+
private flushTallies;
|
|
3131
3215
|
private verbFor;
|
|
3132
3216
|
private pushActivity;
|
|
3133
3217
|
private seedFeed;
|
|
@@ -3150,6 +3234,9 @@ declare class SeatManager {
|
|
|
3150
3234
|
private paintKpis;
|
|
3151
3235
|
private paintRail;
|
|
3152
3236
|
private renderViewRail;
|
|
3237
|
+
/** Live presence wins over the snapshot's copy — it is the fresher channel,
|
|
3238
|
+
* and it exists from the first frame rather than the first fetch. */
|
|
3239
|
+
private presenceCounts;
|
|
3153
3240
|
private paintMonitorInsights;
|
|
3154
3241
|
private applyHeatOverlay;
|
|
3155
3242
|
private renderInspectRail;
|