@matchi/api 0.20250130.2 → 0.20250206.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.
@@ -1 +1 @@
1
- var e={properties:{booker:{format:"uuid",type:"string"},created_at:{format:"date-time",type:"string"},created_by:{type:"string"},end_time:{format:"date-time",type:"string"},id:{format:"uuid",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},required:["guests","players"],type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"},updated_at:{format:"date-time",type:"string"},updated_by:{type:"string"}},required:["id","booker","location","start_time","end_time","created_at","updated_at","participants","payment_reference","created_by","updated_by"],type:"object"},t={properties:{booker:{format:"uuid",type:"string"},created_by:{type:"string"},end_time:{format:"date-time",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"}},required:["booker","location","start_time","end_time","participants","payment_reference"],type:"object"},r={properties:{email:{type:"string"}},required:["email"],type:"object"},a={properties:{email:{type:"string"},id:{format:"uuid",type:"string"}},required:["id","email"],type:"object"},i={properties:{booker:{format:"uuid",type:"string"},end_time:{format:"date-time",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"}},required:["booker","location","start_time","end_time","participants","payment_reference"],type:"object"},s={properties:{message:{description:"The error message",type:"string"}},type:"object"},o={description:"An array of error details to accompany a problem details response.",items:{$ref:"#/components/schemas/pkgOpenapiSharedError"},maxItems:1e3,type:"array"},p={description:"Metadata about the offset based pagination for the result. This information is coupled with the OffsetParam and OffsetLimitParam. Intended to be used as the `meta` field in a list response, next to an `items` array field containing the data.\n",properties:{limit:{type:"integer"},moreResults:{type:"boolean"},offset:{type:"integer"}},required:["offset","limit","moreResults"],type:"object"},n={properties:{detail:{description:"A human-readable explanation specific to this occurrence of the problem.",maxLength:4096,type:"string"},errors:{$ref:"#/components/schemas/pkgOpenapiSharedErrors"},instance:{description:"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",maxLength:1024,type:"string"},status:{description:"The HTTP status code generated by the origin server for this occurrence of the problem.",format:"int32",maximum:599,minimum:100,type:"integer"},title:{description:"A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.",maxLength:1024,type:"string"},type:{description:"A URI reference that identifies the problem type.",format:"uri",maxLength:1024,type:"string"}},required:["title"],type:"object"};export{e as BookingSchema,t as CreateBookingSchema,r as GuestSchema,a as PlayerSchema,i as UpdateBookingSchema,s as pkgOpenapiSharedErrorSchema,o as pkgOpenapiSharedErrorsSchema,p as pkgOpenapiSharedOffsetPaginatedResultSetSchema,n as pkgOpenapiSharedProblemDetailsSchema};
1
+ var e={properties:{booker:{format:"uuid",type:"string"},created_at:{format:"date-time",type:"string"},created_by:{type:"string"},end_time:{format:"date-time",type:"string"},id:{format:"uuid",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},required:["guests","players"],type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"},updated_at:{format:"date-time",type:"string"},updated_by:{type:"string"}},required:["id","booker","location","start_time","end_time","created_at","updated_at","participants","payment_reference","created_by","updated_by"],type:"object"},t={properties:{booker:{format:"uuid",type:"string"},created_by:{type:"string"},end_time:{format:"date-time",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"}},required:["booker","location","start_time","end_time","participants","payment_reference"],type:"object"},r={properties:{data:{oneOf:[{$ref:"#/components/schemas/FacilityPunchCardData"},{$ref:"#/components/schemas/FacilityValueCardData"}]},type:{enum:["FACILITY_PUNCH_CARD","FACILITY_VALUE_CARD"],type:"string"}},required:["type","data"],type:"object"},i={oneOf:[{$ref:"#/components/schemas/FacilityOfferConditionWeekdays"},{$ref:"#/components/schemas/FacilityOfferConditionCourts"},{$ref:"#/components/schemas/FacilityOfferConditionDate"},{$ref:"#/components/schemas/FacilityOfferConditionTime"},{$ref:"#/components/schemas/FacilityOfferConditionHoursinadvance"},{$ref:"#/components/schemas/FacilityOfferConditionActivities"},{$ref:"#/components/schemas/FacilityOfferConditionNotImplemented"}],properties:{type:{enum:["WEEKDAYS","COURTS","DATE","TIME","HOURSINADVANCE","ACTIVITIES","NOT_IMPLEMENTED"],type:"string"}},type:"object"},a={properties:{all_activities:{type:"boolean"},not_valid_for_activities:{type:"boolean"},type:{type:"string"}},required:["type","not_valid_for_activities","all_activities"],type:"object"},o={properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},s={properties:{end_date:{format:"date-time",type:"string"},start_date:{format:"date-time",type:"string"},type:{type:"string"}},required:["type","start_date","end_date"],type:"object"},n={properties:{nr_of_hours:{type:"integer"},type:{type:"string"}},required:["type","nr_of_hours"],type:"object"},p={properties:{type:{type:"string"}},required:["type"],type:"object"},c={properties:{end_time:{format:"time",type:"string"},start_time:{format:"time",type:"string"},type:{type:"string"}},required:["type","start_time","end_time"],type:"object"},m={properties:{type:{type:"string"},weekdays:{items:{description:"Interger representation of weekday. 1 (Monday), 7 (Sunday).",type:"integer"},type:"array"}},required:["type","weekdays"],type:"object"},y={properties:{data:{items:{$ref:"#/components/schemas/FacilityOffer"},type:"array"},meta:{$ref:"#/components/schemas/pkgOpenapiSharedCursorPaginatedResultSet"}},required:["data","meta"],type:"object"},d={properties:{checkout_url:{description:"The URL to the checkout page for the facility offer order",example:"https://checkout.matchi.com/pay/1b44a93b24a3413dadsee96e1bc7a4350ecac",format:"uri",type:"string"},id:{type:"string"}},required:["id","checkout_url"],type:"object"},f={properties:{conditions:{items:{$ref:"#/components/schemas/FacilityOfferCondition"},type:"array"},description:{nullable:!0,type:"string"},expire_date:{format:"date-time",type:"string"},facility_id:{type:"integer"},facility_receive_membership_requests:{type:"boolean"},id:{type:"integer"},max_duration:{type:"integer"},members_only:{type:"boolean"},name:{type:"string"},nr_of_bookings_in_period:{type:"integer"},nr_of_days_valid:{type:"integer"},nr_of_tickets:{type:"integer"},price:{type:"string"},unlimited:{type:"boolean"},user_has_active_membership:{type:"boolean"}},required:["id","facility_id","name","description","price","unlimited","max_duration","nr_of_days_valid","nr_of_tickets","members_only","user_has_active_membership","facility_receive_membership_requests","expire_date","conditions","nr_of_bookings_in_period"],type:"object"},l={properties:{amount:{type:"string"},description:{nullable:!0,type:"string"},expire_date:{format:"date-time",type:"string"},facility_id:{type:"integer"},facility_receive_membership_requests:{type:"boolean"},id:{type:"integer"},members_only:{type:"boolean"},name:{type:"string"},nr_of_days_valid:{type:"integer"},price:{type:"string"},user_has_active_membership:{type:"boolean"}},required:["id","facility_id","name","description","price","nr_of_days_valid","amount","members_only","user_has_active_membership","facility_receive_membership_requests","expire_date"],type:"object"},u={properties:{email:{type:"string"}},required:["email"],type:"object"},_={properties:{email:{type:"string"},id:{format:"uuid",type:"string"}},required:["id","email"],type:"object"},h={properties:{booker:{format:"uuid",type:"string"},end_time:{format:"date-time",type:"string"},location:{type:"string"},participants:{properties:{guests:{items:{$ref:"#/components/schemas/Guest"},type:"array"},players:{items:{$ref:"#/components/schemas/Player"},type:"array"}},type:"object"},payment_reference:{type:"string"},start_time:{format:"date-time",type:"string"}},required:["booker","location","start_time","end_time","participants","payment_reference"],type:"object"},g={description:"Metadata about the cursor based pagination for the result. This information is coupled with the CursorParam and CursorLimitParam. Intended to be used as the `meta` field in a list response, next to an `items` array field containing the data.\n",properties:{current_cursor:{description:"Cursor used to retrieve the current page of results.",type:"string"},more_results:{description:"Indicates if there are more results available.",type:"boolean"},next_cursor:{description:"Cursor to retrieve the next page of results.",type:"string"}},required:["current_cursor","more_results"],type:"object"},b={properties:{message:{description:"The error message",type:"string"}},type:"object"},x={description:"An array of error details to accompany a problem details response.",items:{$ref:"#/components/schemas/pkgOpenapiSharedError"},maxItems:1e3,type:"array"},S={description:"Metadata about the offset based pagination for the result. This information is coupled with the OffsetParam and OffsetLimitParam. Intended to be used as the `meta` field in a list response, next to an `items` array field containing the data.\n",properties:{limit:{type:"integer"},more_results:{type:"boolean"},offset:{type:"integer"}},required:["offset","limit","more_results"],type:"object"},C={properties:{detail:{description:"A human-readable explanation specific to this occurrence of the problem.",maxLength:4096,type:"string"},errors:{$ref:"#/components/schemas/pkgOpenapiSharedErrors"},instance:{description:"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",maxLength:1024,type:"string"},status:{description:"The HTTP status code generated by the origin server for this occurrence of the problem.",format:"int32",maximum:599,minimum:100,type:"integer"},title:{description:"A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.",maxLength:1024,type:"string"},type:{description:"A URI reference that identifies the problem type.",format:"uri",maxLength:1024,type:"string"}},required:["title"],type:"object"};export{e as BookingSchema,t as CreateBookingSchema,a as FacilityOfferConditionActivitiesSchema,o as FacilityOfferConditionCourtsSchema,s as FacilityOfferConditionDateSchema,n as FacilityOfferConditionHoursinadvanceSchema,p as FacilityOfferConditionNotImplementedSchema,i as FacilityOfferConditionSchema,c as FacilityOfferConditionTimeSchema,m as FacilityOfferConditionWeekdaysSchema,y as FacilityOfferListSchema,d as FacilityOfferOrderSchema,r as FacilityOfferSchema,f as FacilityPunchCardDataSchema,l as FacilityValueCardDataSchema,u as GuestSchema,_ as PlayerSchema,h as UpdateBookingSchema,g as pkgOpenapiSharedCursorPaginatedResultSetSchema,b as pkgOpenapiSharedErrorSchema,x as pkgOpenapiSharedErrorsSchema,S as pkgOpenapiSharedOffsetPaginatedResultSetSchema,C as pkgOpenapiSharedProblemDetailsSchema};
@@ -1,4 +1,4 @@
1
- import { FindBookingsData, Booking, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedProblemDetails, AddBookingData, DeleteBookingData, FindBookingByIdData, UpdateBookingData } from './types.gen.mjs';
1
+ import { FindBookingsData, Booking, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedProblemDetails, AddBookingData, DeleteBookingData, FindBookingByIdData, UpdateBookingData, ListFacilityOffersData, FacilityOfferList, CreateFacilityOfferOrderData, FacilityOfferOrder } from './types.gen.mjs';
2
2
  import * as _hey_api_client_fetch from '@hey-api/client-fetch';
3
3
  import { Options } from '@hey-api/client-fetch';
4
4
 
@@ -31,5 +31,15 @@ declare const findBookingById: <ThrowOnError extends boolean = false>(options: O
31
31
  * Update a booking with the specified ID using the provided details
32
32
  */
33
33
  declare const updateBooking: <ThrowOnError extends boolean = false>(options: Options<UpdateBookingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Booking, PkgOpenapiSharedProblemDetails, ThrowOnError>;
34
+ /**
35
+ * List all offers for a facility
36
+ * Retrieve a list of all facility offers
37
+ */
38
+ declare const listFacilityOffers: <ThrowOnError extends boolean = false>(options: Options<ListFacilityOffersData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<FacilityOfferList, PkgOpenapiSharedProblemDetails, ThrowOnError>;
39
+ /**
40
+ * Create a facility offer order
41
+ * Will create a facility offer order and return the order object
42
+ */
43
+ declare const createFacilityOfferOrder: <ThrowOnError extends boolean = false>(options: Options<CreateFacilityOfferOrderData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<FacilityOfferOrder, PkgOpenapiSharedProblemDetails, ThrowOnError>;
34
44
 
35
- export { addBooking, client, deleteBooking, findBookingById, findBookings, updateBooking };
45
+ export { addBooking, client, createFacilityOfferOrder, deleteBooking, findBookingById, findBookings, listFacilityOffers, updateBooking };
@@ -1,4 +1,4 @@
1
- import { FindBookingsData, Booking, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedProblemDetails, AddBookingData, DeleteBookingData, FindBookingByIdData, UpdateBookingData } from './types.gen.js';
1
+ import { FindBookingsData, Booking, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedProblemDetails, AddBookingData, DeleteBookingData, FindBookingByIdData, UpdateBookingData, ListFacilityOffersData, FacilityOfferList, CreateFacilityOfferOrderData, FacilityOfferOrder } from './types.gen.js';
2
2
  import * as _hey_api_client_fetch from '@hey-api/client-fetch';
3
3
  import { Options } from '@hey-api/client-fetch';
4
4
 
@@ -31,5 +31,15 @@ declare const findBookingById: <ThrowOnError extends boolean = false>(options: O
31
31
  * Update a booking with the specified ID using the provided details
32
32
  */
33
33
  declare const updateBooking: <ThrowOnError extends boolean = false>(options: Options<UpdateBookingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Booking, PkgOpenapiSharedProblemDetails, ThrowOnError>;
34
+ /**
35
+ * List all offers for a facility
36
+ * Retrieve a list of all facility offers
37
+ */
38
+ declare const listFacilityOffers: <ThrowOnError extends boolean = false>(options: Options<ListFacilityOffersData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<FacilityOfferList, PkgOpenapiSharedProblemDetails, ThrowOnError>;
39
+ /**
40
+ * Create a facility offer order
41
+ * Will create a facility offer order and return the order object
42
+ */
43
+ declare const createFacilityOfferOrder: <ThrowOnError extends boolean = false>(options: Options<CreateFacilityOfferOrderData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<FacilityOfferOrder, PkgOpenapiSharedProblemDetails, ThrowOnError>;
34
44
 
35
- export { addBooking, client, deleteBooking, findBookingById, findBookings, updateBooking };
45
+ export { addBooking, client, createFacilityOfferOrder, deleteBooking, findBookingById, findBookings, listFacilityOffers, updateBooking };
@@ -1 +1 @@
1
- "use strict";var w=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var r in t)w(e,r,{get:t[r],enumerable:!0})},C=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of A(t))!U.call(e,a)&&a!==r&&w(e,a,{get:()=>t[a],enumerable:!(i=v(t,a))||i.enumerable});return e};var q=e=>C(w({},"__esModule",{value:!0}),e);var ee={};$(ee,{addBooking:()=>K,client:()=>f,deleteBooking:()=>X,findBookingById:()=>Y,findBookings:()=>Q,updateBooking:()=>Z});module.exports=q(ee);var I=/\{[^{}]+\}/g,m=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},z=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},_=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},F=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},x=({allowReserved:e,explode:t,name:r,style:i,value:a})=>{if(!t){let n=(e?a:a.map(l=>encodeURIComponent(l))).join(_(i));switch(i){case"label":return`.${n}`;case"matrix":return`;${r}=${n}`;case"simple":return n;default:return`${r}=${n}`}}let s=z(i),o=a.map(n=>i==="label"||i==="simple"?e?n:encodeURIComponent(n):m({allowReserved:e,name:r,value:n})).join(s);return i==="label"||i==="matrix"?s+o:o},j=({allowReserved:e,explode:t,name:r,style:i,value:a})=>{if(a instanceof Date)return`${r}=${a.toISOString()}`;if(i!=="deepObject"&&!t){let n=[];Object.entries(a).forEach(([p,u])=>{n=[...n,p,e?u:encodeURIComponent(u)]});let l=n.join(",");switch(i){case"form":return`${r}=${l}`;case"label":return`.${l}`;case"matrix":return`;${r}=${l}`;default:return l}}let s=F(i),o=Object.entries(a).map(([n,l])=>m({allowReserved:e,name:i==="deepObject"?`${r}[${n}]`:n,value:l})).join(s);return i==="label"||i==="matrix"?s+o:o},W=({path:e,url:t})=>{let r=t,i=t.match(I);if(i)for(let a of i){let s=!1,o=a.substring(1,a.length-1),n="simple";o.endsWith("*")&&(s=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let l=e[o];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,x({explode:s,name:o,style:n,value:l}));continue}if(typeof l=="object"){r=r.replace(a,j({explode:s,name:o,style:n,value:l}));continue}if(n==="matrix"){r=r.replace(a,`;${m({name:o,value:l})}`);continue}let p=encodeURIComponent(n==="label"?`.${l}`:l);r=r.replace(a,p)}return r},T=({allowReserved:e,array:t,object:r}={})=>i=>{let a=[];if(i&&typeof i=="object")for(let s in i){let o=i[s];if(o!=null){if(Array.isArray(o)){a=[...a,x({allowReserved:e,explode:!0,name:s,style:"form",value:o,...t})];continue}if(typeof o=="object"){a=[...a,j({allowReserved:e,explode:!0,name:s,style:"deepObject",value:o,...r})];continue}a=[...a,m({allowReserved:e,name:s,value:o})]}}return a.join("&")},N=e=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},P=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r},H=async({security:e,...t})=>{for(let r of e){let i=await P(r,t.auth);if(!i)continue;let a=r.name??"Authorization";switch(r.in){case"query":t.query||(t.query={}),t.query[a]=i;break;case"header":default:t.headers.set(a,i);break}return}},O=e=>J({baseUrl:e.baseUrl??"",path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:T(e.querySerializer),url:e.url}),J=({baseUrl:e,path:t,query:r,querySerializer:i,url:a})=>{let s=a.startsWith("/")?a:`/${a}`,o=e+s;t&&(o=W({path:t,url:o}));let n=r?i(r):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o},E=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=R(e.headers,t.headers),r},R=(...e)=>{let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let i=r instanceof Headers?r.entries():Object.entries(r);for(let[a,s]of i)if(s===null)t.delete(a);else if(Array.isArray(s))for(let o of s)t.append(a,o);else s!==void 0&&t.set(a,typeof s=="object"?JSON.stringify(s):s)}return t},B=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(e){return this._fns.indexOf(e)!==-1}eject(e){let t=this._fns.indexOf(e);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}},L=()=>({error:new B,request:new B,response:new B});var V={bodySerializer:e=>JSON.stringify(e)};var G=T({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),M={"Content-Type":"application/json"},k=(e={})=>({...V,baseUrl:"",headers:M,parseAs:"auto",querySerializer:G,...e}),S=(e={})=>{let t=E(k(),e),r=()=>({...t}),i=o=>(t=E(t,o),r()),a=L(),s=async o=>{let n={...t,...o,fetch:o.fetch??t.fetch??globalThis.fetch,headers:R(t.headers,o.headers)};n.security&&await H({...n,security:n.security}),n.body&&n.bodySerializer&&(n.body=n.bodySerializer(n.body)),n.body||n.headers.delete("Content-Type");let l=O(n),p={redirect:"follow",...n},u=new Request(l,p);for(let c of a.request._fns)u=await c(u,n);let D=n.fetch,d=await D(u);for(let c of a.response._fns)d=await c(d,u,n);let y={request:u,response:d};if(d.ok){if(d.status===204||d.headers.get("Content-Length")==="0")return{data:{},...y};let c=(n.parseAs==="auto"?N(d.headers.get("Content-Type")):n.parseAs)??"json";if(c==="stream")return{data:d.body,...y};let g=await d[c]();return c==="json"&&(n.responseValidator&&await n.responseValidator(g),n.responseTransformer&&(g=await n.responseTransformer(g))),{data:g,...y}}let b=await d.text();try{b=JSON.parse(b)}catch{}let h=b;for(let c of a.error._fns)h=await c(b,d,u,n);if(h=h||{},n.throwOnError)throw h;return{error:h,...y}};return{buildUrl:O,connect:o=>s({...o,method:"CONNECT"}),delete:o=>s({...o,method:"DELETE"}),get:o=>s({...o,method:"GET"}),getConfig:r,head:o=>s({...o,method:"HEAD"}),interceptors:a,options:o=>s({...o,method:"OPTIONS"}),patch:o=>s({...o,method:"PATCH"}),post:o=>s({...o,method:"POST"}),put:o=>s({...o,method:"PUT"}),request:s,setConfig:i,trace:o=>s({...o,method:"TRACE"})}};var f=S(k()),Q=e=>(e?.client??f).get({...e,url:"/bookings"}),K=e=>(e?.client??f).post({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings"}),X=e=>(e?.client??f).delete({...e,url:"/bookings/{bookingId}"}),Y=e=>(e?.client??f).get({...e,url:"/bookings/{bookingId}"}),Z=e=>(e?.client??f).put({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings/{bookingId}"});0&&(module.exports={addBooking,client,deleteBooking,findBookingById,findBookings,updateBooking});
1
+ "use strict";var m=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var A=(e,t)=>{for(var r in t)m(e,r,{get:t[r],enumerable:!0})},U=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of S(t))!v.call(e,a)&&a!==r&&m(e,a,{get:()=>t[a],enumerable:!(i=F(t,a))||i.enumerable});return e};var $=e=>U(m({},"__esModule",{value:!0}),e);var te={};A(te,{addBooking:()=>K,client:()=>c,createFacilityOfferOrder:()=>re,deleteBooking:()=>X,findBookingById:()=>Y,findBookings:()=>Q,listFacilityOffers:()=>ee,updateBooking:()=>Z});module.exports=$(te);var q=/\{[^{}]+\}/g,O=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},I=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},_=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},x=({allowReserved:e,explode:t,name:r,style:i,value:a})=>{if(!t){let n=(e?a:a.map(l=>encodeURIComponent(l))).join(z(i));switch(i){case"label":return`.${n}`;case"matrix":return`;${r}=${n}`;case"simple":return n;default:return`${r}=${n}`}}let s=I(i),o=a.map(n=>i==="label"||i==="simple"?e?n:encodeURIComponent(n):O({allowReserved:e,name:r,value:n})).join(s);return i==="label"||i==="matrix"?s+o:o},T=({allowReserved:e,explode:t,name:r,style:i,value:a})=>{if(a instanceof Date)return`${r}=${a.toISOString()}`;if(i!=="deepObject"&&!t){let n=[];Object.entries(a).forEach(([p,f])=>{n=[...n,p,e?f:encodeURIComponent(f)]});let l=n.join(",");switch(i){case"form":return`${r}=${l}`;case"label":return`.${l}`;case"matrix":return`;${r}=${l}`;default:return l}}let s=_(i),o=Object.entries(a).map(([n,l])=>O({allowReserved:e,name:i==="deepObject"?`${r}[${n}]`:n,value:l})).join(s);return i==="label"||i==="matrix"?s+o:o},W=({path:e,url:t})=>{let r=t,i=t.match(q);if(i)for(let a of i){let s=!1,o=a.substring(1,a.length-1),n="simple";o.endsWith("*")&&(s=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),n="label"):o.startsWith(";")&&(o=o.substring(1),n="matrix");let l=e[o];if(l==null)continue;if(Array.isArray(l)){r=r.replace(a,x({explode:s,name:o,style:n,value:l}));continue}if(typeof l=="object"){r=r.replace(a,T({explode:s,name:o,style:n,value:l}));continue}if(n==="matrix"){r=r.replace(a,`;${O({name:o,value:l})}`);continue}let p=encodeURIComponent(n==="label"?`.${l}`:l);r=r.replace(a,p)}return r},j=({allowReserved:e,array:t,object:r}={})=>i=>{let a=[];if(i&&typeof i=="object")for(let s in i){let o=i[s];if(o!=null){if(Array.isArray(o)){a=[...a,x({allowReserved:e,explode:!0,name:s,style:"form",value:o,...t})];continue}if(typeof o=="object"){a=[...a,T({allowReserved:e,explode:!0,name:s,style:"deepObject",value:o,...r})];continue}a=[...a,O({allowReserved:e,name:s,value:o})]}}return a.join("&")},L=e=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},N=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r},P=async({security:e,...t})=>{for(let r of e){let i=await N(r,t.auth);if(!i)continue;let a=r.name??"Authorization";switch(r.in){case"query":t.query||(t.query={}),t.query[a]=i;break;case"header":default:t.headers.set(a,i);break}return}},B=e=>H({baseUrl:e.baseUrl??"",path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:j(e.querySerializer),url:e.url}),H=({baseUrl:e,path:t,query:r,querySerializer:i,url:a})=>{let s=a.startsWith("/")?a:`/${a}`,o=e+s;t&&(o=W({path:t,url:o}));let n=r?i(r):"";return n.startsWith("?")&&(n=n.substring(1)),n&&(o+=`?${n}`),o},k=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=R(e.headers,t.headers),r},R=(...e)=>{let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let i=r instanceof Headers?r.entries():Object.entries(r);for(let[a,s]of i)if(s===null)t.delete(a);else if(Array.isArray(s))for(let o of s)t.append(a,o);else s!==void 0&&t.set(a,typeof s=="object"?JSON.stringify(s):s)}return t},w=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(e){return this._fns.indexOf(e)!==-1}eject(e){let t=this._fns.indexOf(e);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}},J=()=>({error:new w,request:new w,response:new w});var V={bodySerializer:e=>JSON.stringify(e)};var G=j({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),M={"Content-Type":"application/json"},E=(e={})=>({...V,baseUrl:"",headers:M,parseAs:"auto",querySerializer:G,...e}),D=(e={})=>{let t=k(E(),e),r=()=>({...t}),i=o=>(t=k(t,o),r()),a=J(),s=async o=>{let n={...t,...o,fetch:o.fetch??t.fetch??globalThis.fetch,headers:R(t.headers,o.headers)};n.security&&await P({...n,security:n.security}),n.body&&n.bodySerializer&&(n.body=n.bodySerializer(n.body)),n.body||n.headers.delete("Content-Type");let l=B(n),p={redirect:"follow",...n},f=new Request(l,p);for(let u of a.request._fns)f=await u(f,n);let C=n.fetch,d=await C(f);for(let u of a.response._fns)d=await u(d,f,n);let y={request:f,response:d};if(d.ok){if(d.status===204||d.headers.get("Content-Length")==="0")return{data:{},...y};let u=(n.parseAs==="auto"?L(d.headers.get("Content-Type")):n.parseAs)??"json";if(u==="stream")return{data:d.body,...y};let g=await d[u]();return u==="json"&&(n.responseValidator&&await n.responseValidator(g),n.responseTransformer&&(g=await n.responseTransformer(g))),{data:g,...y}}let b=await d.text();try{b=JSON.parse(b)}catch{}let h=b;for(let u of a.error._fns)h=await u(b,d,f,n);if(h=h||{},n.throwOnError)throw h;return{error:h,...y}};return{buildUrl:B,connect:o=>s({...o,method:"CONNECT"}),delete:o=>s({...o,method:"DELETE"}),get:o=>s({...o,method:"GET"}),getConfig:r,head:o=>s({...o,method:"HEAD"}),interceptors:a,options:o=>s({...o,method:"OPTIONS"}),patch:o=>s({...o,method:"PATCH"}),post:o=>s({...o,method:"POST"}),put:o=>s({...o,method:"PUT"}),request:s,setConfig:i,trace:o=>s({...o,method:"TRACE"})}};var c=D(E()),Q=e=>(e?.client??c).get({...e,url:"/bookings"}),K=e=>(e?.client??c).post({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings"}),X=e=>(e?.client??c).delete({...e,url:"/bookings/{bookingId}"}),Y=e=>(e?.client??c).get({...e,url:"/bookings/{bookingId}"}),Z=e=>(e?.client??c).put({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings/{bookingId}"}),ee=e=>(e?.client??c).get({...e,url:"/facilities/{facility_id}/offers"}),re=e=>(e?.client??c).post({...e,url:"/facilities/{facility_id}/offers/{offer_id}"});0&&(module.exports={addBooking,client,createFacilityOfferOrder,deleteBooking,findBookingById,findBookings,listFacilityOffers,updateBooking});
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"./chunk-SNGJPP3Q.mjs";export{c as addBooking,a as client,d as deleteBooking,e as findBookingById,b as findBookings,f as updateBooking};
1
+ import{a,b,c,d,e,f,g,h}from"./chunk-M5A265XW.mjs";export{c as addBooking,a as client,h as createFacilityOfferOrder,d as deleteBooking,e as findBookingById,b as findBookings,g as listFacilityOffers,f as updateBooking};
@@ -26,6 +26,84 @@ type CreateBooking = {
26
26
  paymentReference: string;
27
27
  startTime: string;
28
28
  };
29
+ type FacilityOffer = {
30
+ data: FacilityPunchCardData | FacilityValueCardData;
31
+ type: 'FACILITY_PUNCH_CARD' | 'FACILITY_VALUE_CARD';
32
+ };
33
+ type FacilityOfferCondition = (FacilityOfferConditionWeekdays | FacilityOfferConditionCourts | FacilityOfferConditionDate | FacilityOfferConditionTime | FacilityOfferConditionHoursinadvance | FacilityOfferConditionActivities | FacilityOfferConditionNotImplemented) & {
34
+ type?: 'WEEKDAYS' | 'COURTS' | 'DATE' | 'TIME' | 'HOURSINADVANCE' | 'ACTIVITIES' | 'NOT_IMPLEMENTED';
35
+ };
36
+ type FacilityOfferConditionActivities = {
37
+ allActivities: boolean;
38
+ notValidForActivities: boolean;
39
+ type: string;
40
+ };
41
+ type FacilityOfferConditionCourts = {
42
+ name?: string;
43
+ type: string;
44
+ };
45
+ type FacilityOfferConditionDate = {
46
+ endDate: string;
47
+ startDate: string;
48
+ type: string;
49
+ };
50
+ type FacilityOfferConditionHoursinadvance = {
51
+ nrOfHours: number;
52
+ type: string;
53
+ };
54
+ type FacilityOfferConditionNotImplemented = {
55
+ type: string;
56
+ };
57
+ type FacilityOfferConditionTime = {
58
+ endTime: string;
59
+ startTime: string;
60
+ type: string;
61
+ };
62
+ type FacilityOfferConditionWeekdays = {
63
+ type: string;
64
+ weekdays: Array<number>;
65
+ };
66
+ type FacilityOfferList = {
67
+ data: Array<FacilityOffer>;
68
+ meta: PkgOpenapiSharedCursorPaginatedResultSet;
69
+ };
70
+ type FacilityOfferOrder = {
71
+ /**
72
+ * The URL to the checkout page for the facility offer order
73
+ */
74
+ checkoutUrl: string;
75
+ id: string;
76
+ };
77
+ type FacilityPunchCardData = {
78
+ conditions: Array<FacilityOfferCondition>;
79
+ description: string | null;
80
+ expireDate: string;
81
+ facilityId: number;
82
+ facilityReceiveMembershipRequests: boolean;
83
+ id: number;
84
+ maxDuration: number;
85
+ membersOnly: boolean;
86
+ name: string;
87
+ nrOfBookingsInPeriod: number;
88
+ nrOfDaysValid: number;
89
+ nrOfTickets: number;
90
+ price: string;
91
+ unlimited: boolean;
92
+ userHasActiveMembership: boolean;
93
+ };
94
+ type FacilityValueCardData = {
95
+ amount: string;
96
+ description: string | null;
97
+ expireDate: string;
98
+ facilityId: number;
99
+ facilityReceiveMembershipRequests: boolean;
100
+ id: number;
101
+ membersOnly: boolean;
102
+ name: string;
103
+ nrOfDaysValid: number;
104
+ price: string;
105
+ userHasActiveMembership: boolean;
106
+ };
29
107
  type Guest = {
30
108
  email: string;
31
109
  };
@@ -44,6 +122,24 @@ type UpdateBooking = {
44
122
  paymentReference: string;
45
123
  startTime: string;
46
124
  };
125
+ /**
126
+ * Metadata about the cursor based pagination for the result. This information is coupled with the CursorParam and CursorLimitParam. Intended to be used as the `meta` field in a list response, next to an `items` array field containing the data.
127
+ *
128
+ */
129
+ type PkgOpenapiSharedCursorPaginatedResultSet = {
130
+ /**
131
+ * Cursor used to retrieve the current page of results.
132
+ */
133
+ currentCursor: string;
134
+ /**
135
+ * Indicates if there are more results available.
136
+ */
137
+ moreResults: boolean;
138
+ /**
139
+ * Cursor to retrieve the next page of results.
140
+ */
141
+ nextCursor?: string;
142
+ };
47
143
  type PkgOpenapiSharedError = {
48
144
  /**
49
145
  * The error message
@@ -86,6 +182,17 @@ type PkgOpenapiSharedProblemDetails = {
86
182
  */
87
183
  type?: string;
88
184
  };
185
+ type FacilityIdPath = string;
186
+ type OfferIdPath = string;
187
+ /**
188
+ * Maximum number of items to return per page.
189
+ */
190
+ type PkgOpenapiSharedCursorLimitParam = number;
191
+ /**
192
+ * Cursor for pagination. An opaque value to request the next page. Should not be set for the first call to the resource. Subsequent should use the value from `meta.next_cursor` in the response, until `meta.more_results` is false.
193
+ *
194
+ */
195
+ type PkgOpenapiSharedCursorParam = string;
89
196
  /**
90
197
  * Maximum number of items to return.
91
198
  */
@@ -312,5 +419,88 @@ type UpdateBookingResponses = {
312
419
  200: Booking;
313
420
  };
314
421
  type UpdateBookingResponse = UpdateBookingResponses[keyof UpdateBookingResponses];
422
+ type ListFacilityOffersData = {
423
+ body?: never;
424
+ path: {
425
+ facilityId: string;
426
+ };
427
+ query?: {
428
+ /**
429
+ * Cursor for pagination. An opaque value to request the next page. Should not be set for the first call to the resource. Subsequent should use the value from `meta.next_cursor` in the response, until `meta.more_results` is false.
430
+ *
431
+ */
432
+ cursor?: string;
433
+ /**
434
+ * Maximum number of items to return per page.
435
+ */
436
+ limit?: number;
437
+ };
438
+ url: '/facilities/{facility_id}/offers';
439
+ };
440
+ type ListFacilityOffersErrors = {
441
+ /**
442
+ * Access token is not set or invalid.
443
+ */
444
+ 401: PkgOpenapiSharedProblemDetails;
445
+ /**
446
+ * The requestor is not authorized to perform this operation on the resource.
447
+ */
448
+ 403: PkgOpenapiSharedProblemDetails;
449
+ /**
450
+ * The server encountered an unexpected error
451
+ */
452
+ 500: PkgOpenapiSharedProblemDetails;
453
+ /**
454
+ * The requested operation is not implemented.
455
+ */
456
+ 501: PkgOpenapiSharedProblemDetails;
457
+ };
458
+ type ListFacilityOffersError = ListFacilityOffersErrors[keyof ListFacilityOffersErrors];
459
+ type ListFacilityOffersResponses = {
460
+ /**
461
+ * OK
462
+ */
463
+ 200: FacilityOfferList;
464
+ };
465
+ type ListFacilityOffersResponse = ListFacilityOffersResponses[keyof ListFacilityOffersResponses];
466
+ type CreateFacilityOfferOrderData = {
467
+ body?: never;
468
+ path: {
469
+ facilityId: string;
470
+ offerId: string;
471
+ };
472
+ query?: never;
473
+ url: '/facilities/{facility_id}/offers/{offer_id}';
474
+ };
475
+ type CreateFacilityOfferOrderErrors = {
476
+ /**
477
+ * Access token is not set or invalid.
478
+ */
479
+ 401: PkgOpenapiSharedProblemDetails;
480
+ /**
481
+ * The requestor is not authorized to perform this operation on the resource.
482
+ */
483
+ 403: PkgOpenapiSharedProblemDetails;
484
+ /**
485
+ * The requested resource was not found.
486
+ */
487
+ 404: PkgOpenapiSharedProblemDetails;
488
+ /**
489
+ * The server encountered an unexpected error
490
+ */
491
+ 500: PkgOpenapiSharedProblemDetails;
492
+ /**
493
+ * The requested operation is not implemented.
494
+ */
495
+ 501: PkgOpenapiSharedProblemDetails;
496
+ };
497
+ type CreateFacilityOfferOrderError = CreateFacilityOfferOrderErrors[keyof CreateFacilityOfferOrderErrors];
498
+ type CreateFacilityOfferOrderResponses = {
499
+ /**
500
+ * OK
501
+ */
502
+ 200: FacilityOfferOrder;
503
+ };
504
+ type CreateFacilityOfferOrderResponse = CreateFacilityOfferOrderResponses[keyof CreateFacilityOfferOrderResponses];
315
505
 
316
- export type { AddBookingData, AddBookingError, AddBookingErrors, AddBookingResponse, AddBookingResponses, Booking, CreateBooking, DeleteBookingData, DeleteBookingError, DeleteBookingErrors, DeleteBookingResponse, DeleteBookingResponses, FindBookingByIdData, FindBookingByIdError, FindBookingByIdErrors, FindBookingByIdResponse, FindBookingByIdResponses, FindBookingsData, FindBookingsError, FindBookingsErrors, FindBookingsResponse, FindBookingsResponses, Guest, PkgOpenapiSharedError, PkgOpenapiSharedErrors, PkgOpenapiSharedOffsetLimitParam, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedOffsetParam, PkgOpenapiSharedProblemDetails, Player, UpdateBooking, UpdateBookingData, UpdateBookingError, UpdateBookingErrors, UpdateBookingResponse, UpdateBookingResponses };
506
+ export type { AddBookingData, AddBookingError, AddBookingErrors, AddBookingResponse, AddBookingResponses, Booking, CreateBooking, CreateFacilityOfferOrderData, CreateFacilityOfferOrderError, CreateFacilityOfferOrderErrors, CreateFacilityOfferOrderResponse, CreateFacilityOfferOrderResponses, DeleteBookingData, DeleteBookingError, DeleteBookingErrors, DeleteBookingResponse, DeleteBookingResponses, FacilityIdPath, FacilityOffer, FacilityOfferCondition, FacilityOfferConditionActivities, FacilityOfferConditionCourts, FacilityOfferConditionDate, FacilityOfferConditionHoursinadvance, FacilityOfferConditionNotImplemented, FacilityOfferConditionTime, FacilityOfferConditionWeekdays, FacilityOfferList, FacilityOfferOrder, FacilityPunchCardData, FacilityValueCardData, FindBookingByIdData, FindBookingByIdError, FindBookingByIdErrors, FindBookingByIdResponse, FindBookingByIdResponses, FindBookingsData, FindBookingsError, FindBookingsErrors, FindBookingsResponse, FindBookingsResponses, Guest, ListFacilityOffersData, ListFacilityOffersError, ListFacilityOffersErrors, ListFacilityOffersResponse, ListFacilityOffersResponses, OfferIdPath, PkgOpenapiSharedCursorLimitParam, PkgOpenapiSharedCursorPaginatedResultSet, PkgOpenapiSharedCursorParam, PkgOpenapiSharedError, PkgOpenapiSharedErrors, PkgOpenapiSharedOffsetLimitParam, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedOffsetParam, PkgOpenapiSharedProblemDetails, Player, UpdateBooking, UpdateBookingData, UpdateBookingError, UpdateBookingErrors, UpdateBookingResponse, UpdateBookingResponses };
@@ -26,6 +26,84 @@ type CreateBooking = {
26
26
  paymentReference: string;
27
27
  startTime: string;
28
28
  };
29
+ type FacilityOffer = {
30
+ data: FacilityPunchCardData | FacilityValueCardData;
31
+ type: 'FACILITY_PUNCH_CARD' | 'FACILITY_VALUE_CARD';
32
+ };
33
+ type FacilityOfferCondition = (FacilityOfferConditionWeekdays | FacilityOfferConditionCourts | FacilityOfferConditionDate | FacilityOfferConditionTime | FacilityOfferConditionHoursinadvance | FacilityOfferConditionActivities | FacilityOfferConditionNotImplemented) & {
34
+ type?: 'WEEKDAYS' | 'COURTS' | 'DATE' | 'TIME' | 'HOURSINADVANCE' | 'ACTIVITIES' | 'NOT_IMPLEMENTED';
35
+ };
36
+ type FacilityOfferConditionActivities = {
37
+ allActivities: boolean;
38
+ notValidForActivities: boolean;
39
+ type: string;
40
+ };
41
+ type FacilityOfferConditionCourts = {
42
+ name?: string;
43
+ type: string;
44
+ };
45
+ type FacilityOfferConditionDate = {
46
+ endDate: string;
47
+ startDate: string;
48
+ type: string;
49
+ };
50
+ type FacilityOfferConditionHoursinadvance = {
51
+ nrOfHours: number;
52
+ type: string;
53
+ };
54
+ type FacilityOfferConditionNotImplemented = {
55
+ type: string;
56
+ };
57
+ type FacilityOfferConditionTime = {
58
+ endTime: string;
59
+ startTime: string;
60
+ type: string;
61
+ };
62
+ type FacilityOfferConditionWeekdays = {
63
+ type: string;
64
+ weekdays: Array<number>;
65
+ };
66
+ type FacilityOfferList = {
67
+ data: Array<FacilityOffer>;
68
+ meta: PkgOpenapiSharedCursorPaginatedResultSet;
69
+ };
70
+ type FacilityOfferOrder = {
71
+ /**
72
+ * The URL to the checkout page for the facility offer order
73
+ */
74
+ checkoutUrl: string;
75
+ id: string;
76
+ };
77
+ type FacilityPunchCardData = {
78
+ conditions: Array<FacilityOfferCondition>;
79
+ description: string | null;
80
+ expireDate: string;
81
+ facilityId: number;
82
+ facilityReceiveMembershipRequests: boolean;
83
+ id: number;
84
+ maxDuration: number;
85
+ membersOnly: boolean;
86
+ name: string;
87
+ nrOfBookingsInPeriod: number;
88
+ nrOfDaysValid: number;
89
+ nrOfTickets: number;
90
+ price: string;
91
+ unlimited: boolean;
92
+ userHasActiveMembership: boolean;
93
+ };
94
+ type FacilityValueCardData = {
95
+ amount: string;
96
+ description: string | null;
97
+ expireDate: string;
98
+ facilityId: number;
99
+ facilityReceiveMembershipRequests: boolean;
100
+ id: number;
101
+ membersOnly: boolean;
102
+ name: string;
103
+ nrOfDaysValid: number;
104
+ price: string;
105
+ userHasActiveMembership: boolean;
106
+ };
29
107
  type Guest = {
30
108
  email: string;
31
109
  };
@@ -44,6 +122,24 @@ type UpdateBooking = {
44
122
  paymentReference: string;
45
123
  startTime: string;
46
124
  };
125
+ /**
126
+ * Metadata about the cursor based pagination for the result. This information is coupled with the CursorParam and CursorLimitParam. Intended to be used as the `meta` field in a list response, next to an `items` array field containing the data.
127
+ *
128
+ */
129
+ type PkgOpenapiSharedCursorPaginatedResultSet = {
130
+ /**
131
+ * Cursor used to retrieve the current page of results.
132
+ */
133
+ currentCursor: string;
134
+ /**
135
+ * Indicates if there are more results available.
136
+ */
137
+ moreResults: boolean;
138
+ /**
139
+ * Cursor to retrieve the next page of results.
140
+ */
141
+ nextCursor?: string;
142
+ };
47
143
  type PkgOpenapiSharedError = {
48
144
  /**
49
145
  * The error message
@@ -86,6 +182,17 @@ type PkgOpenapiSharedProblemDetails = {
86
182
  */
87
183
  type?: string;
88
184
  };
185
+ type FacilityIdPath = string;
186
+ type OfferIdPath = string;
187
+ /**
188
+ * Maximum number of items to return per page.
189
+ */
190
+ type PkgOpenapiSharedCursorLimitParam = number;
191
+ /**
192
+ * Cursor for pagination. An opaque value to request the next page. Should not be set for the first call to the resource. Subsequent should use the value from `meta.next_cursor` in the response, until `meta.more_results` is false.
193
+ *
194
+ */
195
+ type PkgOpenapiSharedCursorParam = string;
89
196
  /**
90
197
  * Maximum number of items to return.
91
198
  */
@@ -312,5 +419,88 @@ type UpdateBookingResponses = {
312
419
  200: Booking;
313
420
  };
314
421
  type UpdateBookingResponse = UpdateBookingResponses[keyof UpdateBookingResponses];
422
+ type ListFacilityOffersData = {
423
+ body?: never;
424
+ path: {
425
+ facilityId: string;
426
+ };
427
+ query?: {
428
+ /**
429
+ * Cursor for pagination. An opaque value to request the next page. Should not be set for the first call to the resource. Subsequent should use the value from `meta.next_cursor` in the response, until `meta.more_results` is false.
430
+ *
431
+ */
432
+ cursor?: string;
433
+ /**
434
+ * Maximum number of items to return per page.
435
+ */
436
+ limit?: number;
437
+ };
438
+ url: '/facilities/{facility_id}/offers';
439
+ };
440
+ type ListFacilityOffersErrors = {
441
+ /**
442
+ * Access token is not set or invalid.
443
+ */
444
+ 401: PkgOpenapiSharedProblemDetails;
445
+ /**
446
+ * The requestor is not authorized to perform this operation on the resource.
447
+ */
448
+ 403: PkgOpenapiSharedProblemDetails;
449
+ /**
450
+ * The server encountered an unexpected error
451
+ */
452
+ 500: PkgOpenapiSharedProblemDetails;
453
+ /**
454
+ * The requested operation is not implemented.
455
+ */
456
+ 501: PkgOpenapiSharedProblemDetails;
457
+ };
458
+ type ListFacilityOffersError = ListFacilityOffersErrors[keyof ListFacilityOffersErrors];
459
+ type ListFacilityOffersResponses = {
460
+ /**
461
+ * OK
462
+ */
463
+ 200: FacilityOfferList;
464
+ };
465
+ type ListFacilityOffersResponse = ListFacilityOffersResponses[keyof ListFacilityOffersResponses];
466
+ type CreateFacilityOfferOrderData = {
467
+ body?: never;
468
+ path: {
469
+ facilityId: string;
470
+ offerId: string;
471
+ };
472
+ query?: never;
473
+ url: '/facilities/{facility_id}/offers/{offer_id}';
474
+ };
475
+ type CreateFacilityOfferOrderErrors = {
476
+ /**
477
+ * Access token is not set or invalid.
478
+ */
479
+ 401: PkgOpenapiSharedProblemDetails;
480
+ /**
481
+ * The requestor is not authorized to perform this operation on the resource.
482
+ */
483
+ 403: PkgOpenapiSharedProblemDetails;
484
+ /**
485
+ * The requested resource was not found.
486
+ */
487
+ 404: PkgOpenapiSharedProblemDetails;
488
+ /**
489
+ * The server encountered an unexpected error
490
+ */
491
+ 500: PkgOpenapiSharedProblemDetails;
492
+ /**
493
+ * The requested operation is not implemented.
494
+ */
495
+ 501: PkgOpenapiSharedProblemDetails;
496
+ };
497
+ type CreateFacilityOfferOrderError = CreateFacilityOfferOrderErrors[keyof CreateFacilityOfferOrderErrors];
498
+ type CreateFacilityOfferOrderResponses = {
499
+ /**
500
+ * OK
501
+ */
502
+ 200: FacilityOfferOrder;
503
+ };
504
+ type CreateFacilityOfferOrderResponse = CreateFacilityOfferOrderResponses[keyof CreateFacilityOfferOrderResponses];
315
505
 
316
- export type { AddBookingData, AddBookingError, AddBookingErrors, AddBookingResponse, AddBookingResponses, Booking, CreateBooking, DeleteBookingData, DeleteBookingError, DeleteBookingErrors, DeleteBookingResponse, DeleteBookingResponses, FindBookingByIdData, FindBookingByIdError, FindBookingByIdErrors, FindBookingByIdResponse, FindBookingByIdResponses, FindBookingsData, FindBookingsError, FindBookingsErrors, FindBookingsResponse, FindBookingsResponses, Guest, PkgOpenapiSharedError, PkgOpenapiSharedErrors, PkgOpenapiSharedOffsetLimitParam, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedOffsetParam, PkgOpenapiSharedProblemDetails, Player, UpdateBooking, UpdateBookingData, UpdateBookingError, UpdateBookingErrors, UpdateBookingResponse, UpdateBookingResponses };
506
+ export type { AddBookingData, AddBookingError, AddBookingErrors, AddBookingResponse, AddBookingResponses, Booking, CreateBooking, CreateFacilityOfferOrderData, CreateFacilityOfferOrderError, CreateFacilityOfferOrderErrors, CreateFacilityOfferOrderResponse, CreateFacilityOfferOrderResponses, DeleteBookingData, DeleteBookingError, DeleteBookingErrors, DeleteBookingResponse, DeleteBookingResponses, FacilityIdPath, FacilityOffer, FacilityOfferCondition, FacilityOfferConditionActivities, FacilityOfferConditionCourts, FacilityOfferConditionDate, FacilityOfferConditionHoursinadvance, FacilityOfferConditionNotImplemented, FacilityOfferConditionTime, FacilityOfferConditionWeekdays, FacilityOfferList, FacilityOfferOrder, FacilityPunchCardData, FacilityValueCardData, FindBookingByIdData, FindBookingByIdError, FindBookingByIdErrors, FindBookingByIdResponse, FindBookingByIdResponses, FindBookingsData, FindBookingsError, FindBookingsErrors, FindBookingsResponse, FindBookingsResponses, Guest, ListFacilityOffersData, ListFacilityOffersError, ListFacilityOffersErrors, ListFacilityOffersResponse, ListFacilityOffersResponses, OfferIdPath, PkgOpenapiSharedCursorLimitParam, PkgOpenapiSharedCursorPaginatedResultSet, PkgOpenapiSharedCursorParam, PkgOpenapiSharedError, PkgOpenapiSharedErrors, PkgOpenapiSharedOffsetLimitParam, PkgOpenapiSharedOffsetPaginatedResultSet, PkgOpenapiSharedOffsetParam, PkgOpenapiSharedProblemDetails, Player, UpdateBooking, UpdateBookingData, UpdateBookingError, UpdateBookingErrors, UpdateBookingResponse, UpdateBookingResponses };
@@ -1 +1 @@
1
- "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var g=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!s.call(r,o)&&o!==n&&i(r,o,{get:()=>e[o],enumerable:!(t=p(e,o))||t.enumerable});return r};var d=r=>g(i({},"__esModule",{value:!0}),r);var k={};module.exports=d(k);
1
+ "use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(r,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!p.call(r,t)&&t!==a&&o(r,t,{get:()=>e[t],enumerable:!(i=n(e,t))||i.enumerable});return r};var l=r=>d(o({},"__esModule",{value:!0}),r);var y={};module.exports=l(y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matchi/api",
3
- "version": "0.20250130.2",
3
+ "version": "0.20250206.1",
4
4
  "main": "dist/main/index.js",
5
5
  "module": "dist/main/index.mjs",
6
6
  "devDependencies": {
@@ -1 +0,0 @@
1
- var D=/\{[^{}]+\}/g,m=({allowReserved:e,name:n,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?t:encodeURIComponent(t)}`},v=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},A=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},U=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},E=({allowReserved:e,explode:n,name:t,style:s,value:a})=>{if(!n){let o=(e?a:a.map(l=>encodeURIComponent(l))).join(A(s));switch(s){case"label":return`.${o}`;case"matrix":return`;${t}=${o}`;case"simple":return o;default:return`${t}=${o}`}}let i=v(s),r=a.map(o=>s==="label"||s==="simple"?e?o:encodeURIComponent(o):m({allowReserved:e,name:t,value:o})).join(i);return s==="label"||s==="matrix"?i+r:r},x=({allowReserved:e,explode:n,name:t,style:s,value:a})=>{if(a instanceof Date)return`${t}=${a.toISOString()}`;if(s!=="deepObject"&&!n){let o=[];Object.entries(a).forEach(([f,u])=>{o=[...o,f,e?u:encodeURIComponent(u)]});let l=o.join(",");switch(s){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}let i=U(s),r=Object.entries(a).map(([o,l])=>m({allowReserved:e,name:s==="deepObject"?`${t}[${o}]`:o,value:l})).join(i);return s==="label"||s==="matrix"?i+r:r},$=({path:e,url:n})=>{let t=n,s=n.match(D);if(s)for(let a of s){let i=!1,r=a.substring(1,a.length-1),o="simple";r.endsWith("*")&&(i=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(r=r.substring(1),o="label"):r.startsWith(";")&&(r=r.substring(1),o="matrix");let l=e[r];if(l==null)continue;if(Array.isArray(l)){t=t.replace(a,E({explode:i,name:r,style:o,value:l}));continue}if(typeof l=="object"){t=t.replace(a,x({explode:i,name:r,style:o,value:l}));continue}if(o==="matrix"){t=t.replace(a,`;${m({name:r,value:l})}`);continue}let f=encodeURIComponent(o==="label"?`.${l}`:l);t=t.replace(a,f)}return t},j=({allowReserved:e,array:n,object:t}={})=>s=>{let a=[];if(s&&typeof s=="object")for(let i in s){let r=s[i];if(r!=null){if(Array.isArray(r)){a=[...a,E({allowReserved:e,explode:!0,name:i,style:"form",value:r,...n})];continue}if(typeof r=="object"){a=[...a,x({allowReserved:e,explode:!0,name:i,style:"deepObject",value:r,...t})];continue}a=[...a,m({allowReserved:e,name:i,value:r})]}}return a.join("&")},C=e=>{if(!e)return"stream";let n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>n.startsWith(t)))return"blob";if(n.startsWith("text/"))return"text"}},q=async(e,n)=>{let t=typeof n=="function"?await n(e):n;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t},I=async({security:e,...n})=>{for(let t of e){let s=await q(t,n.auth);if(!s)continue;let a=t.name??"Authorization";switch(t.in){case"query":n.query||(n.query={}),n.query[a]=s;break;case"header":default:n.headers.set(a,s);break}return}},k=e=>z({baseUrl:e.baseUrl??"",path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:j(e.querySerializer),url:e.url}),z=({baseUrl:e,path:n,query:t,querySerializer:s,url:a})=>{let i=a.startsWith("/")?a:`/${a}`,r=e+i;n&&(r=$({path:n,url:r}));let o=t?s(t):"";return o.startsWith("?")&&(o=o.substring(1)),o&&(r+=`?${o}`),r},O=(e,n)=>{let t={...e,...n};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=T(e.headers,n.headers),t},T=(...e)=>{let n=new Headers;for(let t of e){if(!t||typeof t!="object")continue;let s=t instanceof Headers?t.entries():Object.entries(t);for(let[a,i]of s)if(i===null)n.delete(a);else if(Array.isArray(i))for(let r of i)n.append(a,r);else i!==void 0&&n.set(a,typeof i=="object"?JSON.stringify(i):i)}return n},w=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(e){return this._fns.indexOf(e)!==-1}eject(e){let n=this._fns.indexOf(e);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(e){this._fns=[...this._fns,e]}},_=()=>({error:new w,request:new w,response:new w});var F={bodySerializer:e=>JSON.stringify(e)};var W=j({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),N={"Content-Type":"application/json"},B=(e={})=>({...F,baseUrl:"",headers:N,parseAs:"auto",querySerializer:W,...e}),R=(e={})=>{let n=O(B(),e),t=()=>({...n}),s=r=>(n=O(n,r),t()),a=_(),i=async r=>{let o={...n,...r,fetch:r.fetch??n.fetch??globalThis.fetch,headers:T(n.headers,r.headers)};o.security&&await I({...o,security:o.security}),o.body&&o.bodySerializer&&(o.body=o.bodySerializer(o.body)),o.body||o.headers.delete("Content-Type");let l=k(o),f={redirect:"follow",...o},u=new Request(l,f);for(let c of a.request._fns)u=await c(u,o);let S=o.fetch,d=await S(u);for(let c of a.response._fns)d=await c(d,u,o);let y={request:u,response:d};if(d.ok){if(d.status===204||d.headers.get("Content-Length")==="0")return{data:{},...y};let c=(o.parseAs==="auto"?C(d.headers.get("Content-Type")):o.parseAs)??"json";if(c==="stream")return{data:d.body,...y};let g=await d[c]();return c==="json"&&(o.responseValidator&&await o.responseValidator(g),o.responseTransformer&&(g=await o.responseTransformer(g))),{data:g,...y}}let b=await d.text();try{b=JSON.parse(b)}catch{}let p=b;for(let c of a.error._fns)p=await c(b,d,u,o);if(p=p||{},o.throwOnError)throw p;return{error:p,...y}};return{buildUrl:k,connect:r=>i({...r,method:"CONNECT"}),delete:r=>i({...r,method:"DELETE"}),get:r=>i({...r,method:"GET"}),getConfig:t,head:r=>i({...r,method:"HEAD"}),interceptors:a,options:r=>i({...r,method:"OPTIONS"}),patch:r=>i({...r,method:"PATCH"}),post:r=>i({...r,method:"POST"}),put:r=>i({...r,method:"PUT"}),request:i,setConfig:s,trace:r=>i({...r,method:"TRACE"})}};var h=R(B()),L=e=>(e?.client??h).get({...e,url:"/bookings"}),V=e=>(e?.client??h).post({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings"}),G=e=>(e?.client??h).delete({...e,url:"/bookings/{bookingId}"}),M=e=>(e?.client??h).get({...e,url:"/bookings/{bookingId}"}),Q=e=>(e?.client??h).put({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/bookings/{bookingId}"});export{h as a,L as b,V as c,G as d,M as e,Q as f};