@peektravel/app-utilities 0.8.1 → 0.9.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/dist/index.d.cts CHANGED
@@ -2178,89 +2178,89 @@ declare class PeekAccessService {
2178
2178
  * authenticated transport. The instance is created lazily and reused.
2179
2179
  */
2180
2180
  getReviewService(): ReviewService;
2181
- /** All products (activities + add-ons). Delegates to {@link ProductService.getAllProducts}. */
2181
+ /** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
2182
2182
  getAllProducts(): Promise<Product[]>;
2183
- /** All activity products (excludes add-ons). Delegates to {@link ProductService.getAllActivities}. */
2183
+ /** All activity products (excludes add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllActivities}. */
2184
2184
  getAllActivities(): Promise<Product[]>;
2185
- /** All rental products. Delegates to {@link ProductService.getAllRentals}. */
2185
+ /** All rental products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllRentals}. */
2186
2186
  getAllRentals(): Promise<Product[]>;
2187
- /** All add-on products. Delegates to {@link ProductService.getAllAddons}. */
2187
+ /** All add-on products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllAddons}. */
2188
2188
  getAllAddons(): Promise<Product[]>;
2189
- /** An activity's custom questions. Delegates to {@link ProductService.getCustomQuestions}. */
2189
+ /** An activity's custom questions. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getCustomQuestions}. */
2190
2190
  getCustomQuestions(productId: string): Promise<CustomQuestion[]>;
2191
- /** All active account users. Delegates to {@link AccountUserService.getAll}. */
2191
+ /** All active account users. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getAll}. */
2192
2192
  getAllAccountUsers(): Promise<AccountUser[]>;
2193
- /** Account user by id, or null. Delegates to {@link AccountUserService.getById}. */
2193
+ /** Account user by id, or null. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getById}. */
2194
2194
  getAccountUserById(userId: string): Promise<AccountUser | null>;
2195
- /** All resource pools. Delegates to {@link ResourcePoolService.getAll}. */
2195
+ /** All resource pools. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResourcePoolService.getAll}. */
2196
2196
  getAllResourcePools(mode?: ResourcePoolMode): Promise<ResourcePool[]>;
2197
- /** Timeslots for an activity on a given date. Delegates to {@link TimeslotService.getForDay}. */
2197
+ /** Timeslots for an activity on a given date. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getForDay}. */
2198
2198
  getTimeslotsForDay(productId: string, date: string, filter?: TimeslotFilter): Promise<Timeslot[]>;
2199
- /** Single timeslot by id. Delegates to {@link TimeslotService.getById}. */
2199
+ /** Single timeslot by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getById}. */
2200
2200
  getTimeslotById(timeslotId: string): Promise<Timeslot | null>;
2201
- /** Set timeslot status. Delegates to {@link TimeslotService.setAvailability}. */
2201
+ /** Set timeslot status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setAvailability}. */
2202
2202
  setTimeslotAvailability(timeslotId: string, status: string): Promise<UpdateTimeslotResult>;
2203
- /** Set timeslot manifest notes. Delegates to {@link TimeslotService.setNotes}. */
2203
+ /** Set timeslot manifest notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setNotes}. */
2204
2204
  setTimeslotNotes(timeslotId: string, manifestNotes: string): Promise<UpdateTimeslotResult>;
2205
- /** Assign or unassign guides on timeslots. Delegates to {@link TimeslotService.assignGuide}. */
2205
+ /** Assign or unassign guides on timeslots. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.assignGuide}. */
2206
2206
  assignTimeslotGuide(assignment: GuideAssignment): Promise<AssignGuideResult>;
2207
- /** All reseller channels. Delegates to {@link ResellerService.getAllChannels}. */
2207
+ /** All reseller channels. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResellerService.getAllChannels}. */
2208
2208
  getAllChannels(agentsPerChannel?: number): Promise<Channel[]>;
2209
- /** All promo codes. Delegates to {@link PromoCodeService.getAll}. */
2209
+ /** All promo codes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.getAll}. */
2210
2210
  getAllPromoCodes(): Promise<PromoCode[]>;
2211
- /** Create a promo code. Delegates to {@link PromoCodeService.create}. */
2211
+ /** Create a promo code. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.create}. */
2212
2212
  createPromoCode(input: CreatePromoCodeInput): Promise<CreatedPromoCode>;
2213
- /** Create a pricing engine. Delegates to {@link PricingService.createEngine}. */
2213
+ /** Create a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.createEngine}. */
2214
2214
  createPricingEngine(input: CreateEngineInput): Promise<CreatedPricingEngine>;
2215
- /** Update a pricing engine. Delegates to {@link PricingService.updateEngine}. */
2215
+ /** Update a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.updateEngine}. */
2216
2216
  updatePricingEngine(input: UpdateEngineInput): Promise<PricingEngine>;
2217
- /** Delete a pricing engine (idempotent). Delegates to {@link PricingService.deleteEngine}. */
2217
+ /** Delete a pricing engine (idempotent). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.deleteEngine}. */
2218
2218
  deletePricingEngine(engineId: string): Promise<void>;
2219
- /** Upsert pricing overrides. Delegates to {@link PricingService.upsertOverrides}. */
2219
+ /** Upsert pricing overrides. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.upsertOverrides}. */
2220
2220
  upsertPricingOverrides(input: UpsertOverridesInput): Promise<UpsertOverridesResult>;
2221
- /** Clear pricing overrides for a set of activities. Delegates to {@link PricingService.clearOverrides}. */
2221
+ /** Clear pricing overrides for a set of activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.clearOverrides}. */
2222
2222
  clearPricingOverrides(input: ClearOverridesInput): Promise<UpsertOverridesResult>;
2223
- /** Today's daily note. Delegates to {@link DailyNoteService.getToday}. */
2223
+ /** Today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.getToday}. */
2224
2224
  getDailyNoteToday(): Promise<DailyNote | null>;
2225
- /** Update today's daily note. Delegates to {@link DailyNoteService.update}. */
2225
+ /** Update today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.update}. */
2226
2226
  updateDailyNote(note: string): Promise<DailyNote | null>;
2227
- /** Availability times for an activity. Delegates to {@link AvailabilityService.getAvailabilityTimes}. */
2227
+ /** Availability times for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AvailabilityService.getAvailabilityTimes}. */
2228
2228
  getAvailabilityTimes(query: AvailabilityTimesQuery): Promise<AvailabilityTime[]>;
2229
- /** All memberships. Delegates to {@link MembershipService.getAll}. */
2229
+ /** All memberships. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.getAll}. */
2230
2230
  getAllMemberships(): Promise<Membership[]>;
2231
- /** Purchase a membership. Delegates to {@link MembershipService.purchase}. */
2231
+ /** Purchase a membership. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.purchase}. */
2232
2232
  purchaseMembership(input: MembershipPurchaseInput): Promise<PurchasedMembership>;
2233
- /** Booking by id. Delegates to {@link BookingService.getById}. */
2233
+ /** Booking by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getById}. */
2234
2234
  getBookingById(bookingId: string, options?: BookingReadOptions): Promise<Booking | null>;
2235
- /** Bookings by time range. Delegates to {@link BookingService.searchByTimeRange}. */
2235
+ /** Bookings by time range. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeRange}. */
2236
2236
  searchBookingsByTimeRange(input: BookingTimeRangeSearch): Promise<Booking[]>;
2237
- /** Bookings on a timeslot. Delegates to {@link BookingService.searchByTimeslot}. */
2237
+ /** Bookings on a timeslot. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeslot}. */
2238
2238
  searchBookingsByTimeslot(timeslotId: string, options?: BookingReadOptions): Promise<Booking[]>;
2239
- /** Guests on a booking. Delegates to {@link BookingService.getGuests}. */
2239
+ /** Guests on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getGuests}. */
2240
2240
  getBookingGuests(bookingId: string): Promise<Guest[]>;
2241
- /** Payments on file for a booking. Delegates to {@link BookingService.getPaymentsOnFile}. */
2241
+ /** Payments on file for a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getPaymentsOnFile}. */
2242
2242
  getBookingPaymentsOnFile(bookingId: string): Promise<BookingPaymentsOnFile | null>;
2243
- /** Append or overwrite operator notes. Delegates to {@link BookingService.appendNote}. */
2243
+ /** Append or overwrite operator notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.appendNote}. */
2244
2244
  appendBookingNote(bookingId: string, note: string, mode?: NoteMode): Promise<Booking | null>;
2245
- /** Set booking check-in status. Delegates to {@link BookingService.setCheckinStatus}. */
2245
+ /** Set booking check-in status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.setCheckinStatus}. */
2246
2246
  setBookingCheckinStatus(bookingId: string, checkedIn: boolean): Promise<Booking | null>;
2247
- /** Cancel a booking. Delegates to {@link BookingService.cancel}. */
2247
+ /** Cancel a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.cancel}. */
2248
2248
  cancelBooking(bookingId: string, notes?: string): Promise<CancelBookingResult>;
2249
- /** Charge a booking. Delegates to {@link BookingService.makePayment}. */
2249
+ /** Charge a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.makePayment}. */
2250
2250
  makeBookingPayment(input: MakePaymentInput): Promise<MakePaymentResult>;
2251
- /** Refund a booking payment. Delegates to {@link BookingService.refund}. */
2251
+ /** Refund a booking payment. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.refund}. */
2252
2252
  refundBooking(input: RefundInput): Promise<RefundResult>;
2253
- /** Create an invoice link. Delegates to {@link BookingService.createInvoiceLink}. */
2253
+ /** Create an invoice link. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.createInvoiceLink}. */
2254
2254
  createBookingInvoiceLink(bookingId: string): Promise<InvoiceLinkResult>;
2255
- /** List add-ons on a booking. Delegates to {@link BookingService.listAddons}. */
2255
+ /** List add-ons on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.listAddons}. */
2256
2256
  listBookingAddons(bookingId: string): Promise<BookingAddons>;
2257
- /** Add an add-on to a booking. Delegates to {@link BookingService.addAddon}. */
2257
+ /** Add an add-on to a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.addAddon}. */
2258
2258
  addBookingAddon(bookingId: string, input: AddAddonInput): Promise<BookingAddonsMutationResult>;
2259
- /** Remove an add-on from a booking. Delegates to {@link BookingService.removeAddon}. */
2259
+ /** Remove an add-on from a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.removeAddon}. */
2260
2260
  removeBookingAddon(bookingId: string, input: AddAddonInput): Promise<BookingAddonsMutationResult>;
2261
- /** Create a booking. Delegates to {@link BookingService.create}. */
2261
+ /** Create a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.create}. */
2262
2262
  createBooking(input: CreateBookingInput): Promise<CreatedBooking>;
2263
- /** Reviews for an activity. Delegates to {@link ReviewService.getReviews}. */
2263
+ /** Reviews for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ReviewService.getReviews}. */
2264
2264
  getReviews(productId: string, reviewCount?: number, reviewOffset?: number): Promise<Review[]>;
2265
2265
  }
2266
2266
 
@@ -2300,6 +2300,7 @@ declare class RestClient$1 {
2300
2300
  *
2301
2301
  * @throws {AdminAccountRequiredError} on HTTP 418
2302
2302
  * @throws {RateLimitError} on HTTP 429 after retries are exhausted
2303
+ * @throws {CngPermissionError} on HTTP 403 (app missing a permission)
2303
2304
  * @throws {CngApiError} on any other non-2xx response
2304
2305
  */
2305
2306
  get<T>(path: string): Promise<T>;
@@ -2321,23 +2322,30 @@ declare class RestClient$1 {
2321
2322
  *
2322
2323
  * `CngAccessService.getAllActivities()` returns these as a flat list.
2323
2324
  *
2324
- * NOTE: field mapping is a best-guess placeholder until the real
2325
- * `commerce-config/products` response shape is confirmed — see
2326
- * `internal/cng/products/product-queries.ts`.
2325
+ * Mapped from the `app-registry/products` REST payload — see
2326
+ * `internal/cng/products/product-queries.ts`. That payload carries no
2327
+ * product-type discriminator and no sub-options, so `type` is always
2328
+ * {@link ACTIVITY_PRODUCT_TYPE} and `tickets` is always empty.
2327
2329
  */
2328
2330
  interface Activity {
2329
2331
  /** Stable unique identifier for the activity. */
2330
2332
  productId: string;
2331
2333
  /** Human-readable display name. */
2332
2334
  name: string;
2333
- /** Product type reported by CNG (e.g. `"ACTIVITY"`). */
2335
+ /**
2336
+ * Product type. Always {@link ACTIVITY_PRODUCT_TYPE} — the CNG products
2337
+ * payload has no type discriminator. Kept for parity with the Peek `Product`.
2338
+ */
2334
2339
  type: string;
2335
2340
  /**
2336
- * Display color as a hex string (e.g. `"#1A2B3C"`). Empty string when no
2337
- * color is set.
2341
+ * Display color as a hex string (e.g. `"#1A2B3C"`), from the product's
2342
+ * access-control color. Empty string when no color is set.
2338
2343
  */
2339
2344
  color: string;
2340
- /** The bookable sub-options (tickets) of this activity. */
2345
+ /**
2346
+ * The bookable sub-options (tickets) of this activity. Always empty — CNG
2347
+ * exposes no tickets on the products endpoint today.
2348
+ */
2341
2349
  tickets: ActivityTicket[];
2342
2350
  }
2343
2351
  /** A single bookable sub-option (ticket) of an {@link Activity}. */
@@ -2382,7 +2390,7 @@ type CngAccessServiceConfig = BaseAccessServiceConfig;
2382
2390
  * appId: process.env.PEEK_APP_ID!,
2383
2391
  * });
2384
2392
  *
2385
- * const activities: Activity[] = await cng.getAllActivities();
2393
+ * const activities: Activity[] = await cng.getProductService().getAllActivities();
2386
2394
  * ```
2387
2395
  *
2388
2396
  * @throws {Error} from the constructor when any required config field
@@ -2397,7 +2405,7 @@ declare class CngAccessService {
2397
2405
  * authenticated transport. The instance is created lazily and reused.
2398
2406
  */
2399
2407
  getProductService(): CngProductService;
2400
- /** All activities. Delegates to {@link CngProductService.getAllActivities}. */
2408
+ /** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link CngProductService.getAllActivities}. */
2401
2409
  getAllActivities(): Promise<Activity[]>;
2402
2410
  }
2403
2411
 
@@ -2517,7 +2525,7 @@ type AcmeAccessServiceConfig = BaseAccessServiceConfig;
2517
2525
  * appId: process.env.PEEK_APP_ID!,
2518
2526
  * });
2519
2527
  *
2520
- * const activities: AcmeActivity[] = await acme.getAllActivities();
2528
+ * const activities: AcmeActivity[] = await acme.getProductService().getAllActivities();
2521
2529
  * ```
2522
2530
  *
2523
2531
  * @throws {Error} from the constructor when any required config field
@@ -2532,7 +2540,7 @@ declare class AcmeAccessService {
2532
2540
  * authenticated transport. The instance is created lazily and reused.
2533
2541
  */
2534
2542
  getProductService(): AcmeProductService;
2535
- /** All activities. Delegates to {@link AcmeProductService.getAllActivities}. */
2543
+ /** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AcmeProductService.getAllActivities}. */
2536
2544
  getAllActivities(): Promise<AcmeActivity[]>;
2537
2545
  }
2538
2546
 
@@ -2864,15 +2872,6 @@ declare function parseInstallWebhook(token: string, body: unknown, secret: strin
2864
2872
  */
2865
2873
  declare function verifyInstallWebhook(token: string, secret: string): InstallWebhookClaims;
2866
2874
 
2867
- /**
2868
- * Typed errors thrown by the package. Each mirrors a failure mode of the Peek
2869
- * GraphQL gateway (or the CNG REST gateway) so callers can branch on the error
2870
- * type rather than parsing messages.
2871
- *
2872
- * `AdminAccountRequiredError` and `RateLimitError` are shared by all gateways.
2873
- * `PeekGraphQLError` is Peek-only; `CngApiError` is CNG-only; `AcmeApiError` is
2874
- * ACME-only.
2875
- */
2876
2875
  /**
2877
2876
  * Thrown when the gateway responds with HTTP 418, indicating the install is not
2878
2877
  * permitted to perform the request because an admin account is required.
@@ -2947,6 +2946,32 @@ declare class CngApiError extends Error {
2947
2946
  readonly body: unknown;
2948
2947
  constructor(statusCode: number, body: unknown, message?: string);
2949
2948
  }
2949
+ /**
2950
+ * Thrown when the CNG REST gateway responds with HTTP 403 because the app lacks
2951
+ * a permission the endpoint requires (e.g. `products:read`). This is an
2952
+ * **expected** failure for a misconfigured install — not a bug — so the
2953
+ * transport logs it at `warn` rather than `error` and leaves presentation to the
2954
+ * caller, which can branch on the type and surface the missing permission
2955
+ * however its UI prefers.
2956
+ *
2957
+ * The permission names the gateway named are on
2958
+ * {@link CngPermissionError.permissions} (empty when the body does not name
2959
+ * any), so a caller can render them without re-parsing the raw body. Thrown in
2960
+ * place of {@link CngApiError} for 403s only; every other non-2xx status still
2961
+ * throws `CngApiError`.
2962
+ */
2963
+ declare class CngPermissionError extends Error {
2964
+ /** The HTTP status that triggered this error. */
2965
+ readonly statusCode = 403;
2966
+ /**
2967
+ * The permissions the gateway reported as missing, e.g. `["products:read"]`.
2968
+ * Empty when the response body did not name any.
2969
+ */
2970
+ readonly permissions: string[];
2971
+ /** The raw response body (parsed JSON when possible, otherwise text). */
2972
+ readonly body: unknown;
2973
+ constructor(permissions: string[], body: unknown, message?: string);
2974
+ }
2950
2975
  /**
2951
2976
  * Thrown when the ACME REST gateway returns a non-2xx response that is not one
2952
2977
  * of the specifically-handled statuses (418/429). The offending status is
@@ -2962,4 +2987,4 @@ declare class AcmeApiError extends Error {
2962
2987
  constructor(statusCode: number, body: unknown, message?: string);
2963
2988
  }
2964
2989
 
2965
- export { ACTIVITY_PRODUCT_TYPE, ADD_ON_PRODUCT_TYPE, type AccessOptions, type AccountUser, AccountUserService, type AccountUserServiceOptions, AcmeAccessService, type AcmeAccessServiceConfig, type AcmeActivity, type AcmeActivityTicket, AcmeApiError, AcmeProductService, type Activity, type ActivityOverrides, type ActivityTicket, type AddAddonInput, AdminAccountRequiredError, type Agent, type AssignGuideResult, type AssignedActivity, type AssignedResource, type Availability, AvailabilityService, type AvailabilityTime, type AvailabilityTimesQuery, type Booking, type BookingAddon, type BookingAddonMoney, type BookingAddonOption, type BookingAddons, type BookingAddonsMutationResult, type BookingPaymentsOnFile, type BookingReadOptions, type BookingSearchBy, BookingService, type BookingServiceOptions, type BookingTimeRangeSearch, type CancelBookingResult, type Channel, type ClearOverridesInput, CngAccessService, type CngAccessServiceConfig, CngApiError, CngProductService, type CreateBookingGuest, type CreateBookingInput, type CreateBookingTicket, type CreateEngineInput, type CreatePromoCodeInput, type CreatedBooking, type CreatedPricingEngine, type CreatedPromoCode, type CustomQuestion, type CustomQuestionAnswer, type CustomQuestionAnswerInput, type CustomQuestionOption, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, INSTALL_STATUSES, type InstallAccessConfig, type InstallAccessService, type InstallAccessTarget, type InstallStatus, type InstallWebhook, type InstallWebhookAccount, type InstallWebhookClaims, type InvoiceLinkResult, type Logger, type MakePaymentInput, type MakePaymentResult, type Membership, type MembershipPurchaseInput, MembershipService, type NoteMode, type Payment, type PaymentSource, PeekAccessService, type PeekAccessServiceConfig, type PeekAuthTokenClaims, type PeekAuthTokenUser, PeekGraphQLError, PeekHttpError, type PeekPlatform, PiiAccessDisabledError, type Price, type PricingActivityContext, type PricingEngine, type PricingMoney, type PricingNamedRef, type PricingOverride, type PricingOverrideFilter, PricingService, type Product, type ProductMeetingLocation, ProductService, type ProductServiceOptions, type ProductTicket, type PromoCode, type PromoCodeFixedAmount, PromoCodeService, type PromoCodeServiceOptions, type PurchasedMembership, RENTAL_PRODUCT_TYPE, RateLimitError, type RefundInput, type RefundResult, ResellerService, type ResolvedOverride, type ResolvedPricingOverride, type ResolvedResourceOption, type Resource, type ResourceOptionOverride, type ResourceOptionQuantity, type ResourcePool, type ResourcePoolAccountUser, type ResourcePoolAssignment, type ResourcePoolMode, ResourcePoolService, type Review, ReviewService, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
2990
+ export { ACTIVITY_PRODUCT_TYPE, ADD_ON_PRODUCT_TYPE, type AccessOptions, type AccountUser, AccountUserService, type AccountUserServiceOptions, AcmeAccessService, type AcmeAccessServiceConfig, type AcmeActivity, type AcmeActivityTicket, AcmeApiError, AcmeProductService, type Activity, type ActivityOverrides, type ActivityTicket, type AddAddonInput, AdminAccountRequiredError, type Agent, type AssignGuideResult, type AssignedActivity, type AssignedResource, type Availability, AvailabilityService, type AvailabilityTime, type AvailabilityTimesQuery, type Booking, type BookingAddon, type BookingAddonMoney, type BookingAddonOption, type BookingAddons, type BookingAddonsMutationResult, type BookingPaymentsOnFile, type BookingReadOptions, type BookingSearchBy, BookingService, type BookingServiceOptions, type BookingTimeRangeSearch, type CancelBookingResult, type Channel, type ClearOverridesInput, CngAccessService, type CngAccessServiceConfig, CngApiError, CngPermissionError, CngProductService, type CreateBookingGuest, type CreateBookingInput, type CreateBookingTicket, type CreateEngineInput, type CreatePromoCodeInput, type CreatedBooking, type CreatedPricingEngine, type CreatedPromoCode, type CustomQuestion, type CustomQuestionAnswer, type CustomQuestionAnswerInput, type CustomQuestionOption, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, INSTALL_STATUSES, type InstallAccessConfig, type InstallAccessService, type InstallAccessTarget, type InstallStatus, type InstallWebhook, type InstallWebhookAccount, type InstallWebhookClaims, type InvoiceLinkResult, type Logger, type MakePaymentInput, type MakePaymentResult, type Membership, type MembershipPurchaseInput, MembershipService, type NoteMode, type Payment, type PaymentSource, PeekAccessService, type PeekAccessServiceConfig, type PeekAuthTokenClaims, type PeekAuthTokenUser, PeekGraphQLError, PeekHttpError, type PeekPlatform, PiiAccessDisabledError, type Price, type PricingActivityContext, type PricingEngine, type PricingMoney, type PricingNamedRef, type PricingOverride, type PricingOverrideFilter, PricingService, type Product, type ProductMeetingLocation, ProductService, type ProductServiceOptions, type ProductTicket, type PromoCode, type PromoCodeFixedAmount, PromoCodeService, type PromoCodeServiceOptions, type PurchasedMembership, RENTAL_PRODUCT_TYPE, RateLimitError, type RefundInput, type RefundResult, ResellerService, type ResolvedOverride, type ResolvedPricingOverride, type ResolvedResourceOption, type Resource, type ResourceOptionOverride, type ResourceOptionQuantity, type ResourcePool, type ResourcePoolAccountUser, type ResourcePoolAssignment, type ResourcePoolMode, ResourcePoolService, type Review, ReviewService, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
package/dist/index.d.ts CHANGED
@@ -2178,89 +2178,89 @@ declare class PeekAccessService {
2178
2178
  * authenticated transport. The instance is created lazily and reused.
2179
2179
  */
2180
2180
  getReviewService(): ReviewService;
2181
- /** All products (activities + add-ons). Delegates to {@link ProductService.getAllProducts}. */
2181
+ /** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
2182
2182
  getAllProducts(): Promise<Product[]>;
2183
- /** All activity products (excludes add-ons). Delegates to {@link ProductService.getAllActivities}. */
2183
+ /** All activity products (excludes add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllActivities}. */
2184
2184
  getAllActivities(): Promise<Product[]>;
2185
- /** All rental products. Delegates to {@link ProductService.getAllRentals}. */
2185
+ /** All rental products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllRentals}. */
2186
2186
  getAllRentals(): Promise<Product[]>;
2187
- /** All add-on products. Delegates to {@link ProductService.getAllAddons}. */
2187
+ /** All add-on products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllAddons}. */
2188
2188
  getAllAddons(): Promise<Product[]>;
2189
- /** An activity's custom questions. Delegates to {@link ProductService.getCustomQuestions}. */
2189
+ /** An activity's custom questions. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getCustomQuestions}. */
2190
2190
  getCustomQuestions(productId: string): Promise<CustomQuestion[]>;
2191
- /** All active account users. Delegates to {@link AccountUserService.getAll}. */
2191
+ /** All active account users. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getAll}. */
2192
2192
  getAllAccountUsers(): Promise<AccountUser[]>;
2193
- /** Account user by id, or null. Delegates to {@link AccountUserService.getById}. */
2193
+ /** Account user by id, or null. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getById}. */
2194
2194
  getAccountUserById(userId: string): Promise<AccountUser | null>;
2195
- /** All resource pools. Delegates to {@link ResourcePoolService.getAll}. */
2195
+ /** All resource pools. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResourcePoolService.getAll}. */
2196
2196
  getAllResourcePools(mode?: ResourcePoolMode): Promise<ResourcePool[]>;
2197
- /** Timeslots for an activity on a given date. Delegates to {@link TimeslotService.getForDay}. */
2197
+ /** Timeslots for an activity on a given date. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getForDay}. */
2198
2198
  getTimeslotsForDay(productId: string, date: string, filter?: TimeslotFilter): Promise<Timeslot[]>;
2199
- /** Single timeslot by id. Delegates to {@link TimeslotService.getById}. */
2199
+ /** Single timeslot by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getById}. */
2200
2200
  getTimeslotById(timeslotId: string): Promise<Timeslot | null>;
2201
- /** Set timeslot status. Delegates to {@link TimeslotService.setAvailability}. */
2201
+ /** Set timeslot status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setAvailability}. */
2202
2202
  setTimeslotAvailability(timeslotId: string, status: string): Promise<UpdateTimeslotResult>;
2203
- /** Set timeslot manifest notes. Delegates to {@link TimeslotService.setNotes}. */
2203
+ /** Set timeslot manifest notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setNotes}. */
2204
2204
  setTimeslotNotes(timeslotId: string, manifestNotes: string): Promise<UpdateTimeslotResult>;
2205
- /** Assign or unassign guides on timeslots. Delegates to {@link TimeslotService.assignGuide}. */
2205
+ /** Assign or unassign guides on timeslots. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.assignGuide}. */
2206
2206
  assignTimeslotGuide(assignment: GuideAssignment): Promise<AssignGuideResult>;
2207
- /** All reseller channels. Delegates to {@link ResellerService.getAllChannels}. */
2207
+ /** All reseller channels. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResellerService.getAllChannels}. */
2208
2208
  getAllChannels(agentsPerChannel?: number): Promise<Channel[]>;
2209
- /** All promo codes. Delegates to {@link PromoCodeService.getAll}. */
2209
+ /** All promo codes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.getAll}. */
2210
2210
  getAllPromoCodes(): Promise<PromoCode[]>;
2211
- /** Create a promo code. Delegates to {@link PromoCodeService.create}. */
2211
+ /** Create a promo code. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.create}. */
2212
2212
  createPromoCode(input: CreatePromoCodeInput): Promise<CreatedPromoCode>;
2213
- /** Create a pricing engine. Delegates to {@link PricingService.createEngine}. */
2213
+ /** Create a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.createEngine}. */
2214
2214
  createPricingEngine(input: CreateEngineInput): Promise<CreatedPricingEngine>;
2215
- /** Update a pricing engine. Delegates to {@link PricingService.updateEngine}. */
2215
+ /** Update a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.updateEngine}. */
2216
2216
  updatePricingEngine(input: UpdateEngineInput): Promise<PricingEngine>;
2217
- /** Delete a pricing engine (idempotent). Delegates to {@link PricingService.deleteEngine}. */
2217
+ /** Delete a pricing engine (idempotent). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.deleteEngine}. */
2218
2218
  deletePricingEngine(engineId: string): Promise<void>;
2219
- /** Upsert pricing overrides. Delegates to {@link PricingService.upsertOverrides}. */
2219
+ /** Upsert pricing overrides. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.upsertOverrides}. */
2220
2220
  upsertPricingOverrides(input: UpsertOverridesInput): Promise<UpsertOverridesResult>;
2221
- /** Clear pricing overrides for a set of activities. Delegates to {@link PricingService.clearOverrides}. */
2221
+ /** Clear pricing overrides for a set of activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.clearOverrides}. */
2222
2222
  clearPricingOverrides(input: ClearOverridesInput): Promise<UpsertOverridesResult>;
2223
- /** Today's daily note. Delegates to {@link DailyNoteService.getToday}. */
2223
+ /** Today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.getToday}. */
2224
2224
  getDailyNoteToday(): Promise<DailyNote | null>;
2225
- /** Update today's daily note. Delegates to {@link DailyNoteService.update}. */
2225
+ /** Update today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.update}. */
2226
2226
  updateDailyNote(note: string): Promise<DailyNote | null>;
2227
- /** Availability times for an activity. Delegates to {@link AvailabilityService.getAvailabilityTimes}. */
2227
+ /** Availability times for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AvailabilityService.getAvailabilityTimes}. */
2228
2228
  getAvailabilityTimes(query: AvailabilityTimesQuery): Promise<AvailabilityTime[]>;
2229
- /** All memberships. Delegates to {@link MembershipService.getAll}. */
2229
+ /** All memberships. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.getAll}. */
2230
2230
  getAllMemberships(): Promise<Membership[]>;
2231
- /** Purchase a membership. Delegates to {@link MembershipService.purchase}. */
2231
+ /** Purchase a membership. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.purchase}. */
2232
2232
  purchaseMembership(input: MembershipPurchaseInput): Promise<PurchasedMembership>;
2233
- /** Booking by id. Delegates to {@link BookingService.getById}. */
2233
+ /** Booking by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getById}. */
2234
2234
  getBookingById(bookingId: string, options?: BookingReadOptions): Promise<Booking | null>;
2235
- /** Bookings by time range. Delegates to {@link BookingService.searchByTimeRange}. */
2235
+ /** Bookings by time range. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeRange}. */
2236
2236
  searchBookingsByTimeRange(input: BookingTimeRangeSearch): Promise<Booking[]>;
2237
- /** Bookings on a timeslot. Delegates to {@link BookingService.searchByTimeslot}. */
2237
+ /** Bookings on a timeslot. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeslot}. */
2238
2238
  searchBookingsByTimeslot(timeslotId: string, options?: BookingReadOptions): Promise<Booking[]>;
2239
- /** Guests on a booking. Delegates to {@link BookingService.getGuests}. */
2239
+ /** Guests on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getGuests}. */
2240
2240
  getBookingGuests(bookingId: string): Promise<Guest[]>;
2241
- /** Payments on file for a booking. Delegates to {@link BookingService.getPaymentsOnFile}. */
2241
+ /** Payments on file for a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getPaymentsOnFile}. */
2242
2242
  getBookingPaymentsOnFile(bookingId: string): Promise<BookingPaymentsOnFile | null>;
2243
- /** Append or overwrite operator notes. Delegates to {@link BookingService.appendNote}. */
2243
+ /** Append or overwrite operator notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.appendNote}. */
2244
2244
  appendBookingNote(bookingId: string, note: string, mode?: NoteMode): Promise<Booking | null>;
2245
- /** Set booking check-in status. Delegates to {@link BookingService.setCheckinStatus}. */
2245
+ /** Set booking check-in status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.setCheckinStatus}. */
2246
2246
  setBookingCheckinStatus(bookingId: string, checkedIn: boolean): Promise<Booking | null>;
2247
- /** Cancel a booking. Delegates to {@link BookingService.cancel}. */
2247
+ /** Cancel a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.cancel}. */
2248
2248
  cancelBooking(bookingId: string, notes?: string): Promise<CancelBookingResult>;
2249
- /** Charge a booking. Delegates to {@link BookingService.makePayment}. */
2249
+ /** Charge a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.makePayment}. */
2250
2250
  makeBookingPayment(input: MakePaymentInput): Promise<MakePaymentResult>;
2251
- /** Refund a booking payment. Delegates to {@link BookingService.refund}. */
2251
+ /** Refund a booking payment. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.refund}. */
2252
2252
  refundBooking(input: RefundInput): Promise<RefundResult>;
2253
- /** Create an invoice link. Delegates to {@link BookingService.createInvoiceLink}. */
2253
+ /** Create an invoice link. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.createInvoiceLink}. */
2254
2254
  createBookingInvoiceLink(bookingId: string): Promise<InvoiceLinkResult>;
2255
- /** List add-ons on a booking. Delegates to {@link BookingService.listAddons}. */
2255
+ /** List add-ons on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.listAddons}. */
2256
2256
  listBookingAddons(bookingId: string): Promise<BookingAddons>;
2257
- /** Add an add-on to a booking. Delegates to {@link BookingService.addAddon}. */
2257
+ /** Add an add-on to a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.addAddon}. */
2258
2258
  addBookingAddon(bookingId: string, input: AddAddonInput): Promise<BookingAddonsMutationResult>;
2259
- /** Remove an add-on from a booking. Delegates to {@link BookingService.removeAddon}. */
2259
+ /** Remove an add-on from a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.removeAddon}. */
2260
2260
  removeBookingAddon(bookingId: string, input: AddAddonInput): Promise<BookingAddonsMutationResult>;
2261
- /** Create a booking. Delegates to {@link BookingService.create}. */
2261
+ /** Create a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.create}. */
2262
2262
  createBooking(input: CreateBookingInput): Promise<CreatedBooking>;
2263
- /** Reviews for an activity. Delegates to {@link ReviewService.getReviews}. */
2263
+ /** Reviews for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ReviewService.getReviews}. */
2264
2264
  getReviews(productId: string, reviewCount?: number, reviewOffset?: number): Promise<Review[]>;
2265
2265
  }
2266
2266
 
@@ -2300,6 +2300,7 @@ declare class RestClient$1 {
2300
2300
  *
2301
2301
  * @throws {AdminAccountRequiredError} on HTTP 418
2302
2302
  * @throws {RateLimitError} on HTTP 429 after retries are exhausted
2303
+ * @throws {CngPermissionError} on HTTP 403 (app missing a permission)
2303
2304
  * @throws {CngApiError} on any other non-2xx response
2304
2305
  */
2305
2306
  get<T>(path: string): Promise<T>;
@@ -2321,23 +2322,30 @@ declare class RestClient$1 {
2321
2322
  *
2322
2323
  * `CngAccessService.getAllActivities()` returns these as a flat list.
2323
2324
  *
2324
- * NOTE: field mapping is a best-guess placeholder until the real
2325
- * `commerce-config/products` response shape is confirmed — see
2326
- * `internal/cng/products/product-queries.ts`.
2325
+ * Mapped from the `app-registry/products` REST payload — see
2326
+ * `internal/cng/products/product-queries.ts`. That payload carries no
2327
+ * product-type discriminator and no sub-options, so `type` is always
2328
+ * {@link ACTIVITY_PRODUCT_TYPE} and `tickets` is always empty.
2327
2329
  */
2328
2330
  interface Activity {
2329
2331
  /** Stable unique identifier for the activity. */
2330
2332
  productId: string;
2331
2333
  /** Human-readable display name. */
2332
2334
  name: string;
2333
- /** Product type reported by CNG (e.g. `"ACTIVITY"`). */
2335
+ /**
2336
+ * Product type. Always {@link ACTIVITY_PRODUCT_TYPE} — the CNG products
2337
+ * payload has no type discriminator. Kept for parity with the Peek `Product`.
2338
+ */
2334
2339
  type: string;
2335
2340
  /**
2336
- * Display color as a hex string (e.g. `"#1A2B3C"`). Empty string when no
2337
- * color is set.
2341
+ * Display color as a hex string (e.g. `"#1A2B3C"`), from the product's
2342
+ * access-control color. Empty string when no color is set.
2338
2343
  */
2339
2344
  color: string;
2340
- /** The bookable sub-options (tickets) of this activity. */
2345
+ /**
2346
+ * The bookable sub-options (tickets) of this activity. Always empty — CNG
2347
+ * exposes no tickets on the products endpoint today.
2348
+ */
2341
2349
  tickets: ActivityTicket[];
2342
2350
  }
2343
2351
  /** A single bookable sub-option (ticket) of an {@link Activity}. */
@@ -2382,7 +2390,7 @@ type CngAccessServiceConfig = BaseAccessServiceConfig;
2382
2390
  * appId: process.env.PEEK_APP_ID!,
2383
2391
  * });
2384
2392
  *
2385
- * const activities: Activity[] = await cng.getAllActivities();
2393
+ * const activities: Activity[] = await cng.getProductService().getAllActivities();
2386
2394
  * ```
2387
2395
  *
2388
2396
  * @throws {Error} from the constructor when any required config field
@@ -2397,7 +2405,7 @@ declare class CngAccessService {
2397
2405
  * authenticated transport. The instance is created lazily and reused.
2398
2406
  */
2399
2407
  getProductService(): CngProductService;
2400
- /** All activities. Delegates to {@link CngProductService.getAllActivities}. */
2408
+ /** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link CngProductService.getAllActivities}. */
2401
2409
  getAllActivities(): Promise<Activity[]>;
2402
2410
  }
2403
2411
 
@@ -2517,7 +2525,7 @@ type AcmeAccessServiceConfig = BaseAccessServiceConfig;
2517
2525
  * appId: process.env.PEEK_APP_ID!,
2518
2526
  * });
2519
2527
  *
2520
- * const activities: AcmeActivity[] = await acme.getAllActivities();
2528
+ * const activities: AcmeActivity[] = await acme.getProductService().getAllActivities();
2521
2529
  * ```
2522
2530
  *
2523
2531
  * @throws {Error} from the constructor when any required config field
@@ -2532,7 +2540,7 @@ declare class AcmeAccessService {
2532
2540
  * authenticated transport. The instance is created lazily and reused.
2533
2541
  */
2534
2542
  getProductService(): AcmeProductService;
2535
- /** All activities. Delegates to {@link AcmeProductService.getAllActivities}. */
2543
+ /** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AcmeProductService.getAllActivities}. */
2536
2544
  getAllActivities(): Promise<AcmeActivity[]>;
2537
2545
  }
2538
2546
 
@@ -2864,15 +2872,6 @@ declare function parseInstallWebhook(token: string, body: unknown, secret: strin
2864
2872
  */
2865
2873
  declare function verifyInstallWebhook(token: string, secret: string): InstallWebhookClaims;
2866
2874
 
2867
- /**
2868
- * Typed errors thrown by the package. Each mirrors a failure mode of the Peek
2869
- * GraphQL gateway (or the CNG REST gateway) so callers can branch on the error
2870
- * type rather than parsing messages.
2871
- *
2872
- * `AdminAccountRequiredError` and `RateLimitError` are shared by all gateways.
2873
- * `PeekGraphQLError` is Peek-only; `CngApiError` is CNG-only; `AcmeApiError` is
2874
- * ACME-only.
2875
- */
2876
2875
  /**
2877
2876
  * Thrown when the gateway responds with HTTP 418, indicating the install is not
2878
2877
  * permitted to perform the request because an admin account is required.
@@ -2947,6 +2946,32 @@ declare class CngApiError extends Error {
2947
2946
  readonly body: unknown;
2948
2947
  constructor(statusCode: number, body: unknown, message?: string);
2949
2948
  }
2949
+ /**
2950
+ * Thrown when the CNG REST gateway responds with HTTP 403 because the app lacks
2951
+ * a permission the endpoint requires (e.g. `products:read`). This is an
2952
+ * **expected** failure for a misconfigured install — not a bug — so the
2953
+ * transport logs it at `warn` rather than `error` and leaves presentation to the
2954
+ * caller, which can branch on the type and surface the missing permission
2955
+ * however its UI prefers.
2956
+ *
2957
+ * The permission names the gateway named are on
2958
+ * {@link CngPermissionError.permissions} (empty when the body does not name
2959
+ * any), so a caller can render them without re-parsing the raw body. Thrown in
2960
+ * place of {@link CngApiError} for 403s only; every other non-2xx status still
2961
+ * throws `CngApiError`.
2962
+ */
2963
+ declare class CngPermissionError extends Error {
2964
+ /** The HTTP status that triggered this error. */
2965
+ readonly statusCode = 403;
2966
+ /**
2967
+ * The permissions the gateway reported as missing, e.g. `["products:read"]`.
2968
+ * Empty when the response body did not name any.
2969
+ */
2970
+ readonly permissions: string[];
2971
+ /** The raw response body (parsed JSON when possible, otherwise text). */
2972
+ readonly body: unknown;
2973
+ constructor(permissions: string[], body: unknown, message?: string);
2974
+ }
2950
2975
  /**
2951
2976
  * Thrown when the ACME REST gateway returns a non-2xx response that is not one
2952
2977
  * of the specifically-handled statuses (418/429). The offending status is
@@ -2962,4 +2987,4 @@ declare class AcmeApiError extends Error {
2962
2987
  constructor(statusCode: number, body: unknown, message?: string);
2963
2988
  }
2964
2989
 
2965
- export { ACTIVITY_PRODUCT_TYPE, ADD_ON_PRODUCT_TYPE, type AccessOptions, type AccountUser, AccountUserService, type AccountUserServiceOptions, AcmeAccessService, type AcmeAccessServiceConfig, type AcmeActivity, type AcmeActivityTicket, AcmeApiError, AcmeProductService, type Activity, type ActivityOverrides, type ActivityTicket, type AddAddonInput, AdminAccountRequiredError, type Agent, type AssignGuideResult, type AssignedActivity, type AssignedResource, type Availability, AvailabilityService, type AvailabilityTime, type AvailabilityTimesQuery, type Booking, type BookingAddon, type BookingAddonMoney, type BookingAddonOption, type BookingAddons, type BookingAddonsMutationResult, type BookingPaymentsOnFile, type BookingReadOptions, type BookingSearchBy, BookingService, type BookingServiceOptions, type BookingTimeRangeSearch, type CancelBookingResult, type Channel, type ClearOverridesInput, CngAccessService, type CngAccessServiceConfig, CngApiError, CngProductService, type CreateBookingGuest, type CreateBookingInput, type CreateBookingTicket, type CreateEngineInput, type CreatePromoCodeInput, type CreatedBooking, type CreatedPricingEngine, type CreatedPromoCode, type CustomQuestion, type CustomQuestionAnswer, type CustomQuestionAnswerInput, type CustomQuestionOption, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, INSTALL_STATUSES, type InstallAccessConfig, type InstallAccessService, type InstallAccessTarget, type InstallStatus, type InstallWebhook, type InstallWebhookAccount, type InstallWebhookClaims, type InvoiceLinkResult, type Logger, type MakePaymentInput, type MakePaymentResult, type Membership, type MembershipPurchaseInput, MembershipService, type NoteMode, type Payment, type PaymentSource, PeekAccessService, type PeekAccessServiceConfig, type PeekAuthTokenClaims, type PeekAuthTokenUser, PeekGraphQLError, PeekHttpError, type PeekPlatform, PiiAccessDisabledError, type Price, type PricingActivityContext, type PricingEngine, type PricingMoney, type PricingNamedRef, type PricingOverride, type PricingOverrideFilter, PricingService, type Product, type ProductMeetingLocation, ProductService, type ProductServiceOptions, type ProductTicket, type PromoCode, type PromoCodeFixedAmount, PromoCodeService, type PromoCodeServiceOptions, type PurchasedMembership, RENTAL_PRODUCT_TYPE, RateLimitError, type RefundInput, type RefundResult, ResellerService, type ResolvedOverride, type ResolvedPricingOverride, type ResolvedResourceOption, type Resource, type ResourceOptionOverride, type ResourceOptionQuantity, type ResourcePool, type ResourcePoolAccountUser, type ResourcePoolAssignment, type ResourcePoolMode, ResourcePoolService, type Review, ReviewService, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
2990
+ export { ACTIVITY_PRODUCT_TYPE, ADD_ON_PRODUCT_TYPE, type AccessOptions, type AccountUser, AccountUserService, type AccountUserServiceOptions, AcmeAccessService, type AcmeAccessServiceConfig, type AcmeActivity, type AcmeActivityTicket, AcmeApiError, AcmeProductService, type Activity, type ActivityOverrides, type ActivityTicket, type AddAddonInput, AdminAccountRequiredError, type Agent, type AssignGuideResult, type AssignedActivity, type AssignedResource, type Availability, AvailabilityService, type AvailabilityTime, type AvailabilityTimesQuery, type Booking, type BookingAddon, type BookingAddonMoney, type BookingAddonOption, type BookingAddons, type BookingAddonsMutationResult, type BookingPaymentsOnFile, type BookingReadOptions, type BookingSearchBy, BookingService, type BookingServiceOptions, type BookingTimeRangeSearch, type CancelBookingResult, type Channel, type ClearOverridesInput, CngAccessService, type CngAccessServiceConfig, CngApiError, CngPermissionError, CngProductService, type CreateBookingGuest, type CreateBookingInput, type CreateBookingTicket, type CreateEngineInput, type CreatePromoCodeInput, type CreatedBooking, type CreatedPricingEngine, type CreatedPromoCode, type CustomQuestion, type CustomQuestionAnswer, type CustomQuestionAnswerInput, type CustomQuestionOption, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, INSTALL_STATUSES, type InstallAccessConfig, type InstallAccessService, type InstallAccessTarget, type InstallStatus, type InstallWebhook, type InstallWebhookAccount, type InstallWebhookClaims, type InvoiceLinkResult, type Logger, type MakePaymentInput, type MakePaymentResult, type Membership, type MembershipPurchaseInput, MembershipService, type NoteMode, type Payment, type PaymentSource, PeekAccessService, type PeekAccessServiceConfig, type PeekAuthTokenClaims, type PeekAuthTokenUser, PeekGraphQLError, PeekHttpError, type PeekPlatform, PiiAccessDisabledError, type Price, type PricingActivityContext, type PricingEngine, type PricingMoney, type PricingNamedRef, type PricingOverride, type PricingOverrideFilter, PricingService, type Product, type ProductMeetingLocation, ProductService, type ProductServiceOptions, type ProductTicket, type PromoCode, type PromoCodeFixedAmount, PromoCodeService, type PromoCodeServiceOptions, type PurchasedMembership, RENTAL_PRODUCT_TYPE, RateLimitError, type RefundInput, type RefundResult, ResellerService, type ResolvedOverride, type ResolvedPricingOverride, type ResolvedResourceOption, type Resource, type ResourceOptionOverride, type ResourceOptionQuantity, type ResourcePool, type ResourcePoolAccountUser, type ResourcePoolAssignment, type ResourcePoolMode, ResourcePoolService, type Review, ReviewService, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };