@cohostvip/cohost-node 0.0.4 → 0.0.7
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/README.md +11 -0
- package/dist/index.d.mts +1114 -764
- package/dist/index.d.ts +1114 -764
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -41,457 +41,224 @@ declare class CohostEndpoint {
|
|
|
41
41
|
constructor(request: RequestFn, settings: CohostClientSettings);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
address_1: string;
|
|
46
|
-
address_2?: string;
|
|
47
|
-
city: string;
|
|
48
|
-
country: string;
|
|
49
|
-
formattedAddress?: string;
|
|
50
|
-
localized_address_display?: string;
|
|
51
|
-
localized_area_display?: string;
|
|
52
|
-
localized_multi_line_address_display?: Array<string>;
|
|
53
|
-
postal_code: string;
|
|
54
|
-
premise?: string;
|
|
55
|
-
region: string;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
type BuzzBuilder = {
|
|
59
|
-
countLabel: string;
|
|
60
|
-
profiles: Array<{
|
|
61
|
-
id: string;
|
|
62
|
-
name: string;
|
|
63
|
-
photoURL: string;
|
|
64
|
-
}>;
|
|
65
|
-
};
|
|
44
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
66
45
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
/**
|
|
47
|
+
* A namespaced identifier representing the entity an order is associated with.
|
|
48
|
+
*
|
|
49
|
+
* Must begin with one of the following prefixes:
|
|
50
|
+
* - "evt_" for events
|
|
51
|
+
* - "ven_" for venues
|
|
52
|
+
* - "org_" for organizers
|
|
53
|
+
*
|
|
54
|
+
* @example "evt_abc123"
|
|
55
|
+
* @example "org_def456"
|
|
56
|
+
*
|
|
57
|
+
* @schema string()
|
|
58
|
+
* @pattern ^((evt|ven|org)_[a-zA-Z0-9]+)$
|
|
59
|
+
*/
|
|
60
|
+
type ContextId = string;
|
|
61
|
+
type ApiVersion = "2025-04-15";
|
|
62
|
+
/**
|
|
63
|
+
* A rich content object that supports multiple representations of text.
|
|
64
|
+
*/
|
|
65
|
+
interface MultipartText {
|
|
66
|
+
/** HTML version of the content. */
|
|
67
|
+
html?: string;
|
|
68
|
+
/** Plain text version of the content. */
|
|
69
|
+
text?: string;
|
|
70
|
+
/** Markdown version of the content. */
|
|
71
|
+
md?: string;
|
|
72
|
+
/** Optional rich editor blocks (if structured editing is supported). */
|
|
73
|
+
blocks?: any[] | null;
|
|
72
74
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
75
|
+
/**
|
|
76
|
+
* A photo object with resolution options and optional metadata.
|
|
77
|
+
*/
|
|
78
|
+
interface Photo {
|
|
79
|
+
/** High-resolution (2x) image URL. */
|
|
80
|
+
"2x"?: string;
|
|
81
|
+
/** Internal photo ID, if stored in a media system. */
|
|
82
|
+
id?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Primary image URL.
|
|
85
|
+
* This is the default image URL to be used when no other resolution is specified.
|
|
86
|
+
*
|
|
87
|
+
* @example "https://picsum.photos/500"
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* @x-faker image.imageUrl
|
|
91
|
+
*/
|
|
92
|
+
url: string;
|
|
93
|
+
/** Width of the image in pixels. */
|
|
94
|
+
width?: number;
|
|
95
|
+
/** Height of the image in pixels. */
|
|
96
|
+
height?: number;
|
|
97
|
+
/** Optional caption for the image. */
|
|
98
|
+
caption?: string;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
* Unique identifier for the record.
|
|
114
|
-
*/
|
|
115
|
-
id: string;
|
|
116
|
-
/**
|
|
117
|
-
* List of offering IDs (e.g., ticket classes) this coupon applies to.
|
|
118
|
-
* If empty, the coupon applies to all eligible offerings in its context.
|
|
119
|
-
*/
|
|
120
|
-
offeringIds: Array<string>;
|
|
121
|
-
/**
|
|
122
|
-
* Percentage to deduct from the item or order total.
|
|
123
|
-
* Range is 0–100. Use 0 for no percentage-based discount.
|
|
124
|
-
*/
|
|
125
|
-
percentOff: number;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
type Partial_Customer_ = {
|
|
129
|
-
age?: number;
|
|
130
|
-
birthdate?: string;
|
|
131
|
-
displayName?: string;
|
|
132
|
-
email?: string;
|
|
133
|
-
first?: string;
|
|
134
|
-
gender?: string;
|
|
135
|
-
last?: string;
|
|
136
|
-
name?: string;
|
|
137
|
-
phone?: string;
|
|
138
|
-
photoURL?: string;
|
|
139
|
-
uid?: string;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
type Partial_OrderContext_ = {
|
|
143
|
-
/**
|
|
144
|
-
* The unique cart session ID assigned at the time the cart was created.
|
|
145
|
-
* Helps track cart attribution across systems.
|
|
146
|
-
*/
|
|
147
|
-
cartSessionId?: string;
|
|
148
|
-
/**
|
|
149
|
-
* IP addresses associated with the user request.
|
|
150
|
-
* Typically includes forwarded IPs and direct client IP.
|
|
151
|
-
*/
|
|
152
|
-
ipAddresses?: Array<string>;
|
|
153
|
-
/**
|
|
154
|
-
* (Optional) Origin domain name if embedded or white-labeled.
|
|
155
|
-
* Can help identify partner portals or iframe referrers.
|
|
156
|
-
*/
|
|
157
|
-
originDomain?: string;
|
|
158
|
-
/**
|
|
159
|
-
* The referring URL from which the cart or checkout was initiated.
|
|
160
|
-
* May be a partner site, marketing page, or event listing.
|
|
161
|
-
*/
|
|
162
|
-
referrer?: string;
|
|
163
|
-
/**
|
|
164
|
-
* (Optional) Campaign ID, UTM source, or tracking label.
|
|
165
|
-
* Useful for affiliate and analytics systems.
|
|
166
|
-
*/
|
|
167
|
-
trackingId?: string;
|
|
168
|
-
/**
|
|
169
|
-
* Authenticated user ID, or null for anonymous guests.
|
|
170
|
-
*/
|
|
171
|
-
uid?: string;
|
|
172
|
-
/**
|
|
173
|
-
* Raw User-Agent header from the client request.
|
|
174
|
-
*/
|
|
175
|
-
userAgent?: string;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
declare enum OfferingType {
|
|
179
|
-
ADMISSION = "admission",
|
|
180
|
-
DONATION = "donation",
|
|
181
|
-
DRINK = "drink",
|
|
182
|
-
MEMBERSHIP = "membership",
|
|
183
|
-
MERCH = "merch",
|
|
184
|
-
OTHER = "other",
|
|
185
|
-
PACKAGE = "package",
|
|
186
|
-
SERVICE = "service",
|
|
187
|
-
SKIP = "skip",
|
|
188
|
-
TC_TICKET = "tc-ticket",
|
|
189
|
-
TICKET = "ticket",
|
|
190
|
-
VOUCHER = "voucher"
|
|
100
|
+
/**
|
|
101
|
+
* A repeating or structured date schedule for an event or item.
|
|
102
|
+
*/
|
|
103
|
+
interface Schedule {
|
|
104
|
+
/** Days of the week (0 = Sunday, 6 = Saturday). */
|
|
105
|
+
daysOfWeek?: number[];
|
|
106
|
+
/** ISO-formatted UTC start datetime. */
|
|
107
|
+
start: string;
|
|
108
|
+
/** ISO-formatted UTC end datetime. */
|
|
109
|
+
end: string;
|
|
110
|
+
/** Specific dates to exclude in "YYYY-MM-DD" format. */
|
|
111
|
+
excludeDates?: string[];
|
|
112
|
+
/** Specific dates to include in "YYYY-MM-DD" format. */
|
|
113
|
+
includeDates?: string[];
|
|
191
114
|
}
|
|
192
|
-
|
|
193
115
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
116
|
+
* Base metadata for any record stored in the system.
|
|
117
|
+
* Includes an ID and timestamps for creation and optional updates.
|
|
118
|
+
*
|
|
119
|
+
* @export
|
|
196
120
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Total discount amount applied to this item.
|
|
216
|
-
*/
|
|
217
|
-
discount: string;
|
|
218
|
-
/**
|
|
219
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
220
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
221
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
222
|
-
*
|
|
223
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
224
|
-
*/
|
|
225
|
-
fee: string;
|
|
226
|
-
/**
|
|
227
|
-
* cost + fee - discount , not including tax
|
|
228
|
-
*/
|
|
229
|
-
gross: string;
|
|
230
|
-
/**
|
|
231
|
-
* Total price before discounts.
|
|
232
|
-
* Equal to subtotal + fee, before subtracting discount.
|
|
233
|
-
*/
|
|
234
|
-
preDiscount: string;
|
|
235
|
-
/**
|
|
236
|
-
* Total cost of tickets before taxes, fees, and discounts.
|
|
237
|
-
*/
|
|
238
|
-
subtotal: string;
|
|
239
|
-
/**
|
|
240
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
241
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
242
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
243
|
-
*
|
|
244
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
245
|
-
*/
|
|
246
|
-
tax: string;
|
|
247
|
-
/**
|
|
248
|
-
* total cost including tax
|
|
249
|
-
*/
|
|
250
|
-
total: string;
|
|
251
|
-
};
|
|
252
|
-
|
|
121
|
+
interface DataRecord {
|
|
122
|
+
/**
|
|
123
|
+
* Unique identifier for the record.
|
|
124
|
+
* @example "rec_123abc"
|
|
125
|
+
*/
|
|
126
|
+
id: string;
|
|
127
|
+
/**
|
|
128
|
+
* ISO 8601 timestamp indicating when the record was created.
|
|
129
|
+
* @example "2025-04-16T10:15:00Z"
|
|
130
|
+
*/
|
|
131
|
+
created: string;
|
|
132
|
+
/**
|
|
133
|
+
* ISO 8601 timestamp indicating when the record was last updated, if applicable.
|
|
134
|
+
* @example "2025-04-18T08:00:00Z"
|
|
135
|
+
*/
|
|
136
|
+
changed?: string;
|
|
137
|
+
}
|
|
253
138
|
/**
|
|
254
|
-
*
|
|
139
|
+
* Extension of `DataRecord` for resources returned from RESTful APIs.
|
|
140
|
+
* Includes a schema version to ensure compatibility with evolving formats.
|
|
141
|
+
*
|
|
142
|
+
* @export
|
|
255
143
|
*/
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
268
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
269
|
-
*
|
|
270
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
271
|
-
*/
|
|
272
|
-
delivery: string;
|
|
273
|
-
/**
|
|
274
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
275
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
276
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
277
|
-
*
|
|
278
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
279
|
-
*/
|
|
280
|
-
fee: string;
|
|
281
|
-
/**
|
|
282
|
-
* cost + fee - discount , not including tax
|
|
283
|
-
*/
|
|
284
|
-
gross: string;
|
|
285
|
-
/**
|
|
286
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
287
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
288
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
289
|
-
*
|
|
290
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
291
|
-
*/
|
|
292
|
-
tax: string;
|
|
293
|
-
/**
|
|
294
|
-
* total cost including tax
|
|
295
|
-
*/
|
|
296
|
-
total: string;
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
type OrderItemOffering = {
|
|
300
|
-
costs: OfferingCosts;
|
|
301
|
-
/**
|
|
302
|
-
* doc assicated with this offering in the DB.
|
|
303
|
-
*/
|
|
304
|
-
docPath: string;
|
|
305
|
-
/**
|
|
306
|
-
* Offering name, can be ticket name, vaucher name, etc...
|
|
307
|
-
*/
|
|
308
|
-
name: string;
|
|
309
|
-
type: OfferingType;
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
type Partial_OrderItem_ = {
|
|
313
|
-
/**
|
|
314
|
-
* Breakdown of cost components (e.g., base, service fee, delivery).
|
|
315
|
-
*/
|
|
316
|
-
costComponents?: Array<CalculatedCostComponent>;
|
|
317
|
-
costs?: OrderItemCosts;
|
|
318
|
-
/**
|
|
319
|
-
* Unique ID for this order item.
|
|
320
|
-
*/
|
|
321
|
-
id?: string;
|
|
322
|
-
/**
|
|
323
|
-
* If this item is included as part of a package, this is the ID of the parent item.
|
|
324
|
-
* Otherwise, null.
|
|
325
|
-
*/
|
|
326
|
-
includedWithItemId?: string;
|
|
327
|
-
/**
|
|
328
|
-
* Any relevant metadata associated with this item.
|
|
329
|
-
* This can include custom fields or additional information.
|
|
330
|
-
*/
|
|
331
|
-
meta?: any;
|
|
332
|
-
offering?: OrderItemOffering;
|
|
333
|
-
/**
|
|
334
|
-
* ID of the offering purchased.
|
|
335
|
-
*/
|
|
336
|
-
offeringId?: string;
|
|
337
|
-
offeringType?: OfferingType;
|
|
338
|
-
/**
|
|
339
|
-
* Quantity purchased of this item.
|
|
340
|
-
*/
|
|
341
|
-
quantity?: number;
|
|
342
|
-
};
|
|
343
|
-
|
|
144
|
+
interface VersionedDataRecord extends DataRecord {
|
|
145
|
+
/**
|
|
146
|
+
* Schema version identifier for this record.
|
|
147
|
+
* Helps manage compatibility across client-server contracts.
|
|
148
|
+
* @example "2025-01-10"
|
|
149
|
+
*/
|
|
150
|
+
version: ApiVersion;
|
|
151
|
+
}
|
|
152
|
+
interface VCDataRecord extends VersionedDataRecord {
|
|
153
|
+
companyId: string;
|
|
154
|
+
}
|
|
344
155
|
/**
|
|
345
|
-
* Represents
|
|
346
|
-
*
|
|
156
|
+
* Represents either an absolute or a relative time constraint.
|
|
157
|
+
*
|
|
158
|
+
* - If using `date`, `secondsBefore` must not be present.
|
|
159
|
+
* - If using `secondsBefore`, `date` must not be present.
|
|
160
|
+
*
|
|
161
|
+
* @export
|
|
347
162
|
*/
|
|
348
|
-
type
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
*/
|
|
363
|
-
costs?: {
|
|
364
|
-
/**
|
|
365
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
366
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
367
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
368
|
-
*
|
|
369
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
370
|
-
*/
|
|
371
|
-
delivery: string;
|
|
372
|
-
/**
|
|
373
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
374
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
375
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
376
|
-
*
|
|
377
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
378
|
-
*/
|
|
379
|
-
discount: string;
|
|
380
|
-
/**
|
|
381
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
382
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
383
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
384
|
-
*
|
|
385
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
386
|
-
*/
|
|
387
|
-
fee: string;
|
|
388
|
-
/**
|
|
389
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
390
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
391
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
392
|
-
*
|
|
393
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
394
|
-
*/
|
|
395
|
-
subtotal: string;
|
|
396
|
-
/**
|
|
397
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
398
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
399
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
400
|
-
*
|
|
401
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
402
|
-
*/
|
|
403
|
-
tax: string;
|
|
404
|
-
/**
|
|
405
|
-
* A string representing a currency amount in the format `"USD,1000"` where:
|
|
406
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
407
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
408
|
-
*
|
|
409
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
410
|
-
*/
|
|
411
|
-
total: string;
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* List of applied coupons used in the order.
|
|
415
|
-
* Supports multiple entries based on organizer preferences.
|
|
416
|
-
*/
|
|
417
|
-
coupons?: Array<CouponSummary>;
|
|
418
|
-
/**
|
|
419
|
-
* ISO 8601 timestamp indicating when the record was created.
|
|
420
|
-
*/
|
|
421
|
-
created: string;
|
|
422
|
-
/**
|
|
423
|
-
* The currency code used for this order in ISO 4217 format.
|
|
424
|
-
*/
|
|
425
|
-
currency: string;
|
|
426
|
-
customer?: Partial_Customer_;
|
|
427
|
-
/**
|
|
428
|
-
* Partner-forwarded data (e.g. utm, session metadata).
|
|
429
|
-
*/
|
|
430
|
-
forwarded?: any;
|
|
431
|
-
/**
|
|
432
|
-
* Unique identifier for the record.
|
|
433
|
-
*/
|
|
434
|
-
id: string;
|
|
435
|
-
/**
|
|
436
|
-
* Items the user has added to their cart.
|
|
437
|
-
*/
|
|
438
|
-
items: Array<Partial_OrderItem_>;
|
|
439
|
-
/**
|
|
440
|
-
* Internal metadata, flags, debug hints, or experimental context.
|
|
441
|
-
*/
|
|
442
|
-
meta: Record<string, any>;
|
|
443
|
-
/**
|
|
444
|
-
* Stripe PaymentIntent client secret, used by frontend (e.g. Stripe.js).
|
|
445
|
-
* Required for completing the payment flow.
|
|
446
|
-
*/
|
|
447
|
-
paymentIntentClientSecret?: string;
|
|
448
|
-
/**
|
|
449
|
-
* Stripe PaymentIntent ID linked to this cart, if created.
|
|
450
|
-
* Used for confirming payment on the backend.
|
|
451
|
-
*/
|
|
452
|
-
paymentIntentId?: string;
|
|
453
|
-
status: CartSession.status;
|
|
454
|
-
/**
|
|
455
|
-
* Authenticated user ID, if available.
|
|
456
|
-
*/
|
|
457
|
-
uid: string;
|
|
458
|
-
/**
|
|
459
|
-
* Schema version identifier for this record.
|
|
460
|
-
* Helps manage compatibility across client-server contracts.
|
|
461
|
-
*/
|
|
462
|
-
version: string;
|
|
163
|
+
type TimeOrOffset = {
|
|
164
|
+
/**
|
|
165
|
+
* Absolute time in ISO 8601 format.
|
|
166
|
+
* @example "2025-06-30T23:59:59"
|
|
167
|
+
*/
|
|
168
|
+
date: string;
|
|
169
|
+
secondsBefore?: never;
|
|
170
|
+
} | {
|
|
171
|
+
/**
|
|
172
|
+
* Relative time before an anchor point (e.g. event start), in seconds.
|
|
173
|
+
* @example 3600
|
|
174
|
+
*/
|
|
175
|
+
secondsBefore: number;
|
|
176
|
+
date?: never;
|
|
463
177
|
};
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
178
|
+
/**
|
|
179
|
+
* @description A string representing a currency amount in the format `"USD,1000"` where:
|
|
180
|
+
* - `"USD"` is the 3-letter ISO currency code.
|
|
181
|
+
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
182
|
+
*
|
|
183
|
+
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
184
|
+
*
|
|
185
|
+
* @example "USD,0"
|
|
186
|
+
* @example "USD,100"
|
|
187
|
+
* @example "USD,1000"
|
|
188
|
+
*
|
|
189
|
+
* @pattern ^\w{3},\d+$
|
|
190
|
+
* @zod .string()
|
|
191
|
+
*/
|
|
192
|
+
type CurrencyAmount = string;
|
|
193
|
+
interface CostBase {
|
|
194
|
+
/**
|
|
195
|
+
* The base value of the cost. This is the value before any operations are applied.
|
|
196
|
+
* in OrderItem this is the cost of a single item.
|
|
197
|
+
*
|
|
198
|
+
* @example "USD,1000"
|
|
199
|
+
*/
|
|
200
|
+
cost: CurrencyAmount;
|
|
201
|
+
/**
|
|
202
|
+
* Delivery fee for a single item.
|
|
203
|
+
*
|
|
204
|
+
* @example "USD,1000"
|
|
205
|
+
*/
|
|
206
|
+
delivery: CurrencyAmount;
|
|
207
|
+
/**
|
|
208
|
+
* Fee per item.
|
|
209
|
+
* @example "USD,1000"
|
|
210
|
+
*/
|
|
211
|
+
fee: CurrencyAmount;
|
|
212
|
+
/**
|
|
213
|
+
* Total discount amount applied to this item.
|
|
214
|
+
* @example "USD,1000"
|
|
215
|
+
*/
|
|
216
|
+
tax: CurrencyAmount;
|
|
471
217
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
218
|
+
interface CostComponentCap {
|
|
219
|
+
op: "cap";
|
|
220
|
+
type: "percentage" | "absolute";
|
|
221
|
+
/**
|
|
222
|
+
* The value of the cap. If type is percentage, it is a percentage of the base value.
|
|
223
|
+
* If type is absolute, it is an absolute value.
|
|
224
|
+
*
|
|
225
|
+
* Absolute value is represented in the same denomination as the cost.
|
|
226
|
+
* i.e. if the cost is in cents, the absolute value should be in cents.
|
|
227
|
+
*
|
|
228
|
+
* percentage value is represented as a decimal.
|
|
229
|
+
* For example, 10% is represented as 0.1.
|
|
230
|
+
*/
|
|
231
|
+
value: number;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Represents a cost operation to be applied in a pricing formula.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* { op: '*', value: 0.9 }
|
|
238
|
+
*/
|
|
239
|
+
interface CostOp {
|
|
240
|
+
/**
|
|
241
|
+
* The operation to apply to the cost value.
|
|
242
|
+
*
|
|
243
|
+
* Allowed values:
|
|
244
|
+
* - "+" (addition)
|
|
245
|
+
* - "-" (subtraction)
|
|
246
|
+
* - "*" (multiplication)
|
|
247
|
+
* - "/" (division)
|
|
248
|
+
* @ignore
|
|
249
|
+
* @enum {string}
|
|
250
|
+
*/
|
|
251
|
+
op: "+" | "-" | "*" | "/";
|
|
252
|
+
/**
|
|
253
|
+
* The operand value used in the cost operation.
|
|
254
|
+
*
|
|
255
|
+
* The unit should match the denomination of the cost.
|
|
256
|
+
* For example, if cost is expressed in cents, this value should also be in cents.
|
|
257
|
+
*
|
|
258
|
+
* @example 100
|
|
259
|
+
*/
|
|
260
|
+
value: number;
|
|
493
261
|
}
|
|
494
|
-
|
|
495
262
|
/**
|
|
496
263
|
* A set of comparison operators used for evaluating conditional expressions.
|
|
497
264
|
*
|
|
@@ -502,62 +269,330 @@ declare namespace CostComponentCap {
|
|
|
502
269
|
* - '<=' (less than or equal to)
|
|
503
270
|
* - '>' (greater than)
|
|
504
271
|
* - '>=' (greater than or equal to)
|
|
272
|
+
* @enum {string}
|
|
273
|
+
* @ignore
|
|
505
274
|
*/
|
|
506
|
-
|
|
507
|
-
|
|
275
|
+
type EqualOperator = "==" | "!=" | "<" | "<=" | ">" | ">=";
|
|
276
|
+
interface CostComponentRuleCondition {
|
|
277
|
+
/**
|
|
278
|
+
* The field to evaluate the condition against.
|
|
279
|
+
* For example, "item.price" or "order.total".
|
|
280
|
+
* The field should be a valid path to the field in the cost component base.
|
|
281
|
+
*/
|
|
282
|
+
field: string;
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
*/
|
|
286
|
+
operator: EqualOperator;
|
|
287
|
+
/**
|
|
288
|
+
* Can be a value such as number, currencyAmount, an ISO date string, etc...
|
|
289
|
+
*/
|
|
290
|
+
value: string | number | any;
|
|
291
|
+
/**
|
|
292
|
+
* evaluator, will define a function or endpoint to evaluate the condition.
|
|
293
|
+
*/
|
|
294
|
+
eval?: string;
|
|
508
295
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
296
|
+
interface CostComponentRule {
|
|
297
|
+
/**
|
|
298
|
+
* Friendly name of the rule.
|
|
299
|
+
*/
|
|
300
|
+
name: string;
|
|
301
|
+
/**
|
|
302
|
+
* The rule will be applied to the cost component if the conditions are met.
|
|
303
|
+
*/
|
|
304
|
+
conditions: CostComponentRuleCondition[];
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Represents the costs associated with an offering.
|
|
308
|
+
*
|
|
309
|
+
* @property {CurrencyAmount} delivery - The delivery cost.
|
|
310
|
+
* @property {CurrencyAmount} cost - The cost amount. In an order item, this is the cost of a single item.
|
|
311
|
+
* @property {CurrencyAmount} fee - The fee amount. In an order item, this is the fee of a single item.
|
|
312
|
+
* @property {CurrencyAmount} tax - The tax amount. In an order item, this is the tax per a single item.
|
|
313
|
+
* @property {CurrencyAmount} gross - The gross amount, which is the cost plus fee minus discount, not including tax.
|
|
314
|
+
* @property {CurrencyAmount} total - The total cost including tax.
|
|
315
|
+
*/
|
|
316
|
+
interface OfferingCosts extends CostBase {
|
|
317
|
+
/**
|
|
318
|
+
* cost + fee - discount , not including tax
|
|
319
|
+
*
|
|
320
|
+
* In an order item, this is the gross cost of a single item.
|
|
321
|
+
*
|
|
322
|
+
* @x-faker {"random.arrayElement": ["\"USD,100000\"", "\"USD,25000\""]}
|
|
323
|
+
*/
|
|
324
|
+
gross: CurrencyAmount;
|
|
325
|
+
/**
|
|
326
|
+
* total cost including tax
|
|
327
|
+
*
|
|
328
|
+
* In an order item, this is the total cost * Quantity.
|
|
329
|
+
*/
|
|
330
|
+
total: CurrencyAmount;
|
|
331
|
+
}
|
|
332
|
+
type CostBucket = "item" | "fee" | "tax" | "delivery";
|
|
333
|
+
interface CostComponent {
|
|
334
|
+
id: string;
|
|
335
|
+
name: string;
|
|
336
|
+
details?: any;
|
|
337
|
+
currency: string | "*";
|
|
338
|
+
base: "order" | "item" | string;
|
|
339
|
+
bucket: CostBucket;
|
|
340
|
+
recipient: "organizer" | "platform" | "tax" | string;
|
|
341
|
+
payer: "attendee" | "organizer";
|
|
342
|
+
/**
|
|
343
|
+
* @ignore
|
|
344
|
+
*/
|
|
345
|
+
ops: CostOp[];
|
|
346
|
+
cap?: CostComponentCap;
|
|
347
|
+
rules: CostComponentRule[];
|
|
348
|
+
version: "2025-03-25";
|
|
349
|
+
}
|
|
350
|
+
interface CalculatedCostComponent extends Omit<CostComponent, "ops" | "cap" | "rules" | "details" | "currency"> {
|
|
351
|
+
cost: CurrencyAmount;
|
|
352
|
+
value: number;
|
|
353
|
+
discount: null;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* @zod .string()
|
|
357
|
+
*/
|
|
358
|
+
type OfferingType = "admission" | "package" | "skip" | "drink" | "ticket" | "tc-ticket" | "merch" | "donation" | "membership" | "voucher" | "service" | "other";
|
|
359
|
+
type ActiveOfferingStatus = "live" | "hidden" | "sold-out";
|
|
360
|
+
type OfferingStatus = ActiveOfferingStatus | "draft" | "deleted" | "unavailable";
|
|
361
|
+
type PriceCategory = "donation" | "free" | "paid" | "other";
|
|
362
|
+
interface Offering extends DataRecord {
|
|
363
|
+
/**
|
|
364
|
+
* Offering name, can be ticket name, vaucher name, etc...
|
|
365
|
+
* @example "General Admission" (ticket) | "T-shirt" (merch) | "Donation" (donation) | "Membership" (membership) | "Gift Card" (voucher) | "Service Fee" (service) | "Other" (other)
|
|
366
|
+
*
|
|
367
|
+
* @x-faker commerce.productName
|
|
368
|
+
*/
|
|
369
|
+
name: string;
|
|
370
|
+
type: OfferingType;
|
|
371
|
+
/**
|
|
372
|
+
* @description The maximum number of tickets that can be sold for this offering.
|
|
373
|
+
*
|
|
374
|
+
* @example 100
|
|
375
|
+
*
|
|
376
|
+
* @x-faker {"datatype.number": { "min": 10, "max": 100 }}
|
|
377
|
+
*/
|
|
378
|
+
capacity: number;
|
|
379
|
+
quantitySold: number;
|
|
380
|
+
status: OfferingStatus;
|
|
381
|
+
priceCategory: PriceCategory;
|
|
382
|
+
sorting: number;
|
|
383
|
+
/**
|
|
384
|
+
* @ignore
|
|
385
|
+
*/
|
|
386
|
+
schedule?: Schedule;
|
|
387
|
+
description?: string;
|
|
388
|
+
instructions?: string;
|
|
389
|
+
/**
|
|
390
|
+
* @description Maximum number of tickets that can be purchased in a single order.
|
|
391
|
+
*
|
|
392
|
+
* @example 10
|
|
393
|
+
*
|
|
394
|
+
* @x-faker {"datatype.number": { "min": 4, "max": 15 }}
|
|
395
|
+
*/
|
|
396
|
+
maximumQuantity: number;
|
|
397
|
+
/**
|
|
398
|
+
* @description Minimum number of tickets that can be purchased in a single order.
|
|
399
|
+
*
|
|
400
|
+
* @example 1
|
|
401
|
+
*
|
|
402
|
+
* @x-faker {"datatype.number": { "min": 1, "max": 4 }}
|
|
403
|
+
*/
|
|
404
|
+
minimumQuantity: number;
|
|
405
|
+
package?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* @description Items, products ,and vouchers included in this offering.
|
|
408
|
+
*
|
|
409
|
+
*
|
|
410
|
+
* @x-faker {"array.length": 0}
|
|
411
|
+
*/
|
|
412
|
+
included?: PackageInclude[];
|
|
413
|
+
/**
|
|
414
|
+
* Any constraints that apply to this offering.
|
|
415
|
+
* it can be time limit, quantity limit, etc...
|
|
416
|
+
*/
|
|
417
|
+
constraints?: any;
|
|
418
|
+
hidden: boolean;
|
|
419
|
+
order_confirmation_message?: string | null;
|
|
420
|
+
costs: OfferingCosts;
|
|
421
|
+
/**
|
|
422
|
+
* Describe fees and other costs associated with purchasing tickets
|
|
423
|
+
* to this offering
|
|
424
|
+
*
|
|
425
|
+
* @ignore
|
|
426
|
+
*/
|
|
427
|
+
costComponents?: CostComponent[];
|
|
428
|
+
}
|
|
429
|
+
interface PackageInclude {
|
|
430
|
+
id: string;
|
|
431
|
+
quantity: number;
|
|
432
|
+
type: OfferingType;
|
|
433
|
+
description: string;
|
|
434
|
+
ref?: any;
|
|
435
|
+
}
|
|
436
|
+
interface Ticket extends Omit<Offering, "hidden" | "constraints" | "type"> {
|
|
437
|
+
category: string;
|
|
438
|
+
type: "admission" | "package" | "admission.tableCommitment";
|
|
439
|
+
source: string;
|
|
440
|
+
display_name?: string;
|
|
441
|
+
description?: string;
|
|
442
|
+
ticketParentId?: string;
|
|
443
|
+
salesEnd: string;
|
|
444
|
+
salesStart: string;
|
|
445
|
+
parentId?: string;
|
|
446
|
+
refId?: string;
|
|
447
|
+
}
|
|
448
|
+
interface BuzzBuilder {
|
|
449
|
+
countLabel: string;
|
|
450
|
+
profiles: {
|
|
451
|
+
id: string;
|
|
452
|
+
name: string;
|
|
453
|
+
photoURL: string;
|
|
454
|
+
}[];
|
|
455
|
+
}
|
|
456
|
+
interface EventFeature {
|
|
457
|
+
id: string;
|
|
458
|
+
title: string;
|
|
459
|
+
enabled: boolean;
|
|
460
|
+
order: number;
|
|
461
|
+
widgetUri: string;
|
|
462
|
+
iconName?: string;
|
|
463
|
+
logoUri?: string;
|
|
464
|
+
description: string;
|
|
465
|
+
type: string;
|
|
466
|
+
version?: string;
|
|
467
|
+
key: string;
|
|
468
|
+
meta?: any;
|
|
469
|
+
data: any;
|
|
470
|
+
}
|
|
471
|
+
interface Address {
|
|
472
|
+
address_1: string;
|
|
473
|
+
address_2?: string;
|
|
474
|
+
city: string;
|
|
475
|
+
country: string;
|
|
476
|
+
premise?: string;
|
|
477
|
+
formattedAddress?: string;
|
|
478
|
+
localized_address_display?: string;
|
|
479
|
+
localized_area_display?: string;
|
|
480
|
+
localized_multi_line_address_display?: string[];
|
|
481
|
+
postal_code: string;
|
|
482
|
+
region: string;
|
|
557
483
|
}
|
|
558
|
-
|
|
559
484
|
/**
|
|
560
|
-
*
|
|
485
|
+
* A simple point geometry consisting of latitude and longitude.
|
|
486
|
+
*
|
|
487
|
+
* @typedef {Object} GeometryPoint
|
|
488
|
+
* @property {number} lat - Latitude of the point.
|
|
489
|
+
* @property {number} lng - Longitude of the point.
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* {
|
|
493
|
+
* lat: 40.7128,
|
|
494
|
+
* lng: -74.0060
|
|
495
|
+
* }
|
|
496
|
+
*/
|
|
497
|
+
interface GeometryPoint {
|
|
498
|
+
lat: number;
|
|
499
|
+
lng: number;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Represents the geometry of a location, including optional viewport and zoom level.
|
|
503
|
+
*
|
|
504
|
+
* @typedef {Object} LocationGeometry
|
|
505
|
+
* @property {number} lat - Latitude of the location.
|
|
506
|
+
* @property {number} lng - Longitude of the location.
|
|
507
|
+
* @property {number} [zoom] - Optional zoom level representing map detail.
|
|
508
|
+
* @property {{ northeast: GeometryPoint, southwest: GeometryPoint }} [viewport] - Optional viewport rectangle surrounding the location.
|
|
509
|
+
* @property {string} [vicinity] - Optional vicinity description.
|
|
510
|
+
* @property {string} [region] - Optional region.
|
|
511
|
+
* @property {string} [locality] - Optional locality.
|
|
512
|
+
* @property {string} [geoHash] - Optional geohash for spatial indexing.
|
|
513
|
+
*
|
|
514
|
+
* @example
|
|
515
|
+
* {
|
|
516
|
+
* lat: 37.7749,
|
|
517
|
+
* lng: -122.4194,
|
|
518
|
+
* zoom: 15,
|
|
519
|
+
* viewport: {
|
|
520
|
+
* northeast: { lat: 37.785, lng: -122.41 },
|
|
521
|
+
* southwest: { lat: 37.765, lng: -122.43 }
|
|
522
|
+
* },
|
|
523
|
+
* vicinity: "Near Mission District",
|
|
524
|
+
* region: "California",
|
|
525
|
+
* locality: "San Francisco",
|
|
526
|
+
* geoHash: "9q8yy"
|
|
527
|
+
* }
|
|
528
|
+
*/
|
|
529
|
+
interface LocationGeometry extends GeometryPoint {
|
|
530
|
+
zoom?: number;
|
|
531
|
+
viewport?: {
|
|
532
|
+
northeast: GeometryPoint;
|
|
533
|
+
southwest: GeometryPoint;
|
|
534
|
+
};
|
|
535
|
+
vicinity?: string;
|
|
536
|
+
region?: string;
|
|
537
|
+
locality?: string;
|
|
538
|
+
geoHash?: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* A structured representation of a physical location, including address and coordinates.
|
|
542
|
+
*
|
|
543
|
+
* @typedef {Object} Location
|
|
544
|
+
* @property {string | null} venueId - The ID of the venue associated with this location.
|
|
545
|
+
* @property {string | null} placeId - The Google Place ID associated with this location.
|
|
546
|
+
* @property {string} name - Name of the location (e.g., venue or custom name).
|
|
547
|
+
* @property {LocationGeometry | null} geometry - Geospatial data including lat/lng, zoom, and viewport.
|
|
548
|
+
* @property {Address | null} address - Structured postal address.
|
|
549
|
+
* @property {string} [timezone] - IANA time zone (e.g., "America/New_York").
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* {
|
|
553
|
+
* venueId: "abc123",
|
|
554
|
+
* placeId: "ChIJVXealLU_xkcRja_At0z9AGY",
|
|
555
|
+
* name: "The Fillmore",
|
|
556
|
+
* geometry: {
|
|
557
|
+
* lat: 37.784,
|
|
558
|
+
* lng: -122.433,
|
|
559
|
+
* zoom: 14,
|
|
560
|
+
* viewport: {
|
|
561
|
+
* northeast: { lat: 37.788, lng: -122.429 },
|
|
562
|
+
* southwest: { lat: 37.780, lng: -122.437 }
|
|
563
|
+
* }
|
|
564
|
+
* },
|
|
565
|
+
* address: {
|
|
566
|
+
* address_1: "1805 Geary Blvd",
|
|
567
|
+
* city: "San Francisco",
|
|
568
|
+
* state: "CA",
|
|
569
|
+
* postalCode: "94115",
|
|
570
|
+
* country: "USA"
|
|
571
|
+
* },
|
|
572
|
+
* timezone: "America/Los_Angeles"
|
|
573
|
+
* }
|
|
574
|
+
*/
|
|
575
|
+
interface Location {
|
|
576
|
+
venueId: string | null;
|
|
577
|
+
placeId: string | null;
|
|
578
|
+
name: string;
|
|
579
|
+
geometry: LocationGeometry | null;
|
|
580
|
+
address: Address | null;
|
|
581
|
+
timezone?: string;
|
|
582
|
+
}
|
|
583
|
+
interface VenueBase {
|
|
584
|
+
id: string;
|
|
585
|
+
name: string;
|
|
586
|
+
formattedAddress: string;
|
|
587
|
+
placeId?: string | null;
|
|
588
|
+
tz: string;
|
|
589
|
+
logo: Photo | null;
|
|
590
|
+
public: boolean;
|
|
591
|
+
address: Address | null;
|
|
592
|
+
slug: string | null;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* @description Status of the event lifecycle.
|
|
561
596
|
*
|
|
562
597
|
* - `archived`: The event is archived and no longer visible in listings.
|
|
563
598
|
* - `draft`: The event is still being edited and not yet published.
|
|
@@ -567,289 +602,579 @@ declare namespace CostComponent {
|
|
|
567
602
|
* - `completed`: The event has concluded successfully and is finalized.
|
|
568
603
|
* - `canceled`: The event was canceled and is no longer active.
|
|
569
604
|
*/
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
605
|
+
type EventStatus = "archived" | "draft" | "live" | "started" | "ended" | "completed" | "canceled";
|
|
606
|
+
interface EventBase {
|
|
607
|
+
id: string;
|
|
608
|
+
/**
|
|
609
|
+
* @example "Spring Concert"
|
|
610
|
+
* @faker name.firstName
|
|
611
|
+
* @x-faker name.firstName
|
|
612
|
+
*/
|
|
613
|
+
name: string;
|
|
614
|
+
summary: string;
|
|
615
|
+
companyId: string;
|
|
616
|
+
/**
|
|
617
|
+
* @description The timezone in which the event is taking place.
|
|
618
|
+
* @example "America/New_York"
|
|
619
|
+
* @example "Europe/London"
|
|
620
|
+
* @example "Asia/Tokyo"
|
|
621
|
+
*/
|
|
622
|
+
tz: string;
|
|
623
|
+
/**
|
|
624
|
+
* @description The start date and time of the event in ISO 8601 format.
|
|
625
|
+
* @example "2023-10-01T12:00:00Z"
|
|
626
|
+
*/
|
|
627
|
+
start: string;
|
|
628
|
+
/**
|
|
629
|
+
* @description The end date and time of the event in ISO 8601 format.
|
|
630
|
+
* @example "2023-10-01T14:00:00Z"
|
|
631
|
+
*/
|
|
632
|
+
end: string;
|
|
633
|
+
isSeries?: boolean;
|
|
634
|
+
/**
|
|
635
|
+
* @description The status of the event in its lifecycle.
|
|
636
|
+
* @example "draft"
|
|
637
|
+
* @example "live"
|
|
638
|
+
* @example "ended"
|
|
639
|
+
*/
|
|
640
|
+
status: EventStatus;
|
|
641
|
+
/**
|
|
642
|
+
* @x-faker { url: faker.image.imageUrl() }
|
|
643
|
+
*/
|
|
644
|
+
flyer?: Photo | null;
|
|
645
|
+
venue?: VenueBase | null;
|
|
646
|
+
/**
|
|
647
|
+
* @description Curerncy used for the event.
|
|
648
|
+
* @example "USD"
|
|
649
|
+
*/
|
|
650
|
+
currency: string;
|
|
651
|
+
/**
|
|
652
|
+
* @description Is the event public?
|
|
653
|
+
* @example true
|
|
654
|
+
*/
|
|
655
|
+
public: boolean;
|
|
656
|
+
location?: Location;
|
|
578
657
|
}
|
|
579
|
-
|
|
580
|
-
type GeometryPoint = {
|
|
581
|
-
lat: number;
|
|
582
|
-
lng: number;
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
type LocationGeometry = {
|
|
586
|
-
geoHash?: string;
|
|
587
|
-
lat: number;
|
|
588
|
-
lng: number;
|
|
589
|
-
locality?: string;
|
|
590
|
-
region?: string;
|
|
591
|
-
vicinity?: string;
|
|
592
|
-
viewport?: {
|
|
593
|
-
northeast: GeometryPoint;
|
|
594
|
-
southwest: GeometryPoint;
|
|
595
|
-
};
|
|
596
|
-
zoom?: number;
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
type Location = {
|
|
600
|
-
address: Address;
|
|
601
|
-
geometry: LocationGeometry;
|
|
602
|
-
name: string;
|
|
603
|
-
placeId: string;
|
|
604
|
-
timezone?: string;
|
|
605
|
-
venueId: string;
|
|
606
|
-
};
|
|
607
|
-
|
|
608
658
|
/**
|
|
609
|
-
*
|
|
659
|
+
* @openapi
|
|
660
|
+
* @description EventProfile respresent a public view of an event
|
|
610
661
|
*/
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
* This is the default image URL to be used when no other resolution is specified.
|
|
631
|
-
*/
|
|
632
|
-
url: string;
|
|
633
|
-
/**
|
|
634
|
-
* Width of the image in pixels.
|
|
635
|
-
*/
|
|
636
|
-
width?: number;
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
type VenueBase = {
|
|
640
|
-
address: Address;
|
|
641
|
-
formattedAddress: string;
|
|
642
|
-
id: string;
|
|
643
|
-
logo: Photo;
|
|
644
|
-
name: string;
|
|
645
|
-
placeId?: string;
|
|
646
|
-
public: boolean;
|
|
647
|
-
slug: string;
|
|
648
|
-
tz: string;
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
type EventFeature = {
|
|
652
|
-
data: any;
|
|
653
|
-
description: string;
|
|
654
|
-
enabled: boolean;
|
|
655
|
-
iconName?: string;
|
|
656
|
-
id: string;
|
|
657
|
-
key: string;
|
|
658
|
-
logoUri?: string;
|
|
659
|
-
meta?: any;
|
|
660
|
-
order: number;
|
|
661
|
-
title: string;
|
|
662
|
-
type: string;
|
|
663
|
-
version?: string;
|
|
664
|
-
widgetUri: string;
|
|
665
|
-
};
|
|
666
|
-
|
|
662
|
+
interface EventProfile extends EventBase {
|
|
663
|
+
meta?: any;
|
|
664
|
+
organizer: any;
|
|
665
|
+
url?: string;
|
|
666
|
+
slug: string;
|
|
667
|
+
channels: string[];
|
|
668
|
+
description: MultipartText;
|
|
669
|
+
widgets: EventFeature[];
|
|
670
|
+
ticketPrices: string[];
|
|
671
|
+
buzzBuilder?: BuzzBuilder | null;
|
|
672
|
+
venue?: VenueBase | null;
|
|
673
|
+
tags: string[];
|
|
674
|
+
searchTags: string[];
|
|
675
|
+
sections: string[];
|
|
676
|
+
priceRange?: {
|
|
677
|
+
min?: string;
|
|
678
|
+
max?: string;
|
|
679
|
+
};
|
|
680
|
+
}
|
|
667
681
|
/**
|
|
668
|
-
*
|
|
682
|
+
* Represents a discount coupon that can be applied to one or more offerings in an event platform.
|
|
683
|
+
*
|
|
684
|
+
* @export
|
|
669
685
|
*/
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
686
|
+
interface Coupon extends VersionedDataRecord {
|
|
687
|
+
/**
|
|
688
|
+
* ID of the company that issued this coupon.
|
|
689
|
+
* @example "company_123abc"
|
|
690
|
+
*/
|
|
691
|
+
companyId: string;
|
|
692
|
+
/**
|
|
693
|
+
* Internal description for the coupon.
|
|
694
|
+
* This is not necessarily visible to users.
|
|
695
|
+
* @example "Early bird discount for spring events"
|
|
696
|
+
*/
|
|
697
|
+
description: string;
|
|
698
|
+
/**
|
|
699
|
+
* The code used to redeem this coupon during checkout.
|
|
700
|
+
* For public or coded discounts.
|
|
701
|
+
* @example "SPRING2025"
|
|
702
|
+
*/
|
|
703
|
+
code: string;
|
|
704
|
+
/**
|
|
705
|
+
* Type of coupon — determines how it's distributed or applied.
|
|
706
|
+
* @example "coded"
|
|
707
|
+
*/
|
|
708
|
+
type: "access" | "coded" | "public" | "hold";
|
|
709
|
+
/**
|
|
710
|
+
* Fixed amount to deduct from the order total.
|
|
711
|
+
* This is a currency-less value that matches the event or order currency.
|
|
712
|
+
* Example: `10.00` = $10.00 off.
|
|
713
|
+
* @minimum 0
|
|
714
|
+
* @maximum 99999
|
|
715
|
+
* @example 10.0
|
|
716
|
+
*/
|
|
717
|
+
amountOff: number;
|
|
718
|
+
/**
|
|
719
|
+
* Percentage to deduct from the item or order total.
|
|
720
|
+
* Range is 0–100. Use 0 for no percentage-based discount.
|
|
721
|
+
* @minimum 0
|
|
722
|
+
* @maximum 100
|
|
723
|
+
* @example 20.0
|
|
724
|
+
*/
|
|
725
|
+
percentOff: number;
|
|
726
|
+
/**
|
|
727
|
+
* Total number of times this coupon can be used.
|
|
728
|
+
* A value of `0` means unlimited usage.
|
|
729
|
+
* @example 100
|
|
730
|
+
*/
|
|
731
|
+
limit: number;
|
|
732
|
+
/**
|
|
733
|
+
* Number of times this coupon has been redeemed.
|
|
734
|
+
* Read-only field.
|
|
735
|
+
* @readonly
|
|
736
|
+
* @example 42
|
|
737
|
+
*/
|
|
738
|
+
quantitySold: number;
|
|
739
|
+
/**
|
|
740
|
+
* List of offering IDs (e.g., ticket classes) this coupon applies to.
|
|
741
|
+
* If empty, the coupon applies to all eligible offerings in its context.
|
|
742
|
+
* @example ["off_123abc", "off_456def"]
|
|
743
|
+
*/
|
|
744
|
+
offeringIds: string[];
|
|
745
|
+
/**
|
|
746
|
+
* List of context IDs (e.g., event, venue, or organizer) this coupon is valid for.
|
|
747
|
+
* Follows the format: "evt_xxx", "org_xxx", etc.
|
|
748
|
+
* @example ["evt_abc123", "org_def456"]
|
|
749
|
+
*/
|
|
750
|
+
contextIds: ContextId[];
|
|
751
|
+
/**
|
|
752
|
+
* Time-based constraints that control when the coupon is active and when it expires.
|
|
753
|
+
* Supports absolute dates or relative time offsets (in seconds) from event start.
|
|
754
|
+
*
|
|
755
|
+
* - If `start` is omitted, the coupon is valid immediately.
|
|
756
|
+
* - If `end` is omitted, the coupon remains valid until the event ends.
|
|
757
|
+
*
|
|
758
|
+
* @example {
|
|
759
|
+
* start: { date: "2025-04-01T00:00:00" },
|
|
760
|
+
* end: { secondsBefore: 3600 }
|
|
761
|
+
* }
|
|
762
|
+
*/
|
|
763
|
+
constraints: {
|
|
764
|
+
start?: TimeOrOffset;
|
|
765
|
+
end?: TimeOrOffset;
|
|
766
|
+
};
|
|
767
|
+
/**
|
|
768
|
+
* Current status of the coupon for administrative purposes.
|
|
769
|
+
* Determines whether it can be redeemed at checkout.
|
|
770
|
+
* @example "active"
|
|
771
|
+
*/
|
|
772
|
+
status: "active" | "expired" | "disabled" | "sold_out";
|
|
773
|
+
/**
|
|
774
|
+
* Schema version identifier.
|
|
775
|
+
* Used to ensure compatibility between coupon formats.
|
|
776
|
+
* @example "2025-01-10"
|
|
777
|
+
*/
|
|
778
|
+
version: ApiVersion;
|
|
779
|
+
}
|
|
689
780
|
/**
|
|
690
|
-
*
|
|
781
|
+
* Captures metadata and request/session context at the time the cart is created.
|
|
782
|
+
* Supports fraud detection, attribution, analytics, and partner session tracking.
|
|
783
|
+
*
|
|
784
|
+
* This interface is extensible — additional custom fields may be included as needed.
|
|
785
|
+
*
|
|
786
|
+
* @export
|
|
691
787
|
*/
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
widgets: Array<EventFeature>;
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
declare enum OfferingStatus {
|
|
741
|
-
DELETED = "deleted",
|
|
742
|
-
DRAFT = "draft",
|
|
743
|
-
HIDDEN = "hidden",
|
|
744
|
-
LIVE = "live",
|
|
745
|
-
SOLD_OUT = "sold-out",
|
|
746
|
-
UNAVAILABLE = "unavailable"
|
|
788
|
+
interface OrderContext {
|
|
789
|
+
/**
|
|
790
|
+
* IP addresses associated with the user request.
|
|
791
|
+
* Typically includes forwarded IPs and direct client IP.
|
|
792
|
+
* @example ["203.0.113.1", "10.0.0.1"]
|
|
793
|
+
*/
|
|
794
|
+
ipAddresses: string[];
|
|
795
|
+
/**
|
|
796
|
+
* Raw User-Agent header from the client request.
|
|
797
|
+
* @example "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
|
|
798
|
+
*/
|
|
799
|
+
userAgent: string;
|
|
800
|
+
/**
|
|
801
|
+
* The referring URL from which the cart or checkout was initiated.
|
|
802
|
+
* May be a partner site, marketing page, or event listing.
|
|
803
|
+
* @example "https://partner.example.com/tickets/event123"
|
|
804
|
+
*/
|
|
805
|
+
referrer: string;
|
|
806
|
+
/**
|
|
807
|
+
* Authenticated user ID, or null for anonymous guests.
|
|
808
|
+
* @example "uid_456def"
|
|
809
|
+
*/
|
|
810
|
+
uid: string | null;
|
|
811
|
+
/**
|
|
812
|
+
* The unique cart session ID assigned at the time the cart was created.
|
|
813
|
+
* Helps track cart attribution across systems.
|
|
814
|
+
* @example "cart_sess_abc123"
|
|
815
|
+
*/
|
|
816
|
+
cartSessionId: string;
|
|
817
|
+
/**
|
|
818
|
+
* (Optional) Origin domain name if embedded or white-labeled.
|
|
819
|
+
* Can help identify partner portals or iframe referrers.
|
|
820
|
+
* @example "examplepartner.com"
|
|
821
|
+
*/
|
|
822
|
+
originDomain?: string;
|
|
823
|
+
/**
|
|
824
|
+
* (Optional) Campaign ID, UTM source, or tracking label.
|
|
825
|
+
* Useful for affiliate and analytics systems.
|
|
826
|
+
* @example "utm_campaign=spring_launch"
|
|
827
|
+
*/
|
|
828
|
+
trackingId?: string;
|
|
829
|
+
/**
|
|
830
|
+
* Allows custom fields for analytics, partners, or experiment data.
|
|
831
|
+
*/
|
|
832
|
+
[custom: string]: unknown;
|
|
747
833
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
834
|
+
/**
|
|
835
|
+
* Cost breakdown for a specific item in the order.
|
|
836
|
+
* Extends the standard `OfferingCosts` with totals calculated for quantity and discounts.
|
|
837
|
+
*
|
|
838
|
+
* @export
|
|
839
|
+
*/
|
|
840
|
+
interface OrderItemCosts extends OfferingCosts {
|
|
841
|
+
/**
|
|
842
|
+
* Total cost of tickets before taxes, fees, and discounts.
|
|
843
|
+
* @example { amount: 5000, currency: "USD" }
|
|
844
|
+
*/
|
|
845
|
+
subtotal: CurrencyAmount;
|
|
846
|
+
/**
|
|
847
|
+
* Total discount amount applied to this item.
|
|
848
|
+
* @example { amount: 1000, currency: "USD" }
|
|
849
|
+
*/
|
|
850
|
+
discount: CurrencyAmount;
|
|
851
|
+
/**
|
|
852
|
+
* Total price before discounts.
|
|
853
|
+
* Equal to subtotal + fee, before subtracting discount.
|
|
854
|
+
* @example { amount: 6000, currency: "USD" }
|
|
855
|
+
*/
|
|
856
|
+
preDiscount: CurrencyAmount;
|
|
762
857
|
}
|
|
763
|
-
|
|
764
858
|
/**
|
|
765
|
-
*
|
|
859
|
+
* Represents an individual item within an order.
|
|
860
|
+
*
|
|
861
|
+
* @export
|
|
766
862
|
*/
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
description?: string;
|
|
810
|
-
display_name?: string;
|
|
811
|
-
/**
|
|
812
|
-
* Unique identifier for the record.
|
|
813
|
-
*/
|
|
814
|
-
id: string;
|
|
815
|
-
included?: Array<PackageInclude>;
|
|
816
|
-
instructions?: string;
|
|
817
|
-
maximumQuantity: number;
|
|
818
|
-
minimumQuantity: number;
|
|
819
|
-
/**
|
|
820
|
-
* Offering name, can be ticket name, vaucher name, etc...
|
|
821
|
-
*/
|
|
822
|
-
name: string;
|
|
823
|
-
order_confirmation_message?: string;
|
|
824
|
-
package?: boolean;
|
|
825
|
-
parentId?: string;
|
|
826
|
-
priceCategory: PriceCategory;
|
|
827
|
-
quantitySold: number;
|
|
828
|
-
refId?: string;
|
|
829
|
-
salesEnd: string;
|
|
830
|
-
salesStart: string;
|
|
831
|
-
schedule?: Schedule;
|
|
832
|
-
sorting: number;
|
|
833
|
-
source: string;
|
|
834
|
-
status: OfferingStatus;
|
|
835
|
-
ticketParentId?: string;
|
|
836
|
-
type: Ticket.type;
|
|
837
|
-
};
|
|
838
|
-
declare namespace Ticket {
|
|
839
|
-
enum type {
|
|
840
|
-
ADMISSION = "admission",
|
|
841
|
-
ADMISSION_TABLE_COMMITMENT = "admission.tableCommitment",
|
|
842
|
-
PACKAGE = "package"
|
|
843
|
-
}
|
|
863
|
+
interface OrderItem {
|
|
864
|
+
/**
|
|
865
|
+
* Unique ID for this order item.
|
|
866
|
+
* @example "item_abc123"
|
|
867
|
+
*/
|
|
868
|
+
id: string;
|
|
869
|
+
/**
|
|
870
|
+
* Type of offering (e.g., ticket, package, merch).
|
|
871
|
+
* @example "ticket"
|
|
872
|
+
*/
|
|
873
|
+
offeringType: OfferingType;
|
|
874
|
+
/**
|
|
875
|
+
* ID of the offering purchased.
|
|
876
|
+
* @example "evt_abc123_off_001"
|
|
877
|
+
*/
|
|
878
|
+
offeringId: string;
|
|
879
|
+
/**
|
|
880
|
+
* Quantity purchased of this item.
|
|
881
|
+
* @example 2
|
|
882
|
+
*/
|
|
883
|
+
quantity: number;
|
|
884
|
+
/**
|
|
885
|
+
* Full cost breakdown for this item.
|
|
886
|
+
*/
|
|
887
|
+
costs: OrderItemCosts;
|
|
888
|
+
/**
|
|
889
|
+
* If this item is included as part of a package, this is the ID of the parent item.
|
|
890
|
+
* Otherwise, null.
|
|
891
|
+
* @example null
|
|
892
|
+
*/
|
|
893
|
+
includedWithItemId: string | null;
|
|
894
|
+
/**
|
|
895
|
+
* Breakdown of cost components (e.g., base, service fee, delivery).
|
|
896
|
+
*/
|
|
897
|
+
costComponents: CalculatedCostComponent[];
|
|
898
|
+
/**
|
|
899
|
+
* Any relevant metadata associated with this item.
|
|
900
|
+
* This can include custom fields or additional information.
|
|
901
|
+
* @example { "customField": "value" }
|
|
902
|
+
*/
|
|
903
|
+
meta: any;
|
|
904
|
+
offering: OrderItemOffering;
|
|
844
905
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
906
|
+
interface OrderItemOffering extends Pick<Offering, "name" | "costs" | "type"> {
|
|
907
|
+
/**
|
|
908
|
+
* doc assicated with this offering in the DB.
|
|
909
|
+
*
|
|
910
|
+
* @example "events/1234567890/tickets/0987654321"
|
|
911
|
+
*/
|
|
912
|
+
docPath: string;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Person interface
|
|
916
|
+
*/
|
|
917
|
+
interface Person {
|
|
918
|
+
name: string;
|
|
919
|
+
photoURL?: string | null;
|
|
920
|
+
displayName: string;
|
|
921
|
+
first: string;
|
|
922
|
+
last: string;
|
|
923
|
+
gender: null | string | "male" | "female" | "other";
|
|
924
|
+
birthdate?: string | null;
|
|
925
|
+
age?: number;
|
|
926
|
+
}
|
|
927
|
+
interface PersonContact {
|
|
928
|
+
email: string | null;
|
|
929
|
+
phone: string | null;
|
|
930
|
+
}
|
|
931
|
+
type Customer = Person & PersonContact & {
|
|
932
|
+
uid: string | null;
|
|
852
933
|
};
|
|
934
|
+
type CouponSummary = Pick<Coupon, "id" | "code" | "amountOff" | "percentOff" | "offeringIds">;
|
|
935
|
+
type OrderStatus = "placed" | "completed" | "attending" | "cancelled" | "refunded" | "started" | "pending" | "abandoned";
|
|
936
|
+
interface OrderCosts {
|
|
937
|
+
subtotal: CurrencyAmount;
|
|
938
|
+
fee: CurrencyAmount;
|
|
939
|
+
tax: CurrencyAmount;
|
|
940
|
+
discount: CurrencyAmount;
|
|
941
|
+
delivery: CurrencyAmount;
|
|
942
|
+
gross: CurrencyAmount;
|
|
943
|
+
preDiscount: CurrencyAmount;
|
|
944
|
+
total: CurrencyAmount;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Represents an order in the system.
|
|
948
|
+
*
|
|
949
|
+
* @export
|
|
950
|
+
*/
|
|
951
|
+
interface Order extends VCDataRecord {
|
|
952
|
+
/**
|
|
953
|
+
* Human-readable order number for customer reference.
|
|
954
|
+
* Often used in emails and receipts.
|
|
955
|
+
* @example "GW-12345679"
|
|
956
|
+
*/
|
|
957
|
+
orderNumber: string;
|
|
958
|
+
/**
|
|
959
|
+
* @description The currency code used for this order in ISO 4217 format.
|
|
960
|
+
* @example "USD"
|
|
961
|
+
*
|
|
962
|
+
* @pattern ^[A-Z]{3}$
|
|
963
|
+
*/
|
|
964
|
+
currency: string;
|
|
965
|
+
/**
|
|
966
|
+
* List of applied coupons used in the order.
|
|
967
|
+
* Supports multiple entries based on organizer preferences.
|
|
968
|
+
*/
|
|
969
|
+
coupons?: CouponSummary[];
|
|
970
|
+
/**
|
|
971
|
+
* Namespaced identifier indicating what the order is associated with.
|
|
972
|
+
* Format: "{type}_{id}", where type is "evt", "ven", or "org".
|
|
973
|
+
* @example "evt_56k2cf348"
|
|
974
|
+
* @example "org_9912ff8"
|
|
975
|
+
*/
|
|
976
|
+
contextId: ContextId;
|
|
977
|
+
/**
|
|
978
|
+
* Detailed cost breakdown for this order.
|
|
979
|
+
*/
|
|
980
|
+
costs: OrderCosts;
|
|
981
|
+
/**
|
|
982
|
+
* Customer information related to this order.
|
|
983
|
+
*/
|
|
984
|
+
customer: Customer;
|
|
985
|
+
/**
|
|
986
|
+
* The current status of the order.
|
|
987
|
+
* @example "paid"
|
|
988
|
+
*/
|
|
989
|
+
status: OrderStatus;
|
|
990
|
+
/**
|
|
991
|
+
* A list of individual items included in the order.
|
|
992
|
+
*/
|
|
993
|
+
items: OrderItem[];
|
|
994
|
+
/**
|
|
995
|
+
* Agreement flags for terms and marketing opt-ins.
|
|
996
|
+
*/
|
|
997
|
+
agreements: {
|
|
998
|
+
/**
|
|
999
|
+
* Whether the customer accepted the organizer’s custom terms.
|
|
1000
|
+
* @example true
|
|
1001
|
+
*/
|
|
1002
|
+
agreedToOrganizerTerms?: boolean;
|
|
1003
|
+
/**
|
|
1004
|
+
* Whether the customer accepted the platform-wide terms of service.
|
|
1005
|
+
* @example true
|
|
1006
|
+
*/
|
|
1007
|
+
agreedToTerms?: boolean;
|
|
1008
|
+
/**
|
|
1009
|
+
* Whether the customer opted in to receive marketing emails.
|
|
1010
|
+
* @example false
|
|
1011
|
+
*/
|
|
1012
|
+
emailOptIn?: boolean;
|
|
1013
|
+
/**
|
|
1014
|
+
* Whether the customer opted in to receive marketing SMS messages.
|
|
1015
|
+
* @example false
|
|
1016
|
+
*/
|
|
1017
|
+
textOptIn?: boolean;
|
|
1018
|
+
};
|
|
1019
|
+
/**
|
|
1020
|
+
* Responses to dynamic questions during checkout (e.g. survey or registration).
|
|
1021
|
+
* @example { "tshirtSize": "M", "vipNewsletter": true }
|
|
1022
|
+
*/
|
|
1023
|
+
answers: {
|
|
1024
|
+
[questionId: string]: string | boolean;
|
|
1025
|
+
};
|
|
1026
|
+
/**
|
|
1027
|
+
* Freeform object containing metadata forwarded from the partner site
|
|
1028
|
+
* or embedding context. Can include UTM tags, user traits, campaign IDs, etc.
|
|
1029
|
+
* @example { utm_campaign: "spring_launch", partner: "venue_123" }
|
|
1030
|
+
*/
|
|
1031
|
+
forwarded: any;
|
|
1032
|
+
/**
|
|
1033
|
+
* Internal or computed metadata associated with the order.
|
|
1034
|
+
* May include fulfillment flags, debugging info, or derived calculations.
|
|
1035
|
+
* @example { preview: true, manuallyAdjusted: true }
|
|
1036
|
+
*/
|
|
1037
|
+
meta: any;
|
|
1038
|
+
/**
|
|
1039
|
+
* Session and request context captured at the time of order creation.
|
|
1040
|
+
* Includes IPs, referrer, user agent, cart session ID, and tracking info.
|
|
1041
|
+
*/
|
|
1042
|
+
context: OrderContext;
|
|
1043
|
+
version: ApiVersion;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Represents the resolved context associated with a cart session.
|
|
1047
|
+
* This may be an event, venue, or organizer, and is used to enrich the cart with metadata
|
|
1048
|
+
* needed for UI rendering and pricing logic without requiring repeated DB lookups.
|
|
1049
|
+
*
|
|
1050
|
+
* Typically stored in `cart.meta.resolvedContext`.
|
|
1051
|
+
*
|
|
1052
|
+
* @export
|
|
1053
|
+
*/
|
|
1054
|
+
interface ResolvedCartContext {
|
|
1055
|
+
/**
|
|
1056
|
+
* Unique identifier of the context entity.
|
|
1057
|
+
* Typically matches the cart's `contextId` (e.g., "evt_abc123").
|
|
1058
|
+
* @example "evt_abc123"
|
|
1059
|
+
*/
|
|
1060
|
+
id: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* Human-readable title or name of the context entity.
|
|
1063
|
+
* Used for display in headers, summaries, and confirmations.
|
|
1064
|
+
* @example "Downtown Comedy Night"
|
|
1065
|
+
*/
|
|
1066
|
+
title: string;
|
|
1067
|
+
/**
|
|
1068
|
+
* Optional physical or virtual location of the event or venue.
|
|
1069
|
+
* Can include address, coordinates, or virtual link.
|
|
1070
|
+
*/
|
|
1071
|
+
location?: Location;
|
|
1072
|
+
/**
|
|
1073
|
+
* Optional logo, banner, or primary image representing the context.
|
|
1074
|
+
* Used in UI to visually identify the entity during checkout.
|
|
1075
|
+
*/
|
|
1076
|
+
logo?: Photo;
|
|
1077
|
+
/**
|
|
1078
|
+
* A map of offerings relevant to this context (e.g., ticket types, merch).
|
|
1079
|
+
* Stored as a record keyed by offering ID to allow fast lookup.
|
|
1080
|
+
* Each value is a partial offering object, intended for display, validation, or pricing.
|
|
1081
|
+
* @example {
|
|
1082
|
+
* "off_123abc": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "VIP Ticket", price: 3000 }),
|
|
1083
|
+
* "off_456def": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "T-Shirt", price: 2000 }}
|
|
1084
|
+
* }
|
|
1085
|
+
*/
|
|
1086
|
+
offerings?: Record<string, ResolvedCartContextOffering>;
|
|
1087
|
+
}
|
|
1088
|
+
interface ResolvedCartContextOffering {
|
|
1089
|
+
path: string;
|
|
1090
|
+
offering: Offering;
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Represents a temporary or persisted cart before order placement.
|
|
1094
|
+
* Focuses on user intent and checkout prep, not post-purchase records.
|
|
1095
|
+
*
|
|
1096
|
+
* @export
|
|
1097
|
+
*/
|
|
1098
|
+
interface CartSession extends DataRecord, Pick<Order, "currency" | "contextId" | "version" | "coupons"> {
|
|
1099
|
+
/**
|
|
1100
|
+
* Authenticated user ID, if available.
|
|
1101
|
+
* @example "uid_123abc"
|
|
1102
|
+
*/
|
|
1103
|
+
uid: string | null;
|
|
1104
|
+
/**
|
|
1105
|
+
* Optional snapshot of customer info entered during cart fill.
|
|
1106
|
+
* Not required and not final.
|
|
1107
|
+
*
|
|
1108
|
+
* @schema lazy(() => customerSchema).optional()
|
|
1109
|
+
*/
|
|
1110
|
+
customer?: Partial<Customer>;
|
|
1111
|
+
/**
|
|
1112
|
+
* @schema lazy(() => orderContextSchema).optional()
|
|
1113
|
+
*/
|
|
1114
|
+
context: Partial<OrderContext>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Items the user has added to their cart.
|
|
1117
|
+
*/
|
|
1118
|
+
items: Partial<OrderItem>[];
|
|
1119
|
+
/**
|
|
1120
|
+
* Estimated totals based on current cart state.
|
|
1121
|
+
* These values are subject to recalculation before checkout.
|
|
1122
|
+
*/
|
|
1123
|
+
costs?: {
|
|
1124
|
+
subtotal: CurrencyAmount;
|
|
1125
|
+
discount: CurrencyAmount;
|
|
1126
|
+
tax: CurrencyAmount;
|
|
1127
|
+
fee: CurrencyAmount;
|
|
1128
|
+
delivery: CurrencyAmount;
|
|
1129
|
+
total: CurrencyAmount;
|
|
1130
|
+
};
|
|
1131
|
+
/**
|
|
1132
|
+
* Stripe PaymentIntent ID linked to this cart, if created.
|
|
1133
|
+
* Used for confirming payment on the backend.
|
|
1134
|
+
* @example "pi_1ABCXYZ..."
|
|
1135
|
+
*/
|
|
1136
|
+
paymentIntentId?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* Stripe PaymentIntent client secret, used by frontend (e.g. Stripe.js).
|
|
1139
|
+
* Required for completing the payment flow.
|
|
1140
|
+
* @example "pi_1ABCXYZ..._secret_456"
|
|
1141
|
+
*/
|
|
1142
|
+
paymentIntentClientSecret?: string;
|
|
1143
|
+
/**
|
|
1144
|
+
* Partner-forwarded data (e.g. utm, session metadata).
|
|
1145
|
+
*/
|
|
1146
|
+
forwarded?: any;
|
|
1147
|
+
/**
|
|
1148
|
+
* Internal metadata, flags, debug hints, or experimental context.
|
|
1149
|
+
*/
|
|
1150
|
+
meta: {
|
|
1151
|
+
/**
|
|
1152
|
+
* Display context (event, venue, organizer) for rendering and logic.
|
|
1153
|
+
*/
|
|
1154
|
+
resolvedContext?: ResolvedCartContext;
|
|
1155
|
+
/**
|
|
1156
|
+
* Cost components to calculate the cart costs.
|
|
1157
|
+
*
|
|
1158
|
+
* @ignore
|
|
1159
|
+
*/
|
|
1160
|
+
costComponents?: CostComponent[];
|
|
1161
|
+
/**
|
|
1162
|
+
* Snapshot of when pricing was calculated and locked.
|
|
1163
|
+
* Useful for honoring totals during a grace window.
|
|
1164
|
+
*/
|
|
1165
|
+
priceLock?: {
|
|
1166
|
+
lockedAt: string;
|
|
1167
|
+
ttl?: number;
|
|
1168
|
+
};
|
|
1169
|
+
/**
|
|
1170
|
+
* Any additional internal system flags, A/B test conditions, or
|
|
1171
|
+
* non-critical partner payloads.
|
|
1172
|
+
*/
|
|
1173
|
+
[key: string]: any;
|
|
1174
|
+
};
|
|
1175
|
+
status: "started" | "completed" | "abandoned" | "cancelled";
|
|
1176
|
+
}
|
|
1177
|
+
type UpdatableCartSession = Pick<CartSession, "customer" | "items">;
|
|
853
1178
|
|
|
854
1179
|
/**
|
|
855
1180
|
* Provides methods to interact with the Cohost Events API.
|
|
@@ -932,7 +1257,8 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
932
1257
|
* Start a new cart session.
|
|
933
1258
|
*
|
|
934
1259
|
* @param input - Data to start the session
|
|
935
|
-
* @returns The
|
|
1260
|
+
* @returns {CartSession} The latest cart session
|
|
1261
|
+
*
|
|
936
1262
|
* @throws Will throw an error if the request fails
|
|
937
1263
|
*/
|
|
938
1264
|
start(input: StartCartSessionInput): Promise<CartSession>;
|
|
@@ -940,7 +1266,8 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
940
1266
|
* Get a cart session by its ID.
|
|
941
1267
|
*
|
|
942
1268
|
* @param id - The unique session ID
|
|
943
|
-
* @returns The cart session
|
|
1269
|
+
* @returns {CartSession} The latest cart session
|
|
1270
|
+
*
|
|
944
1271
|
* @throws Will throw an error if the session is not found or request fails
|
|
945
1272
|
*/
|
|
946
1273
|
get(id: string): Promise<CartSession>;
|
|
@@ -949,7 +1276,8 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
949
1276
|
*
|
|
950
1277
|
* @param id - The ID of the session to update
|
|
951
1278
|
* @param input - Data to update the session
|
|
952
|
-
* @returns The
|
|
1279
|
+
* @returns {CartSession} The latest cart session
|
|
1280
|
+
*
|
|
953
1281
|
* @throws Will throw an error if the update fails
|
|
954
1282
|
*/
|
|
955
1283
|
update(id: string, input: UpdatableCartSession): Promise<CartSession>;
|
|
@@ -961,6 +1289,28 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
961
1289
|
* @throws Will throw an error if the cancel operation fails
|
|
962
1290
|
*/
|
|
963
1291
|
cancel(id: string): Promise<void>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Update an item in the cart session.
|
|
1294
|
+
*
|
|
1295
|
+
* @param sessionId - The ID of the session
|
|
1296
|
+
* @param props - Properties to update
|
|
1297
|
+
* @returns {CartSession} The latest cart session
|
|
1298
|
+
*
|
|
1299
|
+
* @throws Will throw an error if the update fails
|
|
1300
|
+
*/
|
|
1301
|
+
updateItem(sessionId: string, props: {
|
|
1302
|
+
offeringId: string;
|
|
1303
|
+
quantity: number;
|
|
1304
|
+
}): Promise<CartSession>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Remove an item from the cart session.
|
|
1307
|
+
* The same as setting the quantity to 0.
|
|
1308
|
+
*
|
|
1309
|
+
* @param sessionId
|
|
1310
|
+
* @param offeringId
|
|
1311
|
+
* @returns {CartSession} The latest cart session
|
|
1312
|
+
*/
|
|
1313
|
+
deleteItem(sessionId: string, offeringId: string): Promise<CartSession>;
|
|
964
1314
|
}
|
|
965
1315
|
|
|
966
1316
|
/**
|
|
@@ -1001,4 +1351,4 @@ declare class CohostClient {
|
|
|
1001
1351
|
*/
|
|
1002
1352
|
declare function createCohostClient(options: CohostClientOptions): CohostClient;
|
|
1003
1353
|
|
|
1004
|
-
export { CohostClient, createCohostClient };
|
|
1354
|
+
export { CohostClient, type CohostClientSettings, createCohostClient };
|