@swishapp/api-client 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/openapi/sdk.gen.d.ts +5 -1
- package/dist/openapi/types.gen.d.ts +272 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Le=Object.defineProperty;var s=(e,r)=>Le(e,"name",{value:r,configurable:!0});var j={bodySerializer:s(e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t),"bodySerializer")};var De={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Me=Object.entries(De);var _=s(({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:o,responseValidator:n,sseDefaultRetryDelay:p,sseMaxRetryAttempts:d,sseMaxRetryDelay:a,sseSleepFn:l,url:u,...i})=>{let h,L=l??(c=>new Promise(C=>setTimeout(C,c)));return{stream:s(async function*(){let c=p??3e3,C=0,R=i.signal??new AbortController().signal;for(;!R.aborted;){C++;let D=i.headers instanceof Headers?i.headers:new Headers(i.headers);h!==void 0&&D.set("Last-Event-ID",h);try{let T={redirect:"follow",...i,body:i.serializedBody,headers:D,signal:R},I=new Request(u,T);e&&(I=await e(u,T));let m=await(i.fetch??globalThis.fetch)(I);if(!m.ok)throw new Error(`SSE failed: ${m.status} ${m.statusText}`);if(!m.body)throw new Error("No body in SSE response");let g=m.body.pipeThrough(new TextDecoderStream).getReader(),z="",V=s(()=>{try{g.cancel()}catch{}},"abortHandler");R.addEventListener("abort",V);try{for(;;){let{done:Te,value:Se}=await g.read();if(Te)break;z+=Se;let M=z.split(`
|
|
2
2
|
|
|
3
|
-
`);
|
|
4
|
-
`),
|
|
5
|
-
`);try{w=JSON.parse(O),Q=!0}catch{w=O}}Q&&(s&&await s(w),o&&(w=await o(w))),t==null||t({data:w,event:W,id:h,retry:c}),P.length&&(yield w)}}}finally{R.removeEventListener("abort",V),g.releaseLock()}break}catch(T){if(r==null||r(T),d!==void 0&&C>=d)break;let I=Math.min(c*2**(C-1),a??3e4);await k(I)}}},"createStream")()}},"createSseClient");var qe=n(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorArrayExplode"),Le=n(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"separatorArrayNoExplode"),Pe=n(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorObjectExplode"),A=n(({allowReserved:e,explode:r,name:t,style:o,value:s})=>{if(!r){let a=(e?s:s.map(l=>encodeURIComponent(l))).join(Le(o));switch(o){case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;case"simple":return a;default:return`${t}=${a}`}}let p=qe(o),d=s.map(a=>o==="label"||o==="simple"?e?a:encodeURIComponent(a):E({allowReserved:e,name:t,value:a})).join(p);return o==="label"||o==="matrix"?p+d:d},"serializeArrayParam"),E=n(({allowReserved:e,name:r,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`${r}=${e?t:encodeURIComponent(t)}`},"serializePrimitiveParam"),B=n(({allowReserved:e,explode:r,name:t,style:o,value:s,valueOnly:p})=>{if(s instanceof Date)return p?s.toISOString():`${t}=${s.toISOString()}`;if(o!=="deepObject"&&!r){let l=[];Object.entries(s).forEach(([i,h])=>{l=[...l,i,e?h:encodeURIComponent(h)]});let u=l.join(",");switch(o){case"form":return`${t}=${u}`;case"label":return`.${u}`;case"matrix":return`;${t}=${u}`;default:return u}}let d=Pe(o),a=Object.entries(s).map(([l,u])=>E({allowReserved:e,name:o==="deepObject"?`${t}[${l}]`:l,value:u})).join(d);return o==="label"||o==="matrix"?d+a:a},"serializeObjectParam");var Ae=/\{[^{}]+\}/g,Be=n(({path:e,url:r})=>{let t=r,o=r.match(Ae);if(o)for(let s of o){let p=!1,d=s.substring(1,s.length-1),a="simple";d.endsWith("*")&&(p=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),a="label"):d.startsWith(";")&&(d=d.substring(1),a="matrix");let l=e[d];if(l==null)continue;if(Array.isArray(l)){t=t.replace(s,A({explode:p,name:d,style:a,value:l}));continue}if(typeof l=="object"){t=t.replace(s,B({explode:p,name:d,style:a,value:l,valueOnly:!0}));continue}if(a==="matrix"){t=t.replace(s,`;${E({name:d,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);t=t.replace(s,u)}return t},"defaultPathSerializer"),K=n(({baseUrl:e,path:r,query:t,querySerializer:o,url:s})=>{let p=s.startsWith("/")?s:`/${s}`,d=(e??"")+p;r&&(d=Be({path:r,url:d}));let a=t?o(t):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(d+=`?${a}`),d},"getUrl");function G(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}n(G,"getValidRequestBody");var X=n(async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t},"getAuthToken");var Y=n(({allowReserved:e,array:r,object:t}={})=>n(s=>{let p=[];if(s&&typeof s=="object")for(let d in s){let a=s[d];if(a!=null)if(Array.isArray(a)){let l=A({allowReserved:e,explode:!0,name:d,style:"form",value:a,...r});l&&p.push(l)}else if(typeof a=="object"){let l=B({allowReserved:e,explode:!0,name:d,style:"deepObject",value:a,...t});l&&p.push(l)}else{let l=E({allowReserved:e,name:d,value:a});l&&p.push(l)}}return p.join("&")},"querySerializer"),"createQuerySerializer"),Z=n(e=>{var t;if(!e)return"stream";let r=(t=e.split(";")[0])==null?void 0:t.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(o=>r.startsWith(o)))return"blob";if(r.startsWith("text/"))return"text"}},"getParseAs"),ze=n((e,r)=>{var t,o;return r?!!(e.headers.has(r)||(t=e.query)!=null&&t[r]||(o=e.headers.get("Cookie"))!=null&&o.includes(`${r}=`)):!1},"checkForExistence"),ee=n(async({security:e,...r})=>{for(let t of e){if(ze(r,t.name))continue;let o=await X(t,r.auth);if(!o)continue;let s=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[s]=o;break;case"cookie":r.headers.append("Cookie",`${s}=${o}`);break;case"header":default:r.headers.set(s,o);break}}},"setAuthParams"),v=n(e=>K({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Y(e.querySerializer),url:e.url}),"buildUrl"),U=n((e,r)=>{var o;let t={...e,...r};return(o=t.baseUrl)!=null&&o.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=z(e.headers,r.headers),t},"mergeConfigs"),Fe=n(e=>{let r=[];return e.forEach((t,o)=>{r.push([o,t])}),r},"headersEntries"),z=n((...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let o=t instanceof Headers?Fe(t):Object.entries(t);for(let[s,p]of o)if(p===null)r.delete(s);else if(Array.isArray(p))for(let d of p)r.append(s,d);else p!==void 0&&r.set(s,typeof p=="object"?JSON.stringify(p):p)}return r},"mergeHeaders"),$=class ${constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let o=this.getInterceptorIndex(r);return this.fns[o]?(this.fns[o]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}};n($,"Interceptors");var q=$,re=n(()=>({error:new q,request:new q,response:new q}),"createInterceptors"),je=Y({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ve={"Content-Type":"application/json"},x=n((e={})=>({...j,headers:ve,parseAs:"auto",querySerializer:je,...e}),"createConfig");var S=n((e={})=>{let r=U(x(),e),t=n(()=>({...r}),"getConfig"),o=n(u=>(r=U(r,u),t()),"setConfig"),s=re(),p=n(async u=>{let i={...r,...u,fetch:u.fetch??r.fetch??globalThis.fetch,headers:z(r.headers,u.headers),serializedBody:void 0};i.security&&await ee({...i,security:i.security}),i.requestValidator&&await i.requestValidator(i),i.body!==void 0&&i.bodySerializer&&(i.serializedBody=i.bodySerializer(i.body)),(i.body===void 0||i.serializedBody==="")&&i.headers.delete("Content-Type");let h=v(i);return{opts:i,url:h}},"beforeRequest"),d=n(async u=>{let{opts:i,url:h}=await p(u),k={redirect:"follow",...i,body:G(i)},b=new Request(h,k);for(let f of s.request.fns)f&&(b=await f(b,i));let L=i.fetch,c=await L(b);for(let f of s.response.fns)f&&(c=await f(c,b,i));let C={request:b,response:c};if(c.ok){let f=(i.parseAs==="auto"?Z(c.headers.get("Content-Type")):i.parseAs)??"json";if(c.status===204||c.headers.get("Content-Length")==="0"){let g;switch(f){case"arrayBuffer":case"blob":case"text":g=await c[f]();break;case"formData":g=new FormData;break;case"stream":g=c.body;break;case"json":default:g={};break}return i.responseStyle==="data"?g:{data:g,...C}}let m;switch(f){case"arrayBuffer":case"blob":case"formData":case"json":case"text":m=await c[f]();break;case"stream":return i.responseStyle==="data"?c.body:{data:c.body,...C}}return f==="json"&&(i.responseValidator&&await i.responseValidator(m),i.responseTransformer&&(m=await i.responseTransformer(m))),i.responseStyle==="data"?m:{data:m,...C}}let R=await c.text(),D;try{D=JSON.parse(R)}catch{}let T=D??R,I=T;for(let f of s.error.fns)f&&(I=await f(T,c,b,i));if(I=I||{},i.throwOnError)throw I;return i.responseStyle==="data"?void 0:{error:I,...C}},"request"),a=n(u=>i=>d({...i,method:u}),"makeMethodFn"),l=n(u=>async i=>{let{opts:h,url:k}=await p(i);return _({...h,body:h.body,headers:h.headers,method:u,onRequest:n(async(b,L)=>{let c=new Request(b,L);for(let C of s.request.fns)C&&(c=await C(c,h));return c},"onRequest"),url:k})},"makeSseFn");return{buildUrl:v,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:t,head:a("HEAD"),interceptors:s,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:d,setConfig:o,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:a("TRACE")}},"createClient");var y=S(x({baseUrl:"https://swish.app/api/2026-01"}));var te=n(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/lists",...e}),"listControllerFind"),ne=n(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/lists",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerCreate"),oe=n(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e}),"listControllerDeleteById"),se=n(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e}),"listControllerFindById"),ie=n(e=>(e.client??y).patch({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerUpdateById"),ae=n(e=>(e.client??y).put({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items/order",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerSetListItemsOrder"),le=n(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerAddItemsToList"),de=n(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items/{itemId}",...e}),"listControllerRemoveItemFromList"),pe=n(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerDelete"),ce=n(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items",...e}),"itemControllerFind"),ue=n(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerCreate"),ye=n(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items/count",...e}),"itemControllerCount"),he=n(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e}),"itemControllerDeleteById"),fe=n(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e}),"itemControllerFindById"),Ce=n(e=>(e.client??y).patch({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerUpdateById"),me=n(e=>(e.client??y).put({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}/lists",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerSetListsById"),Oe=n(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/profiles/accounts-version",...e}),"profileControllerCustomerAccountsVersion"),Ie=n(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/profiles/identify",...e,headers:{"Content-Type":"application/json",...e.headers}}),"profileControllerIdentify"),ge=n(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/profiles/token",...e,headers:{"Content-Type":"application/json",...e.headers}}),"profileControllerCreateToken");var be=n(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/orders",...e}),"ordersControllerFind"),xe=n(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/orders/{orderId}",...e}),"ordersControllerFindOne");var $e="2026-01",Re="/apps/wishlist/api",Dr=n(e=>new N(e),"createApiClient"),H=class H{constructor(r){this.useProxy=!1;this.version=$e;this.items={list:n(r=>this.handlePaginatedRequest(ce({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),create:n(r=>this.handleRequest(ue({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"create"),delete:n(r=>this.handleRequest(pe({body:{itemIds:r},client:this.useProxy?this.proxyClient:this.directClient})),"delete"),findById:n(r=>this.handleRequest(fe({path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById"),updateById:n((r,t)=>this.handleRequest(Ce({body:t,path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"updateById"),deleteById:n(r=>this.handleRequest(he({path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"deleteById"),setListsById:n((r,t)=>this.handleRequest(me({body:{listIds:t},path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"setListsById"),count:n(()=>this.handleRequest(ye({client:this.useProxy?this.proxyClient:this.directClient})),"count")};this.lists={list:n(r=>this.handlePaginatedRequest(te({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),create:n(r=>this.handleRequest(ne({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"create"),findById:n(r=>this.handleRequest(se({path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById"),updateById:n((r,t)=>this.handleRequest(ie({body:t,path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"updateById"),deleteById:n(r=>this.handleRequest(oe({path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"deleteById"),orderItems:n((r,t)=>this.handleRequest(ae({body:{itemIds:t},path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"orderItems"),addItemsToList:n((r,t)=>this.handleRequest(le({body:{itemIds:t},path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"addItemsToList"),removeItemFromList:n((r,t)=>this.handleRequest(de({path:{listId:r,itemId:t},client:this.useProxy?this.proxyClient:this.directClient})),"removeItemFromList")};this.profiles={customerAccountsVersion:n(()=>this.handleRequest(Oe({client:this.useProxy?this.proxyClient:this.directClient})),"customerAccountsVersion"),createToken:n((r={},t)=>this.handleRequest(ge({body:r,client:this.useProxy||t!=null&&t.useProxy?this.proxyClient:this.directClient})),"createToken"),identify:n(r=>this.handleRequest(Ie({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"identify")};this.orders={list:n(r=>this.handlePaginatedRequest(be({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),findById:n(r=>this.handleRequest(xe({path:{orderId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById")};this.handleRequest=n(async r=>{let{data:t,error:o}=await r;return o!=null&&o.error?{error:o.error}:{data:t==null?void 0:t.data}},"handleRequest");this.handlePaginatedRequest=n(async r=>{var s;let{data:t,error:o}=await r;return o!=null&&o.error?{error:o.error}:{data:(t==null?void 0:t.data)??[],pageInfo:(t==null?void 0:t.pageInfo)??{next:null,previous:null,totalCount:((s=t==null?void 0:t.data)==null?void 0:s.length)??0}}},"handlePaginatedRequest");var t;this.profile=r.profile,(t=r.config)!=null&&t.version&&(this.version=r.config.version),this.directClient=S(x({baseUrl:`https://swish.app/api/${this.version}`})),this.proxyClient=S(x({baseUrl:Re})),r.authToken&&(this.authToken=r.authToken),r.config&&this.setConfig(r.config),r.requestInterceptor&&(this.proxyClient.interceptors.request.use(r.requestInterceptor),this.directClient.interceptors.request.use(r.requestInterceptor)),r.responseInterceptor&&(this.proxyClient.interceptors.response.use(r.responseInterceptor),this.directClient.interceptors.response.use(r.responseInterceptor)),this.proxyClient.interceptors.request.use(this.proxyRequestInterceptor.bind(this)),this.directClient.interceptors.request.use(this.directRequestInterceptor.bind(this))}setProfile(r){this.profile=r}getProfile(){return this.profile}setAuthToken(r){this.authToken=r}setConfig({proxyBaseUrl:r=Re,baseUrl:t,useProxy:o=!1,...s}){this.useProxy=o,this.proxyClient.setConfig({...s,baseUrl:r}),this.directClient.setConfig({...s})}proxyRequestInterceptor(r){return this.profile&&(r.headers.set("Profile",this.profile),r.headers.set("Swish-Api-Version",this.version)),r}directRequestInterceptor(r){return this.authToken&&r.headers.set("Authorization",`Bearer ${this.authToken}`),r}};n(H,"SwishClient");var N=H;export{Dr as createApiClient,$e as defaultApiVersion,Re as defaultProxyBaseUrl};
|
|
3
|
+
`);z=M.pop()??"";for(let we of M){let Ee=we.split(`
|
|
4
|
+
`),A=[],W;for(let O of Ee)if(O.startsWith("data:"))A.push(O.replace(/^data:\s*/,""));else if(O.startsWith("event:"))W=O.replace(/^event:\s*/,"");else if(O.startsWith("id:"))h=O.replace(/^id:\s*/,"");else if(O.startsWith("retry:")){let J=Number.parseInt(O.replace(/^retry:\s*/,""),10);Number.isNaN(J)||(c=J)}let S,Q=!1;if(A.length){let O=A.join(`
|
|
5
|
+
`);try{S=JSON.parse(O),Q=!0}catch{S=O}}Q&&(n&&await n(S),o&&(S=await o(S))),t==null||t({data:S,event:W,id:h,retry:c}),A.length&&(yield S)}}}finally{R.removeEventListener("abort",V),g.releaseLock()}break}catch(T){if(r==null||r(T),d!==void 0&&C>=d)break;let I=Math.min(c*2**(C-1),a??3e4);await L(I)}}},"createStream")()}},"createSseClient");var ke=s(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorArrayExplode"),qe=s(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"separatorArrayNoExplode"),Ae=s(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorObjectExplode"),P=s(({allowReserved:e,explode:r,name:t,style:o,value:n})=>{if(!r){let a=(e?n:n.map(l=>encodeURIComponent(l))).join(qe(o));switch(o){case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;case"simple":return a;default:return`${t}=${a}`}}let p=ke(o),d=n.map(a=>o==="label"||o==="simple"?e?a:encodeURIComponent(a):w({allowReserved:e,name:t,value:a})).join(p);return o==="label"||o==="matrix"?p+d:d},"serializeArrayParam"),w=s(({allowReserved:e,name:r,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`${r}=${e?t:encodeURIComponent(t)}`},"serializePrimitiveParam"),B=s(({allowReserved:e,explode:r,name:t,style:o,value:n,valueOnly:p})=>{if(n instanceof Date)return p?n.toISOString():`${t}=${n.toISOString()}`;if(o!=="deepObject"&&!r){let l=[];Object.entries(n).forEach(([i,h])=>{l=[...l,i,e?h:encodeURIComponent(h)]});let u=l.join(",");switch(o){case"form":return`${t}=${u}`;case"label":return`.${u}`;case"matrix":return`;${t}=${u}`;default:return u}}let d=Ae(o),a=Object.entries(n).map(([l,u])=>w({allowReserved:e,name:o==="deepObject"?`${t}[${l}]`:l,value:u})).join(d);return o==="label"||o==="matrix"?d+a:a},"serializeObjectParam");var Pe=/\{[^{}]+\}/g,Be=s(({path:e,url:r})=>{let t=r,o=r.match(Pe);if(o)for(let n of o){let p=!1,d=n.substring(1,n.length-1),a="simple";d.endsWith("*")&&(p=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),a="label"):d.startsWith(";")&&(d=d.substring(1),a="matrix");let l=e[d];if(l==null)continue;if(Array.isArray(l)){t=t.replace(n,P({explode:p,name:d,style:a,value:l}));continue}if(typeof l=="object"){t=t.replace(n,B({explode:p,name:d,style:a,value:l,valueOnly:!0}));continue}if(a==="matrix"){t=t.replace(n,`;${w({name:d,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);t=t.replace(n,u)}return t},"defaultPathSerializer"),K=s(({baseUrl:e,path:r,query:t,querySerializer:o,url:n})=>{let p=n.startsWith("/")?n:`/${n}`,d=(e??"")+p;r&&(d=Be({path:r,url:d}));let a=t?o(t):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(d+=`?${a}`),d},"getUrl");function G(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}s(G,"getValidRequestBody");var X=s(async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t},"getAuthToken");var Y=s(({allowReserved:e,array:r,object:t}={})=>s(n=>{let p=[];if(n&&typeof n=="object")for(let d in n){let a=n[d];if(a!=null)if(Array.isArray(a)){let l=P({allowReserved:e,explode:!0,name:d,style:"form",value:a,...r});l&&p.push(l)}else if(typeof a=="object"){let l=B({allowReserved:e,explode:!0,name:d,style:"deepObject",value:a,...t});l&&p.push(l)}else{let l=w({allowReserved:e,name:d,value:a});l&&p.push(l)}}return p.join("&")},"querySerializer"),"createQuerySerializer"),Z=s(e=>{var t;if(!e)return"stream";let r=(t=e.split(";")[0])==null?void 0:t.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(o=>r.startsWith(o)))return"blob";if(r.startsWith("text/"))return"text"}},"getParseAs"),Fe=s((e,r)=>{var t,o;return r?!!(e.headers.has(r)||(t=e.query)!=null&&t[r]||(o=e.headers.get("Cookie"))!=null&&o.includes(`${r}=`)):!1},"checkForExistence"),ee=s(async({security:e,...r})=>{for(let t of e){if(Fe(r,t.name))continue;let o=await X(t,r.auth);if(!o)continue;let n=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[n]=o;break;case"cookie":r.headers.append("Cookie",`${n}=${o}`);break;case"header":default:r.headers.set(n,o);break}}},"setAuthParams"),v=s(e=>K({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Y(e.querySerializer),url:e.url}),"buildUrl"),U=s((e,r)=>{var o;let t={...e,...r};return(o=t.baseUrl)!=null&&o.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=F(e.headers,r.headers),t},"mergeConfigs"),ze=s(e=>{let r=[];return e.forEach((t,o)=>{r.push([o,t])}),r},"headersEntries"),F=s((...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let o=t instanceof Headers?ze(t):Object.entries(t);for(let[n,p]of o)if(p===null)r.delete(n);else if(Array.isArray(p))for(let d of p)r.append(n,d);else p!==void 0&&r.set(n,typeof p=="object"?JSON.stringify(p):p)}return r},"mergeHeaders"),$=class ${constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let o=this.getInterceptorIndex(r);return this.fns[o]?(this.fns[o]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}};s($,"Interceptors");var k=$,re=s(()=>({error:new k,request:new k,response:new k}),"createInterceptors"),je=Y({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ve={"Content-Type":"application/json"},x=s((e={})=>({...j,headers:ve,parseAs:"auto",querySerializer:je,...e}),"createConfig");var E=s((e={})=>{let r=U(x(),e),t=s(()=>({...r}),"getConfig"),o=s(u=>(r=U(r,u),t()),"setConfig"),n=re(),p=s(async u=>{let i={...r,...u,fetch:u.fetch??r.fetch??globalThis.fetch,headers:F(r.headers,u.headers),serializedBody:void 0};i.security&&await ee({...i,security:i.security}),i.requestValidator&&await i.requestValidator(i),i.body!==void 0&&i.bodySerializer&&(i.serializedBody=i.bodySerializer(i.body)),(i.body===void 0||i.serializedBody==="")&&i.headers.delete("Content-Type");let h=v(i);return{opts:i,url:h}},"beforeRequest"),d=s(async u=>{let{opts:i,url:h}=await p(u),L={redirect:"follow",...i,body:G(i)},b=new Request(h,L);for(let f of n.request.fns)f&&(b=await f(b,i));let q=i.fetch,c=await q(b);for(let f of n.response.fns)f&&(c=await f(c,b,i));let C={request:b,response:c};if(c.ok){let f=(i.parseAs==="auto"?Z(c.headers.get("Content-Type")):i.parseAs)??"json";if(c.status===204||c.headers.get("Content-Length")==="0"){let g;switch(f){case"arrayBuffer":case"blob":case"text":g=await c[f]();break;case"formData":g=new FormData;break;case"stream":g=c.body;break;case"json":default:g={};break}return i.responseStyle==="data"?g:{data:g,...C}}let m;switch(f){case"arrayBuffer":case"blob":case"formData":case"json":case"text":m=await c[f]();break;case"stream":return i.responseStyle==="data"?c.body:{data:c.body,...C}}return f==="json"&&(i.responseValidator&&await i.responseValidator(m),i.responseTransformer&&(m=await i.responseTransformer(m))),i.responseStyle==="data"?m:{data:m,...C}}let R=await c.text(),D;try{D=JSON.parse(R)}catch{}let T=D??R,I=T;for(let f of n.error.fns)f&&(I=await f(T,c,b,i));if(I=I||{},i.throwOnError)throw I;return i.responseStyle==="data"?void 0:{error:I,...C}},"request"),a=s(u=>i=>d({...i,method:u}),"makeMethodFn"),l=s(u=>async i=>{let{opts:h,url:L}=await p(i);return _({...h,body:h.body,headers:h.headers,method:u,onRequest:s(async(b,q)=>{let c=new Request(b,q);for(let C of n.request.fns)C&&(c=await C(c,h));return c},"onRequest"),url:L})},"makeSseFn");return{buildUrl:v,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:t,head:a("HEAD"),interceptors:n,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:d,setConfig:o,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:a("TRACE")}},"createClient");var y=E(x({baseUrl:"https://swish.app/api/2026-01"}));var te=s(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/lists",...e}),"listControllerFind"),se=s(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/lists",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerCreate"),oe=s(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e}),"listControllerDeleteById"),ne=s(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e}),"listControllerFindById"),ie=s(e=>(e.client??y).patch({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerUpdateById"),ae=s(e=>(e.client??y).put({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items/order",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerSetListItemsOrder"),le=s(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"listControllerAddItemsToList"),de=s(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/lists/{listId}/items/{itemId}",...e}),"listControllerRemoveItemFromList"),pe=s(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerDelete"),ce=s(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items",...e}),"itemControllerFind"),ue=s(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/items",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerCreate"),ye=s(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items/count",...e}),"itemControllerCount"),he=s(e=>(e.client??y).delete({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e}),"itemControllerDeleteById"),fe=s(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e}),"itemControllerFindById"),Ce=s(e=>(e.client??y).patch({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerUpdateById"),me=s(e=>(e.client??y).put({security:[{scheme:"bearer",type:"http"}],url:"/items/{itemId}/lists",...e,headers:{"Content-Type":"application/json",...e.headers}}),"itemControllerSetListsById"),Oe=s(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/profiles/accounts-version",...e}),"profileControllerCustomerAccountsVersion"),Ie=s(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/profiles/identify",...e,headers:{"Content-Type":"application/json",...e.headers}}),"profileControllerIdentify"),ge=s(e=>(e.client??y).post({security:[{scheme:"bearer",type:"http"}],url:"/profiles/token",...e,headers:{"Content-Type":"application/json",...e.headers}}),"profileControllerCreateToken");var be=s(e=>((e==null?void 0:e.client)??y).get({security:[{scheme:"bearer",type:"http"}],url:"/orders",...e}),"ordersControllerFind"),xe=s(e=>(e.client??y).get({security:[{scheme:"bearer",type:"http"}],url:"/orders/{orderId}",...e}),"ordersControllerFindOne");var $e="2026-01",Re="/apps/wishlist/api",Dr=s(e=>new N(e),"createApiClient"),H=class H{constructor(r){this.useProxy=!1;this.version=$e;this.items={list:s(r=>this.handlePaginatedRequest(ce({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),create:s(r=>this.handleRequest(ue({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"create"),delete:s(r=>this.handleRequest(pe({body:{itemIds:r},client:this.useProxy?this.proxyClient:this.directClient})),"delete"),findById:s(r=>this.handleRequest(fe({path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById"),updateById:s((r,t)=>this.handleRequest(Ce({body:t,path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"updateById"),deleteById:s(r=>this.handleRequest(he({path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"deleteById"),setListsById:s((r,t)=>this.handleRequest(me({body:{listIds:t},path:{itemId:r},client:this.useProxy?this.proxyClient:this.directClient})),"setListsById"),count:s(()=>this.handleRequest(ye({client:this.useProxy?this.proxyClient:this.directClient})),"count")};this.lists={list:s(r=>this.handlePaginatedRequest(te({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),create:s(r=>this.handleRequest(se({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"create"),findById:s(r=>this.handleRequest(ne({path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById"),updateById:s((r,t)=>this.handleRequest(ie({body:t,path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"updateById"),deleteById:s(r=>this.handleRequest(oe({path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"deleteById"),orderItems:s((r,t)=>this.handleRequest(ae({body:{itemIds:t},path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"orderItems"),addItemsToList:s((r,t)=>this.handleRequest(le({body:{itemIds:t},path:{listId:r},client:this.useProxy?this.proxyClient:this.directClient})),"addItemsToList"),removeItemFromList:s((r,t)=>this.handleRequest(de({path:{listId:r,itemId:t},client:this.useProxy?this.proxyClient:this.directClient})),"removeItemFromList")};this.profiles={customerAccountsVersion:s(()=>this.handleRequest(Oe({client:this.useProxy?this.proxyClient:this.directClient})),"customerAccountsVersion"),createToken:s((r={},t)=>this.handleRequest(ge({body:r,client:this.useProxy||t!=null&&t.useProxy?this.proxyClient:this.directClient})),"createToken"),identify:s(r=>this.handleRequest(Ie({body:r,client:this.useProxy?this.proxyClient:this.directClient})),"identify")};this.orders={list:s(r=>this.handlePaginatedRequest(be({query:r,client:this.useProxy?this.proxyClient:this.directClient})),"list"),findById:s(r=>this.handleRequest(xe({path:{orderId:r},client:this.useProxy?this.proxyClient:this.directClient})),"findById")};this.handleRequest=s(async r=>{let{data:t,error:o}=await r;return o!=null&&o.error?{error:o.error}:{data:t==null?void 0:t.data}},"handleRequest");this.handlePaginatedRequest=s(async r=>{var n;let{data:t,error:o}=await r;return o!=null&&o.error?{error:o.error}:{data:(t==null?void 0:t.data)??[],pageInfo:(t==null?void 0:t.pageInfo)??{next:null,previous:null,totalCount:((n=t==null?void 0:t.data)==null?void 0:n.length)??0}}},"handlePaginatedRequest");var t;this.profile=r.profile,(t=r.config)!=null&&t.version&&(this.version=r.config.version),this.directClient=E(x({baseUrl:`https://swish.app/api/${this.version}`})),this.proxyClient=E(x({baseUrl:Re})),r.authToken&&(this.authToken=r.authToken),r.config&&this.setConfig(r.config),r.requestInterceptor&&(this.proxyClient.interceptors.request.use(r.requestInterceptor),this.directClient.interceptors.request.use(r.requestInterceptor)),r.responseInterceptor&&(this.proxyClient.interceptors.response.use(r.responseInterceptor),this.directClient.interceptors.response.use(r.responseInterceptor)),this.proxyClient.interceptors.request.use(this.proxyRequestInterceptor.bind(this)),this.directClient.interceptors.request.use(this.directRequestInterceptor.bind(this))}setProfile(r){this.profile=r}getProfile(){return this.profile}setAuthToken(r){this.authToken=r}setConfig({proxyBaseUrl:r=Re,baseUrl:t,useProxy:o=!1,...n}){this.useProxy=o,this.proxyClient.setConfig({...n,baseUrl:r}),this.directClient.setConfig({...n})}proxyRequestInterceptor(r){return this.profile&&(r.headers.set("Profile",this.profile),r.headers.set("Swish-Api-Version",this.version)),r}directRequestInterceptor(r){return this.authToken&&r.headers.set("Authorization",`Bearer ${this.authToken}`),r}};s(H,"SwishClient");var N=H;export{Dr as createApiClient,$e as defaultApiVersion,Re as defaultProxyBaseUrl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, Options as Options2, TDataShape } from './client';
|
|
2
|
-
import type { AnalyticsControllerLoadNewListsData, AnalyticsControllerLoadNewListsErrors, AnalyticsControllerLoadNewListsResponses, AnalyticsControllerLoadSavedItemsData, AnalyticsControllerLoadSavedItemsErrors, AnalyticsControllerLoadSavedItemsResponses, AnalyticsControllerLoadSessionsData, AnalyticsControllerLoadSessionsErrors, AnalyticsControllerLoadSessionsResponses, ItemControllerCountData, ItemControllerCountErrors, ItemControllerCountResponses, ItemControllerCreateData, ItemControllerCreateErrors, ItemControllerCreateResponses, ItemControllerDeleteByIdData, ItemControllerDeleteByIdErrors, ItemControllerDeleteByIdResponses, ItemControllerDeleteData, ItemControllerDeleteErrors, ItemControllerDeleteResponses, ItemControllerFindByIdData, ItemControllerFindByIdErrors, ItemControllerFindByIdResponses, ItemControllerFindData, ItemControllerFindErrors, ItemControllerFindResponses, ItemControllerSetListsByIdData, ItemControllerSetListsByIdErrors, ItemControllerSetListsByIdResponses, ItemControllerUpdateByIdData, ItemControllerUpdateByIdErrors, ItemControllerUpdateByIdResponses, ListControllerAddItemsToListData, ListControllerAddItemsToListErrors, ListControllerAddItemsToListResponses, ListControllerCreateData, ListControllerCreateErrors, ListControllerCreateResponses, ListControllerDeleteByIdData, ListControllerDeleteByIdErrors, ListControllerDeleteByIdResponses, ListControllerFindByIdData, ListControllerFindByIdErrors, ListControllerFindByIdResponses, ListControllerFindData, ListControllerFindErrors, ListControllerFindResponses, ListControllerRemoveItemFromListData, ListControllerRemoveItemFromListErrors, ListControllerRemoveItemFromListResponses, ListControllerSetListItemsOrderData, ListControllerSetListItemsOrderErrors, ListControllerSetListItemsOrderResponses, ListControllerUpdateByIdData, ListControllerUpdateByIdErrors, ListControllerUpdateByIdResponses, OrdersControllerFindData, OrdersControllerFindErrors, OrdersControllerFindOneData, OrdersControllerFindOneErrors, OrdersControllerFindOneResponses, OrdersControllerFindResponses, ProfileControllerCreateTokenData, ProfileControllerCreateTokenErrors, ProfileControllerCreateTokenResponses, ProfileControllerCustomerAccountsVersionData, ProfileControllerCustomerAccountsVersionErrors, ProfileControllerCustomerAccountsVersionResponses, ProfileControllerIdentifyData, ProfileControllerIdentifyErrors, ProfileControllerIdentifyResponses, TrackingControllerTrackData, TrackingControllerTrackErrors, TrackingControllerTrackResponses } from './types.gen';
|
|
2
|
+
import type { AnalyticsControllerLoadNewListsData, AnalyticsControllerLoadNewListsErrors, AnalyticsControllerLoadNewListsResponses, AnalyticsControllerLoadSavedItemsData, AnalyticsControllerLoadSavedItemsErrors, AnalyticsControllerLoadSavedItemsResponses, AnalyticsControllerLoadSessionsData, AnalyticsControllerLoadSessionsErrors, AnalyticsControllerLoadSessionsResponses, ItemControllerCountData, ItemControllerCountErrors, ItemControllerCountResponses, ItemControllerCreateData, ItemControllerCreateErrors, ItemControllerCreateResponses, ItemControllerDeleteByIdData, ItemControllerDeleteByIdErrors, ItemControllerDeleteByIdResponses, ItemControllerDeleteData, ItemControllerDeleteErrors, ItemControllerDeleteResponses, ItemControllerFindByIdData, ItemControllerFindByIdErrors, ItemControllerFindByIdResponses, ItemControllerFindData, ItemControllerFindErrors, ItemControllerFindResponses, ItemControllerSetListsByIdData, ItemControllerSetListsByIdErrors, ItemControllerSetListsByIdResponses, ItemControllerUpdateByIdData, ItemControllerUpdateByIdErrors, ItemControllerUpdateByIdResponses, ListControllerAddItemsToListData, ListControllerAddItemsToListErrors, ListControllerAddItemsToListResponses, ListControllerCreateData, ListControllerCreateErrors, ListControllerCreateResponses, ListControllerDeleteByIdData, ListControllerDeleteByIdErrors, ListControllerDeleteByIdResponses, ListControllerFindByIdData, ListControllerFindByIdErrors, ListControllerFindByIdResponses, ListControllerFindData, ListControllerFindErrors, ListControllerFindResponses, ListControllerRemoveItemFromListData, ListControllerRemoveItemFromListErrors, ListControllerRemoveItemFromListResponses, ListControllerSetListItemsOrderData, ListControllerSetListItemsOrderErrors, ListControllerSetListItemsOrderResponses, ListControllerUpdateByIdData, ListControllerUpdateByIdErrors, ListControllerUpdateByIdResponses, OrdersControllerFindData, OrdersControllerFindErrors, OrdersControllerFindOneData, OrdersControllerFindOneErrors, OrdersControllerFindOneResponses, OrdersControllerFindResponses, ProfileControllerCreateTokenData, ProfileControllerCreateTokenErrors, ProfileControllerCreateTokenResponses, ProfileControllerCustomerAccountsVersionData, ProfileControllerCustomerAccountsVersionErrors, ProfileControllerCustomerAccountsVersionResponses, ProfileControllerIdentifyData, ProfileControllerIdentifyErrors, ProfileControllerIdentifyResponses, SharedListsControllerDeleteByIdData, SharedListsControllerDeleteByIdErrors, SharedListsControllerDeleteByIdResponses, SharedListsControllerFindAllData, SharedListsControllerFindAllErrors, SharedListsControllerFindAllResponses, SharedListsControllerFindByIdData, SharedListsControllerFindByIdErrors, SharedListsControllerFindByIdResponses, SharedListsControllerSaveData, SharedListsControllerSaveErrors, SharedListsControllerSaveResponses, TrackingControllerTrackData, TrackingControllerTrackErrors, TrackingControllerTrackResponses } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -42,3 +42,7 @@ export declare const analyticsControllerLoadNewLists: <ThrowOnError extends bool
|
|
|
42
42
|
export declare const trackingControllerTrack: <ThrowOnError extends boolean = false>(options: Options<TrackingControllerTrackData, ThrowOnError>) => import("./client").RequestResult<TrackingControllerTrackResponses, TrackingControllerTrackErrors, ThrowOnError, "fields">;
|
|
43
43
|
export declare const ordersControllerFind: <ThrowOnError extends boolean = false>(options?: Options<OrdersControllerFindData, ThrowOnError>) => import("./client").RequestResult<OrdersControllerFindResponses, OrdersControllerFindErrors, ThrowOnError, "fields">;
|
|
44
44
|
export declare const ordersControllerFindOne: <ThrowOnError extends boolean = false>(options: Options<OrdersControllerFindOneData, ThrowOnError>) => import("./client").RequestResult<OrdersControllerFindOneResponses, OrdersControllerFindOneErrors, ThrowOnError, "fields">;
|
|
45
|
+
export declare const sharedListsControllerSave: <ThrowOnError extends boolean = false>(options: Options<SharedListsControllerSaveData, ThrowOnError>) => import("./client").RequestResult<SharedListsControllerSaveResponses, SharedListsControllerSaveErrors, ThrowOnError, "fields">;
|
|
46
|
+
export declare const sharedListsControllerDeleteById: <ThrowOnError extends boolean = false>(options: Options<SharedListsControllerDeleteByIdData, ThrowOnError>) => import("./client").RequestResult<SharedListsControllerDeleteByIdResponses, SharedListsControllerDeleteByIdErrors, ThrowOnError, "fields">;
|
|
47
|
+
export declare const sharedListsControllerFindById: <ThrowOnError extends boolean = false>(options: Options<SharedListsControllerFindByIdData, ThrowOnError>) => import("./client").RequestResult<SharedListsControllerFindByIdResponses, SharedListsControllerFindByIdErrors, ThrowOnError, "fields">;
|
|
48
|
+
export declare const sharedListsControllerFindAll: <ThrowOnError extends boolean = false>(options?: Options<SharedListsControllerFindAllData, ThrowOnError>) => import("./client").RequestResult<SharedListsControllerFindAllResponses, SharedListsControllerFindAllErrors, ThrowOnError, "fields">;
|
|
@@ -309,6 +309,10 @@ export type TrackingEventRequestDto = {
|
|
|
309
309
|
[key: string]: unknown;
|
|
310
310
|
};
|
|
311
311
|
export type ProductVariantDto = {
|
|
312
|
+
/**
|
|
313
|
+
* The product variant’s ID
|
|
314
|
+
*/
|
|
315
|
+
id: string;
|
|
312
316
|
/**
|
|
313
317
|
* The product variant’s title
|
|
314
318
|
*/
|
|
@@ -418,6 +422,36 @@ export type OrderDto = {
|
|
|
418
422
|
*/
|
|
419
423
|
previewImages?: Array<PreviewImageDto>;
|
|
420
424
|
};
|
|
425
|
+
export type SharedList = {
|
|
426
|
+
/**
|
|
427
|
+
* The ID of the shared list entry
|
|
428
|
+
*/
|
|
429
|
+
id: string;
|
|
430
|
+
/**
|
|
431
|
+
* The ID of the list that was saved
|
|
432
|
+
*/
|
|
433
|
+
listId: string;
|
|
434
|
+
/**
|
|
435
|
+
* The name of the list
|
|
436
|
+
*/
|
|
437
|
+
name: string;
|
|
438
|
+
/**
|
|
439
|
+
* The number of items in the list
|
|
440
|
+
*/
|
|
441
|
+
itemCount: number;
|
|
442
|
+
/**
|
|
443
|
+
* Array of preview image objects for the first 4 items in the list
|
|
444
|
+
*/
|
|
445
|
+
previewImages: Array<PreviewImageDto>;
|
|
446
|
+
/**
|
|
447
|
+
* The date and time the shared list was created
|
|
448
|
+
*/
|
|
449
|
+
createdAt: string;
|
|
450
|
+
/**
|
|
451
|
+
* The date and time the shared list was last updated
|
|
452
|
+
*/
|
|
453
|
+
updatedAt: string;
|
|
454
|
+
};
|
|
421
455
|
export type ListControllerFindData = {
|
|
422
456
|
body?: never;
|
|
423
457
|
path?: never;
|
|
@@ -1916,3 +1950,241 @@ export type OrdersControllerFindOneResponses = {
|
|
|
1916
1950
|
};
|
|
1917
1951
|
};
|
|
1918
1952
|
export type OrdersControllerFindOneResponse = OrdersControllerFindOneResponses[keyof OrdersControllerFindOneResponses];
|
|
1953
|
+
export type SharedListsControllerSaveData = {
|
|
1954
|
+
body?: never;
|
|
1955
|
+
path: {
|
|
1956
|
+
/**
|
|
1957
|
+
* The ID of the list to save as shared
|
|
1958
|
+
*/
|
|
1959
|
+
listId: string;
|
|
1960
|
+
};
|
|
1961
|
+
query?: never;
|
|
1962
|
+
url: '/shared-lists/{listId}/save';
|
|
1963
|
+
};
|
|
1964
|
+
export type SharedListsControllerSaveErrors = {
|
|
1965
|
+
/**
|
|
1966
|
+
* Bad Request
|
|
1967
|
+
*/
|
|
1968
|
+
400: ErrorResponse & {
|
|
1969
|
+
error?: {
|
|
1970
|
+
statusCode?: number;
|
|
1971
|
+
error?: string;
|
|
1972
|
+
};
|
|
1973
|
+
};
|
|
1974
|
+
/**
|
|
1975
|
+
* Unauthorized
|
|
1976
|
+
*/
|
|
1977
|
+
401: ErrorResponse & {
|
|
1978
|
+
error?: {
|
|
1979
|
+
statusCode?: number;
|
|
1980
|
+
error?: string;
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
/**
|
|
1984
|
+
* Forbidden
|
|
1985
|
+
*/
|
|
1986
|
+
403: ErrorResponse & {
|
|
1987
|
+
error?: {
|
|
1988
|
+
statusCode?: number;
|
|
1989
|
+
error?: string;
|
|
1990
|
+
};
|
|
1991
|
+
};
|
|
1992
|
+
/**
|
|
1993
|
+
* Not Found
|
|
1994
|
+
*/
|
|
1995
|
+
404: ErrorResponse & {
|
|
1996
|
+
error?: {
|
|
1997
|
+
statusCode?: number;
|
|
1998
|
+
error?: string;
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
export type SharedListsControllerSaveError = SharedListsControllerSaveErrors[keyof SharedListsControllerSaveErrors];
|
|
2003
|
+
export type SharedListsControllerSaveResponses = {
|
|
2004
|
+
/**
|
|
2005
|
+
* The shared list has been successfully saved.
|
|
2006
|
+
*/
|
|
2007
|
+
201: Response & {
|
|
2008
|
+
data?: SharedList;
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
export type SharedListsControllerSaveResponse = SharedListsControllerSaveResponses[keyof SharedListsControllerSaveResponses];
|
|
2012
|
+
export type SharedListsControllerDeleteByIdData = {
|
|
2013
|
+
body?: never;
|
|
2014
|
+
path: {
|
|
2015
|
+
/**
|
|
2016
|
+
* The ID of the list to save as shared
|
|
2017
|
+
*/
|
|
2018
|
+
listId: string;
|
|
2019
|
+
};
|
|
2020
|
+
query?: never;
|
|
2021
|
+
url: '/shared-lists/{listId}';
|
|
2022
|
+
};
|
|
2023
|
+
export type SharedListsControllerDeleteByIdErrors = {
|
|
2024
|
+
/**
|
|
2025
|
+
* Bad Request
|
|
2026
|
+
*/
|
|
2027
|
+
400: ErrorResponse & {
|
|
2028
|
+
error?: {
|
|
2029
|
+
statusCode?: number;
|
|
2030
|
+
error?: string;
|
|
2031
|
+
};
|
|
2032
|
+
};
|
|
2033
|
+
/**
|
|
2034
|
+
* Unauthorized
|
|
2035
|
+
*/
|
|
2036
|
+
401: ErrorResponse & {
|
|
2037
|
+
error?: {
|
|
2038
|
+
statusCode?: number;
|
|
2039
|
+
error?: string;
|
|
2040
|
+
};
|
|
2041
|
+
};
|
|
2042
|
+
/**
|
|
2043
|
+
* Forbidden
|
|
2044
|
+
*/
|
|
2045
|
+
403: ErrorResponse & {
|
|
2046
|
+
error?: {
|
|
2047
|
+
statusCode?: number;
|
|
2048
|
+
error?: string;
|
|
2049
|
+
};
|
|
2050
|
+
};
|
|
2051
|
+
/**
|
|
2052
|
+
* Not Found
|
|
2053
|
+
*/
|
|
2054
|
+
404: ErrorResponse & {
|
|
2055
|
+
error?: {
|
|
2056
|
+
statusCode?: number;
|
|
2057
|
+
error?: string;
|
|
2058
|
+
};
|
|
2059
|
+
};
|
|
2060
|
+
};
|
|
2061
|
+
export type SharedListsControllerDeleteByIdError = SharedListsControllerDeleteByIdErrors[keyof SharedListsControllerDeleteByIdErrors];
|
|
2062
|
+
export type SharedListsControllerDeleteByIdResponses = {
|
|
2063
|
+
/**
|
|
2064
|
+
* The shared list has been successfully deleted.
|
|
2065
|
+
*/
|
|
2066
|
+
204: void;
|
|
2067
|
+
};
|
|
2068
|
+
export type SharedListsControllerDeleteByIdResponse = SharedListsControllerDeleteByIdResponses[keyof SharedListsControllerDeleteByIdResponses];
|
|
2069
|
+
export type SharedListsControllerFindByIdData = {
|
|
2070
|
+
body?: never;
|
|
2071
|
+
path: {
|
|
2072
|
+
/**
|
|
2073
|
+
* The ID of the list to save as shared
|
|
2074
|
+
*/
|
|
2075
|
+
listId: string;
|
|
2076
|
+
};
|
|
2077
|
+
query?: never;
|
|
2078
|
+
url: '/shared-lists/{listId}';
|
|
2079
|
+
};
|
|
2080
|
+
export type SharedListsControllerFindByIdErrors = {
|
|
2081
|
+
/**
|
|
2082
|
+
* Bad Request
|
|
2083
|
+
*/
|
|
2084
|
+
400: ErrorResponse & {
|
|
2085
|
+
error?: {
|
|
2086
|
+
statusCode?: number;
|
|
2087
|
+
error?: string;
|
|
2088
|
+
};
|
|
2089
|
+
};
|
|
2090
|
+
/**
|
|
2091
|
+
* Unauthorized
|
|
2092
|
+
*/
|
|
2093
|
+
401: ErrorResponse & {
|
|
2094
|
+
error?: {
|
|
2095
|
+
statusCode?: number;
|
|
2096
|
+
error?: string;
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
/**
|
|
2100
|
+
* Forbidden
|
|
2101
|
+
*/
|
|
2102
|
+
403: ErrorResponse & {
|
|
2103
|
+
error?: {
|
|
2104
|
+
statusCode?: number;
|
|
2105
|
+
error?: string;
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
2108
|
+
/**
|
|
2109
|
+
* Not Found
|
|
2110
|
+
*/
|
|
2111
|
+
404: ErrorResponse & {
|
|
2112
|
+
error?: {
|
|
2113
|
+
statusCode?: number;
|
|
2114
|
+
error?: string;
|
|
2115
|
+
};
|
|
2116
|
+
};
|
|
2117
|
+
};
|
|
2118
|
+
export type SharedListsControllerFindByIdError = SharedListsControllerFindByIdErrors[keyof SharedListsControllerFindByIdErrors];
|
|
2119
|
+
export type SharedListsControllerFindByIdResponses = {
|
|
2120
|
+
/**
|
|
2121
|
+
* Returns the shared list entry.
|
|
2122
|
+
*/
|
|
2123
|
+
200: Response & {
|
|
2124
|
+
data?: SharedList;
|
|
2125
|
+
};
|
|
2126
|
+
};
|
|
2127
|
+
export type SharedListsControllerFindByIdResponse = SharedListsControllerFindByIdResponses[keyof SharedListsControllerFindByIdResponses];
|
|
2128
|
+
export type SharedListsControllerFindAllData = {
|
|
2129
|
+
body?: never;
|
|
2130
|
+
path?: never;
|
|
2131
|
+
query?: {
|
|
2132
|
+
/**
|
|
2133
|
+
* The page cursor
|
|
2134
|
+
*/
|
|
2135
|
+
page?: string;
|
|
2136
|
+
/**
|
|
2137
|
+
* Number of lists/items to return
|
|
2138
|
+
*/
|
|
2139
|
+
limit?: number;
|
|
2140
|
+
};
|
|
2141
|
+
url: '/shared-lists';
|
|
2142
|
+
};
|
|
2143
|
+
export type SharedListsControllerFindAllErrors = {
|
|
2144
|
+
/**
|
|
2145
|
+
* Bad Request
|
|
2146
|
+
*/
|
|
2147
|
+
400: ErrorResponse & {
|
|
2148
|
+
error?: {
|
|
2149
|
+
statusCode?: number;
|
|
2150
|
+
error?: string;
|
|
2151
|
+
};
|
|
2152
|
+
};
|
|
2153
|
+
/**
|
|
2154
|
+
* Unauthorized
|
|
2155
|
+
*/
|
|
2156
|
+
401: ErrorResponse & {
|
|
2157
|
+
error?: {
|
|
2158
|
+
statusCode?: number;
|
|
2159
|
+
error?: string;
|
|
2160
|
+
};
|
|
2161
|
+
};
|
|
2162
|
+
/**
|
|
2163
|
+
* Forbidden
|
|
2164
|
+
*/
|
|
2165
|
+
403: ErrorResponse & {
|
|
2166
|
+
error?: {
|
|
2167
|
+
statusCode?: number;
|
|
2168
|
+
error?: string;
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
/**
|
|
2172
|
+
* Not Found
|
|
2173
|
+
*/
|
|
2174
|
+
404: ErrorResponse & {
|
|
2175
|
+
error?: {
|
|
2176
|
+
statusCode?: number;
|
|
2177
|
+
error?: string;
|
|
2178
|
+
};
|
|
2179
|
+
};
|
|
2180
|
+
};
|
|
2181
|
+
export type SharedListsControllerFindAllError = SharedListsControllerFindAllErrors[keyof SharedListsControllerFindAllErrors];
|
|
2182
|
+
export type SharedListsControllerFindAllResponses = {
|
|
2183
|
+
/**
|
|
2184
|
+
* Returns all shared lists as paginated response
|
|
2185
|
+
*/
|
|
2186
|
+
200: PaginatedResponse & {
|
|
2187
|
+
data?: Array<SharedList>;
|
|
2188
|
+
};
|
|
2189
|
+
};
|
|
2190
|
+
export type SharedListsControllerFindAllResponse = SharedListsControllerFindAllResponses[keyof SharedListsControllerFindAllResponses];
|