@aifeatures/backend 0.4.0 → 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.js CHANGED
@@ -1,7 +1,7 @@
1
- var $=(e,t,s)=>{typeof s=="string"?e.append(t,s):e.append(t,JSON.stringify(s))};var V={bodySerializer:e=>JSON.stringify(e,(t,s)=>typeof s=="bigint"?s.toString():s)},U={bodySerializer:e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([s,n])=>{n!=null&&(Array.isArray(n)?n.forEach(a=>$(t,s,a)):$(t,s,n))}),t.toString()}};var oe={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},_r=Object.entries(oe);var H=({onRequest:e,onSseError:t,onSseEvent:s,responseTransformer:n,responseValidator:a,sseDefaultRetryDelay:u,sseMaxRetryAttempts:c,sseMaxRetryDelay:i,sseSleepFn:p,url:l,...o})=>{let m,g=p??(d=>new Promise(E=>setTimeout(E,d)));return{stream:async function*(){let d=u??3e3,E=0,f=o.signal??new AbortController().signal;for(;!f.aborted;){E++;let P=o.headers instanceof Headers?o.headers:new Headers(o.headers);m!==void 0&&P.set("Last-Event-ID",m);try{let T={redirect:"follow",...o,body:o.serializedBody,headers:P,signal:f},b=new Request(l,T);e&&(b=await e(l,T));let S=await(o.fetch??globalThis.fetch)(b);if(!S.ok)throw new Error(`SSE failed: ${S.status} ${S.statusText}`);if(!S.body)throw new Error("No body in SSE response");let y=S.body.pipeThrough(new TextDecoderStream).getReader(),x="",q=()=>{try{y.cancel()}catch{}};f.addEventListener("abort",q);try{for(;;){let{done:ee,value:re}=await y.read();if(ee)break;x+=re,x=x.replace(/\r\n/g,`
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 W=x.split(`
3
+ `);let q=P.split(`
4
4
 
5
- `);x=W.pop()??"";for(let te of W){let se=te.split(`
6
- `),v=[],z;for(let R of se)if(R.startsWith("data:"))v.push(R.replace(/^data:\s*/,""));else if(R.startsWith("event:"))z=R.replace(/^event:\s*/,"");else if(R.startsWith("id:"))m=R.replace(/^id:\s*/,"");else if(R.startsWith("retry:")){let N=Number.parseInt(R.replace(/^retry:\s*/,""),10);Number.isNaN(N)||(d=N)}let C,B=!1;if(v.length){let R=v.join(`
7
- `);try{C=JSON.parse(R),B=!0}catch{C=R}}B&&(a&&await a(C),n&&(C=await n(C))),s?.({data:C,event:z,id:m,retry:d}),v.length&&(yield C)}}}finally{f.removeEventListener("abort",q),y.releaseLock()}break}catch(T){if(t?.(T),c!==void 0&&E>=c)break;let b=Math.min(d*2**(E-1),i??3e4);await g(b)}}}()}};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:t,name:s,style:n,value:a})=>{if(!t){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):w({allowReserved:e,name:s,value:i})).join(u);return n==="label"||n==="matrix"?u+c:c},w=({allowReserved:e,name:t,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`${t}=${e?s:encodeURIComponent(s)}`},L=({allowReserved:e,explode:t,name:s,style:n,value:a,valueOnly:u})=>{if(a instanceof Date)return u?a.toISOString():`${s}=${a.toISOString()}`;if(n!=="deepObject"&&!t){let p=[];Object.entries(a).forEach(([o,m])=>{p=[...p,o,e?m:encodeURIComponent(m)]});let l=p.join(",");switch(n){case"form":return`${s}=${l}`;case"label":return`.${l}`;case"matrix":return`;${s}=${l}`;default:return l}}let c=ie(n),i=Object.entries(a).map(([p,l])=>w({allowReserved:e,name:n==="deepObject"?`${s}[${p}]`:p,value:l})).join(c);return n==="label"||n==="matrix"?c+i:i};var ce=/\{[^{}]+\}/g,pe=({path:e,url:t})=>{let s=t,n=t.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,`;${w({name:c,value:p})}`);continue}let l=encodeURIComponent(i==="label"?`.${p}`:p);s=s.replace(a,l)}return s},J=({baseUrl:e,path:t,query:s,querySerializer:n,url:a})=>{let u=a.startsWith("/")?a:`/${a}`,c=(e??"")+u;t&&(c=pe({path:t,url:c}));let i=s?n(s):"";return i.startsWith("?")&&(i=i.substring(1)),i&&(c+=`?${i}`),c};function Q(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(t)return e.body}var _=async(e,t)=>{let s=typeof t=="function"?await t(e):t;if(s)return e.scheme==="bearer"?`Bearer ${s}`:e.scheme==="basic"?`Basic ${btoa(s)}`:s};var K=({parameters:e={},...t}={})=>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]||t;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=w({allowReserved:i.allowReserved,name:u,value:c});p&&a.push(p)}}return a.join("&")},X=e=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(s=>t.startsWith(s)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`)):!1,Y=async({security:e,...t})=>{for(let s of e){if(ue(t,s.name))continue;let n=await _(s,t.auth);if(!n)continue;let a=s.name??"Authorization";switch(s.in){case"query":t.query||(t.query={}),t.query[a]=n;break;case"cookie":t.headers.append("Cookie",`${a}=${n}`);break;case"header":default:t.headers.set(a,n);break}}},M=e=>J({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:K(e.querySerializer),url:e.url}),j=(e,t)=>{let s={...e,...t};return s.baseUrl?.endsWith("/")&&(s.baseUrl=s.baseUrl.substring(0,s.baseUrl.length-1)),s.headers=I(e.headers,t.headers),s},de=e=>{let t=[];return e.forEach((s,n)=>{t.push([n,s])}),t},I=(...e)=>{let t=new Headers;for(let s of e){if(!s)continue;let n=s instanceof Headers?de(s):Object.entries(s);for(let[a,u]of n)if(u===null)t.delete(a);else if(Array.isArray(u))for(let c of u)t.append(a,c);else u!==void 0&&t.set(a,typeof u=="object"?JSON.stringify(u):u)}return t},A=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){let s=this.getInterceptorIndex(t);this.fns[s]&&(this.fns[s]=null)}exists(t){let s=this.getInterceptorIndex(t);return!!this.fns[s]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,s){let n=this.getInterceptorIndex(t);return this.fns[n]?(this.fns[n]=s,t):!1}use(t){return this.fns.push(t),this.fns.length-1}},Z=()=>({error:new A,request:new A,response:new A}),le=K({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},D=(e={})=>({...V,headers:he,parseAs:"auto",querySerializer:le,...e});var F=(e={})=>{let t=j(D(),e),s=()=>({...t}),n=l=>(t=j(t,l),s()),a=Z(),u=async l=>{let o={...t,...l,fetch:l.fetch??t.fetch??globalThis.fetch,headers:I(t.headers,l.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 m=M(o);return{opts:o,url:m}},c=async l=>{let{opts:o,url:m}=await u(l),g={redirect:"follow",...o,body:Q(o)},O=new Request(m,g);for(let h of a.request.fns)h&&(O=await h(O,o));let k=o.fetch,d;try{d=await k(O)}catch(h){let S=h;for(let y of a.error.fns)y&&(S=await y(h,void 0,O,o));if(S=S||{},o.throwOnError)throw S;return o.responseStyle==="data"?void 0:{error:S,request:O,response:void 0}}for(let h of a.response.fns)h&&(d=await h(d,O,o));let E={request:O,response:d};if(d.ok){let h=(o.parseAs==="auto"?X(d.headers.get("Content-Type")):o.parseAs)??"json";if(d.status===204||d.headers.get("Content-Length")==="0"){let y;switch(h){case"arrayBuffer":case"blob":case"text":y=await d[h]();break;case"formData":y=new FormData;break;case"stream":y=d.body;break;case"json":default:y={};break}return o.responseStyle==="data"?y:{data:y,...E}}let S;switch(h){case"arrayBuffer":case"blob":case"formData":case"json":case"text":S=await d[h]();break;case"stream":return o.responseStyle==="data"?d.body:{data:d.body,...E}}return h==="json"&&(o.responseValidator&&await o.responseValidator(S),o.responseTransformer&&(S=await o.responseTransformer(S))),o.responseStyle==="data"?S:{data:S,...E}}let f=await d.text(),P;try{P=JSON.parse(f)}catch{}let T=P??f,b=T;for(let h of a.error.fns)h&&(b=await h(T,d,O,o));if(b=b||{},o.throwOnError)throw b;return o.responseStyle==="data"?void 0:{error:b,...E}},i=l=>o=>c({...o,method:l}),p=l=>async o=>{let{opts:m,url:g}=await u(o);return H({...m,body:m.body,headers:m.headers,method:l,onRequest:async(O,k)=>{let d=new Request(O,k);for(let E of a.request.fns)E&&(d=await E(d,m));return d},url:g})};return{buildUrl:M,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 r=F(D({baseUrl:"https://aifeatures.dev"}));var Se=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/payments",...e,headers:{"Content-Type":"application/json",...e.headers}}),me=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/account-route",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payments/status",...e}),ye=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e}),Oe=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e}),be=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/products",...e,headers:{"Content-Type":"application/json",...e.headers}}),fe=e=>(e.client??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),Te=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e}),Ce=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),we=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/file",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/subscription",...e,headers:{"Content-Type":"application/json",...e.headers}}),ge=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/test-order",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/test-subscription",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/test-orders",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/variants",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(e.client??r).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??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e}),Le=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/products/{productId}/options",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fe=e=>(e.client??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e}),Ve=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/options/{optionId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/variants/{variantId}/inventory/adjust",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders",...e}),qe=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}",...e}),We=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/refund",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/resend-receipt",...e}),Be=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/reset-downloads",...e}),Ne=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/webhook-events/{eventId}/reset",...e}),$e=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e}),He=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e}),Qe=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/customers/{customerId}/revoke-access",...e}),Ke=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/summary",...e}),Xe=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sales-summary",...e}),Ye=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people",...e}),Ze=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/people/{email}",...e}),er=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/payouts/next",...e}),rr=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/orders/{orderId}/fulfillment",...e,headers:{"Content-Type":"application/json",...e.headers}}),tr=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/subscriptions",...e}),sr=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/subscriptions/{subscriptionId}/cancel",...e}),or=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/subscriptions/teardown",...e,headers:{"Content-Type":"application/json",...e.headers}}),nr=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/subscriptions/reactivate-teardown",...e,headers:{"Content-Type":"application/json",...e.headers}}),ar=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/preview-session",...e,headers:{"Content-Type":"application/json",...e.headers}}),ir=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e}),cr=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),pr=e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e}),ur=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites",...e,headers:{"Content-Type":"application/json",...e.headers}}),dr=e=>(e.client??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),lr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e}),hr=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e}),mr=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/checkout-pause",...e,headers:{"Content-Type":"application/json",...e.headers}}),Er=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/domains",...e,headers:{"Content-Type":"application/json",...e.headers}}),yr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e}),Or=e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/sites/{siteId}/forms",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rr=e=>(e.client??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),br=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e}),fr=e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/forms/{formId}/submissions",...e}),Cr=e=>(e.client??r).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),wr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}",...e}),Dr=e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/submissions/{submissionId}/attachments/{attachmentId}",...e}),gr=e=>(e.client??r).get({url:"/v1/p/{productId}",...e}),Pr=e=>(e.client??r).post({url:"/v1/p/{productId}/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),xr=e=>(e.client??r).post({url:"/v1/p/checkout",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ar=e=>(e.client??r).post({url:"/v1/p/checkout/summary",...e,headers:{"Content-Type":"application/json",...e.headers}}),kr=e=>(e.client??r).get({url:"/v1/o/session/{sessionId}",...e}),vr=e=>(e.client??r).get({url:"/v1/d/{token}",...e}),Gr=e=>(e?.client??r).get({url:"/v1/geo",...e}),Lr=e=>(e.client??r).post({url:"/v1/account/login",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ir=e=>(e.client??r).post({url:"/v1/account/verify",...e,headers:{"Content-Type":"application/json",...e.headers}}),Fr=e=>(e?.client??r).post({url:"/v1/account/logout",...e}),Vr=e=>(e?.client??r).get({url:"/v1/account/me",...e}),Ur=e=>(e.client??r).post({url:"/v1/account/subscribe",...e,headers:{"Content-Type":"application/json",...e.headers}}),Mr=e=>(e.client??r).post({url:"/v1/account/subscriptions/{subscriptionId}/cancel",...e}),jr=e=>(e.client??r).post({url:"/v1/account/subscriptions/{subscriptionId}/reactivate",...e}),qr=e=>(e.client??r).post({url:"/v1/account/subscriptions/{subscriptionId}/address",...e,headers:{"Content-Type":"application/json",...e.headers}}),Wr=e=>(e.client??r).post({url:"/v1/account/subscriptions/{subscriptionId}/portal-session",...e}),zr=e=>(e.client??r).post({url:"/v1/account/manage/verify",...e,headers:{"Content-Type":"application/json",...e.headers}}),Br=e=>(e?.client??r).get({url:"/v1/account/manage/subscription",...e}),Nr=e=>(e?.client??r).post({url:"/v1/account/manage/cancel",...e}),$r=e=>(e?.client??r).post({url:"/v1/account/manage/portal-session",...e}),Hr=e=>(e.client??r).get({url:"/v1/m/{token}",...e}),Jr=e=>(e.client??r).post({...U,url:"/v1/m/{token}",...e,headers:{"Content-Type":"application/x-www-form-urlencoded",...e.headers}});export{Mr as accountCancelSubscription,Wr as accountCreatePortalSession,Lr as accountLogin,Fr as accountLogout,Nr as accountManageCancel,Br as accountManageGetSubscription,$r as accountManagePortalSession,zr as accountManageVerify,Vr as accountMe,jr as accountReactivateSubscription,Ur as accountSubscribe,qr as accountUpdateSubscriptionAddress,Ir as accountVerify,Jr as actOnManageLink,Me as adjustVariantInventory,we as attachProductFile,sr as cancelSubscription,xr as createCartCheckout,Pr as createCheckout,F as createClient,D as createConfig,He as createCustomer,Or as createForm,cr as createFormWithSiteToken,xe as createMultiItemTestOrder,Ie as createOption,ar as createPreviewSession,be as createProduct,Oe as createProductWithSiteToken,ur as createSite,ge as createTestOrder,Pe as createTestSubscription,Ae as createVariant,Rr as deleteForm,Fe as deleteOption,fe as deleteProduct,dr as deleteSite,Cr as deleteSubmission,Ge as deleteVariant,Dr as downloadAttachment,vr as downloadFile,ve as generateVariants,Ke as getBusinessSummary,Ar as getCartSummary,Je as getCustomer,br as getForm,Gr as getGeo,er as getNextPayout,qe as getOrder,kr as getOrderSession,Ee as getPaymentsStatus,Ze as getPerson,Te as getProduct,gr as getPublicProduct,Xe as getSalesSummary,lr as getSite,Sr as getSiteCheckoutPause,wr as getSubmission,$e as listCustomers,yr as listForms,ir as listFormsWithSiteToken,je as listOrdersWithSiteToken,Ye as listPeople,Re as listProducts,ye as listProductsWithSiteToken,pr as listSites,Tr as listSubmissions,tr as listSubscriptions,mr as pauseSiteCheckout,nr as reactivateSiteSubscriptionsTeardown,We as refundOrder,ze as resendOrderReceipt,Be as resetOrderDownloads,Ne as resetWebhookEvent,Hr as resolveManageLink,_e as revokeCustomerAccess,rr as setOrderFulfillment,De as setProductSubscription,ke as setProductVariants,Ue as setVariantInventory,or as teardownSiteSubscriptions,Qe as updateCustomer,fr as updateForm,Ve as updateOption,Ce as updateProduct,hr as updateSite,me as updateSiteAccountRoute,Er as updateSiteDomains,Se as updateSitePayments,Le 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.4.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
+ }