@peektravel/app-utilities 1.0.0 → 1.0.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/dist/index.cjs +26 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -11
- package/dist/index.d.ts +36 -11
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1266,21 +1266,36 @@ interface InvoiceLinkResult {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
1268
1268
|
/**
|
|
1269
|
-
*
|
|
1269
|
+
* A monetary value as returned by the Peek gateway, shared across services and
|
|
1270
|
+
* resources (booking add-ons, availability prices, …).
|
|
1270
1271
|
*
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
* an internal implementation detail and is intentionally not exported.
|
|
1272
|
+
* `amount` is intentionally a **string** (e.g. `"50.00"`), never a number — the
|
|
1273
|
+
* gateway returns stringly-typed money to avoid floating-point precision loss.
|
|
1274
1274
|
*/
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
/** Numeric amount as a string (e.g. `"10.00"`). */
|
|
1275
|
+
interface Money {
|
|
1276
|
+
/** Numeric amount as a decimal string (e.g. `"50.00"`). */
|
|
1278
1277
|
amount: string;
|
|
1279
|
-
/** ISO currency code (e.g. `"USD"`). */
|
|
1278
|
+
/** ISO 4217 currency code (e.g. `"USD"`). */
|
|
1280
1279
|
currency: string;
|
|
1281
|
-
/** Human-formatted amount (e.g. `"$
|
|
1280
|
+
/** Human-formatted amount (e.g. `"$50.00"`). */
|
|
1282
1281
|
formatted: string;
|
|
1283
1282
|
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Clean, public data models for a booking's add-ons.
|
|
1286
|
+
*
|
|
1287
|
+
* These are the only add-on shapes a consumer sees. The detailed per-option
|
|
1288
|
+
* model used to build add/cancel mutations (refids, reservation statuses) is
|
|
1289
|
+
* an internal implementation detail and is intentionally not exported.
|
|
1290
|
+
*/
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Money amount for an add-on line, as returned by the gateway.
|
|
1294
|
+
*
|
|
1295
|
+
* @deprecated Use the shared {@link Money} model instead. Retained as an alias
|
|
1296
|
+
* for backwards compatibility.
|
|
1297
|
+
*/
|
|
1298
|
+
type BookingAddonMoney = Money;
|
|
1284
1299
|
/** A single add-on option with the quantity attached to the booking. */
|
|
1285
1300
|
interface BookingAddonOption {
|
|
1286
1301
|
/** The item option id (`itemOptionSnapshot.id`). */
|
|
@@ -1297,7 +1312,7 @@ interface BookingAddon {
|
|
|
1297
1312
|
/** The add-on item name (`itemSnapshot.name`). */
|
|
1298
1313
|
addonName: string;
|
|
1299
1314
|
/** The booking line-item total for this add-on, when present. */
|
|
1300
|
-
total:
|
|
1315
|
+
total: Money | null;
|
|
1301
1316
|
/** Live options on this add-on, combined by option id with a count. */
|
|
1302
1317
|
addonOptions: BookingAddonOption[];
|
|
1303
1318
|
}
|
|
@@ -1658,6 +1673,7 @@ interface PurchasedMembership {
|
|
|
1658
1673
|
* a given activity and date, each carrying its per-resource-option availability
|
|
1659
1674
|
* so callers can decide whether a requested party fits.
|
|
1660
1675
|
*/
|
|
1676
|
+
|
|
1661
1677
|
/**
|
|
1662
1678
|
* A single bookable availability time slot for an activity.
|
|
1663
1679
|
*
|
|
@@ -1677,6 +1693,15 @@ interface AvailabilityTime {
|
|
|
1677
1693
|
duration: Duration;
|
|
1678
1694
|
/** Availability status reported by Peek (e.g. open/closed/sold-out). */
|
|
1679
1695
|
status: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* Minimum number of tickets required to book this slot.
|
|
1698
|
+
*
|
|
1699
|
+
* Normalized: a raw value of `0` (no minimum) is reported as `1`, so callers
|
|
1700
|
+
* can always treat it as the smallest bookable party size.
|
|
1701
|
+
*/
|
|
1702
|
+
minimumTicketsRequired: number;
|
|
1703
|
+
/** Per-ticket price for the slot, when reported by Peek. */
|
|
1704
|
+
price: Money | null;
|
|
1680
1705
|
/**
|
|
1681
1706
|
* Remaining availability broken down per resource option. One entry per
|
|
1682
1707
|
* resource option offered for the slot.
|
|
@@ -3399,4 +3424,4 @@ declare class AcmeApiError extends Error {
|
|
|
3399
3424
|
constructor(statusCode: number, body: unknown, message?: string);
|
|
3400
3425
|
}
|
|
3401
3426
|
|
|
3402
|
-
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 };
|
|
3427
|
+
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 Money, 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
|
@@ -1266,21 +1266,36 @@ interface InvoiceLinkResult {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
1268
1268
|
/**
|
|
1269
|
-
*
|
|
1269
|
+
* A monetary value as returned by the Peek gateway, shared across services and
|
|
1270
|
+
* resources (booking add-ons, availability prices, …).
|
|
1270
1271
|
*
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
* an internal implementation detail and is intentionally not exported.
|
|
1272
|
+
* `amount` is intentionally a **string** (e.g. `"50.00"`), never a number — the
|
|
1273
|
+
* gateway returns stringly-typed money to avoid floating-point precision loss.
|
|
1274
1274
|
*/
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
/** Numeric amount as a string (e.g. `"10.00"`). */
|
|
1275
|
+
interface Money {
|
|
1276
|
+
/** Numeric amount as a decimal string (e.g. `"50.00"`). */
|
|
1278
1277
|
amount: string;
|
|
1279
|
-
/** ISO currency code (e.g. `"USD"`). */
|
|
1278
|
+
/** ISO 4217 currency code (e.g. `"USD"`). */
|
|
1280
1279
|
currency: string;
|
|
1281
|
-
/** Human-formatted amount (e.g. `"$
|
|
1280
|
+
/** Human-formatted amount (e.g. `"$50.00"`). */
|
|
1282
1281
|
formatted: string;
|
|
1283
1282
|
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Clean, public data models for a booking's add-ons.
|
|
1286
|
+
*
|
|
1287
|
+
* These are the only add-on shapes a consumer sees. The detailed per-option
|
|
1288
|
+
* model used to build add/cancel mutations (refids, reservation statuses) is
|
|
1289
|
+
* an internal implementation detail and is intentionally not exported.
|
|
1290
|
+
*/
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Money amount for an add-on line, as returned by the gateway.
|
|
1294
|
+
*
|
|
1295
|
+
* @deprecated Use the shared {@link Money} model instead. Retained as an alias
|
|
1296
|
+
* for backwards compatibility.
|
|
1297
|
+
*/
|
|
1298
|
+
type BookingAddonMoney = Money;
|
|
1284
1299
|
/** A single add-on option with the quantity attached to the booking. */
|
|
1285
1300
|
interface BookingAddonOption {
|
|
1286
1301
|
/** The item option id (`itemOptionSnapshot.id`). */
|
|
@@ -1297,7 +1312,7 @@ interface BookingAddon {
|
|
|
1297
1312
|
/** The add-on item name (`itemSnapshot.name`). */
|
|
1298
1313
|
addonName: string;
|
|
1299
1314
|
/** The booking line-item total for this add-on, when present. */
|
|
1300
|
-
total:
|
|
1315
|
+
total: Money | null;
|
|
1301
1316
|
/** Live options on this add-on, combined by option id with a count. */
|
|
1302
1317
|
addonOptions: BookingAddonOption[];
|
|
1303
1318
|
}
|
|
@@ -1658,6 +1673,7 @@ interface PurchasedMembership {
|
|
|
1658
1673
|
* a given activity and date, each carrying its per-resource-option availability
|
|
1659
1674
|
* so callers can decide whether a requested party fits.
|
|
1660
1675
|
*/
|
|
1676
|
+
|
|
1661
1677
|
/**
|
|
1662
1678
|
* A single bookable availability time slot for an activity.
|
|
1663
1679
|
*
|
|
@@ -1677,6 +1693,15 @@ interface AvailabilityTime {
|
|
|
1677
1693
|
duration: Duration;
|
|
1678
1694
|
/** Availability status reported by Peek (e.g. open/closed/sold-out). */
|
|
1679
1695
|
status: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* Minimum number of tickets required to book this slot.
|
|
1698
|
+
*
|
|
1699
|
+
* Normalized: a raw value of `0` (no minimum) is reported as `1`, so callers
|
|
1700
|
+
* can always treat it as the smallest bookable party size.
|
|
1701
|
+
*/
|
|
1702
|
+
minimumTicketsRequired: number;
|
|
1703
|
+
/** Per-ticket price for the slot, when reported by Peek. */
|
|
1704
|
+
price: Money | null;
|
|
1680
1705
|
/**
|
|
1681
1706
|
* Remaining availability broken down per resource option. One entry per
|
|
1682
1707
|
* resource option offered for the slot.
|
|
@@ -3399,4 +3424,4 @@ declare class AcmeApiError extends Error {
|
|
|
3399
3424
|
constructor(statusCode: number, body: unknown, message?: string);
|
|
3400
3425
|
}
|
|
3401
3426
|
|
|
3402
|
-
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 };
|
|
3427
|
+
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 Money, 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.js
CHANGED
|
@@ -169,6 +169,12 @@ var AVAILABILITY_TIMES_QUERY = `
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
status
|
|
172
|
+
minimumTicketsRequired
|
|
173
|
+
price {
|
|
174
|
+
amount
|
|
175
|
+
currency
|
|
176
|
+
formatted
|
|
177
|
+
}
|
|
172
178
|
availability {
|
|
173
179
|
qty
|
|
174
180
|
taken
|
|
@@ -178,6 +184,24 @@ var AVAILABILITY_TIMES_QUERY = `
|
|
|
178
184
|
}
|
|
179
185
|
`;
|
|
180
186
|
|
|
187
|
+
// src/internal/peek/availability/availability-converter.ts
|
|
188
|
+
var DEFAULT_MINIMUM_TICKETS = 1;
|
|
189
|
+
function toAvailabilityTime(node) {
|
|
190
|
+
const rawMinimum = node.minimumTicketsRequired;
|
|
191
|
+
const minimumTicketsRequired = typeof rawMinimum === "number" && rawMinimum > 0 ? rawMinimum : DEFAULT_MINIMUM_TICKETS;
|
|
192
|
+
return {
|
|
193
|
+
id: node.id,
|
|
194
|
+
time: node.time,
|
|
195
|
+
from: node.from,
|
|
196
|
+
end: node.end,
|
|
197
|
+
duration: node.duration,
|
|
198
|
+
status: node.status,
|
|
199
|
+
minimumTicketsRequired,
|
|
200
|
+
price: node.price ?? null,
|
|
201
|
+
availability: node.availability ?? []
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
181
205
|
// src/internal/peek/availability/availability-service.ts
|
|
182
206
|
var AvailabilityService = class {
|
|
183
207
|
constructor(client) {
|
|
@@ -195,7 +219,7 @@ var AvailabilityService = class {
|
|
|
195
219
|
date: query.date
|
|
196
220
|
}
|
|
197
221
|
);
|
|
198
|
-
return body.data?.availabilityTimes ?? [];
|
|
222
|
+
return (body.data?.availabilityTimes ?? []).map(toAvailabilityTime);
|
|
199
223
|
}
|
|
200
224
|
};
|
|
201
225
|
|
|
@@ -2769,7 +2793,7 @@ async function requestWithRetry(http, url, init, label, onResponse) {
|
|
|
2769
2793
|
// src/internal/sdk-headers.ts
|
|
2770
2794
|
var SDK_HEADER_NAME = "x-peek-sdk";
|
|
2771
2795
|
var SDK_PLATFORM = "js";
|
|
2772
|
-
var SDK_VERSION = "1.0.
|
|
2796
|
+
var SDK_VERSION = "1.0.1";
|
|
2773
2797
|
var SDK_HEADER_VALUE = `${SDK_PLATFORM}-${SDK_VERSION}`;
|
|
2774
2798
|
|
|
2775
2799
|
// src/internal/peek/graphql-client.ts
|