@peektravel/app-utilities 0.9.3 → 0.9.5
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.cjs +186 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -34
- package/dist/index.d.ts +61 -34
- package/dist/index.js +186 -105
- package/dist/index.js.map +1 -1
- package/llms.txt +9 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -400,7 +400,12 @@ interface ProductMeetingLocation {
|
|
|
400
400
|
}
|
|
401
401
|
/** A single bookable sub-option (resource option or add-on item option). */
|
|
402
402
|
interface ProductTicket {
|
|
403
|
-
/**
|
|
403
|
+
/**
|
|
404
|
+
* Unique identifier of the ticket / option. This is also the
|
|
405
|
+
* **`resourceOptionId`** — the id passed as a ticket's `resourceOptionId` when
|
|
406
|
+
* creating a booking (see {@link CreateBookingTicket}) and reported per slot by
|
|
407
|
+
* {@link AvailabilityService.getAvailabilityTimes}.
|
|
408
|
+
*/
|
|
404
409
|
id: string;
|
|
405
410
|
/** Human-readable name of the ticket / option. */
|
|
406
411
|
name: string;
|
|
@@ -848,6 +853,11 @@ interface BookingTimeRangeSearch extends BookingReadOptions {
|
|
|
848
853
|
type NoteMode = "append" | "overwrite";
|
|
849
854
|
/** A requested ticket (resource option) and quantity for a new booking. */
|
|
850
855
|
interface CreateBookingTicket {
|
|
856
|
+
/**
|
|
857
|
+
* The resource option to book — this is the {@link ProductTicket.id} from the
|
|
858
|
+
* activity's `tickets` (also reported per slot by
|
|
859
|
+
* {@link AvailabilityService.getAvailabilityTimes}).
|
|
860
|
+
*/
|
|
851
861
|
resourceOptionId: string;
|
|
852
862
|
quantity: number;
|
|
853
863
|
}
|
|
@@ -991,56 +1001,44 @@ type MetaDataVolumeUnit = "GALLON";
|
|
|
991
1001
|
* `number`; `Decimal` values are kept as strings to avoid float-precision loss;
|
|
992
1002
|
* `Date`/`Time` values are ISO strings.
|
|
993
1003
|
*
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
* `html` variant's `displayValue` is HTML-escaped so it is safe to render as
|
|
997
|
-
* text.
|
|
1004
|
+
* A human-readable, display-safe rendering of the value lives on the parent
|
|
1005
|
+
* {@link MetaData.displayValue}, not here.
|
|
998
1006
|
*/
|
|
999
1007
|
type MetaDataValue = {
|
|
1000
1008
|
kind: "age";
|
|
1001
1009
|
age: number;
|
|
1002
|
-
displayValue: string;
|
|
1003
1010
|
} | {
|
|
1004
1011
|
kind: "attachment";
|
|
1005
1012
|
attachmentUrl: string;
|
|
1006
1013
|
mime: string | null;
|
|
1007
1014
|
name: string | null;
|
|
1008
1015
|
size: number | null;
|
|
1009
|
-
displayValue: string;
|
|
1010
1016
|
} | {
|
|
1011
1017
|
kind: "barcode";
|
|
1012
1018
|
barcodeType: MetaDataBarcodeType | null;
|
|
1013
1019
|
barcodeValue: string;
|
|
1014
|
-
displayValue: string;
|
|
1015
1020
|
} | {
|
|
1016
1021
|
kind: "boolean";
|
|
1017
1022
|
boolean: boolean;
|
|
1018
|
-
displayValue: string;
|
|
1019
1023
|
} | {
|
|
1020
1024
|
kind: "checkbox";
|
|
1021
1025
|
isChecked: boolean;
|
|
1022
|
-
displayValue: string;
|
|
1023
1026
|
} | {
|
|
1024
1027
|
kind: "currency";
|
|
1025
1028
|
currency: string;
|
|
1026
|
-
displayValue: string;
|
|
1027
1029
|
} | {
|
|
1028
1030
|
kind: "date";
|
|
1029
1031
|
date: string;
|
|
1030
|
-
displayValue: string;
|
|
1031
1032
|
} | {
|
|
1032
1033
|
kind: "decimal";
|
|
1033
1034
|
decimal: string | null;
|
|
1034
|
-
displayValue: string;
|
|
1035
1035
|
} | {
|
|
1036
1036
|
kind: "duration";
|
|
1037
1037
|
amount: number;
|
|
1038
1038
|
unit: MetaDataDurationUnit | null;
|
|
1039
|
-
displayValue: string;
|
|
1040
1039
|
} | {
|
|
1041
1040
|
kind: "email";
|
|
1042
1041
|
email: string | null;
|
|
1043
|
-
displayValue: string;
|
|
1044
1042
|
} | {
|
|
1045
1043
|
kind: "guest";
|
|
1046
1044
|
name: string | null;
|
|
@@ -1048,19 +1046,15 @@ type MetaDataValue = {
|
|
|
1048
1046
|
dateOfBirth: string | null;
|
|
1049
1047
|
notes: string | null;
|
|
1050
1048
|
waiverSigned: boolean | null;
|
|
1051
|
-
displayValue: string;
|
|
1052
1049
|
} | {
|
|
1053
1050
|
kind: "html";
|
|
1054
1051
|
html: string;
|
|
1055
|
-
displayValue: string;
|
|
1056
1052
|
} | {
|
|
1057
1053
|
kind: "imageUrl";
|
|
1058
1054
|
imageUrl: string;
|
|
1059
|
-
displayValue: string;
|
|
1060
1055
|
} | {
|
|
1061
1056
|
kind: "integer";
|
|
1062
1057
|
integer: number;
|
|
1063
|
-
displayValue: string;
|
|
1064
1058
|
} | {
|
|
1065
1059
|
kind: "location";
|
|
1066
1060
|
country: string | null;
|
|
@@ -1069,45 +1063,35 @@ type MetaDataValue = {
|
|
|
1069
1063
|
postalCode: string | null;
|
|
1070
1064
|
region: string | null;
|
|
1071
1065
|
streetAddress: string | null;
|
|
1072
|
-
displayValue: string;
|
|
1073
1066
|
} | {
|
|
1074
1067
|
kind: "longText";
|
|
1075
1068
|
longText: string;
|
|
1076
|
-
displayValue: string;
|
|
1077
1069
|
} | {
|
|
1078
1070
|
kind: "meta";
|
|
1079
1071
|
meta: unknown;
|
|
1080
|
-
displayValue: string;
|
|
1081
1072
|
} | {
|
|
1082
1073
|
kind: "percent";
|
|
1083
1074
|
percent: string | null;
|
|
1084
|
-
displayValue: string;
|
|
1085
1075
|
} | {
|
|
1086
1076
|
kind: "phone";
|
|
1087
1077
|
phone: string;
|
|
1088
|
-
displayValue: string;
|
|
1089
1078
|
} | {
|
|
1090
1079
|
kind: "shortText";
|
|
1091
1080
|
shortText: string;
|
|
1092
|
-
displayValue: string;
|
|
1093
1081
|
} | {
|
|
1094
1082
|
kind: "time";
|
|
1095
1083
|
time: string;
|
|
1096
|
-
displayValue: string;
|
|
1097
1084
|
} | {
|
|
1098
1085
|
kind: "url";
|
|
1099
1086
|
url: string | null;
|
|
1100
|
-
displayValue: string;
|
|
1101
1087
|
} | {
|
|
1102
1088
|
kind: "volume";
|
|
1103
1089
|
amount: string;
|
|
1104
1090
|
unit: MetaDataVolumeUnit | null;
|
|
1105
|
-
displayValue: string;
|
|
1106
1091
|
} | {
|
|
1107
1092
|
kind: "weight";
|
|
1108
1093
|
amount: string;
|
|
1109
1094
|
unit: MetaDataWeightUnit | null;
|
|
1110
|
-
displayValue: string;
|
|
1111
1095
|
};
|
|
1112
1096
|
/** A single booking custom-field response (one `fieldResponse`). */
|
|
1113
1097
|
interface MetaData {
|
|
@@ -1117,8 +1101,8 @@ interface MetaData {
|
|
|
1117
1101
|
name: string;
|
|
1118
1102
|
/**
|
|
1119
1103
|
* Field slug. When an `integrator` filter is applied, the matched
|
|
1120
|
-
* `
|
|
1121
|
-
* `
|
|
1104
|
+
* `integrators:<integrator>:` prefix is stripped off (e.g.
|
|
1105
|
+
* `integrators:bob:booking_url` → `booking_url`).
|
|
1122
1106
|
*/
|
|
1123
1107
|
slug: string;
|
|
1124
1108
|
/** Raw field type reported by the gateway (kept as a string). */
|
|
@@ -1131,6 +1115,12 @@ interface MetaData {
|
|
|
1131
1115
|
isRequired: boolean;
|
|
1132
1116
|
/** The response's reference id. */
|
|
1133
1117
|
refid: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* A human-readable, display-safe string rendering of the value. Always
|
|
1120
|
+
* present — `""` when the value is absent or of an unrecognized variant. The
|
|
1121
|
+
* `html` value's rendering is HTML-escaped so it is safe to render as text.
|
|
1122
|
+
*/
|
|
1123
|
+
displayValue: string;
|
|
1134
1124
|
/**
|
|
1135
1125
|
* The typed response value, or `null` when absent or of an unrecognized
|
|
1136
1126
|
* (future) variant.
|
|
@@ -1345,7 +1335,7 @@ interface BookingServiceOptions {
|
|
|
1345
1335
|
accessOptions?: AccessOptions;
|
|
1346
1336
|
/**
|
|
1347
1337
|
* Integrator id used to scope `getMetaData` results — only fields whose slug
|
|
1348
|
-
* starts with `
|
|
1338
|
+
* starts with `integrators:<integrator>:` are returned. Defaults to `""` (set
|
|
1349
1339
|
* by the access service to the install's issuer).
|
|
1350
1340
|
*/
|
|
1351
1341
|
integrator?: string;
|
|
@@ -1406,7 +1396,7 @@ declare class BookingService {
|
|
|
1406
1396
|
/**
|
|
1407
1397
|
* Returns a booking's custom-field metadata (its `fieldResponses`), scoped to
|
|
1408
1398
|
* this service's integrator. Only fields whose slug starts with
|
|
1409
|
-
* `
|
|
1399
|
+
* `integrators:<integrator>:` are returned, and that prefix is stripped from
|
|
1410
1400
|
* each returned `slug`. Returns `[]` when the booking is not found or has no
|
|
1411
1401
|
* matching fields.
|
|
1412
1402
|
*
|
|
@@ -1942,6 +1932,37 @@ declare class AvailabilityService {
|
|
|
1942
1932
|
getAvailabilityTimes(query: AvailabilityTimesQuery): Promise<AvailabilityTime[]>;
|
|
1943
1933
|
}
|
|
1944
1934
|
|
|
1935
|
+
/**
|
|
1936
|
+
* Reads custom questions defined on the account.
|
|
1937
|
+
*
|
|
1938
|
+
* Obtain an instance via {@link PeekAccessService.getCustomQuestionService}.
|
|
1939
|
+
*/
|
|
1940
|
+
declare class CustomQuestionService {
|
|
1941
|
+
private readonly client;
|
|
1942
|
+
constructor(client: GraphQLClient);
|
|
1943
|
+
/**
|
|
1944
|
+
* Returns every custom question defined on the account, across all
|
|
1945
|
+
* activities. Choice-style questions (`SELECT_ONE`, `LOCATION`, …) carry their
|
|
1946
|
+
* selectable {@link CustomQuestion.options}; free-text/checkbox questions
|
|
1947
|
+
* return an empty option list.
|
|
1948
|
+
*
|
|
1949
|
+
* These are account-wide question **definitions**, not customer answers — no
|
|
1950
|
+
* PII is involved, so the result is unaffected by `fullCustomerAccess`. Unlike
|
|
1951
|
+
* {@link ProductService.getCustomQuestions}, the catalog carries no
|
|
1952
|
+
* per-activity configuration, so {@link CustomQuestion.order} is `0` and
|
|
1953
|
+
* {@link CustomQuestion.isRequired} is `false` on every entry.
|
|
1954
|
+
*
|
|
1955
|
+
* @returns Every custom question on the account, or an empty list when none
|
|
1956
|
+
* are defined.
|
|
1957
|
+
*
|
|
1958
|
+
* @example
|
|
1959
|
+
* ```ts
|
|
1960
|
+
* const questions = await peek.getCustomQuestionService().getAll();
|
|
1961
|
+
* ```
|
|
1962
|
+
*/
|
|
1963
|
+
getAll(): Promise<CustomQuestion[]>;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1945
1966
|
/**
|
|
1946
1967
|
* The clean data model for a Peek Pro daily (dashboard) note.
|
|
1947
1968
|
*/
|
|
@@ -2445,6 +2466,7 @@ declare class PeekAccessService {
|
|
|
2445
2466
|
private membershipService?;
|
|
2446
2467
|
private readonly bookingServices;
|
|
2447
2468
|
private reviewService?;
|
|
2469
|
+
private customQuestionService?;
|
|
2448
2470
|
constructor(config: PeekAccessServiceConfig);
|
|
2449
2471
|
/**
|
|
2450
2472
|
* Verifies a Peek auth token issued by the app registry and returns the
|
|
@@ -2537,6 +2559,11 @@ declare class PeekAccessService {
|
|
|
2537
2559
|
* authenticated transport. The instance is created lazily and reused.
|
|
2538
2560
|
*/
|
|
2539
2561
|
getReviewService(): ReviewService;
|
|
2562
|
+
/**
|
|
2563
|
+
* Returns the {@link CustomQuestionService} for this install, bound to the
|
|
2564
|
+
* shared authenticated transport. The instance is created lazily and reused.
|
|
2565
|
+
*/
|
|
2566
|
+
getCustomQuestionService(): CustomQuestionService;
|
|
2540
2567
|
/** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
|
|
2541
2568
|
getAllProducts(): Promise<Product[]>;
|
|
2542
2569
|
/** 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}. */
|
|
@@ -3335,4 +3362,4 @@ declare class AcmeApiError extends Error {
|
|
|
3335
3362
|
constructor(statusCode: number, body: unknown, message?: string);
|
|
3336
3363
|
}
|
|
3337
3364
|
|
|
3338
|
-
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 MetaData, type MetaDataBarcodeType, type MetaDataDurationUnit, type MetaDataValue, type MetaDataVolumeUnit, type MetaDataWeightUnit, 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, type ProductReviewSummary, 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 SetMetaDataAttachmentInput, type SetMetaDataGuestInput, type SetMetaDataResult, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
|
|
3365
|
+
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, CustomQuestionService, 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 MetaData, type MetaDataBarcodeType, type MetaDataDurationUnit, type MetaDataValue, type MetaDataVolumeUnit, type MetaDataWeightUnit, 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, type ProductReviewSummary, 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 SetMetaDataAttachmentInput, type SetMetaDataGuestInput, type SetMetaDataResult, 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
|
@@ -400,7 +400,12 @@ interface ProductMeetingLocation {
|
|
|
400
400
|
}
|
|
401
401
|
/** A single bookable sub-option (resource option or add-on item option). */
|
|
402
402
|
interface ProductTicket {
|
|
403
|
-
/**
|
|
403
|
+
/**
|
|
404
|
+
* Unique identifier of the ticket / option. This is also the
|
|
405
|
+
* **`resourceOptionId`** — the id passed as a ticket's `resourceOptionId` when
|
|
406
|
+
* creating a booking (see {@link CreateBookingTicket}) and reported per slot by
|
|
407
|
+
* {@link AvailabilityService.getAvailabilityTimes}.
|
|
408
|
+
*/
|
|
404
409
|
id: string;
|
|
405
410
|
/** Human-readable name of the ticket / option. */
|
|
406
411
|
name: string;
|
|
@@ -848,6 +853,11 @@ interface BookingTimeRangeSearch extends BookingReadOptions {
|
|
|
848
853
|
type NoteMode = "append" | "overwrite";
|
|
849
854
|
/** A requested ticket (resource option) and quantity for a new booking. */
|
|
850
855
|
interface CreateBookingTicket {
|
|
856
|
+
/**
|
|
857
|
+
* The resource option to book — this is the {@link ProductTicket.id} from the
|
|
858
|
+
* activity's `tickets` (also reported per slot by
|
|
859
|
+
* {@link AvailabilityService.getAvailabilityTimes}).
|
|
860
|
+
*/
|
|
851
861
|
resourceOptionId: string;
|
|
852
862
|
quantity: number;
|
|
853
863
|
}
|
|
@@ -991,56 +1001,44 @@ type MetaDataVolumeUnit = "GALLON";
|
|
|
991
1001
|
* `number`; `Decimal` values are kept as strings to avoid float-precision loss;
|
|
992
1002
|
* `Date`/`Time` values are ISO strings.
|
|
993
1003
|
*
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
* `html` variant's `displayValue` is HTML-escaped so it is safe to render as
|
|
997
|
-
* text.
|
|
1004
|
+
* A human-readable, display-safe rendering of the value lives on the parent
|
|
1005
|
+
* {@link MetaData.displayValue}, not here.
|
|
998
1006
|
*/
|
|
999
1007
|
type MetaDataValue = {
|
|
1000
1008
|
kind: "age";
|
|
1001
1009
|
age: number;
|
|
1002
|
-
displayValue: string;
|
|
1003
1010
|
} | {
|
|
1004
1011
|
kind: "attachment";
|
|
1005
1012
|
attachmentUrl: string;
|
|
1006
1013
|
mime: string | null;
|
|
1007
1014
|
name: string | null;
|
|
1008
1015
|
size: number | null;
|
|
1009
|
-
displayValue: string;
|
|
1010
1016
|
} | {
|
|
1011
1017
|
kind: "barcode";
|
|
1012
1018
|
barcodeType: MetaDataBarcodeType | null;
|
|
1013
1019
|
barcodeValue: string;
|
|
1014
|
-
displayValue: string;
|
|
1015
1020
|
} | {
|
|
1016
1021
|
kind: "boolean";
|
|
1017
1022
|
boolean: boolean;
|
|
1018
|
-
displayValue: string;
|
|
1019
1023
|
} | {
|
|
1020
1024
|
kind: "checkbox";
|
|
1021
1025
|
isChecked: boolean;
|
|
1022
|
-
displayValue: string;
|
|
1023
1026
|
} | {
|
|
1024
1027
|
kind: "currency";
|
|
1025
1028
|
currency: string;
|
|
1026
|
-
displayValue: string;
|
|
1027
1029
|
} | {
|
|
1028
1030
|
kind: "date";
|
|
1029
1031
|
date: string;
|
|
1030
|
-
displayValue: string;
|
|
1031
1032
|
} | {
|
|
1032
1033
|
kind: "decimal";
|
|
1033
1034
|
decimal: string | null;
|
|
1034
|
-
displayValue: string;
|
|
1035
1035
|
} | {
|
|
1036
1036
|
kind: "duration";
|
|
1037
1037
|
amount: number;
|
|
1038
1038
|
unit: MetaDataDurationUnit | null;
|
|
1039
|
-
displayValue: string;
|
|
1040
1039
|
} | {
|
|
1041
1040
|
kind: "email";
|
|
1042
1041
|
email: string | null;
|
|
1043
|
-
displayValue: string;
|
|
1044
1042
|
} | {
|
|
1045
1043
|
kind: "guest";
|
|
1046
1044
|
name: string | null;
|
|
@@ -1048,19 +1046,15 @@ type MetaDataValue = {
|
|
|
1048
1046
|
dateOfBirth: string | null;
|
|
1049
1047
|
notes: string | null;
|
|
1050
1048
|
waiverSigned: boolean | null;
|
|
1051
|
-
displayValue: string;
|
|
1052
1049
|
} | {
|
|
1053
1050
|
kind: "html";
|
|
1054
1051
|
html: string;
|
|
1055
|
-
displayValue: string;
|
|
1056
1052
|
} | {
|
|
1057
1053
|
kind: "imageUrl";
|
|
1058
1054
|
imageUrl: string;
|
|
1059
|
-
displayValue: string;
|
|
1060
1055
|
} | {
|
|
1061
1056
|
kind: "integer";
|
|
1062
1057
|
integer: number;
|
|
1063
|
-
displayValue: string;
|
|
1064
1058
|
} | {
|
|
1065
1059
|
kind: "location";
|
|
1066
1060
|
country: string | null;
|
|
@@ -1069,45 +1063,35 @@ type MetaDataValue = {
|
|
|
1069
1063
|
postalCode: string | null;
|
|
1070
1064
|
region: string | null;
|
|
1071
1065
|
streetAddress: string | null;
|
|
1072
|
-
displayValue: string;
|
|
1073
1066
|
} | {
|
|
1074
1067
|
kind: "longText";
|
|
1075
1068
|
longText: string;
|
|
1076
|
-
displayValue: string;
|
|
1077
1069
|
} | {
|
|
1078
1070
|
kind: "meta";
|
|
1079
1071
|
meta: unknown;
|
|
1080
|
-
displayValue: string;
|
|
1081
1072
|
} | {
|
|
1082
1073
|
kind: "percent";
|
|
1083
1074
|
percent: string | null;
|
|
1084
|
-
displayValue: string;
|
|
1085
1075
|
} | {
|
|
1086
1076
|
kind: "phone";
|
|
1087
1077
|
phone: string;
|
|
1088
|
-
displayValue: string;
|
|
1089
1078
|
} | {
|
|
1090
1079
|
kind: "shortText";
|
|
1091
1080
|
shortText: string;
|
|
1092
|
-
displayValue: string;
|
|
1093
1081
|
} | {
|
|
1094
1082
|
kind: "time";
|
|
1095
1083
|
time: string;
|
|
1096
|
-
displayValue: string;
|
|
1097
1084
|
} | {
|
|
1098
1085
|
kind: "url";
|
|
1099
1086
|
url: string | null;
|
|
1100
|
-
displayValue: string;
|
|
1101
1087
|
} | {
|
|
1102
1088
|
kind: "volume";
|
|
1103
1089
|
amount: string;
|
|
1104
1090
|
unit: MetaDataVolumeUnit | null;
|
|
1105
|
-
displayValue: string;
|
|
1106
1091
|
} | {
|
|
1107
1092
|
kind: "weight";
|
|
1108
1093
|
amount: string;
|
|
1109
1094
|
unit: MetaDataWeightUnit | null;
|
|
1110
|
-
displayValue: string;
|
|
1111
1095
|
};
|
|
1112
1096
|
/** A single booking custom-field response (one `fieldResponse`). */
|
|
1113
1097
|
interface MetaData {
|
|
@@ -1117,8 +1101,8 @@ interface MetaData {
|
|
|
1117
1101
|
name: string;
|
|
1118
1102
|
/**
|
|
1119
1103
|
* Field slug. When an `integrator` filter is applied, the matched
|
|
1120
|
-
* `
|
|
1121
|
-
* `
|
|
1104
|
+
* `integrators:<integrator>:` prefix is stripped off (e.g.
|
|
1105
|
+
* `integrators:bob:booking_url` → `booking_url`).
|
|
1122
1106
|
*/
|
|
1123
1107
|
slug: string;
|
|
1124
1108
|
/** Raw field type reported by the gateway (kept as a string). */
|
|
@@ -1131,6 +1115,12 @@ interface MetaData {
|
|
|
1131
1115
|
isRequired: boolean;
|
|
1132
1116
|
/** The response's reference id. */
|
|
1133
1117
|
refid: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* A human-readable, display-safe string rendering of the value. Always
|
|
1120
|
+
* present — `""` when the value is absent or of an unrecognized variant. The
|
|
1121
|
+
* `html` value's rendering is HTML-escaped so it is safe to render as text.
|
|
1122
|
+
*/
|
|
1123
|
+
displayValue: string;
|
|
1134
1124
|
/**
|
|
1135
1125
|
* The typed response value, or `null` when absent or of an unrecognized
|
|
1136
1126
|
* (future) variant.
|
|
@@ -1345,7 +1335,7 @@ interface BookingServiceOptions {
|
|
|
1345
1335
|
accessOptions?: AccessOptions;
|
|
1346
1336
|
/**
|
|
1347
1337
|
* Integrator id used to scope `getMetaData` results — only fields whose slug
|
|
1348
|
-
* starts with `
|
|
1338
|
+
* starts with `integrators:<integrator>:` are returned. Defaults to `""` (set
|
|
1349
1339
|
* by the access service to the install's issuer).
|
|
1350
1340
|
*/
|
|
1351
1341
|
integrator?: string;
|
|
@@ -1406,7 +1396,7 @@ declare class BookingService {
|
|
|
1406
1396
|
/**
|
|
1407
1397
|
* Returns a booking's custom-field metadata (its `fieldResponses`), scoped to
|
|
1408
1398
|
* this service's integrator. Only fields whose slug starts with
|
|
1409
|
-
* `
|
|
1399
|
+
* `integrators:<integrator>:` are returned, and that prefix is stripped from
|
|
1410
1400
|
* each returned `slug`. Returns `[]` when the booking is not found or has no
|
|
1411
1401
|
* matching fields.
|
|
1412
1402
|
*
|
|
@@ -1942,6 +1932,37 @@ declare class AvailabilityService {
|
|
|
1942
1932
|
getAvailabilityTimes(query: AvailabilityTimesQuery): Promise<AvailabilityTime[]>;
|
|
1943
1933
|
}
|
|
1944
1934
|
|
|
1935
|
+
/**
|
|
1936
|
+
* Reads custom questions defined on the account.
|
|
1937
|
+
*
|
|
1938
|
+
* Obtain an instance via {@link PeekAccessService.getCustomQuestionService}.
|
|
1939
|
+
*/
|
|
1940
|
+
declare class CustomQuestionService {
|
|
1941
|
+
private readonly client;
|
|
1942
|
+
constructor(client: GraphQLClient);
|
|
1943
|
+
/**
|
|
1944
|
+
* Returns every custom question defined on the account, across all
|
|
1945
|
+
* activities. Choice-style questions (`SELECT_ONE`, `LOCATION`, …) carry their
|
|
1946
|
+
* selectable {@link CustomQuestion.options}; free-text/checkbox questions
|
|
1947
|
+
* return an empty option list.
|
|
1948
|
+
*
|
|
1949
|
+
* These are account-wide question **definitions**, not customer answers — no
|
|
1950
|
+
* PII is involved, so the result is unaffected by `fullCustomerAccess`. Unlike
|
|
1951
|
+
* {@link ProductService.getCustomQuestions}, the catalog carries no
|
|
1952
|
+
* per-activity configuration, so {@link CustomQuestion.order} is `0` and
|
|
1953
|
+
* {@link CustomQuestion.isRequired} is `false` on every entry.
|
|
1954
|
+
*
|
|
1955
|
+
* @returns Every custom question on the account, or an empty list when none
|
|
1956
|
+
* are defined.
|
|
1957
|
+
*
|
|
1958
|
+
* @example
|
|
1959
|
+
* ```ts
|
|
1960
|
+
* const questions = await peek.getCustomQuestionService().getAll();
|
|
1961
|
+
* ```
|
|
1962
|
+
*/
|
|
1963
|
+
getAll(): Promise<CustomQuestion[]>;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1945
1966
|
/**
|
|
1946
1967
|
* The clean data model for a Peek Pro daily (dashboard) note.
|
|
1947
1968
|
*/
|
|
@@ -2445,6 +2466,7 @@ declare class PeekAccessService {
|
|
|
2445
2466
|
private membershipService?;
|
|
2446
2467
|
private readonly bookingServices;
|
|
2447
2468
|
private reviewService?;
|
|
2469
|
+
private customQuestionService?;
|
|
2448
2470
|
constructor(config: PeekAccessServiceConfig);
|
|
2449
2471
|
/**
|
|
2450
2472
|
* Verifies a Peek auth token issued by the app registry and returns the
|
|
@@ -2537,6 +2559,11 @@ declare class PeekAccessService {
|
|
|
2537
2559
|
* authenticated transport. The instance is created lazily and reused.
|
|
2538
2560
|
*/
|
|
2539
2561
|
getReviewService(): ReviewService;
|
|
2562
|
+
/**
|
|
2563
|
+
* Returns the {@link CustomQuestionService} for this install, bound to the
|
|
2564
|
+
* shared authenticated transport. The instance is created lazily and reused.
|
|
2565
|
+
*/
|
|
2566
|
+
getCustomQuestionService(): CustomQuestionService;
|
|
2540
2567
|
/** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
|
|
2541
2568
|
getAllProducts(): Promise<Product[]>;
|
|
2542
2569
|
/** 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}. */
|
|
@@ -3335,4 +3362,4 @@ declare class AcmeApiError extends Error {
|
|
|
3335
3362
|
constructor(statusCode: number, body: unknown, message?: string);
|
|
3336
3363
|
}
|
|
3337
3364
|
|
|
3338
|
-
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 MetaData, type MetaDataBarcodeType, type MetaDataDurationUnit, type MetaDataValue, type MetaDataVolumeUnit, type MetaDataWeightUnit, 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, type ProductReviewSummary, 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 SetMetaDataAttachmentInput, type SetMetaDataGuestInput, type SetMetaDataResult, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
|
|
3365
|
+
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, CustomQuestionService, 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 MetaData, type MetaDataBarcodeType, type MetaDataDurationUnit, type MetaDataValue, type MetaDataVolumeUnit, type MetaDataWeightUnit, 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, type ProductReviewSummary, 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 SetMetaDataAttachmentInput, type SetMetaDataGuestInput, type SetMetaDataResult, type Ticket, type Timeslot, type TimeslotFilter, TimeslotService, type UpdateEngineInput, type UpdateTimeslotResult, type UpsertOverridesInput, type UpsertOverridesResult, type Waiver, createAccessServiceForInstall, noopLogger, parseBookingWebhook, parseInstallWebhook, parseWaiverWebhook, verifyInstallWebhook };
|