@peektravel/app-utilities 0.9.1 → 0.9.3
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 +5 -1
- package/dist/index.cjs +627 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +350 -5
- package/dist/index.d.ts +350 -5
- package/dist/index.js +627 -80
- package/dist/index.js.map +1 -1
- package/docs/webhooks.md +1 -1
- package/llms.txt +36 -4
- package/package.json +1 -1
package/docs/webhooks.md
CHANGED
|
@@ -60,7 +60,7 @@ the full price breakdown, so one registration captures everything; the parser
|
|
|
60
60
|
auto-detects whatever a given payload carries.
|
|
61
61
|
|
|
62
62
|
```
|
|
63
|
-
{ displayId id primaryGuest { name email phone optinMarketing optinSms isGdpr postalCode } activitySnapshot { type name id } ticketQuantities { quantity resourceOptionSnapshot { name id } } reservationStatus checkinStatus returnStatus fulfillmentStatusOverride { status } timeSnapshot { id legacyId } purchasedAt purchasedAtUtc startsAt startsAtUtc endsAt endsAtUtc availabilityTimeId bookingPortalUrl operatorNotes value { convenienceFee { amount formatted } deposit { amount formatted } discount { amount formatted } discountedPrice { amount formatted } fees { amount formatted } flatPartnerFee { amount formatted } price { amount formatted } retailPrice { amount formatted } taxes { amount formatted } tips { amount formatted } total { formatted amount } } balance { total { amount formatted } } tips { price { amount formatted } } order { displayId id promoCodes { code } channelSnapshot { id name agent { name } } initialQuote { source { actor { app name } } } } questionAnswers { answer questionText questionLocationSnapshot { latitude longitude } } tickets { questionAnswers { answer questionText } } resourcePoolAssignments { quantity resourcePool { name shortName resources { name } } resourceAssignments { resource { id name } } } bookingGuests { id name country dateOfBirth email isGdpr isParticipant optinSms optinMarketing phone postalCode fieldResponses { id text fieldLocation { field { name } } } } primaryGuest { id name country dateOfBirth email isGdpr isParticipant optinSms optinMarketing phone postalCode fieldResponses { id text fieldLocation { field { name } } } } }
|
|
63
|
+
{ displayId id primaryGuest { name email phone optinMarketing optinSms isGdpr postalCode } activitySnapshot { type name id } ticketQuantities { quantity resourceOptionSnapshot { name id } } reservationStatus checkinStatus returnStatus fulfillmentStatusOverride { status } timeSnapshot { id legacyId } purchasedAt purchasedAtUtc startsAt startsAtUtc endsAt endsAtUtc availabilityTimeId bookingPortalUrl operatorNotes operatorStatus value { convenienceFee { amount formatted } deposit { amount formatted } discount { amount formatted } discountedPrice { amount formatted } fees { amount formatted } flatPartnerFee { amount formatted } price { amount formatted } retailPrice { amount formatted } taxes { amount formatted } tips { amount formatted } total { formatted amount } } balance { total { amount formatted } } tips { price { amount formatted } } order { displayId id promoCodes { code } channelSnapshot { id name agent { name } } initialQuote { source { actor { app name } } } } questionAnswers { answer questionText questionLocationSnapshot { latitude longitude } } tickets { questionAnswers { answer questionText } } resourcePoolAssignments { quantity resourcePool { name shortName resources { name } } resourceAssignments { resource { id name } } } bookingGuests { id name country dateOfBirth email isGdpr isParticipant optinSms optinMarketing phone postalCode fieldResponses { id text fieldLocation { field { name } } } } primaryGuest { id name country dateOfBirth email isGdpr isParticipant optinSms optinMarketing phone postalCode fieldResponses { id text fieldLocation { field { name } } } } }
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
> This package owns this string internally and snapshots it in
|
package/llms.txt
CHANGED
|
@@ -133,12 +133,39 @@ final authority and may still reject the request.
|
|
|
133
133
|
- `getDailyNoteService()` — `getToday()`, `update(note)`
|
|
134
134
|
- `getAvailabilityService()` — `getAvailabilityTimes({activityId, date, resourceOptionQuantities})`
|
|
135
135
|
- `getMembershipService()` — `getAll()`, `purchase(input)`
|
|
136
|
-
- `getBookingService()` — `getById(id, opts?)`, `searchByTimeRange(input)`,
|
|
137
|
-
`searchByTimeslot(id, opts?)`, `getGuests(id)`,
|
|
138
|
-
`
|
|
136
|
+
- `getBookingService(integrator?)` — `getById(id, opts?)`, `searchByTimeRange(input)`,
|
|
137
|
+
`searchByTimeslot(id, opts?)`, `getGuests(id)`,
|
|
138
|
+
`getMetaData(id)` → `MetaData[]` (booking custom-field responses, `[]` when not
|
|
139
|
+
found; each `MetaData` carries a typed `value: MetaDataValue | null` discriminated
|
|
140
|
+
union — every variant also has a display-safe `displayValue` string (the
|
|
141
|
+
`html` variant's is HTML-escaped); returns only fields whose slug starts with
|
|
142
|
+
`integrator:<integrator>:`,
|
|
143
|
+
that prefix stripped). The `integrator` arg on the accessor scopes
|
|
144
|
+
`getMetaData` — **do not set it** unless Peek engineering created a custom
|
|
145
|
+
integrator id for this integration.
|
|
146
|
+
Eight metadata setters (fixed `fieldName`, caller supplies the value;
|
|
147
|
+
integrator-scoped; return `SetMetaDataResult {success, bookingId, message}`;
|
|
148
|
+
not PII-gated): `setMetaDataGuest(id, guests: SetMetaDataGuestInput[])`
|
|
149
|
+
(name+email required), `setMetaDataAttachment(id, attachments:
|
|
150
|
+
SetMetaDataAttachmentInput[])` (name+attachmentUrl required),
|
|
151
|
+
`setMetaDataManifestUrl(id, url)`, `setMetaDataReservationId(id, reservationId)`,
|
|
152
|
+
`setMetaDataBookingStatus(id, status)`, `setMetaDataAssignedProduct(id, productName)`,
|
|
153
|
+
`setMetaDataAssignedEmployee(id, employeeName)`,
|
|
154
|
+
`setMetaDataInsurancePurchased(id, insurancePurchased)`. `getPaymentsOnFile(id)`,
|
|
155
|
+
`appendNote(id, note, mode?)`, `setCheckinStatus(id, checkedIn)`,
|
|
156
|
+
`updateCustomStatus(id, customStatus)` → `boolean` (sets the operator custom
|
|
157
|
+
status; not PII-gated), `cancel(id, notes?)`,
|
|
139
158
|
`makePayment(input)`, `refund(input)`, `createInvoiceLink(id)`,
|
|
140
159
|
`listAddons(id)`, `addAddon(id, {addonOptionId, quantity})`,
|
|
141
|
-
`removeAddon(id, {addonOptionId, quantity})`, `create(input)`
|
|
160
|
+
`removeAddon(id, {addonOptionId, quantity})`, `create(input)` (optional
|
|
161
|
+
`input.listPrice` — total booking price string, commas allowed; split evenly
|
|
162
|
+
across tickets with the remainder cent on the last, sent per ticket in the
|
|
163
|
+
activity currency, fallback USD)
|
|
164
|
+
- `getReviewService()` — `getReviews(productId, reviewCount?, reviewOffset?)`
|
|
165
|
+
(single newest-first page of `Review`s, count 1–50, offset ≥ 0);
|
|
166
|
+
`getAllReviewSummaries()` → `ProductReviewSummary[]` (one per activity:
|
|
167
|
+
`avgRating` — decimal, `null` when no ratings — plus `countTotal` and per-star
|
|
168
|
+
`countOneStar`…`countFiveStar`). No PII; unaffected by `fullCustomerAccess`.
|
|
142
169
|
|
|
143
170
|
## Sibling accessors (CNG, ACME — REST, not GraphQL)
|
|
144
171
|
|
|
@@ -190,6 +217,11 @@ stay internal.
|
|
|
190
217
|
additionally enforces that every required (non-per-guest) custom question is
|
|
191
218
|
answered — validation runs even when `customQuestionAnswers` is empty/omitted,
|
|
192
219
|
and an unanswered required question fails creation before the quote.
|
|
220
|
+
`CreateBookingInput.acceptAllCustomQuestionIds?: boolean` (default `false`)
|
|
221
|
+
relaxes the id check: a `cq_…` id not in the activity's question list is
|
|
222
|
+
accepted as a plain text answer instead of failing creation (by-name answers
|
|
223
|
+
still must match). When every answer is by id (and no required check runs) the
|
|
224
|
+
questions fetch is skipped entirely.
|
|
193
225
|
|
|
194
226
|
## Errors
|
|
195
227
|
|