@peektravel/app-utilities 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -287,6 +287,11 @@ interface Booking {
287
287
  * `"unknown"` when the origin can't be mapped.
288
288
  */
289
289
  sourceDescription: string;
290
+ /**
291
+ * Raw source actor name reported by Peek, when present. `null` when the
292
+ * origin actor carries no name.
293
+ */
294
+ sourceDetails: string | null;
290
295
  /** Primary guest's name, or `""` when unknown. */
291
296
  customerName: string | null;
292
297
  /** Primary guest's email, or null. */
@@ -1036,8 +1041,6 @@ interface Timeslot {
1036
1041
  }
1037
1042
  /** A resource allocated to a {@link Timeslot}. */
1038
1043
  interface AssignedResource {
1039
- /** Resource pool id. */
1040
- id: string;
1041
1044
  /** Resource pool name. */
1042
1045
  name: string;
1043
1046
  /** Resource pool capacity. */
@@ -1046,6 +1049,8 @@ interface AssignedResource {
1046
1049
  category: string;
1047
1050
  /** Allocated quantity. */
1048
1051
  quantity: number;
1052
+ /** Allocation status (e.g. `"ACTIVE"`). */
1053
+ status: string;
1049
1054
  /** Backing account user id, or null. */
1050
1055
  accountUserId: string | null;
1051
1056
  }
package/dist/index.d.ts CHANGED
@@ -287,6 +287,11 @@ interface Booking {
287
287
  * `"unknown"` when the origin can't be mapped.
288
288
  */
289
289
  sourceDescription: string;
290
+ /**
291
+ * Raw source actor name reported by Peek, when present. `null` when the
292
+ * origin actor carries no name.
293
+ */
294
+ sourceDetails: string | null;
290
295
  /** Primary guest's name, or `""` when unknown. */
291
296
  customerName: string | null;
292
297
  /** Primary guest's email, or null. */
@@ -1036,8 +1041,6 @@ interface Timeslot {
1036
1041
  }
1037
1042
  /** A resource allocated to a {@link Timeslot}. */
1038
1043
  interface AssignedResource {
1039
- /** Resource pool id. */
1040
- id: string;
1041
1044
  /** Resource pool name. */
1042
1045
  name: string;
1043
1046
  /** Resource pool capacity. */
@@ -1046,6 +1049,8 @@ interface AssignedResource {
1046
1049
  category: string;
1047
1050
  /** Allocated quantity. */
1048
1051
  quantity: number;
1052
+ /** Allocation status (e.g. `"ACTIVE"`). */
1053
+ status: string;
1049
1054
  /** Backing account user id, or null. */
1050
1055
  accountUserId: string | null;
1051
1056
  }
package/dist/index.js CHANGED
@@ -234,6 +234,7 @@ function fromBookingNode(node, includeGuests = false, includePriceBreakdown = fa
234
234
  const data = node ?? {};
235
235
  const ticketQuantities = data.ticketQuantities ?? [];
236
236
  const app = data.order?.initialQuote?.source?.actor?.app ?? null;
237
+ const sourceDetails = data.order?.initialQuote?.source?.actor?.name ?? null;
237
238
  const customQuestionAnswers = (data.questionAnswers ?? []).map(
238
239
  (answer) => {
239
240
  const base = {
@@ -257,6 +258,7 @@ function fromBookingNode(node, includeGuests = false, includePriceBreakdown = fa
257
258
  source: sourceFromApp(app),
258
259
  sourceApp: app || UNKNOWN,
259
260
  sourceDescription: sourceDescriptionFromApp(app),
261
+ sourceDetails,
260
262
  customerName: data.primaryGuest?.name || "",
261
263
  customerEmail: data.primaryGuest?.email || null,
262
264
  customerPhone: data.primaryGuest?.phone || null,
@@ -692,6 +694,7 @@ var bookingQueryFields = `
692
694
  source {
693
695
  actor {
694
696
  app
697
+ name
695
698
  }
696
699
  }
697
700
  }
@@ -2327,7 +2330,7 @@ function fromTimeslotNode(node, productId) {
2327
2330
  durationMin: node.minuteLength ?? 0,
2328
2331
  date: node.date || "",
2329
2332
  startTime: node.start ?? null,
2330
- assignedResources: mapAssignedResources(node.resourceAllocations)
2333
+ assignedResources: mapAssignedResources(node.inheritedResourceAllocations)
2331
2334
  };
2332
2335
  }
2333
2336
  function mapAssignedResources(allocations) {
@@ -2337,11 +2340,11 @@ function mapAssignedResources(allocations) {
2337
2340
  return allocations.map((allocation) => {
2338
2341
  const pool = allocation.resourcePool;
2339
2342
  return {
2340
- id: pool?.id || "",
2341
2343
  name: pool?.name || "",
2342
2344
  capacity: pool?.capacity ?? 0,
2343
2345
  category: pool?.category || "",
2344
2346
  quantity: allocation.quantity ?? 0,
2347
+ status: allocation.status || "",
2345
2348
  accountUserId: pool?.accountUser?.id ?? null
2346
2349
  };
2347
2350
  });
@@ -2416,10 +2419,10 @@ var TIMESLOTS_QUERY = `
2416
2419
  minuteLength
2417
2420
  status
2418
2421
  date
2419
- resourceAllocations {
2422
+ inheritedResourceAllocations {
2420
2423
  quantity
2424
+ status
2421
2425
  resourcePool {
2422
- id
2423
2426
  name
2424
2427
  category
2425
2428
  capacity
@@ -2454,10 +2457,10 @@ var TIMESLOT_BY_ID_QUERY = `
2454
2457
  minuteLength
2455
2458
  status
2456
2459
  date
2457
- resourceAllocations {
2460
+ inheritedResourceAllocations {
2458
2461
  quantity
2462
+ status
2459
2463
  resourcePool {
2460
- id
2461
2464
  name
2462
2465
  category
2463
2466
  capacity