@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.cjs
CHANGED
|
@@ -2146,6 +2146,12 @@ async function requestWithRetry(http, url, init, label, onResponse) {
|
|
|
2146
2146
|
throw new RateLimitError();
|
|
2147
2147
|
}
|
|
2148
2148
|
|
|
2149
|
+
// src/internal/sdk-headers.ts
|
|
2150
|
+
var SDK_HEADER_NAME = "x-peek-sdk";
|
|
2151
|
+
var SDK_PLATFORM = "js";
|
|
2152
|
+
var SDK_VERSION = "0.9.0";
|
|
2153
|
+
var SDK_HEADER_VALUE = `${SDK_PLATFORM}-${SDK_VERSION}`;
|
|
2154
|
+
|
|
2149
2155
|
// src/internal/peek/graphql-client.ts
|
|
2150
2156
|
var isObject = (value) => typeof value === "object" && value !== null;
|
|
2151
2157
|
var GraphQLClient = class {
|
|
@@ -2199,7 +2205,8 @@ var GraphQLClient = class {
|
|
|
2199
2205
|
buildHeaders() {
|
|
2200
2206
|
const headers = {
|
|
2201
2207
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
2202
|
-
"Content-Type": "application/json"
|
|
2208
|
+
"Content-Type": "application/json",
|
|
2209
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
2203
2210
|
};
|
|
2204
2211
|
if (this.options.gatewayKey) {
|
|
2205
2212
|
headers["pk-api-key"] = this.options.gatewayKey;
|
|
@@ -3997,182 +4004,182 @@ var PeekAccessService = class {
|
|
|
3997
4004
|
return this.reviewService;
|
|
3998
4005
|
}
|
|
3999
4006
|
// ─── Product short-forms ─────────────────────────────────────────────────
|
|
4000
|
-
/** All products (activities + add-ons).
|
|
4007
|
+
/** All products (activities + add-ons). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllProducts}. */
|
|
4001
4008
|
getAllProducts() {
|
|
4002
4009
|
return this.getProductService().getAllProducts();
|
|
4003
4010
|
}
|
|
4004
|
-
/** All activity products (excludes add-ons).
|
|
4011
|
+
/** 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}. */
|
|
4005
4012
|
getAllActivities() {
|
|
4006
4013
|
return this.getProductService().getAllActivities();
|
|
4007
4014
|
}
|
|
4008
|
-
/** All rental products.
|
|
4015
|
+
/** All rental products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllRentals}. */
|
|
4009
4016
|
getAllRentals() {
|
|
4010
4017
|
return this.getProductService().getAllRentals();
|
|
4011
4018
|
}
|
|
4012
|
-
/** All add-on products.
|
|
4019
|
+
/** All add-on products. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getAllAddons}. */
|
|
4013
4020
|
getAllAddons() {
|
|
4014
4021
|
return this.getProductService().getAllAddons();
|
|
4015
4022
|
}
|
|
4016
|
-
/** An activity's custom questions.
|
|
4023
|
+
/** An activity's custom questions. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ProductService.getCustomQuestions}. */
|
|
4017
4024
|
getCustomQuestions(productId) {
|
|
4018
4025
|
return this.getProductService().getCustomQuestions(productId);
|
|
4019
4026
|
}
|
|
4020
4027
|
// ─── Account-user short-forms ─────────────────────────────────────────────
|
|
4021
|
-
/** All active account users.
|
|
4028
|
+
/** All active account users. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AccountUserService.getAll}. */
|
|
4022
4029
|
getAllAccountUsers() {
|
|
4023
4030
|
return this.getAccountUserService().getAll();
|
|
4024
4031
|
}
|
|
4025
|
-
/** Account user by id, or null.
|
|
4032
|
+
/** 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}. */
|
|
4026
4033
|
getAccountUserById(userId) {
|
|
4027
4034
|
return this.getAccountUserService().getById(userId);
|
|
4028
4035
|
}
|
|
4029
4036
|
// ─── Resource-pool short-forms ────────────────────────────────────────────
|
|
4030
|
-
/** All resource pools.
|
|
4037
|
+
/** All resource pools. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResourcePoolService.getAll}. */
|
|
4031
4038
|
getAllResourcePools(mode) {
|
|
4032
4039
|
return this.getResourcePoolService().getAll(mode);
|
|
4033
4040
|
}
|
|
4034
4041
|
// ─── Timeslot short-forms ─────────────────────────────────────────────────
|
|
4035
|
-
/** Timeslots for an activity on a given date.
|
|
4042
|
+
/** 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}. */
|
|
4036
4043
|
getTimeslotsForDay(productId, date, filter) {
|
|
4037
4044
|
return this.getTimeslotService().getForDay(productId, date, filter);
|
|
4038
4045
|
}
|
|
4039
|
-
/** Single timeslot by id.
|
|
4046
|
+
/** Single timeslot by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.getById}. */
|
|
4040
4047
|
getTimeslotById(timeslotId) {
|
|
4041
4048
|
return this.getTimeslotService().getById(timeslotId);
|
|
4042
4049
|
}
|
|
4043
|
-
/** Set timeslot status.
|
|
4050
|
+
/** Set timeslot status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setAvailability}. */
|
|
4044
4051
|
setTimeslotAvailability(timeslotId, status) {
|
|
4045
4052
|
return this.getTimeslotService().setAvailability(timeslotId, status);
|
|
4046
4053
|
}
|
|
4047
|
-
/** Set timeslot manifest notes.
|
|
4054
|
+
/** Set timeslot manifest notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link TimeslotService.setNotes}. */
|
|
4048
4055
|
setTimeslotNotes(timeslotId, manifestNotes) {
|
|
4049
4056
|
return this.getTimeslotService().setNotes(timeslotId, manifestNotes);
|
|
4050
4057
|
}
|
|
4051
|
-
/** Assign or unassign guides on timeslots.
|
|
4058
|
+
/** 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}. */
|
|
4052
4059
|
assignTimeslotGuide(assignment) {
|
|
4053
4060
|
return this.getTimeslotService().assignGuide(assignment);
|
|
4054
4061
|
}
|
|
4055
4062
|
// ─── Reseller short-forms ─────────────────────────────────────────────────
|
|
4056
|
-
/** All reseller channels.
|
|
4063
|
+
/** All reseller channels. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ResellerService.getAllChannels}. */
|
|
4057
4064
|
getAllChannels(agentsPerChannel) {
|
|
4058
4065
|
return this.getResellerService().getAllChannels(agentsPerChannel);
|
|
4059
4066
|
}
|
|
4060
4067
|
// ─── Promo-code short-forms ───────────────────────────────────────────────
|
|
4061
|
-
/** All promo codes.
|
|
4068
|
+
/** All promo codes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.getAll}. */
|
|
4062
4069
|
getAllPromoCodes() {
|
|
4063
4070
|
return this.getPromoCodeService().getAll();
|
|
4064
4071
|
}
|
|
4065
|
-
/** Create a promo code.
|
|
4072
|
+
/** Create a promo code. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PromoCodeService.create}. */
|
|
4066
4073
|
createPromoCode(input) {
|
|
4067
4074
|
return this.getPromoCodeService().create(input);
|
|
4068
4075
|
}
|
|
4069
4076
|
// ─── Pricing short-forms ──────────────────────────────────────────────────
|
|
4070
|
-
/** Create a pricing engine.
|
|
4077
|
+
/** Create a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.createEngine}. */
|
|
4071
4078
|
createPricingEngine(input) {
|
|
4072
4079
|
return this.getPricingService().createEngine(input);
|
|
4073
4080
|
}
|
|
4074
|
-
/** Update a pricing engine.
|
|
4081
|
+
/** Update a pricing engine. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.updateEngine}. */
|
|
4075
4082
|
updatePricingEngine(input) {
|
|
4076
4083
|
return this.getPricingService().updateEngine(input);
|
|
4077
4084
|
}
|
|
4078
|
-
/** Delete a pricing engine (idempotent).
|
|
4085
|
+
/** Delete a pricing engine (idempotent). @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.deleteEngine}. */
|
|
4079
4086
|
deletePricingEngine(engineId) {
|
|
4080
4087
|
return this.getPricingService().deleteEngine(engineId);
|
|
4081
4088
|
}
|
|
4082
|
-
/** Upsert pricing overrides.
|
|
4089
|
+
/** Upsert pricing overrides. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link PricingService.upsertOverrides}. */
|
|
4083
4090
|
upsertPricingOverrides(input) {
|
|
4084
4091
|
return this.getPricingService().upsertOverrides(input);
|
|
4085
4092
|
}
|
|
4086
|
-
/** Clear pricing overrides for a set of activities.
|
|
4093
|
+
/** 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}. */
|
|
4087
4094
|
clearPricingOverrides(input) {
|
|
4088
4095
|
return this.getPricingService().clearOverrides(input);
|
|
4089
4096
|
}
|
|
4090
4097
|
// ─── Daily-note short-forms ───────────────────────────────────────────────
|
|
4091
|
-
/** Today's daily note.
|
|
4098
|
+
/** Today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.getToday}. */
|
|
4092
4099
|
getDailyNoteToday() {
|
|
4093
4100
|
return this.getDailyNoteService().getToday();
|
|
4094
4101
|
}
|
|
4095
|
-
/** Update today's daily note.
|
|
4102
|
+
/** Update today's daily note. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link DailyNoteService.update}. */
|
|
4096
4103
|
updateDailyNote(note) {
|
|
4097
4104
|
return this.getDailyNoteService().update(note);
|
|
4098
4105
|
}
|
|
4099
4106
|
// ─── Availability short-forms ─────────────────────────────────────────────
|
|
4100
|
-
/** Availability times for an activity.
|
|
4107
|
+
/** Availability times for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AvailabilityService.getAvailabilityTimes}. */
|
|
4101
4108
|
getAvailabilityTimes(query) {
|
|
4102
4109
|
return this.getAvailabilityService().getAvailabilityTimes(query);
|
|
4103
4110
|
}
|
|
4104
4111
|
// ─── Membership short-forms ───────────────────────────────────────────────
|
|
4105
|
-
/** All memberships.
|
|
4112
|
+
/** All memberships. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.getAll}. */
|
|
4106
4113
|
getAllMemberships() {
|
|
4107
4114
|
return this.getMembershipService().getAll();
|
|
4108
4115
|
}
|
|
4109
|
-
/** Purchase a membership.
|
|
4116
|
+
/** Purchase a membership. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link MembershipService.purchase}. */
|
|
4110
4117
|
purchaseMembership(input) {
|
|
4111
4118
|
return this.getMembershipService().purchase(input);
|
|
4112
4119
|
}
|
|
4113
4120
|
// ─── Booking short-forms ──────────────────────────────────────────────────
|
|
4114
|
-
/** Booking by id.
|
|
4121
|
+
/** Booking by id. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getById}. */
|
|
4115
4122
|
getBookingById(bookingId, options) {
|
|
4116
4123
|
return this.getBookingService().getById(bookingId, options);
|
|
4117
4124
|
}
|
|
4118
|
-
/** Bookings by time range.
|
|
4125
|
+
/** Bookings by time range. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeRange}. */
|
|
4119
4126
|
searchBookingsByTimeRange(input) {
|
|
4120
4127
|
return this.getBookingService().searchByTimeRange(input);
|
|
4121
4128
|
}
|
|
4122
|
-
/** Bookings on a timeslot.
|
|
4129
|
+
/** Bookings on a timeslot. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.searchByTimeslot}. */
|
|
4123
4130
|
searchBookingsByTimeslot(timeslotId, options) {
|
|
4124
4131
|
return this.getBookingService().searchByTimeslot(timeslotId, options);
|
|
4125
4132
|
}
|
|
4126
|
-
/** Guests on a booking.
|
|
4133
|
+
/** Guests on a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.getGuests}. */
|
|
4127
4134
|
getBookingGuests(bookingId) {
|
|
4128
4135
|
return this.getBookingService().getGuests(bookingId);
|
|
4129
4136
|
}
|
|
4130
|
-
/** Payments on file for a booking.
|
|
4137
|
+
/** 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}. */
|
|
4131
4138
|
getBookingPaymentsOnFile(bookingId) {
|
|
4132
4139
|
return this.getBookingService().getPaymentsOnFile(bookingId);
|
|
4133
4140
|
}
|
|
4134
|
-
/** Append or overwrite operator notes.
|
|
4141
|
+
/** Append or overwrite operator notes. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.appendNote}. */
|
|
4135
4142
|
appendBookingNote(bookingId, note, mode) {
|
|
4136
4143
|
return this.getBookingService().appendNote(bookingId, note, mode);
|
|
4137
4144
|
}
|
|
4138
|
-
/** Set booking check-in status.
|
|
4145
|
+
/** Set booking check-in status. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.setCheckinStatus}. */
|
|
4139
4146
|
setBookingCheckinStatus(bookingId, checkedIn) {
|
|
4140
4147
|
return this.getBookingService().setCheckinStatus(bookingId, checkedIn);
|
|
4141
4148
|
}
|
|
4142
|
-
/** Cancel a booking.
|
|
4149
|
+
/** Cancel a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.cancel}. */
|
|
4143
4150
|
cancelBooking(bookingId, notes) {
|
|
4144
4151
|
return this.getBookingService().cancel(bookingId, notes);
|
|
4145
4152
|
}
|
|
4146
|
-
/** Charge a booking.
|
|
4153
|
+
/** Charge a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.makePayment}. */
|
|
4147
4154
|
makeBookingPayment(input) {
|
|
4148
4155
|
return this.getBookingService().makePayment(input);
|
|
4149
4156
|
}
|
|
4150
|
-
/** Refund a booking payment.
|
|
4157
|
+
/** Refund a booking payment. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.refund}. */
|
|
4151
4158
|
refundBooking(input) {
|
|
4152
4159
|
return this.getBookingService().refund(input);
|
|
4153
4160
|
}
|
|
4154
|
-
/** Create an invoice link.
|
|
4161
|
+
/** Create an invoice link. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.createInvoiceLink}. */
|
|
4155
4162
|
createBookingInvoiceLink(bookingId) {
|
|
4156
4163
|
return this.getBookingService().createInvoiceLink(bookingId);
|
|
4157
4164
|
}
|
|
4158
|
-
/** List add-ons on a booking.
|
|
4165
|
+
/** 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}. */
|
|
4159
4166
|
listBookingAddons(bookingId) {
|
|
4160
4167
|
return this.getBookingService().listAddons(bookingId);
|
|
4161
4168
|
}
|
|
4162
|
-
/** Add an add-on to a booking.
|
|
4169
|
+
/** 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}. */
|
|
4163
4170
|
addBookingAddon(bookingId, input) {
|
|
4164
4171
|
return this.getBookingService().addAddon(bookingId, input);
|
|
4165
4172
|
}
|
|
4166
|
-
/** Remove an add-on from a booking.
|
|
4173
|
+
/** 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}. */
|
|
4167
4174
|
removeBookingAddon(bookingId, input) {
|
|
4168
4175
|
return this.getBookingService().removeAddon(bookingId, input);
|
|
4169
4176
|
}
|
|
4170
|
-
/** Create a booking.
|
|
4177
|
+
/** Create a booking. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link BookingService.create}. */
|
|
4171
4178
|
createBooking(input) {
|
|
4172
4179
|
return this.getBookingService().create(input);
|
|
4173
4180
|
}
|
|
4174
4181
|
// ─── Review short-forms ───────────────────────────────────────────────────
|
|
4175
|
-
/** Reviews for an activity.
|
|
4182
|
+
/** Reviews for an activity. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link ReviewService.getReviews}. */
|
|
4176
4183
|
getReviews(productId, reviewCount, reviewOffset) {
|
|
4177
4184
|
return this.getReviewService().getReviews(productId, reviewCount, reviewOffset);
|
|
4178
4185
|
}
|
|
@@ -4268,7 +4275,8 @@ var RestClient = class {
|
|
|
4268
4275
|
buildHeaders() {
|
|
4269
4276
|
return {
|
|
4270
4277
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
4271
|
-
"Content-Type": "application/json"
|
|
4278
|
+
"Content-Type": "application/json",
|
|
4279
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
4272
4280
|
};
|
|
4273
4281
|
}
|
|
4274
4282
|
};
|
|
@@ -4313,7 +4321,7 @@ var CngAccessService = class {
|
|
|
4313
4321
|
}
|
|
4314
4322
|
return this.productService;
|
|
4315
4323
|
}
|
|
4316
|
-
/** All activities.
|
|
4324
|
+
/** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link CngProductService.getAllActivities}. */
|
|
4317
4325
|
getAllActivities() {
|
|
4318
4326
|
return this.getProductService().getAllActivities();
|
|
4319
4327
|
}
|
|
@@ -4408,7 +4416,8 @@ var RestClient2 = class {
|
|
|
4408
4416
|
buildHeaders() {
|
|
4409
4417
|
return {
|
|
4410
4418
|
"X-Peek-Auth": `Bearer ${this.options.getToken()}`,
|
|
4411
|
-
"Content-Type": "application/json"
|
|
4419
|
+
"Content-Type": "application/json",
|
|
4420
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE
|
|
4412
4421
|
};
|
|
4413
4422
|
}
|
|
4414
4423
|
};
|
|
@@ -4447,7 +4456,7 @@ var AcmeAccessService = class {
|
|
|
4447
4456
|
}
|
|
4448
4457
|
return this.productService;
|
|
4449
4458
|
}
|
|
4450
|
-
/** All activities.
|
|
4459
|
+
/** All activities. @deprecated The access service exposes only its resource-service accessors; call the service directly instead. See {@link AcmeProductService.getAllActivities}. */
|
|
4451
4460
|
getAllActivities() {
|
|
4452
4461
|
return this.getProductService().getAllActivities();
|
|
4453
4462
|
}
|