@peektravel/app-utilities 0.8.0 → 0.8.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
@@ -147,7 +147,13 @@ the app-registry installations API default. `createAccessServiceForInstall` rout
147
147
 
148
148
  - `CngAccessService` — `getProductService().getAllActivities()` (short-form
149
149
  `getAllActivities()`) → `Activity[]` (`Activity`/`ActivityTicket` models).
150
- Errors surface as `CngApiError`.
150
+ Only `productId`/`name`/`color` are populated: `type` is always `"ACTIVITY"`
151
+ and `tickets` is always empty (CNG's products endpoint exposes neither). Only
152
+ active products are returned.
153
+ Errors surface as `CngApiError`, except HTTP 403 — a missing app permission —
154
+ which surfaces as `CngPermissionError` (`.permissions` lists the permission
155
+ names, e.g. `["products:read"]`; logged at `warn`, meant to be caught and
156
+ shown to the operator).
151
157
  - `AcmeAccessService` — `getProductService().getAllActivities()` (short-form
152
158
  `getAllActivities()`) → `AcmeActivity[]` (`AcmeActivity`/`AcmeActivityTicket`
153
159
  models). Errors surface as `AcmeApiError`.
@@ -173,6 +179,10 @@ stay internal.
173
179
  option id or lenient label) before the quote is made — an unmatched/ambiguous
174
180
  question or option, or an invalid checkbox value, fails creation up front.
175
181
  Per-guest questions are not yet supported (answering one fails creation).
182
+ `CreateBookingInput.requireRequiredQuestions?: boolean` (default `false`)
183
+ additionally enforces that every required (non-per-guest) custom question is
184
+ answered — validation runs even when `customQuestionAnswers` is empty/omitted,
185
+ and an unanswered required question fails creation before the quote.
176
186
 
177
187
  ## Errors
178
188
 
@@ -182,8 +192,9 @@ stay internal.
182
192
  418/429 with no GraphQL `errors` — e.g. 401/404/5xx; carries `.statusCode`,
183
193
  `.url`, and raw `.body`; surfaced before JSON parsing so non-JSON error pages
184
194
  keep their status), `PiiAccessDisabledError` (a payment/booking-modification op
185
- was called without `fullCustomerAccess`), and the REST-sibling `CngApiError` /
186
- `AcmeApiError` — all importable; branch with `instanceof`. Token claim
195
+ was called without `fullCustomerAccess`), the REST-sibling `CngApiError` /
196
+ `AcmeApiError`, and `CngPermissionError` (CNG HTTP 403; `.permissions`,
197
+ `.statusCode`, raw `.body`) — all importable; branch with `instanceof`. Token claim
187
198
  extraction never throws once the signature verifies: a missing `user` block
188
199
  gives `user: null`, and each user field (including `id`, the person's own id —
189
200
  not an account/partner id) is nullable, with `""`/`"null"` normalized to `null`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peektravel/app-utilities",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "GraphQL JS mapping utilities extracted from the Peek Pro Autopilot connector.",
5
5
  "license": "MIT",
6
6
  "repository": {