@swishapp/api-client 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/openapi/sdk.gen.d.ts +13 -2
- package/dist/openapi/types.gen.d.ts +227 -1
- package/dist/types.d.ts +10 -0
- package/package.json +2 -1
package/dist/client.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare class SwishClient {
|
|
|
18
18
|
findById: (itemId: string) => Promise<ApiResponse<types.ItemDetail>>;
|
|
19
19
|
updateById: (itemId: string, body: types.UpdateItemInput) => Promise<ApiResponse<types.Item>>;
|
|
20
20
|
deleteById: (itemId: string) => Promise<ApiResponse<unknown>>;
|
|
21
|
+
setListsById: (itemId: string, listIds: types.SetItemListsInput["listIds"]) => Promise<ApiResponse<types.ItemDetail>>;
|
|
21
22
|
};
|
|
22
23
|
readonly lists: {
|
|
23
24
|
list: (query?: types.ListControllerFindData["query"]) => Promise<ApiResponse<types.List[]>>;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var o=(e,r)=>Q(e,"name",{value:r,configurable:!0});var K=o(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},"A");var M={bodySerializer:o(e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t),"bodySerializer")};var X=o(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"U"),Y=o(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"_"),Z=o(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"D"),B=o(({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(!r){let l=(e?i:i.map(d=>encodeURIComponent(d))).join(Y(s));switch(s){case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;case"simple":return l;default:return`${t}=${l}`}}let a=X(s),n=i.map(l=>s==="label"||s==="simple"?e?l:encodeURIComponent(l):w({allowReserved:e,name:t,value:l})).join(a);return s==="label"||s==="matrix"?a+n:n},"O"),w=o(({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)}`},"y"),L=o(({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(i instanceof Date)return`${t}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let l=[];Object.entries(i).forEach(([C,h])=>{l=[...l,C,e?h:encodeURIComponent(h)]});let d=l.join(",");switch(s){case"form":return`${t}=${d}`;case"label":return`.${d}`;case"matrix":return`;${t}=${d}`;default:return d}}let a=Z(s),n=Object.entries(i).map(([l,d])=>w({allowReserved:e,name:s==="deepObject"?`${t}[${l}]`:l,value:d})).join(a);return s==="label"||s==="matrix"?a+n:n},"q"),ee=/\{[^{}]+\}/g,re=o(({path:e,url:r})=>{let t=r,s=r.match(ee);if(s)for(let i of s){let a=!1,n=i.substring(1,i.length-1),l="simple";n.endsWith("*")&&(a=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),l="label"):n.startsWith(";")&&(n=n.substring(1),l="matrix");let d=e[n];if(d==null)continue;if(Array.isArray(d)){t=t.replace(i,B({explode:a,name:n,style:l,value:d}));continue}if(typeof d=="object"){t=t.replace(i,L({explode:a,name:n,style:l,value:d}));continue}if(l==="matrix"){t=t.replace(i,`;${w({name:n,value:d})}`);continue}let C=encodeURIComponent(l==="label"?`.${d}`:d);t=t.replace(i,C)}return t},"B"),S=o(({allowReserved:e,array:r,object:t}={})=>s=>{let i=[];if(s&&typeof s=="object")for(let a in s){let n=s[a];if(n!=null){if(Array.isArray(n)){i=[...i,B({allowReserved:e,explode:!0,name:a,style:"form",value:n,...r})];continue}if(typeof n=="object"){i=[...i,L({allowReserved:e,explode:!0,name:a,style:"deepObject",value:n,...t})];continue}i=[...i,w({allowReserved:e,name:a,value:n})]}}return i.join("&")},"E"),te=o(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(s=>r.startsWith(s)))return"blob";if(r.startsWith("text/"))return"text"}},"P"),oe=o(async({security:e,...r})=>{for(let t of e){let s=await K(t,r.auth);if(!s)continue;let i=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[i]=s;break;case"header":default:r.headers.set(i,s);break}return}},"I"),g=o(e=>ne({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:S(e.querySerializer),url:e.url}),"S"),ne=o(({baseUrl:e,path:r,query:t,querySerializer:s,url:i})=>{let a=i.startsWith("/")?i:`/${i}`,n=(e??"")+a;r&&(n=re({path:r,url:n}));let l=t?s(t):"";return l.startsWith("?")&&(l=l.substring(1)),l&&(n+=`?${l}`),n},"W"),x=o((e,r)=>{var s;let t={...e,...r};return(s=t.baseUrl)!=null&&s.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=q(e.headers,r.headers),t},"C"),q=o((...e)=>{let r=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[i,a]of s)if(a===null)r.delete(i);else if(Array.isArray(a))for(let n of a)r.append(i,n);else a!==void 0&&r.set(i,typeof a=="object"?JSON.stringify(a):a)}return r},"x"),f,b=(f=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let t=this._fns.indexOf(r);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(r){this._fns=[...this._fns,r]}},o(f,"m"),f),le=o(()=>({error:new b,request:new b,response:new b}),"T"),se=S({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ie={"Content-Type":"application/json"},m=o((e={})=>({...M,headers:ie,parseAs:"auto",querySerializer:se,...e}),"w"),E=o((e={})=>{let r=x(m(),e),t=o(()=>({...r}),"e"),s=o(n=>(r=x(r,n),t()),"a"),i=le(),a=o(async n=>{let l={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:q(r.headers,n.headers)};l.security&&await oe({...l,security:l.security}),l.body&&l.bodySerializer&&(l.body=l.bodySerializer(l.body)),(l.body===void 0||l.body==="")&&l.headers.delete("Content-Type");let d=g(l),C={redirect:"follow",...l},h=new Request(d,C);for(let c of i.request._fns)h=await c(h,l);let G=l.fetch,u=await G(h);for(let c of i.response._fns)u=await c(u,h,l);let I={request:h,response:u};if(u.ok){if(u.status===204||u.headers.get("Content-Length")==="0")return{data:{},...I};let c=(l.parseAs==="auto"?te(u.headers.get("Content-Type")):l.parseAs)??"json";if(c==="stream")return{data:u.body,...I};let T=await u[c]();return c==="json"&&(l.responseValidator&&await l.responseValidator(T),l.responseTransformer&&(T=await l.responseTransformer(T))),{data:T,...I}}let O=await u.text();try{O=JSON.parse(O)}catch{}let y=O;for(let c of i.error._fns)y=await c(O,u,h,l);if(y=y||{},l.throwOnError)throw y;return{error:y,...I}},"o");return{buildUrl:g,connect:o(n=>a({...n,method:"CONNECT"}),"connect"),delete:o(n=>a({...n,method:"DELETE"}),"delete"),get:o(n=>a({...n,method:"GET"}),"get"),getConfig:t,head:o(n=>a({...n,method:"HEAD"}),"head"),interceptors:i,options:o(n=>a({...n,method:"OPTIONS"}),"options"),patch:o(n=>a({...n,method:"PATCH"}),"patch"),post:o(n=>a({...n,method:"POST"}),"post"),put:o(n=>a({...n,method:"PUT"}),"put"),request:a,setConfig:s,trace:o(n=>a({...n,method:"TRACE"}),"trace")}},"J");var p=E(m({baseUrl:"https://swish.app/api/2025-04"}));var k=o(e=>((e==null?void 0:e.client)??p).get({url:"/lists",...e}),"listControllerFind"),j=o(e=>(e.client??p).post({url:"/lists",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerCreate"),A=o(e=>(e.client??p).delete({url:"/lists/{listId}",...e}),"listControllerDeleteById"),F=o(e=>(e.client??p).get({url:"/lists/{listId}",...e}),"listControllerFindById"),U=o(e=>(e.client??p).patch({url:"/lists/{listId}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerUpdateById"),v=o(e=>(e.client??p).put({url:"/lists/{listId}/items/order",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerSetListItemsOrder"),P=o(e=>(e.client??p).delete({url:"/items",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerDelete"),$=o(e=>((e==null?void 0:e.client)??p).get({url:"/items",...e}),"itemControllerFind"),z=o(e=>(e.client??p).post({url:"/items",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerCreate"),_=o(e=>(e.client??p).delete({url:"/items/{itemId}",...e}),"itemControllerDeleteById"),V=o(e=>(e.client??p).get({url:"/items/{itemId}",...e}),"itemControllerFindById"),W=o(e=>(e.client??p).patch({url:"/items/{itemId}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerUpdateById");var N=o(e=>((e==null?void 0:e.client)??p).get({url:"/profiles/accounts-version",...e}),"profileControllerCustomerAccountsVersion"),J=o(e=>(e.client??p).post({url:"/profiles/identify",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"profileControllerIdentify"),H=o(e=>(e.client??p).post({url:"/profiles/token",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"profileControllerCreateToken");var Te=o(e=>new D(e),"createApiClient"),R=class R{constructor(r){this.client=E(m({baseUrl:"https://swish.app/api/2025-04"}));this.items={list:o(r=>this.handleRequest($({query:r,client:this.client})),"list"),create:o(r=>this.handleRequest(z({body:r,client:this.client})),"create"),delete:o(r=>this.handleRequest(P({body:{itemIds:r},client:this.client})),"delete"),findById:o(r=>this.handleRequest(V({path:{itemId:r},client:this.client})),"findById"),updateById:o((r,t)=>this.handleRequest(W({body:t,path:{itemId:r},client:this.client})),"updateById"),deleteById:o(r=>this.handleRequest(_({path:{itemId:r},client:this.client})),"deleteById")};this.lists={list:o(r=>this.handleRequest(k({query:r,client:this.client})),"list"),create:o(r=>this.handleRequest(j({body:r,client:this.client})),"create"),findById:o((r,t)=>this.handleRequest(F({path:{listId:r},query:t??{sort:"recently_saved"},client:this.client})),"findById"),updateById:o((r,t)=>this.handleRequest(U({body:t,path:{listId:r},client:this.client})),"updateById"),deleteById:o(r=>this.handleRequest(A({path:{listId:r},client:this.client})),"deleteById"),orderItems:o((r,t)=>this.handleRequest(v({body:{itemIds:t},path:{listId:r},client:this.client})),"orderItems")};this.profiles={customerAccountsVersion:o(()=>this.handleRequest(N({client:this.client})),"customerAccountsVersion"),createToken:o((r={})=>this.handleRequest(H({body:r,client:this.client})),"createToken"),identify:o(r=>this.handleRequest(J({body:r,client:this.client})),"identify")};this.handleRequest=o(async r=>{let{data:t,error:s}=await r;if(s!=null&&s.error)return{data:null,error:s==null?void 0:s.error};if(t!=null&&t.data){let i={data:t.data,error:null};return t.pageInfo&&(i.pageInfo=t.pageInfo),i}return{data:null,error:null}},"handleRequest");this.profile=r.profile,r.authToken&&(this.authToken=r.authToken),r.config&&this.client.setConfig(r.config),this.client.interceptors.request.use(this.requestInterceptor.bind(this)),r.requestInterceptor&&this.client.interceptors.request.use(r.requestInterceptor),r.responseInterceptor&&this.client.interceptors.response.use(r.responseInterceptor)}setProfile(r){this.profile=r}setAuthToken(r){this.authToken=r}setConfig(r){this.client.setConfig(r)}requestInterceptor(r){return this.authToken&&r.headers.set("Authorization",`Bearer ${this.authToken}`),this.profile&&r.headers.set("Profile",this.profile),r}};o(R,"SwishClient");var D=R;export{Te as createApiClient};
|
|
1
|
+
var K=Object.defineProperty;var o=(e,r)=>K(e,"name",{value:r,configurable:!0});var M=o(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},"A");var X={bodySerializer:o(e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t),"bodySerializer")};var Y=o(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"U"),Z=o(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"_"),ee=o(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"D"),g=o(({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(!r){let l=(e?i:i.map(d=>encodeURIComponent(d))).join(Z(s));switch(s){case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;case"simple":return l;default:return`${t}=${l}`}}let a=Y(s),n=i.map(l=>s==="label"||s==="simple"?e?l:encodeURIComponent(l):E({allowReserved:e,name:t,value:l})).join(a);return s==="label"||s==="matrix"?a+n:n},"O"),E=o(({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)}`},"y"),B=o(({allowReserved:e,explode:r,name:t,style:s,value:i})=>{if(i instanceof Date)return`${t}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let l=[];Object.entries(i).forEach(([y,u])=>{l=[...l,y,e?u:encodeURIComponent(u)]});let d=l.join(",");switch(s){case"form":return`${t}=${d}`;case"label":return`.${d}`;case"matrix":return`;${t}=${d}`;default:return d}}let a=ee(s),n=Object.entries(i).map(([l,d])=>E({allowReserved:e,name:s==="deepObject"?`${t}[${l}]`:l,value:d})).join(a);return s==="label"||s==="matrix"?a+n:n},"q"),re=/\{[^{}]+\}/g,te=o(({path:e,url:r})=>{let t=r,s=r.match(re);if(s)for(let i of s){let a=!1,n=i.substring(1,i.length-1),l="simple";n.endsWith("*")&&(a=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(n=n.substring(1),l="label"):n.startsWith(";")&&(n=n.substring(1),l="matrix");let d=e[n];if(d==null)continue;if(Array.isArray(d)){t=t.replace(i,g({explode:a,name:n,style:l,value:d}));continue}if(typeof d=="object"){t=t.replace(i,B({explode:a,name:n,style:l,value:d}));continue}if(l==="matrix"){t=t.replace(i,`;${E({name:n,value:d})}`);continue}let y=encodeURIComponent(l==="label"?`.${d}`:d);t=t.replace(i,y)}return t},"B"),S=o(({allowReserved:e,array:r,object:t}={})=>s=>{let i=[];if(s&&typeof s=="object")for(let a in s){let n=s[a];if(n!=null){if(Array.isArray(n)){i=[...i,g({allowReserved:e,explode:!0,name:a,style:"form",value:n,...r})];continue}if(typeof n=="object"){i=[...i,B({allowReserved:e,explode:!0,name:a,style:"deepObject",value:n,...t})];continue}i=[...i,E({allowReserved:e,name:a,value:n})]}}return i.join("&")},"E"),oe=o(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(s=>r.startsWith(s)))return"blob";if(r.startsWith("text/"))return"text"}},"P"),ne=o(async({security:e,...r})=>{for(let t of e){let s=await M(t,r.auth);if(!s)continue;let i=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[i]=s;break;case"header":default:r.headers.set(i,s);break}return}},"I"),R=o(e=>le({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:S(e.querySerializer),url:e.url}),"S"),le=o(({baseUrl:e,path:r,query:t,querySerializer:s,url:i})=>{let a=i.startsWith("/")?i:`/${i}`,n=(e??"")+a;r&&(n=te({path:r,url:n}));let l=t?s(t):"";return l.startsWith("?")&&(l=l.substring(1)),l&&(n+=`?${l}`),n},"W"),x=o((e,r)=>{var s;let t={...e,...r};return(s=t.baseUrl)!=null&&s.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=A(e.headers,r.headers),t},"C"),A=o((...e)=>{let r=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[i,a]of s)if(a===null)r.delete(i);else if(Array.isArray(a))for(let n of a)r.append(i,n);else a!==void 0&&r.set(i,typeof a=="object"?JSON.stringify(a):a)}return r},"x"),C,b=(C=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(r){return this._fns.indexOf(r)!==-1}eject(r){let t=this._fns.indexOf(r);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(r){this._fns=[...this._fns,r]}},o(C,"m"),C),se=o(()=>({error:new b,request:new b,response:new b}),"T"),ie=S({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ae={"Content-Type":"application/json"},m=o((e={})=>({...X,headers:ae,parseAs:"auto",querySerializer:ie,...e}),"w"),T=o((e={})=>{let r=x(m(),e),t=o(()=>({...r}),"e"),s=o(n=>(r=x(r,n),t()),"a"),i=se(),a=o(async n=>{let l={...r,...n,fetch:n.fetch??r.fetch??globalThis.fetch,headers:A(r.headers,n.headers)};l.security&&await ne({...l,security:l.security}),l.body&&l.bodySerializer&&(l.body=l.bodySerializer(l.body)),(l.body===void 0||l.body==="")&&l.headers.delete("Content-Type");let d=R(l),y={redirect:"follow",...l},u=new Request(d,y);for(let h of i.request._fns)u=await h(u,l);let Q=l.fetch,c=await Q(u);for(let h of i.response._fns)c=await h(c,u,l);let I={request:u,response:c};if(c.ok){if(c.status===204||c.headers.get("Content-Length")==="0")return{data:{},...I};let h=(l.parseAs==="auto"?oe(c.headers.get("Content-Type")):l.parseAs)??"json";if(h==="stream")return{data:c.body,...I};let w=await c[h]();return h==="json"&&(l.responseValidator&&await l.responseValidator(w),l.responseTransformer&&(w=await l.responseTransformer(w))),{data:w,...I}}let O=await c.text();try{O=JSON.parse(O)}catch{}let f=O;for(let h of i.error._fns)f=await h(O,c,u,l);if(f=f||{},l.throwOnError)throw f;return{error:f,...I}},"o");return{buildUrl:R,connect:o(n=>a({...n,method:"CONNECT"}),"connect"),delete:o(n=>a({...n,method:"DELETE"}),"delete"),get:o(n=>a({...n,method:"GET"}),"get"),getConfig:t,head:o(n=>a({...n,method:"HEAD"}),"head"),interceptors:i,options:o(n=>a({...n,method:"OPTIONS"}),"options"),patch:o(n=>a({...n,method:"PATCH"}),"patch"),post:o(n=>a({...n,method:"POST"}),"post"),put:o(n=>a({...n,method:"PUT"}),"put"),request:a,setConfig:s,trace:o(n=>a({...n,method:"TRACE"}),"trace")}},"J");var p=T(m({baseUrl:"https://swish.app/api/2025-04"}));var q=o(e=>((e==null?void 0:e.client)??p).get({url:"/lists",...e}),"listControllerFind"),v=o(e=>(e.client??p).post({url:"/lists",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerCreate"),j=o(e=>(e.client??p).delete({url:"/lists/{listId}",...e}),"listControllerDeleteById"),k=o(e=>(e.client??p).get({url:"/lists/{listId}",...e}),"listControllerFindById"),F=o(e=>(e.client??p).patch({url:"/lists/{listId}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerUpdateById"),U=o(e=>(e.client??p).put({url:"/lists/{listId}/items/order",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"listControllerSetListItemsOrder"),P=o(e=>(e.client??p).delete({url:"/items",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerDelete"),$=o(e=>((e==null?void 0:e.client)??p).get({url:"/items",...e}),"itemControllerFind"),z=o(e=>(e.client??p).post({url:"/items",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerCreate"),N=o(e=>(e.client??p).delete({url:"/items/{itemId}",...e}),"itemControllerDeleteById"),_=o(e=>(e.client??p).get({url:"/items/{itemId}",...e}),"itemControllerFindById"),V=o(e=>(e.client??p).patch({url:"/items/{itemId}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerUpdateById"),W=o(e=>(e.client??p).put({url:"/items/{itemId}/lists",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"itemControllerSetListsById"),J=o(e=>((e==null?void 0:e.client)??p).get({url:"/profiles/accounts-version",...e}),"profileControllerCustomerAccountsVersion"),H=o(e=>(e.client??p).post({url:"/profiles/identify",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"profileControllerIdentify"),G=o(e=>(e.client??p).post({url:"/profiles/token",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),"profileControllerCreateToken");var Ee=o(e=>new D(e),"createApiClient"),L=class L{constructor(r){this.client=T(m({baseUrl:"https://swish.app/api/2025-04"}));this.items={list:o(r=>this.handleRequest($({query:r,client:this.client})),"list"),create:o(r=>this.handleRequest(z({body:r,client:this.client})),"create"),delete:o(r=>this.handleRequest(P({body:{itemIds:r},client:this.client})),"delete"),findById:o(r=>this.handleRequest(_({path:{itemId:r},client:this.client})),"findById"),updateById:o((r,t)=>this.handleRequest(V({body:t,path:{itemId:r},client:this.client})),"updateById"),deleteById:o(r=>this.handleRequest(N({path:{itemId:r},client:this.client})),"deleteById"),setListsById:o((r,t)=>this.handleRequest(W({body:{listIds:t},path:{itemId:r},client:this.client})),"setListsById")};this.lists={list:o(r=>this.handleRequest(q({query:r,client:this.client})),"list"),create:o(r=>this.handleRequest(v({body:r,client:this.client})),"create"),findById:o((r,t)=>this.handleRequest(k({path:{listId:r},query:t??{sort:"recently_saved"},client:this.client})),"findById"),updateById:o((r,t)=>this.handleRequest(F({body:t,path:{listId:r},client:this.client})),"updateById"),deleteById:o(r=>this.handleRequest(j({path:{listId:r},client:this.client})),"deleteById"),orderItems:o((r,t)=>this.handleRequest(U({body:{itemIds:t},path:{listId:r},client:this.client})),"orderItems")};this.profiles={customerAccountsVersion:o(()=>this.handleRequest(J({client:this.client})),"customerAccountsVersion"),createToken:o((r={})=>this.handleRequest(G({body:r,client:this.client})),"createToken"),identify:o(r=>this.handleRequest(H({body:r,client:this.client})),"identify")};this.handleRequest=o(async r=>{let{data:t,error:s}=await r;if(s!=null&&s.error)return{data:null,error:s==null?void 0:s.error};if(t!=null&&t.data){let i={data:t.data,error:null};return t.pageInfo&&(i.pageInfo=t.pageInfo),i}return{data:null,error:null}},"handleRequest");this.profile=r.profile,r.authToken&&(this.authToken=r.authToken),r.config&&this.client.setConfig(r.config),this.client.interceptors.request.use(this.requestInterceptor.bind(this)),r.requestInterceptor&&this.client.interceptors.request.use(r.requestInterceptor),r.responseInterceptor&&this.client.interceptors.response.use(r.responseInterceptor)}setProfile(r){this.profile=r}setAuthToken(r){this.authToken=r}setConfig(r){this.client.setConfig(r)}requestInterceptor(r){return this.authToken&&r.headers.set("Authorization",`Bearer ${this.authToken}`),this.profile&&r.headers.set("Profile",this.profile),r}};o(L,"SwishClient");var D=L;export{Ee as createApiClient};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListControllerFindData, ListControllerFindError, ListControllerCreateData, ListControllerCreateError, ListControllerDeleteByIdData, ListControllerDeleteByIdError, ListControllerFindByIdData, ListControllerFindByIdError, ListControllerUpdateByIdData, ListControllerUpdateByIdError, ListControllerSetListItemsOrderData, ListControllerSetListItemsOrderError, ItemControllerDeleteData, ItemControllerDeleteError, ItemControllerFindData, ItemControllerFindError, ItemControllerCreateData, ItemControllerCreateError, ItemControllerDeleteByIdData, ItemControllerDeleteByIdError, ItemControllerFindByIdData, ItemControllerFindByIdError, ItemControllerUpdateByIdData, ItemControllerUpdateByIdError, ItemControllerSetListsByIdData, ItemControllerSetListsByIdError, ProfileControllerCustomerAccountsVersionData, ProfileControllerCustomerAccountsVersionError, ProfileControllerIdentifyData, ProfileControllerIdentifyError, ProfileControllerCreateTokenData, ProfileControllerCreateTokenError } from './types.gen';
|
|
2
|
+
import type { ListControllerFindData, ListControllerFindError, ListControllerCreateData, ListControllerCreateError, ListControllerDeleteByIdData, ListControllerDeleteByIdError, ListControllerFindByIdData, ListControllerFindByIdError, ListControllerUpdateByIdData, ListControllerUpdateByIdError, ListControllerSetListItemsOrderData, ListControllerSetListItemsOrderError, ItemControllerDeleteData, ItemControllerDeleteError, ItemControllerFindData, ItemControllerFindError, ItemControllerCreateData, ItemControllerCreateError, ItemControllerDeleteByIdData, ItemControllerDeleteByIdError, ItemControllerFindByIdData, ItemControllerFindByIdError, ItemControllerUpdateByIdData, ItemControllerUpdateByIdError, ItemControllerSetListsByIdData, ItemControllerSetListsByIdError, ProfileControllerCustomerAccountsVersionData, ProfileControllerCustomerAccountsVersionError, ProfileControllerIdentifyData, ProfileControllerIdentifyError, ProfileControllerCreateTokenData, ProfileControllerCreateTokenError, AnalyticsControllerLoadSavedItemsData, AnalyticsControllerLoadSavedItemsError, AnalyticsControllerLoadSessionsData, AnalyticsControllerLoadSessionsError, AnalyticsControllerLoadNewListsData, AnalyticsControllerLoadNewListsError } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -43,7 +43,9 @@ export declare const itemControllerFindById: <ThrowOnError extends boolean = fal
|
|
|
43
43
|
export declare const itemControllerUpdateById: <ThrowOnError extends boolean = false>(options: Options<ItemControllerUpdateByIdData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
44
44
|
data?: import("./types.gen").Item;
|
|
45
45
|
}, ItemControllerUpdateByIdError, ThrowOnError>;
|
|
46
|
-
export declare const itemControllerSetListsById: <ThrowOnError extends boolean = false>(options: Options<ItemControllerSetListsByIdData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
46
|
+
export declare const itemControllerSetListsById: <ThrowOnError extends boolean = false>(options: Options<ItemControllerSetListsByIdData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
47
|
+
data?: import("./types.gen").ItemDetail;
|
|
48
|
+
}, ItemControllerSetListsByIdError, ThrowOnError>;
|
|
47
49
|
export declare const profileControllerCustomerAccountsVersion: <ThrowOnError extends boolean = false>(options?: Options<ProfileControllerCustomerAccountsVersionData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
48
50
|
data?: import("./types.gen").AccountsVersionResult;
|
|
49
51
|
}, ProfileControllerCustomerAccountsVersionError, ThrowOnError>;
|
|
@@ -53,3 +55,12 @@ export declare const profileControllerIdentify: <ThrowOnError extends boolean =
|
|
|
53
55
|
export declare const profileControllerCreateToken: <ThrowOnError extends boolean = false>(options: Options<ProfileControllerCreateTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
54
56
|
data?: import("./types.gen").CreateProfileTokenResult;
|
|
55
57
|
}, ProfileControllerCreateTokenError, ThrowOnError>;
|
|
58
|
+
export declare const analyticsControllerLoadSavedItems: <ThrowOnError extends boolean = false>(options: Options<AnalyticsControllerLoadSavedItemsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
59
|
+
data?: Array<import("./types.gen").Analytics>;
|
|
60
|
+
}, AnalyticsControllerLoadSavedItemsError, ThrowOnError>;
|
|
61
|
+
export declare const analyticsControllerLoadSessions: <ThrowOnError extends boolean = false>(options: Options<AnalyticsControllerLoadSessionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
62
|
+
data?: Array<import("./types.gen").Analytics>;
|
|
63
|
+
}, AnalyticsControllerLoadSessionsError, ThrowOnError>;
|
|
64
|
+
export declare const analyticsControllerLoadNewLists: <ThrowOnError extends boolean = false>(options: Options<AnalyticsControllerLoadNewListsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Response & {
|
|
65
|
+
data?: Array<import("./types.gen").Analytics>;
|
|
66
|
+
}, AnalyticsControllerLoadNewListsError, ThrowOnError>;
|
|
@@ -235,6 +235,16 @@ export type CreateProfileTokenInput = {
|
|
|
235
235
|
*/
|
|
236
236
|
session?: string;
|
|
237
237
|
};
|
|
238
|
+
export type Analytics = {
|
|
239
|
+
/**
|
|
240
|
+
* The timeframe for this data point (e.g., "2024-01-01 - 2024-01-10")
|
|
241
|
+
*/
|
|
242
|
+
timeframe: string;
|
|
243
|
+
/**
|
|
244
|
+
* Total number of events for this timeframe
|
|
245
|
+
*/
|
|
246
|
+
total: number;
|
|
247
|
+
};
|
|
238
248
|
export type ListControllerFindData = {
|
|
239
249
|
body?: never;
|
|
240
250
|
path?: never;
|
|
@@ -984,8 +994,11 @@ export type ItemControllerSetListsByIdResponses = {
|
|
|
984
994
|
/**
|
|
985
995
|
* The item has been successfully been added to the lists.
|
|
986
996
|
*/
|
|
987
|
-
200:
|
|
997
|
+
200: Response & {
|
|
998
|
+
data?: ItemDetail;
|
|
999
|
+
};
|
|
988
1000
|
};
|
|
1001
|
+
export type ItemControllerSetListsByIdResponse = ItemControllerSetListsByIdResponses[keyof ItemControllerSetListsByIdResponses];
|
|
989
1002
|
export type ProfileControllerCustomerAccountsVersionData = {
|
|
990
1003
|
body?: never;
|
|
991
1004
|
path?: never;
|
|
@@ -1148,6 +1161,219 @@ export type ProfileControllerCreateTokenResponses = {
|
|
|
1148
1161
|
};
|
|
1149
1162
|
};
|
|
1150
1163
|
export type ProfileControllerCreateTokenResponse = ProfileControllerCreateTokenResponses[keyof ProfileControllerCreateTokenResponses];
|
|
1164
|
+
export type AnalyticsControllerLoadSavedItemsData = {
|
|
1165
|
+
body?: never;
|
|
1166
|
+
path?: never;
|
|
1167
|
+
query: {
|
|
1168
|
+
/**
|
|
1169
|
+
* The granularity of the data
|
|
1170
|
+
*/
|
|
1171
|
+
granularity?: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* The start date
|
|
1174
|
+
*/
|
|
1175
|
+
start: string;
|
|
1176
|
+
/**
|
|
1177
|
+
* The end date
|
|
1178
|
+
*/
|
|
1179
|
+
end: string;
|
|
1180
|
+
/**
|
|
1181
|
+
* Filter by product or variant ID
|
|
1182
|
+
*/
|
|
1183
|
+
merchandiseId?: string;
|
|
1184
|
+
};
|
|
1185
|
+
url: '/analytics/saved-items';
|
|
1186
|
+
};
|
|
1187
|
+
export type AnalyticsControllerLoadSavedItemsErrors = {
|
|
1188
|
+
/**
|
|
1189
|
+
* Bad Request
|
|
1190
|
+
*/
|
|
1191
|
+
400: ErrorResponse & {
|
|
1192
|
+
error?: {
|
|
1193
|
+
statusCode?: number;
|
|
1194
|
+
error?: string;
|
|
1195
|
+
};
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
1198
|
+
* Unauthorized
|
|
1199
|
+
*/
|
|
1200
|
+
401: ErrorResponse & {
|
|
1201
|
+
error?: {
|
|
1202
|
+
statusCode?: number;
|
|
1203
|
+
error?: string;
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
/**
|
|
1207
|
+
* Forbidden
|
|
1208
|
+
*/
|
|
1209
|
+
403: ErrorResponse & {
|
|
1210
|
+
error?: {
|
|
1211
|
+
statusCode?: number;
|
|
1212
|
+
error?: string;
|
|
1213
|
+
};
|
|
1214
|
+
};
|
|
1215
|
+
/**
|
|
1216
|
+
* Not Found
|
|
1217
|
+
*/
|
|
1218
|
+
404: ErrorResponse & {
|
|
1219
|
+
error?: {
|
|
1220
|
+
statusCode?: number;
|
|
1221
|
+
error?: string;
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
export type AnalyticsControllerLoadSavedItemsError = AnalyticsControllerLoadSavedItemsErrors[keyof AnalyticsControllerLoadSavedItemsErrors];
|
|
1226
|
+
export type AnalyticsControllerLoadSavedItemsResponses = {
|
|
1227
|
+
/**
|
|
1228
|
+
* Returns saved items analytics
|
|
1229
|
+
*/
|
|
1230
|
+
200: Response & {
|
|
1231
|
+
data?: Array<Analytics>;
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
export type AnalyticsControllerLoadSavedItemsResponse = AnalyticsControllerLoadSavedItemsResponses[keyof AnalyticsControllerLoadSavedItemsResponses];
|
|
1235
|
+
export type AnalyticsControllerLoadSessionsData = {
|
|
1236
|
+
body?: never;
|
|
1237
|
+
path?: never;
|
|
1238
|
+
query: {
|
|
1239
|
+
/**
|
|
1240
|
+
* The granularity of the data
|
|
1241
|
+
*/
|
|
1242
|
+
granularity?: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* The start date
|
|
1245
|
+
*/
|
|
1246
|
+
start: string;
|
|
1247
|
+
/**
|
|
1248
|
+
* The end date
|
|
1249
|
+
*/
|
|
1250
|
+
end: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* Filter by product or variant ID
|
|
1253
|
+
*/
|
|
1254
|
+
merchandiseId?: string;
|
|
1255
|
+
};
|
|
1256
|
+
url: '/analytics/sessions';
|
|
1257
|
+
};
|
|
1258
|
+
export type AnalyticsControllerLoadSessionsErrors = {
|
|
1259
|
+
/**
|
|
1260
|
+
* Bad Request
|
|
1261
|
+
*/
|
|
1262
|
+
400: ErrorResponse & {
|
|
1263
|
+
error?: {
|
|
1264
|
+
statusCode?: number;
|
|
1265
|
+
error?: string;
|
|
1266
|
+
};
|
|
1267
|
+
};
|
|
1268
|
+
/**
|
|
1269
|
+
* Unauthorized
|
|
1270
|
+
*/
|
|
1271
|
+
401: ErrorResponse & {
|
|
1272
|
+
error?: {
|
|
1273
|
+
statusCode?: number;
|
|
1274
|
+
error?: string;
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
/**
|
|
1278
|
+
* Forbidden
|
|
1279
|
+
*/
|
|
1280
|
+
403: ErrorResponse & {
|
|
1281
|
+
error?: {
|
|
1282
|
+
statusCode?: number;
|
|
1283
|
+
error?: string;
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* Not Found
|
|
1288
|
+
*/
|
|
1289
|
+
404: ErrorResponse & {
|
|
1290
|
+
error?: {
|
|
1291
|
+
statusCode?: number;
|
|
1292
|
+
error?: string;
|
|
1293
|
+
};
|
|
1294
|
+
};
|
|
1295
|
+
};
|
|
1296
|
+
export type AnalyticsControllerLoadSessionsError = AnalyticsControllerLoadSessionsErrors[keyof AnalyticsControllerLoadSessionsErrors];
|
|
1297
|
+
export type AnalyticsControllerLoadSessionsResponses = {
|
|
1298
|
+
/**
|
|
1299
|
+
* Returns sessions analytics
|
|
1300
|
+
*/
|
|
1301
|
+
200: Response & {
|
|
1302
|
+
data?: Array<Analytics>;
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
export type AnalyticsControllerLoadSessionsResponse = AnalyticsControllerLoadSessionsResponses[keyof AnalyticsControllerLoadSessionsResponses];
|
|
1306
|
+
export type AnalyticsControllerLoadNewListsData = {
|
|
1307
|
+
body?: never;
|
|
1308
|
+
path?: never;
|
|
1309
|
+
query: {
|
|
1310
|
+
/**
|
|
1311
|
+
* The granularity of the data
|
|
1312
|
+
*/
|
|
1313
|
+
granularity?: string;
|
|
1314
|
+
/**
|
|
1315
|
+
* The start date
|
|
1316
|
+
*/
|
|
1317
|
+
start: string;
|
|
1318
|
+
/**
|
|
1319
|
+
* The end date
|
|
1320
|
+
*/
|
|
1321
|
+
end: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* Filter by product or variant ID
|
|
1324
|
+
*/
|
|
1325
|
+
merchandiseId?: string;
|
|
1326
|
+
};
|
|
1327
|
+
url: '/analytics/new-lists';
|
|
1328
|
+
};
|
|
1329
|
+
export type AnalyticsControllerLoadNewListsErrors = {
|
|
1330
|
+
/**
|
|
1331
|
+
* Bad Request
|
|
1332
|
+
*/
|
|
1333
|
+
400: ErrorResponse & {
|
|
1334
|
+
error?: {
|
|
1335
|
+
statusCode?: number;
|
|
1336
|
+
error?: string;
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
/**
|
|
1340
|
+
* Unauthorized
|
|
1341
|
+
*/
|
|
1342
|
+
401: ErrorResponse & {
|
|
1343
|
+
error?: {
|
|
1344
|
+
statusCode?: number;
|
|
1345
|
+
error?: string;
|
|
1346
|
+
};
|
|
1347
|
+
};
|
|
1348
|
+
/**
|
|
1349
|
+
* Forbidden
|
|
1350
|
+
*/
|
|
1351
|
+
403: ErrorResponse & {
|
|
1352
|
+
error?: {
|
|
1353
|
+
statusCode?: number;
|
|
1354
|
+
error?: string;
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
/**
|
|
1358
|
+
* Not Found
|
|
1359
|
+
*/
|
|
1360
|
+
404: ErrorResponse & {
|
|
1361
|
+
error?: {
|
|
1362
|
+
statusCode?: number;
|
|
1363
|
+
error?: string;
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
export type AnalyticsControllerLoadNewListsError = AnalyticsControllerLoadNewListsErrors[keyof AnalyticsControllerLoadNewListsErrors];
|
|
1368
|
+
export type AnalyticsControllerLoadNewListsResponses = {
|
|
1369
|
+
/**
|
|
1370
|
+
* Returns new lists analytics
|
|
1371
|
+
*/
|
|
1372
|
+
200: Response & {
|
|
1373
|
+
data?: Array<Analytics>;
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
export type AnalyticsControllerLoadNewListsResponse = AnalyticsControllerLoadNewListsResponses[keyof AnalyticsControllerLoadNewListsResponses];
|
|
1151
1377
|
export type ClientOptions = {
|
|
1152
1378
|
baseUrl: 'https://swish.app/api/2025-04' | (string & {});
|
|
1153
1379
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export type CreateListResponse = Awaited<ReturnType<SwishClient["lists"]["create
|
|
|
22
22
|
export type DeleteListByIdResponse = Awaited<ReturnType<SwishClient["lists"]["deleteById"]>>;
|
|
23
23
|
export type UpdateListByIdResponse = Awaited<ReturnType<SwishClient["lists"]["updateById"]>>;
|
|
24
24
|
export type OrderItemsResponse = Awaited<ReturnType<SwishClient["lists"]["orderItems"]>>;
|
|
25
|
+
export type SetListsByIdResponse = Awaited<ReturnType<SwishClient["items"]["setListsById"]>>;
|
|
25
26
|
export type CustomerAccountsVersionResponse = Awaited<ReturnType<SwishClient["profiles"]["customerAccountsVersion"]>>;
|
|
26
27
|
export type CreateProfileTokenResponse = Awaited<ReturnType<SwishClient["profiles"]["createToken"]>>;
|
|
27
28
|
export type IdentifyProfileResponse = Awaited<ReturnType<SwishClient["profiles"]["identify"]>>;
|
|
@@ -36,3 +37,12 @@ export type ApiResponse<TData> = {
|
|
|
36
37
|
error: ApiError | null;
|
|
37
38
|
pageInfo?: PageInfo;
|
|
38
39
|
};
|
|
40
|
+
export type ApiRequestResponse<TData> = Promise<{
|
|
41
|
+
data?: {
|
|
42
|
+
data?: TData;
|
|
43
|
+
pageInfo?: PageInfo;
|
|
44
|
+
} | void;
|
|
45
|
+
error?: {
|
|
46
|
+
error: unknown;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swishapp/api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "A lightweight JS client for the Swish REST API.",
|
|
5
5
|
"homepage": "https://developers.swish.app/libraries/api-client",
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"test": "jest",
|
|
30
30
|
"test:watch": "jest --watch",
|
|
31
31
|
"build": "rimraf dist && node esbuild.js && tsc -p tsconfig.build.json",
|
|
32
|
+
"dev": "rimraf dist && node esbuild.js --watch && tsc -p tsconfig.build.json --watch",
|
|
32
33
|
"prepublishOnly": "npm run build",
|
|
33
34
|
"lint": "eslint src --ext .ts",
|
|
34
35
|
"clean": "rimraf dist"
|