@peektravel/app-utilities 0.5.1 → 0.5.2

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/llms.txt CHANGED
@@ -30,21 +30,70 @@ const peek = new PeekAccessService({
30
30
  });
31
31
  ```
32
32
 
33
- ## Access options / PII
33
+ ## Access options / PII — `fullCustomerAccess`
34
34
 
35
- Every access service takes `accessOptions?: AccessOptions` (`{ fullCustomerAccess?: boolean }`,
36
- default `false`). With `fullCustomerAccess` off, customer PII is **not requested** at the
37
- GraphQL layer (booking guest identity + custom question answers + `portalUrl`,
38
- review reviewer name/email → `null`/empty), and `BookingService` **disables**
39
- `getPaymentsOnFile`/`makePayment`/`refund`/`createInvoiceLink`/`addAddon`/
40
- `removeAddon` (throw `PiiAccessDisabledError`). `create` (incl. `markAsPaid`) and
41
- non-payment reads/mutations stay available. Pass `{ fullCustomerAccess: true }` to opt in.
35
+ **The most commonly-misunderstood option in this package. Read this before
36
+ debugging "why is `customerName` null?" or "why did `makePayment` throw?".**
37
+
38
+ Every access service takes `accessOptions?: AccessOptions`
39
+ (`{ fullCustomerAccess?: boolean }`). It is passed **once at construction**, not
40
+ per call, and applies to every service that access service hands out.
41
+
42
+ ```ts
43
+ const peek = new PeekAccessService({
44
+ installId, jwtSecret, issuer, appId, gatewayKey,
45
+ accessOptions: { fullCustomerAccess: true }, // opt in to PII + payment ops
46
+ });
47
+ ```
48
+
49
+ - **Default is `false` (PII off).** Omitting `accessOptions`, passing `{}`, or
50
+ passing `undefined` are all identical to `{ fullCustomerAccess: false }`.
51
+ - There is **no per-call override** by design — an install either has customer-
52
+ data entitlement or it doesn't. Need both modes? Construct two access services.
53
+ - Consumed by `BookingService` and `ReviewService`; `parseWaiverWebhook(body,
54
+ options?)` takes the same object directly. `CngAccessService` /
55
+ `AcmeAccessService` accept the field but have no PII surface (inert).
56
+
57
+ ### With `fullCustomerAccess: false` (default) — two distinct effects
58
+
59
+ **1. PII is never requested.** Filtering happens in the GraphQL selection, so the
60
+ data never leaves the gateway; the fields simply arrive as `null`/empty in the
61
+ clean models. There is no error and no warning — a missing name looks exactly
62
+ like a customer who didn't provide one.
63
+
64
+ | Surface | Redacted (→ `null`/empty) | Always present |
65
+ | --- | --- | --- |
66
+ | Booking | primary-guest `customerName`/`email`/`phone`/`postalCode`/`isGdpr`/opt-ins; per-guest identity (name, country, DOB, email, phone, postal code, `isGdpr`, custom `fieldResponses`) — guests keep only ids + participation/opt-in flags; booking- and ticket-level custom `questionAnswers`; the customer `portalUrl` | notes, Peek Pro operator deep link, money/price breakdown, resources, timeslot + structural ids |
67
+ | Review | reviewer `customerName` / `customerEmail` | comment, rating, dates, credited guides |
68
+ | Waiver webhook | participant `guestName`, signed-document `fileUrl` (redacted at parse time — the payload is fixed, so there is no selection to trim) | signature/agreement ids, timestamps, booking linkage |
69
+
70
+ **2. Payment & booking-modification operations are disabled.** These throw
71
+ `PiiAccessDisabledError` (exported; `.operation` names the blocked method)
72
+ **before any network call**:
73
+
74
+ `getPaymentsOnFile`, `makePayment`, `refund`, `createInvoiceLink`, `addAddon`,
75
+ `removeAddon`.
76
+
77
+ Still available without the flag: `create` (**including `markAsPaid`**),
78
+ `getById`, `getGuests`, `searchByTimeRange`, `searchByTimeslot`, `listAddons`,
79
+ `cancel`, `appendNote`, `setCheckinStatus`, and every other resource service.
80
+
81
+ ### Choosing a value
82
+
83
+ Leave it `false` for operations/logistics tooling (manifests, check-in, guide
84
+ assignment, notes, availability) — that surface is fully functional without PII.
85
+ Set it `true` only when the app genuinely needs to contact customers or move
86
+ money, and only when the install is entitled to that data; the gateway is the
87
+ final authority and may still reject the request.
42
88
 
43
89
  ## Resources (accessor → methods)
44
90
 
45
91
  - `getProductService()` — `getAllProducts()` (flat list of activities + add-ons;
46
92
  add-ons have `type === ADD_ON_PRODUCT_TYPE`); `Product.currency` carries the
47
- activity's ISO currency (empty for add-ons)
93
+ activity's ISO currency (empty for add-ons). Each `Product.tickets[]` entry
94
+ carries `minPrice`/`maxPrice` (`PricingMoney | null`, `null` for add-ons and
95
+ when Peek reports no range); every `PricingMoney` includes a `displayPrice`
96
+ string (e.g. `"$50.00"`) on values read back from the gateway.
48
97
  - `getAccountUserService()` — `getAll()`, `getById(userId)`
49
98
  - `getResourcePoolService()` — `getAll(mode?)`
50
99
  - `getTimeslotService()` — `getForDay(productId, date, filter?)`, `getById(id)`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peektravel/app-utilities",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "GraphQL JS mapping utilities extracted from the Peek Pro Autopilot connector.",
5
5
  "license": "MIT",
6
6
  "repository": {