@ventrata/octo-types 0.0.12 → 0.0.13
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/.github/dependabot.yml +13 -0
- package/.github/workflows/check-version-pr.yml +48 -0
- package/.github/workflows/code-check-pr.yml +172 -0
- package/.github/workflows/npm-publish.yml +46 -0
- package/biome.json +79 -0
- package/package.json +1 -6
- package/src/index.ts +663 -0
- package/src/models/AdjustmentDiscount.ts +14 -0
- package/src/models/AdjustmentPer.ts +12 -0
- package/src/models/AdyenGateway.ts +13 -0
- package/src/models/AdyenGatewaySession.ts +8 -0
- package/src/models/AdyenPaymentMethodsConfiguration.ts +14 -0
- package/src/models/AdyenPaymentMethodsConfigurationApplePay.ts +7 -0
- package/src/models/AdyenPaymentMethodsConfigurationCard.ts +24 -0
- package/src/models/AdyenPaymentMethodsConfigurationCardBillingAddressMode.ts +9 -0
- package/src/models/AdyenPaymentMethodsConfigurationGooglePay.ts +9 -0
- package/src/models/AdyenPaymentMethodsConfigurationGooglePayBillingAddressParameters.ts +8 -0
- package/src/models/AdyenPaymentMethodsConfigurationPayPay.ts +9 -0
- package/src/models/Agent.ts +22 -0
- package/src/models/Availability.ts +150 -0
- package/src/models/AvailabilityCalendar.ts +81 -0
- package/src/models/AvailabilityCalendarBody.ts +28 -0
- package/src/models/AvailabilityCalendarErrorResponse.ts +6 -0
- package/src/models/AvailabilityCalendarExtras.ts +8 -0
- package/src/models/AvailabilityCalendarOffers.ts +23 -0
- package/src/models/AvailabilityCalendarPricing.ts +16 -0
- package/src/models/AvailabilityCalendarRequest.ts +8 -0
- package/src/models/AvailabilityCheckBody.ts +32 -0
- package/src/models/AvailabilityCheckErrorResponse.ts +6 -0
- package/src/models/AvailabilityCheckRequest.ts +8 -0
- package/src/models/AvailabilityContent.ts +41 -0
- package/src/models/AvailabilityExtras.ts +8 -0
- package/src/models/AvailabilityOffers.ts +23 -0
- package/src/models/AvailabilityPickups.ts +22 -0
- package/src/models/AvailabilityPricing.ts +16 -0
- package/src/models/AvailabilityResources.ts +10 -0
- package/src/models/AvailabilityStatus.ts +11 -0
- package/src/models/AvailabilityType.ts +8 -0
- package/src/models/AvailabilityUnit.ts +16 -0
- package/src/models/AvailabilityUpdate.ts +29 -0
- package/src/models/Booking.ts +309 -0
- package/src/models/BookingAdjustment.ts +21 -0
- package/src/models/BookingAdjustments.ts +11 -0
- package/src/models/BookingCancellation.ts +19 -0
- package/src/models/BookingCancellationBody.ts +8 -0
- package/src/models/BookingCancellationErrorResponse.ts +6 -0
- package/src/models/BookingCancellationPathParams.ts +10 -0
- package/src/models/BookingCancellationRequest_uuid.ts +8 -0
- package/src/models/BookingCardPayments.ts +9 -0
- package/src/models/BookingCart.ts +9 -0
- package/src/models/BookingCheckin.ts +9 -0
- package/src/models/BookingConfirmationBody.ts +42 -0
- package/src/models/BookingConfirmationErrorResponse.ts +6 -0
- package/src/models/BookingConfirmationPathParams.ts +10 -0
- package/src/models/BookingConfirmationRequest_uuid.ts +8 -0
- package/src/models/BookingContact.ts +62 -0
- package/src/models/BookingContent.ts +17 -0
- package/src/models/BookingExtras.ts +10 -0
- package/src/models/BookingGifts.ts +8 -0
- package/src/models/BookingIdentities.ts +9 -0
- package/src/models/BookingMemberships.ts +10 -0
- package/src/models/BookingOffers.ts +26 -0
- package/src/models/BookingPackages.ts +29 -0
- package/src/models/BookingPickupBody.ts +22 -0
- package/src/models/BookingPickups.ts +33 -0
- package/src/models/BookingPricing.ts +11 -0
- package/src/models/BookingQuestions.ts +12 -0
- package/src/models/BookingRejection.ts +14 -0
- package/src/models/BookingRentals.ts +10 -0
- package/src/models/BookingReservationBody.ts +89 -0
- package/src/models/BookingReservationErrorResponse.ts +6 -0
- package/src/models/BookingReservationRequest.ts +8 -0
- package/src/models/BookingResources.ts +11 -0
- package/src/models/BookingStatus.ts +15 -0
- package/src/models/BookingUpdate.ts +23 -0
- package/src/models/BookingUpdateBody.ts +84 -0
- package/src/models/BookingUpdatePathParams.ts +10 -0
- package/src/models/BookingUpdateRequest_uuid.ts +8 -0
- package/src/models/Brand.ts +21 -0
- package/src/models/BrandContact.ts +11 -0
- package/src/models/BridgepayGateway.ts +7 -0
- package/src/models/CancelOrderBody.ts +10 -0
- package/src/models/CancelOrderRequest_id.ts +8 -0
- package/src/models/Capability.ts +28 -0
- package/src/models/CapabilityId.ts +27 -0
- package/src/models/Card.ts +12 -0
- package/src/models/CardPayment.ts +38 -0
- package/src/models/Category.ts +38 -0
- package/src/models/ConfirmOrderBody.ts +23 -0
- package/src/models/ConfirmOrderPricingBody.ts +10 -0
- package/src/models/ConfirmOrderRequest_id.ts +8 -0
- package/src/models/ContactField.ts +15 -0
- package/src/models/CreateOrderBody.ts +23 -0
- package/src/models/CreateOrderPricingBody.ts +10 -0
- package/src/models/CreateOrderRequest_id.ts +8 -0
- package/src/models/CreateWaitlistRequest.ts +15 -0
- package/src/models/CreateWebhookBody.ts +39 -0
- package/src/models/CreateWebhookRequest.ts +8 -0
- package/src/models/CreateWebhookRequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/CustomerContact.ts +69 -0
- package/src/models/DefaultableID.ts +10 -0
- package/src/models/DeleteWebhookPathParams.ts +10 -0
- package/src/models/DeleteWebhookRequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/DeleteWebhookRequest_id.ts +8 -0
- package/src/models/DeliveryFormat.ts +11 -0
- package/src/models/DeliveryMethod.ts +8 -0
- package/src/models/DeliveryOption.ts +21 -0
- package/src/models/Destination.ts +95 -0
- package/src/models/DestinationContact.ts +29 -0
- package/src/models/DestinationPricing.ts +14 -0
- package/src/models/Diff.ts +22 -0
- package/src/models/DurationUnit.ts +9 -0
- package/src/models/ExtendOrderBody.ts +7 -0
- package/src/models/ExtendOrderRequest_id.ts +8 -0
- package/src/models/ExtendReservationBody.ts +6 -0
- package/src/models/ExtendReservationErrorResponse.ts +6 -0
- package/src/models/ExtendReservationPathParams.ts +10 -0
- package/src/models/ExtendReservationRequest_uuid.ts +8 -0
- package/src/models/ExternalGateway.ts +5 -0
- package/src/models/Extra.ts +44 -0
- package/src/models/ExtraItem.ts +24 -0
- package/src/models/ExtraPricing.ts +32 -0
- package/src/models/ExtraRestrictions.ts +22 -0
- package/src/models/FAQ.ts +14 -0
- package/src/models/Font.ts +18 -0
- package/src/models/GetBookingRequest.ts +6 -0
- package/src/models/GetBookingsRequest.ts +6 -0
- package/src/models/GetMappingsQueryParams_optionId.ts +8 -0
- package/src/models/GetMappingsQueryParams_productId.ts +8 -0
- package/src/models/GetMappingsQueryParams_resellerReference.ts +8 -0
- package/src/models/GetMappingsQueryParams_resellerStatus.ts +9 -0
- package/src/models/GetMappingsRequest.ts +23 -0
- package/src/models/GetOrderRequest_id.ts +8 -0
- package/src/models/GetProductRequest.ts +6 -0
- package/src/models/GetProductsRequest.ts +6 -0
- package/src/models/GetSupplierRequest.ts +6 -0
- package/src/models/GetYourGuideActivateBody.ts +18 -0
- package/src/models/GetYourGuideActivateRequest.ts +8 -0
- package/src/models/GetYourGuideActivateRequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/GetYourGuideConnection.ts +35 -0
- package/src/models/Gift.ts +57 -0
- package/src/models/GiftCardPayments.ts +9 -0
- package/src/models/GiftIdentities.ts +9 -0
- package/src/models/GiftPayment.ts +9 -0
- package/src/models/GoogleLocalizedText.ts +14 -0
- package/src/models/GoogleLocation.ts +15 -0
- package/src/models/GoogleOperator.ts +26 -0
- package/src/models/GoogleOptionCategory.ts +10 -0
- package/src/models/GoogleOptions.ts +39 -0
- package/src/models/GoogleRating.ts +14 -0
- package/src/models/GoogleRelatedLocation.ts +21 -0
- package/src/models/GoogleUrl.ts +10 -0
- package/src/models/Identity.ts +11 -0
- package/src/models/Image.ts +9 -0
- package/src/models/Include.ts +33 -0
- package/src/models/ItineraryItem.ts +64 -0
- package/src/models/ItineraryItemType.ts +10 -0
- package/src/models/Label.ts +8 -0
- package/src/models/ListCapabilitiesRequest.ts +5 -0
- package/src/models/ListCapabilitiesRequestHeaders.ts +5 -0
- package/src/models/ListOrdersRequest.ts +14 -0
- package/src/models/ListWebhooksRequest.ts +5 -0
- package/src/models/ListWebhooksRequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/Mapping.ts +55 -0
- package/src/models/MappingToUpdate.ts +35 -0
- package/src/models/MediaRel.ts +9 -0
- package/src/models/MediaType.ts +12 -0
- package/src/models/Membership.ts +15 -0
- package/src/models/MembershipBenefit.ts +9 -0
- package/src/models/NetDiscount.ts +10 -0
- package/src/models/Notice.ts +10 -0
- package/src/models/Octo_AvailabilityCalendarErrorResponse.ts +19 -0
- package/src/models/Octo_AvailabilityCheckErrorResponse.ts +19 -0
- package/src/models/Octo_BaseError.ts +14 -0
- package/src/models/Octo_BookingCancellationBody.ts +14 -0
- package/src/models/Octo_BookingCancellationErrorResponse.ts +17 -0
- package/src/models/Octo_BookingConfirmationErrorResponse.ts +25 -0
- package/src/models/Octo_BookingReservationErrorResponse.ts +23 -0
- package/src/models/Octo_CapabilityId.ts +14 -0
- package/src/models/Octo_DeliveryFormat.ts +10 -0
- package/src/models/Octo_ErrorBadRequest.ts +6 -0
- package/src/models/Octo_ErrorForbidden.ts +6 -0
- package/src/models/Octo_ErrorInternalServerError.ts +6 -0
- package/src/models/Octo_ErrorInvalidAvailabilityID.ts +11 -0
- package/src/models/Octo_ErrorInvalidBookingUUID.ts +11 -0
- package/src/models/Octo_ErrorInvalidOptionID.ts +11 -0
- package/src/models/Octo_ErrorInvalidProductID.ts +11 -0
- package/src/models/Octo_ErrorInvalidUnitID.ts +11 -0
- package/src/models/Octo_ErrorUnauthorized.ts +6 -0
- package/src/models/Octo_ErrorUnprocessableEntity.ts +6 -0
- package/src/models/Octo_ExtendReservationBody.ts +7 -0
- package/src/models/Octo_ExtendReservationErrorResponse.ts +17 -0
- package/src/models/Octo_GetBookingRequest.ts +10 -0
- package/src/models/Octo_GetBookingRequest_uuid.ts +8 -0
- package/src/models/Octo_GetBookingsRequest.ts +34 -0
- package/src/models/Octo_GetBookingsRequest_localDate.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_localDateEnd.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_localDateStart.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_optionId.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_productId.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_resellerReference.ts +8 -0
- package/src/models/Octo_GetBookingsRequest_supplierReference.ts +8 -0
- package/src/models/Octo_GetProductRequest.ts +10 -0
- package/src/models/Octo_GetProductRequest_id.ts +8 -0
- package/src/models/Octo_GetProductsRequest.ts +5 -0
- package/src/models/Octo_GetSupplierRequest.ts +5 -0
- package/src/models/Octo_Media.ts +39 -0
- package/src/models/Octo_RequestHeaders.ts +5 -0
- package/src/models/Octo_RequestHeadersContent.ts +8 -0
- package/src/models/Octo_RequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/Octo_ResponseHeaders.ts +5 -0
- package/src/models/Offer.ts +39 -0
- package/src/models/OfferCombination.ts +41 -0
- package/src/models/OfferComparison.ts +33 -0
- package/src/models/OfferDiscount.ts +19 -0
- package/src/models/OfferMemberships.ts +8 -0
- package/src/models/OfferRestrictions.ts +26 -0
- package/src/models/OfferTax.ts +19 -0
- package/src/models/OpeningHours.ts +30 -0
- package/src/models/OpeningHoursContent.ts +19 -0
- package/src/models/Option.ts +163 -0
- package/src/models/OptionContent.ts +59 -0
- package/src/models/OptionExtras.ts +8 -0
- package/src/models/OptionPackages.ts +8 -0
- package/src/models/OptionPickups.ts +22 -0
- package/src/models/OptionPricing.ts +15 -0
- package/src/models/OptionQuestions.ts +11 -0
- package/src/models/OptionRentals.ts +8 -0
- package/src/models/OptionRestrictions.ts +22 -0
- package/src/models/Order.ts +60 -0
- package/src/models/OrderCardPayments.ts +9 -0
- package/src/models/OrderCheckin.ts +8 -0
- package/src/models/OrderContent.ts +11 -0
- package/src/models/OrderGifts.ts +10 -0
- package/src/models/OrderIdentities.ts +9 -0
- package/src/models/OrderMemberships.ts +8 -0
- package/src/models/OrderOffers.ts +8 -0
- package/src/models/OrderPathParams.ts +10 -0
- package/src/models/OrderPricing.ts +8 -0
- package/src/models/OrderQuestions.ts +12 -0
- package/src/models/PackageInclude.ts +19 -0
- package/src/models/Partner.ts +15 -0
- package/src/models/PartnerEnum.ts +7 -0
- package/src/models/PartnersConnection.ts +18 -0
- package/src/models/PartnersListConnection.ts +21 -0
- package/src/models/PartnersListConnectionsRequest.ts +5 -0
- package/src/models/PartnersListConnectionsRequestHeaders.ts +6 -0
- package/src/models/PartnersListConnectionsRequestHeaders_octoCapabilities.ts +8 -0
- package/src/models/PartnersListConnectionsRequestHeaders_ventrataPartnerKey.ts +5 -0
- package/src/models/PaypalGateway.ts +8 -0
- package/src/models/PaytrGateway.ts +9 -0
- package/src/models/PeachGateway.ts +9 -0
- package/src/models/PickupPoint.ts +66 -0
- package/src/models/Point.ts +25 -0
- package/src/models/PointGroup.ts +22 -0
- package/src/models/Pricing.ts +36 -0
- package/src/models/PricingExtras.ts +9 -0
- package/src/models/PricingOffers.ts +8 -0
- package/src/models/PricingPer.ts +8 -0
- package/src/models/PricingUnit.ts +42 -0
- package/src/models/PricingUnitExtras.ts +9 -0
- package/src/models/Product.ts +200 -0
- package/src/models/ProductContent.ts +101 -0
- package/src/models/ProductGoogle.ts +8 -0
- package/src/models/ProductMemberships.ts +7 -0
- package/src/models/ProductPackages.ts +8 -0
- package/src/models/ProductPricing.ts +20 -0
- package/src/models/ProductRentals.ts +7 -0
- package/src/models/Question.ts +43 -0
- package/src/models/QuestionAnswer.ts +13 -0
- package/src/models/QuestionInputType.ts +9 -0
- package/src/models/RealaxGateway.ts +5 -0
- package/src/models/RedemptionMethod.ts +9 -0
- package/src/models/Refund.ts +9 -0
- package/src/models/RentalDuration.ts +13 -0
- package/src/models/RequestHeaders.ts +6 -0
- package/src/models/Reseller.ts +22 -0
- package/src/models/ResellerStatus.ts +9 -0
- package/src/models/Resource.ts +23 -0
- package/src/models/ResourceAllocation.ts +41 -0
- package/src/models/ResourceGroup.ts +18 -0
- package/src/models/ResponseHeaders.ts +6 -0
- package/src/models/Scan.ts +9 -0
- package/src/models/Seat.ts +22 -0
- package/src/models/SelectOption.ts +14 -0
- package/src/models/Seller.ts +12 -0
- package/src/models/SettlementMethod.ts +11 -0
- package/src/models/SpreedlyGateway.ts +11 -0
- package/src/models/StripeGateway.ts +19 -0
- package/src/models/Supplier.ts +35 -0
- package/src/models/SupplierContact.ts +22 -0
- package/src/models/SupplierContent.ts +9 -0
- package/src/models/Tax.ts +20 -0
- package/src/models/Ticket.ts +28 -0
- package/src/models/TourGroup.ts +18 -0
- package/src/models/UUID.ts +5 -0
- package/src/models/Unit.ts +80 -0
- package/src/models/UnitContent.ts +18 -0
- package/src/models/UnitExtras.ts +8 -0
- package/src/models/UnitItem.ts +95 -0
- package/src/models/UnitItemExtras.ts +8 -0
- package/src/models/UnitItemIdentifier.ts +23 -0
- package/src/models/UnitItemPricing.ts +11 -0
- package/src/models/UnitItemQuestions.ts +11 -0
- package/src/models/UnitItemRedemption.ts +8 -0
- package/src/models/UnitMemberships.ts +8 -0
- package/src/models/UnitPricing.ts +15 -0
- package/src/models/UnitQuestions.ts +11 -0
- package/src/models/UnitRestrictions.ts +63 -0
- package/src/models/UnitType.ts +15 -0
- package/src/models/UpdateMappingsRequest.ts +8 -0
- package/src/models/UpdateOrderBody.ts +23 -0
- package/src/models/UpdateOrderPricingBody.ts +10 -0
- package/src/models/UpdateOrderRequest_id.ts +8 -0
- package/src/models/User.ts +12 -0
- package/src/models/VivawalletGateway.ts +8 -0
- package/src/models/Waitlist.ts +15 -0
- package/src/models/WaitlistUnitIdentifier.ts +8 -0
- package/src/models/WaitlistUnitItemIdentifier.ts +8 -0
- package/src/models/Webhook.ts +36 -0
- package/src/models/WebhookEvent.ts +8 -0
- package/src/models/WhoIAm.ts +18 -0
- package/src/models/WhoIAmRequest.ts +5 -0
- package/src/openapi.yaml +16477 -0
- package/src/schemas/AdjustmentDiscount.ts +5 -0
- package/src/schemas/AdjustmentPer.ts +5 -0
- package/src/schemas/AdyenGateway.ts +12 -0
- package/src/schemas/AdyenGatewaySession.ts +7 -0
- package/src/schemas/AdyenPaymentMethodsConfiguration.ts +13 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationApplePay.ts +6 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationCard.ts +23 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationCardBillingAddressMode.ts +7 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationGooglePay.ts +8 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationGooglePayBillingAddressParameters.ts +7 -0
- package/src/schemas/AdyenPaymentMethodsConfigurationPayPay.ts +8 -0
- package/src/schemas/Agent.ts +9 -0
- package/src/schemas/Availability.ts +54 -0
- package/src/schemas/AvailabilityCalendar.ts +31 -0
- package/src/schemas/AvailabilityCalendarBody.ts +12 -0
- package/src/schemas/AvailabilityCalendarErrorResponse.ts +4 -0
- package/src/schemas/AvailabilityCalendarExtras.ts +7 -0
- package/src/schemas/AvailabilityCalendarOffers.ts +10 -0
- package/src/schemas/AvailabilityCalendarPricing.ts +9 -0
- package/src/schemas/AvailabilityCalendarRequest.ts +7 -0
- package/src/schemas/AvailabilityCheckBody.ts +13 -0
- package/src/schemas/AvailabilityCheckErrorResponse.ts +4 -0
- package/src/schemas/AvailabilityCheckRequest.ts +7 -0
- package/src/schemas/AvailabilityContent.ts +16 -0
- package/src/schemas/AvailabilityExtras.ts +7 -0
- package/src/schemas/AvailabilityOffers.ts +10 -0
- package/src/schemas/AvailabilityPickups.ts +9 -0
- package/src/schemas/AvailabilityPricing.ts +9 -0
- package/src/schemas/AvailabilityResources.ts +6 -0
- package/src/schemas/AvailabilityStatus.ts +5 -0
- package/src/schemas/AvailabilityType.ts +5 -0
- package/src/schemas/AvailabilityUnit.ts +9 -0
- package/src/schemas/AvailabilityUpdate.ts +13 -0
- package/src/schemas/Booking.ts +146 -0
- package/src/schemas/BookingAdjustment.ts +11 -0
- package/src/schemas/BookingAdjustments.ts +7 -0
- package/src/schemas/BookingCancellation.ts +9 -0
- package/src/schemas/BookingCancellationBody.ts +9 -0
- package/src/schemas/BookingCancellationErrorResponse.ts +4 -0
- package/src/schemas/BookingCancellationPathParams.ts +6 -0
- package/src/schemas/BookingCancellationRequest.ts +10 -0
- package/src/schemas/BookingCancellationRequest_uuid.ts +4 -0
- package/src/schemas/BookingCardPayments.ts +8 -0
- package/src/schemas/BookingCart.ts +8 -0
- package/src/schemas/BookingCheckin.ts +8 -0
- package/src/schemas/BookingConfirmationBody.ts +17 -0
- package/src/schemas/BookingConfirmationErrorResponse.ts +4 -0
- package/src/schemas/BookingConfirmationPathParams.ts +6 -0
- package/src/schemas/BookingConfirmationRequest.ts +10 -0
- package/src/schemas/BookingConfirmationRequest_uuid.ts +4 -0
- package/src/schemas/BookingContact.ts +19 -0
- package/src/schemas/BookingContent.ts +16 -0
- package/src/schemas/BookingExtras.ts +9 -0
- package/src/schemas/BookingGifts.ts +7 -0
- package/src/schemas/BookingIdentities.ts +8 -0
- package/src/schemas/BookingMemberships.ts +9 -0
- package/src/schemas/BookingOffers.ts +13 -0
- package/src/schemas/BookingPackages.ts +12 -0
- package/src/schemas/BookingPickupBody.ts +9 -0
- package/src/schemas/BookingPickups.ts +15 -0
- package/src/schemas/BookingPricing.ts +7 -0
- package/src/schemas/BookingQuestions.ts +7 -0
- package/src/schemas/BookingRejection.ts +7 -0
- package/src/schemas/BookingRentals.ts +9 -0
- package/src/schemas/BookingReservationBody.ts +31 -0
- package/src/schemas/BookingReservationErrorResponse.ts +4 -0
- package/src/schemas/BookingReservationRequest.ts +7 -0
- package/src/schemas/BookingResources.ts +7 -0
- package/src/schemas/BookingStatus.ts +5 -0
- package/src/schemas/BookingUpdate.ts +13 -0
- package/src/schemas/BookingUpdateBody.ts +29 -0
- package/src/schemas/BookingUpdatePathParams.ts +6 -0
- package/src/schemas/BookingUpdateRequest.ts +7 -0
- package/src/schemas/BookingUpdateRequest_uuid.ts +4 -0
- package/src/schemas/Brand.ts +20 -0
- package/src/schemas/BrandContact.ts +10 -0
- package/src/schemas/BridgepayGateway.ts +6 -0
- package/src/schemas/CancelOrderBody.ts +6 -0
- package/src/schemas/CancelOrderRequest_id.ts +4 -0
- package/src/schemas/Capability.ts +12 -0
- package/src/schemas/CapabilityId.ts +5 -0
- package/src/schemas/Card.ts +11 -0
- package/src/schemas/CardPayment.ts +37 -0
- package/src/schemas/Category.ts +13 -0
- package/src/schemas/ConfirmOrderBody.ts +10 -0
- package/src/schemas/ConfirmOrderPricingBody.ts +6 -0
- package/src/schemas/ConfirmOrderRequest_id.ts +4 -0
- package/src/schemas/ContactField.ts +5 -0
- package/src/schemas/CreateOrderBody.ts +10 -0
- package/src/schemas/CreateOrderPricingBody.ts +6 -0
- package/src/schemas/CreateOrderRequest_id.ts +4 -0
- package/src/schemas/CreateWaitlistRequest.ts +14 -0
- package/src/schemas/CreateWebhookBody.ts +13 -0
- package/src/schemas/CreateWebhookRequest.ts +7 -0
- package/src/schemas/CreateWebhookRequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/CustomerContact.ts +23 -0
- package/src/schemas/DefaultableID.ts +4 -0
- package/src/schemas/DeleteWebhookPathParams.ts +6 -0
- package/src/schemas/DeleteWebhookRequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/DeleteWebhookRequest_id.ts +4 -0
- package/src/schemas/DeliveryFormat.ts +5 -0
- package/src/schemas/DeliveryMethod.ts +5 -0
- package/src/schemas/DeliveryOption.ts +8 -0
- package/src/schemas/Destination.ts +34 -0
- package/src/schemas/DestinationContact.ts +10 -0
- package/src/schemas/DestinationPricing.ts +7 -0
- package/src/schemas/Diff.ts +9 -0
- package/src/schemas/DurationUnit.ts +5 -0
- package/src/schemas/ExtendOrderBody.ts +6 -0
- package/src/schemas/ExtendOrderRequest_id.ts +4 -0
- package/src/schemas/ExtendReservationBody.ts +4 -0
- package/src/schemas/ExtendReservationErrorResponse.ts +4 -0
- package/src/schemas/ExtendReservationPathParams.ts +6 -0
- package/src/schemas/ExtendReservationRequest.ts +10 -0
- package/src/schemas/ExtendReservationRequest_uuid.ts +4 -0
- package/src/schemas/ExternalGateway.ts +4 -0
- package/src/schemas/Extra.ts +16 -0
- package/src/schemas/ExtraItem.ts +11 -0
- package/src/schemas/ExtraPricing.ts +13 -0
- package/src/schemas/ExtraRestrictions.ts +9 -0
- package/src/schemas/FAQ.ts +7 -0
- package/src/schemas/Font.ts +11 -0
- package/src/schemas/GetBookingRequest.ts +4 -0
- package/src/schemas/GetBookingsRequest.ts +4 -0
- package/src/schemas/GetMappingsQueryParams_optionId.ts +4 -0
- package/src/schemas/GetMappingsQueryParams_productId.ts +4 -0
- package/src/schemas/GetMappingsQueryParams_resellerReference.ts +4 -0
- package/src/schemas/GetMappingsQueryParams_resellerStatus.ts +4 -0
- package/src/schemas/GetMappingsRequest.ts +10 -0
- package/src/schemas/GetOrderRequest_id.ts +4 -0
- package/src/schemas/GetProductRequest.ts +4 -0
- package/src/schemas/GetProductsRequest.ts +4 -0
- package/src/schemas/GetSupplierRequest.ts +4 -0
- package/src/schemas/GetYourGuideActivateBody.ts +8 -0
- package/src/schemas/GetYourGuideActivateRequest.ts +7 -0
- package/src/schemas/GetYourGuideActivateRequestHeaders.ts +4 -0
- package/src/schemas/GetYourGuideActivateRequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/GetYourGuideConnection.ts +15 -0
- package/src/schemas/Gift.ts +56 -0
- package/src/schemas/GiftCardPayments.ts +8 -0
- package/src/schemas/GiftIdentities.ts +8 -0
- package/src/schemas/GiftPayment.ts +8 -0
- package/src/schemas/GoogleLocalizedText.ts +7 -0
- package/src/schemas/GoogleLocation.ts +8 -0
- package/src/schemas/GoogleOperator.ts +13 -0
- package/src/schemas/GoogleOptionCategory.ts +6 -0
- package/src/schemas/GoogleOptions.ts +17 -0
- package/src/schemas/GoogleRating.ts +7 -0
- package/src/schemas/GoogleRelatedLocation.ts +11 -0
- package/src/schemas/GoogleUrl.ts +6 -0
- package/src/schemas/Identity.ts +7 -0
- package/src/schemas/Image.ts +8 -0
- package/src/schemas/Include.ts +17 -0
- package/src/schemas/ItineraryItem.ts +20 -0
- package/src/schemas/ItineraryItemType.ts +5 -0
- package/src/schemas/Label.ts +7 -0
- package/src/schemas/ListCapabilitiesRequest.ts +4 -0
- package/src/schemas/ListCapabilitiesRequestHeaders.ts +4 -0
- package/src/schemas/ListOrdersRequest.ts +13 -0
- package/src/schemas/ListWebhooksRequest.ts +4 -0
- package/src/schemas/ListWebhooksRequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/Mapping.ts +18 -0
- package/src/schemas/MappingToUpdate.ts +13 -0
- package/src/schemas/MediaRel.ts +5 -0
- package/src/schemas/MediaType.ts +5 -0
- package/src/schemas/Membership.ts +14 -0
- package/src/schemas/MembershipBenefit.ts +8 -0
- package/src/schemas/NetDiscount.ts +5 -0
- package/src/schemas/Notice.ts +9 -0
- package/src/schemas/Octo_AvailabilityCalendar.ts +17 -0
- package/src/schemas/Octo_AvailabilityCalendarBody.ts +12 -0
- package/src/schemas/Octo_AvailabilityCalendarErrorResponse.ts +19 -0
- package/src/schemas/Octo_AvailabilityCalendarRequest.ts +7 -0
- package/src/schemas/Octo_AvailabilityCheckBody.ts +13 -0
- package/src/schemas/Octo_AvailabilityCheckErrorResponse.ts +19 -0
- package/src/schemas/Octo_AvailabilityCheckRequest.ts +7 -0
- package/src/schemas/Octo_AvailabilityUnit.ts +7 -0
- package/src/schemas/Octo_BaseError.ts +7 -0
- package/src/schemas/Octo_BookingCancellationBody.ts +7 -0
- package/src/schemas/Octo_BookingCancellationErrorResponse.ts +17 -0
- package/src/schemas/Octo_BookingCancellationRequest.ts +8 -0
- package/src/schemas/Octo_BookingCancellationRequest_uuid.ts +4 -0
- package/src/schemas/Octo_BookingConfirmationBody.ts +11 -0
- package/src/schemas/Octo_BookingConfirmationErrorResponse.ts +25 -0
- package/src/schemas/Octo_BookingConfirmationRequest.ts +8 -0
- package/src/schemas/Octo_BookingConfirmationRequest_uuid.ts +4 -0
- package/src/schemas/Octo_BookingContact.ts +14 -0
- package/src/schemas/Octo_BookingReservationBody.ts +14 -0
- package/src/schemas/Octo_BookingReservationErrorResponse.ts +23 -0
- package/src/schemas/Octo_BookingReservationRequest.ts +7 -0
- package/src/schemas/Octo_BookingUnitItem.ts +7 -0
- package/src/schemas/Octo_Capability.ts +11 -0
- package/src/schemas/Octo_CapabilityId.ts +5 -0
- package/src/schemas/Octo_DeliveryFormat.ts +5 -0
- package/src/schemas/Octo_ErrorBadRequest.ts +4 -0
- package/src/schemas/Octo_ErrorForbidden.ts +4 -0
- package/src/schemas/Octo_ErrorInternalServerError.ts +4 -0
- package/src/schemas/Octo_ErrorInvalidAvailabilityID.ts +9 -0
- package/src/schemas/Octo_ErrorInvalidBookingUUID.ts +9 -0
- package/src/schemas/Octo_ErrorInvalidOptionID.ts +9 -0
- package/src/schemas/Octo_ErrorInvalidProductID.ts +9 -0
- package/src/schemas/Octo_ErrorInvalidUnitID.ts +9 -0
- package/src/schemas/Octo_ErrorUnauthorized.ts +4 -0
- package/src/schemas/Octo_ErrorUnprocessableEntity.ts +4 -0
- package/src/schemas/Octo_ExtendReservationBody.ts +6 -0
- package/src/schemas/Octo_ExtendReservationErrorResponse.ts +17 -0
- package/src/schemas/Octo_ExtendReservationRequest.ts +8 -0
- package/src/schemas/Octo_ExtendReservationRequest_uuid.ts +4 -0
- package/src/schemas/Octo_GetBookingRequest.ts +6 -0
- package/src/schemas/Octo_GetBookingRequest_uuid.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest.ts +12 -0
- package/src/schemas/Octo_GetBookingsRequest_localDate.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_localDateEnd.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_localDateStart.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_optionId.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_productId.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_resellerReference.ts +4 -0
- package/src/schemas/Octo_GetBookingsRequest_supplierReference.ts +4 -0
- package/src/schemas/Octo_GetProductRequest.ts +6 -0
- package/src/schemas/Octo_GetProductRequest_id.ts +4 -0
- package/src/schemas/Octo_GetProductsRequest.ts +4 -0
- package/src/schemas/Octo_GetSupplierRequest.ts +4 -0
- package/src/schemas/Octo_Media.ts +13 -0
- package/src/schemas/Octo_OpeningHours.ts +7 -0
- package/src/schemas/Octo_Pricing.ts +12 -0
- package/src/schemas/Octo_PricingUnit.ts +9 -0
- package/src/schemas/Octo_RequestHeaders.ts +4 -0
- package/src/schemas/Octo_RequestHeadersContent.ts +4 -0
- package/src/schemas/Octo_RequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/Octo_ResponseHeaders.ts +4 -0
- package/src/schemas/Octo_Tax.ts +9 -0
- package/src/schemas/Offer.ts +17 -0
- package/src/schemas/OfferCombination.ts +16 -0
- package/src/schemas/OfferComparison.ts +14 -0
- package/src/schemas/OfferDiscount.ts +9 -0
- package/src/schemas/OfferMemberships.ts +7 -0
- package/src/schemas/OfferRestrictions.ts +10 -0
- package/src/schemas/OfferTax.ts +9 -0
- package/src/schemas/OpeningHours.ts +11 -0
- package/src/schemas/OpeningHoursContent.ts +9 -0
- package/src/schemas/Option.ts +58 -0
- package/src/schemas/OptionContent.ts +19 -0
- package/src/schemas/OptionExtras.ts +7 -0
- package/src/schemas/OptionPackages.ts +7 -0
- package/src/schemas/OptionPickups.ts +9 -0
- package/src/schemas/OptionPricing.ts +8 -0
- package/src/schemas/OptionQuestions.ts +7 -0
- package/src/schemas/OptionRentals.ts +7 -0
- package/src/schemas/OptionRestrictions.ts +9 -0
- package/src/schemas/Order.ts +55 -0
- package/src/schemas/OrderCardPayments.ts +8 -0
- package/src/schemas/OrderCheckin.ts +7 -0
- package/src/schemas/OrderContent.ts +10 -0
- package/src/schemas/OrderGifts.ts +9 -0
- package/src/schemas/OrderIdentities.ts +8 -0
- package/src/schemas/OrderMemberships.ts +7 -0
- package/src/schemas/OrderOffers.ts +7 -0
- package/src/schemas/OrderPathParams.ts +6 -0
- package/src/schemas/OrderPricing.ts +7 -0
- package/src/schemas/OrderQuestions.ts +7 -0
- package/src/schemas/PackageInclude.ts +9 -0
- package/src/schemas/Partner.ts +8 -0
- package/src/schemas/PartnerEnum.ts +5 -0
- package/src/schemas/PartnersConnection.ts +8 -0
- package/src/schemas/PartnersListConnection.ts +11 -0
- package/src/schemas/PartnersListConnectionsRequest.ts +4 -0
- package/src/schemas/PartnersListConnectionsRequestHeaders.ts +4 -0
- package/src/schemas/PartnersListConnectionsRequestHeaders_octoCapabilities.ts +4 -0
- package/src/schemas/PartnersListConnectionsRequestHeaders_ventrataPartnerKey.ts +4 -0
- package/src/schemas/PaypalGateway.ts +7 -0
- package/src/schemas/PaytrGateway.ts +8 -0
- package/src/schemas/PeachGateway.ts +8 -0
- package/src/schemas/PickupPoint.ts +20 -0
- package/src/schemas/Point.ts +11 -0
- package/src/schemas/PointGroup.ts +9 -0
- package/src/schemas/Pricing.ts +17 -0
- package/src/schemas/PricingExtras.ts +8 -0
- package/src/schemas/PricingOffers.ts +7 -0
- package/src/schemas/PricingPer.ts +5 -0
- package/src/schemas/PricingUnit.ts +20 -0
- package/src/schemas/PricingUnitExtras.ts +8 -0
- package/src/schemas/Product.ts +79 -0
- package/src/schemas/ProductContent.ts +40 -0
- package/src/schemas/ProductGoogle.ts +7 -0
- package/src/schemas/ProductMemberships.ts +6 -0
- package/src/schemas/ProductPackages.ts +7 -0
- package/src/schemas/ProductPricing.ts +10 -0
- package/src/schemas/ProductRentals.ts +6 -0
- package/src/schemas/Question.ts +18 -0
- package/src/schemas/QuestionAnswer.ts +9 -0
- package/src/schemas/QuestionInputType.ts +5 -0
- package/src/schemas/RealaxGateway.ts +4 -0
- package/src/schemas/RedemptionMethod.ts +5 -0
- package/src/schemas/Refund.ts +5 -0
- package/src/schemas/RentalDuration.ts +12 -0
- package/src/schemas/RequestHeaders.ts +4 -0
- package/src/schemas/Reseller.ts +9 -0
- package/src/schemas/ResellerStatus.ts +5 -0
- package/src/schemas/Resource.ts +10 -0
- package/src/schemas/ResourceAllocation.ts +16 -0
- package/src/schemas/ResourceGroup.ts +8 -0
- package/src/schemas/ResponseHeaders.ts +4 -0
- package/src/schemas/Scan.ts +8 -0
- package/src/schemas/Seat.ts +9 -0
- package/src/schemas/SelectOption.ts +7 -0
- package/src/schemas/Seller.ts +11 -0
- package/src/schemas/SettlementMethod.ts +5 -0
- package/src/schemas/SpreedlyGateway.ts +10 -0
- package/src/schemas/StripeGateway.ts +23 -0
- package/src/schemas/Supplier.ts +16 -0
- package/src/schemas/SupplierContact.ts +9 -0
- package/src/schemas/SupplierContent.ts +8 -0
- package/src/schemas/Tax.ts +10 -0
- package/src/schemas/Ticket.ts +11 -0
- package/src/schemas/TourGroup.ts +8 -0
- package/src/schemas/UUID.ts +4 -0
- package/src/schemas/Unit.ts +28 -0
- package/src/schemas/UnitContent.ts +8 -0
- package/src/schemas/UnitExtras.ts +7 -0
- package/src/schemas/UnitItem.ts +40 -0
- package/src/schemas/UnitItemExtras.ts +7 -0
- package/src/schemas/UnitItemIdentifier.ts +10 -0
- package/src/schemas/UnitItemPricing.ts +7 -0
- package/src/schemas/UnitItemQuestions.ts +7 -0
- package/src/schemas/UnitItemRedemption.ts +7 -0
- package/src/schemas/UnitMemberships.ts +7 -0
- package/src/schemas/UnitPricing.ts +8 -0
- package/src/schemas/UnitQuestions.ts +7 -0
- package/src/schemas/UnitRestrictions.ts +20 -0
- package/src/schemas/UnitType.ts +5 -0
- package/src/schemas/UpdateMappingsRequest.ts +7 -0
- package/src/schemas/UpdateOrderBody.ts +10 -0
- package/src/schemas/UpdateOrderPricingBody.ts +6 -0
- package/src/schemas/UpdateOrderRequest_id.ts +4 -0
- package/src/schemas/User.ts +11 -0
- package/src/schemas/VivawalletGateway.ts +7 -0
- package/src/schemas/Waitlist.ts +14 -0
- package/src/schemas/WaitlistUnitIdentifier.ts +7 -0
- package/src/schemas/WaitlistUnitItemIdentifier.ts +7 -0
- package/src/schemas/Webhook.ts +14 -0
- package/src/schemas/WebhookEvent.ts +5 -0
- package/src/schemas/WhoIAm.ts +17 -0
- package/src/schemas/WhoIAmRequest.ts +4 -0
- package/src/utils/generate-schemas.ts +372 -0
- package/src/utils/get-openapi-yaml.ts +20 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { unitSchema } from './Unit';
|
|
4
|
+
import { bookingStatusSchema } from './BookingStatus';
|
|
5
|
+
import { customerContactSchema } from './CustomerContact';
|
|
6
|
+
import { ticketSchema } from './Ticket';
|
|
7
|
+
import { unitTypeSchema } from './UnitType';
|
|
8
|
+
import { pricingSchema } from './Pricing';
|
|
9
|
+
import { questionAnswerSchema } from './QuestionAnswer';
|
|
10
|
+
import { extraItemSchema } from './ExtraItem';
|
|
11
|
+
import { scanSchema } from './Scan';
|
|
12
|
+
|
|
13
|
+
export const unitItemSchema = z.object({
|
|
14
|
+
uuid: z.string().optional(),
|
|
15
|
+
resellerReference: z.string().nullable(),
|
|
16
|
+
supplierReference: z.string().nullable(),
|
|
17
|
+
unitId: z.string(),
|
|
18
|
+
unit: unitSchema.optional(),
|
|
19
|
+
status: bookingStatusSchema,
|
|
20
|
+
utcRedeemedAt: z.string().nullable(),
|
|
21
|
+
contact: customerContactSchema.optional(),
|
|
22
|
+
ticket: ticketSchema.nullable(),
|
|
23
|
+
id: z.string().optional(),
|
|
24
|
+
alias: z.string().nullable(),
|
|
25
|
+
rebookingUuid: z.string().nullable(),
|
|
26
|
+
rebookingUnitItemUuid: z.string().nullable(),
|
|
27
|
+
originalRebookingUuid: z.string().nullable(),
|
|
28
|
+
originalRebookingUnitItemUuid: z.string().nullable(),
|
|
29
|
+
utcRebookedAt: z.string().nullable(),
|
|
30
|
+
utcNoshowedAt: z.string().nullable(),
|
|
31
|
+
requiredContactFields: z.array(z.string()).optional(),
|
|
32
|
+
visibleContactFields: z.array(z.string()).optional(),
|
|
33
|
+
unitType: unitTypeSchema,
|
|
34
|
+
localDateTimeStart: z.string().nullable(),
|
|
35
|
+
localDateTimeEnd: z.string().nullable(),
|
|
36
|
+
pricing: pricingSchema.optional(),
|
|
37
|
+
questionAnswers: z.array(questionAnswerSchema).optional(),
|
|
38
|
+
extraItems: z.array(extraItemSchema).optional(),
|
|
39
|
+
scans: z.array(scanSchema).optional(),
|
|
40
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const unitItemIdentifierSchema = z.object({
|
|
5
|
+
uuid: z.string().optional(),
|
|
6
|
+
unitId: z.string().optional(),
|
|
7
|
+
unitType: z.string().optional(),
|
|
8
|
+
resellerReference: z.string().optional(),
|
|
9
|
+
alias: z.string().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const unitRestrictionsSchema = z.object({
|
|
5
|
+
minAge: z.number(),
|
|
6
|
+
maxAge: z.number(),
|
|
7
|
+
idRequired: z.boolean(),
|
|
8
|
+
minQuantity: z.number().nullable(),
|
|
9
|
+
maxQuantity: z.number().nullable(),
|
|
10
|
+
paxCount: z.number(),
|
|
11
|
+
accompaniedBy: z.array(z.string()),
|
|
12
|
+
minHeight: z.number().optional(),
|
|
13
|
+
maxHeight: z.number().optional(),
|
|
14
|
+
heightUnit: z.string().optional(),
|
|
15
|
+
minWeight: z.number().optional(),
|
|
16
|
+
maxWeight: z.number().optional(),
|
|
17
|
+
weightUnit: z.string().optional(),
|
|
18
|
+
required: z.boolean(),
|
|
19
|
+
accompaniedByRatio: z.number().nullable(),
|
|
20
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { bookingContactSchema } from './BookingContact';
|
|
4
|
+
|
|
5
|
+
export const updateOrderBodySchema = z.object({
|
|
6
|
+
expirationMinutes: z.number().optional(),
|
|
7
|
+
emailReceipt: z.boolean().optional(),
|
|
8
|
+
contact: bookingContactSchema.optional(),
|
|
9
|
+
currency: z.string().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const userSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
name: z.string(),
|
|
7
|
+
reference: z.string().nullable(),
|
|
8
|
+
tags: z.array(z.string()),
|
|
9
|
+
emailAddress: z.string(),
|
|
10
|
+
phoneNumber: z.string().nullable(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { defaultableIDSchema } from './DefaultableID';
|
|
4
|
+
import { waitlistUnitIdentifierSchema } from './WaitlistUnitIdentifier';
|
|
5
|
+
import { customerContactSchema } from './CustomerContact';
|
|
6
|
+
|
|
7
|
+
export const waitlistSchema = z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
productId: z.string(),
|
|
10
|
+
optionId: defaultableIDSchema,
|
|
11
|
+
localDate: z.string(),
|
|
12
|
+
units: z.array(waitlistUnitIdentifierSchema),
|
|
13
|
+
contact: customerContactSchema.nullable(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { webhookEventSchema } from './WebhookEvent';
|
|
4
|
+
import { capabilityIdSchema } from './CapabilityId';
|
|
5
|
+
|
|
6
|
+
export const webhookSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
event: webhookEventSchema,
|
|
9
|
+
url: z.string().nullable(),
|
|
10
|
+
retryOnError: z.boolean(),
|
|
11
|
+
useContactLanguage: z.boolean(),
|
|
12
|
+
headers: z.record(z.string()),
|
|
13
|
+
capabilities: z.array(capabilityIdSchema),
|
|
14
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { supplierSchema } from './Supplier';
|
|
4
|
+
import { getYourGuideConnectionSchema } from './GetYourGuideConnection';
|
|
5
|
+
import { partnersConnectionSchema } from './PartnersConnection';
|
|
6
|
+
import { partnerSchema } from './Partner';
|
|
7
|
+
import { resellerSchema } from './Reseller';
|
|
8
|
+
|
|
9
|
+
export const whoIAmSchema = z.object({
|
|
10
|
+
supplier: supplierSchema,
|
|
11
|
+
connection: z.union([getYourGuideConnectionSchema, partnersConnectionSchema]),
|
|
12
|
+
partner: partnerSchema,
|
|
13
|
+
reseller: resellerSchema,
|
|
14
|
+
checkout: z.any(),
|
|
15
|
+
operator: z.any(),
|
|
16
|
+
terminal: z.any(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { existsSync, promises } from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as glob from 'glob';
|
|
4
|
+
import { generate } from 'ts-to-zod';
|
|
5
|
+
|
|
6
|
+
type ZanySchema = {
|
|
7
|
+
fullMatch: string;
|
|
8
|
+
schemaName: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const CONFIG = {
|
|
12
|
+
ignorePatterns: ['**/*.spec.ts', '**/*.test.ts', '**/*.d.ts'],
|
|
13
|
+
relativePaths: {
|
|
14
|
+
models: 'src/models',
|
|
15
|
+
schemas: 'src/schemas',
|
|
16
|
+
},
|
|
17
|
+
specificModels: [],
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
async function generateSchemas() {
|
|
21
|
+
const { modelsDir, schemasDir } = setupDirectories();
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
await ensureDirectoryExists(schemasDir);
|
|
25
|
+
|
|
26
|
+
const files =
|
|
27
|
+
CONFIG.specificModels.length > 0
|
|
28
|
+
? await findSpecificModelFiles(modelsDir, CONFIG.specificModels)
|
|
29
|
+
: findTypeScriptFiles(modelsDir);
|
|
30
|
+
|
|
31
|
+
console.log(`Found ${files.length} TypeScript files to process`);
|
|
32
|
+
|
|
33
|
+
await Promise.all(files.map((file) => processFile(file, { modelsDir, schemasDir })));
|
|
34
|
+
|
|
35
|
+
console.log('Analyzing and fixing circular dependencies...');
|
|
36
|
+
await fixCircularDependencies(schemasDir);
|
|
37
|
+
|
|
38
|
+
await updateIndexFileWithSchemas(schemasDir);
|
|
39
|
+
|
|
40
|
+
console.log('Finished generating Zod schemas');
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.error('Unhandled error:', err);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function setupDirectories() {
|
|
48
|
+
const projectRoot = process.cwd();
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
modelsDir: path.resolve(projectRoot, CONFIG.relativePaths.models),
|
|
52
|
+
schemasDir: path.resolve(projectRoot, CONFIG.relativePaths.schemas),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function ensureDirectoryExists(dirPath: string): Promise<void> {
|
|
57
|
+
try {
|
|
58
|
+
await promises.mkdir(dirPath, { recursive: true });
|
|
59
|
+
console.log(`Created directory at ${dirPath}`);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.error(`Error creating directory: ${err}`);
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function findTypeScriptFiles(dir: string): string[] {
|
|
67
|
+
return glob.sync('**/*.ts', {
|
|
68
|
+
cwd: dir,
|
|
69
|
+
ignore: CONFIG.ignorePatterns,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function findSpecificModelFiles(dir: string, modelSpecs: string[]): Promise<string[]> {
|
|
74
|
+
const result: string[] = [];
|
|
75
|
+
|
|
76
|
+
for (const spec of modelSpecs) {
|
|
77
|
+
const normalizedSpec = spec.endsWith('.ts') ? spec : `${spec}.ts`;
|
|
78
|
+
|
|
79
|
+
if (await promises.stat(path.join(dir, normalizedSpec)).catch(() => null)) {
|
|
80
|
+
result.push(normalizedSpec);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const fileName = path.basename(normalizedSpec);
|
|
85
|
+
const matches = glob.sync(`**/${fileName}`, {
|
|
86
|
+
cwd: dir,
|
|
87
|
+
ignore: CONFIG.ignorePatterns,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
result.push(...matches);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return Array.from(new Set(result));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function processFile(file: string, dirs: { modelsDir: string; schemasDir: string }): Promise<void> {
|
|
97
|
+
const { modelsDir, schemasDir } = dirs;
|
|
98
|
+
const inputPath = path.join(modelsDir, file);
|
|
99
|
+
const relativePath = path.relative(modelsDir, inputPath);
|
|
100
|
+
const outputDir = path.dirname(path.join(schemasDir, relativePath));
|
|
101
|
+
const fileName = path.basename(relativePath, '.ts');
|
|
102
|
+
const outputPath = path.join(outputDir, `${fileName}.ts`);
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
await ensureDirectoryExists(outputDir);
|
|
106
|
+
|
|
107
|
+
const sourceText = await promises.readFile(inputPath, 'utf-8');
|
|
108
|
+
const result = generateSchema(sourceText);
|
|
109
|
+
|
|
110
|
+
if (result.errors.length > 0) {
|
|
111
|
+
console.warn(`Errors in ${file}:`, result.errors);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const modelImportPathRaw = path.relative(outputDir, inputPath).replace(/\.ts$/, '');
|
|
115
|
+
const modelImportPath = (modelImportPathRaw.startsWith('.') ? modelImportPathRaw : `./${modelImportPathRaw}`)
|
|
116
|
+
.split(path.sep)
|
|
117
|
+
.join('/');
|
|
118
|
+
|
|
119
|
+
let zodSchemasText = result.getZodSchemasFile(modelImportPath);
|
|
120
|
+
|
|
121
|
+
zodSchemasText = replaceZanySchemas(zodSchemasText);
|
|
122
|
+
zodSchemasText = addRules(zodSchemasText, fileName);
|
|
123
|
+
|
|
124
|
+
if (!zodSchemasText.includes('z.')) {
|
|
125
|
+
zodSchemasText = zodSchemasText.replace(/import\s*{\s*z\s*}\s*from\s*["']zod["'];\s*\n?/g, '');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
zodSchemasText = `${zodSchemasText
|
|
129
|
+
.split('\n')
|
|
130
|
+
.map((line) => line.trimEnd())
|
|
131
|
+
.filter((line, idx, arr) => line !== '' || (idx > 0 && arr[idx - 1] !== ''))
|
|
132
|
+
.join('\n')
|
|
133
|
+
.trimEnd()}\n`;
|
|
134
|
+
|
|
135
|
+
await promises.writeFile(outputPath, zodSchemasText);
|
|
136
|
+
console.log(`Created schema file: ${outputPath}`);
|
|
137
|
+
} catch (err) {
|
|
138
|
+
console.error(`Error processing ${file}:`, err);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function generateSchema(sourceText: string) {
|
|
143
|
+
return generate({
|
|
144
|
+
sourceText,
|
|
145
|
+
getSchemaName: (name) => `${name.charAt(0).toLowerCase() + name.slice(1)}Schema`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function replaceZanySchemas(fileContent: string): string {
|
|
150
|
+
const zanySchemas = findZanySchemas(fileContent);
|
|
151
|
+
if (zanySchemas.length === 0) return fileContent;
|
|
152
|
+
|
|
153
|
+
const importsToAdd: string[] = [];
|
|
154
|
+
let modifiedContent = fileContent;
|
|
155
|
+
|
|
156
|
+
for (const schema of zanySchemas) {
|
|
157
|
+
const baseName = schema.schemaName.replace(/Schema$/, '');
|
|
158
|
+
const fileName = baseName.charAt(0).toUpperCase() + baseName.slice(1);
|
|
159
|
+
|
|
160
|
+
importsToAdd.push(`import { ${schema.schemaName} } from "./${fileName}";`);
|
|
161
|
+
modifiedContent = modifiedContent.replace(schema.fullMatch, '');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return reorganizeImports(modifiedContent, importsToAdd);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function findZanySchemas(content: string): ZanySchema[] {
|
|
168
|
+
const zanyRegex = /const\s+([a-zA-Z0-9_]+)\s+=\s+z\.any\(\);/g;
|
|
169
|
+
const zanySchemas: ZanySchema[] = [];
|
|
170
|
+
let match = zanyRegex.exec(content);
|
|
171
|
+
|
|
172
|
+
while (match !== null) {
|
|
173
|
+
zanySchemas.push({
|
|
174
|
+
fullMatch: match[0],
|
|
175
|
+
schemaName: match[1],
|
|
176
|
+
});
|
|
177
|
+
match = zanyRegex.exec(content);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return zanySchemas;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function reorganizeImports(content: string, newImports: string[]): string {
|
|
184
|
+
if (newImports.length === 0) return content;
|
|
185
|
+
|
|
186
|
+
const existingImportRegex = /^import .+ from .+;\n*/gm;
|
|
187
|
+
const matches = content.match(existingImportRegex);
|
|
188
|
+
const existingImports: string[] = matches ? [...matches] : [];
|
|
189
|
+
const endOfImportsIndex = existingImports.reduce((lastIndex: number, imp: string) => {
|
|
190
|
+
const index = content.indexOf(imp);
|
|
191
|
+
return index > lastIndex ? index + imp.length : lastIndex;
|
|
192
|
+
}, 0);
|
|
193
|
+
const cleanedContent = content.slice(endOfImportsIndex).replace(/^\s*\n+/g, '');
|
|
194
|
+
|
|
195
|
+
return `${content.slice(0, endOfImportsIndex).trimEnd()}\n${newImports.join('\n')}\n\n${cleanedContent}`;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function addRules(zodSchemasText: string, fileName: string): string {
|
|
199
|
+
const rulesFilePath = path.resolve(process.cwd(), 'src/rules', `${fileName}.ts`);
|
|
200
|
+
|
|
201
|
+
if (!existsSync(rulesFilePath)) {
|
|
202
|
+
return zodSchemasText;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const ruleFunctionName = `${fileName.charAt(0).toLowerCase() + fileName.slice(1)}Rule`;
|
|
206
|
+
const schemaRegex = /(}\))\s*;/g;
|
|
207
|
+
const refineCall = `.superRefine(${ruleFunctionName}())`;
|
|
208
|
+
|
|
209
|
+
const modifiedText = zodSchemasText.replace(schemaRegex, `$1${refineCall};`);
|
|
210
|
+
const importLine = `import { ${ruleFunctionName} } from '../rules/${fileName}';\n`;
|
|
211
|
+
|
|
212
|
+
return importLine + modifiedText;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function toPascalCase(name: string): string {
|
|
216
|
+
return name
|
|
217
|
+
.split(/[-_\s]/)
|
|
218
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
219
|
+
.join('');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async function fixCircularDependencies(schemasDir: string): Promise<void> {
|
|
223
|
+
const schemaFiles = glob.sync('**/*.ts', { cwd: schemasDir });
|
|
224
|
+
const dependencyGraph = new Map<string, Set<string>>();
|
|
225
|
+
const schemaContents = new Map<string, string>();
|
|
226
|
+
|
|
227
|
+
for (const schemaFile of schemaFiles) {
|
|
228
|
+
const baseName = path.basename(schemaFile, '.ts');
|
|
229
|
+
const schemaFilePath = path.join(schemasDir, schemaFile);
|
|
230
|
+
const content = await promises.readFile(schemaFilePath, 'utf-8');
|
|
231
|
+
schemaContents.set(baseName, content);
|
|
232
|
+
|
|
233
|
+
const dependencies = new Set<string>();
|
|
234
|
+
const importRegex = /import\s+\{[^}]*\}\s+from\s+['"]([^'"]+)['"]/g;
|
|
235
|
+
let match;
|
|
236
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: <any>
|
|
237
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
238
|
+
const importPath = match[1];
|
|
239
|
+
if (importPath.startsWith('./') || importPath.startsWith('../')) {
|
|
240
|
+
const importedFile = path.basename(importPath, '.ts');
|
|
241
|
+
if (importedFile !== baseName) {
|
|
242
|
+
dependencies.add(importedFile);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
dependencyGraph.set(baseName, dependencies);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const visited = new Set<string>();
|
|
250
|
+
const recursionStack = new Set<string>();
|
|
251
|
+
const circularSchemas = new Set<string>();
|
|
252
|
+
|
|
253
|
+
function detectCycles(node: string): void {
|
|
254
|
+
if (recursionStack.has(node)) {
|
|
255
|
+
circularSchemas.add(node);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (visited.has(node)) return;
|
|
259
|
+
|
|
260
|
+
visited.add(node);
|
|
261
|
+
recursionStack.add(node);
|
|
262
|
+
|
|
263
|
+
const dependencies = dependencyGraph.get(node) || new Set();
|
|
264
|
+
for (const dep of dependencies) {
|
|
265
|
+
detectCycles(dep);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
recursionStack.delete(node);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
for (const schema of dependencyGraph.keys()) {
|
|
272
|
+
if (!visited.has(schema)) {
|
|
273
|
+
detectCycles(schema);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
for (const schemaName of circularSchemas) {
|
|
278
|
+
const content = schemaContents.get(schemaName);
|
|
279
|
+
if (!content) continue;
|
|
280
|
+
|
|
281
|
+
const exportConstRegex = /export\s+const\s+(\w+Schema)\s*=\s*z\.(object|union|array|record|tuple|map)\s*\(/;
|
|
282
|
+
const match = content.match(exportConstRegex);
|
|
283
|
+
if (!match) continue;
|
|
284
|
+
|
|
285
|
+
const schemaVarName = match[1];
|
|
286
|
+
const typeName = toPascalCase(schemaName);
|
|
287
|
+
|
|
288
|
+
const importTypeLine = `import { type ${typeName} } from "../models/${typeName}";`;
|
|
289
|
+
let updatedContent = content;
|
|
290
|
+
|
|
291
|
+
if (!content.includes(importTypeLine)) {
|
|
292
|
+
const lines = content.split('\n');
|
|
293
|
+
const insertAt = Math.min(3, lines.length);
|
|
294
|
+
lines.splice(insertAt, 0, importTypeLine);
|
|
295
|
+
updatedContent = lines.join('\n');
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const annotatedLazy = `export const ${schemaVarName}: z.ZodSchema<${typeName}> = z.lazy(() => z.$2(`;
|
|
299
|
+
updatedContent = updatedContent.replace(exportConstRegex, annotatedLazy);
|
|
300
|
+
|
|
301
|
+
const exportStart = updatedContent.indexOf(`export const ${schemaVarName}`);
|
|
302
|
+
if (exportStart !== -1) {
|
|
303
|
+
const afterStart = updatedContent.slice(exportStart);
|
|
304
|
+
const closeIdx = afterStart.indexOf('});');
|
|
305
|
+
if (closeIdx !== -1) {
|
|
306
|
+
updatedContent =
|
|
307
|
+
updatedContent.slice(0, exportStart) +
|
|
308
|
+
afterStart.slice(0, closeIdx) +
|
|
309
|
+
'}));' +
|
|
310
|
+
afterStart.slice(closeIdx + 3);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const schemaFilePath = path.join(schemasDir, `${schemaName}.ts`);
|
|
315
|
+
await promises.writeFile(schemaFilePath, updatedContent);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
async function updateIndexFileWithSchemas(schemasDir: string): Promise<void> {
|
|
320
|
+
try {
|
|
321
|
+
const projectRoot = process.cwd();
|
|
322
|
+
const indexPath = path.join(projectRoot, 'src', 'index.ts');
|
|
323
|
+
|
|
324
|
+
if (!existsSync(indexPath)) return;
|
|
325
|
+
|
|
326
|
+
let indexContent = await promises.readFile(indexPath, 'utf-8');
|
|
327
|
+
const schemaFiles = glob.sync('**/*.ts', {
|
|
328
|
+
cwd: schemasDir,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
const schemaExports: string[] = [];
|
|
332
|
+
const seenSchemaNames = new Set<string>();
|
|
333
|
+
|
|
334
|
+
for (const schemaFile of schemaFiles) {
|
|
335
|
+
const baseName = path.basename(schemaFile, '.ts');
|
|
336
|
+
const schemaFilePath = path.join(schemasDir, schemaFile);
|
|
337
|
+
const schemaContent = await promises.readFile(schemaFilePath, 'utf-8');
|
|
338
|
+
|
|
339
|
+
const exportRegex = /export\s+const\s+(\w+Schema)\s*=/g;
|
|
340
|
+
let match: RegExpExecArray | null;
|
|
341
|
+
|
|
342
|
+
match = exportRegex.exec(schemaContent);
|
|
343
|
+
while (match !== null) {
|
|
344
|
+
const schemaName = match[1];
|
|
345
|
+
if (!seenSchemaNames.has(schemaName)) {
|
|
346
|
+
seenSchemaNames.add(schemaName);
|
|
347
|
+
const exportStatement = `export { ${schemaName} } from './schemas/${baseName}';`;
|
|
348
|
+
if (!indexContent.includes(exportStatement)) {
|
|
349
|
+
schemaExports.push(exportStatement);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
match = exportRegex.exec(schemaContent);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (schemaExports.length > 0) {
|
|
357
|
+
if (!indexContent.includes('// Zod Schemas')) {
|
|
358
|
+
indexContent += '\n\n// Zod Schemas';
|
|
359
|
+
}
|
|
360
|
+
indexContent += `\n${schemaExports.join('\n')}`;
|
|
361
|
+
|
|
362
|
+
await promises.writeFile(indexPath, indexContent);
|
|
363
|
+
console.log(`Updated index file with ${schemaExports.length} schema exports`);
|
|
364
|
+
} else {
|
|
365
|
+
console.log('No new schema exports to add to index file');
|
|
366
|
+
}
|
|
367
|
+
} catch (err) {
|
|
368
|
+
console.error('Error updating index file with schemas:', err);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
generateSchemas().catch((err) => console.log(err));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
|
|
4
|
+
async function fetchAndSaveYaml() {
|
|
5
|
+
const url =
|
|
6
|
+
'https://raw.githubusercontent.com/ventrata/octo-typespec/main/tsp-output/%40typespec/openapi3/openapi.Ventrata.yaml';
|
|
7
|
+
|
|
8
|
+
const response = await fetch(url);
|
|
9
|
+
if (!response.ok) {
|
|
10
|
+
throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const yamlText = await response.text();
|
|
14
|
+
|
|
15
|
+
const outputPath = path.join('src', 'openapi.yaml');
|
|
16
|
+
await writeFile(outputPath, yamlText, 'utf-8');
|
|
17
|
+
console.log(`OpenAPI YAML saved to ${outputPath}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fetchAndSaveYaml().catch((e) => console.error(e));
|