@peektravel/app-utilities 0.8.2 → 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.cjs +56 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -46
- package/dist/index.d.ts +46 -46
- package/dist/index.js +56 -47
- package/dist/index.js.map +1 -1
- package/llms.txt +4 -3
- package/package.json +1 -2
- package/docs/ui.md +0 -1175
package/dist/index.js
CHANGED
|
@@ -2124,6 +2124,12 @@ async function requestWithRetry(http, url, init, label, onResponse) {
|
|
|
2124
2124
|
throw new RateLimitError();
|
|
2125
2125
|
}
|
|
2126
2126
|
|
|
2127
|
+
// src/internal/sdk-headers.ts
|
|
2128
|
+
var SDK_HEADER_NAME = "x-peek-sdk";
|
|
2129
|
+
var SDK_PLATFORM = "js";
|
|
2130
|
+
var SDK_VERSION = "0.9.0";
|
|
2131
|
+
var SDK_HEADER_VALUE = `${SDK_PLATFORM}-${SDK_VERSION}`;
|
|
2132
|
+
|
|
2127
2133
|
// src/internal/peek/graphql-client.ts
|
|
2128
2134
|
var isObject = (value) => typeof value === "object" && value !== null;
|
|
2129
2135
|
var GraphQLClient = class {
|
|
@@ -2177,7 +2183,8 @@ var GraphQLClient = class {
|
|
|
2177
2183
|
buildHeaders() {
|
|
2178
2184
|
const headers = {
|
|
2179
2185
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
2180
|
-
"Content-Type": "application/json"
|
|
2186
|
+
"Content-Type": "application/json",
|
|
2187
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
2181
2188
|
};
|
|
2182
2189
|
if (this.options.gatewayKey) {
|
|
2183
2190
|
headers["pk-api-key"] = this.options.gatewayKey;
|
|
@@ -3975,182 +3982,182 @@ var PeekAccessService = class {
|
|
|
3975
3982
|
return this.reviewService;
|
|
3976
3983
|
}
|
|
3977
3984
|
// ─── Product short-forms ─────────────────────────────────────────────────
|
|
3978
|
-
/** All products (activities + add-ons).
|
|
3985
|
+
/** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
|
|
3979
3986
|
getAllProducts() {
|
|
3980
3987
|
return this.getProductService().getAllProducts();
|
|
3981
3988
|
}
|
|
3982
|
-
/** All activity products (excludes add-ons).
|
|
3989
|
+
/** 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}. */
|
|
3983
3990
|
getAllActivities() {
|
|
3984
3991
|
return this.getProductService().getAllActivities();
|
|
3985
3992
|
}
|
|
3986
|
-
/** All rental products.
|
|
3993
|
+
/** All rental products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllRentals}. */
|
|
3987
3994
|
getAllRentals() {
|
|
3988
3995
|
return this.getProductService().getAllRentals();
|
|
3989
3996
|
}
|
|
3990
|
-
/** All add-on products.
|
|
3997
|
+
/** All add-on products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllAddons}. */
|
|
3991
3998
|
getAllAddons() {
|
|
3992
3999
|
return this.getProductService().getAllAddons();
|
|
3993
4000
|
}
|
|
3994
|
-
/** An activity's custom questions.
|
|
4001
|
+
/** An activity's custom questions. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getCustomQuestions}. */
|
|
3995
4002
|
getCustomQuestions(productId) {
|
|
3996
4003
|
return this.getProductService().getCustomQuestions(productId);
|
|
3997
4004
|
}
|
|
3998
4005
|
// ─── Account-user short-forms ─────────────────────────────────────────────
|
|
3999
|
-
/** All active account users.
|
|
4006
|
+
/** All active account users. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getAll}. */
|
|
4000
4007
|
getAllAccountUsers() {
|
|
4001
4008
|
return this.getAccountUserService().getAll();
|
|
4002
4009
|
}
|
|
4003
|
-
/** Account user by id, or null.
|
|
4010
|
+
/** 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}. */
|
|
4004
4011
|
getAccountUserById(userId) {
|
|
4005
4012
|
return this.getAccountUserService().getById(userId);
|
|
4006
4013
|
}
|
|
4007
4014
|
// ─── Resource-pool short-forms ────────────────────────────────────────────
|
|
4008
|
-
/** All resource pools.
|
|
4015
|
+
/** All resource pools. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResourcePoolService.getAll}. */
|
|
4009
4016
|
getAllResourcePools(mode) {
|
|
4010
4017
|
return this.getResourcePoolService().getAll(mode);
|
|
4011
4018
|
}
|
|
4012
4019
|
// ─── Timeslot short-forms ─────────────────────────────────────────────────
|
|
4013
|
-
/** Timeslots for an activity on a given date.
|
|
4020
|
+
/** 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}. */
|
|
4014
4021
|
getTimeslotsForDay(productId, date, filter) {
|
|
4015
4022
|
return this.getTimeslotService().getForDay(productId, date, filter);
|
|
4016
4023
|
}
|
|
4017
|
-
/** Single timeslot by id.
|
|
4024
|
+
/** Single timeslot by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getById}. */
|
|
4018
4025
|
getTimeslotById(timeslotId) {
|
|
4019
4026
|
return this.getTimeslotService().getById(timeslotId);
|
|
4020
4027
|
}
|
|
4021
|
-
/** Set timeslot status.
|
|
4028
|
+
/** Set timeslot status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setAvailability}. */
|
|
4022
4029
|
setTimeslotAvailability(timeslotId, status) {
|
|
4023
4030
|
return this.getTimeslotService().setAvailability(timeslotId, status);
|
|
4024
4031
|
}
|
|
4025
|
-
/** Set timeslot manifest notes.
|
|
4032
|
+
/** Set timeslot manifest notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setNotes}. */
|
|
4026
4033
|
setTimeslotNotes(timeslotId, manifestNotes) {
|
|
4027
4034
|
return this.getTimeslotService().setNotes(timeslotId, manifestNotes);
|
|
4028
4035
|
}
|
|
4029
|
-
/** Assign or unassign guides on timeslots.
|
|
4036
|
+
/** 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}. */
|
|
4030
4037
|
assignTimeslotGuide(assignment) {
|
|
4031
4038
|
return this.getTimeslotService().assignGuide(assignment);
|
|
4032
4039
|
}
|
|
4033
4040
|
// ─── Reseller short-forms ─────────────────────────────────────────────────
|
|
4034
|
-
/** All reseller channels.
|
|
4041
|
+
/** All reseller channels. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResellerService.getAllChannels}. */
|
|
4035
4042
|
getAllChannels(agentsPerChannel) {
|
|
4036
4043
|
return this.getResellerService().getAllChannels(agentsPerChannel);
|
|
4037
4044
|
}
|
|
4038
4045
|
// ─── Promo-code short-forms ───────────────────────────────────────────────
|
|
4039
|
-
/** All promo codes.
|
|
4046
|
+
/** All promo codes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.getAll}. */
|
|
4040
4047
|
getAllPromoCodes() {
|
|
4041
4048
|
return this.getPromoCodeService().getAll();
|
|
4042
4049
|
}
|
|
4043
|
-
/** Create a promo code.
|
|
4050
|
+
/** Create a promo code. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.create}. */
|
|
4044
4051
|
createPromoCode(input) {
|
|
4045
4052
|
return this.getPromoCodeService().create(input);
|
|
4046
4053
|
}
|
|
4047
4054
|
// ─── Pricing short-forms ──────────────────────────────────────────────────
|
|
4048
|
-
/** Create a pricing engine.
|
|
4055
|
+
/** Create a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.createEngine}. */
|
|
4049
4056
|
createPricingEngine(input) {
|
|
4050
4057
|
return this.getPricingService().createEngine(input);
|
|
4051
4058
|
}
|
|
4052
|
-
/** Update a pricing engine.
|
|
4059
|
+
/** Update a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.updateEngine}. */
|
|
4053
4060
|
updatePricingEngine(input) {
|
|
4054
4061
|
return this.getPricingService().updateEngine(input);
|
|
4055
4062
|
}
|
|
4056
|
-
/** Delete a pricing engine (idempotent).
|
|
4063
|
+
/** Delete a pricing engine (idempotent). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.deleteEngine}. */
|
|
4057
4064
|
deletePricingEngine(engineId) {
|
|
4058
4065
|
return this.getPricingService().deleteEngine(engineId);
|
|
4059
4066
|
}
|
|
4060
|
-
/** Upsert pricing overrides.
|
|
4067
|
+
/** Upsert pricing overrides. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.upsertOverrides}. */
|
|
4061
4068
|
upsertPricingOverrides(input) {
|
|
4062
4069
|
return this.getPricingService().upsertOverrides(input);
|
|
4063
4070
|
}
|
|
4064
|
-
/** Clear pricing overrides for a set of activities.
|
|
4071
|
+
/** 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}. */
|
|
4065
4072
|
clearPricingOverrides(input) {
|
|
4066
4073
|
return this.getPricingService().clearOverrides(input);
|
|
4067
4074
|
}
|
|
4068
4075
|
// ─── Daily-note short-forms ───────────────────────────────────────────────
|
|
4069
|
-
/** Today's daily note.
|
|
4076
|
+
/** Today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.getToday}. */
|
|
4070
4077
|
getDailyNoteToday() {
|
|
4071
4078
|
return this.getDailyNoteService().getToday();
|
|
4072
4079
|
}
|
|
4073
|
-
/** Update today's daily note.
|
|
4080
|
+
/** Update today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.update}. */
|
|
4074
4081
|
updateDailyNote(note) {
|
|
4075
4082
|
return this.getDailyNoteService().update(note);
|
|
4076
4083
|
}
|
|
4077
4084
|
// ─── Availability short-forms ─────────────────────────────────────────────
|
|
4078
|
-
/** Availability times for an activity.
|
|
4085
|
+
/** Availability times for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AvailabilityService.getAvailabilityTimes}. */
|
|
4079
4086
|
getAvailabilityTimes(query) {
|
|
4080
4087
|
return this.getAvailabilityService().getAvailabilityTimes(query);
|
|
4081
4088
|
}
|
|
4082
4089
|
// ─── Membership short-forms ───────────────────────────────────────────────
|
|
4083
|
-
/** All memberships.
|
|
4090
|
+
/** All memberships. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.getAll}. */
|
|
4084
4091
|
getAllMemberships() {
|
|
4085
4092
|
return this.getMembershipService().getAll();
|
|
4086
4093
|
}
|
|
4087
|
-
/** Purchase a membership.
|
|
4094
|
+
/** Purchase a membership. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.purchase}. */
|
|
4088
4095
|
purchaseMembership(input) {
|
|
4089
4096
|
return this.getMembershipService().purchase(input);
|
|
4090
4097
|
}
|
|
4091
4098
|
// ─── Booking short-forms ──────────────────────────────────────────────────
|
|
4092
|
-
/** Booking by id.
|
|
4099
|
+
/** Booking by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getById}. */
|
|
4093
4100
|
getBookingById(bookingId, options) {
|
|
4094
4101
|
return this.getBookingService().getById(bookingId, options);
|
|
4095
4102
|
}
|
|
4096
|
-
/** Bookings by time range.
|
|
4103
|
+
/** Bookings by time range. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeRange}. */
|
|
4097
4104
|
searchBookingsByTimeRange(input) {
|
|
4098
4105
|
return this.getBookingService().searchByTimeRange(input);
|
|
4099
4106
|
}
|
|
4100
|
-
/** Bookings on a timeslot.
|
|
4107
|
+
/** Bookings on a timeslot. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeslot}. */
|
|
4101
4108
|
searchBookingsByTimeslot(timeslotId, options) {
|
|
4102
4109
|
return this.getBookingService().searchByTimeslot(timeslotId, options);
|
|
4103
4110
|
}
|
|
4104
|
-
/** Guests on a booking.
|
|
4111
|
+
/** Guests on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getGuests}. */
|
|
4105
4112
|
getBookingGuests(bookingId) {
|
|
4106
4113
|
return this.getBookingService().getGuests(bookingId);
|
|
4107
4114
|
}
|
|
4108
|
-
/** Payments on file for a booking.
|
|
4115
|
+
/** 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}. */
|
|
4109
4116
|
getBookingPaymentsOnFile(bookingId) {
|
|
4110
4117
|
return this.getBookingService().getPaymentsOnFile(bookingId);
|
|
4111
4118
|
}
|
|
4112
|
-
/** Append or overwrite operator notes.
|
|
4119
|
+
/** Append or overwrite operator notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.appendNote}. */
|
|
4113
4120
|
appendBookingNote(bookingId, note, mode) {
|
|
4114
4121
|
return this.getBookingService().appendNote(bookingId, note, mode);
|
|
4115
4122
|
}
|
|
4116
|
-
/** Set booking check-in status.
|
|
4123
|
+
/** Set booking check-in status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.setCheckinStatus}. */
|
|
4117
4124
|
setBookingCheckinStatus(bookingId, checkedIn) {
|
|
4118
4125
|
return this.getBookingService().setCheckinStatus(bookingId, checkedIn);
|
|
4119
4126
|
}
|
|
4120
|
-
/** Cancel a booking.
|
|
4127
|
+
/** Cancel a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.cancel}. */
|
|
4121
4128
|
cancelBooking(bookingId, notes) {
|
|
4122
4129
|
return this.getBookingService().cancel(bookingId, notes);
|
|
4123
4130
|
}
|
|
4124
|
-
/** Charge a booking.
|
|
4131
|
+
/** Charge a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.makePayment}. */
|
|
4125
4132
|
makeBookingPayment(input) {
|
|
4126
4133
|
return this.getBookingService().makePayment(input);
|
|
4127
4134
|
}
|
|
4128
|
-
/** Refund a booking payment.
|
|
4135
|
+
/** Refund a booking payment. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.refund}. */
|
|
4129
4136
|
refundBooking(input) {
|
|
4130
4137
|
return this.getBookingService().refund(input);
|
|
4131
4138
|
}
|
|
4132
|
-
/** Create an invoice link.
|
|
4139
|
+
/** Create an invoice link. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.createInvoiceLink}. */
|
|
4133
4140
|
createBookingInvoiceLink(bookingId) {
|
|
4134
4141
|
return this.getBookingService().createInvoiceLink(bookingId);
|
|
4135
4142
|
}
|
|
4136
|
-
/** List add-ons on a booking.
|
|
4143
|
+
/** 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}. */
|
|
4137
4144
|
listBookingAddons(bookingId) {
|
|
4138
4145
|
return this.getBookingService().listAddons(bookingId);
|
|
4139
4146
|
}
|
|
4140
|
-
/** Add an add-on to a booking.
|
|
4147
|
+
/** 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}. */
|
|
4141
4148
|
addBookingAddon(bookingId, input) {
|
|
4142
4149
|
return this.getBookingService().addAddon(bookingId, input);
|
|
4143
4150
|
}
|
|
4144
|
-
/** Remove an add-on from a booking.
|
|
4151
|
+
/** 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}. */
|
|
4145
4152
|
removeBookingAddon(bookingId, input) {
|
|
4146
4153
|
return this.getBookingService().removeAddon(bookingId, input);
|
|
4147
4154
|
}
|
|
4148
|
-
/** Create a booking.
|
|
4155
|
+
/** Create a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.create}. */
|
|
4149
4156
|
createBooking(input) {
|
|
4150
4157
|
return this.getBookingService().create(input);
|
|
4151
4158
|
}
|
|
4152
4159
|
// ─── Review short-forms ───────────────────────────────────────────────────
|
|
4153
|
-
/** Reviews for an activity.
|
|
4160
|
+
/** Reviews for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ReviewService.getReviews}. */
|
|
4154
4161
|
getReviews(productId, reviewCount, reviewOffset) {
|
|
4155
4162
|
return this.getReviewService().getReviews(productId, reviewCount, reviewOffset);
|
|
4156
4163
|
}
|
|
@@ -4246,7 +4253,8 @@ var RestClient = class {
|
|
|
4246
4253
|
buildHeaders() {
|
|
4247
4254
|
return {
|
|
4248
4255
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
4249
|
-
"Content-Type": "application/json"
|
|
4256
|
+
"Content-Type": "application/json",
|
|
4257
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
4250
4258
|
};
|
|
4251
4259
|
}
|
|
4252
4260
|
};
|
|
@@ -4291,7 +4299,7 @@ var CngAccessService = class {
|
|
|
4291
4299
|
}
|
|
4292
4300
|
return this.productService;
|
|
4293
4301
|
}
|
|
4294
|
-
/** All activities.
|
|
4302
|
+
/** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link CngProductService.getAllActivities}. */
|
|
4295
4303
|
getAllActivities() {
|
|
4296
4304
|
return this.getProductService().getAllActivities();
|
|
4297
4305
|
}
|
|
@@ -4386,7 +4394,8 @@ var RestClient2 = class {
|
|
|
4386
4394
|
buildHeaders() {
|
|
4387
4395
|
return {
|
|
4388
4396
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
4389
|
-
"Content-Type": "application/json"
|
|
4397
|
+
"Content-Type": "application/json",
|
|
4398
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
4390
4399
|
};
|
|
4391
4400
|
}
|
|
4392
4401
|
};
|
|
@@ -4425,7 +4434,7 @@ var AcmeAccessService = class {
|
|
|
4425
4434
|
}
|
|
4426
4435
|
return this.productService;
|
|
4427
4436
|
}
|
|
4428
|
-
/** All activities.
|
|
4437
|
+
/** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AcmeProductService.getAllActivities}. */
|
|
4429
4438
|
getAllActivities() {
|
|
4430
4439
|
return this.getProductService().getAllActivities();
|
|
4431
4440
|
}
|