@ingram-tech/luma 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -117,13 +117,16 @@ try {
117
117
  | Calendar people | `calendar.listPeople`, `calendar.listAllPeople` |
118
118
  | Coupons | `calendar.listCoupons`, `calendar.findCouponByCode`, `calendar.createCoupon` |
119
119
  | Events | `events.get` |
120
- | Guests | `events.listGuests`, `events.listAllGuests`, `events.getGuest`, `events.updateGuestStatus` |
120
+ | Guests | `events.listGuests`, `events.listAllGuests`, `events.getGuest`, `events.updateGuestStatus`, `events.addGuests` |
121
+ | Ticket types | `events.listTicketTypes`, `events.getTicketType`, `events.createTicketType`, `events.updateTicketType`, `events.deleteTicketType` |
121
122
  | Anything else | `request`, `paginate` |
122
123
 
123
- Luma does not publish a machine-readable schema. The calendar-events and
124
- coupon paths are exercised in production; the guest and people paths are
125
- modelled from Luma's public API documentation. Response objects carry an index
126
- signature, so unmodelled fields are always reachable. PRs welcome.
124
+ The ticket-type and `addGuests` methods are modelled from Luma's published
125
+ OpenAPI (`https://public-api.luma.com/openapi.json`). Note the API has no
126
+ checkout/payment endpoint `addGuests` registers a guest host-side but never
127
+ takes payment; ticket purchase happens on Luma's own hosted checkout. Response
128
+ objects carry an index signature, so unmodelled fields are always reachable.
129
+ PRs welcome.
127
130
 
128
131
  ## Development
129
132
 
package/dist/index.d.ts CHANGED
@@ -120,6 +120,82 @@ interface UpdateGuestStatusOptions {
120
120
  guestApiId: string;
121
121
  status: LumaGuestApprovalStatus;
122
122
  }
123
+ /**
124
+ * A ticket type (tier) on an event, as returned by
125
+ * `/v1/events/ticket-types/*`. Prices are in the currency's minor unit
126
+ * (`cents`); free tickets carry `type: "free"` and a null price.
127
+ */
128
+ interface LumaTicketType {
129
+ /** Ticket-type id, usually prefixed `evtticktype-`. */
130
+ id: string;
131
+ name: string;
132
+ /** `"free"` or `"paid"`. Luma may introduce further values. */
133
+ type: "free" | "paid" | (string & {});
134
+ /** Price in the currency's minor unit (e.g. `4000` = €40), or null. */
135
+ cents: number | null;
136
+ /** ISO 4217 code, lower-cased as Luma returns it (e.g. `eur`), or null. */
137
+ currency: string | null;
138
+ /** Whether the buyer may choose the amount (pay-what-you-want). */
139
+ is_flexible?: boolean;
140
+ /** For flexible tickets, the minimum amount in minor units. */
141
+ min_cents?: number | null;
142
+ require_approval?: boolean;
143
+ is_hidden?: boolean;
144
+ description?: string | null;
145
+ valid_start_at?: string | null;
146
+ valid_end_at?: string | null;
147
+ max_capacity?: number | null;
148
+ [key: string]: unknown;
149
+ }
150
+ interface ListTicketTypesOptions {
151
+ eventApiId: string;
152
+ /** Include hidden ticket types in the result. */
153
+ includeHidden?: boolean;
154
+ }
155
+ /** Fields shared by ticket-type create and update. */
156
+ interface TicketTypeWriteFields {
157
+ name?: string;
158
+ /** Price in the currency's minor unit. Required for paid tickets. */
159
+ cents?: number | null;
160
+ /** ISO 4217 code (e.g. `eur`). */
161
+ currency?: string | null;
162
+ requireApproval?: boolean;
163
+ isHidden?: boolean;
164
+ description?: string | null;
165
+ /** Pay-what-you-want ticket. */
166
+ isFlexible?: boolean;
167
+ minCents?: number | null;
168
+ maxCapacity?: number | null;
169
+ validStartAt?: Date | string | null;
170
+ validEndAt?: Date | string | null;
171
+ }
172
+ interface CreateTicketTypeInput extends TicketTypeWriteFields {
173
+ eventApiId: string;
174
+ name: string;
175
+ type: "free" | "paid";
176
+ }
177
+ interface UpdateTicketTypeInput extends TicketTypeWriteFields {
178
+ ticketTypeApiId: string;
179
+ type?: "free" | "paid";
180
+ }
181
+ /** A guest to add via {@link import("./client").LumaClient.events.addGuests}. */
182
+ interface AddGuestInput {
183
+ email: string;
184
+ name?: string;
185
+ /** Answers to the event's registration questions, if any. */
186
+ registrationAnswers?: unknown[];
187
+ }
188
+ interface AddGuestsOptions {
189
+ eventApiId: string;
190
+ /** The guests to add. At least one is required. */
191
+ guests: AddGuestInput[];
192
+ /** Assign one ticket of this ticket type to each added guest. */
193
+ ticketTypeApiId?: string;
194
+ /** Initial status. Defaults to `approved` ("Going"). */
195
+ approvalStatus?: LumaGuestApprovalStatus;
196
+ /** Whether Luma emails each added guest. Defaults to true. */
197
+ sendEmail?: boolean;
198
+ }
123
199
  interface LumaCoupon {
124
200
  api_id: string;
125
201
  code: string;
@@ -230,6 +306,26 @@ declare class LumaClient {
230
306
  getGuest: (options: GetEventGuestOptions) => Promise<LumaGuest>;
231
307
  /** Update a guest's approval status (approve, decline, waitlist…). */
232
308
  updateGuestStatus: (options: UpdateGuestStatusOptions) => Promise<void>;
309
+ /**
310
+ * Add guests to an event (host-side). Registers people directly — this
311
+ * does NOT take payment; Luma owns checkout/payment on its hosted flow.
312
+ * By default guests are added as approved ("Going") and emailed. Pass a
313
+ * `ticketTypeApiId` to assign each guest a ticket of that type.
314
+ */
315
+ addGuests: (options: AddGuestsOptions) => Promise<void>;
316
+ /**
317
+ * List an event's ticket types (tiers), including prices. Pass
318
+ * `includeHidden` to include ticket types not shown on the public page.
319
+ */
320
+ listTicketTypes: (options: ListTicketTypesOptions) => Promise<LumaTicketType[]>;
321
+ /** Fetch a single ticket type by its id. */
322
+ getTicketType: (ticketTypeApiId: string) => Promise<LumaTicketType>;
323
+ /** Create a ticket type on an event. */
324
+ createTicketType: (input: CreateTicketTypeInput) => Promise<LumaTicketType>;
325
+ /** Update an existing ticket type. */
326
+ updateTicketType: (input: UpdateTicketTypeInput) => Promise<LumaTicketType>;
327
+ /** Delete a ticket type by its id. */
328
+ deleteTicketType: (ticketTypeApiId: string) => Promise<void>;
233
329
  };
234
330
  }
235
331
 
@@ -269,4 +365,4 @@ declare class LumaApiError extends Error {
269
365
  get isDuplicateCouponCode(): boolean;
270
366
  }
271
367
 
272
- export { type CreateCalendarCouponInput, type GetEventGuestOptions, LUMA_API_BASE_URL, LUMA_API_KEY_HEADER, LUMA_API_VERSION, type ListCalendarEventsOptions, type ListCalendarPeopleOptions, type ListEventGuestsOptions, LumaApiError, type LumaCalendarEntry, LumaClient, type LumaClientOptions, type LumaCoupon, type LumaCouponEntry, type LumaEvent, type LumaEventLocation, type LumaEventTag, type LumaGuest, type LumaGuestApprovalStatus, type LumaGuestEntry, type LumaPaginatedResponse, type LumaPaginationOptions, type LumaPerson, type LumaRequestInit, type UpdateGuestStatusOptions, collect };
368
+ export { type AddGuestInput, type AddGuestsOptions, type CreateCalendarCouponInput, type CreateTicketTypeInput, type GetEventGuestOptions, LUMA_API_BASE_URL, LUMA_API_KEY_HEADER, LUMA_API_VERSION, type ListCalendarEventsOptions, type ListCalendarPeopleOptions, type ListEventGuestsOptions, type ListTicketTypesOptions, LumaApiError, type LumaCalendarEntry, LumaClient, type LumaClientOptions, type LumaCoupon, type LumaCouponEntry, type LumaEvent, type LumaEventLocation, type LumaEventTag, type LumaGuest, type LumaGuestApprovalStatus, type LumaGuestEntry, type LumaPaginatedResponse, type LumaPaginationOptions, type LumaPerson, type LumaRequestInit, type LumaTicketType, type UpdateGuestStatusOptions, type UpdateTicketTypeInput, collect };
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ var LumaApiError = class extends Error {
40
40
  // src/client.ts
41
41
  var serializeQueryValue = (value) => value instanceof Date ? value.toISOString() : String(value);
42
42
  var toIso = (value) => value instanceof Date ? value.toISOString() : value;
43
+ var toIsoNullable = (value) => value == null ? value : toIso(value);
43
44
  var collect = async (source) => {
44
45
  const out = [];
45
46
  for await (const item of source) {
@@ -279,9 +280,97 @@ var LumaClient = class _LumaClient {
279
280
  status: options.status
280
281
  }
281
282
  });
283
+ },
284
+ /**
285
+ * Add guests to an event (host-side). Registers people directly — this
286
+ * does NOT take payment; Luma owns checkout/payment on its hosted flow.
287
+ * By default guests are added as approved ("Going") and emailed. Pass a
288
+ * `ticketTypeApiId` to assign each guest a ticket of that type.
289
+ */
290
+ addGuests: async (options) => {
291
+ await this.request("/v1/events/guests/add", {
292
+ method: "POST",
293
+ body: {
294
+ event_id: options.eventApiId,
295
+ guests: options.guests.map((guest) => ({
296
+ email: guest.email,
297
+ name: guest.name,
298
+ registration_answers: guest.registrationAnswers
299
+ })),
300
+ ticket: options.ticketTypeApiId ? { event_ticket_type_id: options.ticketTypeApiId } : void 0,
301
+ approval_status: options.approvalStatus,
302
+ send_email: options.sendEmail
303
+ }
304
+ });
305
+ },
306
+ /**
307
+ * List an event's ticket types (tiers), including prices. Pass
308
+ * `includeHidden` to include ticket types not shown on the public page.
309
+ */
310
+ listTicketTypes: async (options) => {
311
+ const response = await this.request(
312
+ "/v1/events/ticket-types/list",
313
+ {
314
+ query: {
315
+ event_id: options.eventApiId,
316
+ include_hidden: options.includeHidden
317
+ }
318
+ }
319
+ );
320
+ return response.entries ?? [];
321
+ },
322
+ /** Fetch a single ticket type by its id. */
323
+ getTicketType: async (ticketTypeApiId) => {
324
+ const response = await this.request("/v1/events/ticket-types/get", {
325
+ query: { event_ticket_type_id: ticketTypeApiId }
326
+ });
327
+ return response.ticket_type ?? response;
328
+ },
329
+ /** Create a ticket type on an event. */
330
+ createTicketType: async (input) => {
331
+ const response = await this.request("/v1/events/ticket-types/create", {
332
+ method: "POST",
333
+ body: ticketTypeBody(
334
+ { event_id: input.eventApiId, type: input.type },
335
+ input
336
+ )
337
+ });
338
+ return response.ticket_type ?? response;
339
+ },
340
+ /** Update an existing ticket type. */
341
+ updateTicketType: async (input) => {
342
+ const response = await this.request("/v1/events/ticket-types/update", {
343
+ method: "POST",
344
+ body: ticketTypeBody(
345
+ { event_ticket_type_id: input.ticketTypeApiId, type: input.type },
346
+ input
347
+ )
348
+ });
349
+ return response.ticket_type ?? response;
350
+ },
351
+ /** Delete a ticket type by its id. */
352
+ deleteTicketType: async (ticketTypeApiId) => {
353
+ await this.request("/v1/events/ticket-types/delete", {
354
+ method: "POST",
355
+ body: { event_ticket_type_id: ticketTypeApiId }
356
+ });
282
357
  }
283
358
  };
284
359
  };
360
+ var ticketTypeBody = (base, fields) => ({
361
+ ...base,
362
+ name: fields.name,
363
+ cents: fields.cents,
364
+ currency: fields.currency == null ? fields.currency : fields.currency.toLowerCase(),
365
+ require_approval: fields.requireApproval,
366
+ is_hidden: fields.isHidden,
367
+ description: fields.description,
368
+ is_flexible: fields.isFlexible,
369
+ min_cents: fields.minCents,
370
+ max_capacity: fields.maxCapacity,
371
+ valid_start_at: toIsoNullable(fields.validStartAt),
372
+ valid_end_at: toIsoNullable(fields.validEndAt)
373
+ });
285
374
  var normalizeCoupon = (entry, fallbackCode) => ({
286
375
  ...entry,
287
376
  api_id: entry.api_id ?? entry.id ?? "",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants.ts","../src/errors.ts","../src/client.ts"],"sourcesContent":["/** Base URL for the Luma public API. */\nexport const LUMA_API_BASE_URL = \"https://public-api.luma.com\";\n\n/** Header Luma expects the API key in. */\nexport const LUMA_API_KEY_HEADER = \"x-luma-api-key\";\n\n/** API version path segment prepended to every endpoint. */\nexport const LUMA_API_VERSION = \"v1\";\n","/**\n * Thrown when the Luma API responds with a non-2xx status, or when a response\n * body cannot be parsed as JSON.\n */\nexport class LumaApiError extends Error {\n\t/** HTTP status code returned by Luma (0 if the request never completed). */\n\treadonly status: number;\n\t/** Raw, untruncated response body. */\n\treadonly body: string;\n\t/** API path that produced the error, e.g. `/v1/event/get-guests`. */\n\treadonly path: string;\n\n\tconstructor(params: {\n\t\tmessage: string;\n\t\tstatus: number;\n\t\tbody: string;\n\t\tpath: string;\n\t}) {\n\t\tsuper(params.message);\n\t\tthis.name = \"LumaApiError\";\n\t\tthis.status = params.status;\n\t\tthis.body = params.body;\n\t\tthis.path = params.path;\n\t}\n\n\t/** True for 401/403 — the API key is missing, invalid, or lacks scope. */\n\tget isAuthError(): boolean {\n\t\treturn this.status === 401 || this.status === 403;\n\t}\n\n\t/** True for 429 — the caller is being rate limited. */\n\tget isRateLimited(): boolean {\n\t\treturn this.status === 429;\n\t}\n\n\t/**\n\t * True when Luma rejected a coupon create because the code already exists.\n\t * Luma surfaces this as a 400/409 whose body mentions the code already\n\t * existing; matched permissively so callers can treat it as idempotent.\n\t */\n\tget isDuplicateCouponCode(): boolean {\n\t\tconst lower = this.body.toLowerCase();\n\t\treturn (\n\t\t\t(this.status === 400 || this.status === 409) &&\n\t\t\tlower.includes(\"code\") &&\n\t\t\t(lower.includes(\"exist\") || lower.includes(\"already\"))\n\t\t);\n\t}\n}\n","import { LUMA_API_BASE_URL, LUMA_API_KEY_HEADER } from \"./constants\";\nimport { LumaApiError } from \"./errors\";\nimport type {\n\tCreateCalendarCouponInput,\n\tGetEventGuestOptions,\n\tListCalendarEventsOptions,\n\tListCalendarPeopleOptions,\n\tListEventGuestsOptions,\n\tLumaCalendarEntry,\n\tLumaCoupon,\n\tLumaCouponEntry,\n\tLumaEvent,\n\tLumaGuest,\n\tLumaGuestEntry,\n\tLumaPaginatedResponse,\n\tLumaPerson,\n\tUpdateGuestStatusOptions,\n} from \"./types\";\n\nexport interface LumaClientOptions {\n\t/** Luma API key. Found under Calendar Settings → API on a Luma Plus plan. */\n\tapiKey: string;\n\t/** Override the API base URL. Defaults to {@link LUMA_API_BASE_URL}. */\n\tbaseUrl?: string;\n\t/**\n\t * Fetch implementation to use. Defaults to the global `fetch`. Pass a\n\t * custom one to inject Next.js cache hints, retries, or a test double.\n\t */\n\tfetch?: typeof fetch;\n}\n\n/** Per-request options for {@link LumaClient.request}. */\nexport interface LumaRequestInit {\n\tmethod?: string;\n\t/** Query parameters. `undefined`/`null` values are dropped; `Date`s are\n\t * serialised as ISO strings. */\n\tquery?: Record<string, unknown>;\n\t/** JSON request body. Sets `content-type: application/json`. */\n\tbody?: unknown;\n\tsignal?: AbortSignal;\n\t/** Extra `fetch` init merged last — e.g. Next.js `{ next: { revalidate } }`. */\n\tfetchInit?: RequestInit;\n}\n\nconst serializeQueryValue = (value: unknown): string =>\n\tvalue instanceof Date ? value.toISOString() : String(value);\n\nconst toIso = (value: Date | string): string =>\n\tvalue instanceof Date ? value.toISOString() : value;\n\n/** Drain an async generator into an array. */\nexport const collect = async <T>(source: AsyncIterable<T>): Promise<T[]> => {\n\tconst out: T[] = [];\n\tfor await (const item of source) {\n\t\tout.push(item);\n\t}\n\treturn out;\n};\n\n/**\n * Typed client for the Luma (lu.ma) public API.\n *\n * The typed resource methods cover the endpoints this client is built around;\n * for anything not modelled here, {@link LumaClient.request} and\n * {@link LumaClient.paginate} are public escape hatches that work against any\n * endpoint.\n */\nexport class LumaClient {\n\treadonly baseUrl: string;\n\tprivate readonly apiKey: string;\n\tprivate readonly fetchImpl: typeof fetch;\n\n\tconstructor(options: LumaClientOptions) {\n\t\tif (!options.apiKey) {\n\t\t\tthrow new Error(\"LumaClient requires an `apiKey`\");\n\t\t}\n\t\tthis.apiKey = options.apiKey;\n\t\tthis.baseUrl = options.baseUrl ?? LUMA_API_BASE_URL;\n\t\tconst fetchImpl = options.fetch ?? globalThis.fetch;\n\t\tif (typeof fetchImpl !== \"function\") {\n\t\t\tthrow new Error(\n\t\t\t\t\"No global `fetch` available; pass one via LumaClientOptions.fetch\",\n\t\t\t);\n\t\t}\n\t\tthis.fetchImpl = fetchImpl;\n\t}\n\n\t/**\n\t * Construct a client from environment variables. Reads `LUMA_API_KEY` and,\n\t * optionally, `LUMA_API_BASE_URL`.\n\t */\n\tstatic fromEnv(\n\t\tenv: Record<string, string | undefined> = typeof process !== \"undefined\"\n\t\t\t? process.env\n\t\t\t: {},\n\t): LumaClient {\n\t\tconst apiKey = env.LUMA_API_KEY;\n\t\tif (!apiKey) {\n\t\t\tthrow new Error(\"LUMA_API_KEY is not set\");\n\t\t}\n\t\treturn new LumaClient({ apiKey, baseUrl: env.LUMA_API_BASE_URL });\n\t}\n\n\t/**\n\t * Low-level request against any Luma endpoint. `path` is taken relative to\n\t * the base URL, e.g. `/v1/event/get`.\n\t */\n\tasync request<T>(path: string, init: LumaRequestInit = {}): Promise<T> {\n\t\tconst url = new URL(path.startsWith(\"/\") ? path : `/${path}`, this.baseUrl);\n\t\tif (init.query) {\n\t\t\tfor (const [key, value] of Object.entries(init.query)) {\n\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\turl.searchParams.set(key, serializeQueryValue(value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst headers: Record<string, string> = {\n\t\t\t[LUMA_API_KEY_HEADER]: this.apiKey,\n\t\t\taccept: \"application/json\",\n\t\t};\n\t\tlet body: string | undefined;\n\t\tif (init.body !== undefined) {\n\t\t\theaders[\"content-type\"] = \"application/json\";\n\t\t\tbody = JSON.stringify(init.body);\n\t\t}\n\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await this.fetchImpl(url, {\n\t\t\t\tmethod: init.method ?? \"GET\",\n\t\t\t\theaders,\n\t\t\t\tbody,\n\t\t\t\tsignal: init.signal,\n\t\t\t\t...init.fetchInit,\n\t\t\t});\n\t\t} catch (cause) {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API request to ${path} failed: ${\n\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t}`,\n\t\t\t\tstatus: 0,\n\t\t\t\tbody: \"\",\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\n\t\tconst text = await response.text();\n\t\tif (!response.ok) {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API responded ${response.status} for ${path}`,\n\t\t\t\tstatus: response.status,\n\t\t\t\tbody: text,\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\t\tif (text.length === 0) {\n\t\t\treturn undefined as T;\n\t\t}\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API returned a non-JSON body for ${path}`,\n\t\t\t\tstatus: response.status,\n\t\t\t\tbody: text,\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Iterate a cursor-paginated endpoint, yielding each entry. Follows\n\t * `next_cursor` while `has_more` is true.\n\t */\n\tasync *paginate<T>(\n\t\tpath: string,\n\t\tquery: Record<string, unknown> = {},\n\t): AsyncGenerator<T> {\n\t\tlet cursor: string | null | undefined;\n\t\t// Hard stop so a misbehaving endpoint cannot loop forever.\n\t\tfor (let page = 0; page < 10_000; page += 1) {\n\t\t\tconst pageQuery = { ...query };\n\t\t\tif (cursor) {\n\t\t\t\tpageQuery.pagination_cursor = cursor;\n\t\t\t}\n\t\t\tconst result = await this.request<LumaPaginatedResponse<T>>(path, {\n\t\t\t\tquery: pageQuery,\n\t\t\t});\n\t\t\tfor (const entry of result.entries ?? []) {\n\t\t\t\tyield entry;\n\t\t\t}\n\t\t\tif (!result.has_more || !result.next_cursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcursor = result.next_cursor;\n\t\t}\n\t}\n\n\t// ─── calendar ────────────────────────────────────────────────────────\n\n\treadonly calendar = {\n\t\t/** Iterate every event on a calendar. */\n\t\tlistEvents: (options: ListCalendarEventsOptions) =>\n\t\t\tthis.paginate<LumaCalendarEntry>(\"/v1/calendar/list-events\", {\n\t\t\t\tcalendar_api_id: options.calendarApiId,\n\t\t\t\tafter: options.after,\n\t\t\t\tbefore: options.before,\n\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t}),\n\n\t\t/** Collect every event on a calendar into an array. */\n\t\tlistAllEvents: (options: ListCalendarEventsOptions) =>\n\t\t\tcollect(this.calendar.listEvents(options)),\n\n\t\t/** Iterate every person who has interacted with a calendar. */\n\t\tlistPeople: (options: ListCalendarPeopleOptions) =>\n\t\t\tthis.paginate<LumaPerson>(\"/v1/calendar/list-people\", {\n\t\t\t\tcalendar_api_id: options.calendarApiId,\n\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t}),\n\n\t\t/** Collect every person on a calendar into an array. */\n\t\tlistAllPeople: (options: ListCalendarPeopleOptions) =>\n\t\t\tcollect(this.calendar.listPeople(options)),\n\n\t\t/** Iterate every coupon on the calendar tied to the API key. */\n\t\tlistCoupons: async function* (this: LumaClient): AsyncGenerator<LumaCoupon> {\n\t\t\tfor await (const entry of this.paginate<LumaCouponEntry>(\n\t\t\t\t\"/v1/calendar/coupons\",\n\t\t\t)) {\n\t\t\t\tyield normalizeCoupon(entry);\n\t\t\t}\n\t\t}.bind(this),\n\n\t\t/** Find a calendar coupon by its code, or `null` if none matches. */\n\t\tfindCouponByCode: async (code: string): Promise<LumaCoupon | null> => {\n\t\t\tconst target = code.toLowerCase();\n\t\t\tfor await (const coupon of this.calendar.listCoupons()) {\n\t\t\t\tif (coupon.code.toLowerCase() === target) {\n\t\t\t\t\treturn coupon;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\n\t\t/** Create a calendar coupon. */\n\t\tcreateCoupon: async (input: CreateCalendarCouponInput): Promise<LumaCoupon> => {\n\t\t\tconst discount =\n\t\t\t\tinput.discount.type === \"percent\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tdiscount_type: \"percent\" as const,\n\t\t\t\t\t\t\tpercent_off: input.discount.percentOff,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tdiscount_type: \"amount\" as const,\n\t\t\t\t\t\t\tcents_off: input.discount.centsOff,\n\t\t\t\t\t\t\tcurrency: input.discount.currency.toLowerCase(),\n\t\t\t\t\t\t};\n\t\t\tconst response = await this.request<{ coupon?: LumaCouponEntry }>(\n\t\t\t\t\"/v1/calendar/coupons/create\",\n\t\t\t\t{\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tcode: input.code,\n\t\t\t\t\t\tremaining_count: input.remainingCount,\n\t\t\t\t\t\tvalid_start_at: input.validStartAt\n\t\t\t\t\t\t\t? toIso(input.validStartAt)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tvalid_end_at: input.validEndAt\n\t\t\t\t\t\t\t? toIso(input.validEndAt)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdiscount,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn normalizeCoupon(response.coupon ?? {}, input.code);\n\t\t},\n\t};\n\n\t// ─── events ──────────────────────────────────────────────────────────\n\n\treadonly events = {\n\t\t/** Fetch a single event by its `api_id`. */\n\t\tget: async (eventApiId: string): Promise<LumaEvent> => {\n\t\t\tconst response = await this.request<{ event?: LumaEvent } & LumaEvent>(\n\t\t\t\t\"/v1/event/get\",\n\t\t\t\t{ query: { api_id: eventApiId } },\n\t\t\t);\n\t\t\treturn response.event ?? response;\n\t\t},\n\n\t\t/** Iterate every guest of an event. */\n\t\tlistGuests: (options: ListEventGuestsOptions) =>\n\t\t\tasync function* (this: LumaClient): AsyncGenerator<LumaGuest> {\n\t\t\t\tfor await (const entry of this.paginate<LumaGuestEntry>(\n\t\t\t\t\t\"/v1/event/get-guests\",\n\t\t\t\t\t{\n\t\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\t\tapproval_status: options.approvalStatus,\n\t\t\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t\t\t},\n\t\t\t\t)) {\n\t\t\t\t\tconst guest = entry.guest ?? (entry as unknown as LumaGuest);\n\t\t\t\t\tyield guest;\n\t\t\t\t}\n\t\t\t}.call(this),\n\n\t\t/** Collect every guest of an event into an array. */\n\t\tlistAllGuests: (options: ListEventGuestsOptions) =>\n\t\t\tcollect(this.events.listGuests(options)),\n\n\t\t/** Fetch a single guest, by guest `api_id` or by registration email. */\n\t\tgetGuest: async (options: GetEventGuestOptions): Promise<LumaGuest> => {\n\t\t\tif (!options.guestApiId && !options.email) {\n\t\t\t\tthrow new Error(\"getGuest requires either `guestApiId` or `email`\");\n\t\t\t}\n\t\t\tconst response = await this.request<{ guest?: LumaGuest } & LumaGuest>(\n\t\t\t\t\"/v1/event/get-guest\",\n\t\t\t\t{\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\t\tapi_id: options.guestApiId,\n\t\t\t\t\t\temail: options.email,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn response.guest ?? response;\n\t\t},\n\n\t\t/** Update a guest's approval status (approve, decline, waitlist…). */\n\t\tupdateGuestStatus: async (options: UpdateGuestStatusOptions): Promise<void> => {\n\t\t\tawait this.request(\"/v1/event/update-guest-status\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\tguest_api_id: options.guestApiId,\n\t\t\t\t\tstatus: options.status,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t};\n}\n\nconst normalizeCoupon = (\n\tentry: LumaCouponEntry,\n\tfallbackCode?: string,\n): LumaCoupon => ({\n\t...entry,\n\tapi_id: entry.api_id ?? entry.id ?? \"\",\n\tcode: entry.code ?? fallbackCode ?? \"\",\n});\n"],"mappings":";AACO,IAAM,oBAAoB;AAG1B,IAAM,sBAAsB;AAG5B,IAAM,mBAAmB;;;ACHzB,IAAM,eAAN,cAA2B,MAAM;AAAA;AAAA,EAE9B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAET,YAAY,QAKT;AACF,UAAM,OAAO,OAAO;AACpB,SAAK,OAAO;AACZ,SAAK,SAAS,OAAO;AACrB,SAAK,OAAO,OAAO;AACnB,SAAK,OAAO,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,cAAuB;AAC1B,WAAO,KAAK,WAAW,OAAO,KAAK,WAAW;AAAA,EAC/C;AAAA;AAAA,EAGA,IAAI,gBAAyB;AAC5B,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,wBAAiC;AACpC,UAAM,QAAQ,KAAK,KAAK,YAAY;AACpC,YACE,KAAK,WAAW,OAAO,KAAK,WAAW,QACxC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cAAM;AAAA,MACP;AAAA,IACD,EAAE,KAAK,IAAI;AAAA;AAAA,IAGZ,eAAe,CAAC,YACf,QAAQ,KAAK,OAAO,WAAW,OAAO,CAAC;AAAA;AAAA,IAGxC,UAAU,OAAO,YAAsD;AACtE,UAAI,CAAC,QAAQ,cAAc,CAAC,QAAQ,OAAO;AAC1C,cAAM,IAAI,MAAM,kDAAkD;AAAA,MACnE;AACA,YAAM,WAAW,MAAM,KAAK;AAAA,QAC3B;AAAA,QACA;AAAA,UACC,OAAO;AAAA,YACN,cAAc,QAAQ;AAAA,YACtB,QAAQ,QAAQ;AAAA,YAChB,OAAO,QAAQ;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AACA,aAAO,SAAS,SAAS;AAAA,IAC1B;AAAA;AAAA,IAGA,mBAAmB,OAAO,YAAqD;AAC9E,YAAM,KAAK,QAAQ,iCAAiC;AAAA,QACnD,QAAQ;AAAA,QACR,MAAM;AAAA,UACL,cAAc,QAAQ;AAAA,UACtB,cAAc,QAAQ;AAAA,UACtB,QAAQ,QAAQ;AAAA,QACjB;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AACD;AAEA,IAAM,kBAAkB,CACvB,OACA,kBACiB;AAAA,EACjB,GAAG;AAAA,EACH,QAAQ,MAAM,UAAU,MAAM,MAAM;AAAA,EACpC,MAAM,MAAM,QAAQ,gBAAgB;AACrC;","names":[]}
1
+ {"version":3,"sources":["../src/constants.ts","../src/errors.ts","../src/client.ts"],"sourcesContent":["/** Base URL for the Luma public API. */\nexport const LUMA_API_BASE_URL = \"https://public-api.luma.com\";\n\n/** Header Luma expects the API key in. */\nexport const LUMA_API_KEY_HEADER = \"x-luma-api-key\";\n\n/** API version path segment prepended to every endpoint. */\nexport const LUMA_API_VERSION = \"v1\";\n","/**\n * Thrown when the Luma API responds with a non-2xx status, or when a response\n * body cannot be parsed as JSON.\n */\nexport class LumaApiError extends Error {\n\t/** HTTP status code returned by Luma (0 if the request never completed). */\n\treadonly status: number;\n\t/** Raw, untruncated response body. */\n\treadonly body: string;\n\t/** API path that produced the error, e.g. `/v1/event/get-guests`. */\n\treadonly path: string;\n\n\tconstructor(params: {\n\t\tmessage: string;\n\t\tstatus: number;\n\t\tbody: string;\n\t\tpath: string;\n\t}) {\n\t\tsuper(params.message);\n\t\tthis.name = \"LumaApiError\";\n\t\tthis.status = params.status;\n\t\tthis.body = params.body;\n\t\tthis.path = params.path;\n\t}\n\n\t/** True for 401/403 — the API key is missing, invalid, or lacks scope. */\n\tget isAuthError(): boolean {\n\t\treturn this.status === 401 || this.status === 403;\n\t}\n\n\t/** True for 429 — the caller is being rate limited. */\n\tget isRateLimited(): boolean {\n\t\treturn this.status === 429;\n\t}\n\n\t/**\n\t * True when Luma rejected a coupon create because the code already exists.\n\t * Luma surfaces this as a 400/409 whose body mentions the code already\n\t * existing; matched permissively so callers can treat it as idempotent.\n\t */\n\tget isDuplicateCouponCode(): boolean {\n\t\tconst lower = this.body.toLowerCase();\n\t\treturn (\n\t\t\t(this.status === 400 || this.status === 409) &&\n\t\t\tlower.includes(\"code\") &&\n\t\t\t(lower.includes(\"exist\") || lower.includes(\"already\"))\n\t\t);\n\t}\n}\n","import { LUMA_API_BASE_URL, LUMA_API_KEY_HEADER } from \"./constants\";\nimport { LumaApiError } from \"./errors\";\nimport type {\n\tAddGuestsOptions,\n\tCreateCalendarCouponInput,\n\tCreateTicketTypeInput,\n\tGetEventGuestOptions,\n\tListCalendarEventsOptions,\n\tListCalendarPeopleOptions,\n\tListEventGuestsOptions,\n\tListTicketTypesOptions,\n\tLumaCalendarEntry,\n\tLumaCoupon,\n\tLumaCouponEntry,\n\tLumaEvent,\n\tLumaGuest,\n\tLumaGuestEntry,\n\tLumaPaginatedResponse,\n\tLumaPerson,\n\tLumaTicketType,\n\tUpdateGuestStatusOptions,\n\tUpdateTicketTypeInput,\n} from \"./types\";\n\nexport interface LumaClientOptions {\n\t/** Luma API key. Found under Calendar Settings → API on a Luma Plus plan. */\n\tapiKey: string;\n\t/** Override the API base URL. Defaults to {@link LUMA_API_BASE_URL}. */\n\tbaseUrl?: string;\n\t/**\n\t * Fetch implementation to use. Defaults to the global `fetch`. Pass a\n\t * custom one to inject Next.js cache hints, retries, or a test double.\n\t */\n\tfetch?: typeof fetch;\n}\n\n/** Per-request options for {@link LumaClient.request}. */\nexport interface LumaRequestInit {\n\tmethod?: string;\n\t/** Query parameters. `undefined`/`null` values are dropped; `Date`s are\n\t * serialised as ISO strings. */\n\tquery?: Record<string, unknown>;\n\t/** JSON request body. Sets `content-type: application/json`. */\n\tbody?: unknown;\n\tsignal?: AbortSignal;\n\t/** Extra `fetch` init merged last — e.g. Next.js `{ next: { revalidate } }`. */\n\tfetchInit?: RequestInit;\n}\n\nconst serializeQueryValue = (value: unknown): string =>\n\tvalue instanceof Date ? value.toISOString() : String(value);\n\nconst toIso = (value: Date | string): string =>\n\tvalue instanceof Date ? value.toISOString() : value;\n\n/** Like {@link toIso} but passes `null`/`undefined` through untouched, so a\n * caller can clear a field (`null`) or leave it unset (`undefined`). */\nconst toIsoNullable = (\n\tvalue: Date | string | null | undefined,\n): string | null | undefined => (value == null ? value : toIso(value));\n\n/** Drain an async generator into an array. */\nexport const collect = async <T>(source: AsyncIterable<T>): Promise<T[]> => {\n\tconst out: T[] = [];\n\tfor await (const item of source) {\n\t\tout.push(item);\n\t}\n\treturn out;\n};\n\n/**\n * Typed client for the Luma (lu.ma) public API.\n *\n * The typed resource methods cover the endpoints this client is built around;\n * for anything not modelled here, {@link LumaClient.request} and\n * {@link LumaClient.paginate} are public escape hatches that work against any\n * endpoint.\n */\nexport class LumaClient {\n\treadonly baseUrl: string;\n\tprivate readonly apiKey: string;\n\tprivate readonly fetchImpl: typeof fetch;\n\n\tconstructor(options: LumaClientOptions) {\n\t\tif (!options.apiKey) {\n\t\t\tthrow new Error(\"LumaClient requires an `apiKey`\");\n\t\t}\n\t\tthis.apiKey = options.apiKey;\n\t\tthis.baseUrl = options.baseUrl ?? LUMA_API_BASE_URL;\n\t\tconst fetchImpl = options.fetch ?? globalThis.fetch;\n\t\tif (typeof fetchImpl !== \"function\") {\n\t\t\tthrow new Error(\n\t\t\t\t\"No global `fetch` available; pass one via LumaClientOptions.fetch\",\n\t\t\t);\n\t\t}\n\t\tthis.fetchImpl = fetchImpl;\n\t}\n\n\t/**\n\t * Construct a client from environment variables. Reads `LUMA_API_KEY` and,\n\t * optionally, `LUMA_API_BASE_URL`.\n\t */\n\tstatic fromEnv(\n\t\tenv: Record<string, string | undefined> = typeof process !== \"undefined\"\n\t\t\t? process.env\n\t\t\t: {},\n\t): LumaClient {\n\t\tconst apiKey = env.LUMA_API_KEY;\n\t\tif (!apiKey) {\n\t\t\tthrow new Error(\"LUMA_API_KEY is not set\");\n\t\t}\n\t\treturn new LumaClient({ apiKey, baseUrl: env.LUMA_API_BASE_URL });\n\t}\n\n\t/**\n\t * Low-level request against any Luma endpoint. `path` is taken relative to\n\t * the base URL, e.g. `/v1/event/get`.\n\t */\n\tasync request<T>(path: string, init: LumaRequestInit = {}): Promise<T> {\n\t\tconst url = new URL(path.startsWith(\"/\") ? path : `/${path}`, this.baseUrl);\n\t\tif (init.query) {\n\t\t\tfor (const [key, value] of Object.entries(init.query)) {\n\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\turl.searchParams.set(key, serializeQueryValue(value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst headers: Record<string, string> = {\n\t\t\t[LUMA_API_KEY_HEADER]: this.apiKey,\n\t\t\taccept: \"application/json\",\n\t\t};\n\t\tlet body: string | undefined;\n\t\tif (init.body !== undefined) {\n\t\t\theaders[\"content-type\"] = \"application/json\";\n\t\t\tbody = JSON.stringify(init.body);\n\t\t}\n\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await this.fetchImpl(url, {\n\t\t\t\tmethod: init.method ?? \"GET\",\n\t\t\t\theaders,\n\t\t\t\tbody,\n\t\t\t\tsignal: init.signal,\n\t\t\t\t...init.fetchInit,\n\t\t\t});\n\t\t} catch (cause) {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API request to ${path} failed: ${\n\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t}`,\n\t\t\t\tstatus: 0,\n\t\t\t\tbody: \"\",\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\n\t\tconst text = await response.text();\n\t\tif (!response.ok) {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API responded ${response.status} for ${path}`,\n\t\t\t\tstatus: response.status,\n\t\t\t\tbody: text,\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\t\tif (text.length === 0) {\n\t\t\treturn undefined as T;\n\t\t}\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\tthrow new LumaApiError({\n\t\t\t\tmessage: `Luma API returned a non-JSON body for ${path}`,\n\t\t\t\tstatus: response.status,\n\t\t\t\tbody: text,\n\t\t\t\tpath,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Iterate a cursor-paginated endpoint, yielding each entry. Follows\n\t * `next_cursor` while `has_more` is true.\n\t */\n\tasync *paginate<T>(\n\t\tpath: string,\n\t\tquery: Record<string, unknown> = {},\n\t): AsyncGenerator<T> {\n\t\tlet cursor: string | null | undefined;\n\t\t// Hard stop so a misbehaving endpoint cannot loop forever.\n\t\tfor (let page = 0; page < 10_000; page += 1) {\n\t\t\tconst pageQuery = { ...query };\n\t\t\tif (cursor) {\n\t\t\t\tpageQuery.pagination_cursor = cursor;\n\t\t\t}\n\t\t\tconst result = await this.request<LumaPaginatedResponse<T>>(path, {\n\t\t\t\tquery: pageQuery,\n\t\t\t});\n\t\t\tfor (const entry of result.entries ?? []) {\n\t\t\t\tyield entry;\n\t\t\t}\n\t\t\tif (!result.has_more || !result.next_cursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcursor = result.next_cursor;\n\t\t}\n\t}\n\n\t// ─── calendar ────────────────────────────────────────────────────────\n\n\treadonly calendar = {\n\t\t/** Iterate every event on a calendar. */\n\t\tlistEvents: (options: ListCalendarEventsOptions) =>\n\t\t\tthis.paginate<LumaCalendarEntry>(\"/v1/calendar/list-events\", {\n\t\t\t\tcalendar_api_id: options.calendarApiId,\n\t\t\t\tafter: options.after,\n\t\t\t\tbefore: options.before,\n\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t}),\n\n\t\t/** Collect every event on a calendar into an array. */\n\t\tlistAllEvents: (options: ListCalendarEventsOptions) =>\n\t\t\tcollect(this.calendar.listEvents(options)),\n\n\t\t/** Iterate every person who has interacted with a calendar. */\n\t\tlistPeople: (options: ListCalendarPeopleOptions) =>\n\t\t\tthis.paginate<LumaPerson>(\"/v1/calendar/list-people\", {\n\t\t\t\tcalendar_api_id: options.calendarApiId,\n\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t}),\n\n\t\t/** Collect every person on a calendar into an array. */\n\t\tlistAllPeople: (options: ListCalendarPeopleOptions) =>\n\t\t\tcollect(this.calendar.listPeople(options)),\n\n\t\t/** Iterate every coupon on the calendar tied to the API key. */\n\t\tlistCoupons: async function* (this: LumaClient): AsyncGenerator<LumaCoupon> {\n\t\t\tfor await (const entry of this.paginate<LumaCouponEntry>(\n\t\t\t\t\"/v1/calendar/coupons\",\n\t\t\t)) {\n\t\t\t\tyield normalizeCoupon(entry);\n\t\t\t}\n\t\t}.bind(this),\n\n\t\t/** Find a calendar coupon by its code, or `null` if none matches. */\n\t\tfindCouponByCode: async (code: string): Promise<LumaCoupon | null> => {\n\t\t\tconst target = code.toLowerCase();\n\t\t\tfor await (const coupon of this.calendar.listCoupons()) {\n\t\t\t\tif (coupon.code.toLowerCase() === target) {\n\t\t\t\t\treturn coupon;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\n\t\t/** Create a calendar coupon. */\n\t\tcreateCoupon: async (input: CreateCalendarCouponInput): Promise<LumaCoupon> => {\n\t\t\tconst discount =\n\t\t\t\tinput.discount.type === \"percent\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tdiscount_type: \"percent\" as const,\n\t\t\t\t\t\t\tpercent_off: input.discount.percentOff,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tdiscount_type: \"amount\" as const,\n\t\t\t\t\t\t\tcents_off: input.discount.centsOff,\n\t\t\t\t\t\t\tcurrency: input.discount.currency.toLowerCase(),\n\t\t\t\t\t\t};\n\t\t\tconst response = await this.request<{ coupon?: LumaCouponEntry }>(\n\t\t\t\t\"/v1/calendar/coupons/create\",\n\t\t\t\t{\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: {\n\t\t\t\t\t\tcode: input.code,\n\t\t\t\t\t\tremaining_count: input.remainingCount,\n\t\t\t\t\t\tvalid_start_at: input.validStartAt\n\t\t\t\t\t\t\t? toIso(input.validStartAt)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tvalid_end_at: input.validEndAt\n\t\t\t\t\t\t\t? toIso(input.validEndAt)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdiscount,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn normalizeCoupon(response.coupon ?? {}, input.code);\n\t\t},\n\t};\n\n\t// ─── events ──────────────────────────────────────────────────────────\n\n\treadonly events = {\n\t\t/** Fetch a single event by its `api_id`. */\n\t\tget: async (eventApiId: string): Promise<LumaEvent> => {\n\t\t\tconst response = await this.request<{ event?: LumaEvent } & LumaEvent>(\n\t\t\t\t\"/v1/event/get\",\n\t\t\t\t{ query: { api_id: eventApiId } },\n\t\t\t);\n\t\t\treturn response.event ?? response;\n\t\t},\n\n\t\t/** Iterate every guest of an event. */\n\t\tlistGuests: (options: ListEventGuestsOptions) =>\n\t\t\tasync function* (this: LumaClient): AsyncGenerator<LumaGuest> {\n\t\t\t\tfor await (const entry of this.paginate<LumaGuestEntry>(\n\t\t\t\t\t\"/v1/event/get-guests\",\n\t\t\t\t\t{\n\t\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\t\tapproval_status: options.approvalStatus,\n\t\t\t\t\t\tpagination_limit: options.paginationLimit,\n\t\t\t\t\t\tpagination_cursor: options.paginationCursor,\n\t\t\t\t\t},\n\t\t\t\t)) {\n\t\t\t\t\tconst guest = entry.guest ?? (entry as unknown as LumaGuest);\n\t\t\t\t\tyield guest;\n\t\t\t\t}\n\t\t\t}.call(this),\n\n\t\t/** Collect every guest of an event into an array. */\n\t\tlistAllGuests: (options: ListEventGuestsOptions) =>\n\t\t\tcollect(this.events.listGuests(options)),\n\n\t\t/** Fetch a single guest, by guest `api_id` or by registration email. */\n\t\tgetGuest: async (options: GetEventGuestOptions): Promise<LumaGuest> => {\n\t\t\tif (!options.guestApiId && !options.email) {\n\t\t\t\tthrow new Error(\"getGuest requires either `guestApiId` or `email`\");\n\t\t\t}\n\t\t\tconst response = await this.request<{ guest?: LumaGuest } & LumaGuest>(\n\t\t\t\t\"/v1/event/get-guest\",\n\t\t\t\t{\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\t\tapi_id: options.guestApiId,\n\t\t\t\t\t\temail: options.email,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn response.guest ?? response;\n\t\t},\n\n\t\t/** Update a guest's approval status (approve, decline, waitlist…). */\n\t\tupdateGuestStatus: async (options: UpdateGuestStatusOptions): Promise<void> => {\n\t\t\tawait this.request(\"/v1/event/update-guest-status\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tevent_api_id: options.eventApiId,\n\t\t\t\t\tguest_api_id: options.guestApiId,\n\t\t\t\t\tstatus: options.status,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Add guests to an event (host-side). Registers people directly — this\n\t\t * does NOT take payment; Luma owns checkout/payment on its hosted flow.\n\t\t * By default guests are added as approved (\"Going\") and emailed. Pass a\n\t\t * `ticketTypeApiId` to assign each guest a ticket of that type.\n\t\t */\n\t\taddGuests: async (options: AddGuestsOptions): Promise<void> => {\n\t\t\tawait this.request(\"/v1/events/guests/add\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tevent_id: options.eventApiId,\n\t\t\t\t\tguests: options.guests.map((guest) => ({\n\t\t\t\t\t\temail: guest.email,\n\t\t\t\t\t\tname: guest.name,\n\t\t\t\t\t\tregistration_answers: guest.registrationAnswers,\n\t\t\t\t\t})),\n\t\t\t\t\tticket: options.ticketTypeApiId\n\t\t\t\t\t\t? { event_ticket_type_id: options.ticketTypeApiId }\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tapproval_status: options.approvalStatus,\n\t\t\t\t\tsend_email: options.sendEmail,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * List an event's ticket types (tiers), including prices. Pass\n\t\t * `includeHidden` to include ticket types not shown on the public page.\n\t\t */\n\t\tlistTicketTypes: async (\n\t\t\toptions: ListTicketTypesOptions,\n\t\t): Promise<LumaTicketType[]> => {\n\t\t\tconst response = await this.request<{ entries?: LumaTicketType[] }>(\n\t\t\t\t\"/v1/events/ticket-types/list\",\n\t\t\t\t{\n\t\t\t\t\tquery: {\n\t\t\t\t\t\tevent_id: options.eventApiId,\n\t\t\t\t\t\tinclude_hidden: options.includeHidden,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn response.entries ?? [];\n\t\t},\n\n\t\t/** Fetch a single ticket type by its id. */\n\t\tgetTicketType: async (ticketTypeApiId: string): Promise<LumaTicketType> => {\n\t\t\tconst response = await this.request<\n\t\t\t\t{ ticket_type?: LumaTicketType } & LumaTicketType\n\t\t\t>(\"/v1/events/ticket-types/get\", {\n\t\t\t\tquery: { event_ticket_type_id: ticketTypeApiId },\n\t\t\t});\n\t\t\treturn response.ticket_type ?? response;\n\t\t},\n\n\t\t/** Create a ticket type on an event. */\n\t\tcreateTicketType: async (\n\t\t\tinput: CreateTicketTypeInput,\n\t\t): Promise<LumaTicketType> => {\n\t\t\tconst response = await this.request<\n\t\t\t\t{ ticket_type?: LumaTicketType } & LumaTicketType\n\t\t\t>(\"/v1/events/ticket-types/create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: ticketTypeBody(\n\t\t\t\t\t{ event_id: input.eventApiId, type: input.type },\n\t\t\t\t\tinput,\n\t\t\t\t),\n\t\t\t});\n\t\t\treturn response.ticket_type ?? response;\n\t\t},\n\n\t\t/** Update an existing ticket type. */\n\t\tupdateTicketType: async (\n\t\t\tinput: UpdateTicketTypeInput,\n\t\t): Promise<LumaTicketType> => {\n\t\t\tconst response = await this.request<\n\t\t\t\t{ ticket_type?: LumaTicketType } & LumaTicketType\n\t\t\t>(\"/v1/events/ticket-types/update\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: ticketTypeBody(\n\t\t\t\t\t{ event_ticket_type_id: input.ticketTypeApiId, type: input.type },\n\t\t\t\t\tinput,\n\t\t\t\t),\n\t\t\t});\n\t\t\treturn response.ticket_type ?? response;\n\t\t},\n\n\t\t/** Delete a ticket type by its id. */\n\t\tdeleteTicketType: async (ticketTypeApiId: string): Promise<void> => {\n\t\t\tawait this.request(\"/v1/events/ticket-types/delete\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: { event_ticket_type_id: ticketTypeApiId },\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Build the snake_case body shared by ticket-type create and update. Keys\n * left `undefined` are dropped by `JSON.stringify`; explicit `null` is sent. */\nconst ticketTypeBody = (\n\tbase: Record<string, unknown>,\n\tfields: {\n\t\tname?: string;\n\t\tcents?: number | null;\n\t\tcurrency?: string | null;\n\t\trequireApproval?: boolean;\n\t\tisHidden?: boolean;\n\t\tdescription?: string | null;\n\t\tisFlexible?: boolean;\n\t\tminCents?: number | null;\n\t\tmaxCapacity?: number | null;\n\t\tvalidStartAt?: Date | string | null;\n\t\tvalidEndAt?: Date | string | null;\n\t},\n): Record<string, unknown> => ({\n\t...base,\n\tname: fields.name,\n\tcents: fields.cents,\n\tcurrency: fields.currency == null ? fields.currency : fields.currency.toLowerCase(),\n\trequire_approval: fields.requireApproval,\n\tis_hidden: fields.isHidden,\n\tdescription: fields.description,\n\tis_flexible: fields.isFlexible,\n\tmin_cents: fields.minCents,\n\tmax_capacity: fields.maxCapacity,\n\tvalid_start_at: toIsoNullable(fields.validStartAt),\n\tvalid_end_at: toIsoNullable(fields.validEndAt),\n});\n\nconst normalizeCoupon = (\n\tentry: LumaCouponEntry,\n\tfallbackCode?: string,\n): LumaCoupon => ({\n\t...entry,\n\tapi_id: entry.api_id ?? entry.id ?? \"\",\n\tcode: entry.code ?? fallbackCode ?? \"\",\n});\n"],"mappings":";AACO,IAAM,oBAAoB;AAG1B,IAAM,sBAAsB;AAG5B,IAAM,mBAAmB;;;ACHzB,IAAM,eAAN,cAA2B,MAAM;AAAA;AAAA,EAE9B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAET,YAAY,QAKT;AACF,UAAM,OAAO,OAAO;AACpB,SAAK,OAAO;AACZ,SAAK,SAAS,OAAO;AACrB,SAAK,OAAO,OAAO;AACnB,SAAK,OAAO,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,cAAuB;AAC1B,WAAO,KAAK,WAAW,OAAO,KAAK,WAAW;AAAA,EAC/C;AAAA;AAAA,EAGA,IAAI,gBAAyB;AAC5B,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,wBAAiC;AACpC,UAAM,QAAQ,KAAK,KAAK,YAAY;AACpC,YACE,KAAK,WAAW,OAAO,KAAK,WAAW,QACxC,MAAM,SAAS,MAAM,MACpB,MAAM,SAAS,OAAO,KAAK,MAAM,SAAS,SAAS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BAAkB,OAAO;AAAA,EACzB,WAAW,OAAO;AAAA,EAClB,aAAa,OAAO;AAAA,EACpB,aAAa,OAAO;AAAA,EACpB,WAAW,OAAO;AAAA,EAClB,cAAc,OAAO;AAAA,EACrB,gBAAgB,cAAc,OAAO,YAAY;AAAA,EACjD,cAAc,cAAc,OAAO,UAAU;AAC9C;AAEA,IAAM,kBAAkB,CACvB,OACA,kBACiB;AAAA,EACjB,GAAG;AAAA,EACH,QAAQ,MAAM,UAAU,MAAM,MAAM;AAAA,EACpC,MAAM,MAAM,QAAQ,gBAAgB;AACrC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-tech/luma",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "TypeScript client for the Luma (lu.ma) public API.",
5
5
  "license": "MIT",
6
6
  "author": "Ingram Technologies",
@@ -47,10 +47,10 @@
47
47
  "node": ">=18"
48
48
  },
49
49
  "devDependencies": {
50
- "@biomejs/biome": "^2.4.13",
51
- "@types/node": "^22.0.0",
52
- "tsup": "^8.0.0",
50
+ "@biomejs/biome": "^2.5.1",
51
+ "@types/node": "^26.0.1",
52
+ "tsup": "^8.5.1",
53
53
  "typescript": "^5.9.3",
54
- "vitest": "^4.0.18"
54
+ "vitest": "^4.1.9"
55
55
  }
56
56
  }