@aifeatures/backend 0.3.1 → 0.5.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.cjs +5 -5
- package/dist/index.d.cts +2321 -175
- package/dist/index.d.ts +2321 -175
- package/dist/index.js +5 -5
- package/package.json +9 -8
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $=(e,r,s)=>{typeof s=="string"?e.append(r,s):e.append(r,JSON.stringify(s))};var U={bodySerializer:e=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s)},F={bodySerializer:e=>{let r=new URLSearchParams;return Object.entries(e).forEach(([s,n])=>{n!=null&&(Array.isArray(n)?n.forEach(a=>$(r,s,a)):$(r,s,n))}),r.toString()}};var oe={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},dr=Object.entries(oe);var H=({onRequest:e,onSseError:r,onSseEvent:s,responseTransformer:n,responseValidator:a,sseDefaultRetryDelay:u,sseMaxRetryAttempts:c,sseMaxRetryDelay:i,sseSleepFn:p,url:d,...o})=>{let S,w=p??(l=>new Promise(y=>setTimeout(y,l)));return{stream:async function*(){let l=u??3e3,y=0,T=o.signal??new AbortController().signal;for(;!T.aborted;){y++;let g=o.headers instanceof Headers?o.headers:new Headers(o.headers);S!==void 0&&g.set("Last-Event-ID",S);try{let b={redirect:"follow",...o,body:o.serializedBody,headers:g,signal:T},D=new Request(d,b);e&&(D=await e(d,b));let E=await(o.fetch??globalThis.fetch)(D);if(!E.ok)throw new Error(`SSE failed: ${E.status} ${E.statusText}`);if(!E.body)throw new Error("No body in SSE response");let R=E.body.pipeThrough(new TextDecoderStream).getReader(),P="",j=()=>{try{R.cancel()}catch{}};T.addEventListener("abort",j);try{for(;;){let{done:ee,value:te}=await R.read();if(ee)break;P+=te,P=P.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
|
-
`);let
|
|
3
|
+
`);let q=P.split(`
|
|
4
4
|
|
|
5
|
-
`);
|
|
6
|
-
`),
|
|
7
|
-
`);try{b=JSON.parse(E),B=!0}catch{b=E}}B&&(n&&await n(b),a&&(b=await a(b))),t?.({data:b,event:z,id:y,retry:c}),F.length&&(yield b)}}}finally{C.removeEventListener("abort",q),f.releaseLock()}break}catch(T){if(r?.(T),p!==void 0&&O>=p)break;let R=Math.min(c*2**(O-1),i??3e4);await P(R)}}}()}};var se=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},oe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ne=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},I=({allowReserved:e,explode:r,name:t,style:a,value:n})=>{if(!r){let i=(e?n:n.map(d=>encodeURIComponent(d))).join(oe(a));switch(a){case"label":return`.${i}`;case"matrix":return`;${t}=${i}`;case"simple":return i;default:return`${t}=${i}`}}let u=se(a),p=n.map(i=>a==="label"||a==="simple"?e?i:encodeURIComponent(i):D({allowReserved:e,name:t,value:i})).join(u);return a==="label"||a==="matrix"?u+p:p},D=({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)}`},v=({allowReserved:e,explode:r,name:t,style:a,value:n,valueOnly:u})=>{if(n instanceof Date)return u?n.toISOString():`${t}=${n.toISOString()}`;if(a!=="deepObject"&&!r){let d=[];Object.entries(n).forEach(([o,y])=>{d=[...d,o,e?y:encodeURIComponent(y)]});let l=d.join(",");switch(a){case"form":return`${t}=${l}`;case"label":return`.${l}`;case"matrix":return`;${t}=${l}`;default:return l}}let p=ne(a),i=Object.entries(n).map(([d,l])=>D({allowReserved:e,name:a==="deepObject"?`${t}[${d}]`:d,value:l})).join(p);return a==="label"||a==="matrix"?p+i:i};var ae=/\{[^{}]+\}/g,ie=({path:e,url:r})=>{let t=r,a=r.match(ae);if(a)for(let n of a){let u=!1,p=n.substring(1,n.length-1),i="simple";p.endsWith("*")&&(u=!0,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),i="label"):p.startsWith(";")&&(p=p.substring(1),i="matrix");let d=e[p];if(d==null)continue;if(Array.isArray(d)){t=t.replace(n,I({explode:u,name:p,style:i,value:d}));continue}if(typeof d=="object"){t=t.replace(n,v({explode:u,name:p,style:i,value:d,valueOnly:!0}));continue}if(i==="matrix"){t=t.replace(n,`;${D({name:p,value:d})}`);continue}let l=encodeURIComponent(i==="label"?`.${d}`:d);t=t.replace(n,l)}return t},$=({baseUrl:e,path:r,query:t,querySerializer:a,url:n})=>{let u=n.startsWith("/")?n:`/${n}`,p=(e??"")+u;r&&(p=ie({path:r,url:p}));let i=t?a(t):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(p+=`?${i}`),p};function H(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}var J=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};var Q=({parameters:e={},...r}={})=>a=>{let n=[];if(a&&typeof a=="object")for(let u in a){let p=a[u];if(p==null)continue;let i=e[u]||r;if(Array.isArray(p)){let d=I({allowReserved:i.allowReserved,explode:!0,name:u,style:"form",value:p,...i.array});d&&n.push(d)}else if(typeof p=="object"){let d=v({allowReserved:i.allowReserved,explode:!0,name:u,style:"deepObject",value:p,...i.object});d&&n.push(d)}else{let d=D({allowReserved:i.allowReserved,name:u,value:p});d&&n.push(d)}}return n.join("&")},_=e=>{if(!e)return"stream";let r=e.split(";")[0]?.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(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},pe=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,K=async({security:e,...r})=>{for(let t of e){if(pe(r,t.name))continue;let a=await J(t,r.auth);if(!a)continue;let n=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[n]=a;break;case"cookie":r.headers.append("Cookie",`${n}=${a}`);break;case"header":default:r.headers.set(n,a);break}}},A=e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Q(e.querySerializer),url:e.url}),V=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=U(e.headers,r.headers),t},de=e=>{let r=[];return e.forEach((t,a)=>{r.push([a,t])}),r},U=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let a=t instanceof Headers?de(t):Object.entries(t);for(let[n,u]of a)if(u===null)r.delete(n);else if(Array.isArray(u))for(let p of u)r.append(n,p);else u!==void 0&&r.set(n,typeof u=="object"?JSON.stringify(u):u)}return r},k=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 a=this.getInterceptorIndex(r);return this.fns[a]?(this.fns[a]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},X=()=>({error:new k,request:new k,response:new k}),ue=Q({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ce={"Content-Type":"application/json"},w=(e={})=>({...j,headers:ce,parseAs:"auto",querySerializer:ue,...e});var L=(e={})=>{let r=V(w(),e),t=()=>({...r}),a=l=>(r=V(r,l),t()),n=X(),u=async l=>{let o={...r,...l,fetch:l.fetch??r.fetch??globalThis.fetch,headers:U(r.headers,l.headers),serializedBody:void 0};o.security&&await K({...o,security:o.security}),o.requestValidator&&await o.requestValidator(o),o.body!==void 0&&o.bodySerializer&&(o.serializedBody=o.bodySerializer(o.body)),(o.body===void 0||o.serializedBody==="")&&o.headers.delete("Content-Type");let y=A(o);return{opts:o,url:y}},p=async l=>{let{opts:o,url:y}=await u(l),P={redirect:"follow",...o,body:H(o)},S=new Request(y,P);for(let h of n.request.fns)h&&(S=await h(S,o));let G=o.fetch,c;try{c=await G(S)}catch(h){let m=h;for(let f of n.error.fns)f&&(m=await f(h,void 0,S,o));if(m=m||{},o.throwOnError)throw m;return o.responseStyle==="data"?void 0:{error:m,request:S,response:void 0}}for(let h of n.response.fns)h&&(c=await h(c,S,o));let O={request:S,response:c};if(c.ok){let h=(o.parseAs==="auto"?_(c.headers.get("Content-Type")):o.parseAs)??"json";if(c.status===204||c.headers.get("Content-Length")==="0"){let f;switch(h){case"arrayBuffer":case"blob":case"text":f=await c[h]();break;case"formData":f=new FormData;break;case"stream":f=c.body;break;case"json":default:f={};break}return o.responseStyle==="data"?f:{data:f,...O}}let m;switch(h){case"arrayBuffer":case"blob":case"formData":case"json":case"text":m=await c[h]();break;case"stream":return o.responseStyle==="data"?c.body:{data:c.body,...O}}return h==="json"&&(o.responseValidator&&await o.responseValidator(m),o.responseTransformer&&(m=await o.responseTransformer(m))),o.responseStyle==="data"?m:{data:m,...O}}let C=await c.text(),g;try{g=JSON.parse(C)}catch{}let T=g??C,R=T;for(let h of n.error.fns)h&&(R=await h(T,c,S,o));if(R=R||{},o.throwOnError)throw R;return o.responseStyle==="data"?void 0:{error:R,...O}},i=l=>o=>p({...o,method:l}),d=l=>async o=>{let{opts:y,url:P}=await u(o);return M({...y,body:y.body,headers:y.headers,method:l,onRequest:async(S,G)=>{let c=new Request(S,G);for(let O of n.request.fns)O&&(c=await O(c,y));return c},url:P})};return{buildUrl:A,connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:t,head:i("HEAD"),interceptors:n,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:p,setConfig:a,sse:{connect:d("CONNECT"),delete:d("DELETE"),get:d("GET"),head:d("HEAD"),options:d("OPTIONS"),patch:d("PATCH"),post:d("POST"),put:d("PUT"),trace:d("TRACE")},trace:i("TRACE")}};var s=L(w({baseUrl:"https://aifeatures.dev"}));var le=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/payments",...e,headers:{"Content-Type":"application/json",...e.headers}}),he=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payments/status",...e}),me=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e}),ye=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e}),fe=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),Ee=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),Re=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/file",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/test-order",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/test-orders",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??s).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e}),ge=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/options",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e}),Ge=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??s).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory/adjust",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders",...e}),Ue=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}",...e}),Le=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/refund",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/resend-receipt",...e}),Ae=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/reset-downloads",...e}),Ve=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/webhook-events/{eventId}/reset",...e}),qe=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e}),We=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e}),Be=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/summary",...e}),Me=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sales-summary",...e}),$e=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people",...e}),He=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people/{email}",...e}),Je=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payouts/next",...e}),Qe=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/fulfillment",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e}),Ke=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xe=e=>(e?.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e}),Ye=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ze=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),er=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),rr=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),tr=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e}),sr=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e,headers:{"Content-Type":"application/json",...e.headers}}),or=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/domains",...e,headers:{"Content-Type":"application/json",...e.headers}}),nr=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e}),ar=e=>(e.client??s).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),ir=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),pr=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),dr=e=>(e.client??s).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),ur=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}/submissions",...e}),cr=e=>(e.client??s).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),lr=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),hr=e=>(e.client??s).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}/attachments/{attachmentId}",...e}),mr=e=>(e.client??s).get({url:"/v1/p/{productId}",...e}),yr=e=>(e.client??s).post({url:"/v1/p/{productId}/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),Or=e=>(e.client??s).post({url:"/v1/p/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),fr=e=>(e.client??s).post({url:"/v1/p/checkout/summary",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sr=e=>(e.client??s).get({url:"/v1/o/session/{sessionId}",...e}),Er=e=>(e.client??s).get({url:"/v1/d/{token}",...e}),Rr=e=>(e?.client??s).get({url:"/v1/geo",...e});export{Ie as adjustVariantInventory,Ce as attachProductFile,Or as createCartCheckout,yr as createCheckout,L as createClient,w as createConfig,We as createCustomer,ar as createForm,Ke as createFormWithSiteToken,be as createMultiItemTestOrder,xe as createOption,fe as createProduct,ye as createProductWithSiteToken,Ye as createSite,Te as createTestOrder,De as createVariant,ir as deleteForm,ke as deleteOption,Se as deleteProduct,Ze as deleteSite,cr as deleteSubmission,Pe as deleteVariant,hr as downloadAttachment,Er as downloadFile,Ne as getBusinessSummary,fr as getCartSummary,ze as getCustomer,pr as getForm,Rr as getGeo,Je as getNextPayout,Ue as getOrder,Sr as getOrderSession,he as getPaymentsStatus,He as getPerson,Ee as getProduct,mr as getPublicProduct,Me as getSalesSummary,er as getSite,tr as getSiteCheckoutPause,lr as getSubmission,qe as listCustomers,nr as listForms,_e as listFormsWithSiteToken,ve as listOrdersWithSiteToken,$e as listPeople,Oe as listProducts,me as listProductsWithSiteToken,Xe as listSites,ur as listSubmissions,sr as pauseSiteCheckout,Le as refundOrder,je as resendOrderReceipt,Ae as resetOrderDownloads,Ve as resetWebhookEvent,Qe as setOrderFulfillment,we as setProductVariants,Fe as setVariantInventory,Be as updateCustomer,dr as updateForm,Ge as updateOption,Re as updateProduct,rr as updateSite,or as updateSiteDomains,le as updateSitePayments,ge as updateVariant};
|
|
5
|
+
`);P=q.pop()??"";for(let re of q){let se=re.split(`
|
|
6
|
+
`),A=[],z;for(let O of se)if(O.startsWith("data:"))A.push(O.replace(/^data:\s*/,""));else if(O.startsWith("event:"))z=O.replace(/^event:\s*/,"");else if(O.startsWith("id:"))S=O.replace(/^id:\s*/,"");else if(O.startsWith("retry:")){let N=Number.parseInt(O.replace(/^retry:\s*/,""),10);Number.isNaN(N)||(l=N)}let f,B=!1;if(A.length){let O=A.join(`
|
|
7
|
+
`);try{f=JSON.parse(O),B=!0}catch{f=O}}B&&(a&&await a(f),n&&(f=await n(f))),s?.({data:f,event:z,id:S,retry:l}),A.length&&(yield f)}}}finally{T.removeEventListener("abort",j),R.releaseLock()}break}catch(b){if(r?.(b),c!==void 0&&y>=c)break;let D=Math.min(l*2**(y-1),i??3e4);await w(D)}}}()}};var ne=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},ae=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},G=({allowReserved:e,explode:r,name:s,style:n,value:a})=>{if(!r){let i=(e?a:a.map(p=>encodeURIComponent(p))).join(ae(n));switch(n){case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;case"simple":return i;default:return`${s}=${i}`}}let u=ne(n),c=a.map(i=>n==="label"||n==="simple"?e?i:encodeURIComponent(i):v({allowReserved:e,name:s,value:i})).join(u);return n==="label"||n==="matrix"?u+c:c},v=({allowReserved:e,name:r,value:s})=>{if(s==null)return"";if(typeof s=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?s:encodeURIComponent(s)}`},L=({allowReserved:e,explode:r,name:s,style:n,value:a,valueOnly:u})=>{if(a instanceof Date)return u?a.toISOString():`${s}=${a.toISOString()}`;if(n!=="deepObject"&&!r){let p=[];Object.entries(a).forEach(([o,S])=>{p=[...p,o,e?S:encodeURIComponent(S)]});let d=p.join(",");switch(n){case"form":return`${s}=${d}`;case"label":return`.${d}`;case"matrix":return`;${s}=${d}`;default:return d}}let c=ie(n),i=Object.entries(a).map(([p,d])=>v({allowReserved:e,name:n==="deepObject"?`${s}[${p}]`:p,value:d})).join(c);return n==="label"||n==="matrix"?c+i:i};var ce=/\{[^{}]+\}/g,pe=({path:e,url:r})=>{let s=r,n=r.match(ce);if(n)for(let a of n){let u=!1,c=a.substring(1,a.length-1),i="simple";c.endsWith("*")&&(u=!0,c=c.substring(0,c.length-1)),c.startsWith(".")?(c=c.substring(1),i="label"):c.startsWith(";")&&(c=c.substring(1),i="matrix");let p=e[c];if(p==null)continue;if(Array.isArray(p)){s=s.replace(a,G({explode:u,name:c,style:i,value:p}));continue}if(typeof p=="object"){s=s.replace(a,L({explode:u,name:c,style:i,value:p,valueOnly:!0}));continue}if(i==="matrix"){s=s.replace(a,`;${v({name:c,value:p})}`);continue}let d=encodeURIComponent(i==="label"?`.${p}`:p);s=s.replace(a,d)}return s},J=({baseUrl:e,path:r,query:s,querySerializer:n,url:a})=>{let u=a.startsWith("/")?a:`/${a}`,c=(e??"")+u;r&&(c=pe({path:r,url:c}));let i=s?n(s):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(c+=`?${i}`),c};function Q(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}var _=async(e,r)=>{let s=typeof r=="function"?await r(e):r;if(s)return e.scheme==="bearer"?`Bearer ${s}`:e.scheme==="basic"?`Basic ${btoa(s)}`:s};var K=({parameters:e={},...r}={})=>n=>{let a=[];if(n&&typeof n=="object")for(let u in n){let c=n[u];if(c==null)continue;let i=e[u]||r;if(Array.isArray(c)){let p=G({allowReserved:i.allowReserved,explode:!0,name:u,style:"form",value:c,...i.array});p&&a.push(p)}else if(typeof c=="object"){let p=L({allowReserved:i.allowReserved,explode:!0,name:u,style:"deepObject",value:c,...i.object});p&&a.push(p)}else{let p=v({allowReserved:i.allowReserved,name:u,value:c});p&&a.push(p)}}return a.join("&")},X=e=>{if(!e)return"stream";let r=e.split(";")[0]?.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"}},ue=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,Y=async({security:e,...r})=>{for(let s of e){if(ue(r,s.name))continue;let n=await _(s,r.auth);if(!n)continue;let a=s.name??"Authorization";switch(s.in){case"query":r.query||(r.query={}),r.query[a]=n;break;case"cookie":r.headers.append("Cookie",`${a}=${n}`);break;case"header":default:r.headers.set(a,n);break}}},V=e=>J({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:K(e.querySerializer),url:e.url}),M=(e,r)=>{let s={...e,...r};return s.baseUrl?.endsWith("/")&&(s.baseUrl=s.baseUrl.substring(0,s.baseUrl.length-1)),s.headers=W(e.headers,r.headers),s},le=e=>{let r=[];return e.forEach((s,n)=>{r.push([n,s])}),r},W=(...e)=>{let r=new Headers;for(let s of e){if(!s)continue;let n=s instanceof Headers?le(s):Object.entries(s);for(let[a,u]of n)if(u===null)r.delete(a);else if(Array.isArray(u))for(let c of u)r.append(a,c);else u!==void 0&&r.set(a,typeof u=="object"?JSON.stringify(u):u)}return r},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let s=this.getInterceptorIndex(r);this.fns[s]&&(this.fns[s]=null)}exists(r){let s=this.getInterceptorIndex(r);return!!this.fns[s]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,s){let n=this.getInterceptorIndex(r);return this.fns[n]?(this.fns[n]=s,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},Z=()=>({error:new k,request:new k,response:new k}),de=K({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},C=(e={})=>({...U,headers:he,parseAs:"auto",querySerializer:de,...e});var I=(e={})=>{let r=M(C(),e),s=()=>({...r}),n=d=>(r=M(r,d),s()),a=Z(),u=async d=>{let o={...r,...d,fetch:d.fetch??r.fetch??globalThis.fetch,headers:W(r.headers,d.headers),serializedBody:void 0};o.security&&await Y({...o,security:o.security}),o.requestValidator&&await o.requestValidator(o),o.body!==void 0&&o.bodySerializer&&(o.serializedBody=o.bodySerializer(o.body)),(o.body===void 0||o.serializedBody==="")&&o.headers.delete("Content-Type");let S=V(o);return{opts:o,url:S}},c=async d=>{let{opts:o,url:S}=await u(d),w={redirect:"follow",...o,body:Q(o)},m=new Request(S,w);for(let h of a.request.fns)h&&(m=await h(m,o));let x=o.fetch,l;try{l=await x(m)}catch(h){let E=h;for(let R of a.error.fns)R&&(E=await R(h,void 0,m,o));if(E=E||{},o.throwOnError)throw E;return o.responseStyle==="data"?void 0:{error:E,request:m,response:void 0}}for(let h of a.response.fns)h&&(l=await h(l,m,o));let y={request:m,response:l};if(l.ok){let h=(o.parseAs==="auto"?X(l.headers.get("Content-Type")):o.parseAs)??"json";if(l.status===204||l.headers.get("Content-Length")==="0"){let R;switch(h){case"arrayBuffer":case"blob":case"text":R=await l[h]();break;case"formData":R=new FormData;break;case"stream":R=l.body;break;case"json":default:R={};break}return o.responseStyle==="data"?R:{data:R,...y}}let E;switch(h){case"arrayBuffer":case"blob":case"formData":case"json":case"text":E=await l[h]();break;case"stream":return o.responseStyle==="data"?l.body:{data:l.body,...y}}return h==="json"&&(o.responseValidator&&await o.responseValidator(E),o.responseTransformer&&(E=await o.responseTransformer(E))),o.responseStyle==="data"?E:{data:E,...y}}let T=await l.text(),g;try{g=JSON.parse(T)}catch{}let b=g??T,D=b;for(let h of a.error.fns)h&&(D=await h(b,l,m,o));if(D=D||{},o.throwOnError)throw D;return o.responseStyle==="data"?void 0:{error:D,...y}},i=d=>o=>c({...o,method:d}),p=d=>async o=>{let{opts:S,url:w}=await u(o);return H({...S,body:S.body,headers:S.headers,method:d,onRequest:async(m,x)=>{let l=new Request(m,x);for(let y of a.request.fns)y&&(l=await y(l,S));return l},url:w})};return{buildUrl:V,connect:i("CONNECT"),delete:i("DELETE"),get:i("GET"),getConfig:s,head:i("HEAD"),interceptors:a,options:i("OPTIONS"),patch:i("PATCH"),post:i("POST"),put:i("PUT"),request:c,setConfig:n,sse:{connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),head:p("HEAD"),options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),trace:p("TRACE")},trace:i("TRACE")}};var t=I(C({baseUrl:"https://aifeatures.dev"}));var Ee=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/payments",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/account-route",...e,headers:{"Content-Type":"application/json",...e.headers}}),ye=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payments/status",...e}),Re=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e}),me=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e}),De=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),be=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),fe=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/file",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(e.client??t).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/subscription",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/test-order",...e,headers:{"Content-Type":"application/json",...e.headers}}),ge=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/test-subscription",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/test-orders",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(e.client??t).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ge=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e}),Le=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),We=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/options",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e}),Ue=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??t).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ve=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory/adjust",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders",...e}),je=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}",...e}),qe=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/refund",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/resend-receipt",...e}),Be=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/reset-downloads",...e}),Ne=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/webhook-events/{eventId}/reset",...e}),$e=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e}),He=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e}),Qe=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}/revoke-access",...e}),Ke=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/summary",...e}),Xe=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sales-summary",...e}),Ye=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people",...e}),Ze=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people/{email}",...e}),et=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payouts/next",...e}),tt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/fulfillment",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/subscriptions",...e}),st=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/subscriptions/{subscriptionId}/cancel",...e}),ot=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/subscriptions/teardown",...e,headers:{"Content-Type":"application/json",...e.headers}}),nt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/subscriptions/reactivate-teardown",...e,headers:{"Content-Type":"application/json",...e.headers}}),at=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/preview-session",...e,headers:{"Content-Type":"application/json",...e.headers}}),it=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e}),ct=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),pt=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e}),ut=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e,headers:{"Content-Type":"application/json",...e.headers}}),lt=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),dt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),ht=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Et=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e}),St=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e,headers:{"Content-Type":"application/json",...e.headers}}),yt=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/domains",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e}),mt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ot=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),Dt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),Tt=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),bt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}/submissions",...e}),ft=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),vt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),Ct=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}/attachments/{attachmentId}",...e}),wt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations",...e}),gt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pt=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}",...e}),kt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}",...e}),xt=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),At=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}/rotate-secret",...e}),Gt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}/secret",...e}),Lt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}/deliveries",...e}),Wt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/event-destinations/{destinationId}/deliveries/{deliveryId}/retry",...e}),It=e=>(e?.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations",...e}),Ut=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ft=e=>(e.client??t).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}",...e}),Vt=e=>(e.client??t).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Mt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}/rotate-secret",...e}),jt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}/secret",...e}),qt=e=>(e.client??t).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}/deliveries",...e}),zt=e=>(e.client??t).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/event-destinations/{destinationId}/deliveries/{deliveryId}/retry",...e}),Bt=e=>(e.client??t).get({url:"/v1/p/{productId}",...e}),Nt=e=>(e.client??t).post({url:"/v1/p/{productId}/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),$t=e=>(e.client??t).post({url:"/v1/p/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ht=e=>(e.client??t).post({url:"/v1/p/checkout/summary",...e,headers:{"Content-Type":"application/json",...e.headers}}),Jt=e=>(e.client??t).get({url:"/v1/o/session/{sessionId}",...e}),Qt=e=>(e.client??t).get({url:"/v1/d/{token}",...e}),_t=e=>(e?.client??t).get({url:"/v1/geo",...e}),Kt=e=>(e.client??t).post({url:"/v1/account/login",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xt=e=>(e.client??t).post({url:"/v1/account/verify",...e,headers:{"Content-Type":"application/json",...e.headers}}),Yt=e=>(e?.client??t).post({url:"/v1/account/logout",...e}),Zt=e=>(e?.client??t).get({url:"/v1/account/me",...e}),er=e=>(e.client??t).post({url:"/v1/account/subscribe",...e,headers:{"Content-Type":"application/json",...e.headers}}),tr=e=>(e.client??t).post({url:"/v1/account/subscriptions/{subscriptionId}/cancel",...e}),rr=e=>(e.client??t).post({url:"/v1/account/subscriptions/{subscriptionId}/reactivate",...e}),sr=e=>(e.client??t).post({url:"/v1/account/subscriptions/{subscriptionId}/address",...e,headers:{"Content-Type":"application/json",...e.headers}}),or=e=>(e.client??t).post({url:"/v1/account/subscriptions/{subscriptionId}/portal-session",...e}),nr=e=>(e.client??t).post({url:"/v1/account/manage/verify",...e,headers:{"Content-Type":"application/json",...e.headers}}),ar=e=>(e?.client??t).get({url:"/v1/account/manage/subscription",...e}),ir=e=>(e?.client??t).post({url:"/v1/account/manage/cancel",...e}),cr=e=>(e?.client??t).post({url:"/v1/account/manage/portal-session",...e}),pr=e=>(e.client??t).get({url:"/v1/m/{token}",...e}),ur=e=>(e.client??t).post({...F,url:"/v1/m/{token}",...e,headers:{"Content-Type":"application/x-www-form-urlencoded",...e.headers}});export{tr as accountCancelSubscription,or as accountCreatePortalSession,Kt as accountLogin,Yt as accountLogout,ir as accountManageCancel,ar as accountManageGetSubscription,cr as accountManagePortalSession,nr as accountManageVerify,Zt as accountMe,rr as accountReactivateSubscription,er as accountSubscribe,sr as accountUpdateSubscriptionAddress,Xt as accountVerify,ur as actOnManageLink,Ve as adjustVariantInventory,ve as attachProductFile,st as cancelSubscription,$t as createCartCheckout,Nt as createCheckout,I as createClient,C as createConfig,He as createCustomer,gt as createEventDestination,Ut as createEventDestinationWithSiteToken,mt as createForm,ct as createFormWithSiteToken,Pe as createMultiItemTestOrder,We as createOption,at as createPreviewSession,De as createProduct,me as createProductWithSiteToken,ut as createSite,we as createTestOrder,ge as createTestSubscription,ke as createVariant,Pt as deleteEventDestination,Ft as deleteEventDestinationWithSiteToken,Ot as deleteForm,Ie as deleteOption,Te as deleteProduct,lt as deleteSite,ft as deleteSubmission,Ge as deleteVariant,Ct as downloadAttachment,Qt as downloadFile,Ae as generateVariants,Ke as getBusinessSummary,Ht as getCartSummary,Je as getCustomer,kt as getEventDestination,Gt as getEventDestinationSecret,jt as getEventDestinationSecretWithSiteToken,Dt as getForm,_t as getGeo,et as getNextPayout,je as getOrder,Jt as getOrderSession,ye as getPaymentsStatus,Ze as getPerson,be as getProduct,Bt as getPublicProduct,Xe as getSalesSummary,dt as getSite,Et as getSiteCheckoutPause,vt as getSubmission,$e as listCustomers,Lt as listEventDeliveries,qt as listEventDeliveriesWithSiteToken,wt as listEventDestinations,It as listEventDestinationsWithSiteToken,Rt as listForms,it as listFormsWithSiteToken,Me as listOrdersWithSiteToken,Ye as listPeople,Oe as listProducts,Re as listProductsWithSiteToken,pt as listSites,bt as listSubmissions,rt as listSubscriptions,St as pauseSiteCheckout,nt as reactivateSiteSubscriptionsTeardown,qe as refundOrder,ze as resendOrderReceipt,Be as resetOrderDownloads,Ne as resetWebhookEvent,pr as resolveManageLink,Wt as retryEventDelivery,zt as retryEventDeliveryWithSiteToken,_e as revokeCustomerAccess,At as rotateEventDestinationSecret,Mt as rotateEventDestinationSecretWithSiteToken,tt as setOrderFulfillment,Ce as setProductSubscription,xe as setProductVariants,Fe as setVariantInventory,ot as teardownSiteSubscriptions,Qe as updateCustomer,xt as updateEventDestination,Vt as updateEventDestinationWithSiteToken,Tt as updateForm,Ue as updateOption,fe as updateProduct,ht as updateSite,Se as updateSiteAccountRoute,yt as updateSiteDomains,Ee as updateSitePayments,Le as updateVariant};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aifeatures/backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "TypeScript API client for aifeatures backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -21,6 +21,13 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"generate": "openapi-ts",
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"prepack": "pnpm build",
|
|
28
|
+
"dev": "tsup --watch",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
},
|
|
24
31
|
"devDependencies": {
|
|
25
32
|
"@hey-api/openapi-ts": "0.89.2",
|
|
26
33
|
"tsup": "^8.3.5",
|
|
@@ -28,11 +35,5 @@
|
|
|
28
35
|
},
|
|
29
36
|
"dependencies": {
|
|
30
37
|
"@hey-api/client-fetch": "0.13.1"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"generate": "openapi-ts",
|
|
34
|
-
"build": "tsup",
|
|
35
|
-
"dev": "tsup --watch",
|
|
36
|
-
"typecheck": "tsc --noEmit"
|
|
37
38
|
}
|
|
38
|
-
}
|
|
39
|
+
}
|