@cohostvip/cohost-node 0.3.7 → 0.3.9
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.d.mts +3 -1704
- package/dist/index.d.ts +3 -1704
- 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 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,1706 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Must begin with one of the following prefixes:
|
|
5
|
-
* - "evt_" for events
|
|
6
|
-
* - "ven_" for venues
|
|
7
|
-
* - "org_" for organizers
|
|
8
|
-
*
|
|
9
|
-
* @example "evt_abc123"
|
|
10
|
-
* @example "org_def456"
|
|
11
|
-
*
|
|
12
|
-
* @schema string()
|
|
13
|
-
* @pattern ^((evt|ven|org)_[a-zA-Z0-9]+)$
|
|
14
|
-
*/
|
|
15
|
-
type ContextId = string;
|
|
16
|
-
type ApiVersion = "2025-04-15";
|
|
17
|
-
/**
|
|
18
|
-
* A rich content object that supports multiple representations of text.
|
|
19
|
-
*/
|
|
20
|
-
interface MultipartText {
|
|
21
|
-
/** HTML version of the content. */
|
|
22
|
-
html?: string;
|
|
23
|
-
/** Plain text version of the content. */
|
|
24
|
-
text?: string;
|
|
25
|
-
/** Markdown version of the content. */
|
|
26
|
-
md?: string;
|
|
27
|
-
/** Optional rich editor blocks (if structured editing is supported). */
|
|
28
|
-
blocks?: any[] | null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A photo object with resolution options and optional metadata.
|
|
32
|
-
*/
|
|
33
|
-
interface Photo {
|
|
34
|
-
/** High-resolution (2x) image URL. */
|
|
35
|
-
"2x"?: string;
|
|
36
|
-
/** Internal photo ID, if stored in a media system. */
|
|
37
|
-
id?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Primary image URL.
|
|
40
|
-
* This is the default image URL to be used when no other resolution is specified.
|
|
41
|
-
*
|
|
42
|
-
* @example "https://picsum.photos/500"
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @x-faker image.imageUrl
|
|
46
|
-
*/
|
|
47
|
-
url: string;
|
|
48
|
-
/** Width of the image in pixels. */
|
|
49
|
-
width?: number;
|
|
50
|
-
/** Height of the image in pixels. */
|
|
51
|
-
height?: number;
|
|
52
|
-
/** Optional caption for the image. */
|
|
53
|
-
caption?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* A repeating or structured date schedule for an event or item.
|
|
57
|
-
*/
|
|
58
|
-
interface Schedule {
|
|
59
|
-
/** Days of the week (0 = Sunday, 6 = Saturday). */
|
|
60
|
-
daysOfWeek?: number[];
|
|
61
|
-
/** ISO-formatted UTC start datetime. */
|
|
62
|
-
start: string;
|
|
63
|
-
/** ISO-formatted UTC end datetime. */
|
|
64
|
-
end: string;
|
|
65
|
-
/** Specific dates to exclude in "YYYY-MM-DD" format. */
|
|
66
|
-
excludeDates?: string[];
|
|
67
|
-
/** Specific dates to include in "YYYY-MM-DD" format. */
|
|
68
|
-
includeDates?: string[];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Pagination parameters for a paginated API request.
|
|
72
|
-
*/
|
|
73
|
-
interface Pagination$1 {
|
|
74
|
-
/** Number of results per page. */
|
|
75
|
-
size: number;
|
|
76
|
-
/** Page number (starting from 1). */
|
|
77
|
-
page: number;
|
|
78
|
-
/** Continuation */
|
|
79
|
-
continuation?: string;
|
|
80
|
-
}
|
|
81
|
-
interface PaginationResponse extends Pagination$1 {
|
|
82
|
-
/** Total number of results available. */
|
|
83
|
-
total: number;
|
|
84
|
-
}
|
|
85
|
-
type PaginatedResponse<T> = {
|
|
86
|
-
/** Array of results. */
|
|
87
|
-
results: T[];
|
|
88
|
-
/** Pagination metadata. */
|
|
89
|
-
pagination: PaginationResponse;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* A pre-parsed human-friendly representation of a date and time.
|
|
93
|
-
*/
|
|
94
|
-
interface StructuredDate {
|
|
95
|
-
/** Formatted date strings. */
|
|
96
|
-
date: {
|
|
97
|
-
/** Full format, e.g., "Tuesday, October 3". */
|
|
98
|
-
EEEEMMMMd: string;
|
|
99
|
-
/** Short weekday/month/day, e.g., "Tue, Oct. 3". */
|
|
100
|
-
EEEMMMd: string;
|
|
101
|
-
/** Long date format, e.g., "Tuesday, October 3, 2023". */
|
|
102
|
-
long: string;
|
|
103
|
-
/** Short numeric format, e.g., "10/03/2023". */
|
|
104
|
-
short: string;
|
|
105
|
-
};
|
|
106
|
-
/** Time string (e.g., "3:00 PM"). */
|
|
107
|
-
time: string;
|
|
108
|
-
/** UTC timestamp (e.g., "2006-10-25T12:00:00Z"). */
|
|
109
|
-
utc: string;
|
|
110
|
-
/** IANA timezone (e.g., "America/New_York"). */
|
|
111
|
-
timezone: string;
|
|
112
|
-
/** Local timestamp (e.g., "2006-10-25T12:00:00-04:00"). */
|
|
113
|
-
local: string;
|
|
114
|
-
/** Whether this date is in the future. */
|
|
115
|
-
upcoming: boolean;
|
|
116
|
-
/** Duration details from now to the date. */
|
|
117
|
-
duration: {
|
|
118
|
-
days: number;
|
|
119
|
-
hours: number;
|
|
120
|
-
minutes: number;
|
|
121
|
-
weeks: number;
|
|
122
|
-
months: number;
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Base metadata for any record stored in the system.
|
|
127
|
-
* Includes an ID and timestamps for creation and optional updates.
|
|
128
|
-
*
|
|
129
|
-
* @export
|
|
130
|
-
*/
|
|
131
|
-
interface DataRecord {
|
|
132
|
-
/**
|
|
133
|
-
* Unique identifier for the record.
|
|
134
|
-
* @example "rec_123abc"
|
|
135
|
-
*/
|
|
136
|
-
id: string;
|
|
137
|
-
/**
|
|
138
|
-
* ISO 8601 timestamp indicating when the record was created.
|
|
139
|
-
* @example "2025-04-16T10:15:00Z"
|
|
140
|
-
*/
|
|
141
|
-
created: string;
|
|
142
|
-
/**
|
|
143
|
-
* ISO 8601 timestamp indicating when the record was last updated, if applicable.
|
|
144
|
-
* @example "2025-04-18T08:00:00Z"
|
|
145
|
-
*/
|
|
146
|
-
changed?: string;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Extension of `DataRecord` for resources returned from RESTful APIs.
|
|
150
|
-
* Includes a schema version to ensure compatibility with evolving formats.
|
|
151
|
-
*
|
|
152
|
-
* @export
|
|
153
|
-
*/
|
|
154
|
-
interface VersionedDataRecord extends DataRecord {
|
|
155
|
-
/**
|
|
156
|
-
* Schema version identifier for this record.
|
|
157
|
-
* Helps manage compatibility across client-server contracts.
|
|
158
|
-
* @example "2025-01-10"
|
|
159
|
-
*/
|
|
160
|
-
version: ApiVersion;
|
|
161
|
-
}
|
|
162
|
-
interface VCDataRecord extends VersionedDataRecord {
|
|
163
|
-
companyId: string;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Represents either an absolute or a relative time constraint.
|
|
167
|
-
*
|
|
168
|
-
* - If using `date`, `secondsBefore` must not be present.
|
|
169
|
-
* - If using `secondsBefore`, `date` must not be present.
|
|
170
|
-
*
|
|
171
|
-
* @export
|
|
172
|
-
*/
|
|
173
|
-
type TimeOrOffset = {
|
|
174
|
-
/**
|
|
175
|
-
* Absolute time in ISO 8601 format.
|
|
176
|
-
* @example "2025-06-30T23:59:59"
|
|
177
|
-
*/
|
|
178
|
-
date: string;
|
|
179
|
-
secondsBefore?: never;
|
|
180
|
-
} | {
|
|
181
|
-
/**
|
|
182
|
-
* Relative time before an anchor point (e.g. event start), in seconds.
|
|
183
|
-
* @example 3600
|
|
184
|
-
*/
|
|
185
|
-
secondsBefore: number;
|
|
186
|
-
date?: never;
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* A request structure that includes both query parameters and pagination.
|
|
190
|
-
*
|
|
191
|
-
* @ignore
|
|
192
|
-
*/
|
|
193
|
-
type PaginatedRequest<T> = T & {
|
|
194
|
-
/** Pagination settings. */
|
|
195
|
-
pagination: Pagination$1;
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* @description A string representing a currency amount in the format `"USD,1000"` where:
|
|
199
|
-
* - `"USD"` is the 3-letter ISO currency code.
|
|
200
|
-
* - The number after the comma represents the value in **minor units** (e.g., cents for USD).
|
|
201
|
-
*
|
|
202
|
-
* For example, `"USD,1000"` equals $10.00 (i.e., 1000 cents).
|
|
203
|
-
*
|
|
204
|
-
* @example "USD,0"
|
|
205
|
-
* @example "USD,100"
|
|
206
|
-
* @example "USD,1000"
|
|
207
|
-
*
|
|
208
|
-
* @pattern ^\w{3},\d+$
|
|
209
|
-
* @zod .string()
|
|
210
|
-
*/
|
|
211
|
-
type CurrencyAmount = string;
|
|
212
|
-
interface CostBase {
|
|
213
|
-
/**
|
|
214
|
-
* The base value of the cost. This is the value before any operations are applied.
|
|
215
|
-
* in OrderItem this is the cost of a single item.
|
|
216
|
-
*
|
|
217
|
-
* @example "USD,1000"
|
|
218
|
-
*/
|
|
219
|
-
cost: CurrencyAmount;
|
|
220
|
-
/**
|
|
221
|
-
* Delivery fee for a single item.
|
|
222
|
-
*
|
|
223
|
-
* @example "USD,1000"
|
|
224
|
-
*/
|
|
225
|
-
delivery: CurrencyAmount;
|
|
226
|
-
/**
|
|
227
|
-
* Fee per item.
|
|
228
|
-
* @example "USD,1000"
|
|
229
|
-
*/
|
|
230
|
-
fee: CurrencyAmount;
|
|
231
|
-
/**
|
|
232
|
-
* Total discount amount applied to this item.
|
|
233
|
-
* @example "USD,1000"
|
|
234
|
-
*/
|
|
235
|
-
tax: CurrencyAmount;
|
|
236
|
-
}
|
|
237
|
-
interface CostComponentCap {
|
|
238
|
-
op: "cap";
|
|
239
|
-
type: "percentage" | "absolute";
|
|
240
|
-
/**
|
|
241
|
-
* The value of the cap. If type is percentage, it is a percentage of the base value.
|
|
242
|
-
* If type is absolute, it is an absolute value.
|
|
243
|
-
*
|
|
244
|
-
* Absolute value is represented in the same denomination as the cost.
|
|
245
|
-
* i.e. if the cost is in cents, the absolute value should be in cents.
|
|
246
|
-
*
|
|
247
|
-
* percentage value is represented as a decimal.
|
|
248
|
-
* For example, 10% is represented as 0.1.
|
|
249
|
-
*/
|
|
250
|
-
value: number;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Represents a cost operation to be applied in a pricing formula.
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* { op: '*', value: 0.9 }
|
|
257
|
-
*/
|
|
258
|
-
interface CostOp {
|
|
259
|
-
/**
|
|
260
|
-
* The operation to apply to the cost value.
|
|
261
|
-
*
|
|
262
|
-
* Allowed values:
|
|
263
|
-
* - "+" (addition)
|
|
264
|
-
* - "-" (subtraction)
|
|
265
|
-
* - "*" (multiplication)
|
|
266
|
-
* - "/" (division)
|
|
267
|
-
* @ignore
|
|
268
|
-
* @enum {string}
|
|
269
|
-
*/
|
|
270
|
-
op: "+" | "-" | "*" | "/";
|
|
271
|
-
/**
|
|
272
|
-
* The operand value used in the cost operation.
|
|
273
|
-
*
|
|
274
|
-
* The unit should match the denomination of the cost.
|
|
275
|
-
* For example, if cost is expressed in cents, this value should also be in cents.
|
|
276
|
-
*
|
|
277
|
-
* @example 100
|
|
278
|
-
*/
|
|
279
|
-
value: number;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* A set of comparison operators used for evaluating conditional expressions.
|
|
283
|
-
*
|
|
284
|
-
* Supported operators:
|
|
285
|
-
* - '==' (equal to)
|
|
286
|
-
* - '!=' (not equal to)
|
|
287
|
-
* - '<' (less than)
|
|
288
|
-
* - '<=' (less than or equal to)
|
|
289
|
-
* - '>' (greater than)
|
|
290
|
-
* - '>=' (greater than or equal to)
|
|
291
|
-
* @enum {string}
|
|
292
|
-
* @ignore
|
|
293
|
-
*/
|
|
294
|
-
type EqualOperator = "==" | "!=" | "<" | "<=" | ">" | ">=";
|
|
295
|
-
interface CostComponentRuleCondition {
|
|
296
|
-
/**
|
|
297
|
-
* The field to evaluate the condition against.
|
|
298
|
-
* For example, "item.price" or "order.total".
|
|
299
|
-
* The field should be a valid path to the field in the cost component base.
|
|
300
|
-
*/
|
|
301
|
-
field: string;
|
|
302
|
-
/**
|
|
303
|
-
*
|
|
304
|
-
*/
|
|
305
|
-
operator: EqualOperator;
|
|
306
|
-
/**
|
|
307
|
-
* Can be a value such as number, currencyAmount, an ISO date string, etc...
|
|
308
|
-
*/
|
|
309
|
-
value: string | number | any;
|
|
310
|
-
/**
|
|
311
|
-
* evaluator, will define a function or endpoint to evaluate the condition.
|
|
312
|
-
*/
|
|
313
|
-
eval?: string;
|
|
314
|
-
}
|
|
315
|
-
interface CostComponentRule {
|
|
316
|
-
/**
|
|
317
|
-
* Friendly name of the rule.
|
|
318
|
-
*/
|
|
319
|
-
name: string;
|
|
320
|
-
/**
|
|
321
|
-
* The rule will be applied to the cost component if the conditions are met.
|
|
322
|
-
*/
|
|
323
|
-
conditions: CostComponentRuleCondition[];
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Represents the costs associated with an offering.
|
|
327
|
-
*
|
|
328
|
-
* @property {CurrencyAmount} delivery - The delivery cost.
|
|
329
|
-
* @property {CurrencyAmount} cost - The cost amount. In an order item, this is the cost of a single item.
|
|
330
|
-
* @property {CurrencyAmount} fee - The fee amount. In an order item, this is the fee of a single item.
|
|
331
|
-
* @property {CurrencyAmount} tax - The tax amount. In an order item, this is the tax per a single item.
|
|
332
|
-
* @property {CurrencyAmount} gross - The gross amount, which is the cost plus fee minus discount, not including tax.
|
|
333
|
-
* @property {CurrencyAmount} total - The total cost including tax.
|
|
334
|
-
*/
|
|
335
|
-
interface OfferingCosts extends CostBase {
|
|
336
|
-
/**
|
|
337
|
-
* cost + fee - discount , not including tax
|
|
338
|
-
*
|
|
339
|
-
* In an order item, this is the gross cost of a single item.
|
|
340
|
-
*
|
|
341
|
-
* @x-faker {"random.arrayElement": ["\"USD,100000\"", "\"USD,25000\""]}
|
|
342
|
-
*/
|
|
343
|
-
gross: CurrencyAmount;
|
|
344
|
-
/**
|
|
345
|
-
* total cost including tax
|
|
346
|
-
*
|
|
347
|
-
* In an order item, this is the total cost * Quantity.
|
|
348
|
-
*/
|
|
349
|
-
total: CurrencyAmount;
|
|
350
|
-
}
|
|
351
|
-
interface StructuredCost {
|
|
352
|
-
currency: string;
|
|
353
|
-
formatted: string;
|
|
354
|
-
value: number;
|
|
355
|
-
majorValue: number;
|
|
356
|
-
}
|
|
357
|
-
type CostBucket = "item" | "fee" | "tax" | "delivery";
|
|
358
|
-
interface CostComponent {
|
|
359
|
-
id: string;
|
|
360
|
-
name: string;
|
|
361
|
-
details?: any;
|
|
362
|
-
currency: string | "*";
|
|
363
|
-
base: "order" | "item" | string;
|
|
364
|
-
bucket: CostBucket;
|
|
365
|
-
recipient: "organizer" | "platform" | "tax" | string;
|
|
366
|
-
payer: "attendee" | "organizer";
|
|
367
|
-
/**
|
|
368
|
-
* @ignore
|
|
369
|
-
*/
|
|
370
|
-
ops: CostOp[];
|
|
371
|
-
cap?: CostComponentCap;
|
|
372
|
-
rules: CostComponentRule[];
|
|
373
|
-
enabled?: boolean;
|
|
374
|
-
version: "2025-03-25";
|
|
375
|
-
}
|
|
376
|
-
interface CalculatedCostComponent extends Omit<CostComponent, "ops" | "cap" | "rules" | "details" | "currency"> {
|
|
377
|
-
cost: CurrencyAmount;
|
|
378
|
-
value: number;
|
|
379
|
-
discount: null;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* @zod .string()
|
|
383
|
-
*/
|
|
384
|
-
type OfferingType = "admission" | "admission.tableCommitment" | "package" | "skip" | "drink" | "ticket" | "tc-ticket" | "merch" | "donation" | "membership" | "voucher" | "service" | "other";
|
|
385
|
-
type ActiveOfferingStatus = "live" | "hidden" | "sold-out";
|
|
386
|
-
type OfferingStatus = ActiveOfferingStatus | "draft" | "deleted" | "unavailable";
|
|
387
|
-
type PriceCategory = "donation" | "free" | "paid" | "other";
|
|
388
|
-
interface Offering extends DataRecord {
|
|
389
|
-
/**
|
|
390
|
-
* Offering name, can be ticket name, vaucher name, etc...
|
|
391
|
-
* @example "General Admission" (ticket) | "T-shirt" (merch) | "Donation" (donation) | "Membership" (membership) | "Gift Card" (voucher) | "Service Fee" (service) | "Other" (other)
|
|
392
|
-
*
|
|
393
|
-
* @x-faker commerce.productName
|
|
394
|
-
*/
|
|
395
|
-
name: string;
|
|
396
|
-
type: OfferingType;
|
|
397
|
-
/**
|
|
398
|
-
* @description The maximum number of tickets that can be sold for this offering.
|
|
399
|
-
*
|
|
400
|
-
* @example 100
|
|
401
|
-
*
|
|
402
|
-
* @x-faker {"datatype.number": { "min": 10, "max": 100 }}
|
|
403
|
-
*/
|
|
404
|
-
capacity: number;
|
|
405
|
-
quantitySold: number;
|
|
406
|
-
status: OfferingStatus;
|
|
407
|
-
priceCategory: PriceCategory;
|
|
408
|
-
sorting: number;
|
|
409
|
-
/**
|
|
410
|
-
* @ignore
|
|
411
|
-
*/
|
|
412
|
-
schedule?: Schedule;
|
|
413
|
-
description?: string;
|
|
414
|
-
instructions?: string;
|
|
415
|
-
/**
|
|
416
|
-
* @description Maximum number of tickets that can be purchased in a single order.
|
|
417
|
-
*
|
|
418
|
-
* @example 10
|
|
419
|
-
*
|
|
420
|
-
* @x-faker {"datatype.number": { "min": 4, "max": 15 }}
|
|
421
|
-
*/
|
|
422
|
-
maximumQuantity: number;
|
|
423
|
-
/**
|
|
424
|
-
* @description Minimum number of tickets that can be purchased in a single order.
|
|
425
|
-
*
|
|
426
|
-
* @example 1
|
|
427
|
-
*
|
|
428
|
-
* @x-faker {"datatype.number": { "min": 1, "max": 4 }}
|
|
429
|
-
*/
|
|
430
|
-
minimumQuantity: number;
|
|
431
|
-
package?: boolean;
|
|
432
|
-
/**
|
|
433
|
-
* @description Items, products ,and vouchers included in this offering.
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
* @x-faker {"array.length": 0}
|
|
437
|
-
*/
|
|
438
|
-
includes?: PackageInclude[];
|
|
439
|
-
/**
|
|
440
|
-
* Any constraints that apply to this offering.
|
|
441
|
-
* it can be time limit, quantity limit, etc...
|
|
442
|
-
*/
|
|
443
|
-
constraints?: any;
|
|
444
|
-
hidden: boolean;
|
|
445
|
-
order_confirmation_message?: string | null;
|
|
446
|
-
costs: OfferingCosts;
|
|
447
|
-
/**
|
|
448
|
-
* @description The group this offering belongs to.
|
|
449
|
-
*
|
|
450
|
-
* @example "General Admission" (ticket) | "T-shirt" (merch) | "Donation" (donation) | "Membership" (membership) | "Gift Card" (voucher) | "Service Fee" (service) | "Other" (other)
|
|
451
|
-
*/
|
|
452
|
-
options?: OfferingOptionsGroup[];
|
|
453
|
-
/**
|
|
454
|
-
* Describe fees and other costs associated with purchasing tickets
|
|
455
|
-
* to this offering
|
|
456
|
-
*
|
|
457
|
-
* @ignore
|
|
458
|
-
*/
|
|
459
|
-
costComponents?: CostComponent[];
|
|
460
|
-
meta?: {
|
|
461
|
-
[key: string]: any;
|
|
462
|
-
};
|
|
463
|
-
config?: {
|
|
464
|
-
groups?: OfferingPurchaseGroupSetting;
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
interface OfferingPurchaseGroupSetting {
|
|
468
|
-
enabled: boolean;
|
|
469
|
-
autoGenerateGroupId?: boolean;
|
|
470
|
-
}
|
|
471
|
-
interface OfferingOptionsGroup {
|
|
472
|
-
id: string;
|
|
473
|
-
name: string;
|
|
474
|
-
hash?: string;
|
|
475
|
-
options: OfferingOption[];
|
|
476
|
-
}
|
|
477
|
-
interface OfferingOption {
|
|
478
|
-
key: string;
|
|
479
|
-
description: string;
|
|
480
|
-
value: string | number;
|
|
481
|
-
meta?: any;
|
|
482
|
-
}
|
|
483
|
-
interface PackageInclude {
|
|
484
|
-
id: string;
|
|
485
|
-
quantity: number;
|
|
486
|
-
type: OfferingType;
|
|
487
|
-
description: string;
|
|
488
|
-
name?: string;
|
|
489
|
-
/**
|
|
490
|
-
* path to the offering doc in the db.
|
|
491
|
-
*/
|
|
492
|
-
refPath?: string;
|
|
493
|
-
}
|
|
494
|
-
interface Ticket extends Omit<Offering, "hidden" | "constraints" | "type"> {
|
|
495
|
-
category: string;
|
|
496
|
-
type: "admission" | "package" | "admission.tableCommitment";
|
|
497
|
-
source: string;
|
|
498
|
-
display_name?: string;
|
|
499
|
-
description?: string;
|
|
500
|
-
ticketParentId?: string;
|
|
501
|
-
salesEnd: string;
|
|
502
|
-
salesStart: string;
|
|
503
|
-
parentId?: string;
|
|
504
|
-
refId?: string;
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Represents a physical address with comprehensive localization support.
|
|
508
|
-
*
|
|
509
|
-
* @interface Address
|
|
510
|
-
* @example
|
|
511
|
-
* ```typescript
|
|
512
|
-
* // Basic US address
|
|
513
|
-
* const usAddress: Address = {
|
|
514
|
-
* address_1: "123 Main Street",
|
|
515
|
-
* address_2: "Apt 4B",
|
|
516
|
-
* city: "New York",
|
|
517
|
-
* country: "US",
|
|
518
|
-
* postal_code: "10001",
|
|
519
|
-
* region: "NY"
|
|
520
|
-
* };
|
|
521
|
-
*
|
|
522
|
-
* // US address with premise
|
|
523
|
-
* const businessAddress: Address = {
|
|
524
|
-
* address_1: "1600 Pennsylvania Avenue NW",
|
|
525
|
-
* city: "Washington",
|
|
526
|
-
* country: "US",
|
|
527
|
-
* premise: "West Wing",
|
|
528
|
-
* postal_code: "20500",
|
|
529
|
-
* region: "DC"
|
|
530
|
-
* };
|
|
531
|
-
*
|
|
532
|
-
* // US address with formatting
|
|
533
|
-
* const formattedAddress: Address = {
|
|
534
|
-
* address_1: "350 Fifth Avenue",
|
|
535
|
-
* city: "New York",
|
|
536
|
-
* country: "US",
|
|
537
|
-
* postal_code: "10118",
|
|
538
|
-
* region: "NY",
|
|
539
|
-
* formattedAddress: "350 Fifth Avenue, New York, NY 10118, US",
|
|
540
|
-
* localized_multi_line_address_display: [
|
|
541
|
-
* "350 Fifth Avenue",
|
|
542
|
-
* "New York, NY 10118"
|
|
543
|
-
* ]
|
|
544
|
-
* };
|
|
545
|
-
* ```
|
|
546
|
-
*/
|
|
547
|
-
interface Address {
|
|
548
|
-
/**
|
|
549
|
-
* Primary street address line.
|
|
550
|
-
*
|
|
551
|
-
* @example "123 Main Street"
|
|
552
|
-
* @example "1600 Pennsylvania Avenue NW"
|
|
553
|
-
*/
|
|
554
|
-
address_1: string;
|
|
555
|
-
/**
|
|
556
|
-
* Secondary address line for apartment, suite, or unit numbers.
|
|
557
|
-
*
|
|
558
|
-
* @example "Apt 4B"
|
|
559
|
-
* @example "Suite 100"
|
|
560
|
-
* @example "Unit 12"
|
|
561
|
-
*/
|
|
562
|
-
address_2?: string;
|
|
563
|
-
/**
|
|
564
|
-
* City or locality name.
|
|
565
|
-
*
|
|
566
|
-
* @example "New York"
|
|
567
|
-
* @example "San Francisco"
|
|
568
|
-
* @example "Chicago"
|
|
569
|
-
*/
|
|
570
|
-
city: string;
|
|
571
|
-
/**
|
|
572
|
-
* ISO 3166-1 alpha-2 country code.
|
|
573
|
-
*
|
|
574
|
-
* @example "US" // United States
|
|
575
|
-
*/
|
|
576
|
-
country: string;
|
|
577
|
-
/**
|
|
578
|
-
* Building or premise identifier (building name, floor, etc.).
|
|
579
|
-
*
|
|
580
|
-
* @example "Building A"
|
|
581
|
-
* @example "3rd Floor"
|
|
582
|
-
* @example "West Wing"
|
|
583
|
-
*/
|
|
584
|
-
premise?: string;
|
|
585
|
-
/**
|
|
586
|
-
* Complete formatted address as a single string.
|
|
587
|
-
* Useful for display purposes or geocoding services.
|
|
588
|
-
*
|
|
589
|
-
* @example "123 Main Street, Apt 4B, New York, NY 10001, US"
|
|
590
|
-
* @example "1600 Pennsylvania Avenue NW, Washington, DC 20500, US"
|
|
591
|
-
*/
|
|
592
|
-
formattedAddress?: string;
|
|
593
|
-
/**
|
|
594
|
-
* Localized version of the complete address.
|
|
595
|
-
* For US addresses, typically the same as the standard format.
|
|
596
|
-
*
|
|
597
|
-
* @example "123 Main Street, New York, NY 10001"
|
|
598
|
-
*/
|
|
599
|
-
localized_address_display?: string;
|
|
600
|
-
/**
|
|
601
|
-
* Localized area/region display combining city and state.
|
|
602
|
-
*
|
|
603
|
-
* @example "Brooklyn, NY"
|
|
604
|
-
* @example "Los Angeles, CA"
|
|
605
|
-
* @example "Miami, FL"
|
|
606
|
-
*/
|
|
607
|
-
localized_area_display?: string;
|
|
608
|
-
/**
|
|
609
|
-
* Multi-line address display as an array of strings.
|
|
610
|
-
* Each element represents a line for proper address formatting on labels or forms.
|
|
611
|
-
*
|
|
612
|
-
* @example
|
|
613
|
-
* [
|
|
614
|
-
* "123 Main Street",
|
|
615
|
-
* "Apt 4B",
|
|
616
|
-
* "New York, NY 10001"
|
|
617
|
-
* ]
|
|
618
|
-
*
|
|
619
|
-
* @example
|
|
620
|
-
* [
|
|
621
|
-
* "350 Fifth Avenue",
|
|
622
|
-
* "New York, NY 10118"
|
|
623
|
-
* ]
|
|
624
|
-
*/
|
|
625
|
-
localized_multi_line_address_display?: string[];
|
|
626
|
-
/**
|
|
627
|
-
* US ZIP code or ZIP+4 format.
|
|
628
|
-
*
|
|
629
|
-
* @example "10001" // Standard ZIP
|
|
630
|
-
* @example "10001-1234" // ZIP+4 format
|
|
631
|
-
* @example "90210" // Beverly Hills ZIP
|
|
632
|
-
*/
|
|
633
|
-
postal_code: string;
|
|
634
|
-
/**
|
|
635
|
-
* US state or territory 2-letter abbreviation.
|
|
636
|
-
*
|
|
637
|
-
* @example "NY" // New York
|
|
638
|
-
* @example "CA" // California
|
|
639
|
-
* @example "TX" // Texas
|
|
640
|
-
* @example "DC" // District of Columbia
|
|
641
|
-
*/
|
|
642
|
-
region: string;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Represents a person with basic identity information.
|
|
646
|
-
*
|
|
647
|
-
* @interface Person
|
|
648
|
-
* @example
|
|
649
|
-
* ```typescript
|
|
650
|
-
* const person: Person = {
|
|
651
|
-
* name: "John Michael Smith",
|
|
652
|
-
* displayName: "John Smith",
|
|
653
|
-
* first: "John",
|
|
654
|
-
* last: "Smith",
|
|
655
|
-
* gender: "male",
|
|
656
|
-
* birthdate: "1990-05-15",
|
|
657
|
-
* age: 33,
|
|
658
|
-
* photoURL: "https://example.com/photos/john-smith.jpg"
|
|
659
|
-
* };
|
|
660
|
-
* ```
|
|
661
|
-
*/
|
|
662
|
-
interface Person {
|
|
663
|
-
/**
|
|
664
|
-
* Full name of the person.
|
|
665
|
-
*
|
|
666
|
-
* @example "John Michael Smith"
|
|
667
|
-
* @example "Sarah Johnson"
|
|
668
|
-
*/
|
|
669
|
-
name: string;
|
|
670
|
-
/**
|
|
671
|
-
* URL to the person's profile photo or avatar.
|
|
672
|
-
* Can be null if no photo is available.
|
|
673
|
-
*
|
|
674
|
-
* @example "https://example.com/photos/john-smith.jpg"
|
|
675
|
-
* @example "https://cdn.example.com/avatars/user123.png"
|
|
676
|
-
* @example null
|
|
677
|
-
*/
|
|
678
|
-
photoURL?: string | null;
|
|
679
|
-
/**
|
|
680
|
-
* Preferred display name for the person.
|
|
681
|
-
* Often a shortened or preferred version of their full name.
|
|
682
|
-
*
|
|
683
|
-
* @example "John Smith"
|
|
684
|
-
* @example "Mike"
|
|
685
|
-
* @example "Dr. Johnson"
|
|
686
|
-
*/
|
|
687
|
-
displayName: string;
|
|
688
|
-
/**
|
|
689
|
-
* First name or given name.
|
|
690
|
-
*
|
|
691
|
-
* @example "John"
|
|
692
|
-
* @example "Sarah"
|
|
693
|
-
* @example "Michael"
|
|
694
|
-
*/
|
|
695
|
-
first: string;
|
|
696
|
-
/**
|
|
697
|
-
* Last name or family name.
|
|
698
|
-
*
|
|
699
|
-
* @example "Smith"
|
|
700
|
-
* @example "Johnson"
|
|
701
|
-
* @example "Williams"
|
|
702
|
-
*/
|
|
703
|
-
last: string;
|
|
704
|
-
/**
|
|
705
|
-
* Gender identity of the person.
|
|
706
|
-
* Can be null if not specified or prefer not to answer.
|
|
707
|
-
*
|
|
708
|
-
* @example "male"
|
|
709
|
-
* @example "female"
|
|
710
|
-
* @example "other"
|
|
711
|
-
* @example null
|
|
712
|
-
*/
|
|
713
|
-
gender: null | string | "male" | "female" | "other";
|
|
714
|
-
/**
|
|
715
|
-
* Date of birth in ISO 8601 format (YYYY-MM-DD).
|
|
716
|
-
* Can be null if not provided.
|
|
717
|
-
*
|
|
718
|
-
* @example "1990-05-15"
|
|
719
|
-
* @example "1985-12-25"
|
|
720
|
-
* @example null
|
|
721
|
-
*/
|
|
722
|
-
birthdate?: string | null;
|
|
723
|
-
/**
|
|
724
|
-
* Current age in years.
|
|
725
|
-
* Typically calculated from birthdate.
|
|
726
|
-
*
|
|
727
|
-
* @example 33
|
|
728
|
-
* @example 28
|
|
729
|
-
* @example 45
|
|
730
|
-
*/
|
|
731
|
-
age?: number;
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Contact information for a person.
|
|
735
|
-
*
|
|
736
|
-
* @interface PersonContact
|
|
737
|
-
* @example
|
|
738
|
-
* ```typescript
|
|
739
|
-
* const contact: PersonContact = {
|
|
740
|
-
* email: "john.smith@example.com",
|
|
741
|
-
* phone: "+1-555-123-4567"
|
|
742
|
-
* };
|
|
743
|
-
*
|
|
744
|
-
* // Minimal contact with only email
|
|
745
|
-
* const emailOnly: PersonContact = {
|
|
746
|
-
* email: "sarah@example.com",
|
|
747
|
-
* phone: null
|
|
748
|
-
* };
|
|
749
|
-
* ```
|
|
750
|
-
*/
|
|
751
|
-
interface PersonContact {
|
|
752
|
-
/**
|
|
753
|
-
* Primary email address.
|
|
754
|
-
* Can be null if no email is provided.
|
|
755
|
-
*
|
|
756
|
-
* @example "john.smith@example.com"
|
|
757
|
-
* @example "user123@gmail.com"
|
|
758
|
-
* @example null
|
|
759
|
-
*/
|
|
760
|
-
email: string | null;
|
|
761
|
-
/**
|
|
762
|
-
* Primary phone number.
|
|
763
|
-
* Can be null if no phone number is provided.
|
|
764
|
-
* Format may vary (with/without country code, formatting).
|
|
765
|
-
*
|
|
766
|
-
* @example "+1-555-123-4567"
|
|
767
|
-
* @example "(555) 123-4567"
|
|
768
|
-
* @example "5551234567"
|
|
769
|
-
* @example null
|
|
770
|
-
*/
|
|
771
|
-
phone: string | null;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Address information with associated person's name.
|
|
775
|
-
* Extends the base Address interface with first and last name fields.
|
|
776
|
-
* Useful for shipping/billing addresses where the recipient name may differ from the customer.
|
|
777
|
-
*
|
|
778
|
-
* @interface PersonAddress
|
|
779
|
-
* @extends Address
|
|
780
|
-
* @example
|
|
781
|
-
* ```typescript
|
|
782
|
-
* const shippingAddress: PersonAddress = {
|
|
783
|
-
* first: "John",
|
|
784
|
-
* last: "Smith",
|
|
785
|
-
* address_1: "123 Main Street",
|
|
786
|
-
* address_2: "Apt 4B",
|
|
787
|
-
* city: "New York",
|
|
788
|
-
* country: "US",
|
|
789
|
-
* postal_code: "10001",
|
|
790
|
-
* region: "NY"
|
|
791
|
-
* };
|
|
792
|
-
*
|
|
793
|
-
* // Gift shipping to different recipient
|
|
794
|
-
* const giftAddress: PersonAddress = {
|
|
795
|
-
* first: "Jane",
|
|
796
|
-
* last: "Doe",
|
|
797
|
-
* address_1: "456 Oak Avenue",
|
|
798
|
-
* city: "Los Angeles",
|
|
799
|
-
* country: "US",
|
|
800
|
-
* postal_code: "90210",
|
|
801
|
-
* region: "CA"
|
|
802
|
-
* };
|
|
803
|
-
* ```
|
|
804
|
-
*/
|
|
805
|
-
interface PersonAddress extends Address {
|
|
806
|
-
/**
|
|
807
|
-
* First name of the person at this address.
|
|
808
|
-
* May differ from the customer's name for gift deliveries.
|
|
809
|
-
*
|
|
810
|
-
* @example "John"
|
|
811
|
-
* @example "Jane"
|
|
812
|
-
*/
|
|
813
|
-
first: string;
|
|
814
|
-
/**
|
|
815
|
-
* Last name of the person at this address.
|
|
816
|
-
* May differ from the customer's name for gift deliveries.
|
|
817
|
-
*
|
|
818
|
-
* @example "Smith"
|
|
819
|
-
* @example "Doe"
|
|
820
|
-
*/
|
|
821
|
-
last: string;
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Complete customer information combining personal details, contact info, and addresses.
|
|
825
|
-
* Represents a customer in an e-commerce or service system.
|
|
826
|
-
*
|
|
827
|
-
* @type Customer
|
|
828
|
-
* @example
|
|
829
|
-
* ```typescript
|
|
830
|
-
* const customer: Customer = {
|
|
831
|
-
* uid: "user_abc123",
|
|
832
|
-
* name: "John Michael Smith",
|
|
833
|
-
* displayName: "John Smith",
|
|
834
|
-
* first: "John",
|
|
835
|
-
* last: "Smith",
|
|
836
|
-
* gender: "male",
|
|
837
|
-
* birthdate: "1990-05-15",
|
|
838
|
-
* age: 33,
|
|
839
|
-
* email: "john.smith@example.com",
|
|
840
|
-
* phone: "+1-555-123-4567",
|
|
841
|
-
* billingAddress: {
|
|
842
|
-
* first: "John",
|
|
843
|
-
* last: "Smith",
|
|
844
|
-
* address_1: "123 Main Street",
|
|
845
|
-
* city: "New York",
|
|
846
|
-
* country: "US",
|
|
847
|
-
* postal_code: "10001",
|
|
848
|
-
* region: "NY"
|
|
849
|
-
* },
|
|
850
|
-
* shippingAddress: {
|
|
851
|
-
* first: "John",
|
|
852
|
-
* last: "Smith",
|
|
853
|
-
* address_1: "456 Work Plaza",
|
|
854
|
-
* address_2: "Suite 100",
|
|
855
|
-
* city: "New York",
|
|
856
|
-
* country: "US",
|
|
857
|
-
* postal_code: "10005",
|
|
858
|
-
* region: "NY"
|
|
859
|
-
* }
|
|
860
|
-
* };
|
|
861
|
-
*
|
|
862
|
-
* // Guest customer (no account)
|
|
863
|
-
* const guestCustomer: Customer = {
|
|
864
|
-
* uid: null,
|
|
865
|
-
* name: "Jane Doe",
|
|
866
|
-
* displayName: "Jane Doe",
|
|
867
|
-
* first: "Jane",
|
|
868
|
-
* last: "Doe",
|
|
869
|
-
* gender: null,
|
|
870
|
-
* email: "jane@example.com",
|
|
871
|
-
* phone: null
|
|
872
|
-
* };
|
|
873
|
-
* ```
|
|
874
|
-
*/
|
|
875
|
-
type Customer = Person & PersonContact & {
|
|
876
|
-
/**
|
|
877
|
-
* Unique identifier for the customer account.
|
|
878
|
-
* Can be null for guest customers who haven't created an account.
|
|
879
|
-
*
|
|
880
|
-
* @example "user_abc123"
|
|
881
|
-
* @example "cust_def456"
|
|
882
|
-
* @example null // Guest customer
|
|
883
|
-
*/
|
|
884
|
-
uid: string | null;
|
|
885
|
-
/**
|
|
886
|
-
* Billing address for payment and invoicing.
|
|
887
|
-
* Can be null if not yet provided.
|
|
888
|
-
*
|
|
889
|
-
* @example PersonAddress object with billing details
|
|
890
|
-
* @example null
|
|
891
|
-
*/
|
|
892
|
-
billingAddress?: PersonAddress | null;
|
|
893
|
-
/**
|
|
894
|
-
* Shipping address for order delivery.
|
|
895
|
-
* Can be null for digital products or if not yet provided.
|
|
896
|
-
* May differ from billing address.
|
|
897
|
-
*
|
|
898
|
-
* @example PersonAddress object with shipping details
|
|
899
|
-
* @example null
|
|
900
|
-
*/
|
|
901
|
-
shippingAddress?: PersonAddress | null;
|
|
902
|
-
};
|
|
903
|
-
type AttendeeStatus = "attending" | "checkedIn" | "cancelled" | "refunded" | "noShow" | "unknown" | string;
|
|
904
|
-
interface Attendee extends DataRecord {
|
|
905
|
-
/**
|
|
906
|
-
* Order ID, from /orders/:orderId
|
|
907
|
-
*/
|
|
908
|
-
orderId: string;
|
|
909
|
-
/**
|
|
910
|
-
* For event it will be the ticket's id
|
|
911
|
-
*/
|
|
912
|
-
offeringId: string;
|
|
913
|
-
/**
|
|
914
|
-
*
|
|
915
|
-
*/
|
|
916
|
-
orderNumber: string;
|
|
917
|
-
uid: string | null;
|
|
918
|
-
offeringSnapshot: Partial<Offering>;
|
|
919
|
-
profile: Customer | null;
|
|
920
|
-
checkedIn: boolean;
|
|
921
|
-
barcodes: string[];
|
|
922
|
-
version: ApiVersion;
|
|
923
|
-
status: AttendeeStatus | string;
|
|
924
|
-
index: number;
|
|
925
|
-
}
|
|
926
|
-
interface BuzzBuilder {
|
|
927
|
-
countLabel: string;
|
|
928
|
-
profiles: {
|
|
929
|
-
id: string;
|
|
930
|
-
name: string;
|
|
931
|
-
photoURL: string;
|
|
932
|
-
}[];
|
|
933
|
-
}
|
|
934
|
-
interface EventFeature {
|
|
935
|
-
id: string;
|
|
936
|
-
title: string;
|
|
937
|
-
enabled: boolean;
|
|
938
|
-
order: number;
|
|
939
|
-
widgetUri: string;
|
|
940
|
-
iconName?: string;
|
|
941
|
-
logoUri?: string;
|
|
942
|
-
description: string;
|
|
943
|
-
type: string;
|
|
944
|
-
version?: string;
|
|
945
|
-
key: string;
|
|
946
|
-
meta?: any;
|
|
947
|
-
data: any;
|
|
948
|
-
}
|
|
949
|
-
/**
|
|
950
|
-
* A simple point geometry consisting of latitude and longitude.
|
|
951
|
-
*
|
|
952
|
-
* @typedef {Object} GeometryPoint
|
|
953
|
-
* @property {number} lat - Latitude of the point.
|
|
954
|
-
* @property {number} lng - Longitude of the point.
|
|
955
|
-
*
|
|
956
|
-
* @example
|
|
957
|
-
* {
|
|
958
|
-
* lat: 40.7128,
|
|
959
|
-
* lng: -74.0060
|
|
960
|
-
* }
|
|
961
|
-
*/
|
|
962
|
-
interface GeometryPoint {
|
|
963
|
-
lat: number;
|
|
964
|
-
lng: number;
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Represents the geometry of a location, including optional viewport and zoom level.
|
|
968
|
-
*
|
|
969
|
-
* @typedef {Object} LocationGeometry
|
|
970
|
-
* @property {number} lat - Latitude of the location.
|
|
971
|
-
* @property {number} lng - Longitude of the location.
|
|
972
|
-
* @property {number} [zoom] - Optional zoom level representing map detail.
|
|
973
|
-
* @property {{ northeast: GeometryPoint, southwest: GeometryPoint }} [viewport] - Optional viewport rectangle surrounding the location.
|
|
974
|
-
* @property {string} [vicinity] - Optional vicinity description.
|
|
975
|
-
* @property {string} [region] - Optional region.
|
|
976
|
-
* @property {string} [locality] - Optional locality.
|
|
977
|
-
* @property {string} [geoHash] - Optional geohash for spatial indexing.
|
|
978
|
-
*
|
|
979
|
-
* @example
|
|
980
|
-
* {
|
|
981
|
-
* lat: 37.7749,
|
|
982
|
-
* lng: -122.4194,
|
|
983
|
-
* zoom: 15,
|
|
984
|
-
* viewport: {
|
|
985
|
-
* northeast: { lat: 37.785, lng: -122.41 },
|
|
986
|
-
* southwest: { lat: 37.765, lng: -122.43 }
|
|
987
|
-
* },
|
|
988
|
-
* vicinity: "Near Mission District",
|
|
989
|
-
* region: "California",
|
|
990
|
-
* locality: "San Francisco",
|
|
991
|
-
* geoHash: "9q8yy"
|
|
992
|
-
* }
|
|
993
|
-
*/
|
|
994
|
-
interface LocationGeometry extends GeometryPoint {
|
|
995
|
-
zoom?: number;
|
|
996
|
-
viewport?: {
|
|
997
|
-
northeast: GeometryPoint;
|
|
998
|
-
southwest: GeometryPoint;
|
|
999
|
-
};
|
|
1000
|
-
vicinity?: string;
|
|
1001
|
-
region?: string;
|
|
1002
|
-
locality?: string;
|
|
1003
|
-
geoHash?: string;
|
|
1004
|
-
}
|
|
1005
|
-
/**
|
|
1006
|
-
* A structured representation of a physical location, including address and coordinates.
|
|
1007
|
-
*
|
|
1008
|
-
* @typedef {Object} Location
|
|
1009
|
-
* @property {string | null} venueId - The ID of the venue associated with this location.
|
|
1010
|
-
* @property {string | null} placeId - The Google Place ID associated with this location.
|
|
1011
|
-
* @property {string} name - Name of the location (e.g., venue or custom name).
|
|
1012
|
-
* @property {LocationGeometry | null} geometry - Geospatial data including lat/lng, zoom, and viewport.
|
|
1013
|
-
* @property {Address | null} address - Structured postal address.
|
|
1014
|
-
* @property {string} [timezone] - IANA time zone (e.g., "America/New_York").
|
|
1015
|
-
*
|
|
1016
|
-
* @example
|
|
1017
|
-
* {
|
|
1018
|
-
* venueId: "abc123",
|
|
1019
|
-
* placeId: "ChIJVXealLU_xkcRja_At0z9AGY",
|
|
1020
|
-
* name: "The Fillmore",
|
|
1021
|
-
* geometry: {
|
|
1022
|
-
* lat: 37.784,
|
|
1023
|
-
* lng: -122.433,
|
|
1024
|
-
* zoom: 14,
|
|
1025
|
-
* viewport: {
|
|
1026
|
-
* northeast: { lat: 37.788, lng: -122.429 },
|
|
1027
|
-
* southwest: { lat: 37.780, lng: -122.437 }
|
|
1028
|
-
* }
|
|
1029
|
-
* },
|
|
1030
|
-
* address: {
|
|
1031
|
-
* address_1: "1805 Geary Blvd",
|
|
1032
|
-
* city: "San Francisco",
|
|
1033
|
-
* state: "CA",
|
|
1034
|
-
* postalCode: "94115",
|
|
1035
|
-
* country: "USA"
|
|
1036
|
-
* },
|
|
1037
|
-
* timezone: "America/Los_Angeles"
|
|
1038
|
-
* }
|
|
1039
|
-
*/
|
|
1040
|
-
interface Location {
|
|
1041
|
-
venueId: string | null;
|
|
1042
|
-
placeId: string | null;
|
|
1043
|
-
name: string;
|
|
1044
|
-
geometry: LocationGeometry | null;
|
|
1045
|
-
address: Address | null;
|
|
1046
|
-
timezone?: string;
|
|
1047
|
-
}
|
|
1048
|
-
interface VenueBase {
|
|
1049
|
-
id: string;
|
|
1050
|
-
name: string;
|
|
1051
|
-
formattedAddress: string;
|
|
1052
|
-
placeId?: string | null;
|
|
1053
|
-
tz: string;
|
|
1054
|
-
logo: Photo | null;
|
|
1055
|
-
public: boolean;
|
|
1056
|
-
address: Address | null;
|
|
1057
|
-
slug: string | null;
|
|
1058
|
-
}
|
|
1059
|
-
interface Venue extends VenueBase {
|
|
1060
|
-
claimed: boolean;
|
|
1061
|
-
refId?: string;
|
|
1062
|
-
description?: MultipartText;
|
|
1063
|
-
capacity?: number | null;
|
|
1064
|
-
types: string[];
|
|
1065
|
-
photos?: Photo[];
|
|
1066
|
-
hoursOfOperation: string[];
|
|
1067
|
-
phoneNumber?: string | null;
|
|
1068
|
-
priceLevel: number | null;
|
|
1069
|
-
rating: {
|
|
1070
|
-
google: number | null;
|
|
1071
|
-
};
|
|
1072
|
-
[key: string]: any;
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* @description Status of the event lifecycle.
|
|
1076
|
-
*
|
|
1077
|
-
* - `archived`: The event is archived and no longer visible in listings.
|
|
1078
|
-
* - `draft`: The event is still being edited and not yet published.
|
|
1079
|
-
* - `live`: The event is published and accepting actions (e.g., ticket sales).
|
|
1080
|
-
* - `started`: The event has begun.
|
|
1081
|
-
* - `ended`: The event has ended.
|
|
1082
|
-
* - `completed`: The event has concluded successfully and is finalized.
|
|
1083
|
-
* - `canceled`: The event was canceled and is no longer active.
|
|
1084
|
-
*/
|
|
1085
|
-
type EventStatus = "archived" | "draft" | "live" | "started" | "ended" | "completed" | "canceled";
|
|
1086
|
-
interface EventBase extends DataRecord {
|
|
1087
|
-
/**
|
|
1088
|
-
* @example "Spring Concert"
|
|
1089
|
-
* @faker name.firstName
|
|
1090
|
-
* @x-faker name.firstName
|
|
1091
|
-
*/
|
|
1092
|
-
name: string;
|
|
1093
|
-
summary: string;
|
|
1094
|
-
companyId: string;
|
|
1095
|
-
/**
|
|
1096
|
-
* @description The timezone in which the event is taking place.
|
|
1097
|
-
* @example "America/New_York"
|
|
1098
|
-
* @example "Europe/London"
|
|
1099
|
-
* @example "Asia/Tokyo"
|
|
1100
|
-
*/
|
|
1101
|
-
tz: string;
|
|
1102
|
-
/**
|
|
1103
|
-
* @description The start date and time of the event in ISO 8601 format.
|
|
1104
|
-
* @example "2023-10-01T12:00:00Z"
|
|
1105
|
-
*/
|
|
1106
|
-
start: string;
|
|
1107
|
-
/**
|
|
1108
|
-
* @description The end date and time of the event in ISO 8601 format.
|
|
1109
|
-
* @example "2023-10-01T14:00:00Z"
|
|
1110
|
-
*/
|
|
1111
|
-
end: string;
|
|
1112
|
-
isSeries?: boolean;
|
|
1113
|
-
/**
|
|
1114
|
-
* @description The status of the event in its lifecycle.
|
|
1115
|
-
* @example "draft"
|
|
1116
|
-
* @example "live"
|
|
1117
|
-
* @example "ended"
|
|
1118
|
-
*/
|
|
1119
|
-
status: EventStatus;
|
|
1120
|
-
/**
|
|
1121
|
-
* @x-faker { url: faker.image.imageUrl() }
|
|
1122
|
-
*/
|
|
1123
|
-
flyer?: Photo | null;
|
|
1124
|
-
venue?: VenueBase | null;
|
|
1125
|
-
/**
|
|
1126
|
-
* @description Curerncy used for the event.
|
|
1127
|
-
* @example "USD"
|
|
1128
|
-
*/
|
|
1129
|
-
currency: string;
|
|
1130
|
-
/**
|
|
1131
|
-
* @description Is the event public?
|
|
1132
|
-
* @example true
|
|
1133
|
-
*/
|
|
1134
|
-
public: boolean;
|
|
1135
|
-
location?: Location;
|
|
1136
|
-
organizerId: string;
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* @openapi
|
|
1140
|
-
* @description EventProfile respresent a public view of an event
|
|
1141
|
-
*/
|
|
1142
|
-
interface EventProfile extends EventBase {
|
|
1143
|
-
meta?: any;
|
|
1144
|
-
organizer: any;
|
|
1145
|
-
url?: string;
|
|
1146
|
-
slug: string;
|
|
1147
|
-
channels: string[];
|
|
1148
|
-
description: MultipartText;
|
|
1149
|
-
widgets: EventFeature[];
|
|
1150
|
-
ticketPrices: string[];
|
|
1151
|
-
buzzBuilder?: BuzzBuilder | null;
|
|
1152
|
-
venue?: VenueBase | null;
|
|
1153
|
-
tags: string[];
|
|
1154
|
-
searchTags: string[];
|
|
1155
|
-
sections: string[];
|
|
1156
|
-
priceRange?: {
|
|
1157
|
-
min?: string;
|
|
1158
|
-
max?: string;
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Represents a discount coupon that can be applied to one or more offerings in an event platform.
|
|
1163
|
-
*
|
|
1164
|
-
* @export
|
|
1165
|
-
*/
|
|
1166
|
-
interface Coupon$1 extends VersionedDataRecord {
|
|
1167
|
-
/**
|
|
1168
|
-
* ID of the company that issued this coupon.
|
|
1169
|
-
* @example "company_123abc"
|
|
1170
|
-
*/
|
|
1171
|
-
companyId: string;
|
|
1172
|
-
/**
|
|
1173
|
-
* Internal description for the coupon.
|
|
1174
|
-
* This is not necessarily visible to users.
|
|
1175
|
-
* @example "Early bird discount for spring events"
|
|
1176
|
-
*/
|
|
1177
|
-
description: string;
|
|
1178
|
-
/**
|
|
1179
|
-
* The code used to redeem this coupon during checkout.
|
|
1180
|
-
* For public or coded discounts.
|
|
1181
|
-
* @example "SPRING2025"
|
|
1182
|
-
*/
|
|
1183
|
-
code: string;
|
|
1184
|
-
/**
|
|
1185
|
-
* Type of coupon — determines how it's distributed or applied.
|
|
1186
|
-
* @example "coded"
|
|
1187
|
-
*/
|
|
1188
|
-
type: "access" | "coded" | "public" | "hold";
|
|
1189
|
-
/**
|
|
1190
|
-
* Fixed amount to deduct from the order total.
|
|
1191
|
-
* This is a currency-less value that matches the event or order currency.
|
|
1192
|
-
* Example: `10.00` = $10.00 off.
|
|
1193
|
-
* @minimum 0
|
|
1194
|
-
* @maximum 99999
|
|
1195
|
-
* @example 10.0
|
|
1196
|
-
*/
|
|
1197
|
-
amountOff: number;
|
|
1198
|
-
/**
|
|
1199
|
-
* Percentage to deduct from the item or order total.
|
|
1200
|
-
* Range is 0–100. Use 0 for no percentage-based discount.
|
|
1201
|
-
* @minimum 0
|
|
1202
|
-
* @maximum 100
|
|
1203
|
-
* @example 20.0
|
|
1204
|
-
*/
|
|
1205
|
-
percentOff: number;
|
|
1206
|
-
/**
|
|
1207
|
-
* Total number of times this coupon can be used.
|
|
1208
|
-
* A value of `0` means unlimited usage.
|
|
1209
|
-
* @example 100
|
|
1210
|
-
*/
|
|
1211
|
-
limit: number;
|
|
1212
|
-
/**
|
|
1213
|
-
* Number of times this coupon has been redeemed.
|
|
1214
|
-
* Read-only field.
|
|
1215
|
-
* @readonly
|
|
1216
|
-
* @example 42
|
|
1217
|
-
*/
|
|
1218
|
-
quantitySold: number;
|
|
1219
|
-
/**
|
|
1220
|
-
* List of offering IDs (e.g., ticket classes) this coupon applies to.
|
|
1221
|
-
* If empty, the coupon applies to all eligible offerings in its context.
|
|
1222
|
-
* @example ["off_123abc", "off_456def"]
|
|
1223
|
-
*/
|
|
1224
|
-
offeringIds: string[];
|
|
1225
|
-
/**
|
|
1226
|
-
* List of context IDs (e.g., event, venue, or organizer) this coupon is valid for.
|
|
1227
|
-
* Follows the format: "evt_xxx", "org_xxx", etc.
|
|
1228
|
-
* @example ["evt_abc123", "org_def456"]
|
|
1229
|
-
*/
|
|
1230
|
-
contextIds: ContextId[];
|
|
1231
|
-
/**
|
|
1232
|
-
* Time-based constraints that control when the coupon is active and when it expires.
|
|
1233
|
-
* Supports absolute dates or relative time offsets (in seconds) from event start.
|
|
1234
|
-
*
|
|
1235
|
-
* - If `start` is omitted, the coupon is valid immediately.
|
|
1236
|
-
* - If `end` is omitted, the coupon remains valid until the event ends.
|
|
1237
|
-
*
|
|
1238
|
-
* @example {
|
|
1239
|
-
* start: { date: "2025-04-01T00:00:00" },
|
|
1240
|
-
* end: { secondsBefore: 3600 }
|
|
1241
|
-
* }
|
|
1242
|
-
*/
|
|
1243
|
-
constraints: {
|
|
1244
|
-
start?: TimeOrOffset;
|
|
1245
|
-
end?: TimeOrOffset;
|
|
1246
|
-
};
|
|
1247
|
-
/**
|
|
1248
|
-
* Current status of the coupon for administrative purposes.
|
|
1249
|
-
* Determines whether it can be redeemed at checkout.
|
|
1250
|
-
* @example "active"
|
|
1251
|
-
*/
|
|
1252
|
-
status: "active" | "expired" | "disabled" | "sold_out";
|
|
1253
|
-
/**
|
|
1254
|
-
* Schema version identifier.
|
|
1255
|
-
* Used to ensure compatibility between coupon formats.
|
|
1256
|
-
* @example "2025-01-10"
|
|
1257
|
-
*/
|
|
1258
|
-
version: ApiVersion;
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Cost breakdown for a specific item in the order.
|
|
1262
|
-
* Extends the standard `OfferingCosts` with totals calculated for quantity and discounts.
|
|
1263
|
-
*
|
|
1264
|
-
* @export
|
|
1265
|
-
*/
|
|
1266
|
-
interface OrderItemCosts extends OfferingCosts {
|
|
1267
|
-
/**
|
|
1268
|
-
* Total cost of tickets before taxes, fees, and discounts.
|
|
1269
|
-
* @example { amount: 5000, currency: "USD" }
|
|
1270
|
-
*/
|
|
1271
|
-
subtotal: CurrencyAmount;
|
|
1272
|
-
/**
|
|
1273
|
-
* Total discount amount applied to this item.
|
|
1274
|
-
* @example { amount: 1000, currency: "USD" }
|
|
1275
|
-
*/
|
|
1276
|
-
discount: CurrencyAmount;
|
|
1277
|
-
/**
|
|
1278
|
-
* Total price before discounts.
|
|
1279
|
-
* Equal to subtotal + fee, before subtracting discount.
|
|
1280
|
-
* @example { amount: 6000, currency: "USD" }
|
|
1281
|
-
*/
|
|
1282
|
-
preDiscount: CurrencyAmount;
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* Represents an individual item within an order.
|
|
1286
|
-
*
|
|
1287
|
-
* @export
|
|
1288
|
-
*/
|
|
1289
|
-
interface OrderItem {
|
|
1290
|
-
/**
|
|
1291
|
-
* Unique ID for this order item.
|
|
1292
|
-
* @example "item_abc123"
|
|
1293
|
-
*/
|
|
1294
|
-
id: string;
|
|
1295
|
-
purchaseGroupId: string | null;
|
|
1296
|
-
tableCommitment?: {
|
|
1297
|
-
id: string;
|
|
1298
|
-
groupSize: number;
|
|
1299
|
-
ticketsPurchased: number;
|
|
1300
|
-
completed: boolean;
|
|
1301
|
-
};
|
|
1302
|
-
/**
|
|
1303
|
-
* Type of offering (e.g., ticket, package, merch).
|
|
1304
|
-
* @example "ticket"
|
|
1305
|
-
*/
|
|
1306
|
-
offeringType: OfferingType;
|
|
1307
|
-
/**
|
|
1308
|
-
* ID of the offering purchased.
|
|
1309
|
-
* @example "evt_abc123_off_001"
|
|
1310
|
-
*/
|
|
1311
|
-
offeringId: string;
|
|
1312
|
-
/**
|
|
1313
|
-
* Quantity purchased of this item.
|
|
1314
|
-
* @example 2
|
|
1315
|
-
*/
|
|
1316
|
-
quantity: number;
|
|
1317
|
-
/**
|
|
1318
|
-
* Full cost breakdown for this item.
|
|
1319
|
-
*/
|
|
1320
|
-
costs: OrderItemCosts;
|
|
1321
|
-
/**
|
|
1322
|
-
* If this item is included as part of a package, this is the ID of the parent item.
|
|
1323
|
-
* Otherwise, null.
|
|
1324
|
-
* @example null
|
|
1325
|
-
*/
|
|
1326
|
-
includedWithItemId: string | null;
|
|
1327
|
-
/**
|
|
1328
|
-
* Breakdown of cost components (e.g., base, service fee, delivery).
|
|
1329
|
-
*/
|
|
1330
|
-
costComponents: CalculatedCostComponent[];
|
|
1331
|
-
/**
|
|
1332
|
-
* Any relevant metadata associated with this item.
|
|
1333
|
-
* This can include custom fields or additional information.
|
|
1334
|
-
* @example { "customField": "value" }
|
|
1335
|
-
*/
|
|
1336
|
-
meta?: null | {
|
|
1337
|
-
groups?: OfferingPurchaseGroupSetting;
|
|
1338
|
-
[key: string]: any;
|
|
1339
|
-
};
|
|
1340
|
-
details: string | null;
|
|
1341
|
-
options: any | null;
|
|
1342
|
-
offering: OrderItemOffering;
|
|
1343
|
-
}
|
|
1344
|
-
interface OrderItemOffering extends Pick<Offering, "id" | "name" | "type" | "description" | "sorting"> {
|
|
1345
|
-
costs?: OfferingCosts;
|
|
1346
|
-
/**
|
|
1347
|
-
* doc assicated with this offering in the DB.
|
|
1348
|
-
*
|
|
1349
|
-
* @example "events/1234567890/tickets/0987654321"
|
|
1350
|
-
*/
|
|
1351
|
-
refPath: string;
|
|
1352
|
-
}
|
|
1353
|
-
/**
|
|
1354
|
-
* Represents the resolved context associated with a cart session.
|
|
1355
|
-
* This may be an event, venue, or organizer, and is used to enrich the cart with metadata
|
|
1356
|
-
* needed for UI rendering and pricing logic without requiring repeated DB lookups.
|
|
1357
|
-
*
|
|
1358
|
-
* Typically stored in `cart.meta.resolvedContext`.
|
|
1359
|
-
*
|
|
1360
|
-
* @export
|
|
1361
|
-
*/
|
|
1362
|
-
interface ResolvedCartContext {
|
|
1363
|
-
/**
|
|
1364
|
-
* Unique identifier of the context entity.
|
|
1365
|
-
* Typically matches the cart's `contextId` (e.g., "evt_abc123").
|
|
1366
|
-
* @example "evt_abc123"
|
|
1367
|
-
*/
|
|
1368
|
-
id: string;
|
|
1369
|
-
/**
|
|
1370
|
-
* Human-readable title or name of the context entity.
|
|
1371
|
-
* Used for display in headers, summaries, and confirmations.
|
|
1372
|
-
* @example "Downtown Comedy Night"
|
|
1373
|
-
*/
|
|
1374
|
-
title: string;
|
|
1375
|
-
/**
|
|
1376
|
-
* Optional physical or virtual location of the event or venue.
|
|
1377
|
-
* Can include address, coordinates, or virtual link.
|
|
1378
|
-
*/
|
|
1379
|
-
location?: Location;
|
|
1380
|
-
/**
|
|
1381
|
-
* Optional logo, banner, or primary image representing the context.
|
|
1382
|
-
* Used in UI to visually identify the entity during checkout.
|
|
1383
|
-
*/
|
|
1384
|
-
logo?: Photo;
|
|
1385
|
-
/**
|
|
1386
|
-
* Optional description or summary of the context entity.
|
|
1387
|
-
* Provides additional information to the customer during checkout.
|
|
1388
|
-
* @example "Join us for a night of laughter with top comedians!"
|
|
1389
|
-
*/
|
|
1390
|
-
start: string;
|
|
1391
|
-
/**
|
|
1392
|
-
* Optional end date or time of the event or context entity.
|
|
1393
|
-
* Useful for events with a specific duration or schedule.
|
|
1394
|
-
* @example "2023-10-15T22:00:00Z"
|
|
1395
|
-
*/
|
|
1396
|
-
end?: string;
|
|
1397
|
-
/**
|
|
1398
|
-
* A map of offerings relevant to this context (e.g., ticket types, merch).
|
|
1399
|
-
* Stored as a record keyed by offering ID to allow fast lookup.
|
|
1400
|
-
* Each value is a partial offering object, intended for display, validation, or pricing.
|
|
1401
|
-
* @example {
|
|
1402
|
-
* "off_123abc": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "VIP Ticket", price: 3000 }),
|
|
1403
|
-
* "off_456def": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "T-Shirt", price: 2000 }}
|
|
1404
|
-
* }
|
|
1405
|
-
*/
|
|
1406
|
-
offerings?: Record<string, ResolvedCartContextOffering>;
|
|
1407
|
-
config: any;
|
|
1408
|
-
}
|
|
1409
|
-
interface ResolvedCartContextOffering {
|
|
1410
|
-
path: string;
|
|
1411
|
-
offering: Offering;
|
|
1412
|
-
}
|
|
1413
|
-
type CouponSummary = Pick<Coupon$1, "id" | "code" | "amountOff" | "percentOff" | "offeringIds">;
|
|
1414
|
-
type OrderStatus = "placed" | "completed" | "attending" | "cancelled" | "refunded" | "started" | "pending" | "abandoned";
|
|
1415
|
-
interface OrderCosts {
|
|
1416
|
-
subtotal: CurrencyAmount;
|
|
1417
|
-
fee: CurrencyAmount;
|
|
1418
|
-
tax: CurrencyAmount;
|
|
1419
|
-
discount: CurrencyAmount;
|
|
1420
|
-
delivery: CurrencyAmount;
|
|
1421
|
-
gross: CurrencyAmount;
|
|
1422
|
-
preDiscount: CurrencyAmount;
|
|
1423
|
-
total: CurrencyAmount;
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Represents an order in the system.
|
|
1427
|
-
*
|
|
1428
|
-
* @export
|
|
1429
|
-
*/
|
|
1430
|
-
interface Order extends VCDataRecord {
|
|
1431
|
-
/**
|
|
1432
|
-
* Human-readable order number for customer reference.
|
|
1433
|
-
* Often used in emails and receipts.
|
|
1434
|
-
* @example "GW-12345679"
|
|
1435
|
-
*/
|
|
1436
|
-
orderNumber: string;
|
|
1437
|
-
/**
|
|
1438
|
-
* @description The currency code used for this order in ISO 4217 format.
|
|
1439
|
-
* @example "USD"
|
|
1440
|
-
*
|
|
1441
|
-
* @pattern ^[A-Z]{3}$
|
|
1442
|
-
*/
|
|
1443
|
-
currency: string;
|
|
1444
|
-
/**
|
|
1445
|
-
* List of applied coupons used in the order.
|
|
1446
|
-
* Supports multiple entries based on organizer preferences.
|
|
1447
|
-
*/
|
|
1448
|
-
coupons?: CouponSummary[];
|
|
1449
|
-
organizerId: string;
|
|
1450
|
-
/**
|
|
1451
|
-
* Namespaced identifier indicating what the order is associated with.
|
|
1452
|
-
* Format: "{type}_{id}", where type is "evt", "ven", or "org".
|
|
1453
|
-
* @example "evt_56k2cf348"
|
|
1454
|
-
* @example "org_9912ff8"
|
|
1455
|
-
*/
|
|
1456
|
-
contextId: ContextId;
|
|
1457
|
-
/**
|
|
1458
|
-
* Detailed cost breakdown for this order.
|
|
1459
|
-
*/
|
|
1460
|
-
costs: OrderCosts;
|
|
1461
|
-
/**
|
|
1462
|
-
* Customer information related to this order.
|
|
1463
|
-
*/
|
|
1464
|
-
customer: Customer;
|
|
1465
|
-
/**
|
|
1466
|
-
* The current status of the order.
|
|
1467
|
-
* @example "paid"
|
|
1468
|
-
*/
|
|
1469
|
-
status: OrderStatus;
|
|
1470
|
-
/**
|
|
1471
|
-
* A list of individual items included in the order.
|
|
1472
|
-
*/
|
|
1473
|
-
items: OrderItem[];
|
|
1474
|
-
/**
|
|
1475
|
-
* Agreement flags for terms and marketing opt-ins.
|
|
1476
|
-
*/
|
|
1477
|
-
agreements: {
|
|
1478
|
-
/**
|
|
1479
|
-
* Whether the customer accepted the organizer’s custom terms.
|
|
1480
|
-
* @example true
|
|
1481
|
-
*/
|
|
1482
|
-
agreedToOrganizerTerms?: boolean;
|
|
1483
|
-
/**
|
|
1484
|
-
* Whether the customer accepted the platform-wide terms of service.
|
|
1485
|
-
* @example true
|
|
1486
|
-
*/
|
|
1487
|
-
agreedToTerms?: boolean;
|
|
1488
|
-
/**
|
|
1489
|
-
* Whether the customer opted in to receive marketing emails.
|
|
1490
|
-
* @example false
|
|
1491
|
-
*/
|
|
1492
|
-
emailOptIn?: boolean;
|
|
1493
|
-
/**
|
|
1494
|
-
* Whether the customer opted in to receive marketing SMS messages.
|
|
1495
|
-
* @example false
|
|
1496
|
-
*/
|
|
1497
|
-
textOptIn?: boolean;
|
|
1498
|
-
};
|
|
1499
|
-
/**
|
|
1500
|
-
* Responses to dynamic questions during checkout (e.g. survey or registration).
|
|
1501
|
-
* @example { "tshirtSize": "M", "vipNewsletter": true }
|
|
1502
|
-
*/
|
|
1503
|
-
answers: {
|
|
1504
|
-
[questionId: string]: string | boolean;
|
|
1505
|
-
};
|
|
1506
|
-
/**
|
|
1507
|
-
* Freeform object containing metadata forwarded from the partner site
|
|
1508
|
-
* or embedding context. Can include UTM tags, user traits, campaign IDs, etc.
|
|
1509
|
-
* @example { utm_campaign: "spring_launch", partner: "venue_123" }
|
|
1510
|
-
*/
|
|
1511
|
-
forwarded: any;
|
|
1512
|
-
/**
|
|
1513
|
-
* Internal or computed metadata associated with the order.
|
|
1514
|
-
* May include fulfillment flags, debugging info, or derived calculations.
|
|
1515
|
-
* @example { preview: true, manuallyAdjusted: true }
|
|
1516
|
-
*/
|
|
1517
|
-
meta: {
|
|
1518
|
-
/**
|
|
1519
|
-
* Display context (event, venue, organizer) for rendering and logic.
|
|
1520
|
-
*/
|
|
1521
|
-
resolvedContext?: ResolvedCartContext;
|
|
1522
|
-
/**
|
|
1523
|
-
* Cost components to calculate the cart costs.
|
|
1524
|
-
*
|
|
1525
|
-
* @ignore
|
|
1526
|
-
*/
|
|
1527
|
-
costComponents?: CostComponent[];
|
|
1528
|
-
/**
|
|
1529
|
-
* Snapshot of when pricing was calculated and locked.
|
|
1530
|
-
* Useful for honoring totals during a grace window.
|
|
1531
|
-
*/
|
|
1532
|
-
priceLock?: {
|
|
1533
|
-
lockedAt: string;
|
|
1534
|
-
ttl?: number;
|
|
1535
|
-
};
|
|
1536
|
-
/**
|
|
1537
|
-
* Any additional internal system flags, A/B test conditions, or
|
|
1538
|
-
* non-critical partner payloads.
|
|
1539
|
-
*/
|
|
1540
|
-
[key: string]: any;
|
|
1541
|
-
};
|
|
1542
|
-
/**
|
|
1543
|
-
* Session and request context captured at the time of order creation.
|
|
1544
|
-
* Includes IPs, referrer, user agent, cart session ID, and tracking info.
|
|
1545
|
-
*/
|
|
1546
|
-
context: OrderContext;
|
|
1547
|
-
/**
|
|
1548
|
-
* userId
|
|
1549
|
-
*/
|
|
1550
|
-
uid: string | null;
|
|
1551
|
-
version: ApiVersion;
|
|
1552
|
-
}
|
|
1553
|
-
type OrderContext = ({
|
|
1554
|
-
type: "event";
|
|
1555
|
-
event: EventProfile;
|
|
1556
|
-
venue?: Venue;
|
|
1557
|
-
} | {
|
|
1558
|
-
type: "venue";
|
|
1559
|
-
event?: EventProfile;
|
|
1560
|
-
venue: Venue;
|
|
1561
|
-
}) & {
|
|
1562
|
-
[key: string]: any;
|
|
1563
|
-
};
|
|
1564
|
-
interface OrderContext$1 {
|
|
1565
|
-
/**
|
|
1566
|
-
* IP addresses associated with the user request.
|
|
1567
|
-
* Typically includes forwarded IPs and direct client IP.
|
|
1568
|
-
* @example ["203.0.113.1", "10.0.0.1"]
|
|
1569
|
-
*/
|
|
1570
|
-
ipAddresses: string[];
|
|
1571
|
-
/**
|
|
1572
|
-
* Raw User-Agent header from the client request.
|
|
1573
|
-
* @example "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
|
|
1574
|
-
*/
|
|
1575
|
-
userAgent: string;
|
|
1576
|
-
/**
|
|
1577
|
-
* The referring URL from which the cart or checkout was initiated.
|
|
1578
|
-
* May be a partner site, marketing page, or event listing.
|
|
1579
|
-
* @example "https://partner.example.com/tickets/event123"
|
|
1580
|
-
*/
|
|
1581
|
-
referrer: string;
|
|
1582
|
-
/**
|
|
1583
|
-
* Authenticated user ID, or null for anonymous guests.
|
|
1584
|
-
* @example "uid_456def"
|
|
1585
|
-
*/
|
|
1586
|
-
uid: string | null;
|
|
1587
|
-
/**
|
|
1588
|
-
* The unique cart session ID assigned at the time the cart was created.
|
|
1589
|
-
* Helps track cart attribution across systems.
|
|
1590
|
-
* @example "cart_sess_abc123"
|
|
1591
|
-
*/
|
|
1592
|
-
cartSessionId: string;
|
|
1593
|
-
/**
|
|
1594
|
-
* (Optional) Origin domain name if embedded or white-labeled.
|
|
1595
|
-
* Can help identify partner portals or iframe referrers.
|
|
1596
|
-
* @example "examplepartner.com"
|
|
1597
|
-
*/
|
|
1598
|
-
originDomain?: string;
|
|
1599
|
-
tracking?: Record<string, string>;
|
|
1600
|
-
forward?: Record<string, any>;
|
|
1601
|
-
}
|
|
1602
|
-
type StartCartSessionInput = {
|
|
1603
|
-
contextId: string;
|
|
1604
|
-
sessionContext: Partial<OrderContext$1>;
|
|
1605
|
-
};
|
|
1606
|
-
type CartSessionItemOffering = OrderItemOffering & Pick<Offering, "options" | "maximumQuantity" | "minimumQuantity" | "status" | "includes">;
|
|
1607
|
-
type CartSessionItem = Pick<OrderItem, "id" | "details" | "offeringId" | "quantity" | "options" | "purchaseGroupId"> & {
|
|
1608
|
-
costs?: OrderItemCosts;
|
|
1609
|
-
offering: CartSessionItemOffering;
|
|
1610
|
-
};
|
|
1611
|
-
/**
|
|
1612
|
-
* Represents a temporary or persisted cart before order placement.
|
|
1613
|
-
* Focuses on user intent and checkout prep, not post-purchase records.
|
|
1614
|
-
*
|
|
1615
|
-
* @export
|
|
1616
|
-
*/
|
|
1617
|
-
interface CartSession extends DataRecord, Pick<Order, "currency" | "contextId" | "version" | "coupons" | "companyId" | "organizerId"> {
|
|
1618
|
-
orderId?: string;
|
|
1619
|
-
orderNumber?: string;
|
|
1620
|
-
/**
|
|
1621
|
-
* Authenticated user ID, if available.
|
|
1622
|
-
* @example "uid_123abc"
|
|
1623
|
-
*/
|
|
1624
|
-
uid: string | null;
|
|
1625
|
-
/**
|
|
1626
|
-
* Optional snapshot of customer info entered during cart fill.
|
|
1627
|
-
* Not required and not final.
|
|
1628
|
-
*
|
|
1629
|
-
* @schema lazy(() => customerSchema).optional()
|
|
1630
|
-
*/
|
|
1631
|
-
customer?: Partial<Customer>;
|
|
1632
|
-
/**
|
|
1633
|
-
* @schema lazy(() => orderContextSchema).optional()
|
|
1634
|
-
*/
|
|
1635
|
-
context: Partial<OrderContext$1>;
|
|
1636
|
-
/**
|
|
1637
|
-
* Items the user has added to their cart.
|
|
1638
|
-
*/
|
|
1639
|
-
items: CartSessionItem[];
|
|
1640
|
-
/**
|
|
1641
|
-
* Estimated totals based on current cart state.
|
|
1642
|
-
* These values are subject to recalculation before checkout.
|
|
1643
|
-
*/
|
|
1644
|
-
costs?: {
|
|
1645
|
-
subtotal: CurrencyAmount;
|
|
1646
|
-
discount: CurrencyAmount;
|
|
1647
|
-
tax: CurrencyAmount;
|
|
1648
|
-
fee: CurrencyAmount;
|
|
1649
|
-
delivery: CurrencyAmount;
|
|
1650
|
-
total: CurrencyAmount;
|
|
1651
|
-
};
|
|
1652
|
-
paymentStatus: "pending" | "confirmed" | "failed" | "refunded";
|
|
1653
|
-
/**
|
|
1654
|
-
* Stripe PaymentIntent ID linked to this cart, if created.
|
|
1655
|
-
* Used for confirming payment on the backend.
|
|
1656
|
-
* @example "pi_1ABCXYZ..."
|
|
1657
|
-
*/
|
|
1658
|
-
paymentIntentId?: string;
|
|
1659
|
-
/**
|
|
1660
|
-
* Stripe PaymentIntent client secret, used by frontend (e.g. Stripe.js).
|
|
1661
|
-
* Required for completing the payment flow.
|
|
1662
|
-
* @example "pi_1ABCXYZ..._secret_456"
|
|
1663
|
-
*/
|
|
1664
|
-
paymentIntentClientSecret?: string;
|
|
1665
|
-
/**
|
|
1666
|
-
* Partner-forwarded data (e.g. utm, session metadata).
|
|
1667
|
-
*/
|
|
1668
|
-
forwarded?: any;
|
|
1669
|
-
/**
|
|
1670
|
-
* Customer answers
|
|
1671
|
-
*/
|
|
1672
|
-
customerAnswers?: any;
|
|
1673
|
-
status: "started" | "completed" | "stale" | "abandoned" | "cancelled";
|
|
1674
|
-
meta: CartSessionMeta;
|
|
1675
|
-
}
|
|
1676
|
-
type StaleMeta = {
|
|
1677
|
-
/**
|
|
1678
|
-
* Hard stale time in milliseconds.
|
|
1679
|
-
* After this time, the cart is considered abandoned.
|
|
1680
|
-
*/
|
|
1681
|
-
hard: number;
|
|
1682
|
-
/**
|
|
1683
|
-
* Soft stale time in milliseconds.
|
|
1684
|
-
* After this time, the cart is considered abandoned.
|
|
1685
|
-
* This is the last change+idle, no later than hard time.
|
|
1686
|
-
*/
|
|
1687
|
-
soft: number;
|
|
1688
|
-
/**
|
|
1689
|
-
* Idle time in milliseconds.s
|
|
1690
|
-
*/
|
|
1691
|
-
idle: number;
|
|
1692
|
-
};
|
|
1693
|
-
type CartSessionMeta = Partial<Pick<Order, "meta">> & {
|
|
1694
|
-
paymentIntent?: any;
|
|
1695
|
-
/** policy for cart to become abandon */
|
|
1696
|
-
stale: StaleMeta;
|
|
1697
|
-
/**
|
|
1698
|
-
* Any additional internal system flags, A/B test conditions, or
|
|
1699
|
-
* non-critical partner payloads.
|
|
1700
|
-
*/
|
|
1701
|
-
[key: string]: any;
|
|
1702
|
-
};
|
|
1703
|
-
type UpdatableCartSession = Pick<CartSession, "customer" | "items" | "customerAnswers" | "forwarded">;
|
|
1
|
+
import { PaginatedRequest, PaginatedResponse, EventProfile, Ticket, Attendee, Order, StartCartSessionInput, CartSession, UpdatableCartSession } from '@cohostvip/cohost-types';
|
|
2
|
+
export * from '@cohostvip/cohost-types';
|
|
1704
3
|
|
|
1705
4
|
/**
|
|
1706
5
|
* Pagination parameters for a paginated API request.
|
|
@@ -2261,4 +560,4 @@ declare class CohostClient {
|
|
|
2261
560
|
*/
|
|
2262
561
|
declare function createCohostClient(options: CohostClientOptions): CohostClient;
|
|
2263
562
|
|
|
2264
|
-
export {
|
|
563
|
+
export { CohostClient, type CohostClientSettings, type Coupon, createCohostClient };
|