@bookitive/js 0.1.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.
@@ -0,0 +1,247 @@
1
+ declare enum ResponseType {
2
+ ErrInvalidPayload = "INVALID_PAYLOAD",
3
+ ErrValidationFailed = "VALIDATION_FAILED",
4
+ ErrNotFound = "NOT_FOUND",
5
+ ErrNotImplemented = "NOT_IMPLEMENTED",
6
+ ErrConflict = "CONFLICT",
7
+ ErrInternal = "INTERNAL_ERROR",
8
+ ErrUnauthorized = "UNAUTHORIZED",
9
+ ErrForbidden = "FORBIDDEN",
10
+ ErrMissingOrganizationID = "MISSING_ORGANIZATION_ID",
11
+ ErrMissingUserID = "MISSING_USER_ID"
12
+ }
13
+ interface DtoPublicAvailability {
14
+ gaRemaining?: Record<string, number>;
15
+ /**
16
+ * ReservedSeats marks which unavailable seats are merely reserved and may
17
+ * free up again — present only when the event shares reserved status.
18
+ */
19
+ reservedSeats?: string[];
20
+ ticketTypeRemaining?: Record<string, number>;
21
+ unavailableSeats?: string[];
22
+ }
23
+ interface DtoPublicEvent {
24
+ event?: DtoPublicEventInfo;
25
+ /**
26
+ * Floors lets a host page render its floor tabs without loading the full
27
+ * seating payload; ids match the seating endpoint's floors.
28
+ */
29
+ floors?: DtoPublicFloorInfo[];
30
+ org?: DtoPublicOrg;
31
+ ticketTypes?: DtoPublicTicketType[];
32
+ }
33
+ interface DtoPublicEventInfo {
34
+ currency?: string;
35
+ endTime?: string;
36
+ holdTtlSeconds?: number;
37
+ locationName?: string;
38
+ name?: string;
39
+ slug?: string;
40
+ startTime?: string;
41
+ }
42
+ interface DtoPublicFloor {
43
+ cons?: string[];
44
+ description?: string;
45
+ id?: string;
46
+ /** "single" | "sections" */
47
+ mode?: string;
48
+ name?: string;
49
+ position?: number;
50
+ pros?: string[];
51
+ sections?: DtoPublicSection[];
52
+ }
53
+ interface DtoPublicFloorInfo {
54
+ cons?: string[];
55
+ description?: string;
56
+ id?: string;
57
+ /** "single" | "sections" */
58
+ mode?: string;
59
+ name?: string;
60
+ position?: number;
61
+ pros?: string[];
62
+ }
63
+ interface DtoPublicGAArea {
64
+ capacity?: number;
65
+ h?: number;
66
+ id?: string;
67
+ label?: string;
68
+ rotation?: number;
69
+ ticketTypeId?: string;
70
+ w?: number;
71
+ x?: number;
72
+ y?: number;
73
+ }
74
+ interface DtoPublicOrder {
75
+ currency?: string;
76
+ expiresAt?: string;
77
+ payment?: DtoPublicPaymentDetail;
78
+ reference?: string;
79
+ status?: string;
80
+ totalCents?: number;
81
+ }
82
+ interface DtoPublicOrg {
83
+ accentColor?: string;
84
+ logoUrl?: string;
85
+ name?: string;
86
+ slug?: string;
87
+ }
88
+ interface DtoPublicPaymentDetail {
89
+ /** BankAccount is the organizer's free-form payment destination. */
90
+ bankAccount?: string;
91
+ /** VariableSymbol identifies the payment — it equals the order reference. */
92
+ variableSymbol?: string;
93
+ }
94
+ interface DtoPublicSeat {
95
+ code?: string;
96
+ id?: string;
97
+ tableId?: string;
98
+ ticketTypeId?: string;
99
+ x?: number;
100
+ y?: number;
101
+ }
102
+ interface DtoPublicSeating {
103
+ floors?: DtoPublicFloor[];
104
+ }
105
+ interface DtoPublicSection {
106
+ decorations?: object;
107
+ gaAreas?: DtoPublicGAArea[];
108
+ h?: number;
109
+ id?: string;
110
+ name?: string;
111
+ polygon?: object;
112
+ prefix?: string;
113
+ seats?: DtoPublicSeat[];
114
+ settings?: object;
115
+ tables?: DtoPublicTable[];
116
+ w?: number;
117
+ x?: number;
118
+ y?: number;
119
+ }
120
+ interface DtoPublicTable {
121
+ curve?: number;
122
+ h?: number;
123
+ id?: string;
124
+ number?: number;
125
+ radius?: number;
126
+ rotation?: number;
127
+ /** "round" | "rect" | "row" */
128
+ shape?: string;
129
+ sides?: number[];
130
+ spacing?: number;
131
+ w?: number;
132
+ x?: number;
133
+ y?: number;
134
+ }
135
+ interface DtoPublicTicketType {
136
+ color?: string;
137
+ cons?: string[];
138
+ description?: string;
139
+ id?: string;
140
+ /** "seated" | "standing" */
141
+ kind?: string;
142
+ maxPerOrder?: number;
143
+ /**
144
+ * MinPerOrder appears only when it is a real constraint (> 1) — the
145
+ * limit applies to orders that include this type at all.
146
+ */
147
+ minPerOrder?: number;
148
+ name?: string;
149
+ priceCents?: number;
150
+ pros?: string[];
151
+ saleEndTime?: string;
152
+ saleStartTime?: string;
153
+ }
154
+ interface PublichandlerPayloadPublicOrder {
155
+ captchaToken?: string;
156
+ customer: {
157
+ email: string;
158
+ /** @maxLength 200 */
159
+ name: string;
160
+ /** @maxLength 50 */
161
+ phone?: string;
162
+ };
163
+ /** @minItems 1 */
164
+ items: PublichandlerPayloadPublicOrderItem[];
165
+ }
166
+ interface PublichandlerPayloadPublicOrderItem {
167
+ gaAreaId?: string;
168
+ /** @min 1 */
169
+ quantity: number;
170
+ seatId?: string;
171
+ ticketTypeId: string;
172
+ }
173
+ interface ResponseAPIError {
174
+ data?: any;
175
+ fields?: Record<string, string>;
176
+ /** @example "see fields" */
177
+ msg: string;
178
+ timestamp?: string;
179
+ traceId?: string;
180
+ /** @example "VALIDATION_FAILED" */
181
+ type: ResponseType;
182
+ }
183
+
184
+ /** One seat changing state. "reserved" appears only when the event shares
185
+ * reserved status publicly — a reserved seat may free up again. */
186
+ interface SeatDelta {
187
+ seatId: string;
188
+ taken: boolean;
189
+ status: 'free' | 'reserved' | 'taken';
190
+ }
191
+ interface LiveHandlers {
192
+ /** Full snapshot — on connect and on every reconnect. */
193
+ onStartstate?: (availability: DtoPublicAvailability) => void;
194
+ /** One seat changed. */
195
+ onSeat?: (delta: SeatDelta) => void;
196
+ /** Connection state changes (drive a "live" indicator if you like). */
197
+ onConnectionChange?: (connected: boolean) => void;
198
+ }
199
+ declare class LiveSubscription {
200
+ #private;
201
+ constructor(url: string, handlers: LiveHandlers);
202
+ close(): void;
203
+ }
204
+
205
+ interface BookitiveClientOptions {
206
+ /** API origin, e.g. "https://api.bookitive.com" (no trailing slash). */
207
+ baseUrl: string;
208
+ /** Organization slug — the {org} in events.bookitive.com/{org}/{event}. */
209
+ org: string;
210
+ /** Event slug. */
211
+ event: string;
212
+ /** Custom fetch (SSR frameworks pass their own). Defaults to global fetch. */
213
+ fetch?: typeof fetch;
214
+ }
215
+ /** API failure with the backend's error envelope attached. */
216
+ declare class BookitiveError extends Error {
217
+ readonly status: number;
218
+ readonly type: string;
219
+ constructor(status: number, body: ResponseAPIError | undefined, fallback: string);
220
+ /** The selection raced another buyer — refresh availability and reselect. */
221
+ get isConflict(): boolean;
222
+ }
223
+ declare class BookitiveClient {
224
+ #private;
225
+ constructor(options: BookitiveClientOptions);
226
+ /** Event identity, org branding, priced ticket types, and floor tabs. */
227
+ event(): Promise<DtoPublicEvent>;
228
+ /** Static chart geometry: floors → sections → tables, seats, GA areas. */
229
+ seating(): Promise<DtoPublicSeating>;
230
+ /** Live sellability snapshot (poll it, or use live() for push updates). */
231
+ availability(): Promise<DtoPublicAvailability>;
232
+ /**
233
+ * Places a bank-transfer reservation: seats are held atomically for the
234
+ * event's hold TTL and payment instructions are emailed (and returned).
235
+ * A 409 (error.isConflict) means a seat was just taken — refresh and
236
+ * reselect.
237
+ */
238
+ checkout(order: PublichandlerPayloadPublicOrder): Promise<DtoPublicOrder>;
239
+ /**
240
+ * Subscribes to live availability over websocket: `startstate` fires with
241
+ * the full snapshot on every (re)connect, then `seat` deltas stream in.
242
+ * Reconnects automatically with backoff; call close() when done.
243
+ */
244
+ live(handlers: LiveHandlers): LiveSubscription;
245
+ }
246
+
247
+ export { BookitiveClient, type BookitiveClientOptions, BookitiveError, type DtoPublicAvailability, type DtoPublicEvent, type DtoPublicEventInfo, type DtoPublicFloor, type DtoPublicFloorInfo, type DtoPublicGAArea, type DtoPublicOrder, type DtoPublicOrg, type DtoPublicPaymentDetail, type DtoPublicSeat, type DtoPublicSeating, type DtoPublicSection, type DtoPublicTable, type DtoPublicTicketType, type LiveHandlers, LiveSubscription, type PublichandlerPayloadPublicOrder, type PublichandlerPayloadPublicOrderItem, type ResponseAPIError, ResponseType, type SeatDelta };
package/dist/index.js ADDED
@@ -0,0 +1,125 @@
1
+ // src/live.ts
2
+ var INITIAL_BACKOFF_MS = 1e3;
3
+ var MAX_BACKOFF_MS = 15e3;
4
+ var LiveSubscription = class {
5
+ #url;
6
+ #handlers;
7
+ #ws = null;
8
+ #backoff = INITIAL_BACKOFF_MS;
9
+ #retry = null;
10
+ #closed = false;
11
+ constructor(url, handlers) {
12
+ this.#url = url.replace(/^http/, "ws");
13
+ this.#handlers = handlers;
14
+ this.#connect();
15
+ }
16
+ close() {
17
+ this.#closed = true;
18
+ if (this.#retry) clearTimeout(this.#retry);
19
+ this.#ws?.close();
20
+ }
21
+ #connect() {
22
+ if (this.#closed) return;
23
+ const ws = new WebSocket(this.#url);
24
+ this.#ws = ws;
25
+ ws.onopen = () => {
26
+ this.#backoff = INITIAL_BACKOFF_MS;
27
+ this.#handlers.onConnectionChange?.(true);
28
+ };
29
+ ws.onmessage = (event) => {
30
+ const message = JSON.parse(event.data);
31
+ if (message.event === "startstate") {
32
+ this.#handlers.onStartstate?.(message.data);
33
+ } else if (message.event === "seat") {
34
+ this.#handlers.onSeat?.(message.data);
35
+ }
36
+ };
37
+ ws.onclose = () => {
38
+ this.#handlers.onConnectionChange?.(false);
39
+ if (this.#closed) return;
40
+ this.#retry = setTimeout(() => this.#connect(), this.#backoff);
41
+ this.#backoff = Math.min(this.#backoff * 2, MAX_BACKOFF_MS);
42
+ };
43
+ }
44
+ };
45
+
46
+ // src/client.ts
47
+ var BookitiveError = class extends Error {
48
+ status;
49
+ type;
50
+ constructor(status, body, fallback) {
51
+ super(body?.msg ?? fallback);
52
+ this.name = "BookitiveError";
53
+ this.status = status;
54
+ this.type = body?.type ?? "UNKNOWN";
55
+ }
56
+ /** The selection raced another buyer — refresh availability and reselect. */
57
+ get isConflict() {
58
+ return this.status === 409;
59
+ }
60
+ };
61
+ var BookitiveClient = class {
62
+ #base;
63
+ #fetch;
64
+ constructor(options) {
65
+ this.#base = `${options.baseUrl.replace(/\/$/, "")}/public/v1/orgs/${encodeURIComponent(
66
+ options.org
67
+ )}/events/${encodeURIComponent(options.event)}`;
68
+ this.#fetch = options.fetch ?? ((...args) => fetch(...args));
69
+ }
70
+ /** Event identity, org branding, priced ticket types, and floor tabs. */
71
+ event() {
72
+ return this.#get("");
73
+ }
74
+ /** Static chart geometry: floors → sections → tables, seats, GA areas. */
75
+ seating() {
76
+ return this.#get("/seating");
77
+ }
78
+ /** Live sellability snapshot (poll it, or use live() for push updates). */
79
+ availability() {
80
+ return this.#get("/availability");
81
+ }
82
+ /**
83
+ * Places a bank-transfer reservation: seats are held atomically for the
84
+ * event's hold TTL and payment instructions are emailed (and returned).
85
+ * A 409 (error.isConflict) means a seat was just taken — refresh and
86
+ * reselect.
87
+ */
88
+ async checkout(order) {
89
+ const res = await this.#fetch(`${this.#base}/orders`, {
90
+ method: "POST",
91
+ headers: { "Content-Type": "application/json" },
92
+ body: JSON.stringify(order)
93
+ });
94
+ return this.#parse(res, "checkout failed");
95
+ }
96
+ /**
97
+ * Subscribes to live availability over websocket: `startstate` fires with
98
+ * the full snapshot on every (re)connect, then `seat` deltas stream in.
99
+ * Reconnects automatically with backoff; call close() when done.
100
+ */
101
+ live(handlers) {
102
+ return new LiveSubscription(`${this.#base}/live`, handlers);
103
+ }
104
+ async #get(path) {
105
+ const res = await this.#fetch(`${this.#base}${path}`);
106
+ return this.#parse(res, `request failed: ${path || "/"}`);
107
+ }
108
+ async #parse(res, fallback) {
109
+ if (!res.ok) {
110
+ let body;
111
+ try {
112
+ body = await res.json();
113
+ } catch {
114
+ }
115
+ throw new BookitiveError(res.status, body, fallback);
116
+ }
117
+ return await res.json();
118
+ }
119
+ };
120
+ export {
121
+ BookitiveClient,
122
+ BookitiveError,
123
+ LiveSubscription
124
+ };
125
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/live.ts","../src/client.ts"],"sourcesContent":["// Live availability over websocket: {\"event\":\"startstate\"|\"seat\", data}.\n// Startstate re-fires on every reconnect, so consumers treat it as the\n// resync point and apply deltas on top.\nimport type { DtoPublicAvailability } from './generated/api.js';\n\n/** One seat changing state. \"reserved\" appears only when the event shares\n * reserved status publicly — a reserved seat may free up again. */\nexport interface SeatDelta {\n\tseatId: string;\n\ttaken: boolean;\n\tstatus: 'free' | 'reserved' | 'taken';\n}\n\nexport interface LiveHandlers {\n\t/** Full snapshot — on connect and on every reconnect. */\n\tonStartstate?: (availability: DtoPublicAvailability) => void;\n\t/** One seat changed. */\n\tonSeat?: (delta: SeatDelta) => void;\n\t/** Connection state changes (drive a \"live\" indicator if you like). */\n\tonConnectionChange?: (connected: boolean) => void;\n}\n\nconst INITIAL_BACKOFF_MS = 1000;\nconst MAX_BACKOFF_MS = 15000;\n\nexport class LiveSubscription {\n\t#url: string;\n\t#handlers: LiveHandlers;\n\t#ws: WebSocket | null = null;\n\t#backoff = INITIAL_BACKOFF_MS;\n\t#retry: ReturnType<typeof setTimeout> | null = null;\n\t#closed = false;\n\n\tconstructor(url: string, handlers: LiveHandlers) {\n\t\tthis.#url = url.replace(/^http/, 'ws');\n\t\tthis.#handlers = handlers;\n\t\tthis.#connect();\n\t}\n\n\tclose(): void {\n\t\tthis.#closed = true;\n\t\tif (this.#retry) clearTimeout(this.#retry);\n\t\tthis.#ws?.close();\n\t}\n\n\t#connect(): void {\n\t\tif (this.#closed) return;\n\t\tconst ws = new WebSocket(this.#url);\n\t\tthis.#ws = ws;\n\t\tws.onopen = () => {\n\t\t\tthis.#backoff = INITIAL_BACKOFF_MS;\n\t\t\tthis.#handlers.onConnectionChange?.(true);\n\t\t};\n\t\tws.onmessage = (event) => {\n\t\t\tconst message = JSON.parse(event.data as string) as {\n\t\t\t\tevent: string;\n\t\t\t\tdata: unknown;\n\t\t\t};\n\t\t\tif (message.event === 'startstate') {\n\t\t\t\tthis.#handlers.onStartstate?.(message.data as DtoPublicAvailability);\n\t\t\t} else if (message.event === 'seat') {\n\t\t\t\tthis.#handlers.onSeat?.(message.data as SeatDelta);\n\t\t\t}\n\t\t};\n\t\tws.onclose = () => {\n\t\t\tthis.#handlers.onConnectionChange?.(false);\n\t\t\tif (this.#closed) return;\n\t\t\tthis.#retry = setTimeout(() => this.#connect(), this.#backoff);\n\t\t\tthis.#backoff = Math.min(this.#backoff * 2, MAX_BACKOFF_MS);\n\t\t};\n\t}\n}\n","// The typed core of @bookitive/js: a thin fetch wrapper over the public\n// checkout API, addressed by org + event slug. All response and payload types\n// are generated from the backend's public swagger — they cannot drift.\nimport type {\n\tDtoPublicAvailability,\n\tDtoPublicEvent,\n\tDtoPublicOrder,\n\tDtoPublicSeating,\n\tPublichandlerPayloadPublicOrder,\n\tResponseAPIError,\n} from './generated/api.js';\nimport { LiveSubscription, type LiveHandlers } from './live.js';\n\nexport interface BookitiveClientOptions {\n\t/** API origin, e.g. \"https://api.bookitive.com\" (no trailing slash). */\n\tbaseUrl: string;\n\t/** Organization slug — the {org} in events.bookitive.com/{org}/{event}. */\n\torg: string;\n\t/** Event slug. */\n\tevent: string;\n\t/** Custom fetch (SSR frameworks pass their own). Defaults to global fetch. */\n\tfetch?: typeof fetch;\n}\n\n/** API failure with the backend's error envelope attached. */\nexport class BookitiveError extends Error {\n\treadonly status: number;\n\treadonly type: string;\n\n\tconstructor(status: number, body: ResponseAPIError | undefined, fallback: string) {\n\t\tsuper(body?.msg ?? fallback);\n\t\tthis.name = 'BookitiveError';\n\t\tthis.status = status;\n\t\tthis.type = body?.type ?? 'UNKNOWN';\n\t}\n\n\t/** The selection raced another buyer — refresh availability and reselect. */\n\tget isConflict(): boolean {\n\t\treturn this.status === 409;\n\t}\n}\n\nexport class BookitiveClient {\n\treadonly #base: string;\n\treadonly #fetch: typeof fetch;\n\n\tconstructor(options: BookitiveClientOptions) {\n\t\tthis.#base = `${options.baseUrl.replace(/\\/$/, '')}/public/v1/orgs/${encodeURIComponent(\n\t\t\toptions.org\n\t\t)}/events/${encodeURIComponent(options.event)}`;\n\t\t// bind, or a browser's fetch throws \"Illegal invocation\" when called\n\t\t// detached from window\n\t\tthis.#fetch = options.fetch ?? ((...args) => fetch(...args));\n\t}\n\n\t/** Event identity, org branding, priced ticket types, and floor tabs. */\n\tevent(): Promise<DtoPublicEvent> {\n\t\treturn this.#get<DtoPublicEvent>('');\n\t}\n\n\t/** Static chart geometry: floors → sections → tables, seats, GA areas. */\n\tseating(): Promise<DtoPublicSeating> {\n\t\treturn this.#get<DtoPublicSeating>('/seating');\n\t}\n\n\t/** Live sellability snapshot (poll it, or use live() for push updates). */\n\tavailability(): Promise<DtoPublicAvailability> {\n\t\treturn this.#get<DtoPublicAvailability>('/availability');\n\t}\n\n\t/**\n\t * Places a bank-transfer reservation: seats are held atomically for the\n\t * event's hold TTL and payment instructions are emailed (and returned).\n\t * A 409 (error.isConflict) means a seat was just taken — refresh and\n\t * reselect.\n\t */\n\tasync checkout(order: PublichandlerPayloadPublicOrder): Promise<DtoPublicOrder> {\n\t\tconst res = await this.#fetch(`${this.#base}/orders`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(order),\n\t\t});\n\t\treturn this.#parse<DtoPublicOrder>(res, 'checkout failed');\n\t}\n\n\t/**\n\t * Subscribes to live availability over websocket: `startstate` fires with\n\t * the full snapshot on every (re)connect, then `seat` deltas stream in.\n\t * Reconnects automatically with backoff; call close() when done.\n\t */\n\tlive(handlers: LiveHandlers): LiveSubscription {\n\t\treturn new LiveSubscription(`${this.#base}/live`, handlers);\n\t}\n\n\tasync #get<T>(path: string): Promise<T> {\n\t\tconst res = await this.#fetch(`${this.#base}${path}`);\n\t\treturn this.#parse<T>(res, `request failed: ${path || '/'}`);\n\t}\n\n\tasync #parse<T>(res: Response, fallback: string): Promise<T> {\n\t\tif (!res.ok) {\n\t\t\tlet body: ResponseAPIError | undefined;\n\t\t\ttry {\n\t\t\t\tbody = (await res.json()) as ResponseAPIError;\n\t\t\t} catch {\n\t\t\t\t// non-JSON error body — the fallback message covers it\n\t\t\t}\n\t\t\tthrow new BookitiveError(res.status, body, fallback);\n\t\t}\n\t\treturn (await res.json()) as T;\n\t}\n}\n"],"mappings":"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","names":[]}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@bookitive/js",
3
+ "version": "0.1.0",
4
+ "description": "Typed client for the Bookitive public checkout API — event info, seating, live availability, and orders.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "devDependencies": {
23
+ "prettier": "^3.4.2",
24
+ "swagger-typescript-api": "^13.0.28",
25
+ "tsup": "^8.5.1",
26
+ "typescript": "^5.7.3",
27
+ "vitest": "^3.0.5"
28
+ },
29
+ "scripts": {
30
+ "generate": "swagger-typescript-api generate -p ${PUBLIC_SWAGGER_JSON:-http://localhost:3000/public/v1/swagger/doc.json} -o ./src/generated -n api.ts --no-client",
31
+ "build": "tsup src/index.ts --format esm --dts --clean --sourcemap",
32
+ "check": "tsc --noEmit",
33
+ "test": "vitest run",
34
+ "lint": "prettier --check src"
35
+ }
36
+ }