@peektravel/app-utilities 0.4.1 → 0.5.1
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 +36 -2
- package/dist/index.cjs +519 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +352 -3
- package/dist/index.d.ts +352 -3
- package/dist/index.js +518 -104
- package/dist/index.js.map +1 -1
- package/docs/webhooks.md +9 -1
- package/llms.txt +45 -6
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -95,6 +95,14 @@ interface Product {
|
|
|
95
95
|
* Add-ons default to white (`"#FFFFFF"`). Empty string when no color is set.
|
|
96
96
|
*/
|
|
97
97
|
color: string;
|
|
98
|
+
/**
|
|
99
|
+
* ISO 4217 currency code the activity prices in (e.g. `"USD"`).
|
|
100
|
+
*
|
|
101
|
+
* Populated for activities and rentals; empty string for add-ons (which carry
|
|
102
|
+
* no currency of their own) and when Peek reports none. Consumers building
|
|
103
|
+
* pricing overrides use this to set the currency on fixed-price adjustments.
|
|
104
|
+
*/
|
|
105
|
+
currency: string;
|
|
98
106
|
/**
|
|
99
107
|
* The bookable sub-options of this product.
|
|
100
108
|
*
|
|
@@ -156,6 +164,31 @@ declare class ProductService {
|
|
|
156
164
|
private fetchAllItemOptionNodes;
|
|
157
165
|
}
|
|
158
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Cross-cutting options that govern what data an access service will read and
|
|
169
|
+
* expose. Passed once when constructing an access service and threaded down to
|
|
170
|
+
* the resource services (and the webhook parsers) so a single object controls
|
|
171
|
+
* behaviour everywhere, rather than a boolean being passed hand-to-hand.
|
|
172
|
+
*
|
|
173
|
+
* Kept deliberately small — today it carries a single PII toggle, but new
|
|
174
|
+
* cross-cutting flags slot in here without changing any downstream signatures.
|
|
175
|
+
*/
|
|
176
|
+
/** Options controlling PII exposure across an access service's reads. */
|
|
177
|
+
interface AccessOptions {
|
|
178
|
+
/**
|
|
179
|
+
* When `true`, customer PII (guest names/emails/phones, custom question
|
|
180
|
+
* answers, the customer booking-portal URL, waiver participant details, …) is
|
|
181
|
+
* requested and returned, and payment/booking-modification operations are
|
|
182
|
+
* available.
|
|
183
|
+
*
|
|
184
|
+
* When `false` (the default), those PII fields are never requested from the
|
|
185
|
+
* gateway and come back `null`/empty, and the payment/booking-modification
|
|
186
|
+
* operations that touch customer financial data are disabled (they throw a
|
|
187
|
+
* {@link PiiAccessDisabledError}).
|
|
188
|
+
*/
|
|
189
|
+
fullCustomerAccess?: boolean;
|
|
190
|
+
}
|
|
191
|
+
|
|
159
192
|
/**
|
|
160
193
|
* The clean, transport-agnostic data model for Peek Pro bookings.
|
|
161
194
|
*
|
|
@@ -667,6 +700,8 @@ interface CancelBookingResult {
|
|
|
667
700
|
interface BookingServiceOptions {
|
|
668
701
|
/** Page size for cursor pagination. Default: 50. */
|
|
669
702
|
pageSize?: number;
|
|
703
|
+
/** Cross-cutting access options (PII exposure). Default: PII off. */
|
|
704
|
+
accessOptions?: AccessOptions;
|
|
670
705
|
}
|
|
671
706
|
/** Dependencies the {@link BookingService} composes for add-on resolution. */
|
|
672
707
|
interface BookingServiceDeps {
|
|
@@ -688,7 +723,15 @@ declare class BookingService {
|
|
|
688
723
|
private readonly client;
|
|
689
724
|
private readonly deps;
|
|
690
725
|
private readonly pageSize;
|
|
726
|
+
/** Whether customer PII is requested and payment operations are allowed. */
|
|
727
|
+
private readonly fullCustomerAccess;
|
|
691
728
|
constructor(client: GraphQLClient, deps: BookingServiceDeps, options?: BookingServiceOptions);
|
|
729
|
+
/**
|
|
730
|
+
* Throws a {@link PiiAccessDisabledError} for `operation` when this service was
|
|
731
|
+
* created without `fullCustomerAccess` — used to gate payment and booking-modification
|
|
732
|
+
* operations that touch customer financial data.
|
|
733
|
+
*/
|
|
734
|
+
private assertPiiEnabled;
|
|
692
735
|
/**
|
|
693
736
|
* Returns a single booking by id, or null when not found. The `bookingId` is
|
|
694
737
|
* normalized internally (lowercased, `-` → `_`), so `B-ABC123` and `b_abc123`
|
|
@@ -965,6 +1008,237 @@ interface AvailabilityTimesQuery {
|
|
|
965
1008
|
resourceOptionQuantities: ResourceOptionQuantity[];
|
|
966
1009
|
}
|
|
967
1010
|
|
|
1011
|
+
/**
|
|
1012
|
+
* The clean data model for Peek Pro pricing engines and pricing overrides.
|
|
1013
|
+
*
|
|
1014
|
+
* A **pricing engine** is a named container Peek Pro applies at checkout. A
|
|
1015
|
+
* caller creates one lazily, stores its id, then repeatedly **upserts pricing
|
|
1016
|
+
* overrides** onto it for a given date range. Overrides adjust ticket prices
|
|
1017
|
+
* (fixed replacement or percentage adjustment) for an activity, optionally
|
|
1018
|
+
* gated by how many spots are already taken and/or a start-time window.
|
|
1019
|
+
*
|
|
1020
|
+
* Scope note: this package is a thin wrapper over the Peek GraphQL primitives.
|
|
1021
|
+
* It does **not** own the domain logic that decides *what* the overrides should
|
|
1022
|
+
* be — segmenting an activity across time windows, ordering overrides by tier,
|
|
1023
|
+
* or computing the `spotsTaken` bounds. The caller builds an
|
|
1024
|
+
* {@link UpsertOverridesInput} and the service sends it faithfully; the service
|
|
1025
|
+
* only maps between these clean shapes and the raw GraphQL payload.
|
|
1026
|
+
*/
|
|
1027
|
+
/**
|
|
1028
|
+
* A monetary value on a pricing override.
|
|
1029
|
+
*
|
|
1030
|
+
* `amount` is intentionally a **string** (e.g. `"50.00"`), never a number — the
|
|
1031
|
+
* Peek API rejects floats here, and stringly-typed money avoids precision loss.
|
|
1032
|
+
*/
|
|
1033
|
+
interface PricingMoney {
|
|
1034
|
+
/** Numeric amount as a decimal string (e.g. `"50.00"`). */
|
|
1035
|
+
amount: string;
|
|
1036
|
+
/** ISO 4217 currency code (e.g. `"USD"`). */
|
|
1037
|
+
currency: string;
|
|
1038
|
+
}
|
|
1039
|
+
/** An `{ id, name }` reference to a Peek entity echoed back in a response. */
|
|
1040
|
+
interface PricingNamedRef {
|
|
1041
|
+
/** Stable Peek identifier. */
|
|
1042
|
+
id: string;
|
|
1043
|
+
/** Human-readable display name. */
|
|
1044
|
+
name: string;
|
|
1045
|
+
}
|
|
1046
|
+
/** Input for creating a pricing engine. */
|
|
1047
|
+
interface CreateEngineInput {
|
|
1048
|
+
/** Display name for the engine. */
|
|
1049
|
+
name: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* Optional list of activity ids the engine is scoped to. Omit (or pass an
|
|
1052
|
+
* empty array) to create an unfiltered engine that applies to all activities.
|
|
1053
|
+
*/
|
|
1054
|
+
activityIds?: string[];
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* The result of creating a pricing engine.
|
|
1058
|
+
*
|
|
1059
|
+
* The create mutation returns only the new engine's id; store it as the
|
|
1060
|
+
* schedule's `source_refid` for subsequent override upserts.
|
|
1061
|
+
*/
|
|
1062
|
+
interface CreatedPricingEngine {
|
|
1063
|
+
/** The new engine's id. */
|
|
1064
|
+
id: string;
|
|
1065
|
+
}
|
|
1066
|
+
/** Input for updating a pricing engine's name and/or activity scope. */
|
|
1067
|
+
interface UpdateEngineInput {
|
|
1068
|
+
/** The engine to update. */
|
|
1069
|
+
engineId: string;
|
|
1070
|
+
/** New display name. */
|
|
1071
|
+
name: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* Activity ids the engine should be scoped to. An empty array (or omitting
|
|
1074
|
+
* the field) **clears** the filter so the engine applies to all activities.
|
|
1075
|
+
*/
|
|
1076
|
+
activityIds?: string[];
|
|
1077
|
+
}
|
|
1078
|
+
/** A pricing engine reference as echoed back by the API. */
|
|
1079
|
+
interface PricingEngine {
|
|
1080
|
+
/** Engine id. */
|
|
1081
|
+
id: string;
|
|
1082
|
+
/** Engine display name. */
|
|
1083
|
+
name: string;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* A single ticket (resourceOption) price override, discriminated by `mode`.
|
|
1087
|
+
*
|
|
1088
|
+
* - `fixed` — replace the ticket price outright with {@link PricingMoney}.
|
|
1089
|
+
* - `percentage` — adjust the ticket price by a percentage. The adjustment is a
|
|
1090
|
+
* decimal **string** (e.g. `"-25"` for 25% off) and must be greater than
|
|
1091
|
+
* `-100`.
|
|
1092
|
+
*/
|
|
1093
|
+
type ResourceOptionOverride = {
|
|
1094
|
+
/** The Peek resourceOption (ticket) id being overridden. */
|
|
1095
|
+
id: string;
|
|
1096
|
+
mode: "fixed";
|
|
1097
|
+
/** The replacement price. */
|
|
1098
|
+
price: PricingMoney;
|
|
1099
|
+
} | {
|
|
1100
|
+
/** The Peek resourceOption (ticket) id being overridden. */
|
|
1101
|
+
id: string;
|
|
1102
|
+
mode: "percentage";
|
|
1103
|
+
/** Percentage adjustment as a decimal string, e.g. `"-25"`. Must be > -100. */
|
|
1104
|
+
percentageAdjustment: string;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* A filter gating when an override applies. Both variants are optional and an
|
|
1108
|
+
* override may carry zero, one, or both.
|
|
1109
|
+
*/
|
|
1110
|
+
type PricingOverrideFilter = {
|
|
1111
|
+
/**
|
|
1112
|
+
* Restricts the override by how many spots are already taken.
|
|
1113
|
+
*
|
|
1114
|
+
* `minSpots`/`maxSpots` are **zero-indexed spots-taken counts**, not
|
|
1115
|
+
* ticket counts — e.g. "applies from the 5th ticket onward" is
|
|
1116
|
+
* `{ minSpots: 4 }`. The caller is responsible for this off-by-one
|
|
1117
|
+
* conversion from ticket-count ranges.
|
|
1118
|
+
*/
|
|
1119
|
+
spotsTaken: {
|
|
1120
|
+
/** Lower bound (inclusive) on spots already taken. Omit for no lower bound. */
|
|
1121
|
+
minSpots?: number;
|
|
1122
|
+
/** Upper bound (inclusive) on spots already taken. Omit for no upper bound. */
|
|
1123
|
+
maxSpots?: number;
|
|
1124
|
+
};
|
|
1125
|
+
} | {
|
|
1126
|
+
/**
|
|
1127
|
+
* Restricts the override to a start-time window, as a PostgreSQL-style
|
|
1128
|
+
* inclusive range string `"[HH:MM:SS,HH:MM:SS]"`.
|
|
1129
|
+
*/
|
|
1130
|
+
startTimeRange: string;
|
|
1131
|
+
};
|
|
1132
|
+
/**
|
|
1133
|
+
* One override entry for an activity: which tickets it adjusts, in what order,
|
|
1134
|
+
* under which filters.
|
|
1135
|
+
*/
|
|
1136
|
+
interface PricingOverride {
|
|
1137
|
+
/**
|
|
1138
|
+
* The override's precedence index (0-based). The caller assigns this — Peek
|
|
1139
|
+
* evaluates lower `order` values first, so higher-discount / more-specific
|
|
1140
|
+
* tiers should get lower numbers.
|
|
1141
|
+
*/
|
|
1142
|
+
order: number;
|
|
1143
|
+
/** The per-ticket price overrides applied by this entry. */
|
|
1144
|
+
resourceOptions: ResourceOptionOverride[];
|
|
1145
|
+
/** Zero or more filters gating when this entry applies. */
|
|
1146
|
+
filters: PricingOverrideFilter[];
|
|
1147
|
+
}
|
|
1148
|
+
/** The set of overrides to apply for a single activity. */
|
|
1149
|
+
interface ActivityOverrides {
|
|
1150
|
+
/** The Peek activity id these overrides apply to. */
|
|
1151
|
+
activityId: string;
|
|
1152
|
+
/**
|
|
1153
|
+
* The overrides for this activity. Pass an **empty array to clear** all
|
|
1154
|
+
* overrides for the activity — never omit the activity to clear it.
|
|
1155
|
+
*/
|
|
1156
|
+
overrides: PricingOverride[];
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* The full input for upserting pricing overrides onto an engine.
|
|
1160
|
+
*
|
|
1161
|
+
* Mirrors the Peek `upsertPricingOverridesActivityContexts` input verbatim. The
|
|
1162
|
+
* caller owns all segmentation and ordering; the service sends this as-is.
|
|
1163
|
+
*/
|
|
1164
|
+
interface UpsertOverridesInput {
|
|
1165
|
+
/** The engine to write overrides to (its {@link CreatedPricingEngine.id}). */
|
|
1166
|
+
engineId: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* The date range the overrides apply to, as a PostgreSQL-style inclusive
|
|
1169
|
+
* range string. For a single day, both ends are the same: `"[2025-07-04,2025-07-04]"`.
|
|
1170
|
+
*/
|
|
1171
|
+
dateRange: string;
|
|
1172
|
+
/** One entry per activity being written (or cleared). */
|
|
1173
|
+
activities: ActivityOverrides[];
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Convenience input for clearing all overrides across a set of activities for a
|
|
1177
|
+
* date range. Equivalent to an {@link UpsertOverridesInput} whose every
|
|
1178
|
+
* activity carries `overrides: []`.
|
|
1179
|
+
*/
|
|
1180
|
+
interface ClearOverridesInput {
|
|
1181
|
+
/** The engine to clear overrides on. */
|
|
1182
|
+
engineId: string;
|
|
1183
|
+
/** The date range to clear, same format as {@link UpsertOverridesInput.dateRange}. */
|
|
1184
|
+
dateRange: string;
|
|
1185
|
+
/** The activity ids to clear. Recover these from a prior sync's payload. */
|
|
1186
|
+
activityIds: string[];
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* A ticket price override as **resolved** by Peek, discriminated by `mode`.
|
|
1190
|
+
*
|
|
1191
|
+
* This normalizes Peek's GraphQL union (a `price` object vs a bare
|
|
1192
|
+
* `percentageAdjustment`) into the same `mode`-tagged shape used on input.
|
|
1193
|
+
*/
|
|
1194
|
+
type ResolvedOverride = {
|
|
1195
|
+
mode: "fixed";
|
|
1196
|
+
/** The resolved replacement price. */
|
|
1197
|
+
price: PricingMoney;
|
|
1198
|
+
} | {
|
|
1199
|
+
mode: "percentage";
|
|
1200
|
+
/** The resolved percentage adjustment as a decimal string. */
|
|
1201
|
+
percentageAdjustment: string;
|
|
1202
|
+
};
|
|
1203
|
+
/** A single ticket's resolved override within a returned context. */
|
|
1204
|
+
interface ResolvedResourceOption {
|
|
1205
|
+
/** The ticket (resourceOption) this override resolved for. */
|
|
1206
|
+
resourceOption: PricingNamedRef;
|
|
1207
|
+
/** The resolved fixed or percentage override. */
|
|
1208
|
+
override: ResolvedOverride;
|
|
1209
|
+
}
|
|
1210
|
+
/** A single resolved override entry within a returned activity context. */
|
|
1211
|
+
interface ResolvedPricingOverride {
|
|
1212
|
+
/** The override's precedence index as stored by Peek. */
|
|
1213
|
+
order: number;
|
|
1214
|
+
/** The resolved per-ticket overrides. */
|
|
1215
|
+
resourceOptions: ResolvedResourceOption[];
|
|
1216
|
+
/**
|
|
1217
|
+
* The filters gating this override, normalized to the same shape as the
|
|
1218
|
+
* {@link PricingOverrideFilter} used on input.
|
|
1219
|
+
*/
|
|
1220
|
+
filters: PricingOverrideFilter[];
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* The resolved pricing state for one activity on one date, as returned by an
|
|
1224
|
+
* upsert or clear. Useful as an audit record of exactly what Peek stored.
|
|
1225
|
+
*/
|
|
1226
|
+
interface PricingActivityContext {
|
|
1227
|
+
/** The date the context applies to (ISO `YYYY-MM-DD`). */
|
|
1228
|
+
date: string;
|
|
1229
|
+
/** The activity the overrides belong to. */
|
|
1230
|
+
activity: PricingNamedRef;
|
|
1231
|
+
/** The engine the overrides live under. */
|
|
1232
|
+
engine: PricingNamedRef;
|
|
1233
|
+
/** The resolved overrides (empty when the date was cleared). */
|
|
1234
|
+
overrides: ResolvedPricingOverride[];
|
|
1235
|
+
}
|
|
1236
|
+
/** The result of an upsert or clear: the resolved contexts Peek returned. */
|
|
1237
|
+
interface UpsertOverridesResult {
|
|
1238
|
+
/** One entry per activity written or cleared in the request. */
|
|
1239
|
+
activityContexts: PricingActivityContext[];
|
|
1240
|
+
}
|
|
1241
|
+
|
|
968
1242
|
/**
|
|
969
1243
|
* The clean data model for Peek Pro promo codes.
|
|
970
1244
|
*/
|
|
@@ -1226,6 +1500,12 @@ interface BaseAccessServiceConfig {
|
|
|
1226
1500
|
logger?: Logger;
|
|
1227
1501
|
/** Custom `fetch` implementation. Default: the global `fetch`. */
|
|
1228
1502
|
fetch?: typeof fetch;
|
|
1503
|
+
/**
|
|
1504
|
+
* Cross-cutting access options (PII exposure, …). When omitted, defaults are
|
|
1505
|
+
* used ({@link AccessOptions.fullCustomerAccess} `false`). Threaded down to the
|
|
1506
|
+
* resource services that read customer data.
|
|
1507
|
+
*/
|
|
1508
|
+
accessOptions?: AccessOptions;
|
|
1229
1509
|
}
|
|
1230
1510
|
|
|
1231
1511
|
declare class MembershipService {
|
|
@@ -1335,7 +1615,9 @@ interface Review {
|
|
|
1335
1615
|
*/
|
|
1336
1616
|
declare class ReviewService {
|
|
1337
1617
|
private readonly client;
|
|
1338
|
-
|
|
1618
|
+
/** Whether reviewer PII (name/email) is requested. */
|
|
1619
|
+
private readonly fullCustomerAccess;
|
|
1620
|
+
constructor(client: GraphQLClient, accessOptions?: AccessOptions);
|
|
1339
1621
|
/**
|
|
1340
1622
|
* Returns up to `reviewCount` reviews for an activity in **descending order
|
|
1341
1623
|
* by review date (newest first)**, skipping the `reviewOffset` newest reviews
|
|
@@ -1426,6 +1708,39 @@ declare class PromoCodeService {
|
|
|
1426
1708
|
create(input: CreatePromoCodeInput): Promise<CreatedPromoCode>;
|
|
1427
1709
|
}
|
|
1428
1710
|
|
|
1711
|
+
declare class PricingService {
|
|
1712
|
+
private readonly client;
|
|
1713
|
+
constructor(client: GraphQLClient);
|
|
1714
|
+
/**
|
|
1715
|
+
* Creates a pricing engine. Store the returned id and reuse it on every
|
|
1716
|
+
* subsequent override upsert. Throws on an InvalidDataError from Peek.
|
|
1717
|
+
*/
|
|
1718
|
+
createEngine(input: CreateEngineInput): Promise<CreatedPricingEngine>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Updates a pricing engine's name and/or activity scope. Throws on an
|
|
1721
|
+
* InvalidDataError or NotFoundError from Peek.
|
|
1722
|
+
*/
|
|
1723
|
+
updateEngine(input: UpdateEngineInput): Promise<PricingEngine>;
|
|
1724
|
+
/**
|
|
1725
|
+
* Deletes a pricing engine. Idempotent — resolves whether the engine existed
|
|
1726
|
+
* or was already gone (Peek's NotFoundError is treated as success).
|
|
1727
|
+
*/
|
|
1728
|
+
deleteEngine(engineId: string): Promise<void>;
|
|
1729
|
+
/**
|
|
1730
|
+
* Upserts pricing overrides for the engine and date range in `input`. Returns
|
|
1731
|
+
* the resolved contexts Peek stored. Throws on an InvalidDataError from Peek.
|
|
1732
|
+
*/
|
|
1733
|
+
upsertOverrides(input: UpsertOverridesInput): Promise<UpsertOverridesResult>;
|
|
1734
|
+
/**
|
|
1735
|
+
* Clears all overrides for the given activities across a date range. This is
|
|
1736
|
+
* an upsert with empty overrides — never clear by omitting an activity.
|
|
1737
|
+
*/
|
|
1738
|
+
clearOverrides(input: ClearOverridesInput): Promise<UpsertOverridesResult>;
|
|
1739
|
+
private sendUpsert;
|
|
1740
|
+
private validateUpsertInput;
|
|
1741
|
+
private validateResourceOption;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1429
1744
|
/**
|
|
1430
1745
|
* Platform that embedded the app for this session. Verification is
|
|
1431
1746
|
* brand-agnostic — one peek-auth JWT is minted for every platform — so this
|
|
@@ -1506,6 +1821,7 @@ interface PeekAccessServiceConfig extends BaseAccessServiceConfig {
|
|
|
1506
1821
|
declare class PeekAccessService {
|
|
1507
1822
|
private readonly client;
|
|
1508
1823
|
private readonly productServiceOptions;
|
|
1824
|
+
private readonly accessOptions;
|
|
1509
1825
|
private readonly jwtSecret;
|
|
1510
1826
|
private productService?;
|
|
1511
1827
|
private accountUserService?;
|
|
@@ -1513,6 +1829,7 @@ declare class PeekAccessService {
|
|
|
1513
1829
|
private timeslotService?;
|
|
1514
1830
|
private resellerService?;
|
|
1515
1831
|
private promoCodeService?;
|
|
1832
|
+
private pricingService?;
|
|
1516
1833
|
private dailyNoteService?;
|
|
1517
1834
|
private availabilityService?;
|
|
1518
1835
|
private membershipService?;
|
|
@@ -1569,6 +1886,11 @@ declare class PeekAccessService {
|
|
|
1569
1886
|
* authenticated transport. The instance is created lazily and reused.
|
|
1570
1887
|
*/
|
|
1571
1888
|
getPromoCodeService(): PromoCodeService;
|
|
1889
|
+
/**
|
|
1890
|
+
* Returns the {@link PricingService} for this install, bound to the shared
|
|
1891
|
+
* authenticated transport. The instance is created lazily and reused.
|
|
1892
|
+
*/
|
|
1893
|
+
getPricingService(): PricingService;
|
|
1572
1894
|
/**
|
|
1573
1895
|
* Returns the {@link DailyNoteService} for this install, bound to the shared
|
|
1574
1896
|
* authenticated transport. The instance is created lazily and reused.
|
|
@@ -1624,6 +1946,16 @@ declare class PeekAccessService {
|
|
|
1624
1946
|
getAllPromoCodes(): Promise<PromoCode[]>;
|
|
1625
1947
|
/** Create a promo code. Delegates to {@link PromoCodeService.create}. */
|
|
1626
1948
|
createPromoCode(input: CreatePromoCodeInput): Promise<CreatedPromoCode>;
|
|
1949
|
+
/** Create a pricing engine. Delegates to {@link PricingService.createEngine}. */
|
|
1950
|
+
createPricingEngine(input: CreateEngineInput): Promise<CreatedPricingEngine>;
|
|
1951
|
+
/** Update a pricing engine. Delegates to {@link PricingService.updateEngine}. */
|
|
1952
|
+
updatePricingEngine(input: UpdateEngineInput): Promise<PricingEngine>;
|
|
1953
|
+
/** Delete a pricing engine (idempotent). Delegates to {@link PricingService.deleteEngine}. */
|
|
1954
|
+
deletePricingEngine(engineId: string): Promise<void>;
|
|
1955
|
+
/** Upsert pricing overrides. Delegates to {@link PricingService.upsertOverrides}. */
|
|
1956
|
+
upsertPricingOverrides(input: UpsertOverridesInput): Promise<UpsertOverridesResult>;
|
|
1957
|
+
/** Clear pricing overrides for a set of activities. Delegates to {@link PricingService.clearOverrides}. */
|
|
1958
|
+
clearPricingOverrides(input: ClearOverridesInput): Promise<UpsertOverridesResult>;
|
|
1627
1959
|
/** Today's daily note. Delegates to {@link DailyNoteService.getToday}. */
|
|
1628
1960
|
getDailyNoteToday(): Promise<DailyNote | null>;
|
|
1629
1961
|
/** Update today's daily note. Delegates to {@link DailyNoteService.update}. */
|
|
@@ -2001,8 +2333,13 @@ interface Waiver {
|
|
|
2001
2333
|
* Accepts the raw request body — either the `{ waiver: … }` envelope or a bare
|
|
2002
2334
|
* waiver node, and a JSON string is parsed first. Never throws on malformed
|
|
2003
2335
|
* input: a missing/garbled body yields a {@link Waiver} with empty fields.
|
|
2336
|
+
*
|
|
2337
|
+
* Because a waiver webhook has no GraphQL selection to trim (Peek delivers a
|
|
2338
|
+
* fixed payload), the PII fields — the participant `guestName` and the signed
|
|
2339
|
+
* document `fileUrl` — are instead redacted here at parse time when `options`
|
|
2340
|
+
* does not enable PII. Pass `{ fullCustomerAccess: true }` to keep them.
|
|
2004
2341
|
*/
|
|
2005
|
-
declare function parseWaiverWebhook(payload: unknown): Waiver;
|
|
2342
|
+
declare function parseWaiverWebhook(payload: unknown, options?: AccessOptions): Waiver;
|
|
2006
2343
|
|
|
2007
2344
|
/**
|
|
2008
2345
|
* Typed errors thrown by the package. Each mirrors a failure mode of the Peek
|
|
@@ -2040,6 +2377,18 @@ declare class PeekGraphQLError extends Error {
|
|
|
2040
2377
|
readonly graphqlErrors: unknown[];
|
|
2041
2378
|
constructor(graphqlErrors: unknown[], message?: string);
|
|
2042
2379
|
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Thrown when a payment or booking-modification operation is called on an
|
|
2382
|
+
* access service that was constructed without `fullCustomerAccess` (PII access
|
|
2383
|
+
* disabled). These operations — pulling payment sources, charging/refunding,
|
|
2384
|
+
* creating invoice links, and adding/removing add-ons — touch customer
|
|
2385
|
+
* financial data, so they are gated behind the same flag as customer PII.
|
|
2386
|
+
*/
|
|
2387
|
+
declare class PiiAccessDisabledError extends Error {
|
|
2388
|
+
/** The name of the operation that was blocked (e.g. `"makePayment"`). */
|
|
2389
|
+
readonly operation: string;
|
|
2390
|
+
constructor(operation: string);
|
|
2391
|
+
}
|
|
2043
2392
|
/**
|
|
2044
2393
|
* Thrown when the CNG REST gateway returns a non-2xx response that is not one
|
|
2045
2394
|
* of the specifically-handled statuses (418/429). The offending status is
|
|
@@ -2068,4 +2417,4 @@ declare class AcmeApiError extends Error {
|
|
|
2068
2417
|
constructor(statusCode: number, body: unknown, message?: string);
|
|
2069
2418
|
}
|
|
2070
2419
|
|
|
2071
|
-
export { ACTIVITY_PRODUCT_TYPE, ADD_ON_PRODUCT_TYPE, type AccountUser, AccountUserService, type AccountUserServiceOptions, AcmeAccessService, type AcmeAccessServiceConfig, type AcmeActivity, type AcmeActivityTicket, AcmeApiError, AcmeProductService, type Activity, 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, CngAccessService, type CngAccessServiceConfig, CngApiError, CngProductService, type CreateBookingGuest, type CreateBookingInput, type CreateBookingTicket, type CreatePromoCodeInput, type CreatedBooking, type CreatedPromoCode, type CustomQuestionAnswer, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, 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, type PeekPlatform, type Price, type Product, ProductService, type ProductServiceOptions, type ProductTicket, type PromoCode, type PromoCodeFixedAmount, PromoCodeService, type PromoCodeServiceOptions, type PurchasedMembership, RENTAL_PRODUCT_TYPE, RateLimitError, type RefundInput, type RefundResult, ResellerService, type Resource, type ResourceOptionQuantity, type ResourcePool, type ResourcePoolAccountUser, type ResourcePoolAssignment, type ResourcePoolMode, ResourcePoolService, type Review, ReviewService, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateTimeslotResult, type Waiver, noopLogger, parseBookingWebhook, parseWaiverWebhook };
|
|
2420
|
+
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 CustomQuestionAnswer, type DailyNote, DailyNoteService, type Duration, type Guest, type GuestMetadata, type Guide, type GuideAssignment, 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, type PeekPlatform, PiiAccessDisabledError, type Price, type PricingActivityContext, type PricingEngine, type PricingMoney, type PricingNamedRef, type PricingOverride, type PricingOverrideFilter, PricingService, type Product, 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, noopLogger, parseBookingWebhook, parseWaiverWebhook };
|