aves-sdk 2.0.0 → 2.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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.1] - 2026-08-05
9
+
10
+ ### Changed
11
+
12
+ - Omit source maps from the published package; `files` now ships only
13
+ `dist/index.mjs` and `dist/index.d.mts`.
14
+
8
15
  ## [2.0.0] - 2026-08-05
9
16
 
10
17
  ### Changed
package/dist/index.d.mts CHANGED
@@ -19352,5 +19352,4 @@ declare class AvesClient {
19352
19352
  constructor(options: AvesClientOptions, deps?: AvesClientDeps);
19353
19353
  }
19354
19354
  //#endregion
19355
- export { type AccountPolicies, AvesClient, type AvesClientDeps, type AvesClientOptions, AvesError, type AvesSearchRQ, AvesSearchType, AvesSearchTypeSchema, AvesServiceType, AvesServiceTypeSchema, AvesTransport, BookedServiceStatus, BookedServiceStatusSchema, BookingClient, type BookingFileDetailRS, type BookingFileRQ, type BookingFileRS, BookingFileStatus, BookingFileStatusSchema, BookingFileStatusWire, BookingFileStatusWireSchema, type BookingStatusOnlyRS, type CancelFileRQ, CancelOperationType, CancelOperationTypeSchema, CarrierType, CarrierTypeSchema, type CommitPackageRQ, type CommitPackageRS, CostPriceType, CostPriceTypeSchema, CustomerPaymentType, CustomerPaymentTypeSchema, DestinationType, DestinationTypeSchema, DocumentType, DocumentTypeSchema, type DynamicFields, type FilePaymentListRQ, FilePaymentOperationType, FilePaymentOperationTypeSchema, type FinancialDetail, Gender, GenderSchema, GroupingPaxPolicy, GroupingPaxPolicySchema, type IdDocumentDetail, InsertCriteria, InsertCriteriaSchema, MakeDocumentTo, MakeDocumentToSchema, type ManageMasterRecordRS, type ManageMasterRecordRequest, MasterPaymentType, MasterPaymentTypeSchema, type MasterRecordDetail, type MasterRecordDetailResponse, MasterRecordsClient, type ModFileHeaderRQ, type ModFileServicesRQ, OptionedExpirePolicy, OptionedExpirePolicySchema, PackageCatalogClient, type PackageDetailRQ, type PackageDetailRS, PassengerCategory, PassengerCategorySchema, PaxQtyCriteria, PaxQtyCriteriaSchema, PaymentType, PaymentTypeSchema, RecordStatus, RecordStatusSchema, RecordType, RecordTypeSchema, type RqHeader, type RsStatus, RsStatusValue, RsStatusValueSchema, type SearchBookingFileRQ, type SearchBookingFileRS, SearchBookingFileType, SearchBookingFileTypeSchema, type SearchMasterRecord, type SearchMasterRecordRS, SearchMasterType, SearchMasterTypeSchema, type SearchPackageRS, type SearchServicesRS, ServiceRefType, ServiceRefTypeSchema, type SetFileServiceStatusRQ, type SetFileStatusRQ, SetFileStatusValue, SetFileStatusValueSchema, ToServiceType, ToServiceTypeSchema, TypeDownloadFile, TypeDownloadFileSchema };
19356
- //# sourceMappingURL=index.d.mts.map
19355
+ export { type AccountPolicies, AvesClient, type AvesClientDeps, type AvesClientOptions, AvesError, type AvesSearchRQ, AvesSearchType, AvesSearchTypeSchema, AvesServiceType, AvesServiceTypeSchema, AvesTransport, BookedServiceStatus, BookedServiceStatusSchema, BookingClient, type BookingFileDetailRS, type BookingFileRQ, type BookingFileRS, BookingFileStatus, BookingFileStatusSchema, BookingFileStatusWire, BookingFileStatusWireSchema, type BookingStatusOnlyRS, type CancelFileRQ, CancelOperationType, CancelOperationTypeSchema, CarrierType, CarrierTypeSchema, type CommitPackageRQ, type CommitPackageRS, CostPriceType, CostPriceTypeSchema, CustomerPaymentType, CustomerPaymentTypeSchema, DestinationType, DestinationTypeSchema, DocumentType, DocumentTypeSchema, type DynamicFields, type FilePaymentListRQ, FilePaymentOperationType, FilePaymentOperationTypeSchema, type FinancialDetail, Gender, GenderSchema, GroupingPaxPolicy, GroupingPaxPolicySchema, type IdDocumentDetail, InsertCriteria, InsertCriteriaSchema, MakeDocumentTo, MakeDocumentToSchema, type ManageMasterRecordRS, type ManageMasterRecordRequest, MasterPaymentType, MasterPaymentTypeSchema, type MasterRecordDetail, type MasterRecordDetailResponse, MasterRecordsClient, type ModFileHeaderRQ, type ModFileServicesRQ, OptionedExpirePolicy, OptionedExpirePolicySchema, PackageCatalogClient, type PackageDetailRQ, type PackageDetailRS, PassengerCategory, PassengerCategorySchema, PaxQtyCriteria, PaxQtyCriteriaSchema, PaymentType, PaymentTypeSchema, RecordStatus, RecordStatusSchema, RecordType, RecordTypeSchema, type RqHeader, type RsStatus, RsStatusValue, RsStatusValueSchema, type SearchBookingFileRQ, type SearchBookingFileRS, SearchBookingFileType, SearchBookingFileTypeSchema, type SearchMasterRecord, type SearchMasterRecordRS, SearchMasterType, SearchMasterTypeSchema, type SearchPackageRS, type SearchServicesRS, ServiceRefType, ServiceRefTypeSchema, type SetFileServiceStatusRQ, type SetFileStatusRQ, SetFileStatusValue, SetFileStatusValueSchema, ToServiceType, ToServiceTypeSchema, TypeDownloadFile, TypeDownloadFileSchema };
package/dist/index.mjs CHANGED
@@ -1,2 +1 @@
1
- import*as e from"valibot";import{ValiError as t,parse as n,safeParse as r}from"valibot";import{request as i}from"undici";import a from"fast-xml-builder";import{XMLParser as o}from"fast-xml-parser";function s(t){return e.picklist(Object.values(t))}const c={M:`M`,F:`F`},l=s(c),u={OK:`OK`,ERROR:`ERROR`,WARNING:`WARNING`,TIMEOUT:`TIMEOUT`},ee=s(u),d={CODE:`CODE`,NAME:`NAME`,VATCODE:`VATCODE`,ZONE:`ZONE`,CATEGORY:`CATEGORY`,EMAIL:`EMAIL`,LASTMODDATE:`LASTMODDATE`,SEARCH_FIELD:`SEARCH_FIELD`,EXTERNAL_REF_CODE:`EXTERNAL_REF_CODE`},te=s(d),ne={CUSTOMER:`CUSTOMER`,SUPPLIER:`SUPPLIER`,VOUCHER:`VOUCHER`,SUPPLIER_VOUCHER:`SUPPLIER_VOUCHER`,GENERAL:`GENERAL`},re=s(ne),f={ENABLED:`ENABLED`,DISABLED:`DISABLED`,WARNING:`WARNING`,BLACKLISTED:`BLACKLISTED`},ie=s(f),ae={S:`S`,N:`N`,T:`T`,M:`M`},oe=s(ae),se={CASH:`CASH`,BANK:`BANK`,RID:`RID`,RIBA:`RIBA`,SPECIFIC_CODE:`SPECIFIC_CODE`},ce=s(se),le={NOT_SET:`NOT_SET`,FLIGHT:`FLIGHT`,SHIP:`SHIP`,TRAIN:`TRAIN`,RENTCAR:`RENTCAR`,BUS:`BUS`,DP_HOTEL:`DP_HOTEL`,TO_HOTEL:`TO_HOTEL`,TO_TOUR:`TO_TOUR`,TO_HOTEL_AND_TOUR:`TO_HOTEL_AND_TOUR`,DP_AUTO:`DP_AUTO`,DP_GDS_NAVI:`DP_GDS_NAVI`,DP_GDS_VOLI:`DP_GDS_VOLI`,TOUR_OPERATOR:`TOUR_OPERATOR`,TICKETING_EV:`TICKETING_EV`,OTHER:`OTHER`},ue=s(le),de={QUOTATION:`QUOTATION`,WORK_IN_PROGRESS:`WORK_IN_PROGRESS`,CONFIRMED:`CONFIRMED`,OPTIONED:`OPTIONED`,CANCELED:`CANCELED`},fe=s(de),pe={...de,NULLIFIED:`NULLIFIED`},me=s(pe),p={QUOTATION:`QUOTATION`,WORK_IN_PROGRESS:`WORK_IN_PROGRESS`,CONFIRM:`CONFIRM`,CONFIRMED:`CONFIRMED`,OPTION:`OPTION`,OPTIONED:`OPTIONED`,REQUEST:`REQUEST`,REQUESTED:`REQUESTED`,NULLIFIED:`NULLIFIED`,CANCELED:`CANCELED`},m=s(p),he={TOP:`TOP`,TOP_SS:`TOP_SS`,ADV:`ADV`,GRP:`GRP`,OTHER:`OTHER`},h=s(he),ge={ACCOMODATION:`ACCOMODATION`,TRANSPORT:`TRANSPORT`,CHARTER:`CHARTER`,TRANSFER:`TRANSFER`,PULLMAN:`PULLMAN`,FERRY:`FERRY`,CRUISE:`CRUISE`,INSURANCE:`INSURANCE`,EXTRAFEE:`EXTRAFEE`,PENALTY:`PENALTY`,PROMO:`PROMO`,OTHER:`OTHER`,NOT_SET:`NOT_SET`,RESIDENCE:`RESIDENCE`,TOUR:`TOUR`},g=s(ge),_e={REQUEST:`REQUEST`,ALLOTMENT_REQUEST:`ALLOTMENT_REQUEST`,CONFIRMED_REQUEST:`CONFIRMED_REQUEST`,CONFIRMED_EXTRA_ALLOTMENT:`CONFIRMED_EXTRA_ALLOTMENT`,WAITLISTED:`WAITLISTED`,ALLOTMENT:`ALLOTMENT`,REFUSED:`REFUSED`,NULLIFIED:`NULLIFIED`,CANCELED:`CANCELED`,MESSAGE:`MESSAGE`},ve=s(_e),ye={C:`C`,B:`B`,D:`D`,T:`T`,P:`P`,R:`R`,A:`A`,H:`H`,I:`I`,J:`J`,K:`K`,L:`L`,M:`M`,N:`N`,O:`O`,Q:`Q`,S:`S`,U:`U`,V:`V`},be=s(ye),xe={CASH:`CASH`,BANK:`BANK`,RID:`RID`,RIBA:`RIBA`,SPECIFIC_CODE:`SPECIFIC_CODE`,NOT_SET:`NOT_SET`},Se=s(xe),Ce={AD:`AD`,CH:`CH`,IN:`IN`,OV:`OV`},we=s(Ce),Te={NULLIFY:`NULLIFY`,DELETE:`DELETE`},Ee=s(Te),De={RPH:`RPH`,FILE:`FILE`},Oe=s(De),ke={NOT_SET:`NOT_SET`,CONSIDER_HOLIDAY:`CONSIDER_HOLIDAY`,CONSIDER_HOLIDAY_AND_SATURDAY:`CONSIDER_HOLIDAY_AND_SATURDAY`},Ae=s(ke),je={AbsoluteAmountsInsertion:`AbsoluteAmountsInsertion`,FinalAmountToAchieve:`FinalAmountToAchieve`,FinalAmountToAchieveWithoutControls:`FinalAmountToAchieveWithoutControls`},Me=s(je),Ne={VISA_REQUEST:`VISA_REQUEST`,TRAVEL_INFORMATION:`TRAVEL_INFORMATION`,VOUCHER:`VOUCHER`,BOOKING_CONTRACT:`BOOKING_CONTRACT`,BOOKING_CONFIRMATION:`BOOKING_CONFIRMATION`,SUPPLIER_SERVICE_LIST:`SUPPLIER_SERVICE_LIST`,INVOICE:`INVOICE`,PROFORMA_INVOICE:`PROFORMA_INVOICE`,ADEGUAMENTO:`ADEGUAMENTO`,RESERVATION_FORM:`RESERVATION_FORM`,OPEN_XML:`OPEN_XML`,SALES_INVOICE:`SALES_INVOICE`,TICKETING_TMASTER:`TICKETING_TMASTER`,SUMMARY_FORM:`SUMMARY_FORM`},Pe=s(Ne),Fe={BOOKING_CUSTOMER:`BOOKING_CUSTOMER`,FIRST_PASSENGER:`FIRST_PASSENGER`},Ie=s(Fe),Le={PAX_QTY_DAY:`PAX_QTY_DAY`,PAX_QTY_NIGHT:`PAX_QTY_NIGHT`,PAX_QTY_WEEK:`PAX_QTY_WEEK`,PAX_QTY:`PAX_QTY`,PAX_DAY:`PAX_DAY`,PAX_NIGHT:`PAX_NIGHT`,PAX_WEEK:`PAX_WEEK`,PAX:`PAX`,QTY_DAY:`QTY_DAY`,QTY_NIGHT:`QTY_NIGHT`,QTY_WEE:`QTY_WEE`,QTY:`QTY`,DAY:`DAY`,NIGHT:`NIGHT`,WEEK:`WEEK`,FORFAIT:`FORFAIT`},_=s(Le),Re={GROUPED_PAX:`GROUPED_PAX`,NOT_GROUPED_PAX:`NOT_GROUPED_PAX`,ONE_PAX_ONLY:`ONE_PAX_ONLY`},ze=s(Re),Be={AVES2AVES:`AVES2AVES`,AVES2AVESVIA:`AVES2AVESVIA`,AVES2AVESITA:`AVES2AVESITA`},Ve=s(Be),v={FILE_CODE:`FILE_CODE`,PAX_NAME:`PAX_NAME`,PACKAGE_CODE:`PACKAGE_CODE`,OTHER:`OTHER`},He=s(v),y={SERVICE:`SERVICE`,PROGRAM:`PROGRAM`,PACKAGE:`PACKAGE`},Ue=s(y),We={GREATER_THAN:`GREATER_THAN`,GREATER_OR_EQUAL:`GREATER_OR_EQUAL`,EQUAL_TO:`EQUAL_TO`,LESS_OR_EQUAL:`LESS_OR_EQUAL`,LESS_THAN:`LESS_THAN`},Ge=s(We),Ke={CODE:`CODE`,SUB_LOCALITY:`SUB_LOCALITY`,LOCALITY:`LOCALITY`,SUB_SUB_ISLAND:`SUB_SUB_ISLAND`,SUB_ISLAND:`SUB_ISLAND`,ISLAND_COUNTY:`ISLAND_COUNTY`,SUB_ARCHIPELAGO:`SUB_ARCHIPELAGO`,ARCHIPELAGO:`ARCHIPELAGO`,REGION_STATE:`REGION_STATE`,SUB_SUB_NATION:`SUB_SUB_NATION`,SUB_NATION:`SUB_NATION`,NATION:`NATION`,SUB_SUB_CONTINENT:`SUB_SUB_CONTINENT`,SUB_CONTINENT:`SUB_CONTINENT`,CONTINENT:`CONTINENT`},qe=s(Ke),Je=e.pipe(e.string(),e.minLength(2),e.maxLength(2)),b=e.optional(Je),x=e.union([e.string(),e.number()]),S=e.union([e.string(),e.number(),e.boolean()]),C=e.object({minDate:e.string(),maxDate:e.string()}),Ye=e.object({"@HostID":e.pipe(e.string(),e.minLength(6),e.maxLength(6)),"@Xtoken":e.string(),"@Interface":e.literal(`WEB`),"@UserName":e.literal(`WEB`),"@LanguageCode":b}),Xe=e.optional(e.string()),w=e.pipe(e.object({"@Status":ee,ErrorCode:e.optional(e.pipe(x,e.transform(e=>Number(e)))),ErrorDescription:e.optional(e.string()),Warnings:Xe}),e.transform(e=>({status:e[`@Status`],errorCode:e.ErrorCode,errorDescription:e.ErrorDescription,warnings:e.Warnings}))),Ze=D(e.object({RsStatus:w})),Qe={rph:`RPH`,toServiceType:`TOServiceType`,text:`#text`},$e=Object.fromEntries(Object.entries(Qe).map(([e,t])=>[t,e]));function et(e){return e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error}function tt(e){return Qe[e]??e.charAt(0).toUpperCase()+e.slice(1)}function nt(e){return $e[e]??e.charAt(0).toLowerCase()+e.slice(1)}function rt(e,t){let n=t?.textContent===e?`#text`:t?.rename?.[e]??tt(e);return n===`#text`||!t?.attrs?.includes(e)?n:t.preserveCamel?.includes(e)?`@${e}`:`@${n}`}function it(e){let{listWrap:t,detailKey:n,...r}=e;return r}function at(e,t){return t?.listWrap?{children:{[t.detailKey??(e.endsWith(`List`)?`${e.slice(0,-4)}Detail`:`${e}Detail`)]:it(t)}}:t}function ot(e,t){if(typeof e!=`object`||!e||et(e))return e;if(Array.isArray(e))return e.map(e=>ot(e,t));let n={};for(let[r,i]of Object.entries(e)){let e=t?.children?.[r];n[rt(r,t)]=ot(i,at(r,e))}return n}function st(e){if(typeof e!=`object`||!e||et(e))return e;if(Array.isArray(e))return e.map(e=>st(e));let t={};for(let[n,r]of Object.entries(e)){let e=n.startsWith(`@`)?n.slice(1):n;t[nt(e)]=st(r)}return t}const ct={financialDeadlineList:`deadlineDetail`};function lt(e,t){return t?.detailKey??ct[e]??(e.endsWith(`List`)?`${e.slice(0,-4)}Detail`:`${e}Detail`)}function ut(e,t){let n=(e,t)=>{if(Array.isArray(e))return e.map(e=>n(e,t));if(typeof e!=`object`||!e)return e;let r={};for(let[i,a]of Object.entries(e)){let e=t?.children?.[i];if(e?.listWrap&&Array.isArray(a)){let t=lt(i,e),o=a.map(t=>n(t,it(e)));r[i]=e.listWrap===`one`?o.map(e=>({[t]:e})):{[t]:o};continue}r[i]=n(a,e)}return r};return n(e,t)}function dt(e){let t=e=>{if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n={};for(let[r,i]of Object.entries(e)){if(r===`paxAssociated`&&Array.isArray(i)){if(!i.length){n[r]=``;continue}if(i.every(e=>typeof e==`string`)){n[r]=i.map(e=>({pax:e}));continue}}n[r]=t(i)}return n};return t(e)}function ft(e,t){return ot(dt(ut(e,t)),t)}function T(t,n){return e.pipe(t,e.transform(e=>ft(e,n)))}function pt(t){return e.pipe(e.union([e.array(t),t]),e.transform(e=>Array.isArray(e)?e:[e]))}function E(t,n){let r=e.optional(pt(n));return e.pipe(e.object({[t]:r}),e.transform(e=>e[t]??[]))}function D(t){return e.pipe(t,e.transform(e=>st(e)))}function O(t,n){let r={[t]:e.optional(n)};return D(e.object({RsStatus:w,...r}))}function mt(e){return t=>{if(typeof t!=`object`||!t)return t;let n=t,r=n[e],{[e]:i,...a}=n;return!r||typeof r!=`object`||Array.isArray(r)?a:{...a,...r}}}function ht(t,n){return e.pipe(D(t),e.transform(e=>mt(n)(e)))}function k(t,n){let r=e.object({value:t,...n??{}});return e.pipe(e.union([t,r]),e.transform(e=>typeof e==`object`&&e?e:{value:e}))}function gt(e,t){return n=>{let r=Reflect.get(n,e),i=Reflect.get(n,t),a={...n};return Reflect.deleteProperty(a,e),Reflect.set(a,t,i??(Array.isArray(r)?r[0]:void 0)),a}}function _t(e){let{customerRecordCode:t,customerDetail:n,...r}=e;return{...r,customerDetail:{...n,recordCode:n?.recordCode??t}}}function vt(e){return e.type===`object`&&`entries`in e}function yt(e){return e.type===`optional`&&`wrapped`in e}function bt(e){return e.type===`array`&&`item`in e}function A(t,n){if(yt(t)){let r=A(t.wrapped,n);return t.default===void 0?e.optional(r):e.optional(r,t.default)}return bt(t)?pt(A(t.item,n)):vt(t)?xt(t,n):t}function xt(t,n,r){let i={};for(let e in t.entries){let r=n.children?.[e]??{};i[rt(e,n)]=A(t.entries[e],r)}return e.object({...i,...r})}function j(e,t={},n){return xt(e,t,n)}function M(e,t){let n={...e};for(let[e,r]of Object.entries(t)){let t;for(let e of r)if(n[e]!==void 0&&n[e]!==null){t=n[e];break}for(let t of r)t!==e&&delete n[t];t===void 0?delete n[e]:n[e]=t}return n}function N(e,t){return{api:T(e,t),validation:j(e,t)}}function P(e){return e}function F(...e){return P({attrs:e})}function St(...e){return P({attrs:e,preserveCamel:e})}function Ct(e,t){return P({attrs:e,preserveCamel:t})}function I(e){return P({children:e})}function L(e,t){return P({attrs:e,children:t})}function R(e,t,n){return P(n?{...e,listWrap:t,detailKey:n}:{...e,listWrap:t})}function z(e,...t){return R(F(...t),e)}function wt(e){return{one:R(e,`one`),many:R(e,`many`)}}F(`hostID`,`xtoken`,`interface`,`userName`,`status`,`languageCode`);const Tt=F(`currencyCode`,`creditLimit`,`c_PaymentType`,`c_SpecPaymentTypeCode`,`s_PaymentType`,`s_SpecPaymentTypeCode`,`enableElectronicInvoicing`,`electronicInvoicingType`),Et=F(`idType`,`idCode`,`idIssueLocation`,`idIssueCounty`,`idIssueDate`,`idExpireDate`),Dt=F(`acceptProfilingPolicies`,`acceptPrivacyPolicies`,`acceptNewsletterPolicies`),Ot=F(`key`,`value`),kt=F(`supplierRefCode`,`companyMainBusinessType`,`carrierType`),At=L([`recordCode`,`insertCriteria`],{financialDetail:Tt,idDocumentDetail:Et,accountPolicies:Dt,dynamicFields:Ot,supplierRefMasterRecords:kt}),B=F(`minDate`,`maxDate`),jt=I({lastModificationDate:B}),Mt=St(`sCode1`,`sCode2`,`sCode3`,`sCode4`,`sCode5`,`sCode6`),Nt=F(`code`,`iataCode`,`nationCode`,`type`),Pt=F(`nType`,`title`),Ft=R(Pt,`many`),It=L([`rph`,`roomRph`,`billingHolder`],{notes:R(Pt,`many`,`noteDetail`),idDocInfo:Et}),Lt=F(`currencyCode`,`exchangeRate`,`cost`,`costTax`,`costType`,`vatCostCurrencyCode`,`price`,`priceTax`,`priceType`),Rt=Ct([`pCode`,`startDate`,`endDate`,`getServicesFromPackage`],[`pCode`]),V=wt(P({...Ct([`sCode`,`ssCode`],[`sCode`,`ssCode`]),children:{serviceFare:Lt,avesServiceInfo:I({serviceFare:Lt}),noteList:Ft}})),H=wt(It);H.one,H.many;const zt=R(Rt,`many`),Bt=z(`many`,`deadlineCode`,`description`,`expireDate`),Vt=z(`many`,`reschedulingCode`,`description`,`expireDate`),Ht=R(F(`reschedulingCode`,`expireDate`,`totalAmount`),`many`,`deadlineDetail`),Ut=R(P({...F(`paymentDate`,`paymentNote`,`amount`,`paymentUser`,`paymentType`),rename:{paymentNote:`PaumentNote`}}),`many`),Wt=z(`many`,`paymentDate`,`paymentNote`,`payerMasterCode`,`payerName`,`amount`,`paymentType`),Gt=z(`many`,`cancelOperationType`,`serviceRefType`,`serviceRefValue`),Kt=L([`printDoc`,`sendDocViaEmail`],{infoDocumentsToPrint:I({documentCustomizablePrintParameters:F(`makeDocumentTo`,`fillInCode`)})}),qt=F(`value`,`expiredDate`),Jt=F(`recordCode`),Yt=F(`customer_PaymentType`,`customer_SpecPaymentTypeCode`),Xt=F(`getAllDeptDate`,`getFlightPlan`,`getAllAccomodation`,`getRealAvailability`),Zt=F(`compatibleAccomodation`,`alternativeAccomodation`),Qt=z(`many`,`code`,`name`),$t=F(`value`,`expiredDate`,`optionedFileExpireDatePolicy`),en=F(`apply`,`specificCode`),tn={customerDetail:Jt,bookingFileStatus:qt,statisticCodes:Mt,destination:Nt,bookingFileDocument:Kt,bookingFinancialInfo:Yt,selectedPackageDetail:Rt,selectedPackageList:zt,financialDeadlineList:Ht,paymentList:Ut,cancellableBookedServiceList:Gt,noteList:Ft},nn=I({...tn,deadlineList:Bt,selectedServiceList:V.one,extraQuoteServiceList:V.one,passengerList:H.one}),rn=I({...tn,deadlineList:Vt,selectedServiceList:V.many,extraQuoteServiceList:V.many,passengerList:H.many}),an=L([`paymentUser`],{filePaymentList:Wt}),on=I({fileStatus:F(`value`,`expireDate`),startDate:B,createdDate:B,lastModificationDate:B,insurance:F(`code`,`number`)}),sn=I({statisticCodes:Mt,selectedServiceList:R(F(`serviceCode`,`packageRow`),`many`),passengerList:H.many}),cn=I({passengerList:H.many}),ln=I({destination:Nt,statisticCodes:Mt,packageParams:Xt,topServiceParams:Zt,featureList:Qt}),un=I({fileStatus:$t,penalty:en,bookingFileDocument:Kt}),dn=P({}),U=e.union([e.literal(`true`),e.literal(`false`),e.boolean()]),fn={[p.CONFIRM]:`CONFIRMED`,[p.OPTION]:`OPTIONED`,[p.REQUESTED]:`REQUEST`};function pn(e){return e in fn?fn[e]:e}const mn=e.pipe(e.object({"@Value":m,"@ExpiredDate":e.optional(e.string()),"@ExpireDate":e.optional(e.string())}),e.transform(e=>({...M(e,{"@ExpiredDate":[`@ExpiredDate`,`@ExpireDate`]}),"@Value":pn(e[`@Value`])}))),hn=E(`PricePerPaxDetail`,e.object({"@PaxRef":e.string(),"@Price":x})),gn=e.object({"@CommissionCode":e.optional(e.string()),"@CommissionPercentage":e.optional(x),"@CommissionAmount":e.optional(x),"@PriceListCode":e.optional(e.string()),"@CostListCode":e.optional(e.string()),"@ServiceTotalPrice":e.optional(x),PaxPriceList:e.optional(hn)}),_n=e.object({"@Code":e.optional(e.string()),"@Name":e.optional(e.string()),"@Email":e.optional(e.string()),"@LanguageCode":e.optional(e.string())}),vn=e.object({"@Code":e.optional(e.string()),"@Description":e.optional(e.string())}),yn=e.object({"@RPH":e.string(),"@ServiceCode":e.optional(e.string()),"@FromExternalProvider":e.optional(x),"@isFromExternalProvider":e.optional(x),AvesServiceType:e.optional(h),TOServiceType:e.optional(g),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),ThirdDescription:e.optional(e.string()),FourthDescription:e.optional(e.string()),ServiceStatus:e.optional(ve),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),Qty:e.optional(x),Pax:e.optional(x),PeriodType:e.optional(e.string()),PaxMultiplier:e.optional(e.string()),ExternalProviderCode:e.optional(e.string()),WebStatisticCode:e.optional(e.string()),WebStatisticDescription:e.optional(e.string()),WebStatistic:e.optional(vn),SupplierInfo:e.optional(_n),ServiceTotalAmountDetail:e.optional(gn)}),bn=E(`BookedServiceDetail`,e.pipe(yn,e.transform(e=>M(e,{"@FromExternalProvider":[`@FromExternalProvider`,`@isFromExternalProvider`]})))),xn=e.object({"@CurrencyCode":e.optional(e.string()),"@TotalAmountBeforeDiscount":e.optional(x),"@TotalAmountAfterDiscount":e.optional(x),"@TotalDiscount":e.optional(x),"@TotalAmountWithoutVat":e.optional(x),"@DueAmount":e.optional(x),"@PaiedAmount":e.optional(x),"@Balance":e.optional(x)}),Sn=E(`PassengerDetail`,e.object({"@RPH":e.string(),"@RoomRPH":e.optional(e.string()),"@BillingHolder":e.optional(x),Name:e.optional(e.string()),CategoryCode:e.optional(e.string()),Sex:e.optional(e.string()),BirthDate:e.optional(e.string()),BirthPlace:e.optional(e.string()),NationCode:e.optional(e.string()),CitizenshipCode:e.optional(e.string()),FiscalCode:e.optional(e.string()),PhoneNumber:e.optional(e.string()),EMail:e.optional(e.string()),MasterRecordCode:e.optional(e.string())})),Cn=e.object({"@ReschedulingCode":e.optional(e.string()),"@ExpireDate":e.optional(e.string()),"@TotalAmount":e.optional(x),ReschedulingCode:e.optional(e.string()),ExpireDate:e.optional(e.string()),TotalAmount:e.optional(x)}),wn=E(`DeadlineDetail`,e.pipe(Cn,e.transform(e=>M(e,{"@ReschedulingCode":[`@ReschedulingCode`,`ReschedulingCode`],"@ExpireDate":[`@ExpireDate`,`ExpireDate`],"@TotalAmount":[`@TotalAmount`,`TotalAmount`]})))),Tn=E(`StoredDocumentDetail`,e.object({DocumentRefCode:e.optional(e.string()),DocumentType:e.optional(e.string()),DocumentName:e.optional(e.string()),ArchiviationDescription:e.optional(e.string())})),En=E(`PrintableDocumentDetail`,e.object({DocumentType:e.optional(e.string()),DocumentName:e.optional(e.string()),Enabled:e.optional(x)})),Dn=e.object({"@BookingFileCode":e.optional(e.string()),BookingFileCode:e.optional(e.string()),CustomerRecordCode:e.optional(e.string()),CustomerName:e.optional(e.string()),CustomerEmail:e.optional(e.string()),TravelAgencyName:e.optional(e.string()),TravelAgencyEmail:e.optional(e.string()),BookingFileStatus:e.optional(mn),Description:e.optional(e.string()),Nation:e.optional(e.string()),Destination:e.optional(e.string()),CreationDate:e.optional(e.string()),FirstConfirmationDate:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),PackageCode:e.optional(e.string()),BookedServiceList:e.optional(bn),TotalAmountDetail:e.optional(xn),PaxNumber:e.optional(x),PassengerList:e.optional(Sn),Reference:e.optional(e.string()),ClerkName:e.optional(e.string()),StoredDocumentsList:e.optional(Tn),PrintableDocumentsList:e.optional(En),FinancialDeadlineList:e.optional(wn)}),On=e.pipe(Dn,e.transform(e=>M(e,{"@BookingFileCode":[`@BookingFileCode`,`BookingFileCode`]}))),kn=e.object({currencyCode:e.optional(e.string()),creditLimit:e.optional(e.string()),c_PaymentType:e.optional(ce),c_SpecPaymentTypeCode:e.optional(e.string()),s_PaymentType:e.optional(ce),s_SpecPaymentTypeCode:e.optional(e.string()),enableElectronicInvoicing:e.optional(U),electronicInvoicingType:e.optional(e.string())}),An=N(kn,Tt);An.api,An.validation;const jn=e.object({idType:e.optional(e.string()),idCode:e.optional(e.string()),idIssueLocation:e.optional(e.string()),idIssueCounty:e.optional(e.string()),idIssueDate:e.optional(e.string()),idExpireDate:e.optional(e.string())}),Mn=N(jn,Et);Mn.api,Mn.validation;const Nn=e.object({key:e.string(),value:e.string()});j(Nn,Ot);const Pn=e.object({supplierRefCode:e.optional(e.string()),companyMainBusinessType:e.optional(e.string()),carrierType:e.optional(ue)}),Fn=N(Pn,kt);Fn.api,Fn.validation;const In=e.union([e.literal(0),e.literal(1)]),Ln=e.object({acceptProfilingPolicies:e.optional(In),acceptPrivacyPolicies:e.optional(In),acceptNewsletterPolicies:e.optional(In)}),Rn=N(Ln,Dt);Rn.api,Rn.validation;const zn=e.object({recordCode:e.optional(e.pipe(e.string(),e.minLength(6),e.maxLength(6))),insertCriteria:e.optional(oe),createdDate:e.optional(e.string()),recordType:e.optional(re,ne.CUSTOMER),recordStatus:e.optional(ie,f.ENABLED),moniker:e.optional(e.string()),name:e.optional(e.string()),extraInfo:e.optional(e.string()),languageCode:Je,address:e.optional(e.string()),zipCode:e.optional(e.string()),cityName:e.optional(e.string()),countyCode:e.optional(e.string()),stateCode:e.optional(e.string()),categoryCode:e.optional(e.string()),firstPhoneNumber:e.optional(e.string()),mobilePhoneNumber:e.optional(e.string()),email:e.optional(e.string()),gender:e.optional(l),birthDate:e.optional(e.string()),birthCity:e.optional(e.string()),birthCounty:e.optional(e.string()),fiscalCode:e.optional(e.string()),vatCode:e.optional(e.string()),thirdPartRecordCode:e.optional(e.string()),idDocumentDetail:e.optional(jn),accountPolicies:e.optional(Ln),financialDetail:e.optional(kn),dynamicFields:e.optional(e.array(Nn)),supplierRefMasterRecords:e.optional(Pn)}),Bn=T(zn,At),W=e.partial(j(zn,At,{ModifiedDate:e.optional(e.string()),LoginType:e.optional(e.string()),PromoterCode:e.optional(e.string()),EncryptedPassword:e.optional(U),NewsletterDisabled:e.optional(U)}));D(W);const Vn=k(fe,{expiredDate:e.optional(e.string())}),G=e.object({sCode1:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode2:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode3:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode4:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode5:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode6:e.optional(e.pipe(e.string(),e.maxLength(4)))}),Hn=e.object({code:e.optional(e.string()),iataCode:e.optional(e.string()),nationCode:e.optional(e.string()),type:e.optional(qe)}),Un=e.object({recordCode:e.optional(e.string())}),Wn=e.object({makeDocumentTo:e.optional(Ie)}),Gn=e.object({fillInCode:e.optional(e.string())}),Kn=e.union([Wn,Gn]),qn=e.object({documentType:Pe,documentCustomizablePrintParameters:e.optional(Kn)}),Jn=e.object({printDoc:e.optional(U),sendDocViaEmail:e.optional(U),infoDocumentsToPrint:e.optional(e.array(qn))}),Yn=e.object({reschedulingCode:e.optional(e.string()),expireDate:e.optional(e.string()),totalAmount:e.optional(e.string())}),Xn=e.object({deadlineCode:e.optional(e.string()),description:e.optional(e.string()),expireDate:e.optional(e.string())}),Zn=e.object({paymentDate:e.optional(e.string()),paymentNote:e.optional(e.string()),amount:e.optional(e.string()),paymentUser:e.optional(e.string()),paymentType:e.optional(be)}),Qn=e.object({nType:e.optional(e.string()),title:e.optional(e.string()),text:e.optional(e.string())}),$n=e.object({currencyCode:e.optional(e.string()),exchangeRate:e.optional(e.string()),cost:e.optional(e.string()),costTax:e.optional(e.string()),costType:e.optional(_),vatCostCurrencyCode:e.optional(e.string()),price:e.optional(e.string()),priceTax:e.optional(e.string()),priceType:e.optional(_)}),er=e.object({packageCode:e.optional(e.string()),packageReference:e.optional(e.string()),suballotmentCode:e.optional(e.string()),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),externalFileCode:e.optional(e.string()),externalReference:e.optional(e.string()),serviceStatus:e.optional(e.string()),serviceStatisticCode:e.optional(e.string()),serviceFare:e.optional($n)}),tr=e.object({sCode:e.string(),ssCode:e.optional(e.string()),avesServiceType:h,toServiceType:e.optional(g),subServiceDesc:e.optional(e.string()),startDate:e.string(),endDate:e.string(),qty:e.string(),pax:e.string(),paxAssociated:e.optional(e.union([e.array(e.string()),e.array(e.object({pax:e.string()}))])),avesSession:e.string(),avesServiceInfo:e.optional(er),serviceFare:e.optional($n),bookedServiceRef:e.optional(e.string()),supplierMasterCode:e.optional(e.string()),voucherMasterCode:e.optional(e.string()),hotelServiceInfo:e.optional(e.string()),carRentalServiceInfo:e.optional(e.string()),flightServiceInfo:e.optional(e.string()),shipServiceInfo:e.optional(e.string()),ticketServiceInfo:e.optional(e.string()),commission:e.optional(e.string()),noteList:e.optional(e.array(Qn)),voucherInfo:e.optional(e.string()),firstDescription:e.optional(e.string()),secondDescription:e.optional(e.string())}),nr=e.object({pCode:e.string(),startDate:e.string(),endDate:e.string(),getServicesFromPackage:e.optional(U)}),rr={rph:e.string(),roomRph:e.optional(e.string()),billingHolder:e.optional(U),masterRecordCode:e.optional(e.string()),name:e.string(),sex:l,birthDate:e.optional(e.string()),birthPlace:e.optional(e.string()),nationCode:e.optional(e.string()),citizenshipCode:e.optional(e.string()),fiscalCode:e.optional(e.string()),phoneNumber:e.optional(e.string()),eMail:e.optional(e.string()),notes:e.optional(e.array(Qn)),flagStatus:e.optional(e.string()),offerCode:e.optional(e.string()),idDocInfo:e.optional(jn)},ir=e.object({...rr,categoryCode:we}),ar=e.object({...rr,categoryCode:e.optional(we)}),or=e.object({customer_PaymentType:e.optional(Se),customer_SpecPaymentTypeCode:e.optional(e.string())}),sr=T(e.pipe(e.object({createDate:e.optional(e.string()),bookingFileRefCode:e.optional(e.string()),travelAgentCode:e.optional(e.string()),clerkName:e.optional(e.string()),customerDetail:e.optional(Un),customerRecordCode:e.optional(e.string()),currencyCode:e.optional(e.string()),markupCode:e.optional(e.string()),bookingFileStatus:Vn,statisticCodes:e.optional(G),destination:e.optional(Hn),bookingFileDescription:e.optional(e.string()),startDate:e.string(),endDate:e.string(),earlyBookingDate:e.optional(e.string()),cupCode:e.optional(e.string()),cigCode:e.optional(e.string()),customerPromoterCode:e.optional(e.string()),billingReferenceCode:e.optional(e.string()),paymentReferenceCode:e.optional(e.string()),bookingFileDocument:e.optional(Jn),financialDeadlineList:e.optional(e.array(Yn)),deadlineList:e.optional(e.array(Xn)),paymentList:e.optional(e.array(Zn)),selectedPackageList:e.optional(e.array(nr)),selectedServiceList:e.array(tr),extraQuotaRefCode:e.optional(e.string()),extraQuoteServiceList:e.optional(e.array(tr)),getExtraQuoteFromSystem:e.optional(U),passengerList:e.array(ir),noteList:e.optional(e.array(Qn)),bookingFinancialInfo:e.optional(or),bookingFileCode:e.optional(e.string()),groupingPaxPolicy:e.optional(ze),groupBookingFile:e.optional(U),typeDownloadFile:e.optional(Ve),setBookingFileCodeFromStartDate:e.optional(U)}),e.check(e=>!!(e.customerDetail||e.customerRecordCode),`customerDetail or customerRecordCode is required`),e.transform(_t)),nn),cr=ht(e.object({RsStatus:w,BookingFileDetail:e.optional(On),PrintableDocumentsList:e.optional(En),TotalAmountDetailAfterCancellation:e.optional(xn),Base64DocContent:e.optional(e.string())}),`bookingFileDetail`),lr=Ze,K={customerRecordCode:e.string(),bookingFileCode:e.string()},ur=cr,dr=e.object({reschedulingCode:e.string(),description:e.optional(e.string()),expireDate:e.optional(e.string())}),fr=e.object({cancelOperationType:Ee,serviceRefType:Oe,serviceRefValue:e.string()}),pr=T(e.pipe(e.object({...K,currencyCode:e.optional(e.string()),deadlineList:e.optional(e.array(dr)),selectedPackageDetail:e.optional(nr),selectedPackageList:e.optional(e.pipe(e.array(nr),e.maxLength(1))),selectedServiceList:e.pipe(e.array(tr),e.minLength(1)),cancellableBookedServiceList:e.optional(e.array(fr)),passengerList:e.optional(e.array(ar))}),e.transform(gt(`selectedPackageList`,`selectedPackageDetail`))),rn),mr=T(e.object({...K,bookingFileStartDate:e.string(),newCustomerRecordCode:e.optional(e.string()),bookingFileReferenceName:e.optional(e.string()),travelAgentCode:e.optional(e.string()),billingReferenceCode:e.optional(e.string()),paymentReferenceCode:e.optional(e.string()),cupCode:e.optional(e.string()),cigCode:e.optional(e.string()),customerPromoterCode:e.optional(e.string()),bookingNote:e.optional(e.string()),passengerList:e.optional(e.array(ar)),statisticCodes:e.optional(G),bookingFinancialInfo:e.optional(or),financialDeadlineList:e.optional(e.array(e.object({reschedulingCode:e.string(),expireDate:e.string(),totalAmount:e.string()})))}),rn),hr=T(e.object({...K}),dn),gr=T(e.object({...K,fileStatus:k(me,{expiredDate:e.optional(e.string()),optionedFileExpireDatePolicy:e.optional(Ae)}),backOfficeRequest:e.optional(U),bookingFileDocument:e.optional(Jn),penalty:e.optional(e.object({apply:e.optional(U),specificCode:e.optional(e.string())})),simulateCancelAndGetPenaltyAmount:e.optional(U)}),un),_r=T(e.object({...K,bookingServiceRef:e.string(),bookingFileServiceStatus:e.literal(`NULLIFIED`),bookingFileServiceStatusDate:e.optional(e.string())}),dn),vr=e.object({paymentDate:e.string(),paymentNote:e.optional(e.string()),payerMasterCode:e.optional(e.string()),payerName:e.optional(e.string()),amount:e.string(),paymentType:be}),yr=T(e.pipe(e.object({bookingFileCode:e.optional(e.string()),bookingFileRefCode:e.optional(e.string()),paymentUser:e.optional(e.string()),enableMultiplePayments:U,operationType:Me,filePaymentList:e.pipe(e.array(vr),e.minLength(1))}),e.check(e=>!!(e.bookingFileCode||e.bookingFileRefCode),`bookingFileCode or bookingFileRefCode is required`)),an),br=k(m,{expireDate:e.optional(e.string())}),xr=e.object({code:e.optional(e.string()),number:e.optional(e.string())}),q={customerRecordCode:e.string(),customerPromoterCode:e.optional(e.string()),getSupplierInfo:e.optional(U),user:e.optional(e.string()),officeCode:e.optional(e.string())},Sr=e.object({...q,searchType:e.literal(v.FILE_CODE),bookingFileCode:e.string()}),Cr=e.object({...q,searchType:e.literal(v.PAX_NAME),firstPaxName:e.string()}),wr=e.object({...q,searchType:e.literal(v.PACKAGE_CODE),packageCode:e.string()}),Tr=e.object({...q,searchType:e.literal(v.OTHER),fileStatus:e.optional(br),startDate:e.optional(C),createdDate:e.optional(C),lastModificationDate:e.optional(C),insurance:e.optional(xr),isSearchForB2C:e.optional(U)}),Er=T(e.union([Sr,Cr,wr,Tr]),on),Dr=O(`BookingFileList`,E(`BookingFileDetail`,On)),J={SEARCH_REQUEST:`SearchMasterRecordRQ`,SEARCH_RESPONSE:`SearchMasterRecordRS`,UPSERT_REQUEST:`ManageMasterRecordRQ`,UPSERT_RESPONSE:`ManageMasterRecordRS`,BOOKING_REQUEST:`BookFileRQ`,BOOKING_RESPONSE:`BookingFileRS`,MOD_FILE_SERVICES_REQUEST:`ModFileServicesRQ`,MOD_FILE_HEADER_REQUEST:`ModFileHeaderRQ`,MOD_FILE_HEADER_RESPONSE:`ModFileHeaderRS`,CANCEL_FILE_REQUEST:`CancelFileRQ`,CANCEL_FILE_RESPONSE:`CancelFileRS`,SET_STATUS_REQUEST:`SetStatusRQ`,SET_STATUS_RESPONSE:`SetStatusRS`,SET_STATUS_SERVICE_REQUEST:`SetStatusServiceRQ`,SET_STATUS_SERVICE_RESPONSE:`SetStatusServiceRS`,FILE_PAYMENT_LIST_REQUEST:`FilePaymentListRQ`,FILE_PAYMENT_LIST_RESPONSE:`FilePaymentListRS`,AVES_SEARCH_REQUEST:`AvesSearchRQ`,SEARCH_PACKAGE_RESPONSE:`SearchPackageRS`,SEARCH_SERVICES_RESPONSE:`SearchServicesRS`,PACKAGE_DETAIL_REQUEST:`PackageDetailRQ`,PACKAGE_DETAIL_RESPONSE:`PackageDetailRS`,COMMIT_PACKAGE_REQUEST:`CommitPackRQ`,COMMIT_PACKAGE_RESPONSE:`CommitPackRS`,SEARCH_BOOKING_FILE_REQUEST:`SearchFileRQ`,SEARCH_BOOKING_FILE_RESPONSE:`SearchFileRS`};function Or(e,t){return{[e]:t}}const Y={search:`/interop/masterRecords/v2/rest/Search`,upsert:`/interop/masterRecords/v2/rest/InsertOrUpdate`,createBooking:`/interop/booking/v2/rest/CreateBookingFile`,modBookingServices:`/interop/booking/v2/rest/ModBookingFileServices`,modBookingHeader:`/interop/booking/v2/rest/ModBookingFileHeader`,cancelBooking:`/interop/booking/v2/rest/CancelBookingFile`,setBookingStatus:`/interop/booking/v2/rest/SetBookingFileStatus`,setBookingServiceStatus:`/interop/booking/v2/rest/SetBookingFileServiceStatus`,insertFilePaymentList:`/interop/booking/v2/rest/InsertFilePaymentList`,searchAvesPackages:`/interop/booking/v2/rest/SearchAvesPackages`,searchTopServices:`/interop/booking/v2/rest/SearchTopServices`,getPackageDetail:`/interop/booking/v2/rest/GetPackageDetail`,commitPackage:`/interop/booking/v2/rest/CommitPackage`,searchBookingFile:`/interop/booking/v2/rest/SearchBookingFile`};var kr=class{transport;constructor(e){this.transport=e}createBooking(e){return this.transport.invokeOp({op:`createBooking`,params:e,apiSchema:sr,endpoint:Y.createBooking,requestRoot:J.BOOKING_REQUEST,responseRoot:J.BOOKING_RESPONSE,responseSchema:cr})}modBookingServices(e){return this.transport.invokeOp({op:`modBookingServices`,params:e,apiSchema:pr,endpoint:Y.modBookingServices,requestRoot:J.MOD_FILE_SERVICES_REQUEST,responseRoot:J.BOOKING_RESPONSE,responseSchema:ur})}modBookingHeader(e){return this.transport.invokeOp({op:`modBookingHeader`,params:e,apiSchema:mr,endpoint:Y.modBookingHeader,requestRoot:J.MOD_FILE_HEADER_REQUEST,responseRoot:J.MOD_FILE_HEADER_RESPONSE,responseSchema:lr})}cancelBooking(e){return this.transport.invokeOp({op:`cancelBooking`,params:e,apiSchema:hr,endpoint:Y.cancelBooking,requestRoot:J.CANCEL_FILE_REQUEST,responseRoot:J.CANCEL_FILE_RESPONSE,responseSchema:lr})}setBookingStatus(e){return this.transport.invokeOp({op:`setBookingStatus`,params:e,apiSchema:gr,endpoint:Y.setBookingStatus,requestRoot:J.SET_STATUS_REQUEST,responseRoot:J.SET_STATUS_RESPONSE,responseSchema:ur})}setBookingServiceStatus(e){return this.transport.invokeOp({op:`setBookingServiceStatus`,params:e,apiSchema:_r,endpoint:Y.setBookingServiceStatus,requestRoot:J.SET_STATUS_SERVICE_REQUEST,responseRoot:J.SET_STATUS_SERVICE_RESPONSE,responseSchema:ur})}insertFilePaymentList(e){return this.transport.invokeOp({op:`insertFilePaymentList`,params:e,apiSchema:yr,endpoint:Y.insertFilePaymentList,requestRoot:J.FILE_PAYMENT_LIST_REQUEST,responseRoot:J.FILE_PAYMENT_LIST_RESPONSE,responseSchema:lr})}searchBookingFiles(e){return this.transport.invokeOp({op:`searchBookingFiles`,params:e,apiSchema:Er,endpoint:Y.searchBookingFile,requestRoot:J.SEARCH_BOOKING_FILE_REQUEST,responseRoot:J.SEARCH_BOOKING_FILE_RESPONSE,responseSchema:Dr})}};const Ar=C,X=b,jr=e.object({searchType:e.literal(d.CODE),recordCode:e.pipe(e.string(),e.minLength(5),e.maxLength(6)),languageCode:X}),Mr=e.object({searchType:e.literal(d.NAME),name:e.string(),city:e.optional(e.string()),languageCode:X}),Nr=e.object({searchType:e.literal(d.VATCODE),vatCode:e.string(),phoneNumber:e.optional(e.string()),languageCode:X}),Pr=e.object({searchType:e.literal(d.ZONE),zipCode:e.string(),countyCode:e.string(),city:e.optional(e.string()),languageCode:X}),Fr=e.object({searchType:e.literal(d.CATEGORY),categoryCode:e.string(),languageCode:X}),Ir=e.object({searchType:e.literal(d.EMAIL),email:e.string(),languageCode:X}),Lr=e.object({searchType:e.literal(d.LASTMODDATE),lastModificationDate:Ar,languageCode:X}),Rr=e.object({searchType:e.literal(d.SEARCH_FIELD),searchFieldValue:e.string(),languageCode:X}),zr=e.object({searchType:e.literal(d.EXTERNAL_REF_CODE),searchFieldValue:e.string(),languageCode:X}),Br=T(e.union([jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr]),jt);e.pipe(e.object({RqHeader:Ye,SearchMasterRecord:Br}),e.transform(e=>{let{SearchMasterRecord:t,RqHeader:n,...r}=e;return{RqHeader:n,...t,...r}}));const Vr=O(`MasterRecordList`,E(`MasterRecordDetail`,W));e.object({RqHeader:Ye,MasterRecordDetail:W});const Hr=ht(e.object({RsStatus:w,MasterRecordDetail:e.optional(W)}),`masterRecordDetail`);var Ur=class{transport;constructor(e){this.transport=e}search(e){return this.transport.invokeOp({op:`search`,params:e,apiSchema:Br,endpoint:Y.search,requestRoot:J.SEARCH_REQUEST,responseRoot:J.SEARCH_RESPONSE,responseSchema:Vr})}upsertRecord(e){return this.transport.invokeOp({op:`upsertRecord`,params:e,apiSchema:Bn,bodyKey:`MasterRecordDetail`,endpoint:Y.upsert,requestRoot:J.UPSERT_REQUEST,responseRoot:J.UPSERT_RESPONSE,responseSchema:Hr})}};const Wr=E(`FeatureDetail`,e.object({"@Code":e.optional(e.string()),"@Name":e.optional(e.string()),ValueCode:e.optional(e.string()),ValueName:e.optional(e.string())})),Gr=e.object({"@PackageCode":e.optional(e.string()),"@PackageReference":e.optional(e.string()),"@PackageServiceType":e.optional(e.string()),"@ServiceCodeForPackageDetail":e.optional(e.string())}),Kr=E(`SubServiceDetail`,e.object({"@ssCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SubServiceType:e.optional(e.string()),SubServiceLevel:e.optional(S),StartDate:e.optional(e.string()),EndDate:e.optional(e.string())})),qr=E(`ServiceDetail`,e.object({"@sCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),AvesServiceType:e.optional(e.string()),TOServiceType:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),RefPackageInfo:e.optional(Gr),SubServiceList:e.optional(Kr)})),Jr=e.object({"@pCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),FrequencyType:e.optional(e.string()),ProgramType:e.optional(e.string()),StartValidation:e.optional(e.string()),EndValidation:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),BasePrice:e.optional(S),BasePax:e.optional(S),CanCommitPack:e.optional(S),FeatureList:e.optional(Wr),ServiceList:e.optional(qr)}),Yr=E(`PackageDetail`,Jr),Xr=e.object({code:e.string(),name:e.optional(e.string())}),Zr=e.object({getAllDeptDate:e.optional(U),getFlightPlan:e.optional(U),getAllAccomodation:e.optional(U),getRealAvailability:e.optional(U),minStay:e.optional(x),maxStay:e.optional(x)}),Qr=e.object({compatibleAccomodation:e.optional(U),alternativeAccomodation:e.optional(U)}),$r=e.object({customerRecordCode:e.string(),languageCode:b,currencyCode:e.optional(e.string()),startDate:e.string(),endDate:e.string(),earlyBookingDate:e.optional(e.string()),passengerList:e.pipe(e.array(ir),e.minLength(1)),avesSearchType:e.optional(Ue),paxQty:e.optional(x),paxQtyCriteria:e.optional(Ge),discartNotAvailables:e.optional(U),discartNotAvailablesMinSales:e.optional(U),discartNotAvailablesDaysInOut:e.optional(U),discardPriceZero:e.optional(U),discardZeroPriceDays:e.optional(U),destination:e.optional(Hn),objectTypeCode:e.optional(e.string()),featureList:e.optional(e.array(Xr)),servOrPackCode:e.optional(e.string()),servOrPackDesc:e.optional(e.string()),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),suballotmentCode:e.optional(e.string()),markupCode:e.optional(e.string()),statisticCodes:e.optional(G),mergeBoardAndAccomodation:e.optional(U),packageParams:e.optional(Zr),topServiceParams:e.optional(Qr),getDocumentation:e.optional(U)}),ei=e.required($r,[`languageCode`,`avesSearchType`]);function ti(e){let{customerRecordCode:t,languageCode:n,currencyCode:r,startDate:i,endDate:a,earlyBookingDate:o,passengerList:s,paxQty:c,paxQtyCriteria:l,avesSearchType:u,...ee}=e;return{BaseSearch:ft({customerRecordCode:t,languageCode:n,currencyCode:r,startDate:i,endDate:a,earlyBookingDate:o,passengerList:s},cn),...ft({...ee,avesSearchType:u,paxQty:c??s.length,paxQtyCriteria:l??We.GREATER_OR_EQUAL},ln)}}const ni=e.pipe(ei,e.transform(ti)),ri=O(`PackageList`,Yr),ii=O(`ServiceList`,qr),ai=e.object({serviceCode:e.string(),packageRow:e.string()}),oi=T(e.object({customerRecordCode:e.string(),languageCode:b,currencyCode:e.optional(e.string()),packageCode:e.string(),startDate:e.string(),endDate:e.string(),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),markupCode:e.optional(e.string()),statisticCodes:e.optional(G),selectedServiceList:e.pipe(e.array(ai),e.minLength(1)),passengerList:e.optional(e.array(ir))}),sn),si=ht(e.object({RsStatus:w,PackageDetail:e.optional(Jr)}),`packageDetail`),ci=T(e.object({packageCode:e.string()}),dn),li=Ze;var ui=class{transport;constructor(e){this.transport=e}#e(e,t){return{...this.transport.languageCode&&{languageCode:this.transport.languageCode},avesSearchType:t,...e}}searchPackages(e){return this.transport.invokeOp({op:`searchPackages`,params:this.#e(e,y.PACKAGE),apiSchema:ni,endpoint:Y.searchAvesPackages,requestRoot:J.AVES_SEARCH_REQUEST,responseRoot:J.SEARCH_PACKAGE_RESPONSE,responseSchema:ri})}searchTopServices(e){return this.transport.invokeOp({op:`searchTopServices`,params:this.#e(e,y.SERVICE),apiSchema:ni,endpoint:Y.searchTopServices,requestRoot:J.AVES_SEARCH_REQUEST,responseRoot:J.SEARCH_SERVICES_RESPONSE,responseSchema:ii})}getPackageDetail(e){return this.transport.invokeOp({op:`getPackageDetail`,params:e,apiSchema:oi,endpoint:Y.getPackageDetail,requestRoot:J.PACKAGE_DETAIL_REQUEST,responseRoot:J.PACKAGE_DETAIL_RESPONSE,responseSchema:si})}commitPackage(e){return this.transport.invokeOp({op:`commitPackage`,params:e,apiSchema:ci,endpoint:Y.commitPackage,requestRoot:J.COMMIT_PACKAGE_REQUEST,responseRoot:J.COMMIT_PACKAGE_RESPONSE,responseSchema:li})}};const di={VALIDATION:`validation`,API:`api`,UNKNOWN:`unknown`};var Z=class extends Error{kind;status;code;constructor(e,t,n,r){super(t),this.kind=e,this.status=n,this.code=r,this.name=`AvesError`}};function Q(e){return new Z(di.VALIDATION,e)}function fi(e,t,n){return new Z(di.API,e,t,n)}function pi(e){return new Z(di.UNKNOWN,e)}function mi(e){return e.map(hi).join(`; `)}function hi(e){let t=gi(e.path),n=e.message??`Invalid value`;return t?`${t}: ${n}`:n}function gi(e){if(!e||e.length===0)return;let t=e.map(_i).filter(e=>e!==void 0);return t.length>0?t.join(`.`):void 0}function _i(e){if(typeof e==`string`||typeof e==`number`)return String(e);if(typeof e==`object`&&e&&`key`in e)return String(e.key)}function vi(e){return e instanceof Error&&e.name===`AbortError`}function yi(e){return{success:!0,data:e}}function $(e){return{success:!1,error:e}}function bi(e){let t=new AbortController;if(!e||e<=0)return{signal:t.signal};let n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function xi(e,t){try{let n=new URL(e),r=(n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname)+t;return new URL(r,n)}catch(e){throw Q(`Invalid baseURL: ${e instanceof Error?e.message:`Invalid URL format`}`)}}function Si(e,t){if(!t.startsWith(`/`))throw Q(`Invalid endpoint: endpoint must start with '/' but got '${t}'`);let n=xi(e.replace(/\/$/,``),t);if(n.protocol!==`http:`&&n.protocol!==`https:`)throw Q(`Invalid protocol: baseURL must use http:// or https:// but got '${n.protocol}'`);return n.toString()}const Ci={ignoreAttributes:!1,attributeNamePrefix:`@`,parseAttributeValue:!1,trimValues:!0,ignoreNameSpace:!0,removeNSPrefix:!0,parseTagValue:!1},wi={ignoreAttributes:!1,attributeNamePrefix:`@`,suppressEmptyNode:!0},Ti=new o(Ci),Ei=new a(wi);function Di(e){try{return Ei.build(e)}catch(e){throw Q(`Failed to convert JSON to XML: ${e instanceof Error?e.message:`Unknown error`}`)}}function Oi(e){try{return Ti.parse(e)}catch(e){throw Q(`Failed to convert XML to JSON: ${e instanceof Error?e.message:`Unknown error`}`)}}var ki=class{options;constructor(e){this.options=e}get languageCode(){return this.options.languageCode}createRqHeader(){return{"@HostID":this.options.hostID,"@Xtoken":this.options.xtoken,"@Interface":`WEB`,"@UserName":`WEB`,...this.options.languageCode&&{"@LanguageCode":this.options.languageCode}}}toAvesError(e,n){return e instanceof Z?e:e instanceof t?Q(`Validation error: ${mi(e.issues)}`):e instanceof Error?pi(e.message):pi(n)}handleApiStatus(e){let{rsStatus:t}=e;return t.status===`OK`?yi(e):$(fi(t.errorDescription??``,t.status,t.errorCode))}async request(e,t,n,a){let{signal:o,clear:s}=bi(this.options.timeoutMs??3e4);try{let s=await i(Si(this.options.baseURL,e),{method:`POST`,headers:{"Content-Type":`application/xml`},body:Di(t),signal:o}),c=await s.body.text();if(s.statusCode<200||s.statusCode>299)return $(fi(c.slice(0,4096),`ERROR`,s.statusCode));let l=Oi(c)[n];if(!l)return $(Q(`Invalid response structure: missing root element '${n}'`));let u=r(a,l);return u.success?this.handleApiStatus(u.output):$(Q(`Invalid response format: ${mi(u.issues)}`))}catch(e){return vi(e)?$(fi(`Request timed out`,`TIMEOUT`)):$(this.toAvesError(e,`Unknown error occurred`))}finally{s?.()}}async invokeOp(e){try{let t=n(e.apiSchema,e.params),r=e.bodyKey?{[e.bodyKey]:t}:t;return this.request(e.endpoint,Or(e.requestRoot,{RqHeader:this.createRqHeader(),...r}),e.responseRoot,e.responseSchema)}catch(t){return $(this.toAvesError(t,`Validation error occurred during ${e.op}`))}}},Ai=class{transport;master;booking;packages;constructor(e,t={}){this.transport=t.transport??new ki(e),this.master=t.master??new Ur(this.transport),this.booking=t.booking??new kr(this.transport),this.packages=t.packages??new ui(this.transport)}};export{Ai as AvesClient,Z as AvesError,y as AvesSearchType,Ue as AvesSearchTypeSchema,he as AvesServiceType,h as AvesServiceTypeSchema,ki as AvesTransport,_e as BookedServiceStatus,ve as BookedServiceStatusSchema,kr as BookingClient,de as BookingFileStatus,fe as BookingFileStatusSchema,p as BookingFileStatusWire,m as BookingFileStatusWireSchema,Te as CancelOperationType,Ee as CancelOperationTypeSchema,le as CarrierType,ue as CarrierTypeSchema,Le as CostPriceType,_ as CostPriceTypeSchema,xe as CustomerPaymentType,Se as CustomerPaymentTypeSchema,Ke as DestinationType,qe as DestinationTypeSchema,Ne as DocumentType,Pe as DocumentTypeSchema,je as FilePaymentOperationType,Me as FilePaymentOperationTypeSchema,c as Gender,l as GenderSchema,Re as GroupingPaxPolicy,ze as GroupingPaxPolicySchema,ae as InsertCriteria,oe as InsertCriteriaSchema,Fe as MakeDocumentTo,Ie as MakeDocumentToSchema,se as MasterPaymentType,ce as MasterPaymentTypeSchema,Ur as MasterRecordsClient,ke as OptionedExpirePolicy,Ae as OptionedExpirePolicySchema,ui as PackageCatalogClient,Ce as PassengerCategory,we as PassengerCategorySchema,We as PaxQtyCriteria,Ge as PaxQtyCriteriaSchema,ye as PaymentType,be as PaymentTypeSchema,f as RecordStatus,ie as RecordStatusSchema,ne as RecordType,re as RecordTypeSchema,u as RsStatusValue,ee as RsStatusValueSchema,v as SearchBookingFileType,He as SearchBookingFileTypeSchema,d as SearchMasterType,te as SearchMasterTypeSchema,De as ServiceRefType,Oe as ServiceRefTypeSchema,pe as SetFileStatusValue,me as SetFileStatusValueSchema,ge as ToServiceType,g as ToServiceTypeSchema,Be as TypeDownloadFile,Ve as TypeDownloadFileSchema};
2
- //# sourceMappingURL=index.mjs.map
1
+ import*as e from"valibot";import{ValiError as t,parse as n,safeParse as r}from"valibot";import{request as i}from"undici";import a from"fast-xml-builder";import{XMLParser as o}from"fast-xml-parser";function s(t){return e.picklist(Object.values(t))}const c={M:`M`,F:`F`},l=s(c),u={OK:`OK`,ERROR:`ERROR`,WARNING:`WARNING`,TIMEOUT:`TIMEOUT`},ee=s(u),d={CODE:`CODE`,NAME:`NAME`,VATCODE:`VATCODE`,ZONE:`ZONE`,CATEGORY:`CATEGORY`,EMAIL:`EMAIL`,LASTMODDATE:`LASTMODDATE`,SEARCH_FIELD:`SEARCH_FIELD`,EXTERNAL_REF_CODE:`EXTERNAL_REF_CODE`},te=s(d),ne={CUSTOMER:`CUSTOMER`,SUPPLIER:`SUPPLIER`,VOUCHER:`VOUCHER`,SUPPLIER_VOUCHER:`SUPPLIER_VOUCHER`,GENERAL:`GENERAL`},re=s(ne),f={ENABLED:`ENABLED`,DISABLED:`DISABLED`,WARNING:`WARNING`,BLACKLISTED:`BLACKLISTED`},ie=s(f),ae={S:`S`,N:`N`,T:`T`,M:`M`},oe=s(ae),se={CASH:`CASH`,BANK:`BANK`,RID:`RID`,RIBA:`RIBA`,SPECIFIC_CODE:`SPECIFIC_CODE`},ce=s(se),le={NOT_SET:`NOT_SET`,FLIGHT:`FLIGHT`,SHIP:`SHIP`,TRAIN:`TRAIN`,RENTCAR:`RENTCAR`,BUS:`BUS`,DP_HOTEL:`DP_HOTEL`,TO_HOTEL:`TO_HOTEL`,TO_TOUR:`TO_TOUR`,TO_HOTEL_AND_TOUR:`TO_HOTEL_AND_TOUR`,DP_AUTO:`DP_AUTO`,DP_GDS_NAVI:`DP_GDS_NAVI`,DP_GDS_VOLI:`DP_GDS_VOLI`,TOUR_OPERATOR:`TOUR_OPERATOR`,TICKETING_EV:`TICKETING_EV`,OTHER:`OTHER`},ue=s(le),de={QUOTATION:`QUOTATION`,WORK_IN_PROGRESS:`WORK_IN_PROGRESS`,CONFIRMED:`CONFIRMED`,OPTIONED:`OPTIONED`,CANCELED:`CANCELED`},fe=s(de),pe={...de,NULLIFIED:`NULLIFIED`},me=s(pe),p={QUOTATION:`QUOTATION`,WORK_IN_PROGRESS:`WORK_IN_PROGRESS`,CONFIRM:`CONFIRM`,CONFIRMED:`CONFIRMED`,OPTION:`OPTION`,OPTIONED:`OPTIONED`,REQUEST:`REQUEST`,REQUESTED:`REQUESTED`,NULLIFIED:`NULLIFIED`,CANCELED:`CANCELED`},m=s(p),he={TOP:`TOP`,TOP_SS:`TOP_SS`,ADV:`ADV`,GRP:`GRP`,OTHER:`OTHER`},h=s(he),ge={ACCOMODATION:`ACCOMODATION`,TRANSPORT:`TRANSPORT`,CHARTER:`CHARTER`,TRANSFER:`TRANSFER`,PULLMAN:`PULLMAN`,FERRY:`FERRY`,CRUISE:`CRUISE`,INSURANCE:`INSURANCE`,EXTRAFEE:`EXTRAFEE`,PENALTY:`PENALTY`,PROMO:`PROMO`,OTHER:`OTHER`,NOT_SET:`NOT_SET`,RESIDENCE:`RESIDENCE`,TOUR:`TOUR`},g=s(ge),_e={REQUEST:`REQUEST`,ALLOTMENT_REQUEST:`ALLOTMENT_REQUEST`,CONFIRMED_REQUEST:`CONFIRMED_REQUEST`,CONFIRMED_EXTRA_ALLOTMENT:`CONFIRMED_EXTRA_ALLOTMENT`,WAITLISTED:`WAITLISTED`,ALLOTMENT:`ALLOTMENT`,REFUSED:`REFUSED`,NULLIFIED:`NULLIFIED`,CANCELED:`CANCELED`,MESSAGE:`MESSAGE`},ve=s(_e),ye={C:`C`,B:`B`,D:`D`,T:`T`,P:`P`,R:`R`,A:`A`,H:`H`,I:`I`,J:`J`,K:`K`,L:`L`,M:`M`,N:`N`,O:`O`,Q:`Q`,S:`S`,U:`U`,V:`V`},be=s(ye),xe={CASH:`CASH`,BANK:`BANK`,RID:`RID`,RIBA:`RIBA`,SPECIFIC_CODE:`SPECIFIC_CODE`,NOT_SET:`NOT_SET`},Se=s(xe),Ce={AD:`AD`,CH:`CH`,IN:`IN`,OV:`OV`},we=s(Ce),Te={NULLIFY:`NULLIFY`,DELETE:`DELETE`},Ee=s(Te),De={RPH:`RPH`,FILE:`FILE`},Oe=s(De),ke={NOT_SET:`NOT_SET`,CONSIDER_HOLIDAY:`CONSIDER_HOLIDAY`,CONSIDER_HOLIDAY_AND_SATURDAY:`CONSIDER_HOLIDAY_AND_SATURDAY`},Ae=s(ke),je={AbsoluteAmountsInsertion:`AbsoluteAmountsInsertion`,FinalAmountToAchieve:`FinalAmountToAchieve`,FinalAmountToAchieveWithoutControls:`FinalAmountToAchieveWithoutControls`},Me=s(je),Ne={VISA_REQUEST:`VISA_REQUEST`,TRAVEL_INFORMATION:`TRAVEL_INFORMATION`,VOUCHER:`VOUCHER`,BOOKING_CONTRACT:`BOOKING_CONTRACT`,BOOKING_CONFIRMATION:`BOOKING_CONFIRMATION`,SUPPLIER_SERVICE_LIST:`SUPPLIER_SERVICE_LIST`,INVOICE:`INVOICE`,PROFORMA_INVOICE:`PROFORMA_INVOICE`,ADEGUAMENTO:`ADEGUAMENTO`,RESERVATION_FORM:`RESERVATION_FORM`,OPEN_XML:`OPEN_XML`,SALES_INVOICE:`SALES_INVOICE`,TICKETING_TMASTER:`TICKETING_TMASTER`,SUMMARY_FORM:`SUMMARY_FORM`},Pe=s(Ne),Fe={BOOKING_CUSTOMER:`BOOKING_CUSTOMER`,FIRST_PASSENGER:`FIRST_PASSENGER`},Ie=s(Fe),Le={PAX_QTY_DAY:`PAX_QTY_DAY`,PAX_QTY_NIGHT:`PAX_QTY_NIGHT`,PAX_QTY_WEEK:`PAX_QTY_WEEK`,PAX_QTY:`PAX_QTY`,PAX_DAY:`PAX_DAY`,PAX_NIGHT:`PAX_NIGHT`,PAX_WEEK:`PAX_WEEK`,PAX:`PAX`,QTY_DAY:`QTY_DAY`,QTY_NIGHT:`QTY_NIGHT`,QTY_WEE:`QTY_WEE`,QTY:`QTY`,DAY:`DAY`,NIGHT:`NIGHT`,WEEK:`WEEK`,FORFAIT:`FORFAIT`},_=s(Le),Re={GROUPED_PAX:`GROUPED_PAX`,NOT_GROUPED_PAX:`NOT_GROUPED_PAX`,ONE_PAX_ONLY:`ONE_PAX_ONLY`},ze=s(Re),Be={AVES2AVES:`AVES2AVES`,AVES2AVESVIA:`AVES2AVESVIA`,AVES2AVESITA:`AVES2AVESITA`},Ve=s(Be),v={FILE_CODE:`FILE_CODE`,PAX_NAME:`PAX_NAME`,PACKAGE_CODE:`PACKAGE_CODE`,OTHER:`OTHER`},He=s(v),y={SERVICE:`SERVICE`,PROGRAM:`PROGRAM`,PACKAGE:`PACKAGE`},Ue=s(y),We={GREATER_THAN:`GREATER_THAN`,GREATER_OR_EQUAL:`GREATER_OR_EQUAL`,EQUAL_TO:`EQUAL_TO`,LESS_OR_EQUAL:`LESS_OR_EQUAL`,LESS_THAN:`LESS_THAN`},Ge=s(We),Ke={CODE:`CODE`,SUB_LOCALITY:`SUB_LOCALITY`,LOCALITY:`LOCALITY`,SUB_SUB_ISLAND:`SUB_SUB_ISLAND`,SUB_ISLAND:`SUB_ISLAND`,ISLAND_COUNTY:`ISLAND_COUNTY`,SUB_ARCHIPELAGO:`SUB_ARCHIPELAGO`,ARCHIPELAGO:`ARCHIPELAGO`,REGION_STATE:`REGION_STATE`,SUB_SUB_NATION:`SUB_SUB_NATION`,SUB_NATION:`SUB_NATION`,NATION:`NATION`,SUB_SUB_CONTINENT:`SUB_SUB_CONTINENT`,SUB_CONTINENT:`SUB_CONTINENT`,CONTINENT:`CONTINENT`},qe=s(Ke),Je=e.pipe(e.string(),e.minLength(2),e.maxLength(2)),b=e.optional(Je),x=e.union([e.string(),e.number()]),S=e.union([e.string(),e.number(),e.boolean()]),C=e.object({minDate:e.string(),maxDate:e.string()}),Ye=e.object({"@HostID":e.pipe(e.string(),e.minLength(6),e.maxLength(6)),"@Xtoken":e.string(),"@Interface":e.literal(`WEB`),"@UserName":e.literal(`WEB`),"@LanguageCode":b}),Xe=e.optional(e.string()),w=e.pipe(e.object({"@Status":ee,ErrorCode:e.optional(e.pipe(x,e.transform(e=>Number(e)))),ErrorDescription:e.optional(e.string()),Warnings:Xe}),e.transform(e=>({status:e[`@Status`],errorCode:e.ErrorCode,errorDescription:e.ErrorDescription,warnings:e.Warnings}))),Ze=D(e.object({RsStatus:w})),Qe={rph:`RPH`,toServiceType:`TOServiceType`,text:`#text`},$e=Object.fromEntries(Object.entries(Qe).map(([e,t])=>[t,e]));function et(e){return e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error}function tt(e){return Qe[e]??e.charAt(0).toUpperCase()+e.slice(1)}function nt(e){return $e[e]??e.charAt(0).toLowerCase()+e.slice(1)}function rt(e,t){let n=t?.textContent===e?`#text`:t?.rename?.[e]??tt(e);return n===`#text`||!t?.attrs?.includes(e)?n:t.preserveCamel?.includes(e)?`@${e}`:`@${n}`}function it(e){let{listWrap:t,detailKey:n,...r}=e;return r}function at(e,t){return t?.listWrap?{children:{[t.detailKey??(e.endsWith(`List`)?`${e.slice(0,-4)}Detail`:`${e}Detail`)]:it(t)}}:t}function ot(e,t){if(typeof e!=`object`||!e||et(e))return e;if(Array.isArray(e))return e.map(e=>ot(e,t));let n={};for(let[r,i]of Object.entries(e)){let e=t?.children?.[r];n[rt(r,t)]=ot(i,at(r,e))}return n}function st(e){if(typeof e!=`object`||!e||et(e))return e;if(Array.isArray(e))return e.map(e=>st(e));let t={};for(let[n,r]of Object.entries(e)){let e=n.startsWith(`@`)?n.slice(1):n;t[nt(e)]=st(r)}return t}const ct={financialDeadlineList:`deadlineDetail`};function lt(e,t){return t?.detailKey??ct[e]??(e.endsWith(`List`)?`${e.slice(0,-4)}Detail`:`${e}Detail`)}function ut(e,t){let n=(e,t)=>{if(Array.isArray(e))return e.map(e=>n(e,t));if(typeof e!=`object`||!e)return e;let r={};for(let[i,a]of Object.entries(e)){let e=t?.children?.[i];if(e?.listWrap&&Array.isArray(a)){let t=lt(i,e),o=a.map(t=>n(t,it(e)));r[i]=e.listWrap===`one`?o.map(e=>({[t]:e})):{[t]:o};continue}r[i]=n(a,e)}return r};return n(e,t)}function dt(e){let t=e=>{if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n={};for(let[r,i]of Object.entries(e)){if(r===`paxAssociated`&&Array.isArray(i)){if(!i.length){n[r]=``;continue}if(i.every(e=>typeof e==`string`)){n[r]=i.map(e=>({pax:e}));continue}}n[r]=t(i)}return n};return t(e)}function ft(e,t){return ot(dt(ut(e,t)),t)}function T(t,n){return e.pipe(t,e.transform(e=>ft(e,n)))}function pt(t){return e.pipe(e.union([e.array(t),t]),e.transform(e=>Array.isArray(e)?e:[e]))}function E(t,n){let r=e.optional(pt(n));return e.pipe(e.object({[t]:r}),e.transform(e=>e[t]??[]))}function D(t){return e.pipe(t,e.transform(e=>st(e)))}function O(t,n){let r={[t]:e.optional(n)};return D(e.object({RsStatus:w,...r}))}function mt(e){return t=>{if(typeof t!=`object`||!t)return t;let n=t,r=n[e],{[e]:i,...a}=n;return!r||typeof r!=`object`||Array.isArray(r)?a:{...a,...r}}}function ht(t,n){return e.pipe(D(t),e.transform(e=>mt(n)(e)))}function k(t,n){let r=e.object({value:t,...n??{}});return e.pipe(e.union([t,r]),e.transform(e=>typeof e==`object`&&e?e:{value:e}))}function gt(e,t){return n=>{let r=Reflect.get(n,e),i=Reflect.get(n,t),a={...n};return Reflect.deleteProperty(a,e),Reflect.set(a,t,i??(Array.isArray(r)?r[0]:void 0)),a}}function _t(e){let{customerRecordCode:t,customerDetail:n,...r}=e;return{...r,customerDetail:{...n,recordCode:n?.recordCode??t}}}function vt(e){return e.type===`object`&&`entries`in e}function yt(e){return e.type===`optional`&&`wrapped`in e}function bt(e){return e.type===`array`&&`item`in e}function A(t,n){if(yt(t)){let r=A(t.wrapped,n);return t.default===void 0?e.optional(r):e.optional(r,t.default)}return bt(t)?pt(A(t.item,n)):vt(t)?xt(t,n):t}function xt(t,n,r){let i={};for(let e in t.entries){let r=n.children?.[e]??{};i[rt(e,n)]=A(t.entries[e],r)}return e.object({...i,...r})}function j(e,t={},n){return xt(e,t,n)}function M(e,t){let n={...e};for(let[e,r]of Object.entries(t)){let t;for(let e of r)if(n[e]!==void 0&&n[e]!==null){t=n[e];break}for(let t of r)t!==e&&delete n[t];t===void 0?delete n[e]:n[e]=t}return n}function N(e,t){return{api:T(e,t),validation:j(e,t)}}function P(e){return e}function F(...e){return P({attrs:e})}function St(...e){return P({attrs:e,preserveCamel:e})}function Ct(e,t){return P({attrs:e,preserveCamel:t})}function I(e){return P({children:e})}function L(e,t){return P({attrs:e,children:t})}function R(e,t,n){return P(n?{...e,listWrap:t,detailKey:n}:{...e,listWrap:t})}function z(e,...t){return R(F(...t),e)}function wt(e){return{one:R(e,`one`),many:R(e,`many`)}}F(`hostID`,`xtoken`,`interface`,`userName`,`status`,`languageCode`);const Tt=F(`currencyCode`,`creditLimit`,`c_PaymentType`,`c_SpecPaymentTypeCode`,`s_PaymentType`,`s_SpecPaymentTypeCode`,`enableElectronicInvoicing`,`electronicInvoicingType`),Et=F(`idType`,`idCode`,`idIssueLocation`,`idIssueCounty`,`idIssueDate`,`idExpireDate`),Dt=F(`acceptProfilingPolicies`,`acceptPrivacyPolicies`,`acceptNewsletterPolicies`),Ot=F(`key`,`value`),kt=F(`supplierRefCode`,`companyMainBusinessType`,`carrierType`),At=L([`recordCode`,`insertCriteria`],{financialDetail:Tt,idDocumentDetail:Et,accountPolicies:Dt,dynamicFields:Ot,supplierRefMasterRecords:kt}),B=F(`minDate`,`maxDate`),jt=I({lastModificationDate:B}),Mt=St(`sCode1`,`sCode2`,`sCode3`,`sCode4`,`sCode5`,`sCode6`),Nt=F(`code`,`iataCode`,`nationCode`,`type`),Pt=F(`nType`,`title`),Ft=R(Pt,`many`),It=L([`rph`,`roomRph`,`billingHolder`],{notes:R(Pt,`many`,`noteDetail`),idDocInfo:Et}),Lt=F(`currencyCode`,`exchangeRate`,`cost`,`costTax`,`costType`,`vatCostCurrencyCode`,`price`,`priceTax`,`priceType`),Rt=Ct([`pCode`,`startDate`,`endDate`,`getServicesFromPackage`],[`pCode`]),V=wt(P({...Ct([`sCode`,`ssCode`],[`sCode`,`ssCode`]),children:{serviceFare:Lt,avesServiceInfo:I({serviceFare:Lt}),noteList:Ft}})),H=wt(It);H.one,H.many;const zt=R(Rt,`many`),Bt=z(`many`,`deadlineCode`,`description`,`expireDate`),Vt=z(`many`,`reschedulingCode`,`description`,`expireDate`),Ht=R(F(`reschedulingCode`,`expireDate`,`totalAmount`),`many`,`deadlineDetail`),Ut=R(P({...F(`paymentDate`,`paymentNote`,`amount`,`paymentUser`,`paymentType`),rename:{paymentNote:`PaumentNote`}}),`many`),Wt=z(`many`,`paymentDate`,`paymentNote`,`payerMasterCode`,`payerName`,`amount`,`paymentType`),Gt=z(`many`,`cancelOperationType`,`serviceRefType`,`serviceRefValue`),Kt=L([`printDoc`,`sendDocViaEmail`],{infoDocumentsToPrint:I({documentCustomizablePrintParameters:F(`makeDocumentTo`,`fillInCode`)})}),qt=F(`value`,`expiredDate`),Jt=F(`recordCode`),Yt=F(`customer_PaymentType`,`customer_SpecPaymentTypeCode`),Xt=F(`getAllDeptDate`,`getFlightPlan`,`getAllAccomodation`,`getRealAvailability`),Zt=F(`compatibleAccomodation`,`alternativeAccomodation`),Qt=z(`many`,`code`,`name`),$t=F(`value`,`expiredDate`,`optionedFileExpireDatePolicy`),en=F(`apply`,`specificCode`),tn={customerDetail:Jt,bookingFileStatus:qt,statisticCodes:Mt,destination:Nt,bookingFileDocument:Kt,bookingFinancialInfo:Yt,selectedPackageDetail:Rt,selectedPackageList:zt,financialDeadlineList:Ht,paymentList:Ut,cancellableBookedServiceList:Gt,noteList:Ft},nn=I({...tn,deadlineList:Bt,selectedServiceList:V.one,extraQuoteServiceList:V.one,passengerList:H.one}),rn=I({...tn,deadlineList:Vt,selectedServiceList:V.many,extraQuoteServiceList:V.many,passengerList:H.many}),an=L([`paymentUser`],{filePaymentList:Wt}),on=I({fileStatus:F(`value`,`expireDate`),startDate:B,createdDate:B,lastModificationDate:B,insurance:F(`code`,`number`)}),sn=I({statisticCodes:Mt,selectedServiceList:R(F(`serviceCode`,`packageRow`),`many`),passengerList:H.many}),cn=I({passengerList:H.many}),ln=I({destination:Nt,statisticCodes:Mt,packageParams:Xt,topServiceParams:Zt,featureList:Qt}),un=I({fileStatus:$t,penalty:en,bookingFileDocument:Kt}),dn=P({}),U=e.union([e.literal(`true`),e.literal(`false`),e.boolean()]),fn={[p.CONFIRM]:`CONFIRMED`,[p.OPTION]:`OPTIONED`,[p.REQUESTED]:`REQUEST`};function pn(e){return e in fn?fn[e]:e}const mn=e.pipe(e.object({"@Value":m,"@ExpiredDate":e.optional(e.string()),"@ExpireDate":e.optional(e.string())}),e.transform(e=>({...M(e,{"@ExpiredDate":[`@ExpiredDate`,`@ExpireDate`]}),"@Value":pn(e[`@Value`])}))),hn=E(`PricePerPaxDetail`,e.object({"@PaxRef":e.string(),"@Price":x})),gn=e.object({"@CommissionCode":e.optional(e.string()),"@CommissionPercentage":e.optional(x),"@CommissionAmount":e.optional(x),"@PriceListCode":e.optional(e.string()),"@CostListCode":e.optional(e.string()),"@ServiceTotalPrice":e.optional(x),PaxPriceList:e.optional(hn)}),_n=e.object({"@Code":e.optional(e.string()),"@Name":e.optional(e.string()),"@Email":e.optional(e.string()),"@LanguageCode":e.optional(e.string())}),vn=e.object({"@Code":e.optional(e.string()),"@Description":e.optional(e.string())}),yn=e.object({"@RPH":e.string(),"@ServiceCode":e.optional(e.string()),"@FromExternalProvider":e.optional(x),"@isFromExternalProvider":e.optional(x),AvesServiceType:e.optional(h),TOServiceType:e.optional(g),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),ThirdDescription:e.optional(e.string()),FourthDescription:e.optional(e.string()),ServiceStatus:e.optional(ve),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),Qty:e.optional(x),Pax:e.optional(x),PeriodType:e.optional(e.string()),PaxMultiplier:e.optional(e.string()),ExternalProviderCode:e.optional(e.string()),WebStatisticCode:e.optional(e.string()),WebStatisticDescription:e.optional(e.string()),WebStatistic:e.optional(vn),SupplierInfo:e.optional(_n),ServiceTotalAmountDetail:e.optional(gn)}),bn=E(`BookedServiceDetail`,e.pipe(yn,e.transform(e=>M(e,{"@FromExternalProvider":[`@FromExternalProvider`,`@isFromExternalProvider`]})))),xn=e.object({"@CurrencyCode":e.optional(e.string()),"@TotalAmountBeforeDiscount":e.optional(x),"@TotalAmountAfterDiscount":e.optional(x),"@TotalDiscount":e.optional(x),"@TotalAmountWithoutVat":e.optional(x),"@DueAmount":e.optional(x),"@PaiedAmount":e.optional(x),"@Balance":e.optional(x)}),Sn=E(`PassengerDetail`,e.object({"@RPH":e.string(),"@RoomRPH":e.optional(e.string()),"@BillingHolder":e.optional(x),Name:e.optional(e.string()),CategoryCode:e.optional(e.string()),Sex:e.optional(e.string()),BirthDate:e.optional(e.string()),BirthPlace:e.optional(e.string()),NationCode:e.optional(e.string()),CitizenshipCode:e.optional(e.string()),FiscalCode:e.optional(e.string()),PhoneNumber:e.optional(e.string()),EMail:e.optional(e.string()),MasterRecordCode:e.optional(e.string())})),Cn=e.object({"@ReschedulingCode":e.optional(e.string()),"@ExpireDate":e.optional(e.string()),"@TotalAmount":e.optional(x),ReschedulingCode:e.optional(e.string()),ExpireDate:e.optional(e.string()),TotalAmount:e.optional(x)}),wn=E(`DeadlineDetail`,e.pipe(Cn,e.transform(e=>M(e,{"@ReschedulingCode":[`@ReschedulingCode`,`ReschedulingCode`],"@ExpireDate":[`@ExpireDate`,`ExpireDate`],"@TotalAmount":[`@TotalAmount`,`TotalAmount`]})))),Tn=E(`StoredDocumentDetail`,e.object({DocumentRefCode:e.optional(e.string()),DocumentType:e.optional(e.string()),DocumentName:e.optional(e.string()),ArchiviationDescription:e.optional(e.string())})),En=E(`PrintableDocumentDetail`,e.object({DocumentType:e.optional(e.string()),DocumentName:e.optional(e.string()),Enabled:e.optional(x)})),Dn=e.object({"@BookingFileCode":e.optional(e.string()),BookingFileCode:e.optional(e.string()),CustomerRecordCode:e.optional(e.string()),CustomerName:e.optional(e.string()),CustomerEmail:e.optional(e.string()),TravelAgencyName:e.optional(e.string()),TravelAgencyEmail:e.optional(e.string()),BookingFileStatus:e.optional(mn),Description:e.optional(e.string()),Nation:e.optional(e.string()),Destination:e.optional(e.string()),CreationDate:e.optional(e.string()),FirstConfirmationDate:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),PackageCode:e.optional(e.string()),BookedServiceList:e.optional(bn),TotalAmountDetail:e.optional(xn),PaxNumber:e.optional(x),PassengerList:e.optional(Sn),Reference:e.optional(e.string()),ClerkName:e.optional(e.string()),StoredDocumentsList:e.optional(Tn),PrintableDocumentsList:e.optional(En),FinancialDeadlineList:e.optional(wn)}),On=e.pipe(Dn,e.transform(e=>M(e,{"@BookingFileCode":[`@BookingFileCode`,`BookingFileCode`]}))),kn=e.object({currencyCode:e.optional(e.string()),creditLimit:e.optional(e.string()),c_PaymentType:e.optional(ce),c_SpecPaymentTypeCode:e.optional(e.string()),s_PaymentType:e.optional(ce),s_SpecPaymentTypeCode:e.optional(e.string()),enableElectronicInvoicing:e.optional(U),electronicInvoicingType:e.optional(e.string())}),An=N(kn,Tt);An.api,An.validation;const jn=e.object({idType:e.optional(e.string()),idCode:e.optional(e.string()),idIssueLocation:e.optional(e.string()),idIssueCounty:e.optional(e.string()),idIssueDate:e.optional(e.string()),idExpireDate:e.optional(e.string())}),Mn=N(jn,Et);Mn.api,Mn.validation;const Nn=e.object({key:e.string(),value:e.string()});j(Nn,Ot);const Pn=e.object({supplierRefCode:e.optional(e.string()),companyMainBusinessType:e.optional(e.string()),carrierType:e.optional(ue)}),Fn=N(Pn,kt);Fn.api,Fn.validation;const In=e.union([e.literal(0),e.literal(1)]),Ln=e.object({acceptProfilingPolicies:e.optional(In),acceptPrivacyPolicies:e.optional(In),acceptNewsletterPolicies:e.optional(In)}),Rn=N(Ln,Dt);Rn.api,Rn.validation;const zn=e.object({recordCode:e.optional(e.pipe(e.string(),e.minLength(6),e.maxLength(6))),insertCriteria:e.optional(oe),createdDate:e.optional(e.string()),recordType:e.optional(re,ne.CUSTOMER),recordStatus:e.optional(ie,f.ENABLED),moniker:e.optional(e.string()),name:e.optional(e.string()),extraInfo:e.optional(e.string()),languageCode:Je,address:e.optional(e.string()),zipCode:e.optional(e.string()),cityName:e.optional(e.string()),countyCode:e.optional(e.string()),stateCode:e.optional(e.string()),categoryCode:e.optional(e.string()),firstPhoneNumber:e.optional(e.string()),mobilePhoneNumber:e.optional(e.string()),email:e.optional(e.string()),gender:e.optional(l),birthDate:e.optional(e.string()),birthCity:e.optional(e.string()),birthCounty:e.optional(e.string()),fiscalCode:e.optional(e.string()),vatCode:e.optional(e.string()),thirdPartRecordCode:e.optional(e.string()),idDocumentDetail:e.optional(jn),accountPolicies:e.optional(Ln),financialDetail:e.optional(kn),dynamicFields:e.optional(e.array(Nn)),supplierRefMasterRecords:e.optional(Pn)}),Bn=T(zn,At),W=e.partial(j(zn,At,{ModifiedDate:e.optional(e.string()),LoginType:e.optional(e.string()),PromoterCode:e.optional(e.string()),EncryptedPassword:e.optional(U),NewsletterDisabled:e.optional(U)}));D(W);const Vn=k(fe,{expiredDate:e.optional(e.string())}),G=e.object({sCode1:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode2:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode3:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode4:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode5:e.optional(e.pipe(e.string(),e.maxLength(4))),sCode6:e.optional(e.pipe(e.string(),e.maxLength(4)))}),Hn=e.object({code:e.optional(e.string()),iataCode:e.optional(e.string()),nationCode:e.optional(e.string()),type:e.optional(qe)}),Un=e.object({recordCode:e.optional(e.string())}),Wn=e.object({makeDocumentTo:e.optional(Ie)}),Gn=e.object({fillInCode:e.optional(e.string())}),Kn=e.union([Wn,Gn]),qn=e.object({documentType:Pe,documentCustomizablePrintParameters:e.optional(Kn)}),Jn=e.object({printDoc:e.optional(U),sendDocViaEmail:e.optional(U),infoDocumentsToPrint:e.optional(e.array(qn))}),Yn=e.object({reschedulingCode:e.optional(e.string()),expireDate:e.optional(e.string()),totalAmount:e.optional(e.string())}),Xn=e.object({deadlineCode:e.optional(e.string()),description:e.optional(e.string()),expireDate:e.optional(e.string())}),Zn=e.object({paymentDate:e.optional(e.string()),paymentNote:e.optional(e.string()),amount:e.optional(e.string()),paymentUser:e.optional(e.string()),paymentType:e.optional(be)}),Qn=e.object({nType:e.optional(e.string()),title:e.optional(e.string()),text:e.optional(e.string())}),$n=e.object({currencyCode:e.optional(e.string()),exchangeRate:e.optional(e.string()),cost:e.optional(e.string()),costTax:e.optional(e.string()),costType:e.optional(_),vatCostCurrencyCode:e.optional(e.string()),price:e.optional(e.string()),priceTax:e.optional(e.string()),priceType:e.optional(_)}),er=e.object({packageCode:e.optional(e.string()),packageReference:e.optional(e.string()),suballotmentCode:e.optional(e.string()),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),externalFileCode:e.optional(e.string()),externalReference:e.optional(e.string()),serviceStatus:e.optional(e.string()),serviceStatisticCode:e.optional(e.string()),serviceFare:e.optional($n)}),tr=e.object({sCode:e.string(),ssCode:e.optional(e.string()),avesServiceType:h,toServiceType:e.optional(g),subServiceDesc:e.optional(e.string()),startDate:e.string(),endDate:e.string(),qty:e.string(),pax:e.string(),paxAssociated:e.optional(e.union([e.array(e.string()),e.array(e.object({pax:e.string()}))])),avesSession:e.string(),avesServiceInfo:e.optional(er),serviceFare:e.optional($n),bookedServiceRef:e.optional(e.string()),supplierMasterCode:e.optional(e.string()),voucherMasterCode:e.optional(e.string()),hotelServiceInfo:e.optional(e.string()),carRentalServiceInfo:e.optional(e.string()),flightServiceInfo:e.optional(e.string()),shipServiceInfo:e.optional(e.string()),ticketServiceInfo:e.optional(e.string()),commission:e.optional(e.string()),noteList:e.optional(e.array(Qn)),voucherInfo:e.optional(e.string()),firstDescription:e.optional(e.string()),secondDescription:e.optional(e.string())}),nr=e.object({pCode:e.string(),startDate:e.string(),endDate:e.string(),getServicesFromPackage:e.optional(U)}),rr={rph:e.string(),roomRph:e.optional(e.string()),billingHolder:e.optional(U),masterRecordCode:e.optional(e.string()),name:e.string(),sex:l,birthDate:e.optional(e.string()),birthPlace:e.optional(e.string()),nationCode:e.optional(e.string()),citizenshipCode:e.optional(e.string()),fiscalCode:e.optional(e.string()),phoneNumber:e.optional(e.string()),eMail:e.optional(e.string()),notes:e.optional(e.array(Qn)),flagStatus:e.optional(e.string()),offerCode:e.optional(e.string()),idDocInfo:e.optional(jn)},ir=e.object({...rr,categoryCode:we}),ar=e.object({...rr,categoryCode:e.optional(we)}),or=e.object({customer_PaymentType:e.optional(Se),customer_SpecPaymentTypeCode:e.optional(e.string())}),sr=T(e.pipe(e.object({createDate:e.optional(e.string()),bookingFileRefCode:e.optional(e.string()),travelAgentCode:e.optional(e.string()),clerkName:e.optional(e.string()),customerDetail:e.optional(Un),customerRecordCode:e.optional(e.string()),currencyCode:e.optional(e.string()),markupCode:e.optional(e.string()),bookingFileStatus:Vn,statisticCodes:e.optional(G),destination:e.optional(Hn),bookingFileDescription:e.optional(e.string()),startDate:e.string(),endDate:e.string(),earlyBookingDate:e.optional(e.string()),cupCode:e.optional(e.string()),cigCode:e.optional(e.string()),customerPromoterCode:e.optional(e.string()),billingReferenceCode:e.optional(e.string()),paymentReferenceCode:e.optional(e.string()),bookingFileDocument:e.optional(Jn),financialDeadlineList:e.optional(e.array(Yn)),deadlineList:e.optional(e.array(Xn)),paymentList:e.optional(e.array(Zn)),selectedPackageList:e.optional(e.array(nr)),selectedServiceList:e.array(tr),extraQuotaRefCode:e.optional(e.string()),extraQuoteServiceList:e.optional(e.array(tr)),getExtraQuoteFromSystem:e.optional(U),passengerList:e.array(ir),noteList:e.optional(e.array(Qn)),bookingFinancialInfo:e.optional(or),bookingFileCode:e.optional(e.string()),groupingPaxPolicy:e.optional(ze),groupBookingFile:e.optional(U),typeDownloadFile:e.optional(Ve),setBookingFileCodeFromStartDate:e.optional(U)}),e.check(e=>!!(e.customerDetail||e.customerRecordCode),`customerDetail or customerRecordCode is required`),e.transform(_t)),nn),cr=ht(e.object({RsStatus:w,BookingFileDetail:e.optional(On),PrintableDocumentsList:e.optional(En),TotalAmountDetailAfterCancellation:e.optional(xn),Base64DocContent:e.optional(e.string())}),`bookingFileDetail`),lr=Ze,K={customerRecordCode:e.string(),bookingFileCode:e.string()},ur=cr,dr=e.object({reschedulingCode:e.string(),description:e.optional(e.string()),expireDate:e.optional(e.string())}),fr=e.object({cancelOperationType:Ee,serviceRefType:Oe,serviceRefValue:e.string()}),pr=T(e.pipe(e.object({...K,currencyCode:e.optional(e.string()),deadlineList:e.optional(e.array(dr)),selectedPackageDetail:e.optional(nr),selectedPackageList:e.optional(e.pipe(e.array(nr),e.maxLength(1))),selectedServiceList:e.pipe(e.array(tr),e.minLength(1)),cancellableBookedServiceList:e.optional(e.array(fr)),passengerList:e.optional(e.array(ar))}),e.transform(gt(`selectedPackageList`,`selectedPackageDetail`))),rn),mr=T(e.object({...K,bookingFileStartDate:e.string(),newCustomerRecordCode:e.optional(e.string()),bookingFileReferenceName:e.optional(e.string()),travelAgentCode:e.optional(e.string()),billingReferenceCode:e.optional(e.string()),paymentReferenceCode:e.optional(e.string()),cupCode:e.optional(e.string()),cigCode:e.optional(e.string()),customerPromoterCode:e.optional(e.string()),bookingNote:e.optional(e.string()),passengerList:e.optional(e.array(ar)),statisticCodes:e.optional(G),bookingFinancialInfo:e.optional(or),financialDeadlineList:e.optional(e.array(e.object({reschedulingCode:e.string(),expireDate:e.string(),totalAmount:e.string()})))}),rn),hr=T(e.object({...K}),dn),gr=T(e.object({...K,fileStatus:k(me,{expiredDate:e.optional(e.string()),optionedFileExpireDatePolicy:e.optional(Ae)}),backOfficeRequest:e.optional(U),bookingFileDocument:e.optional(Jn),penalty:e.optional(e.object({apply:e.optional(U),specificCode:e.optional(e.string())})),simulateCancelAndGetPenaltyAmount:e.optional(U)}),un),_r=T(e.object({...K,bookingServiceRef:e.string(),bookingFileServiceStatus:e.literal(`NULLIFIED`),bookingFileServiceStatusDate:e.optional(e.string())}),dn),vr=e.object({paymentDate:e.string(),paymentNote:e.optional(e.string()),payerMasterCode:e.optional(e.string()),payerName:e.optional(e.string()),amount:e.string(),paymentType:be}),yr=T(e.pipe(e.object({bookingFileCode:e.optional(e.string()),bookingFileRefCode:e.optional(e.string()),paymentUser:e.optional(e.string()),enableMultiplePayments:U,operationType:Me,filePaymentList:e.pipe(e.array(vr),e.minLength(1))}),e.check(e=>!!(e.bookingFileCode||e.bookingFileRefCode),`bookingFileCode or bookingFileRefCode is required`)),an),br=k(m,{expireDate:e.optional(e.string())}),xr=e.object({code:e.optional(e.string()),number:e.optional(e.string())}),q={customerRecordCode:e.string(),customerPromoterCode:e.optional(e.string()),getSupplierInfo:e.optional(U),user:e.optional(e.string()),officeCode:e.optional(e.string())},Sr=e.object({...q,searchType:e.literal(v.FILE_CODE),bookingFileCode:e.string()}),Cr=e.object({...q,searchType:e.literal(v.PAX_NAME),firstPaxName:e.string()}),wr=e.object({...q,searchType:e.literal(v.PACKAGE_CODE),packageCode:e.string()}),Tr=e.object({...q,searchType:e.literal(v.OTHER),fileStatus:e.optional(br),startDate:e.optional(C),createdDate:e.optional(C),lastModificationDate:e.optional(C),insurance:e.optional(xr),isSearchForB2C:e.optional(U)}),Er=T(e.union([Sr,Cr,wr,Tr]),on),Dr=O(`BookingFileList`,E(`BookingFileDetail`,On)),J={SEARCH_REQUEST:`SearchMasterRecordRQ`,SEARCH_RESPONSE:`SearchMasterRecordRS`,UPSERT_REQUEST:`ManageMasterRecordRQ`,UPSERT_RESPONSE:`ManageMasterRecordRS`,BOOKING_REQUEST:`BookFileRQ`,BOOKING_RESPONSE:`BookingFileRS`,MOD_FILE_SERVICES_REQUEST:`ModFileServicesRQ`,MOD_FILE_HEADER_REQUEST:`ModFileHeaderRQ`,MOD_FILE_HEADER_RESPONSE:`ModFileHeaderRS`,CANCEL_FILE_REQUEST:`CancelFileRQ`,CANCEL_FILE_RESPONSE:`CancelFileRS`,SET_STATUS_REQUEST:`SetStatusRQ`,SET_STATUS_RESPONSE:`SetStatusRS`,SET_STATUS_SERVICE_REQUEST:`SetStatusServiceRQ`,SET_STATUS_SERVICE_RESPONSE:`SetStatusServiceRS`,FILE_PAYMENT_LIST_REQUEST:`FilePaymentListRQ`,FILE_PAYMENT_LIST_RESPONSE:`FilePaymentListRS`,AVES_SEARCH_REQUEST:`AvesSearchRQ`,SEARCH_PACKAGE_RESPONSE:`SearchPackageRS`,SEARCH_SERVICES_RESPONSE:`SearchServicesRS`,PACKAGE_DETAIL_REQUEST:`PackageDetailRQ`,PACKAGE_DETAIL_RESPONSE:`PackageDetailRS`,COMMIT_PACKAGE_REQUEST:`CommitPackRQ`,COMMIT_PACKAGE_RESPONSE:`CommitPackRS`,SEARCH_BOOKING_FILE_REQUEST:`SearchFileRQ`,SEARCH_BOOKING_FILE_RESPONSE:`SearchFileRS`};function Or(e,t){return{[e]:t}}const Y={search:`/interop/masterRecords/v2/rest/Search`,upsert:`/interop/masterRecords/v2/rest/InsertOrUpdate`,createBooking:`/interop/booking/v2/rest/CreateBookingFile`,modBookingServices:`/interop/booking/v2/rest/ModBookingFileServices`,modBookingHeader:`/interop/booking/v2/rest/ModBookingFileHeader`,cancelBooking:`/interop/booking/v2/rest/CancelBookingFile`,setBookingStatus:`/interop/booking/v2/rest/SetBookingFileStatus`,setBookingServiceStatus:`/interop/booking/v2/rest/SetBookingFileServiceStatus`,insertFilePaymentList:`/interop/booking/v2/rest/InsertFilePaymentList`,searchAvesPackages:`/interop/booking/v2/rest/SearchAvesPackages`,searchTopServices:`/interop/booking/v2/rest/SearchTopServices`,getPackageDetail:`/interop/booking/v2/rest/GetPackageDetail`,commitPackage:`/interop/booking/v2/rest/CommitPackage`,searchBookingFile:`/interop/booking/v2/rest/SearchBookingFile`};var kr=class{transport;constructor(e){this.transport=e}createBooking(e){return this.transport.invokeOp({op:`createBooking`,params:e,apiSchema:sr,endpoint:Y.createBooking,requestRoot:J.BOOKING_REQUEST,responseRoot:J.BOOKING_RESPONSE,responseSchema:cr})}modBookingServices(e){return this.transport.invokeOp({op:`modBookingServices`,params:e,apiSchema:pr,endpoint:Y.modBookingServices,requestRoot:J.MOD_FILE_SERVICES_REQUEST,responseRoot:J.BOOKING_RESPONSE,responseSchema:ur})}modBookingHeader(e){return this.transport.invokeOp({op:`modBookingHeader`,params:e,apiSchema:mr,endpoint:Y.modBookingHeader,requestRoot:J.MOD_FILE_HEADER_REQUEST,responseRoot:J.MOD_FILE_HEADER_RESPONSE,responseSchema:lr})}cancelBooking(e){return this.transport.invokeOp({op:`cancelBooking`,params:e,apiSchema:hr,endpoint:Y.cancelBooking,requestRoot:J.CANCEL_FILE_REQUEST,responseRoot:J.CANCEL_FILE_RESPONSE,responseSchema:lr})}setBookingStatus(e){return this.transport.invokeOp({op:`setBookingStatus`,params:e,apiSchema:gr,endpoint:Y.setBookingStatus,requestRoot:J.SET_STATUS_REQUEST,responseRoot:J.SET_STATUS_RESPONSE,responseSchema:ur})}setBookingServiceStatus(e){return this.transport.invokeOp({op:`setBookingServiceStatus`,params:e,apiSchema:_r,endpoint:Y.setBookingServiceStatus,requestRoot:J.SET_STATUS_SERVICE_REQUEST,responseRoot:J.SET_STATUS_SERVICE_RESPONSE,responseSchema:ur})}insertFilePaymentList(e){return this.transport.invokeOp({op:`insertFilePaymentList`,params:e,apiSchema:yr,endpoint:Y.insertFilePaymentList,requestRoot:J.FILE_PAYMENT_LIST_REQUEST,responseRoot:J.FILE_PAYMENT_LIST_RESPONSE,responseSchema:lr})}searchBookingFiles(e){return this.transport.invokeOp({op:`searchBookingFiles`,params:e,apiSchema:Er,endpoint:Y.searchBookingFile,requestRoot:J.SEARCH_BOOKING_FILE_REQUEST,responseRoot:J.SEARCH_BOOKING_FILE_RESPONSE,responseSchema:Dr})}};const Ar=C,X=b,jr=e.object({searchType:e.literal(d.CODE),recordCode:e.pipe(e.string(),e.minLength(5),e.maxLength(6)),languageCode:X}),Mr=e.object({searchType:e.literal(d.NAME),name:e.string(),city:e.optional(e.string()),languageCode:X}),Nr=e.object({searchType:e.literal(d.VATCODE),vatCode:e.string(),phoneNumber:e.optional(e.string()),languageCode:X}),Pr=e.object({searchType:e.literal(d.ZONE),zipCode:e.string(),countyCode:e.string(),city:e.optional(e.string()),languageCode:X}),Fr=e.object({searchType:e.literal(d.CATEGORY),categoryCode:e.string(),languageCode:X}),Ir=e.object({searchType:e.literal(d.EMAIL),email:e.string(),languageCode:X}),Lr=e.object({searchType:e.literal(d.LASTMODDATE),lastModificationDate:Ar,languageCode:X}),Rr=e.object({searchType:e.literal(d.SEARCH_FIELD),searchFieldValue:e.string(),languageCode:X}),zr=e.object({searchType:e.literal(d.EXTERNAL_REF_CODE),searchFieldValue:e.string(),languageCode:X}),Br=T(e.union([jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr]),jt);e.pipe(e.object({RqHeader:Ye,SearchMasterRecord:Br}),e.transform(e=>{let{SearchMasterRecord:t,RqHeader:n,...r}=e;return{RqHeader:n,...t,...r}}));const Vr=O(`MasterRecordList`,E(`MasterRecordDetail`,W));e.object({RqHeader:Ye,MasterRecordDetail:W});const Hr=ht(e.object({RsStatus:w,MasterRecordDetail:e.optional(W)}),`masterRecordDetail`);var Ur=class{transport;constructor(e){this.transport=e}search(e){return this.transport.invokeOp({op:`search`,params:e,apiSchema:Br,endpoint:Y.search,requestRoot:J.SEARCH_REQUEST,responseRoot:J.SEARCH_RESPONSE,responseSchema:Vr})}upsertRecord(e){return this.transport.invokeOp({op:`upsertRecord`,params:e,apiSchema:Bn,bodyKey:`MasterRecordDetail`,endpoint:Y.upsert,requestRoot:J.UPSERT_REQUEST,responseRoot:J.UPSERT_RESPONSE,responseSchema:Hr})}};const Wr=E(`FeatureDetail`,e.object({"@Code":e.optional(e.string()),"@Name":e.optional(e.string()),ValueCode:e.optional(e.string()),ValueName:e.optional(e.string())})),Gr=e.object({"@PackageCode":e.optional(e.string()),"@PackageReference":e.optional(e.string()),"@PackageServiceType":e.optional(e.string()),"@ServiceCodeForPackageDetail":e.optional(e.string())}),Kr=E(`SubServiceDetail`,e.object({"@ssCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SubServiceType:e.optional(e.string()),SubServiceLevel:e.optional(S),StartDate:e.optional(e.string()),EndDate:e.optional(e.string())})),qr=E(`ServiceDetail`,e.object({"@sCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),AvesServiceType:e.optional(e.string()),TOServiceType:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),RefPackageInfo:e.optional(Gr),SubServiceList:e.optional(Kr)})),Jr=e.object({"@pCode":e.optional(e.string()),FirstDescription:e.optional(e.string()),SecondDescription:e.optional(e.string()),FrequencyType:e.optional(e.string()),ProgramType:e.optional(e.string()),StartValidation:e.optional(e.string()),EndValidation:e.optional(e.string()),StartDate:e.optional(e.string()),EndDate:e.optional(e.string()),BasePrice:e.optional(S),BasePax:e.optional(S),CanCommitPack:e.optional(S),FeatureList:e.optional(Wr),ServiceList:e.optional(qr)}),Yr=E(`PackageDetail`,Jr),Xr=e.object({code:e.string(),name:e.optional(e.string())}),Zr=e.object({getAllDeptDate:e.optional(U),getFlightPlan:e.optional(U),getAllAccomodation:e.optional(U),getRealAvailability:e.optional(U),minStay:e.optional(x),maxStay:e.optional(x)}),Qr=e.object({compatibleAccomodation:e.optional(U),alternativeAccomodation:e.optional(U)}),$r=e.object({customerRecordCode:e.string(),languageCode:b,currencyCode:e.optional(e.string()),startDate:e.string(),endDate:e.string(),earlyBookingDate:e.optional(e.string()),passengerList:e.pipe(e.array(ir),e.minLength(1)),avesSearchType:e.optional(Ue),paxQty:e.optional(x),paxQtyCriteria:e.optional(Ge),discartNotAvailables:e.optional(U),discartNotAvailablesMinSales:e.optional(U),discartNotAvailablesDaysInOut:e.optional(U),discardPriceZero:e.optional(U),discardZeroPriceDays:e.optional(U),destination:e.optional(Hn),objectTypeCode:e.optional(e.string()),featureList:e.optional(e.array(Xr)),servOrPackCode:e.optional(e.string()),servOrPackDesc:e.optional(e.string()),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),suballotmentCode:e.optional(e.string()),markupCode:e.optional(e.string()),statisticCodes:e.optional(G),mergeBoardAndAccomodation:e.optional(U),packageParams:e.optional(Zr),topServiceParams:e.optional(Qr),getDocumentation:e.optional(U)}),ei=e.required($r,[`languageCode`,`avesSearchType`]);function ti(e){let{customerRecordCode:t,languageCode:n,currencyCode:r,startDate:i,endDate:a,earlyBookingDate:o,passengerList:s,paxQty:c,paxQtyCriteria:l,avesSearchType:u,...ee}=e;return{BaseSearch:ft({customerRecordCode:t,languageCode:n,currencyCode:r,startDate:i,endDate:a,earlyBookingDate:o,passengerList:s},cn),...ft({...ee,avesSearchType:u,paxQty:c??s.length,paxQtyCriteria:l??We.GREATER_OR_EQUAL},ln)}}const ni=e.pipe(ei,e.transform(ti)),ri=O(`PackageList`,Yr),ii=O(`ServiceList`,qr),ai=e.object({serviceCode:e.string(),packageRow:e.string()}),oi=T(e.object({customerRecordCode:e.string(),languageCode:b,currencyCode:e.optional(e.string()),packageCode:e.string(),startDate:e.string(),endDate:e.string(),priceListCode:e.optional(e.string()),costListCode:e.optional(e.string()),markupCode:e.optional(e.string()),statisticCodes:e.optional(G),selectedServiceList:e.pipe(e.array(ai),e.minLength(1)),passengerList:e.optional(e.array(ir))}),sn),si=ht(e.object({RsStatus:w,PackageDetail:e.optional(Jr)}),`packageDetail`),ci=T(e.object({packageCode:e.string()}),dn),li=Ze;var ui=class{transport;constructor(e){this.transport=e}#e(e,t){return{...this.transport.languageCode&&{languageCode:this.transport.languageCode},avesSearchType:t,...e}}searchPackages(e){return this.transport.invokeOp({op:`searchPackages`,params:this.#e(e,y.PACKAGE),apiSchema:ni,endpoint:Y.searchAvesPackages,requestRoot:J.AVES_SEARCH_REQUEST,responseRoot:J.SEARCH_PACKAGE_RESPONSE,responseSchema:ri})}searchTopServices(e){return this.transport.invokeOp({op:`searchTopServices`,params:this.#e(e,y.SERVICE),apiSchema:ni,endpoint:Y.searchTopServices,requestRoot:J.AVES_SEARCH_REQUEST,responseRoot:J.SEARCH_SERVICES_RESPONSE,responseSchema:ii})}getPackageDetail(e){return this.transport.invokeOp({op:`getPackageDetail`,params:e,apiSchema:oi,endpoint:Y.getPackageDetail,requestRoot:J.PACKAGE_DETAIL_REQUEST,responseRoot:J.PACKAGE_DETAIL_RESPONSE,responseSchema:si})}commitPackage(e){return this.transport.invokeOp({op:`commitPackage`,params:e,apiSchema:ci,endpoint:Y.commitPackage,requestRoot:J.COMMIT_PACKAGE_REQUEST,responseRoot:J.COMMIT_PACKAGE_RESPONSE,responseSchema:li})}};const di={VALIDATION:`validation`,API:`api`,UNKNOWN:`unknown`};var Z=class extends Error{kind;status;code;constructor(e,t,n,r){super(t),this.kind=e,this.status=n,this.code=r,this.name=`AvesError`}};function Q(e){return new Z(di.VALIDATION,e)}function fi(e,t,n){return new Z(di.API,e,t,n)}function pi(e){return new Z(di.UNKNOWN,e)}function mi(e){return e.map(hi).join(`; `)}function hi(e){let t=gi(e.path),n=e.message??`Invalid value`;return t?`${t}: ${n}`:n}function gi(e){if(!e||e.length===0)return;let t=e.map(_i).filter(e=>e!==void 0);return t.length>0?t.join(`.`):void 0}function _i(e){if(typeof e==`string`||typeof e==`number`)return String(e);if(typeof e==`object`&&e&&`key`in e)return String(e.key)}function vi(e){return e instanceof Error&&e.name===`AbortError`}function yi(e){return{success:!0,data:e}}function $(e){return{success:!1,error:e}}function bi(e){let t=new AbortController;if(!e||e<=0)return{signal:t.signal};let n=setTimeout(()=>t.abort(),e);return{signal:t.signal,clear:()=>clearTimeout(n)}}function xi(e,t){try{let n=new URL(e),r=(n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname)+t;return new URL(r,n)}catch(e){throw Q(`Invalid baseURL: ${e instanceof Error?e.message:`Invalid URL format`}`)}}function Si(e,t){if(!t.startsWith(`/`))throw Q(`Invalid endpoint: endpoint must start with '/' but got '${t}'`);let n=xi(e.replace(/\/$/,``),t);if(n.protocol!==`http:`&&n.protocol!==`https:`)throw Q(`Invalid protocol: baseURL must use http:// or https:// but got '${n.protocol}'`);return n.toString()}const Ci={ignoreAttributes:!1,attributeNamePrefix:`@`,parseAttributeValue:!1,trimValues:!0,ignoreNameSpace:!0,removeNSPrefix:!0,parseTagValue:!1},wi={ignoreAttributes:!1,attributeNamePrefix:`@`,suppressEmptyNode:!0},Ti=new o(Ci),Ei=new a(wi);function Di(e){try{return Ei.build(e)}catch(e){throw Q(`Failed to convert JSON to XML: ${e instanceof Error?e.message:`Unknown error`}`)}}function Oi(e){try{return Ti.parse(e)}catch(e){throw Q(`Failed to convert XML to JSON: ${e instanceof Error?e.message:`Unknown error`}`)}}var ki=class{options;constructor(e){this.options=e}get languageCode(){return this.options.languageCode}createRqHeader(){return{"@HostID":this.options.hostID,"@Xtoken":this.options.xtoken,"@Interface":`WEB`,"@UserName":`WEB`,...this.options.languageCode&&{"@LanguageCode":this.options.languageCode}}}toAvesError(e,n){return e instanceof Z?e:e instanceof t?Q(`Validation error: ${mi(e.issues)}`):e instanceof Error?pi(e.message):pi(n)}handleApiStatus(e){let{rsStatus:t}=e;return t.status===`OK`?yi(e):$(fi(t.errorDescription??``,t.status,t.errorCode))}async request(e,t,n,a){let{signal:o,clear:s}=bi(this.options.timeoutMs??3e4);try{let s=await i(Si(this.options.baseURL,e),{method:`POST`,headers:{"Content-Type":`application/xml`},body:Di(t),signal:o}),c=await s.body.text();if(s.statusCode<200||s.statusCode>299)return $(fi(c.slice(0,4096),`ERROR`,s.statusCode));let l=Oi(c)[n];if(!l)return $(Q(`Invalid response structure: missing root element '${n}'`));let u=r(a,l);return u.success?this.handleApiStatus(u.output):$(Q(`Invalid response format: ${mi(u.issues)}`))}catch(e){return vi(e)?$(fi(`Request timed out`,`TIMEOUT`)):$(this.toAvesError(e,`Unknown error occurred`))}finally{s?.()}}async invokeOp(e){try{let t=n(e.apiSchema,e.params),r=e.bodyKey?{[e.bodyKey]:t}:t;return this.request(e.endpoint,Or(e.requestRoot,{RqHeader:this.createRqHeader(),...r}),e.responseRoot,e.responseSchema)}catch(t){return $(this.toAvesError(t,`Validation error occurred during ${e.op}`))}}},Ai=class{transport;master;booking;packages;constructor(e,t={}){this.transport=t.transport??new ki(e),this.master=t.master??new Ur(this.transport),this.booking=t.booking??new kr(this.transport),this.packages=t.packages??new ui(this.transport)}};export{Ai as AvesClient,Z as AvesError,y as AvesSearchType,Ue as AvesSearchTypeSchema,he as AvesServiceType,h as AvesServiceTypeSchema,ki as AvesTransport,_e as BookedServiceStatus,ve as BookedServiceStatusSchema,kr as BookingClient,de as BookingFileStatus,fe as BookingFileStatusSchema,p as BookingFileStatusWire,m as BookingFileStatusWireSchema,Te as CancelOperationType,Ee as CancelOperationTypeSchema,le as CarrierType,ue as CarrierTypeSchema,Le as CostPriceType,_ as CostPriceTypeSchema,xe as CustomerPaymentType,Se as CustomerPaymentTypeSchema,Ke as DestinationType,qe as DestinationTypeSchema,Ne as DocumentType,Pe as DocumentTypeSchema,je as FilePaymentOperationType,Me as FilePaymentOperationTypeSchema,c as Gender,l as GenderSchema,Re as GroupingPaxPolicy,ze as GroupingPaxPolicySchema,ae as InsertCriteria,oe as InsertCriteriaSchema,Fe as MakeDocumentTo,Ie as MakeDocumentToSchema,se as MasterPaymentType,ce as MasterPaymentTypeSchema,Ur as MasterRecordsClient,ke as OptionedExpirePolicy,Ae as OptionedExpirePolicySchema,ui as PackageCatalogClient,Ce as PassengerCategory,we as PassengerCategorySchema,We as PaxQtyCriteria,Ge as PaxQtyCriteriaSchema,ye as PaymentType,be as PaymentTypeSchema,f as RecordStatus,ie as RecordStatusSchema,ne as RecordType,re as RecordTypeSchema,u as RsStatusValue,ee as RsStatusValueSchema,v as SearchBookingFileType,He as SearchBookingFileTypeSchema,d as SearchMasterType,te as SearchMasterTypeSchema,De as ServiceRefType,Oe as ServiceRefTypeSchema,pe as SetFileStatusValue,me as SetFileStatusValueSchema,ge as ToServiceType,g as ToServiceTypeSchema,Be as TypeDownloadFile,Ve as TypeDownloadFileSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aves-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "TypeScript SDK for AVES XML REST",
5
5
  "homepage": "https://github.com/simoneguglielmi/aves-sdk#readme",
6
6
  "repository": [
@@ -36,11 +36,12 @@
36
36
  }
37
37
  },
38
38
  "sideEffects": false,
39
- "files": [
40
- "dist",
41
- "README.md",
42
- "CHANGELOG.md"
43
- ],
39
+ "files": [
40
+ "dist/index.mjs",
41
+ "dist/index.d.mts",
42
+ "README.md",
43
+ "CHANGELOG.md"
44
+ ],
44
45
  "publishConfig": {
45
46
  "access": "public"
46
47
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":["#prepareSearch","r"],"sources":["../src/utils/enum.ts","../src/schemas/enums.ts","../src/schemas/common.ts","../src/utils/case-transform.ts","../src/utils/booking-transform.ts","../src/utils/schema-transform.ts","../src/utils/wire-shapes.ts","../src/schemas/booking-shared.ts","../src/schemas/booking-response.ts","../src/schemas/master-record.ts","../src/schemas/booking-file.ts","../src/schemas/booking-ops.ts","../src/schemas/search-booking-file.ts","../src/xml/root.ts","../src/client/endpoints.ts","../src/client/booking.ts","../src/schemas/search.ts","../src/schemas/upsert.ts","../src/client/master-records.ts","../src/schemas/package-catalog.ts","../src/client/packages.ts","../src/error.ts","../src/utils/result.ts","../src/utils/timeout.ts","../src/utils/url.ts","../src/xml/client.ts","../src/client/transport.ts","../src/client.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nexport type EnumValue<T extends Record<string, string>> = T[keyof T];\n\n/**\n * Build a Valibot picklist from a string object enum.\n * The cast is required: inside a generic, `Object.values` resolves against the\n * constraint (`Record<string, string>`) and yields `string[]`, which collapses\n * the picklist's in/out types to `string`.\n */\nexport function enumSchema<const T extends Record<string, string>>(\n\tenumObject: T,\n) {\n\treturn v.picklist(Object.values(enumObject) as EnumValue<T>[]);\n}\n","import { type EnumValue, enumSchema } from \"../utils/enum.js\";\n\n// ---------------------------------------------------------------------------\n// Shared / cross-domain\n// ---------------------------------------------------------------------------\n\nexport const Gender = {\n\tM: \"M\",\n\tF: \"F\",\n} as const;\nexport type Gender = EnumValue<typeof Gender>;\nexport const GenderSchema = enumSchema(Gender);\n\nexport const RsStatusValue = {\n\tOK: \"OK\",\n\tERROR: \"ERROR\",\n\tWARNING: \"WARNING\",\n\tTIMEOUT: \"TIMEOUT\",\n} as const;\nexport type RsStatusValue = EnumValue<typeof RsStatusValue>;\nexport const RsStatusValueSchema = enumSchema(RsStatusValue);\n\n// ---------------------------------------------------------------------------\n// Master records\n// ---------------------------------------------------------------------------\n\nexport const SearchMasterType = {\n\tCODE: \"CODE\",\n\tNAME: \"NAME\",\n\tVATCODE: \"VATCODE\",\n\tZONE: \"ZONE\",\n\tCATEGORY: \"CATEGORY\",\n\tEMAIL: \"EMAIL\",\n\tLASTMODDATE: \"LASTMODDATE\",\n\tSEARCH_FIELD: \"SEARCH_FIELD\",\n\tEXTERNAL_REF_CODE: \"EXTERNAL_REF_CODE\",\n} as const;\nexport type SearchMasterType = EnumValue<typeof SearchMasterType>;\nexport const SearchMasterTypeSchema = enumSchema(SearchMasterType);\n\n/** MasterRecord.txt:214-219 / Booking CPX.txt:1960-1964: CUSTOMER/SUPPLIER/VOUCHER/SUPPLIER_VOUCHER/GENERAL */\nexport const RecordType = {\n\tCUSTOMER: \"CUSTOMER\",\n\tSUPPLIER: \"SUPPLIER\",\n\tVOUCHER: \"VOUCHER\",\n\tSUPPLIER_VOUCHER: \"SUPPLIER_VOUCHER\",\n\tGENERAL: \"GENERAL\",\n} as const;\nexport type RecordType = EnumValue<typeof RecordType>;\nexport const RecordTypeSchema = enumSchema(RecordType);\n\nexport const RecordStatus = {\n\tENABLED: \"ENABLED\",\n\tDISABLED: \"DISABLED\",\n\tWARNING: \"WARNING\",\n\tBLACKLISTED: \"BLACKLISTED\",\n} as const;\nexport type RecordStatus = EnumValue<typeof RecordStatus>;\nexport const RecordStatusSchema = enumSchema(RecordStatus);\n\n/** Upsert insertCriteria: S always insert · N skip if exists · T update all · M secondary only */\nexport const InsertCriteria = {\n\tS: \"S\",\n\tN: \"N\",\n\tT: \"T\",\n\tM: \"M\",\n} as const;\nexport type InsertCriteria = EnumValue<typeof InsertCriteria>;\nexport const InsertCriteriaSchema = enumSchema(InsertCriteria);\n\nexport const MasterPaymentType = {\n\tCASH: \"CASH\",\n\tBANK: \"BANK\",\n\tRID: \"RID\",\n\tRIBA: \"RIBA\",\n\tSPECIFIC_CODE: \"SPECIFIC_CODE\",\n} as const;\nexport type MasterPaymentType = EnumValue<typeof MasterPaymentType>;\nexport const MasterPaymentTypeSchema = enumSchema(MasterPaymentType);\n\nexport const CarrierType = {\n\tNOT_SET: \"NOT_SET\",\n\tFLIGHT: \"FLIGHT\",\n\tSHIP: \"SHIP\",\n\tTRAIN: \"TRAIN\",\n\tRENTCAR: \"RENTCAR\",\n\tBUS: \"BUS\",\n\tDP_HOTEL: \"DP_HOTEL\",\n\tTO_HOTEL: \"TO_HOTEL\",\n\tTO_TOUR: \"TO_TOUR\",\n\tTO_HOTEL_AND_TOUR: \"TO_HOTEL_AND_TOUR\",\n\tDP_AUTO: \"DP_AUTO\",\n\tDP_GDS_NAVI: \"DP_GDS_NAVI\",\n\tDP_GDS_VOLI: \"DP_GDS_VOLI\",\n\tTOUR_OPERATOR: \"TOUR_OPERATOR\",\n\tTICKETING_EV: \"TICKETING_EV\",\n\tOTHER: \"OTHER\",\n} as const;\nexport type CarrierType = EnumValue<typeof CarrierType>;\nexport const CarrierTypeSchema = enumSchema(CarrierType);\n\n// ---------------------------------------------------------------------------\n// Booking file / services\n// ---------------------------------------------------------------------------\n\nexport const BookingFileStatus = {\n\tQUOTATION: \"QUOTATION\",\n\tWORK_IN_PROGRESS: \"WORK_IN_PROGRESS\",\n\tCONFIRMED: \"CONFIRMED\",\n\tOPTIONED: \"OPTIONED\",\n\tCANCELED: \"CANCELED\",\n} as const;\nexport type BookingFileStatus = EnumValue<typeof BookingFileStatus>;\nexport const BookingFileStatusSchema = enumSchema(BookingFileStatus);\n\nexport const SetFileStatusValue = {\n\t...BookingFileStatus,\n\tNULLIFIED: \"NULLIFIED\",\n} as const;\nexport type SetFileStatusValue = EnumValue<typeof SetFileStatusValue>;\nexport const SetFileStatusValueSchema = enumSchema(SetFileStatusValue);\n\n/** BOOKEDFILE response aliases (includes non-canonical wire forms). */\nexport const BookingFileStatusWire = {\n\tQUOTATION: \"QUOTATION\",\n\tWORK_IN_PROGRESS: \"WORK_IN_PROGRESS\",\n\tCONFIRM: \"CONFIRM\",\n\tCONFIRMED: \"CONFIRMED\",\n\tOPTION: \"OPTION\",\n\tOPTIONED: \"OPTIONED\",\n\tREQUEST: \"REQUEST\",\n\tREQUESTED: \"REQUESTED\",\n\tNULLIFIED: \"NULLIFIED\",\n\tCANCELED: \"CANCELED\",\n} as const;\nexport type BookingFileStatusWire = EnumValue<typeof BookingFileStatusWire>;\nexport const BookingFileStatusWireSchema = enumSchema(BookingFileStatusWire);\n\nexport const AvesServiceType = {\n\tTOP: \"TOP\",\n\tTOP_SS: \"TOP_SS\",\n\tADV: \"ADV\",\n\tGRP: \"GRP\",\n\tOTHER: \"OTHER\",\n} as const;\nexport type AvesServiceType = EnumValue<typeof AvesServiceType>;\nexport const AvesServiceTypeSchema = enumSchema(AvesServiceType);\n\n/**\n * Booking.txt:575-589 documents 13 values; RESIDENCE and TOUR are undocumented\n * wire dialect seen in real SearchServicesRS examples (Booking.txt:3376, :4207).\n */\nexport const ToServiceType = {\n\tACCOMODATION: \"ACCOMODATION\",\n\tTRANSPORT: \"TRANSPORT\",\n\tCHARTER: \"CHARTER\",\n\tTRANSFER: \"TRANSFER\",\n\tPULLMAN: \"PULLMAN\",\n\tFERRY: \"FERRY\",\n\tCRUISE: \"CRUISE\",\n\tINSURANCE: \"INSURANCE\",\n\tEXTRAFEE: \"EXTRAFEE\",\n\tPENALTY: \"PENALTY\",\n\tPROMO: \"PROMO\",\n\tOTHER: \"OTHER\",\n\tNOT_SET: \"NOT_SET\",\n\tRESIDENCE: \"RESIDENCE\",\n\tTOUR: \"TOUR\",\n} as const;\nexport type ToServiceType = EnumValue<typeof ToServiceType>;\nexport const ToServiceTypeSchema = enumSchema(ToServiceType);\n\nexport const BookedServiceStatus = {\n\tREQUEST: \"REQUEST\",\n\tALLOTMENT_REQUEST: \"ALLOTMENT_REQUEST\",\n\tCONFIRMED_REQUEST: \"CONFIRMED_REQUEST\",\n\tCONFIRMED_EXTRA_ALLOTMENT: \"CONFIRMED_EXTRA_ALLOTMENT\",\n\tWAITLISTED: \"WAITLISTED\",\n\tALLOTMENT: \"ALLOTMENT\",\n\tREFUSED: \"REFUSED\",\n\tNULLIFIED: \"NULLIFIED\",\n\tCANCELED: \"CANCELED\",\n\tMESSAGE: \"MESSAGE\",\n} as const;\nexport type BookedServiceStatus = EnumValue<typeof BookedServiceStatus>;\nexport const BookedServiceStatusSchema = enumSchema(BookedServiceStatus);\n\n/** File payment list / booking paymentList type codes. */\nexport const PaymentType = {\n\tC: \"C\",\n\tB: \"B\",\n\tD: \"D\",\n\tT: \"T\",\n\tP: \"P\",\n\tR: \"R\",\n\tA: \"A\",\n\tH: \"H\",\n\tI: \"I\",\n\tJ: \"J\",\n\tK: \"K\",\n\tL: \"L\",\n\tM: \"M\",\n\tN: \"N\",\n\tO: \"O\",\n\tQ: \"Q\",\n\tS: \"S\",\n\tU: \"U\",\n\tV: \"V\",\n} as const;\nexport type PaymentType = EnumValue<typeof PaymentType>;\nexport const PaymentTypeSchema = enumSchema(PaymentType);\n\nexport const CustomerPaymentType = {\n\tCASH: \"CASH\",\n\tBANK: \"BANK\",\n\tRID: \"RID\",\n\tRIBA: \"RIBA\",\n\tSPECIFIC_CODE: \"SPECIFIC_CODE\",\n\tNOT_SET: \"NOT_SET\",\n} as const;\nexport type CustomerPaymentType = EnumValue<typeof CustomerPaymentType>;\nexport const CustomerPaymentTypeSchema = enumSchema(CustomerPaymentType);\n\nexport const PassengerCategory = {\n\tAD: \"AD\",\n\tCH: \"CH\",\n\tIN: \"IN\",\n\tOV: \"OV\",\n} as const;\nexport type PassengerCategory = EnumValue<typeof PassengerCategory>;\nexport const PassengerCategorySchema = enumSchema(PassengerCategory);\n\nexport const CancelOperationType = {\n\tNULLIFY: \"NULLIFY\",\n\tDELETE: \"DELETE\",\n} as const;\nexport type CancelOperationType = EnumValue<typeof CancelOperationType>;\nexport const CancelOperationTypeSchema = enumSchema(CancelOperationType);\n\nexport const ServiceRefType = {\n\tRPH: \"RPH\",\n\tFILE: \"FILE\",\n} as const;\nexport type ServiceRefType = EnumValue<typeof ServiceRefType>;\nexport const ServiceRefTypeSchema = enumSchema(ServiceRefType);\n\nexport const OptionedExpirePolicy = {\n\tNOT_SET: \"NOT_SET\",\n\tCONSIDER_HOLIDAY: \"CONSIDER_HOLIDAY\",\n\tCONSIDER_HOLIDAY_AND_SATURDAY: \"CONSIDER_HOLIDAY_AND_SATURDAY\",\n} as const;\nexport type OptionedExpirePolicy = EnumValue<typeof OptionedExpirePolicy>;\nexport const OptionedExpirePolicySchema = enumSchema(OptionedExpirePolicy);\n\nexport const FilePaymentOperationType = {\n\tAbsoluteAmountsInsertion: \"AbsoluteAmountsInsertion\",\n\tFinalAmountToAchieve: \"FinalAmountToAchieve\",\n\tFinalAmountToAchieveWithoutControls: \"FinalAmountToAchieveWithoutControls\",\n} as const;\nexport type FilePaymentOperationType = EnumValue<\n\ttypeof FilePaymentOperationType\n>;\nexport const FilePaymentOperationTypeSchema = enumSchema(\n\tFilePaymentOperationType,\n);\n\nexport const DocumentType = {\n\tVISA_REQUEST: \"VISA_REQUEST\",\n\tTRAVEL_INFORMATION: \"TRAVEL_INFORMATION\",\n\tVOUCHER: \"VOUCHER\",\n\tBOOKING_CONTRACT: \"BOOKING_CONTRACT\",\n\tBOOKING_CONFIRMATION: \"BOOKING_CONFIRMATION\",\n\tSUPPLIER_SERVICE_LIST: \"SUPPLIER_SERVICE_LIST\",\n\tINVOICE: \"INVOICE\",\n\tPROFORMA_INVOICE: \"PROFORMA_INVOICE\",\n\tADEGUAMENTO: \"ADEGUAMENTO\",\n\tRESERVATION_FORM: \"RESERVATION_FORM\",\n\tOPEN_XML: \"OPEN_XML\",\n\tSALES_INVOICE: \"SALES_INVOICE\",\n\tTICKETING_TMASTER: \"TICKETING_TMASTER\",\n\tSUMMARY_FORM: \"SUMMARY_FORM\",\n} as const;\nexport type DocumentType = EnumValue<typeof DocumentType>;\nexport const DocumentTypeSchema = enumSchema(DocumentType);\n\nexport const MakeDocumentTo = {\n\tBOOKING_CUSTOMER: \"BOOKING_CUSTOMER\",\n\tFIRST_PASSENGER: \"FIRST_PASSENGER\",\n} as const;\nexport type MakeDocumentTo = EnumValue<typeof MakeDocumentTo>;\nexport const MakeDocumentToSchema = enumSchema(MakeDocumentTo);\n\nexport const CostPriceType = {\n\tPAX_QTY_DAY: \"PAX_QTY_DAY\",\n\tPAX_QTY_NIGHT: \"PAX_QTY_NIGHT\",\n\tPAX_QTY_WEEK: \"PAX_QTY_WEEK\",\n\tPAX_QTY: \"PAX_QTY\",\n\tPAX_DAY: \"PAX_DAY\",\n\tPAX_NIGHT: \"PAX_NIGHT\",\n\tPAX_WEEK: \"PAX_WEEK\",\n\tPAX: \"PAX\",\n\tQTY_DAY: \"QTY_DAY\",\n\tQTY_NIGHT: \"QTY_NIGHT\",\n\tQTY_WEE: \"QTY_WEE\",\n\tQTY: \"QTY\",\n\tDAY: \"DAY\",\n\tNIGHT: \"NIGHT\",\n\tWEEK: \"WEEK\",\n\tFORFAIT: \"FORFAIT\",\n} as const;\nexport type CostPriceType = EnumValue<typeof CostPriceType>;\nexport const CostPriceTypeSchema = enumSchema(CostPriceType);\n\nexport const GroupingPaxPolicy = {\n\tGROUPED_PAX: \"GROUPED_PAX\",\n\tNOT_GROUPED_PAX: \"NOT_GROUPED_PAX\",\n\tONE_PAX_ONLY: \"ONE_PAX_ONLY\",\n} as const;\nexport type GroupingPaxPolicy = EnumValue<typeof GroupingPaxPolicy>;\nexport const GroupingPaxPolicySchema = enumSchema(GroupingPaxPolicy);\n\nexport const TypeDownloadFile = {\n\tAVES2AVES: \"AVES2AVES\",\n\tAVES2AVESVIA: \"AVES2AVESVIA\",\n\tAVES2AVESITA: \"AVES2AVESITA\",\n} as const;\nexport type TypeDownloadFile = EnumValue<typeof TypeDownloadFile>;\nexport const TypeDownloadFileSchema = enumSchema(TypeDownloadFile);\n\nexport const SearchBookingFileType = {\n\tFILE_CODE: \"FILE_CODE\",\n\tPAX_NAME: \"PAX_NAME\",\n\tPACKAGE_CODE: \"PACKAGE_CODE\",\n\tOTHER: \"OTHER\",\n} as const;\nexport type SearchBookingFileType = EnumValue<typeof SearchBookingFileType>;\nexport const SearchBookingFileTypeSchema = enumSchema(SearchBookingFileType);\n\n// ---------------------------------------------------------------------------\n// Package / Program catalog\n// ---------------------------------------------------------------------------\n\nexport const AvesSearchType = {\n\tSERVICE: \"SERVICE\",\n\tPROGRAM: \"PROGRAM\",\n\tPACKAGE: \"PACKAGE\",\n} as const;\nexport type AvesSearchType = EnumValue<typeof AvesSearchType>;\nexport const AvesSearchTypeSchema = enumSchema(AvesSearchType);\n\nexport const PaxQtyCriteria = {\n\tGREATER_THAN: \"GREATER_THAN\",\n\tGREATER_OR_EQUAL: \"GREATER_OR_EQUAL\",\n\tEQUAL_TO: \"EQUAL_TO\",\n\tLESS_OR_EQUAL: \"LESS_OR_EQUAL\",\n\tLESS_THAN: \"LESS_THAN\",\n} as const;\nexport type PaxQtyCriteria = EnumValue<typeof PaxQtyCriteria>;\nexport const PaxQtyCriteriaSchema = enumSchema(PaxQtyCriteria);\n\nexport const DestinationType = {\n\tCODE: \"CODE\",\n\tSUB_LOCALITY: \"SUB_LOCALITY\",\n\tLOCALITY: \"LOCALITY\",\n\tSUB_SUB_ISLAND: \"SUB_SUB_ISLAND\",\n\tSUB_ISLAND: \"SUB_ISLAND\",\n\tISLAND_COUNTY: \"ISLAND_COUNTY\",\n\tSUB_ARCHIPELAGO: \"SUB_ARCHIPELAGO\",\n\tARCHIPELAGO: \"ARCHIPELAGO\",\n\tREGION_STATE: \"REGION_STATE\",\n\tSUB_SUB_NATION: \"SUB_SUB_NATION\",\n\tSUB_NATION: \"SUB_NATION\",\n\tNATION: \"NATION\",\n\tSUB_SUB_CONTINENT: \"SUB_SUB_CONTINENT\",\n\tSUB_CONTINENT: \"SUB_CONTINENT\",\n\tCONTINENT: \"CONTINENT\",\n} as const;\nexport type DestinationType = EnumValue<typeof DestinationType>;\nexport const DestinationTypeSchema = enumSchema(DestinationType);\n","import * as v from \"valibot\";\nimport { createResponseSchema } from \"../utils/schema-transform.js\";\nimport { RsStatusValueSchema } from \"./enums.js\";\n\n/** AVES language code (`01` Italian, `02` English, …) */\nexport const LanguageCodeSchema = v.pipe(\n\tv.string(),\n\tv.minLength(2),\n\tv.maxLength(2),\n);\n\nexport const OptionalLanguageCodeSchema = v.optional(LanguageCodeSchema);\n\n/** XML often sends numbers as strings (or vice versa). */\nexport const StringishSchema = v.union([v.string(), v.number()]);\n\n/** Catalog/boolish wire fields that may arrive as string | number | boolean. */\nexport const StringishBoolSchema = v.union([\n\tv.string(),\n\tv.number(),\n\tv.boolean(),\n]);\n\nexport const DateRangeSchema = v.object({\n\tminDate: v.string(),\n\tmaxDate: v.string(),\n});\n\n/**\n * Request header schema with authentication credentials\n */\nexport const RqHeaderSchema = v.object({\n\t\"@HostID\": v.pipe(v.string(), v.minLength(6), v.maxLength(6)),\n\t\"@Xtoken\": v.string(),\n\t\"@Interface\": v.literal(\"WEB\"),\n\t\"@UserName\": v.literal(\"WEB\"),\n\t\"@LanguageCode\": OptionalLanguageCodeSchema,\n});\n\nconst warningsSchema = v.optional(v.string());\n\n/**\n * Response status schema indicating success, error, or warning\n */\nexport const RsStatusSchema = v.pipe(\n\tv.object({\n\t\t\"@Status\": RsStatusValueSchema,\n\t\tErrorCode: v.optional(\n\t\t\tv.pipe(\n\t\t\t\tStringishSchema,\n\t\t\t\tv.transform((val) => Number(val)),\n\t\t\t),\n\t\t),\n\t\tErrorDescription: v.optional(v.string()),\n\t\tWarnings: warningsSchema,\n\t}),\n\tv.transform((input) => {\n\t\treturn {\n\t\t\tstatus: input[\"@Status\"],\n\t\t\terrorCode: input.ErrorCode,\n\t\t\terrorDescription: input.ErrorDescription,\n\t\t\twarnings: input.Warnings,\n\t\t};\n\t}),\n);\n\n/** Cancel / ModHeader / CommitPackage / InsertFilePaymentList */\nexport const StatusOnlyResponseSchema = createResponseSchema(\n\tv.object({ RsStatus: RsStatusSchema }),\n);\n","import type { WireShape } from \"./wire-shapes.js\";\n\n/**\n * camelCase key → wire spelling that a plain Capitalize can't produce.\n * Single source of truth for both directions (Pascalize/Camelize types, wireKey/pascalToCamel\n * runtime) — the camel-side lookup is derived from this table, never hand-mirrored.\n *\n * `text → #text` is the XML text-content convention (fast-xml-parser).\n */\nconst KEY_OVERRIDES = {\n\trph: \"RPH\",\n\ttoServiceType: \"TOServiceType\",\n\ttext: \"#text\",\n} as const;\n\n/** Inverts a camel→pascal table into pascal→camel. Derived, never hand-maintained. */\ntype InvertOverrides<T extends Record<string, string>> = {\n\t[K in keyof T as T[K]]: K;\n};\n\ntype CamelOverrides = InvertOverrides<typeof KEY_OVERRIDES>;\n\nconst CAMEL_OVERRIDES: Record<string, string | undefined> = Object.fromEntries(\n\tObject.entries(KEY_OVERRIDES).map(([camel, pascal]) => [pascal, camel]),\n);\n\n/** Keys that are preserved as-is (no recursive transform) at runtime */\ntype Primitive = string | number | boolean | symbol | bigint | null | undefined;\ntype SpecialObject =\n\t| Date\n\t| RegExp\n\t| Map<unknown, unknown>\n\t| Set<unknown>\n\t| Error;\n\ntype PascalizeKey<K extends string> = K extends keyof typeof KEY_OVERRIDES\n\t? (typeof KEY_OVERRIDES)[K]\n\t: Capitalize<K>;\n\ntype CamelizeKeyBase<K extends string> = K extends keyof CamelOverrides\n\t? CamelOverrides[K]\n\t: Uncapitalize<K>;\n\n/** Maps key K: strips leading @ and converts to camelCase for mapped output key */\ntype CamelizeKey<K extends string> = K extends `@${infer Rest}`\n\t? CamelizeKeyBase<Rest>\n\t: CamelizeKeyBase<K>;\n\ntype ShapeRename<S> = S extends { readonly rename?: infer R }\n\t? R extends Readonly<Partial<Record<string, string>>>\n\t\t? R\n\t\t: undefined\n\t: undefined;\n\ntype ShapeTextContent<S> = S extends { readonly textContent?: infer T }\n\t? T extends string\n\t\t? T\n\t\t: undefined\n\t: undefined;\n\ntype ShapeChildren<S> = S extends { readonly children?: infer C }\n\t? C\n\t: undefined;\n\ntype ChildShapeOf<S, K extends PropertyKey> =\n\tShapeChildren<S> extends infer C\n\t\t? C extends object\n\t\t\t? K extends keyof C\n\t\t\t\t? C[K]\n\t\t\t\t: undefined\n\t\t\t: undefined\n\t\t: undefined;\n\n/** Wire pascal tag for key K under shape S (rename → textContent → KEY_OVERRIDES → Capitalize). */\ntype WirePascalKey<K extends string, S> =\n\tShapeTextContent<S> extends K\n\t\t? \"#text\"\n\t\t: ShapeRename<S> extends Readonly<Partial<Record<string, string>>>\n\t\t\t? K extends keyof ShapeRename<S>\n\t\t\t\t? Extract<ShapeRename<S>[K], string>\n\t\t\t\t: PascalizeKey<K>\n\t\t\t: PascalizeKey<K>;\n\n/**\n * Recursively maps PascalCase/@-prefixed object keys to camelCase.\n * Reflects pascalToCamelKeys runtime: primitives and special objects preserved; arrays and plain objects recursively transformed.\n */\nexport type Camelize<T> = T extends Primitive\n\t? T\n\t: T extends SpecialObject\n\t\t? T\n\t\t: T extends readonly (infer U)[]\n\t\t\t? Camelize<U>[]\n\t\t\t: T extends object\n\t\t\t\t? { [K in keyof T as CamelizeKey<K & string>]: Camelize<T[K]> }\n\t\t\t\t: T;\n\n/**\n * Recursively maps camelCase keys to wire PascalCase / `#text` / rename tags.\n * `S` is the const WireShape at this level so rename/textContent cannot drift from runtime.\n */\nexport type Pascalize<T, S = undefined> = T extends Primitive\n\t? T\n\t: T extends SpecialObject\n\t\t? T\n\t\t: T extends readonly (infer U)[]\n\t\t\t? Pascalize<U, S>[]\n\t\t\t: T extends object\n\t\t\t\t? {\n\t\t\t\t\t\t[K in keyof T as WirePascalKey<K & string, S>]: Pascalize<\n\t\t\t\t\t\t\tT[K],\n\t\t\t\t\t\t\tChildShapeOf<S, K>\n\t\t\t\t\t\t>;\n\t\t\t\t\t}\n\t\t\t\t: T;\n\nfunction isSpecialObject(obj: unknown): boolean {\n\treturn (\n\t\tobj instanceof Date ||\n\t\tobj instanceof RegExp ||\n\t\tobj instanceof Map ||\n\t\tobj instanceof Set ||\n\t\tobj instanceof Error\n\t);\n}\n\n/**\n * `key as keyof typeof KEY_OVERRIDES` narrows a general `string` to the table's finite key\n * set so the lookup type-checks; the runtime lookup still yields `undefined` for any key\n * outside the table, which the `??` fallback below relies on.\n */\nfunction camelToPascal(key: string): string {\n\treturn (\n\t\tKEY_OVERRIDES[key as keyof typeof KEY_OVERRIDES] ??\n\t\tkey.charAt(0).toUpperCase() + key.slice(1)\n\t);\n}\n\nfunction pascalToCamel(key: string): string {\n\treturn CAMEL_OVERRIDES[key] ?? key.charAt(0).toLowerCase() + key.slice(1);\n}\n\n/**\n * camelCase key → wire key: `\"@RPH\"` | `\"RPH\"` | `\"@rph\"` | `\"#text\"`.\n * Resolution order: `textContent` → `shape.rename` → global `KEY_OVERRIDES` → `Capitalize`;\n * then `@`-prefix when listed in `shape.attrs` (skipped for `#text`).\n */\nexport function wireKey(camelKey: string, shape?: WireShape): string {\n\tconst baseKey =\n\t\tshape?.textContent === camelKey\n\t\t\t? \"#text\"\n\t\t\t: (shape?.rename?.[camelKey] ?? camelToPascal(camelKey));\n\tif (baseKey === \"#text\" || !shape?.attrs?.includes(camelKey)) return baseKey;\n\treturn shape.preserveCamel?.includes(camelKey)\n\t\t? `@${camelKey}`\n\t\t: `@${baseKey}`;\n}\n\n/** Strip listWrap metadata so item encode/walk uses attrs/children only. */\nexport function itemShape(shape: WireShape): WireShape {\n\tconst { listWrap: _, detailKey: __, ...rest } = shape;\n\treturn rest;\n}\n\n/**\n * After list-wrap, a list field's value is `{ detailKey: items }` / `[{ detailKey }]`.\n * Synthesize the wrapper child shape from the item shape that carries `listWrap`.\n */\nexport function encodeShapeFor(\n\tlistKey: string,\n\tshape: WireShape | undefined,\n): WireShape | undefined {\n\tif (!shape?.listWrap) return shape;\n\tconst detailKey =\n\t\tshape.detailKey ??\n\t\t(listKey.endsWith(\"List\")\n\t\t\t? `${listKey.slice(0, -4)}Detail`\n\t\t\t: `${listKey}Detail`);\n\treturn { children: { [detailKey]: itemShape(shape) } };\n}\n\n/**\n * camelCase → PascalCase. `@` attrs only for fields listed on the current {@link WireShape}.\n * Child objects/arrays use `shape.children[key]` (same shape for each array item).\n * List fields with `listWrap` synthesize a Detail wrapper shape for the post-wrap value.\n *\n * Return type is `Pascalize<T>` (shape erased) so call-site spreads stay usable; rename /\n * textContent still apply at runtime via `wireKey`, and `Pascalize<T, S>` remains for\n * explicit type-level checks against a const shape.\n */\nexport function camelToPascalKeys<T>(\n\tinput: T,\n\tshape?: WireShape,\n): Pascalize<T> {\n\tif (input === null || typeof input === \"undefined\")\n\t\treturn input as Pascalize<T>;\n\tif (typeof input !== \"object\" || isSpecialObject(input))\n\t\treturn input as Pascalize<T>;\n\n\tif (Array.isArray(input)) {\n\t\treturn input.map((item) => camelToPascalKeys(item, shape)) as Pascalize<T>;\n\t}\n\n\tconst result: Record<string, unknown> = {};\n\n\tfor (const [key, value] of Object.entries(input)) {\n\t\tconst child = shape?.children?.[key];\n\t\tresult[wireKey(key, shape)] = camelToPascalKeys(\n\t\t\tvalue,\n\t\t\tencodeShapeFor(key, child),\n\t\t);\n\t}\n\n\treturn result as Pascalize<T>;\n}\n\n/**\n * PascalCase / @attrs → camelCase. Strips `@` only; no shape needed.\n * `#text` reverses via KEY_OVERRIDES to `text`.\n */\nexport function pascalToCamelKeys<T>(input: T): Camelize<T> {\n\tif (input === null || typeof input === \"undefined\")\n\t\treturn input as Camelize<T>;\n\tif (typeof input !== \"object\" || isSpecialObject(input))\n\t\treturn input as Camelize<T>;\n\n\tif (Array.isArray(input)) {\n\t\treturn input.map((item) => pascalToCamelKeys(item)) as Camelize<T>;\n\t}\n\n\tconst result: Record<string, unknown> = {};\n\n\tfor (const [key, value] of Object.entries(input)) {\n\t\tconst parsedKey = key.startsWith(\"@\") ? key.slice(1) : key;\n\t\tresult[pascalToCamel(parsedKey)] = pascalToCamelKeys(value);\n\t}\n\n\treturn result as Camelize<T>;\n}\n","import { camelToPascalKeys, itemShape } from \"./case-transform.js\";\nimport type { WireShape } from \"./wire-shapes.js\";\n\n/** Only naming exception when detailKey is omitted on the shape. */\nconst DETAIL_KEY_OVERRIDES: Record<string, string> = {\n\tfinancialDeadlineList: \"deadlineDetail\",\n};\n\nexport function detailKeyFor(listKey: string, shape?: WireShape): string {\n\treturn (\n\t\tshape?.detailKey ??\n\t\tDETAIL_KEY_OVERRIDES[listKey] ??\n\t\t(listKey.endsWith(\"List\")\n\t\t\t? `${listKey.slice(0, -4)}Detail`\n\t\t\t: `${listKey}Detail`)\n\t);\n}\n\n/**\n * Flatten SDK `*List: Item[]` → AVES List/Detail wrappers, driven by `listWrap` on\n * {@link WireShape} children (and nested item children). No global key-name scan.\n */\nexport function wrapListDetails<T extends object>(\n\tinput: T,\n\tshape?: WireShape,\n): T {\n\tconst walk = (value: unknown, s?: WireShape): unknown => {\n\t\tif (Array.isArray(value)) return value.map((item) => walk(item, s));\n\t\tif (value === null || typeof value !== \"object\") return value;\n\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const [key, item] of Object.entries(value)) {\n\t\t\tconst child = s?.children?.[key];\n\t\t\tif (child?.listWrap && Array.isArray(item)) {\n\t\t\t\tconst detailKey = detailKeyFor(key, child);\n\t\t\t\tconst details = item.map((entry) => walk(entry, itemShape(child)));\n\t\t\t\tout[key] =\n\t\t\t\t\tchild.listWrap === \"one\"\n\t\t\t\t\t\t? details.map((detail) => ({ [detailKey]: detail }))\n\t\t\t\t\t\t: { [detailKey]: details };\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tout[key] = walk(item, child);\n\t\t}\n\t\treturn out;\n\t};\n\treturn walk(input, shape) as T;\n}\n\n/**\n * Empty paxAssociated [] → \"\" so XML emits `<PaxAssociated/>`.\n * SDK accepts `string[]` and maps to `{ pax }[]` for the wire.\n */\nexport function normalizeEmptyPaxAssociated<T>(input: T): T {\n\tconst walk = (node: unknown): unknown => {\n\t\tif (node === null || typeof node !== \"object\") return node;\n\t\tif (Array.isArray(node)) return node.map(walk);\n\t\tconst result: Record<string, unknown> = {};\n\t\tfor (const [key, val] of Object.entries(node)) {\n\t\t\tif (key === \"paxAssociated\" && Array.isArray(val)) {\n\t\t\t\tif (!val.length) {\n\t\t\t\t\tresult[key] = \"\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (val.every((item) => typeof item === \"string\")) {\n\t\t\t\t\tresult[key] = val.map((pax) => ({ pax }));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult[key] = walk(val);\n\t\t}\n\t\treturn result;\n\t};\n\treturn walk(input) as T;\n}\n\n/**\n * camelCase body → shape-driven list wrap → PascalCase / @attrs.\n */\nexport function toWireBody<T extends object>(input: T, shape: WireShape) {\n\treturn camelToPascalKeys(\n\t\tnormalizeEmptyPaxAssociated(wrapListDetails(input, shape)),\n\t\tshape,\n\t);\n}\n","import type { BaseIssue, BaseSchema, ObjectEntries } from \"valibot\";\nimport * as v from \"valibot\";\nimport { RsStatusSchema } from \"../schemas/common.js\";\nimport { toWireBody } from \"./booking-transform.js\";\nimport {\n\tcamelToPascalKeys,\n\tpascalToCamelKeys,\n\twireKey,\n} from \"./case-transform.js\";\nimport type { WireShape, WireShapeFor } from \"./wire-shapes.js\";\n\n/**\n * camelCase input → shape-driven list wrap → PascalCase / @attrs via required wire shape.\n * Use `elementOnlyWire` (`{}`) when the root has no attributes.\n */\nexport function createApiSchema<\n\tTSchema extends v.GenericSchema<object, object>,\n>(inputSchema: TSchema, shape: WireShapeFor<v.InferInput<TSchema>>) {\n\treturn v.pipe(\n\t\tinputSchema,\n\t\tv.transform((input) => toWireBody(input, shape)),\n\t);\n}\n\n/**\n * Normalize XML one-or-many nodes into a typed array.\n */\nexport function oneOrMany<TSchema extends v.GenericSchema>(\n\titemSchema: TSchema,\n) {\n\treturn v.pipe(\n\t\tv.union([v.array(itemSchema), itemSchema]),\n\t\tv.transform((input): v.InferOutput<TSchema>[] =>\n\t\t\tArray.isArray(input) ? input : [input],\n\t\t),\n\t);\n}\n\n/**\n * Wire `{ DetailKey: one|many }` → flat `Detail[]` (mirrors request list wrap).\n */\nexport function listDetailApiSchema<\n\tconst TKey extends string,\n\tTSchema extends v.GenericSchema,\n>(detailKey: TKey, itemSchema: TSchema) {\n\tconst itemList = v.optional(oneOrMany(itemSchema));\n\treturn v.pipe(\n\t\tv.object({ [detailKey]: itemList } as {\n\t\t\t[K in TKey]: typeof itemList;\n\t\t}),\n\t\tv.transform((list): v.InferOutput<TSchema>[] => list[detailKey] ?? []),\n\t);\n}\n\n/**\n * Creates a schema that transforms PascalCase API responses to camelCase\n */\nexport function createResponseSchema<TSchema extends v.GenericSchema>(\n\tapiSchema: TSchema,\n) {\n\treturn v.pipe(\n\t\tapiSchema,\n\t\tv.transform((input) => pascalToCamelKeys(input)),\n\t);\n}\n\n/**\n * Search-style RS: `{ rsStatus, [listKey]: Detail[] }` with full InferOutput.\n * Pass PascalCase wire list key (e.g. `\"PackageList\"` → camel `packageList`).\n */\nexport function createListResponseSchema<\n\tconst K extends string,\n\tTList extends v.GenericSchema,\n>(listKey: K, listSchema: TList) {\n\tconst listEntries = { [listKey]: v.optional(listSchema) } as {\n\t\t[P in K]: v.OptionalSchema<TList, undefined>;\n\t};\n\treturn createResponseSchema(\n\t\tv.object({\n\t\t\tRsStatus: RsStatusSchema,\n\t\t\t...listEntries,\n\t\t}),\n\t);\n}\n\n/** Result of spreading optional detail key `K` onto object `T`. */\nexport type FlattenedResponse<T, K extends string> = T extends object\n\t? K extends keyof T\n\t\t? Omit<T, K> & NonNullable<T[K]>\n\t\t: T\n\t: T;\n\n/**\n * Spread an optional nested detail object onto the response root (immutable).\n * e.g. `{ rsStatus, bookingFileDetail: { code } }` → `{ rsStatus, code }`\n */\nexport function flattenResponseDetail<const K extends string>(detailKey: K) {\n\treturn <T>(input: T): FlattenedResponse<T, K> => {\n\t\tif (input === null || typeof input !== \"object\")\n\t\t\treturn input as FlattenedResponse<T, K>;\n\t\tconst record = input as Record<string, unknown>;\n\t\tconst detail = record[detailKey];\n\t\tconst { [detailKey]: _, ...rest } = record;\n\t\tif (!detail || typeof detail !== \"object\" || Array.isArray(detail))\n\t\t\treturn rest as FlattenedResponse<T, K>;\n\t\treturn { ...rest, ...detail } as FlattenedResponse<T, K>;\n\t};\n}\n\n/**\n * camelCase response + spread a single `*Detail` onto the root.\n */\nexport function createFlattenedResponseSchema<\n\tTSchema extends v.GenericSchema,\n\tconst K extends string,\n>(apiSchema: TSchema, detailKey: K) {\n\treturn v.pipe(\n\t\tcreateResponseSchema(apiSchema),\n\t\tv.transform((input) => flattenResponseDetail(detailKey)(input)),\n\t);\n}\n\n/**\n * Accept a bare value **or** `{ value, ...extras }`; always output the object form.\n * Used for booking/file status fields.\n */\nexport function valueFieldSchema<\n\tTValue extends v.GenericSchema,\n\tTExtra extends ObjectEntries,\n>(valueSchema: TValue, extraEntries?: TExtra) {\n\tconst objectSchema = v.object({\n\t\tvalue: valueSchema,\n\t\t...(extraEntries ?? {}),\n\t} as { value: TValue } & TExtra);\n\treturn v.pipe(\n\t\tv.union([valueSchema, objectSchema]),\n\t\tv.transform((input) =>\n\t\t\tinput !== null && typeof input === \"object\" ? input : { value: input },\n\t\t),\n\t);\n}\n\n/**\n * `selectedPackageList: [item]` → `selectedPackageDetail: item` (keeps explicit singular).\n */\nexport function coalesceListHead<\n\tconst ListKey extends string,\n\tconst ItemKey extends string,\n>(listKey: ListKey, itemKey: ItemKey) {\n\treturn <T extends object>(input: T): Omit<T, ListKey> => {\n\t\tconst list = Reflect.get(input, listKey);\n\t\tconst item = Reflect.get(input, itemKey);\n\t\tconst next = { ...input };\n\t\tReflect.deleteProperty(next, listKey);\n\t\tReflect.set(\n\t\t\tnext,\n\t\t\titemKey,\n\t\t\titem ?? (Array.isArray(list) ? list[0] : undefined),\n\t\t);\n\t\treturn next as Omit<T, ListKey>;\n\t};\n}\n\n/**\n * `customerRecordCode` shorthand → `customerDetail.recordCode`.\n */\nexport function coalesceCustomerRecordCode<\n\tT extends {\n\t\tcustomerDetail?: { recordCode?: string } | undefined;\n\t\tcustomerRecordCode?: string | undefined;\n\t},\n>(input: T) {\n\tconst { customerRecordCode, customerDetail, ...rest } = input;\n\treturn {\n\t\t...rest,\n\t\tcustomerDetail: {\n\t\t\t...customerDetail,\n\t\t\trecordCode: customerDetail?.recordCode ?? customerRecordCode,\n\t\t},\n\t};\n}\n\nfunction isObjectSchema(\n\tschema: v.GenericSchema,\n): schema is v.ObjectSchema<\n\tObjectEntries,\n\tv.ErrorMessage<v.ObjectIssue> | undefined\n> {\n\treturn schema.type === \"object\" && \"entries\" in schema;\n}\n\nfunction isOptionalSchema(\n\tschema: v.GenericSchema,\n): schema is v.OptionalSchema<v.GenericSchema, unknown> {\n\treturn schema.type === \"optional\" && \"wrapped\" in schema;\n}\n\nfunction isArraySchema(\n\tschema: v.GenericSchema,\n): schema is v.ArraySchema<\n\tv.GenericSchema,\n\tv.ErrorMessage<v.ArrayIssue> | undefined\n> {\n\treturn schema.type === \"array\" && \"item\" in schema;\n}\n\n/**\n * Recursively rewrite an input entry schema to PascalCase/@attr keys using the same\n * `wireKey` path as the encoder. Object/array nesting follows `shape.children`.\n */\nfunction toWireEntrySchema(\n\tschema: v.GenericSchema,\n\tshape: WireShape,\n): BaseSchema<unknown, unknown, BaseIssue<unknown>> {\n\tif (isOptionalSchema(schema)) {\n\t\tconst inner = toWireEntrySchema(schema.wrapped, shape);\n\t\treturn schema.default !== undefined\n\t\t\t? v.optional(inner, schema.default as never)\n\t\t\t: v.optional(inner);\n\t}\n\tif (isArraySchema(schema))\n\t\treturn oneOrMany(toWireEntrySchema(schema.item, shape));\n\tif (isObjectSchema(schema)) return buildApiValidationObject(schema, shape);\n\treturn schema;\n}\n\nfunction buildApiValidationObject(\n\tinputSchema: v.ObjectSchema<\n\t\tObjectEntries,\n\t\tv.ErrorMessage<v.ObjectIssue> | undefined\n\t>,\n\tshape: WireShape,\n\toverrides?: ObjectEntries,\n) {\n\tconst validationEntries = {} as {\n\t\t[K in string]: BaseSchema<unknown, unknown, BaseIssue<unknown>>;\n\t};\n\n\tfor (const key in inputSchema.entries) {\n\t\tconst childShape = shape.children?.[key] ?? {};\n\t\tvalidationEntries[wireKey(key, shape)] = toWireEntrySchema(\n\t\t\tinputSchema.entries[key],\n\t\t\tchildShape,\n\t\t);\n\t}\n\n\treturn v.object({ ...validationEntries, ...overrides });\n}\n\n/**\n * Validation schema for already-transformed PascalCase/@attr payloads.\n * Walks nested object entries recursively so keys cannot drift from the encoder.\n * `overrides` is only for server-only fields (not structural twins).\n */\nexport function createApiValidationSchema<\n\tTEntries extends ObjectEntries,\n\tTMessage extends v.ErrorMessage<v.ObjectIssue> | undefined,\n\tTOverrides extends ObjectEntries = Record<never, never>,\n>(\n\tinputSchema: v.ObjectSchema<TEntries, TMessage>,\n\tshape: WireShapeFor<v.InferInput<typeof inputSchema>> = {},\n\toverrides?: TOverrides,\n) {\n\treturn buildApiValidationObject(\n\t\tinputSchema,\n\t\tshape,\n\t\toverrides,\n\t) as v.ObjectSchema<TEntries & TOverrides, undefined>;\n}\n\n/**\n * Prefer first defined candidate for each output key; drop alias keys.\n * e.g. `{ \"@FromExternalProvider\": [canonical, alias] }`\n */\nexport function coalesceWireAliases<\n\tT extends object,\n\tconst TRules extends Readonly<Record<string, readonly string[]>>,\n>(\n\tinput: T,\n\trules: TRules,\n): Omit<\n\tT,\n\tExclude<Extract<TRules[keyof TRules][number], PropertyKey>, keyof TRules>\n> {\n\tconst out: Record<string, unknown> = {\n\t\t...(input as Record<string, unknown>),\n\t};\n\tfor (const [outKey, candidates] of Object.entries(rules)) {\n\t\tlet value: unknown;\n\t\tfor (const key of candidates) {\n\t\t\tif (out[key] !== undefined && out[key] !== null) {\n\t\t\t\tvalue = out[key];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (const key of candidates) {\n\t\t\tif (key !== outKey) delete out[key];\n\t\t}\n\t\tif (value !== undefined) out[outKey] = value;\n\t\telse delete out[outKey];\n\t}\n\treturn out as Omit<\n\t\tT,\n\t\tExclude<Extract<TRules[keyof TRules][number], PropertyKey>, keyof TRules>\n\t>;\n}\n\n/**\n * createApiSchema + createApiValidationSchema for the same input/shape pair.\n */\nexport function createWireSchemaPair<\n\tTEntries extends ObjectEntries,\n\tTMessage extends v.ErrorMessage<v.ObjectIssue> | undefined,\n>(\n\tinputSchema: v.ObjectSchema<TEntries, TMessage>,\n\tshape: WireShapeFor<v.InferInput<typeof inputSchema>>,\n) {\n\treturn {\n\t\tapi: createApiSchema(inputSchema, shape),\n\t\tvalidation: createApiValidationSchema(inputSchema, shape),\n\t};\n}\n\nexport { camelToPascalKeys, toWireBody };\n","/**\n * Per-shape wire rules: which camelCase fields are XML @attrs at this level.\n * Children are keyed by the camelCase property name on the parent object.\n * Always pass an explicit shape at request boundaries — missing shape ⇒ all elements.\n *\n * List fields (`*List: Item[]`) carry `listWrap` on the **item** shape. The wrap/encode\n * path synthesizes the Detail wrapper; `WireShapeFor<Item[]>` therefore matches the\n * item keys — no post-wrap escape hatch.\n */\nexport type WireShape = {\n\tattrs?: readonly string[];\n\tpreserveCamel?: readonly string[];\n\t/**\n\t * camelCase key → literal wire tag at this level. Beats the global KEY_OVERRIDES table.\n\t * Threaded through `Pascalize<T, S>` so types mirror runtime.\n\t */\n\trename?: Readonly<Partial<Record<string, string>>>;\n\t/** camelCase field emitted as XML text content (`#text` for fast-xml-parser). */\n\ttextContent?: string;\n\t/**\n\t * Wrap an SDK `*List: Item[]` into AVES List/Detail form.\n\t * `\"many\"` → `{ detailKey: items }` · `\"one\"` → `[{ detailKey: item }, …]`\n\t * Detail key defaults to `*List` → `*Detail` (see `detailKeyFor`).\n\t */\n\tlistWrap?: \"many\" | \"one\";\n\t/** Override inferred Detail key (e.g. financialDeadlineList → deadlineDetail). */\n\tdetailKey?: string;\n\tchildren?: { readonly [key: string]: WireShape | undefined };\n};\n\ntype Item<T> = T extends readonly (infer U)[] ? U : T;\ntype ItemKeys<T> = T extends unknown ? keyof NonNullable<Item<T>> : never;\ntype ItemValue<T, K> = T extends unknown\n\t? K extends keyof NonNullable<Item<T>>\n\t\t? NonNullable<Item<T>>[K]\n\t\t: never\n\t: never;\n\nexport type WireShapeFor<T> = {\n\tattrs?: readonly (ItemKeys<T> & string)[];\n\tpreserveCamel?: readonly (ItemKeys<T> & string)[];\n\trename?: Partial<Record<ItemKeys<T> & string, string>>;\n\ttextContent?: ItemKeys<T> & string;\n\tlistWrap?: \"many\" | \"one\";\n\tdetailKey?: string;\n\tchildren?: {\n\t\t[K in ItemKeys<T>]?: WireShapeFor<NonNullable<ItemValue<T, K>>>;\n\t};\n};\n\n/** Const-preserving WireShape constructor (replaces `as const satisfies WireShape`). */\nexport function wire<const S extends WireShape>(shape: S): S {\n\treturn shape;\n}\n\n/** Attrs-only shape. */\nexport function attrsWire<const A extends readonly string[]>(...attrs: A) {\n\treturn wire({ attrs });\n}\n\n/** Attrs that stay camelCase on the wire (`@sCode1`, not `@SCode1`). */\nexport function camelAttrsWire<const A extends readonly string[]>(...attrs: A) {\n\treturn wire({ attrs, preserveCamel: attrs });\n}\n\n/** Attrs + a subset that stay camelCase (e.g. `pCode` among other Pascal attrs). */\nexport function attrsCamelWire<\n\tconst A extends readonly string[],\n\tconst P extends readonly A[number][],\n>(attrs: A, preserveCamel: P) {\n\treturn wire({ attrs, preserveCamel });\n}\n\n/** Children-only shape. */\nexport function childrenWire<\n\tconst C extends { readonly [key: string]: WireShape | undefined },\n>(children: C) {\n\treturn wire({ children });\n}\n\n/** Attrs + children. */\nexport function nestWire<\n\tconst A extends readonly string[],\n\tconst C extends { readonly [key: string]: WireShape | undefined },\n>(attrs: A, children: C) {\n\treturn wire({ attrs, children });\n}\n\n/** Item shape + listWrap (and optional detailKey override). */\nexport function listWire<\n\tconst S extends WireShape,\n\tconst M extends \"many\" | \"one\",\n>(item: S, listWrap: M, detailKey?: string) {\n\treturn !detailKey\n\t\t? wire({ ...item, listWrap })\n\t\t: wire({ ...item, listWrap, detailKey });\n}\n\n/** `listWire(attrsWire(...), mode)` in one call. */\nexport function listAttrsWire<\n\tconst M extends \"many\" | \"one\",\n\tconst A extends readonly string[],\n>(listWrap: M, ...attrs: A) {\n\treturn listWire(attrsWire(...attrs), listWrap);\n}\n\n/** Both array-of-one and many wraps of the same item shape. */\nexport function listWireModes<const S extends WireShape>(item: S) {\n\treturn {\n\t\tone: listWire(item, \"one\"),\n\t\tmany: listWire(item, \"many\"),\n\t} as const;\n}\n\n// --- leaf / fragment shapes -------------------------------------------------\n\nexport const headerWire = attrsWire(\n\t\"hostID\",\n\t\"xtoken\",\n\t\"interface\",\n\t\"userName\",\n\t\"status\",\n\t\"languageCode\",\n);\n\nexport const financialDetailWire = attrsWire(\n\t\"currencyCode\",\n\t\"creditLimit\",\n\t\"c_PaymentType\",\n\t\"c_SpecPaymentTypeCode\",\n\t\"s_PaymentType\",\n\t\"s_SpecPaymentTypeCode\",\n\t\"enableElectronicInvoicing\",\n\t\"electronicInvoicingType\",\n);\n\nexport const idDocumentDetailWire = attrsWire(\n\t\"idType\",\n\t\"idCode\",\n\t\"idIssueLocation\",\n\t\"idIssueCounty\",\n\t\"idIssueDate\",\n\t\"idExpireDate\",\n);\n\nexport const accountPoliciesWire = attrsWire(\n\t\"acceptProfilingPolicies\",\n\t\"acceptPrivacyPolicies\",\n\t\"acceptNewsletterPolicies\",\n);\n\nexport const dynamicFieldsWire = attrsWire(\"key\", \"value\");\n\nexport const supplierRefMasterRecordsWire = attrsWire(\n\t\"supplierRefCode\",\n\t\"companyMainBusinessType\",\n\t\"carrierType\",\n);\n\nexport const masterRecordWire = nestWire([\"recordCode\", \"insertCriteria\"], {\n\tfinancialDetail: financialDetailWire,\n\tidDocumentDetail: idDocumentDetailWire,\n\taccountPolicies: accountPoliciesWire,\n\tdynamicFields: dynamicFieldsWire,\n\tsupplierRefMasterRecords: supplierRefMasterRecordsWire,\n});\n\nconst dateRangeWire = attrsWire(\"minDate\", \"maxDate\");\n\n/** Search master — recordCode stays element; date range uses attrs. */\nexport const searchMasterWire = childrenWire({\n\tlastModificationDate: dateRangeWire,\n});\n\nexport const statisticCodesWire = camelAttrsWire(\n\t\"sCode1\",\n\t\"sCode2\",\n\t\"sCode3\",\n\t\"sCode4\",\n\t\"sCode5\",\n\t\"sCode6\",\n);\n\nexport const destinationWire = attrsWire(\n\t\"code\",\n\t\"iataCode\",\n\t\"nationCode\",\n\t\"type\",\n);\n\n/** NoteDetail item shape — `text` → `#text` via global KEY_OVERRIDES. */\nexport const noteDetailWire = attrsWire(\"nType\", \"title\");\n\nconst noteListWire = listWire(noteDetailWire, \"many\");\n\nexport const passengerDetailWire = nestWire(\n\t[\"rph\", \"roomRph\", \"billingHolder\"],\n\t{\n\t\tnotes: listWire(noteDetailWire, \"many\", \"noteDetail\"),\n\t\tidDocInfo: idDocumentDetailWire,\n\t},\n);\n\nexport const serviceFareWire = attrsWire(\n\t\"currencyCode\",\n\t\"exchangeRate\",\n\t\"cost\",\n\t\"costTax\",\n\t\"costType\",\n\t\"vatCostCurrencyCode\",\n\t\"price\",\n\t\"priceTax\",\n\t\"priceType\",\n);\n\nexport const selectedPackageDetailWire = attrsCamelWire(\n\t[\"pCode\", \"startDate\", \"endDate\", \"getServicesFromPackage\"],\n\t[\"pCode\"],\n);\n\nexport const selectedServiceDetailWire = wire({\n\t...attrsCamelWire([\"sCode\", \"ssCode\"], [\"sCode\", \"ssCode\"]),\n\tchildren: {\n\t\tserviceFare: serviceFareWire,\n\t\tavesServiceInfo: childrenWire({ serviceFare: serviceFareWire }),\n\t\tnoteList: noteListWire,\n\t},\n});\n\nconst selectedServiceLists = listWireModes(selectedServiceDetailWire);\nconst passengerLists = listWireModes(passengerDetailWire);\n\nexport const passengerListWireOne = passengerLists.one;\nexport const passengerListWireMany = passengerLists.many;\n\nconst selectedPackageListWire = listWire(selectedPackageDetailWire, \"many\");\n\nconst deadlineListWire = listAttrsWire(\n\t\"many\",\n\t\"deadlineCode\",\n\t\"description\",\n\t\"expireDate\",\n);\n\n/** ModFileServices deadline rows use reschedulingCode, not deadlineCode. */\nconst modDeadlineListWire = listAttrsWire(\n\t\"many\",\n\t\"reschedulingCode\",\n\t\"description\",\n\t\"expireDate\",\n);\n\nconst financialDeadlineListWire = listWire(\n\tattrsWire(\"reschedulingCode\", \"expireDate\", \"totalAmount\"),\n\t\"many\",\n\t\"deadlineDetail\",\n);\n\nconst paymentListWire = listWire(\n\twire({\n\t\t...attrsWire(\n\t\t\t\"paymentDate\",\n\t\t\t\"paymentNote\",\n\t\t\t\"amount\",\n\t\t\t\"paymentUser\",\n\t\t\t\"paymentType\",\n\t\t),\n\t\t// AVES misspells this PaymentDetail attribute; SDK field stays `paymentNote`.\n\t\trename: { paymentNote: \"PaumentNote\" },\n\t}),\n\t\"many\",\n);\n\nconst filePaymentListWire = listAttrsWire(\n\t\"many\",\n\t\"paymentDate\",\n\t\"paymentNote\",\n\t\"payerMasterCode\",\n\t\"payerName\",\n\t\"amount\",\n\t\"paymentType\",\n);\n\nconst cancellableBookedServiceListWire = listAttrsWire(\n\t\"many\",\n\t\"cancelOperationType\",\n\t\"serviceRefType\",\n\t\"serviceRefValue\",\n);\n\nconst bookingFileDocumentWire = nestWire([\"printDoc\", \"sendDocViaEmail\"], {\n\tinfoDocumentsToPrint: childrenWire({\n\t\tdocumentCustomizablePrintParameters: attrsWire(\n\t\t\t\"makeDocumentTo\",\n\t\t\t\"fillInCode\",\n\t\t),\n\t}),\n});\n\nconst bookingFileStatusWire = attrsWire(\"value\", \"expiredDate\");\nconst customerDetailWire = attrsWire(\"recordCode\");\nconst bookingFinancialInfoWire = attrsWire(\n\t\"customer_PaymentType\",\n\t\"customer_SpecPaymentTypeCode\",\n);\n\nconst packageParamsWire = attrsWire(\n\t\"getAllDeptDate\",\n\t\"getFlightPlan\",\n\t\"getAllAccomodation\",\n\t\"getRealAvailability\",\n);\n\nconst topServiceParamsWire = attrsWire(\n\t\"compatibleAccomodation\",\n\t\"alternativeAccomodation\",\n);\n\nconst featureListWire = listAttrsWire(\"many\", \"code\", \"name\");\nconst fileStatusWire = attrsWire(\n\t\"value\",\n\t\"expiredDate\",\n\t\"optionedFileExpireDatePolicy\",\n);\nconst penaltyWire = attrsWire(\"apply\", \"specificCode\");\n\nconst bookingFileChildrenBase = {\n\tcustomerDetail: customerDetailWire,\n\tbookingFileStatus: bookingFileStatusWire,\n\tstatisticCodes: statisticCodesWire,\n\tdestination: destinationWire,\n\tbookingFileDocument: bookingFileDocumentWire,\n\tbookingFinancialInfo: bookingFinancialInfoWire,\n\tselectedPackageDetail: selectedPackageDetailWire,\n\tselectedPackageList: selectedPackageListWire,\n\tfinancialDeadlineList: financialDeadlineListWire,\n\tpaymentList: paymentListWire,\n\tcancellableBookedServiceList: cancellableBookedServiceListWire,\n\tnoteList: noteListWire,\n} as const;\n\n/** CreateBookingFile — array-of-one for selectedService / passenger / extraQuote lists. */\nexport const bookingFileWire = childrenWire({\n\t...bookingFileChildrenBase,\n\tdeadlineList: deadlineListWire,\n\tselectedServiceList: selectedServiceLists.one,\n\textraQuoteServiceList: selectedServiceLists.one,\n\tpassengerList: passengerLists.one,\n});\n\n/** ModFileServices / ModFileHeader — many-style list wrap. */\nexport const modBookingFileWire = childrenWire({\n\t...bookingFileChildrenBase,\n\tdeadlineList: modDeadlineListWire,\n\tselectedServiceList: selectedServiceLists.many,\n\textraQuoteServiceList: selectedServiceLists.many,\n\tpassengerList: passengerLists.many,\n});\n\n/** InsertFilePaymentList — root paymentUser is an @attr; detail fields nested. */\nexport const filePaymentListRequestWire = nestWire([\"paymentUser\"], {\n\tfilePaymentList: filePaymentListWire,\n});\n\n/** SearchFileRQ — date ranges / insurance / status use attrs. */\nexport const searchFileWire = childrenWire({\n\tfileStatus: attrsWire(\"value\", \"expireDate\"),\n\tstartDate: dateRangeWire,\n\tcreatedDate: dateRangeWire,\n\tlastModificationDate: dateRangeWire,\n\tinsurance: attrsWire(\"code\", \"number\"),\n});\n\n/** GetPackageDetail SelectedServiceDetail (ServiceCode + PackageRow). */\nexport const packagePrgServiceDetailWire = attrsWire(\n\t\"serviceCode\",\n\t\"packageRow\",\n);\n\nexport const packageDetailRequestWire = childrenWire({\n\tstatisticCodes: statisticCodesWire,\n\tselectedServiceList: listWire(packagePrgServiceDetailWire, \"many\"),\n\tpassengerList: passengerLists.many,\n});\n\n/** BaseSearch fragment inside AvesSearchRQ (dates are elements). */\nexport const baseSearchWire = childrenWire({\n\tpassengerList: passengerLists.many,\n});\n\n/** AvesSearchRQ body outside BaseSearch. */\nexport const avesSearchWire = childrenWire({\n\tdestination: destinationWire,\n\tstatisticCodes: statisticCodesWire,\n\tpackageParams: packageParamsWire,\n\ttopServiceParams: topServiceParamsWire,\n\tfeatureList: featureListWire,\n});\n\nexport const setFileStatusWire = childrenWire({\n\tfileStatus: fileStatusWire,\n\tpenalty: penaltyWire,\n\tbookingFileDocument: bookingFileDocumentWire,\n});\n\n/** Element-only request roots (CancelFile, SetFileServiceStatus, CommitPackage). */\nexport const elementOnlyWire = wire({});\n","import * as v from \"valibot\";\nimport {\n\tBookingFileStatusSchema,\n\tBookingFileStatusWire,\n\ttype BookingFileStatusWireSchema,\n} from \"./enums.js\";\n\nexport {\n\tAvesServiceType,\n\tAvesServiceTypeSchema,\n\tBookedServiceStatus,\n\tBookedServiceStatusSchema,\n\tBookingFileStatus,\n\tBookingFileStatusSchema,\n\tBookingFileStatusWire,\n\tBookingFileStatusWireSchema,\n\tCancelOperationType,\n\tCancelOperationTypeSchema,\n\tCostPriceType,\n\tCostPriceTypeSchema,\n\tCustomerPaymentType,\n\tCustomerPaymentTypeSchema,\n\tDocumentType,\n\tDocumentTypeSchema,\n\tFilePaymentOperationType,\n\tFilePaymentOperationTypeSchema,\n\tGender,\n\tGenderSchema,\n\tGroupingPaxPolicy,\n\tGroupingPaxPolicySchema,\n\tMakeDocumentTo,\n\tMakeDocumentToSchema,\n\tOptionedExpirePolicy,\n\tOptionedExpirePolicySchema,\n\tPassengerCategory,\n\tPassengerCategorySchema,\n\tPaymentType,\n\tPaymentTypeSchema,\n\tServiceRefType,\n\tServiceRefTypeSchema,\n\tSetFileStatusValue,\n\tSetFileStatusValueSchema,\n\tToServiceType,\n\tToServiceTypeSchema,\n\tTypeDownloadFile,\n\tTypeDownloadFileSchema,\n} from \"./enums.js\";\n\n/** @deprecated Use {@link BookingFileStatusSchema} */\nexport const BookingFileStatusRequestSchema = BookingFileStatusSchema;\n\n/** AVES bool-ish wire values */\nexport const BoolishSchema = v.union([\n\tv.literal(\"true\"),\n\tv.literal(\"false\"),\n\tv.boolean(),\n]);\n\nconst statusAliasToCanonical = {\n\t[BookingFileStatusWire.CONFIRM]: \"CONFIRMED\",\n\t[BookingFileStatusWire.OPTION]: \"OPTIONED\",\n\t[BookingFileStatusWire.REQUESTED]: \"REQUEST\",\n} as const;\n\nexport type CanonicalBookingFileStatus =\n\t| Exclude<\n\t\t\tv.InferOutput<typeof BookingFileStatusWireSchema>,\n\t\t\tkeyof typeof statusAliasToCanonical\n\t >\n\t| (typeof statusAliasToCanonical)[keyof typeof statusAliasToCanonical];\n\n/** Normalize BOOKEDFILE status wire aliases to canonical SDK values. */\nexport function canonicalizeBookingFileStatus(\n\tvalue: v.InferOutput<typeof BookingFileStatusWireSchema>,\n): CanonicalBookingFileStatus {\n\tif (value in statusAliasToCanonical)\n\t\treturn statusAliasToCanonical[value as keyof typeof statusAliasToCanonical];\n\treturn value as CanonicalBookingFileStatus;\n}\n","import * as v from \"valibot\";\nimport {\n\tcoalesceWireAliases,\n\tlistDetailApiSchema,\n} from \"../utils/schema-transform.js\";\nimport {\n\tAvesServiceTypeSchema,\n\tBookedServiceStatusSchema,\n\tBookingFileStatusWireSchema,\n\tcanonicalizeBookingFileStatus,\n\tToServiceTypeSchema,\n} from \"./booking-shared.js\";\nimport { StringishSchema } from \"./common.js\";\n\n/** BookingFileStatus in BOOKEDFILE responses — aliases normalized to canonical values */\nexport const BookingFileStatusApiSchema = v.pipe(\n\tv.object({\n\t\t\"@Value\": BookingFileStatusWireSchema,\n\t\t\"@ExpiredDate\": v.optional(v.string()),\n\t\t\"@ExpireDate\": v.optional(v.string()),\n\t}),\n\tv.transform((status) => ({\n\t\t...coalesceWireAliases(status, {\n\t\t\t\"@ExpiredDate\": [\"@ExpiredDate\", \"@ExpireDate\"],\n\t\t}),\n\t\t\"@Value\": canonicalizeBookingFileStatus(status[\"@Value\"]),\n\t})),\n);\n\nexport const PricePerPaxDetailApiSchema = v.object({\n\t\"@PaxRef\": v.string(),\n\t\"@Price\": StringishSchema,\n});\n\nexport const PaxPriceListApiSchema = listDetailApiSchema(\n\t\"PricePerPaxDetail\",\n\tPricePerPaxDetailApiSchema,\n);\n\nexport const ServiceTotalAmountDetailApiSchema = v.object({\n\t\"@CommissionCode\": v.optional(v.string()),\n\t\"@CommissionPercentage\": v.optional(StringishSchema),\n\t\"@CommissionAmount\": v.optional(StringishSchema),\n\t\"@PriceListCode\": v.optional(v.string()),\n\t\"@CostListCode\": v.optional(v.string()),\n\t\"@ServiceTotalPrice\": v.optional(StringishSchema),\n\tPaxPriceList: v.optional(PaxPriceListApiSchema),\n});\n\nexport const SupplierInfoApiSchema = v.object({\n\t\"@Code\": v.optional(v.string()),\n\t\"@Name\": v.optional(v.string()),\n\t\"@Email\": v.optional(v.string()),\n\t\"@LanguageCode\": v.optional(v.string()),\n});\n\nexport const WebStatisticApiSchema = v.object({\n\t\"@Code\": v.optional(v.string()),\n\t\"@Description\": v.optional(v.string()),\n});\n\n/** Wire schema — accepts AVES dialect aliases, then normalizes */\nconst BookedServiceDetailWireSchema = v.object({\n\t\"@RPH\": v.string(),\n\t\"@ServiceCode\": v.optional(v.string()),\n\t\"@FromExternalProvider\": v.optional(StringishSchema),\n\t\"@isFromExternalProvider\": v.optional(StringishSchema),\n\tAvesServiceType: v.optional(AvesServiceTypeSchema),\n\tTOServiceType: v.optional(ToServiceTypeSchema),\n\tFirstDescription: v.optional(v.string()),\n\tSecondDescription: v.optional(v.string()),\n\tThirdDescription: v.optional(v.string()),\n\tFourthDescription: v.optional(v.string()),\n\tServiceStatus: v.optional(BookedServiceStatusSchema),\n\tStartDate: v.optional(v.string()),\n\tEndDate: v.optional(v.string()),\n\tQty: v.optional(StringishSchema),\n\tPax: v.optional(StringishSchema),\n\tPeriodType: v.optional(v.string()),\n\tPaxMultiplier: v.optional(v.string()),\n\tExternalProviderCode: v.optional(v.string()),\n\tWebStatisticCode: v.optional(v.string()),\n\tWebStatisticDescription: v.optional(v.string()),\n\tWebStatistic: v.optional(WebStatisticApiSchema),\n\tSupplierInfo: v.optional(SupplierInfoApiSchema),\n\tServiceTotalAmountDetail: v.optional(ServiceTotalAmountDetailApiSchema),\n});\n\n/** BookedServiceDetail — single fromExternalProvider after normalize */\nexport const BookedServiceDetailApiSchema = v.pipe(\n\tBookedServiceDetailWireSchema,\n\tv.transform((service) =>\n\t\tcoalesceWireAliases(service, {\n\t\t\t\"@FromExternalProvider\": [\n\t\t\t\t\"@FromExternalProvider\",\n\t\t\t\t\"@isFromExternalProvider\",\n\t\t\t],\n\t\t}),\n\t),\n);\n\nexport const BookedServiceListApiSchema = listDetailApiSchema(\n\t\"BookedServiceDetail\",\n\tBookedServiceDetailApiSchema,\n);\n\n/** TotalAmountDetail — attributes on BOOKEDFILE */\nexport const TotalAmountDetailApiSchema = v.object({\n\t\"@CurrencyCode\": v.optional(v.string()),\n\t\"@TotalAmountBeforeDiscount\": v.optional(StringishSchema),\n\t\"@TotalAmountAfterDiscount\": v.optional(StringishSchema),\n\t\"@TotalDiscount\": v.optional(StringishSchema),\n\t\"@TotalAmountWithoutVat\": v.optional(StringishSchema),\n\t\"@DueAmount\": v.optional(StringishSchema),\n\t\"@PaiedAmount\": v.optional(StringishSchema),\n\t\"@Balance\": v.optional(StringishSchema),\n});\n\nexport const PassengerDetailApiSchema = v.object({\n\t\"@RPH\": v.string(),\n\t\"@RoomRPH\": v.optional(v.string()),\n\t\"@BillingHolder\": v.optional(StringishSchema),\n\tName: v.optional(v.string()),\n\tCategoryCode: v.optional(v.string()),\n\tSex: v.optional(v.string()),\n\tBirthDate: v.optional(v.string()),\n\tBirthPlace: v.optional(v.string()),\n\tNationCode: v.optional(v.string()),\n\tCitizenshipCode: v.optional(v.string()),\n\tFiscalCode: v.optional(v.string()),\n\tPhoneNumber: v.optional(v.string()),\n\tEMail: v.optional(v.string()),\n\tMasterRecordCode: v.optional(v.string()),\n});\n\nexport const PassengerListApiSchema = listDetailApiSchema(\n\t\"PassengerDetail\",\n\tPassengerDetailApiSchema,\n);\n\nconst FinancialDeadlineDetailWireSchema = v.object({\n\t\"@ReschedulingCode\": v.optional(v.string()),\n\t\"@ExpireDate\": v.optional(v.string()),\n\t\"@TotalAmount\": v.optional(StringishSchema),\n\tReschedulingCode: v.optional(v.string()),\n\tExpireDate: v.optional(v.string()),\n\tTotalAmount: v.optional(StringishSchema),\n});\n\nexport const FinancialDeadlineDetailApiSchema = v.pipe(\n\tFinancialDeadlineDetailWireSchema,\n\tv.transform((deadline) =>\n\t\tcoalesceWireAliases(deadline, {\n\t\t\t\"@ReschedulingCode\": [\"@ReschedulingCode\", \"ReschedulingCode\"],\n\t\t\t\"@ExpireDate\": [\"@ExpireDate\", \"ExpireDate\"],\n\t\t\t\"@TotalAmount\": [\"@TotalAmount\", \"TotalAmount\"],\n\t\t}),\n\t),\n);\n\nexport const FinancialDeadlineListApiSchema = listDetailApiSchema(\n\t\"DeadlineDetail\",\n\tFinancialDeadlineDetailApiSchema,\n);\n\nexport const StoredDocumentDetailApiSchema = v.object({\n\tDocumentRefCode: v.optional(v.string()),\n\tDocumentType: v.optional(v.string()),\n\tDocumentName: v.optional(v.string()),\n\tArchiviationDescription: v.optional(v.string()),\n});\n\nexport const StoredDocumentsListApiSchema = listDetailApiSchema(\n\t\"StoredDocumentDetail\",\n\tStoredDocumentDetailApiSchema,\n);\n\nexport const PrintableDocumentDetailApiSchema = v.object({\n\tDocumentType: v.optional(v.string()),\n\tDocumentName: v.optional(v.string()),\n\tEnabled: v.optional(StringishSchema),\n});\n\nexport const PrintableDocumentsListApiSchema = listDetailApiSchema(\n\t\"PrintableDocumentDetail\",\n\tPrintableDocumentDetailApiSchema,\n);\n\nconst BookingFileDetailWireSchema = v.object({\n\t\"@BookingFileCode\": v.optional(v.string()),\n\tBookingFileCode: v.optional(v.string()),\n\tCustomerRecordCode: v.optional(v.string()),\n\tCustomerName: v.optional(v.string()),\n\tCustomerEmail: v.optional(v.string()),\n\tTravelAgencyName: v.optional(v.string()),\n\tTravelAgencyEmail: v.optional(v.string()),\n\tBookingFileStatus: v.optional(BookingFileStatusApiSchema),\n\tDescription: v.optional(v.string()),\n\tNation: v.optional(v.string()),\n\tDestination: v.optional(v.string()),\n\tCreationDate: v.optional(v.string()),\n\tFirstConfirmationDate: v.optional(v.string()),\n\tStartDate: v.optional(v.string()),\n\tEndDate: v.optional(v.string()),\n\tPackageCode: v.optional(v.string()),\n\tBookedServiceList: v.optional(BookedServiceListApiSchema),\n\tTotalAmountDetail: v.optional(TotalAmountDetailApiSchema),\n\tPaxNumber: v.optional(StringishSchema),\n\tPassengerList: v.optional(PassengerListApiSchema),\n\tReference: v.optional(v.string()),\n\tClerkName: v.optional(v.string()),\n\tStoredDocumentsList: v.optional(StoredDocumentsListApiSchema),\n\tPrintableDocumentsList: v.optional(PrintableDocumentsListApiSchema),\n\tFinancialDeadlineList: v.optional(FinancialDeadlineListApiSchema),\n});\n\n/**\n * BookingFileDetail — Common Structures \"BOOKEDFILE\".\n * Accepts wire dialects, normalizes to a single PascalCase/@attr shape for camelCase mapping.\n * Nested `*List` fields are already flat Detail arrays.\n */\nexport const BookingFileDetailApiSchema = v.pipe(\n\tBookingFileDetailWireSchema,\n\tv.transform((detail) =>\n\t\tcoalesceWireAliases(detail, {\n\t\t\t\"@BookingFileCode\": [\"@BookingFileCode\", \"BookingFileCode\"],\n\t\t}),\n\t),\n);\n","import * as v from \"valibot\";\nimport {\n\tcreateApiSchema,\n\tcreateApiValidationSchema,\n\tcreateResponseSchema,\n\tcreateWireSchemaPair,\n} from \"../utils/schema-transform.js\";\nimport {\n\taccountPoliciesWire,\n\tdynamicFieldsWire,\n\tfinancialDetailWire,\n\tidDocumentDetailWire,\n\tmasterRecordWire,\n\tsupplierRefMasterRecordsWire,\n} from \"../utils/wire-shapes.js\";\nimport { BoolishSchema } from \"./booking-shared.js\";\nimport { LanguageCodeSchema } from \"./common.js\";\nimport {\n\tCarrierTypeSchema,\n\tGenderSchema,\n\tInsertCriteriaSchema,\n\tMasterPaymentTypeSchema,\n\tRecordStatus,\n\tRecordStatusSchema,\n\tRecordType,\n\tRecordTypeSchema,\n} from \"./enums.js\";\n\nconst FinancialDetailInputSchema = v.object({\n\tcurrencyCode: v.optional(v.string()),\n\tcreditLimit: v.optional(v.string()),\n\tc_PaymentType: v.optional(MasterPaymentTypeSchema),\n\tc_SpecPaymentTypeCode: v.optional(v.string()),\n\ts_PaymentType: v.optional(MasterPaymentTypeSchema),\n\ts_SpecPaymentTypeCode: v.optional(v.string()),\n\tenableElectronicInvoicing: v.optional(BoolishSchema),\n\telectronicInvoicingType: v.optional(v.string()),\n});\n\nconst financialPair = createWireSchemaPair(\n\tFinancialDetailInputSchema,\n\tfinancialDetailWire,\n);\nexport const FinancialDetailSchema = financialPair.api;\nexport const FinancialDetailApiValidationSchema = financialPair.validation;\n\nexport const IdDocumentDetailInputSchema = v.object({\n\tidType: v.optional(v.string()),\n\tidCode: v.optional(v.string()),\n\tidIssueLocation: v.optional(v.string()),\n\tidIssueCounty: v.optional(v.string()),\n\tidIssueDate: v.optional(v.string()),\n\tidExpireDate: v.optional(v.string()),\n});\n\nconst idDocumentPair = createWireSchemaPair(\n\tIdDocumentDetailInputSchema,\n\tidDocumentDetailWire,\n);\nexport const IdDocumentDetailSchema = idDocumentPair.api;\nexport const IdDocumentDetailApiValidationSchema = idDocumentPair.validation;\n\nexport const DynamicFieldsInputSchema = v.object({\n\tkey: v.string(),\n\tvalue: v.string(),\n});\n\n/**\n * Dynamic fields validation schema (already transformed PascalCase with @ attributes)\n */\nexport const DynamicFieldsApiValidationSchema = createApiValidationSchema(\n\tDynamicFieldsInputSchema,\n\tdynamicFieldsWire,\n);\n\n/*\n * Supplier reference master records schema for API requests (transforms to PascalCase)\n * @property supplierRefCode - Supplier reference code\n * @property companyMainBusinessType - Company main business type\n * @property carrierType - Carrier type\n */\nconst SupplierRefMasterRecordsInputSchema = v.object({\n\tsupplierRefCode: v.optional(v.string()),\n\tcompanyMainBusinessType: v.optional(v.string()),\n\tcarrierType: v.optional(CarrierTypeSchema),\n});\n\nconst supplierRefPair = createWireSchemaPair(\n\tSupplierRefMasterRecordsInputSchema,\n\tsupplierRefMasterRecordsWire,\n);\nexport const SupplierRefMasterRecordsSchema = supplierRefPair.api;\nexport const SupplierRefMasterRecordsApiValidationSchema =\n\tsupplierRefPair.validation;\n\nconst flagSchema = v.union([v.literal(0), v.literal(1)]);\n\nconst AccountPoliciesInputSchema = v.object({\n\tacceptProfilingPolicies: v.optional(flagSchema),\n\tacceptPrivacyPolicies: v.optional(flagSchema),\n\tacceptNewsletterPolicies: v.optional(flagSchema),\n});\n\nconst accountPoliciesPair = createWireSchemaPair(\n\tAccountPoliciesInputSchema,\n\taccountPoliciesWire,\n);\nexport const AccountPoliciesSchema = accountPoliciesPair.api;\nexport const AccountPoliciesApiValidationSchema =\n\taccountPoliciesPair.validation;\n\n/**\n * Master record detail input schema (camelCase)\n */\nexport const MasterRecordDetailSchema = v.object({\n\trecordCode: v.optional(v.pipe(v.string(), v.minLength(6), v.maxLength(6))),\n\tinsertCriteria: v.optional(InsertCriteriaSchema),\n\tcreatedDate: v.optional(v.string()),\n\trecordType: v.optional(RecordTypeSchema, RecordType.CUSTOMER),\n\trecordStatus: v.optional(RecordStatusSchema, RecordStatus.ENABLED),\n\tmoniker: v.optional(v.string()),\n\tname: v.optional(v.string()),\n\textraInfo: v.optional(v.string()),\n\tlanguageCode: LanguageCodeSchema,\n\taddress: v.optional(v.string()),\n\tzipCode: v.optional(v.string()),\n\tcityName: v.optional(v.string()),\n\tcountyCode: v.optional(v.string()),\n\tstateCode: v.optional(v.string()),\n\tcategoryCode: v.optional(v.string()),\n\tfirstPhoneNumber: v.optional(v.string()),\n\tmobilePhoneNumber: v.optional(v.string()),\n\temail: v.optional(v.string()),\n\tgender: v.optional(GenderSchema),\n\tbirthDate: v.optional(v.string()),\n\tbirthCity: v.optional(v.string()),\n\tbirthCounty: v.optional(v.string()),\n\tfiscalCode: v.optional(v.string()),\n\tvatCode: v.optional(v.string()),\n\tthirdPartRecordCode: v.optional(v.string()),\n\tidDocumentDetail: v.optional(IdDocumentDetailInputSchema),\n\taccountPolicies: v.optional(AccountPoliciesInputSchema),\n\tfinancialDetail: v.optional(FinancialDetailInputSchema),\n\tdynamicFields: v.optional(v.array(DynamicFieldsInputSchema)),\n\tsupplierRefMasterRecords: v.optional(SupplierRefMasterRecordsInputSchema),\n});\n\n/**\n * Master record detail schema for API requests (transforms to PascalCase)\n */\nexport const MasterRecordDetailApiSchema = createApiSchema(\n\tMasterRecordDetailSchema,\n\tmasterRecordWire,\n);\n\n/**\n * Master record detail API validation schema (PascalCase with @ attributes).\n * Nested structure is generated from `masterRecordWire`; overrides are server-only fields.\n */\nexport const MasterRecordDetailApiValidationSchema = v.partial(\n\tcreateApiValidationSchema(MasterRecordDetailSchema, masterRecordWire, {\n\t\tModifiedDate: v.optional(v.string()),\n\t\tLoginType: v.optional(v.string()),\n\t\tPromoterCode: v.optional(v.string()),\n\t\tEncryptedPassword: v.optional(BoolishSchema),\n\t\tNewsletterDisabled: v.optional(BoolishSchema),\n\t}),\n);\n\n/**\n * Master record detail response schema (transforms to camelCase)\n */\nexport const MasterRecordDetailResponseSchema = createResponseSchema(\n\tMasterRecordDetailApiValidationSchema,\n);\n","import * as v from \"valibot\";\nimport {\n\tcoalesceCustomerRecordCode,\n\tcreateApiSchema,\n\tcreateFlattenedResponseSchema,\n\tvalueFieldSchema,\n} from \"../utils/schema-transform.js\";\nimport { bookingFileWire } from \"../utils/wire-shapes.js\";\nimport {\n\tBookingFileDetailApiSchema,\n\tPrintableDocumentsListApiSchema,\n\tTotalAmountDetailApiSchema,\n} from \"./booking-response.js\";\nimport {\n\tAvesServiceTypeSchema,\n\tBookingFileStatusSchema,\n\tBoolishSchema,\n\tCostPriceTypeSchema,\n\tCustomerPaymentTypeSchema,\n\tDocumentTypeSchema,\n\tGenderSchema,\n\tGroupingPaxPolicySchema,\n\tMakeDocumentToSchema,\n\tPassengerCategorySchema,\n\tPaymentTypeSchema,\n\tToServiceTypeSchema,\n\tTypeDownloadFileSchema,\n} from \"./booking-shared.js\";\nimport { RsStatusSchema } from \"./common.js\";\nimport { DestinationTypeSchema } from \"./enums.js\";\nimport { IdDocumentDetailInputSchema } from \"./master-record.js\";\n\n// ---------------------------------------------------------------------------\n// BookingFileStatus\n// ---------------------------------------------------------------------------\n\nconst BookingFileStatusInputSchema = valueFieldSchema(BookingFileStatusSchema, {\n\texpiredDate: v.optional(v.string()),\n});\n\n// ---------------------------------------------------------------------------\n// StatisticCodes (AvesStatisticCodes)\n// ---------------------------------------------------------------------------\n\nexport const StatisticCodesInputSchema = v.object({\n\tsCode1: v.optional(v.pipe(v.string(), v.maxLength(4))),\n\tsCode2: v.optional(v.pipe(v.string(), v.maxLength(4))),\n\tsCode3: v.optional(v.pipe(v.string(), v.maxLength(4))),\n\tsCode4: v.optional(v.pipe(v.string(), v.maxLength(4))),\n\tsCode5: v.optional(v.pipe(v.string(), v.maxLength(4))),\n\tsCode6: v.optional(v.pipe(v.string(), v.maxLength(4))),\n});\n\n// ---------------------------------------------------------------------------\n// Destination\n// ---------------------------------------------------------------------------\n\nexport const DestinationInputSchema = v.object({\n\tcode: v.optional(v.string()),\n\tiataCode: v.optional(v.string()),\n\tnationCode: v.optional(v.string()),\n\ttype: v.optional(DestinationTypeSchema),\n});\n\n// ---------------------------------------------------------------------------\n// CustomerDetail (record code only or full master record data)\n// ---------------------------------------------------------------------------\n\nconst CustomerDetailInputSchema = v.object({\n\trecordCode: v.optional(v.string()),\n\t// When inserting new record, master record fields can be provided (see Common Structures)\n});\n\n// ---------------------------------------------------------------------------\n// BookingFileDocument\n// ---------------------------------------------------------------------------\n\nconst ReservationFormCustomizablePrintParametersInputSchema = v.object({\n\tmakeDocumentTo: v.optional(MakeDocumentToSchema),\n});\n\nconst TravelInformationCustomizablePrintParametersInputSchema = v.object({\n\tfillInCode: v.optional(v.string()),\n});\n\nconst DocumentCustomizablePrintParametersInputSchema = v.union([\n\tReservationFormCustomizablePrintParametersInputSchema,\n\tTravelInformationCustomizablePrintParametersInputSchema,\n]);\n\nconst InfoDocumentToPrintInputSchema = v.object({\n\tdocumentType: DocumentTypeSchema,\n\tdocumentCustomizablePrintParameters: v.optional(\n\t\tDocumentCustomizablePrintParametersInputSchema,\n\t),\n});\n\nexport const BookingFileDocumentInputSchema = v.object({\n\tprintDoc: v.optional(BoolishSchema),\n\tsendDocViaEmail: v.optional(BoolishSchema),\n\tinfoDocumentsToPrint: v.optional(v.array(InfoDocumentToPrintInputSchema)),\n});\n\n// ---------------------------------------------------------------------------\n// FinancialDeadlineList / DeadlineList / PaymentList\n// ---------------------------------------------------------------------------\n\nconst FinancialDeadlineDetailInputSchema = v.object({\n\treschedulingCode: v.optional(v.string()),\n\texpireDate: v.optional(v.string()),\n\ttotalAmount: v.optional(v.string()),\n});\n\nconst DeadlineDetailInputSchema = v.object({\n\tdeadlineCode: v.optional(v.string()),\n\tdescription: v.optional(v.string()),\n\texpireDate: v.optional(v.string()),\n});\n\nconst PaymentDetailInputSchema = v.object({\n\tpaymentDate: v.optional(v.string()),\n\tpaymentNote: v.optional(v.string()),\n\tamount: v.optional(v.string()),\n\tpaymentUser: v.optional(v.string()),\n\tpaymentType: v.optional(PaymentTypeSchema),\n});\n\n// ---------------------------------------------------------------------------\n// SelectedPackageList / SelectedServiceList / ExtraQuoteServiceList\n// ---------------------------------------------------------------------------\n\nconst NoteDetailInputSchema = v.object({\n\tnType: v.optional(v.string()),\n\ttitle: v.optional(v.string()),\n\ttext: v.optional(v.string()),\n});\n\n/** ServiceFare — cost/price of a selected or booked service */\nexport const ServiceFareInputSchema = v.object({\n\tcurrencyCode: v.optional(v.string()),\n\texchangeRate: v.optional(v.string()),\n\tcost: v.optional(v.string()),\n\tcostTax: v.optional(v.string()),\n\tcostType: v.optional(CostPriceTypeSchema),\n\tvatCostCurrencyCode: v.optional(v.string()),\n\tprice: v.optional(v.string()),\n\tpriceTax: v.optional(v.string()),\n\tpriceType: v.optional(CostPriceTypeSchema),\n});\n\nexport const AvesServiceInfoInputSchema = v.object({\n\tpackageCode: v.optional(v.string()),\n\tpackageReference: v.optional(v.string()),\n\tsuballotmentCode: v.optional(v.string()),\n\tpriceListCode: v.optional(v.string()),\n\tcostListCode: v.optional(v.string()),\n\texternalFileCode: v.optional(v.string()),\n\texternalReference: v.optional(v.string()),\n\tserviceStatus: v.optional(v.string()),\n\tserviceStatisticCode: v.optional(v.string()),\n\tserviceFare: v.optional(ServiceFareInputSchema),\n});\n\nexport const SelectedServiceDetailInputSchema = v.object({\n\tsCode: v.string(),\n\tssCode: v.optional(v.string()),\n\tavesServiceType: AvesServiceTypeSchema,\n\ttoServiceType: v.optional(ToServiceTypeSchema),\n\tsubServiceDesc: v.optional(v.string()),\n\tstartDate: v.string(),\n\tendDate: v.string(),\n\tqty: v.string(),\n\tpax: v.string(),\n\tpaxAssociated: v.optional(\n\t\tv.union([v.array(v.string()), v.array(v.object({ pax: v.string() }))]),\n\t),\n\tavesSession: v.string(),\n\tavesServiceInfo: v.optional(AvesServiceInfoInputSchema),\n\tserviceFare: v.optional(ServiceFareInputSchema),\n\tbookedServiceRef: v.optional(v.string()),\n\tsupplierMasterCode: v.optional(v.string()),\n\tvoucherMasterCode: v.optional(v.string()),\n\t// Known gaps: AVES service-info variants remain unmodeled raw strings.\n\thotelServiceInfo: v.optional(v.string()),\n\tcarRentalServiceInfo: v.optional(v.string()),\n\tflightServiceInfo: v.optional(v.string()),\n\tshipServiceInfo: v.optional(v.string()),\n\tticketServiceInfo: v.optional(v.string()),\n\tcommission: v.optional(v.string()),\n\tnoteList: v.optional(v.array(NoteDetailInputSchema)),\n\t// Known gap: AVES voucher info remains an unmodeled raw string.\n\tvoucherInfo: v.optional(v.string()),\n\tfirstDescription: v.optional(v.string()),\n\tsecondDescription: v.optional(v.string()),\n});\n\nexport const SelectedPackageDetailInputSchema = v.object({\n\tpCode: v.string(),\n\tstartDate: v.string(),\n\tendDate: v.string(),\n\tgetServicesFromPackage: v.optional(BoolishSchema),\n});\n\n// ---------------------------------------------------------------------------\n// PassengerList (PassengerDetail - see Common Structures \"Passenger\" DETAIL)\n// ---------------------------------------------------------------------------\n\nconst passengerDetailBase = {\n\trph: v.string(),\n\troomRph: v.optional(v.string()),\n\tbillingHolder: v.optional(BoolishSchema),\n\tmasterRecordCode: v.optional(v.string()),\n\tname: v.string(),\n\tsex: GenderSchema,\n\tbirthDate: v.optional(v.string()),\n\tbirthPlace: v.optional(v.string()),\n\tnationCode: v.optional(v.string()),\n\tcitizenshipCode: v.optional(v.string()),\n\tfiscalCode: v.optional(v.string()),\n\tphoneNumber: v.optional(v.string()),\n\teMail: v.optional(v.string()),\n\tnotes: v.optional(v.array(NoteDetailInputSchema)),\n\tflagStatus: v.optional(v.string()),\n\tofferCode: v.optional(v.string()),\n\tidDocInfo: v.optional(IdDocumentDetailInputSchema),\n};\n\n/** Passenger on CreateBookingFile — categoryCode required per AVES */\nexport const PassengerDetailCreateInputSchema = v.object({\n\t...passengerDetailBase,\n\tcategoryCode: PassengerCategorySchema,\n});\n\n/** Passenger on ModBookingFileHeader / ModServices — categoryCode optional */\nexport const PassengerDetailPatchInputSchema = v.object({\n\t...passengerDetailBase,\n\tcategoryCode: v.optional(PassengerCategorySchema),\n});\n\n// ---------------------------------------------------------------------------\n// BookingFinancialInfo\n// ---------------------------------------------------------------------------\n\nexport const BookingFinancialInfoInputSchema = v.object({\n\tcustomer_PaymentType: v.optional(CustomerPaymentTypeSchema),\n\tcustomer_SpecPaymentTypeCode: v.optional(v.string()),\n});\n\n// ---------------------------------------------------------------------------\n// BookingFileRQ (root body - camelCase input)\n// ---------------------------------------------------------------------------\n\n/**\n * Booking file request body schema (camelCase input).\n * Maps to BookFileRQ in AVES XML 1.8.0 CreateBookingFile.\n * `*List` fields are flat Detail arrays; wire wrap happens in BookingFileApiSchema.\n * Accepts `customerRecordCode` as a shorthand for `customerDetail: { recordCode }`.\n */\nexport const BookingFileSchema = v.pipe(\n\tv.object({\n\t\tcreateDate: v.optional(v.string()),\n\t\tbookingFileRefCode: v.optional(v.string()),\n\t\ttravelAgentCode: v.optional(v.string()),\n\t\tclerkName: v.optional(v.string()),\n\t\tcustomerDetail: v.optional(CustomerDetailInputSchema),\n\t\tcustomerRecordCode: v.optional(v.string()),\n\t\tcurrencyCode: v.optional(v.string()),\n\t\tmarkupCode: v.optional(v.string()),\n\t\tbookingFileStatus: BookingFileStatusInputSchema,\n\t\tstatisticCodes: v.optional(StatisticCodesInputSchema),\n\t\tdestination: v.optional(DestinationInputSchema),\n\t\tbookingFileDescription: v.optional(v.string()),\n\t\tstartDate: v.string(),\n\t\tendDate: v.string(),\n\t\tearlyBookingDate: v.optional(v.string()),\n\t\tcupCode: v.optional(v.string()),\n\t\tcigCode: v.optional(v.string()),\n\t\tcustomerPromoterCode: v.optional(v.string()),\n\t\tbillingReferenceCode: v.optional(v.string()),\n\t\tpaymentReferenceCode: v.optional(v.string()),\n\t\tbookingFileDocument: v.optional(BookingFileDocumentInputSchema),\n\t\tfinancialDeadlineList: v.optional(\n\t\t\tv.array(FinancialDeadlineDetailInputSchema),\n\t\t),\n\t\tdeadlineList: v.optional(v.array(DeadlineDetailInputSchema)),\n\t\tpaymentList: v.optional(v.array(PaymentDetailInputSchema)),\n\t\tselectedPackageList: v.optional(v.array(SelectedPackageDetailInputSchema)),\n\t\tselectedServiceList: v.array(SelectedServiceDetailInputSchema),\n\t\textraQuotaRefCode: v.optional(v.string()),\n\t\textraQuoteServiceList: v.optional(\n\t\t\tv.array(SelectedServiceDetailInputSchema),\n\t\t),\n\t\tgetExtraQuoteFromSystem: v.optional(BoolishSchema),\n\t\tpassengerList: v.array(PassengerDetailCreateInputSchema),\n\t\tnoteList: v.optional(v.array(NoteDetailInputSchema)),\n\t\tbookingFinancialInfo: v.optional(BookingFinancialInfoInputSchema),\n\t\tbookingFileCode: v.optional(v.string()),\n\t\tgroupingPaxPolicy: v.optional(GroupingPaxPolicySchema),\n\t\tgroupBookingFile: v.optional(BoolishSchema),\n\t\ttypeDownloadFile: v.optional(TypeDownloadFileSchema),\n\t\tsetBookingFileCodeFromStartDate: v.optional(BoolishSchema),\n\t}),\n\tv.check(\n\t\t(input) => !!(input.customerDetail || input.customerRecordCode),\n\t\t\"customerDetail or customerRecordCode is required\",\n\t),\n\tv.transform(coalesceCustomerRecordCode),\n);\n\n/**\n * Booking file schema for API requests (list wrap + PascalCase for BookFileRQ).\n */\nexport const BookingFileApiSchema = createApiSchema(\n\tBookingFileSchema,\n\tbookingFileWire,\n);\n\n/**\n * Shared booking response (Create / ModServices / SetStatus / SetStatusService).\n * Spreads `BookingFileDetail` onto the root; cancel extras stay sibling fields.\n */\nexport const BookingFileResponseSchema = createFlattenedResponseSchema(\n\tv.object({\n\t\tRsStatus: RsStatusSchema,\n\t\tBookingFileDetail: v.optional(BookingFileDetailApiSchema),\n\t\tPrintableDocumentsList: v.optional(PrintableDocumentsListApiSchema),\n\t\tTotalAmountDetailAfterCancellation: v.optional(TotalAmountDetailApiSchema),\n\t\tBase64DocContent: v.optional(v.string()),\n\t}),\n\t\"bookingFileDetail\",\n);\n","import * as v from \"valibot\";\nimport {\n\tcoalesceListHead,\n\tcreateApiSchema,\n\tvalueFieldSchema,\n} from \"../utils/schema-transform.js\";\nimport {\n\telementOnlyWire,\n\tfilePaymentListRequestWire,\n\tmodBookingFileWire,\n\tsetFileStatusWire,\n} from \"../utils/wire-shapes.js\";\nimport {\n\tBookingFileDocumentInputSchema,\n\tBookingFileResponseSchema,\n\tBookingFinancialInfoInputSchema,\n\tPassengerDetailPatchInputSchema,\n\tSelectedPackageDetailInputSchema,\n\tSelectedServiceDetailInputSchema,\n\tStatisticCodesInputSchema,\n} from \"./booking-file.js\";\nimport {\n\tBoolishSchema,\n\tCancelOperationTypeSchema,\n\tFilePaymentOperationTypeSchema,\n\tOptionedExpirePolicySchema,\n\tPaymentTypeSchema,\n\tServiceRefTypeSchema,\n\tSetFileStatusValueSchema,\n} from \"./booking-shared.js\";\nimport { StatusOnlyResponseSchema } from \"./common.js\";\n\n/** Response with RsStatus only (Cancel / ModHeader) */\nexport const BookingStatusOnlyResponseSchema = StatusOnlyResponseSchema;\n\n/** Shared booking file identity fields */\nexport const bookingFileRefEntries = {\n\tcustomerRecordCode: v.string(),\n\tbookingFileCode: v.string(),\n} as const;\n\n/**\n * Shared with CreateBookingFile — typed BookingFileDetail fields on the root (+ optional cancel extras).\n * Create / ModServices / SetStatus / SetStatusService all use this shape.\n */\nexport const BookingFileDetailResponseSchema = BookingFileResponseSchema;\n\n// ---------------------------------------------------------------------------\n// ModBookingFileServices — ModFileServicesRQ\n// ---------------------------------------------------------------------------\n\nconst ModDeadlineDetailInputSchema = v.object({\n\treschedulingCode: v.string(),\n\tdescription: v.optional(v.string()),\n\texpireDate: v.optional(v.string()),\n});\n\nexport const CancellableBookedServiceDetailInputSchema = v.object({\n\tcancelOperationType: CancelOperationTypeSchema,\n\tserviceRefType: ServiceRefTypeSchema,\n\tserviceRefValue: v.string(),\n});\n\n/**\n * ModFileServicesRQ body (camelCase).\n * `*List` fields are flat Detail arrays; wire wrap happens in ModFileServicesApiSchema.\n * `selectedPackageList` (len 1) is an alias for `selectedPackageDetail`.\n */\nexport const ModFileServicesSchema = v.pipe(\n\tv.object({\n\t\t...bookingFileRefEntries,\n\t\tcurrencyCode: v.optional(v.string()),\n\t\tdeadlineList: v.optional(v.array(ModDeadlineDetailInputSchema)),\n\t\tselectedPackageDetail: v.optional(SelectedPackageDetailInputSchema),\n\t\tselectedPackageList: v.optional(\n\t\t\tv.pipe(v.array(SelectedPackageDetailInputSchema), v.maxLength(1)),\n\t\t),\n\t\tselectedServiceList: v.pipe(\n\t\t\tv.array(SelectedServiceDetailInputSchema),\n\t\t\tv.minLength(1),\n\t\t),\n\t\tcancellableBookedServiceList: v.optional(\n\t\t\tv.array(CancellableBookedServiceDetailInputSchema),\n\t\t),\n\t\tpassengerList: v.optional(v.array(PassengerDetailPatchInputSchema)),\n\t}),\n\tv.transform(coalesceListHead(\"selectedPackageList\", \"selectedPackageDetail\")),\n);\n\nexport const ModFileServicesApiSchema = createApiSchema(\n\tModFileServicesSchema,\n\tmodBookingFileWire,\n);\n\n// ---------------------------------------------------------------------------\n// ModBookingFileHeader — ModFileHeaderRQ\n// ---------------------------------------------------------------------------\n\n/**\n * ModFileHeaderRQ body (camelCase).\n * Modify header only — no package/costs.\n */\nexport const ModFileHeaderSchema = v.object({\n\t...bookingFileRefEntries,\n\tbookingFileStartDate: v.string(),\n\tnewCustomerRecordCode: v.optional(v.string()),\n\tbookingFileReferenceName: v.optional(v.string()),\n\ttravelAgentCode: v.optional(v.string()),\n\tbillingReferenceCode: v.optional(v.string()),\n\tpaymentReferenceCode: v.optional(v.string()),\n\tcupCode: v.optional(v.string()),\n\tcigCode: v.optional(v.string()),\n\tcustomerPromoterCode: v.optional(v.string()),\n\tbookingNote: v.optional(v.string()),\n\tpassengerList: v.optional(v.array(PassengerDetailPatchInputSchema)),\n\tstatisticCodes: v.optional(StatisticCodesInputSchema),\n\tbookingFinancialInfo: v.optional(BookingFinancialInfoInputSchema),\n\tfinancialDeadlineList: v.optional(\n\t\tv.array(\n\t\t\tv.object({\n\t\t\t\treschedulingCode: v.string(),\n\t\t\t\texpireDate: v.string(),\n\t\t\t\ttotalAmount: v.string(),\n\t\t\t}),\n\t\t),\n\t),\n});\n\nexport const ModFileHeaderApiSchema = createApiSchema(\n\tModFileHeaderSchema,\n\tmodBookingFileWire,\n);\n\n// ---------------------------------------------------------------------------\n// CancelBookingFile — CancelFileRQ\n// ---------------------------------------------------------------------------\n\nexport const CancelFileSchema = v.object({\n\t...bookingFileRefEntries,\n});\n\nexport const CancelFileApiSchema = createApiSchema(\n\tCancelFileSchema,\n\telementOnlyWire,\n);\n\n// ---------------------------------------------------------------------------\n// SetBookingFileStatus — SetStatusRQ\n// ---------------------------------------------------------------------------\n\n/**\n * SetStatusRQ body (camelCase).\n * Change booking file status (incl. CANCELED / NULLIFIED).\n * `fileStatus` accepts a status string or `{ value, expiredDate?, ... }`.\n */\nexport const SetFileStatusSchema = v.object({\n\t...bookingFileRefEntries,\n\tfileStatus: valueFieldSchema(SetFileStatusValueSchema, {\n\t\texpiredDate: v.optional(v.string()),\n\t\toptionedFileExpireDatePolicy: v.optional(OptionedExpirePolicySchema),\n\t}),\n\tbackOfficeRequest: v.optional(BoolishSchema),\n\tbookingFileDocument: v.optional(BookingFileDocumentInputSchema),\n\tpenalty: v.optional(\n\t\tv.object({\n\t\t\tapply: v.optional(BoolishSchema),\n\t\t\tspecificCode: v.optional(v.string()),\n\t\t}),\n\t),\n\tsimulateCancelAndGetPenaltyAmount: v.optional(BoolishSchema),\n});\n\nexport const SetFileStatusApiSchema = createApiSchema(\n\tSetFileStatusSchema,\n\tsetFileStatusWire,\n);\n\n// ---------------------------------------------------------------------------\n// SetBookingFileServiceStatus — SetStatusServiceRQ\n// ---------------------------------------------------------------------------\n\nexport const SetFileServiceStatusSchema = v.object({\n\t...bookingFileRefEntries,\n\tbookingServiceRef: v.string(),\n\tbookingFileServiceStatus: v.literal(\"NULLIFIED\"),\n\tbookingFileServiceStatusDate: v.optional(v.string()),\n});\n\nexport const SetFileServiceStatusApiSchema = createApiSchema(\n\tSetFileServiceStatusSchema,\n\telementOnlyWire,\n);\n\n// ---------------------------------------------------------------------------\n// InsertFilePaymentList — FilePaymentListRQ\n// ---------------------------------------------------------------------------\n\nexport const FilePaymentDetailInputSchema = v.object({\n\tpaymentDate: v.string(),\n\tpaymentNote: v.optional(v.string()),\n\tpayerMasterCode: v.optional(v.string()),\n\tpayerName: v.optional(v.string()),\n\tamount: v.string(),\n\tpaymentType: PaymentTypeSchema,\n});\n\n/**\n * FilePaymentListRQ body (camelCase).\n * `filePaymentList` is a flat Detail array; wire wrap happens in FilePaymentListApiSchema.\n */\nexport const FilePaymentListSchema = v.pipe(\n\tv.object({\n\t\tbookingFileCode: v.optional(v.string()),\n\t\tbookingFileRefCode: v.optional(v.string()),\n\t\tpaymentUser: v.optional(v.string()),\n\t\tenableMultiplePayments: BoolishSchema,\n\t\toperationType: FilePaymentOperationTypeSchema,\n\t\tfilePaymentList: v.pipe(\n\t\t\tv.array(FilePaymentDetailInputSchema),\n\t\t\tv.minLength(1),\n\t\t),\n\t}),\n\tv.check(\n\t\t(input) => Boolean(input.bookingFileCode || input.bookingFileRefCode),\n\t\t\"bookingFileCode or bookingFileRefCode is required\",\n\t),\n);\n\nexport const FilePaymentListApiSchema = createApiSchema(\n\tFilePaymentListSchema,\n\tfilePaymentListRequestWire,\n);\n","import * as v from \"valibot\";\nimport {\n\tcreateApiSchema,\n\tcreateListResponseSchema,\n\tlistDetailApiSchema,\n\tvalueFieldSchema,\n} from \"../utils/schema-transform.js\";\nimport { searchFileWire } from \"../utils/wire-shapes.js\";\nimport { BookingFileDetailApiSchema } from \"./booking-response.js\";\nimport {\n\tBookingFileStatusWireSchema,\n\tBoolishSchema,\n} from \"./booking-shared.js\";\nimport { DateRangeSchema } from \"./common.js\";\nimport { SearchBookingFileType } from \"./enums.js\";\n\nconst searchFileStatusSchema = valueFieldSchema(BookingFileStatusWireSchema, {\n\texpireDate: v.optional(v.string()),\n});\n\nconst insuranceSchema = v.object({\n\tcode: v.optional(v.string()),\n\tnumber: v.optional(v.string()),\n});\n\nconst searchFileBase = {\n\tcustomerRecordCode: v.string(),\n\tcustomerPromoterCode: v.optional(v.string()),\n\tgetSupplierInfo: v.optional(BoolishSchema),\n\tuser: v.optional(v.string()),\n\tofficeCode: v.optional(v.string()),\n};\n\nconst FileCodeSearchSchema = v.object({\n\t...searchFileBase,\n\tsearchType: v.literal(SearchBookingFileType.FILE_CODE),\n\tbookingFileCode: v.string(),\n});\n\nconst PaxNameSearchSchema = v.object({\n\t...searchFileBase,\n\tsearchType: v.literal(SearchBookingFileType.PAX_NAME),\n\tfirstPaxName: v.string(),\n});\n\nconst PackageCodeSearchSchema = v.object({\n\t...searchFileBase,\n\tsearchType: v.literal(SearchBookingFileType.PACKAGE_CODE),\n\tpackageCode: v.string(),\n});\n\nconst OtherSearchSchema = v.object({\n\t...searchFileBase,\n\tsearchType: v.literal(SearchBookingFileType.OTHER),\n\tfileStatus: v.optional(searchFileStatusSchema),\n\tstartDate: v.optional(DateRangeSchema),\n\tcreatedDate: v.optional(DateRangeSchema),\n\tlastModificationDate: v.optional(DateRangeSchema),\n\tinsurance: v.optional(insuranceSchema),\n\tisSearchForB2C: v.optional(BoolishSchema),\n});\n\n/**\n * SearchFileRQ body (camelCase) — discriminated by searchType.\n */\nexport const SearchBookingFileSchema = v.union([\n\tFileCodeSearchSchema,\n\tPaxNameSearchSchema,\n\tPackageCodeSearchSchema,\n\tOtherSearchSchema,\n]);\n\nexport const SearchBookingFileApiSchema = createApiSchema(\n\tSearchBookingFileSchema,\n\tsearchFileWire,\n);\n\nexport const SearchBookingFileResponseSchema = createListResponseSchema(\n\t\"BookingFileList\",\n\tlistDetailApiSchema(\"BookingFileDetail\", BookingFileDetailApiSchema),\n);\n","export const XML_ROOT_ELEMENTS = {\n\tSEARCH_REQUEST: \"SearchMasterRecordRQ\",\n\tSEARCH_RESPONSE: \"SearchMasterRecordRS\",\n\tUPSERT_REQUEST: \"ManageMasterRecordRQ\",\n\tUPSERT_RESPONSE: \"ManageMasterRecordRS\",\n\tBOOKING_REQUEST: \"BookFileRQ\",\n\tBOOKING_RESPONSE: \"BookingFileRS\",\n\tMOD_FILE_SERVICES_REQUEST: \"ModFileServicesRQ\",\n\tMOD_FILE_HEADER_REQUEST: \"ModFileHeaderRQ\",\n\tMOD_FILE_HEADER_RESPONSE: \"ModFileHeaderRS\",\n\tCANCEL_FILE_REQUEST: \"CancelFileRQ\",\n\tCANCEL_FILE_RESPONSE: \"CancelFileRS\",\n\tSET_STATUS_REQUEST: \"SetStatusRQ\",\n\tSET_STATUS_RESPONSE: \"SetStatusRS\",\n\tSET_STATUS_SERVICE_REQUEST: \"SetStatusServiceRQ\",\n\tSET_STATUS_SERVICE_RESPONSE: \"SetStatusServiceRS\",\n\tFILE_PAYMENT_LIST_REQUEST: \"FilePaymentListRQ\",\n\tFILE_PAYMENT_LIST_RESPONSE: \"FilePaymentListRS\",\n\tAVES_SEARCH_REQUEST: \"AvesSearchRQ\",\n\tSEARCH_PACKAGE_RESPONSE: \"SearchPackageRS\",\n\tSEARCH_SERVICES_RESPONSE: \"SearchServicesRS\",\n\tPACKAGE_DETAIL_REQUEST: \"PackageDetailRQ\",\n\tPACKAGE_DETAIL_RESPONSE: \"PackageDetailRS\",\n\tCOMMIT_PACKAGE_REQUEST: \"CommitPackRQ\",\n\tCOMMIT_PACKAGE_RESPONSE: \"CommitPackRS\",\n\tSEARCH_BOOKING_FILE_REQUEST: \"SearchFileRQ\",\n\tSEARCH_BOOKING_FILE_RESPONSE: \"SearchFileRS\",\n} as const;\n\nexport type XMLRootElementValues =\n\t(typeof XML_ROOT_ELEMENTS)[keyof typeof XML_ROOT_ELEMENTS];\n\nexport function createRootElement<T>(name: XMLRootElementValues, object: T) {\n\treturn { [name]: object };\n}\n","export const AVES_ENDPOINTS = {\n\tsearch: \"/interop/masterRecords/v2/rest/Search\",\n\tupsert: \"/interop/masterRecords/v2/rest/InsertOrUpdate\",\n\tcreateBooking: \"/interop/booking/v2/rest/CreateBookingFile\",\n\tmodBookingServices: \"/interop/booking/v2/rest/ModBookingFileServices\",\n\tmodBookingHeader: \"/interop/booking/v2/rest/ModBookingFileHeader\",\n\tcancelBooking: \"/interop/booking/v2/rest/CancelBookingFile\",\n\tsetBookingStatus: \"/interop/booking/v2/rest/SetBookingFileStatus\",\n\tsetBookingServiceStatus:\n\t\t\"/interop/booking/v2/rest/SetBookingFileServiceStatus\",\n\tinsertFilePaymentList: \"/interop/booking/v2/rest/InsertFilePaymentList\",\n\tsearchAvesPackages: \"/interop/booking/v2/rest/SearchAvesPackages\",\n\tsearchTopServices: \"/interop/booking/v2/rest/SearchTopServices\",\n\tgetPackageDetail: \"/interop/booking/v2/rest/GetPackageDetail\",\n\tcommitPackage: \"/interop/booking/v2/rest/CommitPackage\",\n\tsearchBookingFile: \"/interop/booking/v2/rest/SearchBookingFile\",\n} as const;\n\nexport type AvesEndpointKey = keyof typeof AVES_ENDPOINTS;\n","import type { AvesError } from \"../error.js\";\nimport {\n\tBookingFileApiSchema,\n\tBookingFileResponseSchema,\n} from \"../schemas/booking-file.js\";\nimport {\n\tBookingFileDetailResponseSchema,\n\tBookingStatusOnlyResponseSchema,\n\tCancelFileApiSchema,\n\tFilePaymentListApiSchema,\n\tModFileHeaderApiSchema,\n\tModFileServicesApiSchema,\n\tSetFileServiceStatusApiSchema,\n\tSetFileStatusApiSchema,\n} from \"../schemas/booking-ops.js\";\nimport {\n\tSearchBookingFileApiSchema,\n\tSearchBookingFileResponseSchema,\n} from \"../schemas/search-booking-file.js\";\nimport type {\n\tBookingFileDetailRS,\n\tBookingFileRQ,\n\tBookingFileRS,\n\tBookingStatusOnlyRS,\n\tCancelFileRQ,\n\tFilePaymentListRQ,\n\tModFileHeaderRQ,\n\tModFileServicesRQ,\n\tSearchBookingFileRQ,\n\tSearchBookingFileRS,\n\tSetFileServiceStatusRQ,\n\tSetFileStatusRQ,\n} from \"../types.js\";\nimport type { Result } from \"../utils/result.js\";\nimport { XML_ROOT_ELEMENTS } from \"../xml/root.js\";\nimport { AVES_ENDPOINTS } from \"./endpoints.js\";\nimport type { AvesTransport } from \"./transport.js\";\n\nexport class BookingClient {\n\tconstructor(private readonly transport: AvesTransport) {}\n\n\t/** Create a booking file (CreateBookingFile). */\n\tcreateBooking(\n\t\tparams: BookingFileRQ,\n\t): Promise<Result<BookingFileRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"createBooking\",\n\t\t\tparams,\n\t\t\tapiSchema: BookingFileApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.createBooking,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.BOOKING_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.BOOKING_RESPONSE,\n\t\t\tresponseSchema: BookingFileResponseSchema,\n\t\t});\n\t}\n\n\t/** Add/replace services, assign package, delete/nullify cost items. */\n\tmodBookingServices(\n\t\tparams: ModFileServicesRQ,\n\t): Promise<Result<BookingFileDetailRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"modBookingServices\",\n\t\t\tparams,\n\t\t\tapiSchema: ModFileServicesApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.modBookingServices,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.MOD_FILE_SERVICES_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.BOOKING_RESPONSE,\n\t\t\tresponseSchema: BookingFileDetailResponseSchema,\n\t\t});\n\t}\n\n\t/** Header only (pax, notes, billing) — no costs. */\n\tmodBookingHeader(\n\t\tparams: ModFileHeaderRQ,\n\t): Promise<Result<BookingStatusOnlyRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"modBookingHeader\",\n\t\t\tparams,\n\t\t\tapiSchema: ModFileHeaderApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.modBookingHeader,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.MOD_FILE_HEADER_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.MOD_FILE_HEADER_RESPONSE,\n\t\t\tresponseSchema: BookingStatusOnlyResponseSchema,\n\t\t});\n\t}\n\n\t/** Delete a booking file (CancelBookingFile). */\n\tcancelBooking(\n\t\tparams: CancelFileRQ,\n\t): Promise<Result<BookingStatusOnlyRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"cancelBooking\",\n\t\t\tparams,\n\t\t\tapiSchema: CancelFileApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.cancelBooking,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.CANCEL_FILE_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.CANCEL_FILE_RESPONSE,\n\t\t\tresponseSchema: BookingStatusOnlyResponseSchema,\n\t\t});\n\t}\n\n\t/** Change booking file status (incl. CANCELED / NULLIFIED). */\n\tsetBookingStatus(\n\t\tparams: SetFileStatusRQ,\n\t): Promise<Result<BookingFileDetailRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"setBookingStatus\",\n\t\t\tparams,\n\t\t\tapiSchema: SetFileStatusApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.setBookingStatus,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.SET_STATUS_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SET_STATUS_RESPONSE,\n\t\t\tresponseSchema: BookingFileDetailResponseSchema,\n\t\t});\n\t}\n\n\t/** Nullify a single booked service line. */\n\tsetBookingServiceStatus(\n\t\tparams: SetFileServiceStatusRQ,\n\t): Promise<Result<BookingFileDetailRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"setBookingServiceStatus\",\n\t\t\tparams,\n\t\t\tapiSchema: SetFileServiceStatusApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.setBookingServiceStatus,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.SET_STATUS_SERVICE_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SET_STATUS_SERVICE_RESPONSE,\n\t\t\tresponseSchema: BookingFileDetailResponseSchema,\n\t\t});\n\t}\n\n\t/** Register one or more payments on a booking file. */\n\tinsertFilePaymentList(\n\t\tparams: FilePaymentListRQ,\n\t): Promise<Result<BookingStatusOnlyRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"insertFilePaymentList\",\n\t\t\tparams,\n\t\t\tapiSchema: FilePaymentListApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.insertFilePaymentList,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.FILE_PAYMENT_LIST_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.FILE_PAYMENT_LIST_RESPONSE,\n\t\t\tresponseSchema: BookingStatusOnlyResponseSchema,\n\t\t});\n\t}\n\n\t/** Search booking files, incl. by PACKAGE_CODE. */\n\tsearchBookingFiles(\n\t\tparams: SearchBookingFileRQ,\n\t): Promise<Result<SearchBookingFileRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"searchBookingFiles\",\n\t\t\tparams,\n\t\t\tapiSchema: SearchBookingFileApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.searchBookingFile,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.SEARCH_BOOKING_FILE_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SEARCH_BOOKING_FILE_RESPONSE,\n\t\t\tresponseSchema: SearchBookingFileResponseSchema,\n\t\t});\n\t}\n}\n","import * as v from \"valibot\";\nimport {\n\tcreateApiSchema,\n\tcreateListResponseSchema,\n\tlistDetailApiSchema,\n} from \"../utils/schema-transform.js\";\nimport { searchMasterWire } from \"../utils/wire-shapes.js\";\nimport {\n\tDateRangeSchema,\n\tOptionalLanguageCodeSchema,\n\tRqHeaderSchema,\n} from \"./common.js\";\nimport { SearchMasterType } from \"./enums.js\";\nimport { MasterRecordDetailApiValidationSchema } from \"./master-record.js\";\n\nconst LastModificationDateInputSchema = DateRangeSchema;\nconst languageCodeField = OptionalLanguageCodeSchema;\n\n/**\n * Search by CODE - requires recordCode\n */\nconst CodeSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.CODE),\n\trecordCode: v.pipe(v.string(), v.minLength(5), v.maxLength(6)),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by NAME - requires name, optionally city\n */\nconst NameSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.NAME),\n\tname: v.string(),\n\tcity: v.optional(v.string()),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by VATCODE - requires vatCode, optionally phoneNumber\n */\nconst VatCodeSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.VATCODE),\n\tvatCode: v.string(),\n\tphoneNumber: v.optional(v.string()),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by ZONE - requires zipCode and countyCode, optionally city\n */\nconst ZoneSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.ZONE),\n\tzipCode: v.string(),\n\tcountyCode: v.string(),\n\tcity: v.optional(v.string()),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by CATEGORY - requires categoryCode\n */\nconst CategorySearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.CATEGORY),\n\tcategoryCode: v.string(),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by EMAIL - requires email\n */\nconst EmailSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.EMAIL),\n\temail: v.string(),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by LASTMODDATE - requires lastModificationDate\n */\nconst LastModDateSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.LASTMODDATE),\n\tlastModificationDate: LastModificationDateInputSchema,\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by SEARCH FIELD - requires searchFieldValue\n */\nconst SearchFieldSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.SEARCH_FIELD),\n\tsearchFieldValue: v.string(),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search by EXTERNAL_REF_CODE - requires searchFieldValue\n */\nconst ExternalRefCodeSearchSchema = v.object({\n\tsearchType: v.literal(SearchMasterType.EXTERNAL_REF_CODE),\n\tsearchFieldValue: v.string(),\n\tlanguageCode: languageCodeField,\n});\n\n/**\n * Search master record input schema (camelCase)\n * Conditional fields based on searchType\n */\nexport const SearchMasterRecordSchema = v.union([\n\tCodeSearchSchema,\n\tNameSearchSchema,\n\tVatCodeSearchSchema,\n\tZoneSearchSchema,\n\tCategorySearchSchema,\n\tEmailSearchSchema,\n\tLastModDateSearchSchema,\n\tSearchFieldSearchSchema,\n\tExternalRefCodeSearchSchema,\n]);\n\n/**\n * Search master record schema for API requests (transforms to PascalCase).\n * recordCode stays an element (not @attr) via {@link searchMasterWire}.\n */\nexport const SearchMasterRecordApiSchema = createApiSchema(\n\tSearchMasterRecordSchema,\n\tsearchMasterWire,\n);\n\n/**\n * Complete search request schema with header\n * Flattens SearchMasterRecord fields to root level\n */\nexport const SearchMasterRecordRequestSchema = v.pipe(\n\tv.object({\n\t\tRqHeader: RqHeaderSchema,\n\t\tSearchMasterRecord: SearchMasterRecordApiSchema,\n\t}),\n\tv.transform((input) => {\n\t\tconst { SearchMasterRecord: searchFields, RqHeader, ...rest } = input;\n\t\treturn {\n\t\t\tRqHeader,\n\t\t\t...searchFields,\n\t\t\t...rest,\n\t\t};\n\t}),\n);\n\nconst MasterRecordListApiSchema = listDetailApiSchema(\n\t\"MasterRecordDetail\",\n\tMasterRecordDetailApiValidationSchema,\n);\n\n/**\n * Search master record response schema (transforms to camelCase)\n */\nexport const SearchMasterRecordResponseSchema = createListResponseSchema(\n\t\"MasterRecordList\",\n\tMasterRecordListApiSchema,\n);\n","import * as v from \"valibot\";\nimport { createFlattenedResponseSchema } from \"../utils/schema-transform.js\";\nimport { RqHeaderSchema, RsStatusSchema } from \"./common.js\";\nimport { MasterRecordDetailApiValidationSchema } from \"./master-record.js\";\n\n/**\n * Complete upsert request schema with header and required InsertCriteria\n */\nexport const ManageMasterRecordRequestSchema = v.object({\n\tRqHeader: RqHeaderSchema,\n\tMasterRecordDetail: MasterRecordDetailApiValidationSchema,\n});\n\n/**\n * Upsert response: camelCase, then spread `MasterRecordDetail` onto the root.\n * Callers use `data.recordCode` instead of `data.masterRecordDetail.recordCode`.\n */\nexport const ManageMasterRecordResponseSchema = createFlattenedResponseSchema(\n\tv.object({\n\t\tRsStatus: RsStatusSchema,\n\t\tMasterRecordDetail: v.optional(MasterRecordDetailApiValidationSchema),\n\t}),\n\t\"masterRecordDetail\",\n);\n","import type { AvesError } from \"../error.js\";\nimport { MasterRecordDetailApiSchema } from \"../schemas/master-record.js\";\nimport {\n\tSearchMasterRecordApiSchema,\n\tSearchMasterRecordResponseSchema,\n} from \"../schemas/search.js\";\nimport { ManageMasterRecordResponseSchema } from \"../schemas/upsert.js\";\nimport type {\n\tManageMasterRecordRS,\n\tMasterRecordDetail,\n\tSearchMasterRecord,\n\tSearchMasterRecordRS,\n} from \"../types.js\";\nimport type { Result } from \"../utils/result.js\";\nimport { XML_ROOT_ELEMENTS } from \"../xml/root.js\";\nimport { AVES_ENDPOINTS } from \"./endpoints.js\";\nimport type { AvesTransport } from \"./transport.js\";\n\nexport class MasterRecordsClient {\n\tconstructor(private readonly transport: AvesTransport) {}\n\n\t/** Search master records (camelCase in/out). Fields spread at RQ root. */\n\tsearch(\n\t\tparams: SearchMasterRecord,\n\t): Promise<Result<SearchMasterRecordRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"search\",\n\t\t\tparams,\n\t\t\tapiSchema: SearchMasterRecordApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.search,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.SEARCH_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SEARCH_RESPONSE,\n\t\t\tresponseSchema: SearchMasterRecordResponseSchema,\n\t\t});\n\t}\n\n\t/** Insert or update a master record. */\n\tupsertRecord(\n\t\trecord: MasterRecordDetail,\n\t): Promise<Result<ManageMasterRecordRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"upsertRecord\",\n\t\t\tparams: record,\n\t\t\tapiSchema: MasterRecordDetailApiSchema,\n\t\t\tbodyKey: \"MasterRecordDetail\",\n\t\t\tendpoint: AVES_ENDPOINTS.upsert,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.UPSERT_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.UPSERT_RESPONSE,\n\t\t\tresponseSchema: ManageMasterRecordResponseSchema,\n\t\t});\n\t}\n}\n","import * as v from \"valibot\";\nimport {\n\tcreateApiSchema,\n\tcreateFlattenedResponseSchema,\n\tcreateListResponseSchema,\n\tlistDetailApiSchema,\n\ttoWireBody,\n} from \"../utils/schema-transform.js\";\nimport {\n\tavesSearchWire,\n\tbaseSearchWire,\n\telementOnlyWire,\n\tpackageDetailRequestWire,\n} from \"../utils/wire-shapes.js\";\nimport {\n\tDestinationInputSchema,\n\tPassengerDetailCreateInputSchema,\n\tStatisticCodesInputSchema,\n} from \"./booking-file.js\";\nimport { BoolishSchema } from \"./booking-shared.js\";\nimport {\n\tOptionalLanguageCodeSchema,\n\tRsStatusSchema,\n\tStatusOnlyResponseSchema,\n\tStringishBoolSchema,\n\tStringishSchema,\n} from \"./common.js\";\nimport {\n\tAvesSearchTypeSchema,\n\tPaxQtyCriteria,\n\tPaxQtyCriteriaSchema,\n} from \"./enums.js\";\n\nexport { PaxQtyCriteria, PaxQtyCriteriaSchema } from \"./enums.js\";\n\n// ---------------------------------------------------------------------------\n// Shared catalog fragments (response)\n// ---------------------------------------------------------------------------\n\nexport const FeatureDetailApiSchema = v.object({\n\t\"@Code\": v.optional(v.string()),\n\t\"@Name\": v.optional(v.string()),\n\tValueCode: v.optional(v.string()),\n\tValueName: v.optional(v.string()),\n});\n\nexport const FeatureListApiSchema = listDetailApiSchema(\n\t\"FeatureDetail\",\n\tFeatureDetailApiSchema,\n);\n\nexport const RefPackageInfoApiSchema = v.object({\n\t\"@PackageCode\": v.optional(v.string()),\n\t\"@PackageReference\": v.optional(v.string()),\n\t\"@PackageServiceType\": v.optional(v.string()),\n\t\"@ServiceCodeForPackageDetail\": v.optional(v.string()),\n});\n\n/** Lean catalog SubService — enough for Program search/detail workflows */\nexport const CatalogSubServiceDetailApiSchema = v.object({\n\t\"@ssCode\": v.optional(v.string()),\n\tFirstDescription: v.optional(v.string()),\n\tSubServiceType: v.optional(v.string()),\n\tSubServiceLevel: v.optional(StringishBoolSchema),\n\tStartDate: v.optional(v.string()),\n\tEndDate: v.optional(v.string()),\n});\n\nexport const CatalogSubServiceListApiSchema = listDetailApiSchema(\n\t\"SubServiceDetail\",\n\tCatalogSubServiceDetailApiSchema,\n);\n\n/** Lean catalog Service inside a Package */\nexport const CatalogServiceDetailApiSchema = v.object({\n\t\"@sCode\": v.optional(v.string()),\n\tFirstDescription: v.optional(v.string()),\n\tSecondDescription: v.optional(v.string()),\n\tAvesServiceType: v.optional(v.string()),\n\tTOServiceType: v.optional(v.string()),\n\tStartDate: v.optional(v.string()),\n\tEndDate: v.optional(v.string()),\n\tRefPackageInfo: v.optional(RefPackageInfoApiSchema),\n\tSubServiceList: v.optional(CatalogSubServiceListApiSchema),\n});\n\nexport const CatalogServiceListApiSchema = listDetailApiSchema(\n\t\"ServiceDetail\",\n\tCatalogServiceDetailApiSchema,\n);\n\n/** Package / Program detail (SearchPackageRS + GetPackageDetail) */\nexport const PackageDetailApiSchema = v.object({\n\t\"@pCode\": v.optional(v.string()),\n\tFirstDescription: v.optional(v.string()),\n\tSecondDescription: v.optional(v.string()),\n\tFrequencyType: v.optional(v.string()),\n\tProgramType: v.optional(v.string()),\n\tStartValidation: v.optional(v.string()),\n\tEndValidation: v.optional(v.string()),\n\tStartDate: v.optional(v.string()),\n\tEndDate: v.optional(v.string()),\n\tBasePrice: v.optional(StringishBoolSchema),\n\tBasePax: v.optional(StringishBoolSchema),\n\tCanCommitPack: v.optional(StringishBoolSchema),\n\tFeatureList: v.optional(FeatureListApiSchema),\n\tServiceList: v.optional(CatalogServiceListApiSchema),\n});\n\nexport const PackageListApiSchema = listDetailApiSchema(\n\t\"PackageDetail\",\n\tPackageDetailApiSchema,\n);\n\n// ---------------------------------------------------------------------------\n// SearchAvesPackages / SearchTopServices — AvesSearchRQ\n// ---------------------------------------------------------------------------\n\nconst FeatureDetailInputSchema = v.object({\n\tcode: v.string(),\n\tname: v.optional(v.string()),\n});\n\nconst PackageParamsInputSchema = v.object({\n\tgetAllDeptDate: v.optional(BoolishSchema),\n\tgetFlightPlan: v.optional(BoolishSchema),\n\tgetAllAccomodation: v.optional(BoolishSchema),\n\tgetRealAvailability: v.optional(BoolishSchema),\n\tminStay: v.optional(StringishSchema),\n\tmaxStay: v.optional(StringishSchema),\n});\n\nconst TopServiceParamsInputSchema = v.object({\n\tcompatibleAccomodation: v.optional(BoolishSchema),\n\talternativeAccomodation: v.optional(BoolishSchema),\n});\n\n/**\n * Flat AvesSearchRQ body (camelCase) — shared by SearchAvesPackages / SearchTopServices.\n * BaseSearch fields live at the root; wire transform nests them under `BaseSearch`.\n * `searchPackages` / `searchTopServices` default `avesSearchType`; `paxQty` defaults to\n * `passengerList.length`; `paxQtyCriteria` defaults to `GREATER_OR_EQUAL`.\n * `languageCode` may come from `AvesClient` options when omitted.\n */\nexport const AvesSearchSchema = v.object({\n\tcustomerRecordCode: v.string(),\n\tlanguageCode: OptionalLanguageCodeSchema,\n\tcurrencyCode: v.optional(v.string()),\n\tstartDate: v.string(),\n\tendDate: v.string(),\n\tearlyBookingDate: v.optional(v.string()),\n\tpassengerList: v.pipe(\n\t\tv.array(PassengerDetailCreateInputSchema),\n\t\tv.minLength(1),\n\t),\n\tavesSearchType: v.optional(AvesSearchTypeSchema),\n\tpaxQty: v.optional(StringishSchema),\n\tpaxQtyCriteria: v.optional(PaxQtyCriteriaSchema),\n\tdiscartNotAvailables: v.optional(BoolishSchema),\n\tdiscartNotAvailablesMinSales: v.optional(BoolishSchema),\n\tdiscartNotAvailablesDaysInOut: v.optional(BoolishSchema),\n\tdiscardPriceZero: v.optional(BoolishSchema),\n\tdiscardZeroPriceDays: v.optional(BoolishSchema),\n\tdestination: v.optional(DestinationInputSchema),\n\tobjectTypeCode: v.optional(v.string()),\n\tfeatureList: v.optional(v.array(FeatureDetailInputSchema)),\n\tservOrPackCode: v.optional(v.string()),\n\tservOrPackDesc: v.optional(v.string()),\n\tpriceListCode: v.optional(v.string()),\n\tcostListCode: v.optional(v.string()),\n\tsuballotmentCode: v.optional(v.string()),\n\tmarkupCode: v.optional(v.string()),\n\tstatisticCodes: v.optional(StatisticCodesInputSchema),\n\tmergeBoardAndAccomodation: v.optional(BoolishSchema),\n\tpackageParams: v.optional(PackageParamsInputSchema),\n\ttopServiceParams: v.optional(TopServiceParamsInputSchema),\n\tgetDocumentation: v.optional(BoolishSchema),\n});\n\n/** After client defaults: languageCode + avesSearchType must be present. */\nconst AvesSearchResolvedSchema = v.required(AvesSearchSchema, [\n\t\"languageCode\",\n\t\"avesSearchType\",\n]);\n\n/** Nest BaseSearch under AvesSearchRQ; apply paxQty / paxQtyCriteria defaults. */\nfunction toAvesSearchApiBody(\n\tinput: v.InferOutput<typeof AvesSearchResolvedSchema>,\n) {\n\tconst {\n\t\tcustomerRecordCode,\n\t\tlanguageCode,\n\t\tcurrencyCode,\n\t\tstartDate,\n\t\tendDate,\n\t\tearlyBookingDate,\n\t\tpassengerList,\n\t\tpaxQty,\n\t\tpaxQtyCriteria,\n\t\tavesSearchType,\n\t\t...rest\n\t} = input;\n\n\treturn {\n\t\tBaseSearch: toWireBody(\n\t\t\t{\n\t\t\t\tcustomerRecordCode,\n\t\t\t\tlanguageCode,\n\t\t\t\tcurrencyCode,\n\t\t\t\tstartDate,\n\t\t\t\tendDate,\n\t\t\t\tearlyBookingDate,\n\t\t\t\tpassengerList,\n\t\t\t},\n\t\t\tbaseSearchWire,\n\t\t),\n\t\t...toWireBody(\n\t\t\t{\n\t\t\t\t...rest,\n\t\t\t\tavesSearchType,\n\t\t\t\tpaxQty: paxQty ?? passengerList.length,\n\t\t\t\tpaxQtyCriteria: paxQtyCriteria ?? PaxQtyCriteria.GREATER_OR_EQUAL,\n\t\t\t},\n\t\t\tavesSearchWire,\n\t\t),\n\t};\n}\n\nexport const AvesSearchApiSchema = v.pipe(\n\tAvesSearchResolvedSchema,\n\tv.transform(toAvesSearchApiBody),\n);\n\nexport const SearchPackageResponseSchema = createListResponseSchema(\n\t\"PackageList\",\n\tPackageListApiSchema,\n);\n\nexport const SearchServicesResponseSchema = createListResponseSchema(\n\t\"ServiceList\",\n\tCatalogServiceListApiSchema,\n);\n\n// ---------------------------------------------------------------------------\n// GetPackageDetail — PackageDetailRQ\n// ---------------------------------------------------------------------------\n\n/** SelectedServiceDetail for GetPackageDetail (ServiceCode + PackageRow attrs). */\nexport const PackagePrgServiceDetailInputSchema = v.object({\n\tserviceCode: v.string(),\n\tpackageRow: v.string(),\n});\n\n/**\n * PackageDetailRQ body (camelCase).\n * Root startDate/endDate are XML elements (not listed on packageDetailRequestWire.attrs).\n */\nexport const PackageDetailRequestSchema = v.object({\n\tcustomerRecordCode: v.string(),\n\tlanguageCode: OptionalLanguageCodeSchema,\n\tcurrencyCode: v.optional(v.string()),\n\tpackageCode: v.string(),\n\tstartDate: v.string(),\n\tendDate: v.string(),\n\tpriceListCode: v.optional(v.string()),\n\tcostListCode: v.optional(v.string()),\n\tmarkupCode: v.optional(v.string()),\n\tstatisticCodes: v.optional(StatisticCodesInputSchema),\n\tselectedServiceList: v.pipe(\n\t\tv.array(PackagePrgServiceDetailInputSchema),\n\t\tv.minLength(1),\n\t),\n\tpassengerList: v.optional(v.array(PassengerDetailCreateInputSchema)),\n});\n\n/** Map packagePrg fields → attrs; list wrap + element dates at root. */\nexport const PackageDetailRequestApiSchema = createApiSchema(\n\tPackageDetailRequestSchema,\n\tpackageDetailRequestWire,\n);\n\nexport const PackageDetailResponseSchema = createFlattenedResponseSchema(\n\tv.object({\n\t\tRsStatus: RsStatusSchema,\n\t\tPackageDetail: v.optional(PackageDetailApiSchema),\n\t}),\n\t\"packageDetail\",\n);\n\n// ---------------------------------------------------------------------------\n// CommitPackage — CommitPackRQ\n// ---------------------------------------------------------------------------\n\nexport const CommitPackageSchema = v.object({\n\tpackageCode: v.string(),\n});\n\nexport const CommitPackageApiSchema = createApiSchema(\n\tCommitPackageSchema,\n\telementOnlyWire,\n);\n\nexport const CommitPackageResponseSchema = StatusOnlyResponseSchema;\n","import type { AvesError } from \"../error.js\";\nimport { AvesSearchType } from \"../schemas/enums.js\";\nimport {\n\tAvesSearchApiSchema,\n\tCommitPackageApiSchema,\n\tCommitPackageResponseSchema,\n\tPackageDetailRequestApiSchema,\n\tPackageDetailResponseSchema,\n\tSearchPackageResponseSchema,\n\tSearchServicesResponseSchema,\n} from \"../schemas/package-catalog.js\";\nimport type {\n\tAvesSearchRQ,\n\tCommitPackageRQ,\n\tCommitPackageRS,\n\tPackageDetailRQ,\n\tPackageDetailRS,\n\tSearchPackageRS,\n\tSearchServicesRS,\n} from \"../types.js\";\nimport type { Result } from \"../utils/result.js\";\nimport { XML_ROOT_ELEMENTS } from \"../xml/root.js\";\nimport { AVES_ENDPOINTS } from \"./endpoints.js\";\nimport type { AvesTransport } from \"./transport.js\";\n\nexport class PackageCatalogClient {\n\tconstructor(private readonly transport: AvesTransport) {}\n\n\t/** Merge client languageCode + method default avesSearchType (params win). */\n\t#prepareSearch(\n\t\tparams: AvesSearchRQ,\n\t\tdefaultType: (typeof AvesSearchType)[keyof typeof AvesSearchType],\n\t): AvesSearchRQ {\n\t\treturn {\n\t\t\t...(this.transport.languageCode && {\n\t\t\t\tlanguageCode: this.transport.languageCode,\n\t\t\t}),\n\t\t\tavesSearchType: defaultType,\n\t\t\t...params,\n\t\t};\n\t}\n\n\t/** Search packages / programs. Defaults `avesSearchType` to `PACKAGE`. */\n\tsearchPackages(\n\t\tparams: AvesSearchRQ,\n\t): Promise<Result<SearchPackageRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"searchPackages\",\n\t\t\tparams: this.#prepareSearch(params, AvesSearchType.PACKAGE),\n\t\t\tapiSchema: AvesSearchApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.searchAvesPackages,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.AVES_SEARCH_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SEARCH_PACKAGE_RESPONSE,\n\t\t\tresponseSchema: SearchPackageResponseSchema,\n\t\t});\n\t}\n\n\t/** Search TOP services. Defaults `avesSearchType` to `SERVICE`. */\n\tsearchTopServices(\n\t\tparams: AvesSearchRQ,\n\t): Promise<Result<SearchServicesRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"searchTopServices\",\n\t\t\tparams: this.#prepareSearch(params, AvesSearchType.SERVICE),\n\t\t\tapiSchema: AvesSearchApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.searchTopServices,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.AVES_SEARCH_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.SEARCH_SERVICES_RESPONSE,\n\t\t\tresponseSchema: SearchServicesResponseSchema,\n\t\t});\n\t}\n\n\t/** Package / program detail + service list. */\n\tgetPackageDetail(\n\t\tparams: PackageDetailRQ,\n\t): Promise<Result<PackageDetailRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"getPackageDetail\",\n\t\t\tparams,\n\t\t\tapiSchema: PackageDetailRequestApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.getPackageDetail,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.PACKAGE_DETAIL_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.PACKAGE_DETAIL_RESPONSE,\n\t\t\tresponseSchema: PackageDetailResponseSchema,\n\t\t});\n\t}\n\n\t/** Publish an existing package. Does not create packages. */\n\tcommitPackage(\n\t\tparams: CommitPackageRQ,\n\t): Promise<Result<CommitPackageRS, AvesError>> {\n\t\treturn this.transport.invokeOp({\n\t\t\top: \"commitPackage\",\n\t\t\tparams,\n\t\t\tapiSchema: CommitPackageApiSchema,\n\t\t\tendpoint: AVES_ENDPOINTS.commitPackage,\n\t\t\trequestRoot: XML_ROOT_ELEMENTS.COMMIT_PACKAGE_REQUEST,\n\t\t\tresponseRoot: XML_ROOT_ELEMENTS.COMMIT_PACKAGE_RESPONSE,\n\t\t\tresponseSchema: CommitPackageResponseSchema,\n\t\t});\n\t}\n}\n","import type { BaseIssue } from \"valibot\";\nimport type { RsStatusValue } from \"./schemas/enums.js\";\n\nexport const ERROR_KINDS = {\n\tVALIDATION: \"validation\",\n\tAPI: \"api\",\n\tUNKNOWN: \"unknown\",\n} as const;\n\nexport type ErrorKind = (typeof ERROR_KINDS)[keyof typeof ERROR_KINDS];\n\n/**\n * Error thrown by AVES API operations\n */\nexport class AvesError extends Error {\n\tconstructor(\n\t\treadonly kind: ErrorKind,\n\t\tmessage: string,\n\t\treadonly status?: RsStatusValue,\n\t\treadonly code?: number,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"AvesError\";\n\t}\n}\n\nexport function validationError(message: string): AvesError {\n\treturn new AvesError(ERROR_KINDS.VALIDATION, message);\n}\n\nexport function apiError(\n\tmessage: string,\n\tstatus?: RsStatusValue,\n\tcode?: number,\n): AvesError {\n\treturn new AvesError(ERROR_KINDS.API, message, status, code);\n}\n\nexport function unknownError(message: string): AvesError {\n\treturn new AvesError(ERROR_KINDS.UNKNOWN, message);\n}\n\nexport function buildDetails(issues: readonly BaseIssue<unknown>[]): string {\n\treturn issues.map(formatIssue).join(\"; \");\n}\n\nfunction formatIssue(issue: BaseIssue<unknown>): string {\n\tconst path = formatPath(issue.path);\n\tconst message = issue.message ?? \"Invalid value\";\n\n\treturn path ? `${path}: ${message}` : message;\n}\n\nfunction formatPath(path?: readonly unknown[]): string | undefined {\n\tif (!path || path.length === 0) return;\n\n\tconst segments = path\n\t\t.map(extractSegment)\n\t\t.filter((segment): segment is string => segment !== undefined);\n\n\treturn segments.length > 0 ? segments.join(\".\") : undefined;\n}\n\nfunction extractSegment(segment: unknown): string | undefined {\n\tif (typeof segment === \"string\" || typeof segment === \"number\") {\n\t\treturn String(segment);\n\t}\n\n\tif (typeof segment === \"object\" && segment !== null && \"key\" in segment) {\n\t\treturn String(segment.key);\n\t}\n\n\treturn;\n}\n\nexport function isAbortError(error: unknown): boolean {\n\treturn error instanceof Error && error.name === \"AbortError\";\n}\n","/**\n * Result type for functional error handling\n */\nexport type Result<T, E = Error> =\n\t| { success: true; data: T }\n\t| { success: false; error: E };\n\n/**\n * Creates a successful result\n */\nexport function ok<T>(data: T): Result<T, never> {\n\treturn { success: true, data };\n}\n\n/**\n * Creates an error result\n */\nexport function err<E>(error: E): Result<never, E> {\n\treturn { success: false, error };\n}\n","export interface TimeoutController {\n\tsignal: AbortSignal;\n\tclear?: () => void;\n}\n\n/**\n * Create an AbortSignal that will automatically abort after `timeoutMs`.\n * If `timeoutMs` is not provided or <= 0, no automatic abort is scheduled.\n */\nexport function createTimeoutSignal(timeoutMs?: number): TimeoutController {\n\tconst controller = new AbortController();\n\n\tif (!timeoutMs || timeoutMs <= 0) {\n\t\treturn { signal: controller.signal };\n\t}\n\n\tconst timeoutId = setTimeout(() => controller.abort(), timeoutMs);\n\n\treturn {\n\t\tsignal: controller.signal,\n\t\tclear: () => clearTimeout(timeoutId),\n\t};\n}\n","import { validationError } from \"../error.js\";\n\nfunction buildUrl(baseURL: string, endpoint: string): URL {\n\ttry {\n\t\tconst base = new URL(baseURL);\n\t\tconst basePath = base.pathname.endsWith(\"/\")\n\t\t\t? base.pathname.slice(0, -1)\n\t\t\t: base.pathname;\n\t\tconst combinedPath = basePath + endpoint;\n\n\t\treturn new URL(combinedPath, base);\n\t} catch (error) {\n\t\tthrow validationError(\n\t\t\t`Invalid baseURL: ${error instanceof Error ? error.message : \"Invalid URL format\"}`,\n\t\t);\n\t}\n}\n\n/**\n * Validates and combines baseURL with endpoint\n * @param baseURL - Base URL (must be http:// or https://)\n * @param endpoint - Endpoint path (must start with /)\n * @returns Combined URL string\n * @throws AvesError if URL is invalid or protocol is not http/https\n */\nexport function parseUrl(baseURL: string, endpoint: string): string {\n\tif (!endpoint.startsWith(\"/\")) {\n\t\tthrow validationError(\n\t\t\t`Invalid endpoint: endpoint must start with '/' but got '${endpoint}'`,\n\t\t);\n\t}\n\n\tconst normalizedBaseURL = baseURL.replace(/\\/$/, \"\");\n\n\tconst url = buildUrl(normalizedBaseURL, endpoint);\n\n\tif (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n\t\tthrow validationError(\n\t\t\t`Invalid protocol: baseURL must use http:// or https:// but got '${url.protocol}'`,\n\t\t);\n\t}\n\n\treturn url.toString();\n}\n","import XMLBuilder from \"fast-xml-builder\";\nimport { XMLParser } from \"fast-xml-parser\";\nimport { validationError } from \"../error.js\";\n\nconst parserOptions = {\n\tignoreAttributes: false,\n\tattributeNamePrefix: \"@\",\n\tparseAttributeValue: false,\n\ttrimValues: true,\n\tignoreNameSpace: true,\n\tremoveNSPrefix: true,\n\tparseTagValue: false,\n};\n\nconst builderOptions = {\n\tignoreAttributes: false,\n\tattributeNamePrefix: \"@\",\n\tsuppressEmptyNode: true,\n};\n\nconst parser = new XMLParser(parserOptions);\nconst builder = new XMLBuilder(builderOptions);\n\n/**\n * Converts JSON to XML string\n */\nexport function jsonToXml(json: Record<string, unknown>): string {\n\ttry {\n\t\treturn builder.build(json);\n\t} catch (error) {\n\t\tthrow validationError(\n\t\t\t`Failed to convert JSON to XML: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t);\n\t}\n}\n\n/**\n * Converts XML string to JSON object\n * Attributes are parsed with @ prefix\n */\nexport function xmlToJson(xml: string): Record<string, unknown> {\n\ttry {\n\t\treturn parser.parse(xml);\n\t} catch (error) {\n\t\tthrow validationError(\n\t\t\t`Failed to convert XML to JSON: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n\t\t);\n\t}\n}\n","import { request as r } from \"undici\";\nimport {\n\ttype BaseIssue,\n\ttype BaseSchema,\n\tparse,\n\tsafeParse,\n\tValiError,\n} from \"valibot\";\nimport {\n\tAvesError,\n\tapiError,\n\tbuildDetails,\n\tisAbortError,\n\tunknownError,\n\tvalidationError,\n} from \"../error.js\";\nimport type { AvesClientOptions, RsStatus } from \"../types.js\";\nimport { err, ok, type Result } from \"../utils/result.js\";\nimport { createTimeoutSignal } from \"../utils/timeout.js\";\nimport { parseUrl } from \"../utils/url.js\";\nimport { jsonToXml, xmlToJson } from \"../xml/client.js\";\nimport { createRootElement, type XMLRootElementValues } from \"../xml/root.js\";\n\nconst MAX_ERROR_BODY = 4_096;\n\n/**\n * Shared HTTP + XML transport for AVES domain clients.\n */\nexport class AvesTransport {\n\tconstructor(private readonly options: AvesClientOptions) {}\n\n\tget languageCode() {\n\t\treturn this.options.languageCode;\n\t}\n\n\tcreateRqHeader() {\n\t\treturn {\n\t\t\t\"@HostID\": this.options.hostID,\n\t\t\t\"@Xtoken\": this.options.xtoken,\n\t\t\t\"@Interface\": \"WEB\" as const,\n\t\t\t\"@UserName\": \"WEB\" as const,\n\t\t\t...(this.options.languageCode && {\n\t\t\t\t\"@LanguageCode\": this.options.languageCode,\n\t\t\t}),\n\t\t};\n\t}\n\n\ttoAvesError(error: unknown, defaultMessage: string): AvesError {\n\t\tif (error instanceof AvesError) return error;\n\t\tif (error instanceof ValiError)\n\t\t\treturn validationError(`Validation error: ${buildDetails(error.issues)}`);\n\t\tif (error instanceof Error) return unknownError(error.message);\n\t\treturn unknownError(defaultMessage);\n\t}\n\n\tprivate handleApiStatus<T extends { rsStatus: RsStatus }>(\n\t\toutput: T,\n\t): Result<T, AvesError> {\n\t\tconst { rsStatus } = output;\n\t\tif (rsStatus.status !== \"OK\")\n\t\t\treturn err(\n\t\t\t\tapiError(\n\t\t\t\t\trsStatus.errorDescription ?? \"\",\n\t\t\t\t\trsStatus.status,\n\t\t\t\t\trsStatus.errorCode,\n\t\t\t\t),\n\t\t\t);\n\t\treturn ok(output);\n\t}\n\n\tprivate async request<T extends { rsStatus: RsStatus }>(\n\t\tendpoint: string,\n\t\trequestBody: Record<string, unknown>,\n\t\tresponseRootKey: string,\n\t\tresponseSchema: BaseSchema<unknown, T, BaseIssue<unknown>>,\n\t): Promise<Result<T, AvesError>> {\n\t\tconst { signal, clear } = createTimeoutSignal(\n\t\t\tthis.options.timeoutMs ?? 30_000,\n\t\t);\n\n\t\ttry {\n\t\t\tconst response = await r(parseUrl(this.options.baseURL, endpoint), {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/xml\" },\n\t\t\t\tbody: jsonToXml(requestBody),\n\t\t\t\tsignal,\n\t\t\t});\n\n\t\t\tconst responseText = await response.body.text();\n\t\t\tif (response.statusCode < 200 || response.statusCode > 299)\n\t\t\t\treturn err(\n\t\t\t\t\tapiError(\n\t\t\t\t\t\tresponseText.slice(0, MAX_ERROR_BODY),\n\t\t\t\t\t\t\"ERROR\",\n\t\t\t\t\t\tresponse.statusCode,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\tconst rootElement = xmlToJson(responseText)[responseRootKey];\n\t\t\tif (!rootElement)\n\t\t\t\treturn err(\n\t\t\t\t\tvalidationError(\n\t\t\t\t\t\t`Invalid response structure: missing root element '${responseRootKey}'`,\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\tconst parseResult = safeParse(responseSchema, rootElement);\n\t\t\tif (!parseResult.success)\n\t\t\t\treturn err(\n\t\t\t\t\tvalidationError(\n\t\t\t\t\t\t`Invalid response format: ${buildDetails(parseResult.issues)}`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\treturn this.handleApiStatus(parseResult.output);\n\t\t} catch (error) {\n\t\t\tif (isAbortError(error))\n\t\t\t\treturn err(apiError(\"Request timed out\", \"TIMEOUT\"));\n\t\t\treturn err(this.toAvesError(error, \"Unknown error occurred\"));\n\t\t} finally {\n\t\t\tclear?.();\n\t\t}\n\t}\n\n\t/** Validate → wrap RqHeader → POST → parse response. */\n\tasync invokeOp<\n\t\tTIn,\n\t\tTApiBody extends Record<string, unknown>,\n\t\tTOut extends { rsStatus: RsStatus },\n\t>(opts: {\n\t\top: string;\n\t\tparams: TIn;\n\t\tapiSchema: BaseSchema<TIn, TApiBody, BaseIssue<unknown>>;\n\t\tendpoint: string;\n\t\trequestRoot: XMLRootElementValues;\n\t\tresponseRoot: string;\n\t\tresponseSchema: BaseSchema<unknown, TOut, BaseIssue<unknown>>;\n\t\t/** Nest parsed body under this key instead of spreading at RQ root. */\n\t\tbodyKey?: string;\n\t}): Promise<Result<TOut, AvesError>> {\n\t\ttry {\n\t\t\tconst apiBody = parse(opts.apiSchema, opts.params);\n\t\t\tconst payload = opts.bodyKey ? { [opts.bodyKey]: apiBody } : apiBody;\n\t\t\treturn this.request(\n\t\t\t\topts.endpoint,\n\t\t\t\tcreateRootElement(opts.requestRoot, {\n\t\t\t\t\tRqHeader: this.createRqHeader(),\n\t\t\t\t\t...payload,\n\t\t\t\t}),\n\t\t\t\topts.responseRoot,\n\t\t\t\topts.responseSchema,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\treturn err(\n\t\t\t\tthis.toAvesError(error, `Validation error occurred during ${opts.op}`),\n\t\t\t);\n\t\t}\n\t}\n}\n","import { BookingClient } from \"./client/booking.js\";\nimport { MasterRecordsClient } from \"./client/master-records.js\";\nimport { PackageCatalogClient } from \"./client/packages.js\";\nimport { AvesTransport } from \"./client/transport.js\";\nimport type { AvesClientDeps } from \"./client/types.js\";\nimport type { AvesClientOptions } from \"./types.js\";\n\nexport type { AvesClientDeps } from \"./client/types.js\";\n\n/** AVES XML REST API client — facade over domain clients (DI-friendly). */\nexport class AvesClient {\n\treadonly transport: AvesTransport;\n\treadonly master: MasterRecordsClient;\n\treadonly booking: BookingClient;\n\treadonly packages: PackageCatalogClient;\n\n\tconstructor(options: AvesClientOptions, deps: AvesClientDeps = {}) {\n\t\tthis.transport = deps.transport ?? new AvesTransport(options);\n\t\tthis.master = deps.master ?? new MasterRecordsClient(this.transport);\n\t\tthis.booking = deps.booking ?? new BookingClient(this.transport);\n\t\tthis.packages = deps.packages ?? new PackageCatalogClient(this.transport);\n\t}\n}\n"],"mappings":"qMAUA,SAAgB,EACf,EACC,CACD,OAAO,EAAE,SAAS,OAAO,OAAO,CAAU,CAAmB,CAC9D,CCRA,MAAa,EAAS,CACrB,EAAG,IACH,EAAG,GACJ,EAEa,EAAe,EAAW,CAAM,EAEhC,EAAgB,CAC5B,GAAI,KACJ,MAAO,QACP,QAAS,UACT,QAAS,SACV,EAEa,GAAsB,EAAW,CAAa,EAM9C,EAAmB,CAC/B,KAAM,OACN,KAAM,OACN,QAAS,UACT,KAAM,OACN,SAAU,WACV,MAAO,QACP,YAAa,cACb,aAAc,eACd,kBAAmB,mBACpB,EAEa,GAAyB,EAAW,CAAgB,EAGpD,GAAa,CACzB,SAAU,WACV,SAAU,WACV,QAAS,UACT,iBAAkB,mBAClB,QAAS,SACV,EAEa,GAAmB,EAAW,EAAU,EAExC,EAAe,CAC3B,QAAS,UACT,SAAU,WACV,QAAS,UACT,YAAa,aACd,EAEa,GAAqB,EAAW,CAAY,EAG5C,GAAiB,CAC7B,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,GACJ,EAEa,GAAuB,EAAW,EAAc,EAEhD,GAAoB,CAChC,KAAM,OACN,KAAM,OACN,IAAK,MACL,KAAM,OACN,cAAe,eAChB,EAEa,GAA0B,EAAW,EAAiB,EAEtD,GAAc,CAC1B,QAAS,UACT,OAAQ,SACR,KAAM,OACN,MAAO,QACP,QAAS,UACT,IAAK,MACL,SAAU,WACV,SAAU,WACV,QAAS,UACT,kBAAmB,oBACnB,QAAS,UACT,YAAa,cACb,YAAa,cACb,cAAe,gBACf,aAAc,eACd,MAAO,OACR,EAEa,GAAoB,EAAW,EAAW,E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