rehive 4.0.0 → 4.1.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/admin.d.mts +15619 -15396
- package/dist/admin.d.ts +15619 -15396
- package/dist/admin.js +1 -1
- package/dist/admin.mjs +1 -1
- package/dist/auth.d.mts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +1 -1
- package/dist/auth.mjs +1 -1
- package/dist/{chunk-RKDIBDG6.js → chunk-7WQMKBQ6.js} +1 -1
- package/dist/{chunk-NFN3B6SG.mjs → chunk-CUQ6U73E.mjs} +1 -1
- package/dist/chunk-DRLSOKDI.js +7 -0
- package/dist/{chunk-53JJUQ4V.js → chunk-GR5TETAU.js} +1 -1
- package/dist/{chunk-QWQ6ZENI.js → chunk-JK4JOKBZ.js} +1 -1
- package/dist/chunk-KQ5BJOW2.mjs +1 -0
- package/dist/{chunk-V277OEVY.mjs → chunk-KUM3UI4C.mjs} +1 -1
- package/dist/{chunk-7WWCXCY2.mjs → chunk-S5UXBHRU.mjs} +1 -1
- package/dist/chunk-UMUOM4B2.mjs +7 -0
- package/dist/chunk-YRYX3G3E.js +1 -0
- package/dist/{create-api-client-BrsH1l8c.d.mts → create-api-client-2vNCP2LN.d.mts} +1 -1
- package/dist/{create-api-client-BMeX50D6.d.ts → create-api-client-D-Z8R83N.d.ts} +1 -1
- package/dist/{create-auth-UTklIOTc.d.mts → create-auth-CHzmb_8_.d.mts} +4846 -4616
- package/dist/{create-auth-UTklIOTc.d.ts → create-auth-CHzmb_8_.d.ts} +4846 -4616
- package/dist/extensions/alchemy.d.mts +3 -3
- package/dist/extensions/alchemy.d.ts +3 -3
- package/dist/extensions/alchemy.js +2 -2
- package/dist/extensions/alchemy.mjs +1 -1
- package/dist/extensions/app.d.mts +3 -3
- package/dist/extensions/app.d.ts +3 -3
- package/dist/extensions/app.js +2 -2
- package/dist/extensions/app.mjs +1 -1
- package/dist/extensions/billing.d.mts +3 -3
- package/dist/extensions/billing.d.ts +3 -3
- package/dist/extensions/billing.js +2 -2
- package/dist/extensions/billing.mjs +1 -1
- package/dist/extensions/bridge.d.mts +3 -3
- package/dist/extensions/bridge.d.ts +3 -3
- package/dist/extensions/bridge.js +2 -2
- package/dist/extensions/bridge.mjs +1 -1
- package/dist/extensions/builder.d.mts +3 -3
- package/dist/extensions/builder.d.ts +3 -3
- package/dist/extensions/builder.js +2 -2
- package/dist/extensions/builder.mjs +1 -1
- package/dist/extensions/business.d.mts +3 -3
- package/dist/extensions/business.d.ts +3 -3
- package/dist/extensions/business.js +2 -2
- package/dist/extensions/business.mjs +1 -1
- package/dist/extensions/conversion.d.mts +3 -3
- package/dist/extensions/conversion.d.ts +3 -3
- package/dist/extensions/conversion.js +2 -2
- package/dist/extensions/conversion.mjs +1 -1
- package/dist/extensions/mass-send.d.mts +3 -3
- package/dist/extensions/mass-send.d.ts +3 -3
- package/dist/extensions/mass-send.js +2 -2
- package/dist/extensions/mass-send.mjs +1 -1
- package/dist/extensions/notifications.d.mts +3 -3
- package/dist/extensions/notifications.d.ts +3 -3
- package/dist/extensions/notifications.js +2 -2
- package/dist/extensions/notifications.mjs +1 -1
- package/dist/extensions/payment-requests.d.mts +3 -3
- package/dist/extensions/payment-requests.d.ts +3 -3
- package/dist/extensions/payment-requests.js +2 -2
- package/dist/extensions/payment-requests.mjs +1 -1
- package/dist/extensions/products.d.mts +3 -3
- package/dist/extensions/products.d.ts +3 -3
- package/dist/extensions/products.js +2 -2
- package/dist/extensions/products.mjs +1 -1
- package/dist/extensions/rain.d.mts +3 -3
- package/dist/extensions/rain.d.ts +3 -3
- package/dist/extensions/rain.js +2 -2
- package/dist/extensions/rain.mjs +1 -1
- package/dist/extensions/rewards.d.mts +3 -3
- package/dist/extensions/rewards.d.ts +3 -3
- package/dist/extensions/rewards.js +2 -2
- package/dist/extensions/rewards.mjs +1 -1
- package/dist/extensions/stellar-testnet.d.mts +3 -3
- package/dist/extensions/stellar-testnet.d.ts +3 -3
- package/dist/extensions/stellar-testnet.js +2 -2
- package/dist/extensions/stellar-testnet.mjs +1 -1
- package/dist/extensions/stellar.d.mts +3 -3
- package/dist/extensions/stellar.d.ts +3 -3
- package/dist/extensions/stellar.js +2 -2
- package/dist/extensions/stellar.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/user.d.mts +4 -4
- package/dist/user.d.ts +4 -4
- package/dist/user.js +1 -1
- package/dist/user.mjs +1 -1
- package/package.json +1 -1
- package/src/auth/create-auth.ts +7 -7
- package/src/extensions/alchemy/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/app/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/billing/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/bridge/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/builder/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/business/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/conversion/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/mass-send/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/notifications/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/payment-requests/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/products/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/rain/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/rewards/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/stellar/openapi-ts/client/types.gen.ts +1 -0
- package/src/extensions/stellar-testnet/openapi-ts/client/types.gen.ts +1 -0
- package/src/platform/admin/openapi-ts/client/types.gen.ts +1 -0
- package/src/platform/admin/openapi-ts/index.ts +1 -1
- package/src/platform/admin/openapi-ts/sdk.gen.ts +14 -14
- package/src/platform/admin/openapi-ts/types.gen.ts +11181 -10946
- package/src/platform/user/openapi-ts/client/types.gen.ts +1 -0
- package/src/platform/user/openapi-ts/index.ts +1 -1
- package/src/platform/user/openapi-ts/sdk.gen.ts +3 -3
- package/src/platform/user/openapi-ts/types.gen.ts +7224 -6984
- package/src/shared/create-api-client.ts +1 -0
- package/dist/chunk-5MRX4DHT.js +0 -1
- package/dist/chunk-HF5XDXOU.mjs +0 -1
- package/dist/chunk-Q2ZX3WFY.mjs +0 -7
- package/dist/chunk-UYUMXTPF.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var B={};_chunkOEIQFP6Tjs.a.call(void 0, B,{activateCreate:()=>fe,adminCompanyPartialUpdate:()=>Oe,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>we,adminConversionPairsCreate:()=>Ce,adminConversionPairsDestroy:()=>Ae,adminConversionPairsList:()=>ge,adminConversionPairsPartialUpdate:()=>Te,adminConversionPairsRetrieve:()=>be,adminConversionPairsUpdate:()=>xe,adminConversionsCreate:()=>ve,adminConversionsList:()=>Ee,adminConversionsPartialUpdate:()=>ke,adminConversionsRetrieve:()=>Ue,adminConversionsUpdate:()=>Se,adminCurrenciesCreate:()=>Pe,adminCurrenciesList:()=>De,adminCurrenciesPartialUpdate:()=>Ie,adminCurrenciesRetrieve:()=>ze,adminCurrenciesUpdate:()=>je,adminIntegrationsCreate:()=>Le,adminIntegrationsDestroy:()=>Ke,adminIntegrationsList:()=>qe,adminIntegrationsPartialUpdate:()=>Be,adminIntegrationsRetrieve:()=>We,adminIntegrationsUpdate:()=>_e,adminIntegrationsWebhooksCreate:()=>Ne,adminIntegrationsWebhooksDestroy:()=>He,adminIntegrationsWebhooksList:()=>$e,adminIntegrationsWebhooksPartialUpdate:()=>Fe,adminIntegrationsWebhooksRetrieve:()=>Ve,adminIntegrationsWebhooksUpdate:()=>Je,adminRatePairsCreate:()=>Qe,adminRatePairsDestroy:()=>Ge,adminRatePairsList:()=>Me,adminRatePairsPartialUpdate:()=>Ye,adminRatePairsRetrieve:()=>Xe,adminRatePairsUpdate:()=>Ze,adminUsersList:()=>er,adminUsersPartialUpdate:()=>nr,adminUsersRetrieve:()=>rr,adminUsersUpdate:()=>tr,deactivateCreate:()=>sr,userConversionPairsList:()=>or,userConversionPairsRetrieve:()=>ir,userConversionsCreate:()=>pr,userConversionsList:()=>ar,userConversionsPartialUpdate:()=>lr,userConversionsRetrieve:()=>dr,userConversionsUpdate:()=>cr,userCurrenciesList:()=>ur,userCurrenciesRetrieve:()=>yr,userRatesList:()=>hr,userRatesRetrieve:()=>mr,userRatesSnapshotRetrieve:()=>fr,userRatesSnapshotsList:()=>Rr,userSettingsPartialUpdate:()=>wr,userSettingsRetrieve:()=>Or,userSettingsUpdate:()=>gr,webhookCreate:()=>Cr});var q={bodySerializer:e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString():n)};var ie={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Tr=Object.entries(ie);var M=({onRequest:e,onSseError:r,onSseEvent:n,responseTransformer:i,responseValidator:o,sseDefaultRetryDelay:l,sseMaxRetryAttempts:p,sseMaxRetryDelay:a,sseSleepFn:d,url:u,...s})=>{let m,x=_nullishCoalesce(d, () => ((c=>new Promise(R=>setTimeout(R,c)))));return{stream:async function*(){let c=_nullishCoalesce(l, () => (3e3)),R=0,C=_nullishCoalesce(s.signal, () => (new AbortController().signal));for(;!C.aborted;){R++;let E=s.headers instanceof Headers?s.headers:new Headers(s.headers);m!==void 0&&E.set("Last-Event-ID",m);try{let A={redirect:"follow",...s,body:s.serializedBody,headers:E,signal:C},g=new Request(u,A);e&&(g=await e(u,A));let y=await(_nullishCoalesce(s.fetch, () => (globalThis.fetch)))(g);if(!y.ok)throw new Error(`SSE failed: ${y.status} ${y.statusText}`);if(!y.body)throw new Error("No body in SSE response");let f=y.body.pipeThrough(new TextDecoderStream).getReader(),v="",_=()=>{try{f.cancel()}catch (e2){}};C.addEventListener("abort",_);try{for(;;){let{done:re,value:ne}=await f.read();if(re)break;v+=ne,v=v.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let $=v.split(`
|
|
4
4
|
|
|
5
5
|
`);v=_nullishCoalesce($.pop(), () => (""));for(let te of $){let se=te.split(`
|
|
6
6
|
`),P=[],N;for(let w of se)if(w.startsWith("data:"))P.push(w.replace(/^data:\s*/,""));else if(w.startsWith("event:"))N=w.replace(/^event:\s*/,"");else if(w.startsWith("id:"))m=w.replace(/^id:\s*/,"");else if(w.startsWith("retry:")){let V=Number.parseInt(w.replace(/^retry:\s*/,""),10);Number.isNaN(V)||(c=V)}let b,H=!1;if(P.length){let w=P.join(`
|
|
7
|
-
`);try{b=JSON.parse(w),H=!0}catch (e3){b=w}}H&&(o&&await o(b),i&&(b=await i(b))),_optionalChain([n, 'optionalCall', _2 => _2({data:b,event:N,id:m,retry:c})]),P.length&&(yield b)}}}finally{C.removeEventListener("abort",_),f.releaseLock()}break}catch(A){if(_optionalChain([r, 'optionalCall', _3 => _3(A)]),p!==void 0&&R>=p)break;let g=Math.min(c*2**(R-1),_nullishCoalesce(a, () => (3e4)));await x(g)}}}()}};var ae=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:n,style:i,value:o})=>{if(!r){let a=(e?o:o.map(d=>encodeURIComponent(d))).join(pe(i));switch(i){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let l=ae(i),p=o.map(a=>i==="label"||i==="simple"?e?a:encodeURIComponent(a):T({allowReserved:e,name:n,value:a})).join(l);return i==="label"||i==="matrix"?l+p:p},T=({allowReserved:e,name:r,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?n:encodeURIComponent(n)}`},I=({allowReserved:e,explode:r,name:n,style:i,value:o,valueOnly:l})=>{if(o instanceof Date)return l?o.toISOString():`${n}=${o.toISOString()}`;if(i!=="deepObject"&&!r){let d=[];Object.entries(o).forEach(([s,m])=>{d=[...d,s,e?m:encodeURIComponent(m)]});let u=d.join(",");switch(i){case"form":return`${n}=${u}`;case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;default:return u}}let p=de(i),a=Object.entries(o).map(([d,u])=>T({allowReserved:e,name:i==="deepObject"?`${n}[${d}]`:d,value:u})).join(p);return i==="label"||i==="matrix"?p+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:r})=>{let n=r,i=r.match(le);if(i)for(let o of i){let l=!1,p=o.substring(1,o.length-1),a="simple";p.endsWith("*")&&(l=!0,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),a="label"):p.startsWith(";")&&(p=p.substring(1),a="matrix");let d=e[p];if(d==null)continue;if(Array.isArray(d)){n=n.replace(o,z({explode:l,name:p,style:a,value:d}));continue}if(typeof d=="object"){n=n.replace(o,I({explode:l,name:p,style:a,value:d,valueOnly:!0}));continue}if(a==="matrix"){n=n.replace(o,`;${T({name:p,value:d})}`);continue}let u=encodeURIComponent(a==="label"?`.${d}`:d);n=n.replace(o,u)}return n},Q=({baseUrl:e,path:r,query:n,querySerializer:i,url:o})=>{let l=o.startsWith("/")?o:`/${o}`,p=(_nullishCoalesce(e, () => ("")))+l;r&&(p=ce({path:r,url:p}));let a=n?i(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(p+=`?${a}`),p};function L(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 G=async(e,r)=>{let n=typeof r=="function"?await r(e):r;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n};var X=({parameters:e={},...r}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let l in i){let p=i[l];if(p==null)continue;let a=e[l]||r;if(Array.isArray(p)){let d=z({allowReserved:a.allowReserved,explode:!0,name:l,style:"form",value:p,...a.array});d&&o.push(d)}else if(typeof p=="object"){let d=I({allowReserved:a.allowReserved,explode:!0,name:l,style:"deepObject",value:p,...a.object});d&&o.push(d)}else{let d=T({allowReserved:a.allowReserved,name:l,value:p});d&&o.push(d)}}return o.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);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(n=>r.startsWith(n)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1,Z=async({security:e,...r})=>{for(let n of e){if(ue(r,n.name))continue;let i=await G(n,r.auth);if(!i)continue;let o=_nullishCoalesce(n.name, () => ("Authorization"));switch(n.in){case"query":r.query||(r.query={}),r.query[o]=i;break;case"cookie":r.headers.append("Cookie",`${o}=${i}`);break;case"header":default:r.headers.set(o,i);break}}},K=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),W=(e,r)=>{let n={...e,...r};return _optionalChain([n, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=j(e.headers,r.headers),n},ye=e=>{let r=[];return e.forEach((n,i)=>{r.push([i,n])}),r},j=(...e)=>{let r=new Headers;for(let n of e){if(!n)continue;let i=n instanceof Headers?ye(n):Object.entries(n);for(let[o,l]of i)if(l===null)r.delete(o);else if(Array.isArray(l))for(let p of l)r.append(o,p);else l!==void 0&&r.set(o,typeof l=="object"?JSON.stringify(l):l)}return r},U=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let n=this.getInterceptorIndex(r);this.fns[n]&&(this.fns[n]=null)}exists(r){let n=this.getInterceptorIndex(r);return!!this.fns[n]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,n){let i=this.getInterceptorIndex(r);return this.fns[i]?(this.fns[i]=n,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new U,request:new U,response:new U}),he=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},k=(e={})=>({...q,headers:me,parseAs:"auto",querySerializer:he,...e});var S=(e={})=>{let r=W(k(),e),n=()=>({...r}),i=u=>(r=W(r,u),n()),o=ee(),l=async u=>{let s={...r,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:j(r.headers,u.headers),serializedBody:void 0};s.security&&await Z({...s,security:s.security}),s.requestValidator&&await s.requestValidator(s),s.body!==void 0&&s.bodySerializer&&(s.serializedBody=s.bodySerializer(s.body)),(s.body===void 0||s.serializedBody==="")&&s.headers.delete("Content-Type");let m=K(s);return{opts:s,url:m}},p=async u=>{let{opts:s,url:m}=await l(u),x={redirect:"follow",...s,body:L(s)},O=new Request(m,x);for(let h of o.request.fns)h&&(O=await h(O,s));let D=s.fetch,c;try{c=await D(O)}catch(h){let y=h;for(let f of o.error.fns)f&&(y=await f(h,void 0,O,s));if(y=y||{},s.throwOnError)throw y;return s.responseStyle==="data"?void 0:{error:y,request:O,response:void 0}}for(let h of o.response.fns)h&&(c=await h(c,O,s));let R={request:O,response:c};if(c.ok){let h=_nullishCoalesce((s.parseAs==="auto"?Y(c.headers.get("Content-Type")):s.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 s.responseStyle==="data"?f:{data:f,...R}}let y;switch(h){case"arrayBuffer":case"blob":case"formData":case"text":y=await c[h]();break;case"json":{let f=await c.text();y=f?JSON.parse(f):{};break}case"stream":return s.responseStyle==="data"?c.body:{data:c.body,...R}}return h==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),s.responseStyle==="data"?y:{data:y,...R}}let C=await c.text(),E;try{E=JSON.parse(C)}catch (e4){}let A=_nullishCoalesce(E, () => (C)),g=A;for(let h of o.error.fns)h&&(g=await h(A,c,O,s));if(g=g||{},s.throwOnError)throw g;return s.responseStyle==="data"?void 0:{error:g,...R}},a=u=>s=>p({...s,method:u}),d=u=>async s=>{let{opts:m,url:x}=await l(s);return M({...m,body:m.body,headers:m.headers,method:u,onRequest:async(O,D)=>{let c=new Request(O,D);for(let R of o.request.fns)R&&(c=await R(c,m));return c},serializedBody:L(m),url:x})};return{buildUrl:K,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:n,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:p,setConfig:i,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:a("TRACE")}};var t=S(k({baseUrl:"https://conversion.services.rehive.com/api/"}));var fe=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/",...e}),Ce=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e}),be=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/",...e}),ve=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (t))).get({querySerializer:{parameters:{code__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e}),We=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),$e=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/webhooks/",...e}),Ne=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/webhooks/",...e,headers:{"Content-Type":"application/json",...e.headers}}),He=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e}),Ve=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e}),Fe=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/",...e}),Qe=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ge=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e}),Xe=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e}),Ye=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ze=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),er=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (t))).get({querySerializer:{parameters:{display_currency__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),rr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),nr=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),tr=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),sr=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),or=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversion-pairs/",...e}),ir=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversion-pairs/{identifier}/",...e}),ar=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/",...e}),pr=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/",...e,headers:{"Content-Type":"application/json",...e.headers}}),dr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e}),lr=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),cr=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ur=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (t))).get({querySerializer:{parameters:{code__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/currencies/",...e}),yr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/currencies/{code}/",...e}),hr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _33 => _33.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/",...e}),mr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/{identifier}/",...e}),fr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _34 => _34.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/snapshot/",...e}),Rr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _35 => _35.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/snapshots/",...e}),Or=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _36 => _36.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e}),wr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _37 => _37.client]), () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _38 => _38.headers])}}),gr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _39 => _39.client]), () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _40 => _40.headers])}}),Cr=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function Ar(e){let r=S(_chunk53JJUQ4Vjs.c.call(void 0, e,"https://conversion.services.rehive.com/api/"));return _chunk53JJUQ4Vjs.a.call(void 0, B,r)}exports.createConversionApi = Ar;
|
|
7
|
+
`);try{b=JSON.parse(w),H=!0}catch (e3){b=w}}H&&(o&&await o(b),i&&(b=await i(b))),_optionalChain([n, 'optionalCall', _2 => _2({data:b,event:N,id:m,retry:c})]),P.length&&(yield b)}}}finally{C.removeEventListener("abort",_),f.releaseLock()}break}catch(A){if(_optionalChain([r, 'optionalCall', _3 => _3(A)]),p!==void 0&&R>=p)break;let g=Math.min(c*2**(R-1),_nullishCoalesce(a, () => (3e4)));await x(g)}}}()}};var ae=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},z=({allowReserved:e,explode:r,name:n,style:i,value:o})=>{if(!r){let a=(e?o:o.map(d=>encodeURIComponent(d))).join(pe(i));switch(i){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let l=ae(i),p=o.map(a=>i==="label"||i==="simple"?e?a:encodeURIComponent(a):T({allowReserved:e,name:n,value:a})).join(l);return i==="label"||i==="matrix"?l+p:p},T=({allowReserved:e,name:r,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?n:encodeURIComponent(n)}`},I=({allowReserved:e,explode:r,name:n,style:i,value:o,valueOnly:l})=>{if(o instanceof Date)return l?o.toISOString():`${n}=${o.toISOString()}`;if(i!=="deepObject"&&!r){let d=[];Object.entries(o).forEach(([s,m])=>{d=[...d,s,e?m:encodeURIComponent(m)]});let u=d.join(",");switch(i){case"form":return`${n}=${u}`;case"label":return`.${u}`;case"matrix":return`;${n}=${u}`;default:return u}}let p=de(i),a=Object.entries(o).map(([d,u])=>T({allowReserved:e,name:i==="deepObject"?`${n}[${d}]`:d,value:u})).join(p);return i==="label"||i==="matrix"?p+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:r})=>{let n=r,i=r.match(le);if(i)for(let o of i){let l=!1,p=o.substring(1,o.length-1),a="simple";p.endsWith("*")&&(l=!0,p=p.substring(0,p.length-1)),p.startsWith(".")?(p=p.substring(1),a="label"):p.startsWith(";")&&(p=p.substring(1),a="matrix");let d=e[p];if(d==null)continue;if(Array.isArray(d)){n=n.replace(o,z({explode:l,name:p,style:a,value:d}));continue}if(typeof d=="object"){n=n.replace(o,I({explode:l,name:p,style:a,value:d,valueOnly:!0}));continue}if(a==="matrix"){n=n.replace(o,`;${T({name:p,value:d})}`);continue}let u=encodeURIComponent(a==="label"?`.${d}`:d);n=n.replace(o,u)}return n},Q=({baseUrl:e,path:r,query:n,querySerializer:i,url:o})=>{let l=o.startsWith("/")?o:`/${o}`,p=(_nullishCoalesce(e, () => ("")))+l;r&&(p=ce({path:r,url:p}));let a=n?i(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(p+=`?${a}`),p};function L(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 G=async(e,r)=>{let n=typeof r=="function"?await r(e):r;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n};var X=({parameters:e={},...r}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let l in i){let p=i[l];if(p==null)continue;let a=e[l]||r;if(Array.isArray(p)){let d=z({allowReserved:a.allowReserved,explode:!0,name:l,style:"form",value:p,...a.array});d&&o.push(d)}else if(typeof p=="object"){let d=I({allowReserved:a.allowReserved,explode:!0,name:l,style:"deepObject",value:p,...a.object});d&&o.push(d)}else{let d=T({allowReserved:a.allowReserved,name:l,value:p});d&&o.push(d)}}return o.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);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(n=>r.startsWith(n)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1,Z=async({security:e,...r})=>{for(let n of e){if(ue(r,n.name))continue;let i=await G(n,r.auth);if(!i)continue;let o=_nullishCoalesce(n.name, () => ("Authorization"));switch(n.in){case"query":r.query||(r.query={}),r.query[o]=i;break;case"cookie":r.headers.append("Cookie",`${o}=${i}`);break;case"header":default:r.headers.set(o,i);break}}},K=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),W=(e,r)=>{let n={...e,...r};return _optionalChain([n, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=j(e.headers,r.headers),n},ye=e=>{let r=[];return e.forEach((n,i)=>{r.push([i,n])}),r},j=(...e)=>{let r=new Headers;for(let n of e){if(!n)continue;let i=n instanceof Headers?ye(n):Object.entries(n);for(let[o,l]of i)if(l===null)r.delete(o);else if(Array.isArray(l))for(let p of l)r.append(o,p);else l!==void 0&&r.set(o,typeof l=="object"?JSON.stringify(l):l)}return r},U=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let n=this.getInterceptorIndex(r);this.fns[n]&&(this.fns[n]=null)}exists(r){let n=this.getInterceptorIndex(r);return!!this.fns[n]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,n){let i=this.getInterceptorIndex(r);return this.fns[i]?(this.fns[i]=n,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new U,request:new U,response:new U}),he=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},k=(e={})=>({...q,headers:me,parseAs:"auto",querySerializer:he,...e});var S=(e={})=>{let r=W(k(),e),n=()=>({...r}),i=u=>(r=W(r,u),n()),o=ee(),l=async u=>{let s={...r,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:j(r.headers,u.headers),serializedBody:void 0};s.security&&await Z({...s,security:s.security}),s.requestValidator&&await s.requestValidator(s),s.body!==void 0&&s.bodySerializer&&(s.serializedBody=s.bodySerializer(s.body)),(s.body===void 0||s.serializedBody==="")&&s.headers.delete("Content-Type");let m=K(s);return{opts:s,url:m}},p=async u=>{let{opts:s,url:m}=await l(u),x={redirect:"follow",...s,body:L(s)},O=new Request(m,x);for(let h of o.request.fns)h&&(O=await h(O,s));let D=s.fetch,c;try{c=await D(O)}catch(h){let y=h;for(let f of o.error.fns)f&&(y=await f(h,void 0,O,s));if(y=y||{},s.throwOnError)throw y;return s.responseStyle==="data"?void 0:{error:y,request:O,response:void 0}}for(let h of o.response.fns)h&&(c=await h(c,O,s));let R={request:O,response:c};if(c.ok){let h=_nullishCoalesce((s.parseAs==="auto"?Y(c.headers.get("Content-Type")):s.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 s.responseStyle==="data"?f:{data:f,...R}}let y;switch(h){case"arrayBuffer":case"blob":case"formData":case"text":y=await c[h]();break;case"json":{let f=await c.text();y=f?JSON.parse(f):{};break}case"stream":return s.responseStyle==="data"?c.body:{data:c.body,...R}}return h==="json"&&(s.responseValidator&&await s.responseValidator(y),s.responseTransformer&&(y=await s.responseTransformer(y))),s.responseStyle==="data"?y:{data:y,...R}}let C=await c.text(),E;try{E=JSON.parse(C)}catch (e4){}let A=_nullishCoalesce(E, () => (C)),g=A;for(let h of o.error.fns)h&&(g=await h(A,c,O,s));if(g=g||{},s.throwOnError)throw g;return s.responseStyle==="data"?void 0:{error:g,...R}},a=u=>s=>p({...s,method:u}),d=u=>async s=>{let{opts:m,url:x}=await l(s);return M({...m,body:m.body,headers:m.headers,method:u,onRequest:async(O,D)=>{let c=new Request(O,D);for(let R of o.request.fns)R&&(c=await R(c,m));return c},serializedBody:L(m),url:x})};return{buildUrl:K,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:n,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:p,setConfig:i,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:a("TRACE")}};var t=S(k({baseUrl:"https://conversion.services.rehive.com/api/"}));var fe=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/",...e}),Ce=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e}),be=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversion-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/",...e}),ve=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Se=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (t))).get({querySerializer:{parameters:{code__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e}),We=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),$e=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/webhooks/",...e}),Ne=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{identifier}/webhooks/",...e,headers:{"Content-Type":"application/json",...e.headers}}),He=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e}),Ve=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e}),Fe=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/integrations/{integration_id}/webhooks/{webhook_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/",...e}),Qe=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ge=e=>(_nullishCoalesce(e.client, () => (t))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e}),Xe=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e}),Ye=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ze=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/rate-pairs/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),er=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (t))).get({querySerializer:{parameters:{display_currency__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/",...e}),rr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e}),nr=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),tr=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/users/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),sr=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),or=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversion-pairs/",...e}),ir=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversion-pairs/{identifier}/",...e}),ar=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/",...e}),pr=e=>(_nullishCoalesce(e.client, () => (t))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/",...e,headers:{"Content-Type":"application/json",...e.headers}}),dr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e}),lr=e=>(_nullishCoalesce(e.client, () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),cr=e=>(_nullishCoalesce(e.client, () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/conversions/{identifier}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ur=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (t))).get({querySerializer:{parameters:{code__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/currencies/",...e}),yr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/currencies/{code}/",...e}),hr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _33 => _33.client]), () => (t))).get({querySerializer:{parameters:{key__in:{array:{explode:!1}}}},security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/",...e}),mr=e=>(_nullishCoalesce(e.client, () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/{identifier}/",...e}),fr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _34 => _34.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/snapshot/",...e}),Rr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _35 => _35.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/rates/snapshots/",...e}),Or=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _36 => _36.client]), () => (t))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e}),wr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _37 => _37.client]), () => (t))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _38 => _38.headers])}}),gr=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _39 => _39.client]), () => (t))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/settings/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _40 => _40.headers])}}),Cr=e=>(_nullishCoalesce(e.client, () => (t))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function Ar(e){let r=S(_chunkGR5TETAUjs.c.call(void 0, e,"https://conversion.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, B,r)}exports.createConversionApi = Ar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as F,c as J}from"../chunk-
|
|
1
|
+
import{a as F,c as J}from"../chunk-S5UXBHRU.mjs";import{a as oe}from"../chunk-S4QKN5WW.mjs";var B={};oe(B,{activateCreate:()=>fe,adminCompanyPartialUpdate:()=>Oe,adminCompanyRetrieve:()=>Re,adminCompanyUpdate:()=>we,adminConversionPairsCreate:()=>Ce,adminConversionPairsDestroy:()=>Ae,adminConversionPairsList:()=>ge,adminConversionPairsPartialUpdate:()=>Te,adminConversionPairsRetrieve:()=>be,adminConversionPairsUpdate:()=>xe,adminConversionsCreate:()=>ve,adminConversionsList:()=>Ee,adminConversionsPartialUpdate:()=>ke,adminConversionsRetrieve:()=>Ue,adminConversionsUpdate:()=>Se,adminCurrenciesCreate:()=>Pe,adminCurrenciesList:()=>De,adminCurrenciesPartialUpdate:()=>Ie,adminCurrenciesRetrieve:()=>ze,adminCurrenciesUpdate:()=>je,adminIntegrationsCreate:()=>Le,adminIntegrationsDestroy:()=>Ke,adminIntegrationsList:()=>qe,adminIntegrationsPartialUpdate:()=>Be,adminIntegrationsRetrieve:()=>We,adminIntegrationsUpdate:()=>_e,adminIntegrationsWebhooksCreate:()=>Ne,adminIntegrationsWebhooksDestroy:()=>He,adminIntegrationsWebhooksList:()=>$e,adminIntegrationsWebhooksPartialUpdate:()=>Fe,adminIntegrationsWebhooksRetrieve:()=>Ve,adminIntegrationsWebhooksUpdate:()=>Je,adminRatePairsCreate:()=>Qe,adminRatePairsDestroy:()=>Ge,adminRatePairsList:()=>Me,adminRatePairsPartialUpdate:()=>Ye,adminRatePairsRetrieve:()=>Xe,adminRatePairsUpdate:()=>Ze,adminUsersList:()=>er,adminUsersPartialUpdate:()=>nr,adminUsersRetrieve:()=>rr,adminUsersUpdate:()=>tr,deactivateCreate:()=>sr,userConversionPairsList:()=>or,userConversionPairsRetrieve:()=>ir,userConversionsCreate:()=>pr,userConversionsList:()=>ar,userConversionsPartialUpdate:()=>lr,userConversionsRetrieve:()=>dr,userConversionsUpdate:()=>cr,userCurrenciesList:()=>ur,userCurrenciesRetrieve:()=>yr,userRatesList:()=>hr,userRatesRetrieve:()=>mr,userRatesSnapshotRetrieve:()=>fr,userRatesSnapshotsList:()=>Rr,userSettingsPartialUpdate:()=>wr,userSettingsRetrieve:()=>Or,userSettingsUpdate:()=>gr,webhookCreate:()=>Cr});var q={bodySerializer:e=>JSON.stringify(e,(r,n)=>typeof n=="bigint"?n.toString():n)};var ie={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Tr=Object.entries(ie);var M=({onRequest:e,onSseError:r,onSseEvent:n,responseTransformer:i,responseValidator:o,sseDefaultRetryDelay:l,sseMaxRetryAttempts:p,sseMaxRetryDelay:a,sseSleepFn:d,url:u,...s})=>{let m,x=d??(c=>new Promise(R=>setTimeout(R,c)));return{stream:async function*(){let c=l??3e3,R=0,C=s.signal??new AbortController().signal;for(;!C.aborted;){R++;let E=s.headers instanceof Headers?s.headers:new Headers(s.headers);m!==void 0&&E.set("Last-Event-ID",m);try{let A={redirect:"follow",...s,body:s.serializedBody,headers:E,signal:C},g=new Request(u,A);e&&(g=await e(u,A));let y=await(s.fetch??globalThis.fetch)(g);if(!y.ok)throw new Error(`SSE failed: ${y.status} ${y.statusText}`);if(!y.body)throw new Error("No body in SSE response");let f=y.body.pipeThrough(new TextDecoderStream).getReader(),v="",_=()=>{try{f.cancel()}catch{}};C.addEventListener("abort",_);try{for(;;){let{done:re,value:ne}=await f.read();if(re)break;v+=ne,v=v.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let $=v.split(`
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-2vNCP2LN.mjs';
|
|
2
|
+
import '../create-auth-CHzmb_8_.mjs';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-D-Z8R83N.js';
|
|
2
|
+
import '../create-auth-CHzmb_8_.js';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var K={};_chunkOEIQFP6Tjs.a.call(void 0, K,{activateCreate:()=>me,adminCompanyPartialUpdate:()=>Oe,adminCompanyRetrieve:()=>be,adminCompanyUpdate:()=>ge,adminTransactionUpdateBatchesCreate:()=>Re,adminTransactionUpdateBatchesList:()=>we,adminTransactionUpdateBatchesPartialUpdate:()=>Se,adminTransactionUpdateBatchesRetrieve:()=>Te,adminTransactionUpdateBatchesRowsList:()=>Ae,adminTransactionUpdateBatchesUpdate:()=>xe,adminUploadsCreate:()=>Ue,adminUploadsList:()=>Ce,adminUploadsPartialUpdate:()=>ke,adminUploadsRetrieve:()=>Ee,adminUploadsTransactionsList:()=>De,adminUploadsUpdate:()=>ze,deactivateCreate:()=>qe,uploadsCreate:()=>je,uploadsList:()=>Pe,uploadsPartialUpdate:()=>Ie,uploadsRetrieve:()=>Be,uploadsTransactionsList:()=>Le,uploadsUpdate:()=>ve,webhookCreate:()=>$e});var I={bodySerializer:e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r)};var se={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Ne=Object.entries(se);var W=({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:o,responseValidator:a,sseDefaultRetryDelay:d,sseMaxRetryAttempts:i,sseMaxRetryDelay:s,sseSleepFn:p,url:u,...n})=>{let h,A=_nullishCoalesce(p, () => ((l=>new Promise(b=>setTimeout(b,l)))));return{stream:async function*(){let l=_nullishCoalesce(d, () => (3e3)),b=0,R=_nullishCoalesce(n.signal, () => (new AbortController().signal));for(;!R.aborted;){b++;let C=n.headers instanceof Headers?n.headers:new Headers(n.headers);h!==void 0&&C.set("Last-Event-ID",h);try{let T={redirect:"follow",...n,body:n.serializedBody,headers:C,signal:R},w=new Request(u,T);e&&(w=await e(u,T));let f=await(_nullishCoalesce(n.fetch, () => (globalThis.fetch)))(w);if(!f.ok)throw new Error(`SSE failed: ${f.status} ${f.statusText}`);if(!f.body)throw new Error("No body in SSE response");let m=f.body.pipeThrough(new TextDecoderStream).getReader(),U="",M=()=>{try{m.cancel()}catch (e2){}};R.addEventListener("abort",M);try{for(;;){let{done:te,value:re}=await m.read();if(te)break;U+=re,U=U.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let N=U.split(`
|
|
4
4
|
|
|
5
5
|
`);U=_nullishCoalesce(N.pop(), () => (""));for(let ne of N){let ae=ne.split(`
|
|
6
6
|
`),q=[],H;for(let g of ae)if(g.startsWith("data:"))q.push(g.replace(/^data:\s*/,""));else if(g.startsWith("event:"))H=g.replace(/^event:\s*/,"");else if(g.startsWith("id:"))h=g.replace(/^id:\s*/,"");else if(g.startsWith("retry:")){let _=Number.parseInt(g.replace(/^retry:\s*/,""),10);Number.isNaN(_)||(l=_)}let S,V=!1;if(q.length){let g=q.join(`
|
|
7
|
-
`);try{S=JSON.parse(g),V=!0}catch (e3){S=g}}V&&(a&&await a(S),o&&(S=await o(S))),_optionalChain([r, 'optionalCall', _2 => _2({data:S,event:H,id:h,retry:l})]),q.length&&(yield S)}}}finally{R.removeEventListener("abort",M),m.releaseLock()}break}catch(T){if(_optionalChain([t, 'optionalCall', _3 => _3(T)]),i!==void 0&&b>=i)break;let w=Math.min(l*2**(b-1),_nullishCoalesce(s, () => (3e4)));await A(w)}}}()}};var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},P=({allowReserved:e,explode:t,name:r,style:o,value:a})=>{if(!t){let s=(e?a:a.map(p=>encodeURIComponent(p))).join(pe(o));switch(o){case"label":return`.${s}`;case"matrix":return`;${r}=${s}`;case"simple":return s;default:return`${r}=${s}`}}let d=ie(o),i=a.map(s=>o==="label"||o==="simple"?e?s:encodeURIComponent(s):x({allowReserved:e,name:r,value:s})).join(d);return o==="label"||o==="matrix"?d+i:i},x=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},j=({allowReserved:e,explode:t,name:r,style:o,value:a,valueOnly:d})=>{if(a instanceof Date)return d?a.toISOString():`${r}=${a.toISOString()}`;if(o!=="deepObject"&&!t){let p=[];Object.entries(a).forEach(([n,h])=>{p=[...p,n,e?h:encodeURIComponent(h)]});let u=p.join(",");switch(o){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let i=de(o),s=Object.entries(a).map(([p,u])=>x({allowReserved:e,name:o==="deepObject"?`${r}[${p}]`:p,value:u})).join(i);return o==="label"||o==="matrix"?i+s:s};var le=/\{[^{}]+\}/g,ce=({path:e,url:t})=>{let r=t,o=t.match(le);if(o)for(let a of o){let d=!1,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){r=r.replace(a,P({explode:d,name:i,style:s,value:p}));continue}if(typeof p=="object"){r=r.replace(a,j({explode:d,name:i,style:s,value:p,valueOnly:!0}));continue}if(s==="matrix"){r=r.replace(a,`;${x({name:i,value:p})}`);continue}let u=encodeURIComponent(s==="label"?`.${p}`:p);r=r.replace(a,u)}return r},Q=({baseUrl:e,path:t,query:r,querySerializer:o,url:a})=>{let d=a.startsWith("/")?a:`/${a}`,i=(_nullishCoalesce(e, () => ("")))+d;t&&(i=ce({path:t,url:i}));let s=r?o(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function v(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 G=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var X=({parameters:e={},...t}={})=>o=>{let a=[];if(o&&typeof o=="object")for(let d in o){let i=o[d];if(i==null)continue;let s=e[d]||t;if(Array.isArray(i)){let p=P({allowReserved:s.allowReserved,explode:!0,name:d,style:"form",value:i,...s.array});p&&a.push(p)}else if(typeof i=="object"){let p=j({allowReserved:s.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...s.object});p&&a.push(p)}else{let p=x({allowReserved:s.allowReserved,name:d,value:i});p&&a.push(p)}}return a.join("&")},Y=e=>{if(!e)return"stream";let t=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>t?!!(e.headers.has(t)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[t]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${t}=`)])):!1,Z=async({security:e,...t})=>{for(let r of e){if(ue(t,r.name))continue;let o=await G(r,t.auth);if(!o)continue;let a=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":t.query||(t.query={}),t.query[a]=o;break;case"cookie":t.headers.append("Cookie",`${a}=${o}`);break;case"header":default:t.headers.set(a,o);break}}},L=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,t)=>{let r={...e,...t};return _optionalChain([r, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=B(e.headers,t.headers),r},fe=e=>{let t=[];return e.forEach((r,o)=>{t.push([o,r])}),t},B=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let o=r instanceof Headers?fe(r):Object.entries(r);for(let[a,d]of o)if(d===null)t.delete(a);else if(Array.isArray(d))for(let i of d)t.append(a,i);else d!==void 0&&t.set(a,typeof d=="object"?JSON.stringify(d):d)}return t},E=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null)}exists(t){let r=this.getInterceptorIndex(t);return!!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let o=this.getInterceptorIndex(t);return this.fns[o]?(this.fns[o]=r,t):!1}use(t){return this.fns.push(t),this.fns.length-1}},ee=()=>({error:new E,request:new E,response:new E}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},k=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var z=(e={})=>{let t=$(k(),e),r=()=>({...t}),o=u=>(t=$(t,u),r()),a=ee(),d=async u=>{let n={...t,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (t.fetch)), () => (globalThis.fetch)),headers:B(t.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let h=L(n);return{opts:n,url:h}},i=async u=>{let{opts:n,url:h}=await d(u),A={redirect:"follow",...n,body:v(n)},O=new Request(h,A);for(let y of a.request.fns)y&&(O=await y(O,n));let D=n.fetch,l;try{l=await D(O)}catch(y){let f=y;for(let m of a.error.fns)m&&(f=await m(y,void 0,O,n));if(f=f||{},n.throwOnError)throw f;return n.responseStyle==="data"?void 0:{error:f,request:O,response:void 0}}for(let y of a.response.fns)y&&(l=await y(l,O,n));let b={request:O,response:l};if(l.ok){let y=_nullishCoalesce((n.parseAs==="auto"?Y(l.headers.get("Content-Type")):n.parseAs), () => ("json"));if(l.status===204||l.headers.get("Content-Length")==="0"){let m;switch(y){case"arrayBuffer":case"blob":case"text":m=await l[y]();break;case"formData":m=new FormData;break;case"stream":m=l.body;break;case"json":default:m={};break}return n.responseStyle==="data"?m:{data:m,...b}}let f;switch(y){case"arrayBuffer":case"blob":case"formData":case"text":f=await l[y]();break;case"json":{let m=await l.text();f=m?JSON.parse(m):{};break}case"stream":return n.responseStyle==="data"?l.body:{data:l.body,...b}}return y==="json"&&(n.responseValidator&&await n.responseValidator(f),n.responseTransformer&&(f=await n.responseTransformer(f))),n.responseStyle==="data"?f:{data:f,...b}}let R=await l.text(),C;try{C=JSON.parse(R)}catch (e4){}let T=_nullishCoalesce(C, () => (R)),w=T;for(let y of a.error.fns)y&&(w=await y(T,l,O,n));if(w=w||{},n.throwOnError)throw w;return n.responseStyle==="data"?void 0:{error:w,...b}},s=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:h,url:A}=await d(n);return W({...h,body:h.body,headers:h.headers,method:u,onRequest:async(O,D)=>{let l=new Request(O,D);for(let b of a.request.fns)b&&(l=await b(l,h));return l},serializedBody:v(h),url:A})};return{buildUrl:L,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:o,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:s("TRACE")}};var c=z(k({baseUrl:"https://mass-send.services.rehive.com/api/1/"}));var me=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/",...e}),Re=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/rows/",...e}),Ce=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/",...e}),Ue=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/transactions/",...e}),qe=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/",...e}),je=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Le=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/transactions/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function Ke(e){let t=z(_chunk53JJUQ4Vjs.c.call(void 0, e,"https://mass-send.services.rehive.com/api/"));return _chunk53JJUQ4Vjs.a.call(void 0, K,t)}exports.createMassSendApi = Ke;
|
|
7
|
+
`);try{S=JSON.parse(g),V=!0}catch (e3){S=g}}V&&(a&&await a(S),o&&(S=await o(S))),_optionalChain([r, 'optionalCall', _2 => _2({data:S,event:H,id:h,retry:l})]),q.length&&(yield S)}}}finally{R.removeEventListener("abort",M),m.releaseLock()}break}catch(T){if(_optionalChain([t, 'optionalCall', _3 => _3(T)]),i!==void 0&&b>=i)break;let w=Math.min(l*2**(b-1),_nullishCoalesce(s, () => (3e4)));await A(w)}}}()}};var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},P=({allowReserved:e,explode:t,name:r,style:o,value:a})=>{if(!t){let s=(e?a:a.map(p=>encodeURIComponent(p))).join(pe(o));switch(o){case"label":return`.${s}`;case"matrix":return`;${r}=${s}`;case"simple":return s;default:return`${r}=${s}`}}let d=ie(o),i=a.map(s=>o==="label"||o==="simple"?e?s:encodeURIComponent(s):x({allowReserved:e,name:r,value:s})).join(d);return o==="label"||o==="matrix"?d+i:i},x=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},j=({allowReserved:e,explode:t,name:r,style:o,value:a,valueOnly:d})=>{if(a instanceof Date)return d?a.toISOString():`${r}=${a.toISOString()}`;if(o!=="deepObject"&&!t){let p=[];Object.entries(a).forEach(([n,h])=>{p=[...p,n,e?h:encodeURIComponent(h)]});let u=p.join(",");switch(o){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let i=de(o),s=Object.entries(a).map(([p,u])=>x({allowReserved:e,name:o==="deepObject"?`${r}[${p}]`:p,value:u})).join(i);return o==="label"||o==="matrix"?i+s:s};var le=/\{[^{}]+\}/g,ce=({path:e,url:t})=>{let r=t,o=t.match(le);if(o)for(let a of o){let d=!1,i=a.substring(1,a.length-1),s="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),s="label"):i.startsWith(";")&&(i=i.substring(1),s="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){r=r.replace(a,P({explode:d,name:i,style:s,value:p}));continue}if(typeof p=="object"){r=r.replace(a,j({explode:d,name:i,style:s,value:p,valueOnly:!0}));continue}if(s==="matrix"){r=r.replace(a,`;${x({name:i,value:p})}`);continue}let u=encodeURIComponent(s==="label"?`.${p}`:p);r=r.replace(a,u)}return r},Q=({baseUrl:e,path:t,query:r,querySerializer:o,url:a})=>{let d=a.startsWith("/")?a:`/${a}`,i=(_nullishCoalesce(e, () => ("")))+d;t&&(i=ce({path:t,url:i}));let s=r?o(r):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(i+=`?${s}`),i};function v(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 G=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var X=({parameters:e={},...t}={})=>o=>{let a=[];if(o&&typeof o=="object")for(let d in o){let i=o[d];if(i==null)continue;let s=e[d]||t;if(Array.isArray(i)){let p=P({allowReserved:s.allowReserved,explode:!0,name:d,style:"form",value:i,...s.array});p&&a.push(p)}else if(typeof i=="object"){let p=j({allowReserved:s.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...s.object});p&&a.push(p)}else{let p=x({allowReserved:s.allowReserved,name:d,value:i});p&&a.push(p)}}return a.join("&")},Y=e=>{if(!e)return"stream";let t=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>t?!!(e.headers.has(t)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[t]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${t}=`)])):!1,Z=async({security:e,...t})=>{for(let r of e){if(ue(t,r.name))continue;let o=await G(r,t.auth);if(!o)continue;let a=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":t.query||(t.query={}),t.query[a]=o;break;case"cookie":t.headers.append("Cookie",`${a}=${o}`);break;case"header":default:t.headers.set(a,o);break}}},L=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,t)=>{let r={...e,...t};return _optionalChain([r, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=B(e.headers,t.headers),r},fe=e=>{let t=[];return e.forEach((r,o)=>{t.push([o,r])}),t},B=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let o=r instanceof Headers?fe(r):Object.entries(r);for(let[a,d]of o)if(d===null)t.delete(a);else if(Array.isArray(d))for(let i of d)t.append(a,i);else d!==void 0&&t.set(a,typeof d=="object"?JSON.stringify(d):d)}return t},E=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null)}exists(t){let r=this.getInterceptorIndex(t);return!!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let o=this.getInterceptorIndex(t);return this.fns[o]?(this.fns[o]=r,t):!1}use(t){return this.fns.push(t),this.fns.length-1}},ee=()=>({error:new E,request:new E,response:new E}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},k=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var z=(e={})=>{let t=$(k(),e),r=()=>({...t}),o=u=>(t=$(t,u),r()),a=ee(),d=async u=>{let n={...t,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (t.fetch)), () => (globalThis.fetch)),headers:B(t.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let h=L(n);return{opts:n,url:h}},i=async u=>{let{opts:n,url:h}=await d(u),A={redirect:"follow",...n,body:v(n)},O=new Request(h,A);for(let y of a.request.fns)y&&(O=await y(O,n));let D=n.fetch,l;try{l=await D(O)}catch(y){let f=y;for(let m of a.error.fns)m&&(f=await m(y,void 0,O,n));if(f=f||{},n.throwOnError)throw f;return n.responseStyle==="data"?void 0:{error:f,request:O,response:void 0}}for(let y of a.response.fns)y&&(l=await y(l,O,n));let b={request:O,response:l};if(l.ok){let y=_nullishCoalesce((n.parseAs==="auto"?Y(l.headers.get("Content-Type")):n.parseAs), () => ("json"));if(l.status===204||l.headers.get("Content-Length")==="0"){let m;switch(y){case"arrayBuffer":case"blob":case"text":m=await l[y]();break;case"formData":m=new FormData;break;case"stream":m=l.body;break;case"json":default:m={};break}return n.responseStyle==="data"?m:{data:m,...b}}let f;switch(y){case"arrayBuffer":case"blob":case"formData":case"text":f=await l[y]();break;case"json":{let m=await l.text();f=m?JSON.parse(m):{};break}case"stream":return n.responseStyle==="data"?l.body:{data:l.body,...b}}return y==="json"&&(n.responseValidator&&await n.responseValidator(f),n.responseTransformer&&(f=await n.responseTransformer(f))),n.responseStyle==="data"?f:{data:f,...b}}let R=await l.text(),C;try{C=JSON.parse(R)}catch (e4){}let T=_nullishCoalesce(C, () => (R)),w=T;for(let y of a.error.fns)y&&(w=await y(T,l,O,n));if(w=w||{},n.throwOnError)throw w;return n.responseStyle==="data"?void 0:{error:w,...b}},s=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:h,url:A}=await d(n);return W({...h,body:h.body,headers:h.headers,method:u,onRequest:async(O,D)=>{let l=new Request(O,D);for(let b of a.request.fns)b&&(l=await b(l,h));return l},serializedBody:v(h),url:A})};return{buildUrl:L,connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:r,head:s("HEAD"),interceptors:a,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:i,setConfig:o,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:s("TRACE")}};var c=z(k({baseUrl:"https://mass-send.services.rehive.com/api/1/"}));var me=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/",...e}),Re=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),xe=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/transaction-update-batches/{batch_id}/rows/",...e}),Ce=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/",...e}),Ue=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e}),ke=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),De=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/uploads/{batch_id}/transactions/",...e}),qe=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/",...e}),je=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Le=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/uploads/{batch_id}/transactions/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function Ke(e){let t=z(_chunkGR5TETAUjs.c.call(void 0, e,"https://mass-send.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, K,t)}exports.createMassSendApi = Ke;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as F,c as J}from"../chunk-
|
|
1
|
+
import{a as F,c as J}from"../chunk-S5UXBHRU.mjs";import{a as oe}from"../chunk-S4QKN5WW.mjs";var K={};oe(K,{activateCreate:()=>me,adminCompanyPartialUpdate:()=>Oe,adminCompanyRetrieve:()=>be,adminCompanyUpdate:()=>ge,adminTransactionUpdateBatchesCreate:()=>Re,adminTransactionUpdateBatchesList:()=>we,adminTransactionUpdateBatchesPartialUpdate:()=>Se,adminTransactionUpdateBatchesRetrieve:()=>Te,adminTransactionUpdateBatchesRowsList:()=>Ae,adminTransactionUpdateBatchesUpdate:()=>xe,adminUploadsCreate:()=>Ue,adminUploadsList:()=>Ce,adminUploadsPartialUpdate:()=>ke,adminUploadsRetrieve:()=>Ee,adminUploadsTransactionsList:()=>De,adminUploadsUpdate:()=>ze,deactivateCreate:()=>qe,uploadsCreate:()=>je,uploadsList:()=>Pe,uploadsPartialUpdate:()=>Ie,uploadsRetrieve:()=>Be,uploadsTransactionsList:()=>Le,uploadsUpdate:()=>ve,webhookCreate:()=>$e});var I={bodySerializer:e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r)};var se={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Ne=Object.entries(se);var W=({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:o,responseValidator:a,sseDefaultRetryDelay:d,sseMaxRetryAttempts:i,sseMaxRetryDelay:s,sseSleepFn:p,url:u,...n})=>{let h,A=p??(l=>new Promise(b=>setTimeout(b,l)));return{stream:async function*(){let l=d??3e3,b=0,R=n.signal??new AbortController().signal;for(;!R.aborted;){b++;let C=n.headers instanceof Headers?n.headers:new Headers(n.headers);h!==void 0&&C.set("Last-Event-ID",h);try{let T={redirect:"follow",...n,body:n.serializedBody,headers:C,signal:R},w=new Request(u,T);e&&(w=await e(u,T));let f=await(n.fetch??globalThis.fetch)(w);if(!f.ok)throw new Error(`SSE failed: ${f.status} ${f.statusText}`);if(!f.body)throw new Error("No body in SSE response");let m=f.body.pipeThrough(new TextDecoderStream).getReader(),U="",M=()=>{try{m.cancel()}catch{}};R.addEventListener("abort",M);try{for(;;){let{done:te,value:re}=await m.read();if(te)break;U+=re,U=U.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let N=U.split(`
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-2vNCP2LN.mjs';
|
|
2
|
+
import '../create-auth-CHzmb_8_.mjs';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-D-Z8R83N.js';
|
|
2
|
+
import '../create-auth-CHzmb_8_.js';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var B={};_chunkOEIQFP6Tjs.a.call(void 0, B,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>ge,adminCompanyRetrieve:()=>Oe,adminCompanyUpdate:()=>we,adminCredentialsCreate:()=>Te,adminCredentialsDestroy:()=>Ae,adminCredentialsList:()=>Re,adminCredentialsPartialUpdate:()=>xe,adminCredentialsRetrieve:()=>be,adminCredentialsUpdate:()=>Ce,adminLayoutTemplatesList:()=>Ee,adminLayoutTemplatesRetrieve:()=>Se,adminLayoutsCreate:()=>De,adminLayoutsDestroy:()=>ze,adminLayoutsList:()=>ke,adminLayoutsPartialUpdate:()=>Ue,adminLayoutsRetrieve:()=>Le,adminLayoutsUpdate:()=>Pe,adminLogsList:()=>je,adminLogsRetrieve:()=>qe,adminLogsSendCreate:()=>Ne,adminNotificationsCreate:()=>Ie,adminNotificationsDestroy:()=>Ke,adminNotificationsList:()=>ve,adminNotificationsPartialUpdate:()=>$e,adminNotificationsRetrieve:()=>Be,adminNotificationsTriggerCreate:()=>We,adminNotificationsUpdate:()=>_e,adminTemplatesList:()=>He,adminTemplatesRetrieve:()=>Ve,adminWebhookCreate:()=>Fe,deactivateCreate:()=>Je,userLogsList:()=>Me,userLogsPartialUpdate:()=>Ge,userLogsRetrieve:()=>Qe,userLogsUpdate:()=>Xe,userNotificationsList:()=>Ye,userNotificationsPartialUpdate:()=>et,userNotificationsRetrieve:()=>Ze,userNotificationsUpdate:()=>tt,webhookCreate:()=>rt});var N={bodySerializer:e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},it=Object.entries(ae);var M=({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:i,responseValidator:o,sseDefaultRetryDelay:l,sseMaxRetryAttempts:d,sseMaxRetryDelay:a,sseSleepFn:p,url:u,...n})=>{let m,C=_nullishCoalesce(p, () => ((c=>new Promise(O=>setTimeout(O,c)))));return{stream:async function*(){let c=_nullishCoalesce(l, () => (3e3)),O=0,T=_nullishCoalesce(n.signal, () => (new AbortController().signal));for(;!T.aborted;){O++;let E=n.headers instanceof Headers?n.headers:new Headers(n.headers);m!==void 0&&E.set("Last-Event-ID",m);try{let A={redirect:"follow",...n,body:n.serializedBody,headers:E,signal:T},R=new Request(u,A);e&&(R=await e(u,A));let y=await(_nullishCoalesce(n.fetch, () => (globalThis.fetch)))(R);if(!y.ok)throw new Error(`SSE failed: ${y.status} ${y.statusText}`);if(!y.body)throw new Error("No body in SSE response");let h=y.body.pipeThrough(new TextDecoderStream).getReader(),S="",$=()=>{try{h.cancel()}catch (e2){}};T.addEventListener("abort",$);try{for(;;){let{done:te,value:re}=await h.read();if(te)break;S+=re,S=S.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let _=S.split(`
|
|
4
4
|
|
|
5
5
|
`);S=_nullishCoalesce(_.pop(), () => (""));for(let ne of _){let oe=ne.split(`
|
|
6
6
|
`),U=[],W;for(let w of oe)if(w.startsWith("data:"))U.push(w.replace(/^data:\s*/,""));else if(w.startsWith("event:"))W=w.replace(/^event:\s*/,"");else if(w.startsWith("id:"))m=w.replace(/^id:\s*/,"");else if(w.startsWith("retry:")){let V=Number.parseInt(w.replace(/^retry:\s*/,""),10);Number.isNaN(V)||(c=V)}let b,H=!1;if(U.length){let w=U.join(`
|
|
7
|
-
`);try{b=JSON.parse(w),H=!0}catch (e3){b=w}}H&&(o&&await o(b),i&&(b=await i(b))),_optionalChain([r, 'optionalCall', _2 => _2({data:b,event:W,id:m,retry:c})]),U.length&&(yield b)}}}finally{T.removeEventListener("abort",$),h.releaseLock()}break}catch(A){if(_optionalChain([t, 'optionalCall', _3 => _3(A)]),d!==void 0&&O>=d)break;let R=Math.min(c*2**(O-1),_nullishCoalesce(a, () => (3e4)));await C(R)}}}()}};var se=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},de=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},pe=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},P=({allowReserved:e,explode:t,name:r,style:i,value:o})=>{if(!t){let a=(e?o:o.map(p=>encodeURIComponent(p))).join(de(i));switch(i){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let l=se(i),d=o.map(a=>i==="label"||i==="simple"?e?a:encodeURIComponent(a):x({allowReserved:e,name:r,value:a})).join(l);return i==="label"||i==="matrix"?l+d:d},x=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},j=({allowReserved:e,explode:t,name:r,style:i,value:o,valueOnly:l})=>{if(o instanceof Date)return l?o.toISOString():`${r}=${o.toISOString()}`;if(i!=="deepObject"&&!t){let p=[];Object.entries(o).forEach(([n,m])=>{p=[...p,n,e?m:encodeURIComponent(m)]});let u=p.join(",");switch(i){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let d=pe(i),a=Object.entries(o).map(([p,u])=>x({allowReserved:e,name:i==="deepObject"?`${r}[${p}]`:p,value:u})).join(d);return i==="label"||i==="matrix"?d+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:t})=>{let r=t,i=t.match(le);if(i)for(let o of i){let l=!1,d=o.substring(1,o.length-1),a="simple";d.endsWith("*")&&(l=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),a="label"):d.startsWith(";")&&(d=d.substring(1),a="matrix");let p=e[d];if(p==null)continue;if(Array.isArray(p)){r=r.replace(o,P({explode:l,name:d,style:a,value:p}));continue}if(typeof p=="object"){r=r.replace(o,j({explode:l,name:d,style:a,value:p,valueOnly:!0}));continue}if(a==="matrix"){r=r.replace(o,`;${x({name:d,value:p})}`);continue}let u=encodeURIComponent(a==="label"?`.${p}`:p);r=r.replace(o,u)}return r},Q=({baseUrl:e,path:t,query:r,querySerializer:i,url:o})=>{let l=o.startsWith("/")?o:`/${o}`,d=(_nullishCoalesce(e, () => ("")))+l;t&&(d=ce({path:t,url:d}));let a=r?i(r):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(d+=`?${a}`),d};function v(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 G=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var X=({parameters:e={},...t}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let l in i){let d=i[l];if(d==null)continue;let a=e[l]||t;if(Array.isArray(d)){let p=P({allowReserved:a.allowReserved,explode:!0,name:l,style:"form",value:d,...a.array});p&&o.push(p)}else if(typeof d=="object"){let p=j({allowReserved:a.allowReserved,explode:!0,name:l,style:"deepObject",value:d,...a.object});p&&o.push(p)}else{let p=x({allowReserved:a.allowReserved,name:l,value:d});p&&o.push(p)}}return o.join("&")},Y=e=>{if(!e)return"stream";let t=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>t?!!(e.headers.has(t)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[t]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${t}=`)])):!1,Z=async({security:e,...t})=>{for(let r of e){if(ue(t,r.name))continue;let i=await G(r,t.auth);if(!i)continue;let o=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":t.query||(t.query={}),t.query[o]=i;break;case"cookie":t.headers.append("Cookie",`${o}=${i}`);break;case"header":default:t.headers.set(o,i);break}}},I=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),K=(e,t)=>{let r={...e,...t};return _optionalChain([r, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=q(e.headers,t.headers),r},ye=e=>{let t=[];return e.forEach((r,i)=>{t.push([i,r])}),t},q=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let i=r instanceof Headers?ye(r):Object.entries(r);for(let[o,l]of i)if(l===null)t.delete(o);else if(Array.isArray(l))for(let d of l)t.append(o,d);else l!==void 0&&t.set(o,typeof l=="object"?JSON.stringify(l):l)}return t},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null)}exists(t){let r=this.getInterceptorIndex(t);return!!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let i=this.getInterceptorIndex(t);return this.fns[i]?(this.fns[i]=r,t):!1}use(t){return this.fns.push(t),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},D=(e={})=>({...N,headers:me,parseAs:"auto",querySerializer:fe,...e});var z=(e={})=>{let t=K(D(),e),r=()=>({...t}),i=u=>(t=K(t,u),r()),o=ee(),l=async u=>{let n={...t,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (t.fetch)), () => (globalThis.fetch)),headers:q(t.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let m=I(n);return{opts:n,url:m}},d=async u=>{let{opts:n,url:m}=await l(u),C={redirect:"follow",...n,body:v(n)},g=new Request(m,C);for(let f of o.request.fns)f&&(g=await f(g,n));let L=n.fetch,c;try{c=await L(g)}catch(f){let y=f;for(let h of o.error.fns)h&&(y=await h(f,void 0,g,n));if(y=y||{},n.throwOnError)throw y;return n.responseStyle==="data"?void 0:{error:y,request:g,response:void 0}}for(let f of o.response.fns)f&&(c=await f(c,g,n));let O={request:g,response:c};if(c.ok){let f=_nullishCoalesce((n.parseAs==="auto"?Y(c.headers.get("Content-Type")):n.parseAs), () => ("json"));if(c.status===204||c.headers.get("Content-Length")==="0"){let h;switch(f){case"arrayBuffer":case"blob":case"text":h=await c[f]();break;case"formData":h=new FormData;break;case"stream":h=c.body;break;case"json":default:h={};break}return n.responseStyle==="data"?h:{data:h,...O}}let y;switch(f){case"arrayBuffer":case"blob":case"formData":case"text":y=await c[f]();break;case"json":{let h=await c.text();y=h?JSON.parse(h):{};break}case"stream":return n.responseStyle==="data"?c.body:{data:c.body,...O}}return f==="json"&&(n.responseValidator&&await n.responseValidator(y),n.responseTransformer&&(y=await n.responseTransformer(y))),n.responseStyle==="data"?y:{data:y,...O}}let T=await c.text(),E;try{E=JSON.parse(T)}catch (e4){}let A=_nullishCoalesce(E, () => (T)),R=A;for(let f of o.error.fns)f&&(R=await f(A,c,g,n));if(R=R||{},n.throwOnError)throw R;return n.responseStyle==="data"?void 0:{error:R,...O}},a=u=>n=>d({...n,method:u}),p=u=>async n=>{let{opts:m,url:C}=await l(n);return M({...m,body:m.body,headers:m.headers,method:u,onRequest:async(g,L)=>{let c=new Request(g,L);for(let O of o.request.fns)O&&(c=await O(c,m));return c},serializedBody:v(m),url:C})};return{buildUrl:I,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:r,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:d,setConfig:i,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:a("TRACE")}};var s=z(D({baseUrl:"https://notification.services.rehive.com/api/"}));var he=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e}),be=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e}),xe=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layout-templates/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layout-templates/{id}/",...e}),ke=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/",...e}),De=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e}),Ue=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/",...e}),qe=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/{log_id}/",...e}),Ne=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/{log_id}/send/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),We=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/trigger/",...e,headers:{"Content-Type":"application/json",...e.headers}}),He=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/templates/",...e}),Ve=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/templates/{template_id}/",...e}),Fe=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/admin/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/",...e}),Qe=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e}),Ge=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xe=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/",...e}),Ze=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e}),et=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),tt=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function nt(e){let t=z(_chunk53JJUQ4Vjs.c.call(void 0, e,"https://notification.services.rehive.com/api/"));return _chunk53JJUQ4Vjs.a.call(void 0, B,t)}exports.createNotificationsApi = nt;
|
|
7
|
+
`);try{b=JSON.parse(w),H=!0}catch (e3){b=w}}H&&(o&&await o(b),i&&(b=await i(b))),_optionalChain([r, 'optionalCall', _2 => _2({data:b,event:W,id:m,retry:c})]),U.length&&(yield b)}}}finally{T.removeEventListener("abort",$),h.releaseLock()}break}catch(A){if(_optionalChain([t, 'optionalCall', _3 => _3(A)]),d!==void 0&&O>=d)break;let R=Math.min(c*2**(O-1),_nullishCoalesce(a, () => (3e4)));await C(R)}}}()}};var se=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},de=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},pe=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},P=({allowReserved:e,explode:t,name:r,style:i,value:o})=>{if(!t){let a=(e?o:o.map(p=>encodeURIComponent(p))).join(de(i));switch(i){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let l=se(i),d=o.map(a=>i==="label"||i==="simple"?e?a:encodeURIComponent(a):x({allowReserved:e,name:r,value:a})).join(l);return i==="label"||i==="matrix"?l+d:d},x=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},j=({allowReserved:e,explode:t,name:r,style:i,value:o,valueOnly:l})=>{if(o instanceof Date)return l?o.toISOString():`${r}=${o.toISOString()}`;if(i!=="deepObject"&&!t){let p=[];Object.entries(o).forEach(([n,m])=>{p=[...p,n,e?m:encodeURIComponent(m)]});let u=p.join(",");switch(i){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let d=pe(i),a=Object.entries(o).map(([p,u])=>x({allowReserved:e,name:i==="deepObject"?`${r}[${p}]`:p,value:u})).join(d);return i==="label"||i==="matrix"?d+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:t})=>{let r=t,i=t.match(le);if(i)for(let o of i){let l=!1,d=o.substring(1,o.length-1),a="simple";d.endsWith("*")&&(l=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),a="label"):d.startsWith(";")&&(d=d.substring(1),a="matrix");let p=e[d];if(p==null)continue;if(Array.isArray(p)){r=r.replace(o,P({explode:l,name:d,style:a,value:p}));continue}if(typeof p=="object"){r=r.replace(o,j({explode:l,name:d,style:a,value:p,valueOnly:!0}));continue}if(a==="matrix"){r=r.replace(o,`;${x({name:d,value:p})}`);continue}let u=encodeURIComponent(a==="label"?`.${p}`:p);r=r.replace(o,u)}return r},Q=({baseUrl:e,path:t,query:r,querySerializer:i,url:o})=>{let l=o.startsWith("/")?o:`/${o}`,d=(_nullishCoalesce(e, () => ("")))+l;t&&(d=ce({path:t,url:d}));let a=r?i(r):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(d+=`?${a}`),d};function v(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 G=async(e,t)=>{let r=typeof t=="function"?await t(e):t;if(r)return e.scheme==="bearer"?`Bearer ${r}`:e.scheme==="basic"?`Basic ${btoa(r)}`:r};var X=({parameters:e={},...t}={})=>i=>{let o=[];if(i&&typeof i=="object")for(let l in i){let d=i[l];if(d==null)continue;let a=e[l]||t;if(Array.isArray(d)){let p=P({allowReserved:a.allowReserved,explode:!0,name:l,style:"form",value:d,...a.array});p&&o.push(p)}else if(typeof d=="object"){let p=j({allowReserved:a.allowReserved,explode:!0,name:l,style:"deepObject",value:d,...a.object});p&&o.push(p)}else{let p=x({allowReserved:a.allowReserved,name:l,value:d});p&&o.push(p)}}return o.join("&")},Y=e=>{if(!e)return"stream";let t=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"}},ue=(e,t)=>t?!!(e.headers.has(t)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[t]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${t}=`)])):!1,Z=async({security:e,...t})=>{for(let r of e){if(ue(t,r.name))continue;let i=await G(r,t.auth);if(!i)continue;let o=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":t.query||(t.query={}),t.query[o]=i;break;case"cookie":t.headers.append("Cookie",`${o}=${i}`);break;case"header":default:t.headers.set(o,i);break}}},I=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),K=(e,t)=>{let r={...e,...t};return _optionalChain([r, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=q(e.headers,t.headers),r},ye=e=>{let t=[];return e.forEach((r,i)=>{t.push([i,r])}),t},q=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let i=r instanceof Headers?ye(r):Object.entries(r);for(let[o,l]of i)if(l===null)t.delete(o);else if(Array.isArray(l))for(let d of l)t.append(o,d);else l!==void 0&&t.set(o,typeof l=="object"?JSON.stringify(l):l)}return t},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(t){let r=this.getInterceptorIndex(t);this.fns[r]&&(this.fns[r]=null)}exists(t){let r=this.getInterceptorIndex(t);return!!this.fns[r]}getInterceptorIndex(t){return typeof t=="number"?this.fns[t]?t:-1:this.fns.indexOf(t)}update(t,r){let i=this.getInterceptorIndex(t);return this.fns[i]?(this.fns[i]=r,t):!1}use(t){return this.fns.push(t),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),fe=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),me={"Content-Type":"application/json"},D=(e={})=>({...N,headers:me,parseAs:"auto",querySerializer:fe,...e});var z=(e={})=>{let t=K(D(),e),r=()=>({...t}),i=u=>(t=K(t,u),r()),o=ee(),l=async u=>{let n={...t,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (t.fetch)), () => (globalThis.fetch)),headers:q(t.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let m=I(n);return{opts:n,url:m}},d=async u=>{let{opts:n,url:m}=await l(u),C={redirect:"follow",...n,body:v(n)},g=new Request(m,C);for(let f of o.request.fns)f&&(g=await f(g,n));let L=n.fetch,c;try{c=await L(g)}catch(f){let y=f;for(let h of o.error.fns)h&&(y=await h(f,void 0,g,n));if(y=y||{},n.throwOnError)throw y;return n.responseStyle==="data"?void 0:{error:y,request:g,response:void 0}}for(let f of o.response.fns)f&&(c=await f(c,g,n));let O={request:g,response:c};if(c.ok){let f=_nullishCoalesce((n.parseAs==="auto"?Y(c.headers.get("Content-Type")):n.parseAs), () => ("json"));if(c.status===204||c.headers.get("Content-Length")==="0"){let h;switch(f){case"arrayBuffer":case"blob":case"text":h=await c[f]();break;case"formData":h=new FormData;break;case"stream":h=c.body;break;case"json":default:h={};break}return n.responseStyle==="data"?h:{data:h,...O}}let y;switch(f){case"arrayBuffer":case"blob":case"formData":case"text":y=await c[f]();break;case"json":{let h=await c.text();y=h?JSON.parse(h):{};break}case"stream":return n.responseStyle==="data"?c.body:{data:c.body,...O}}return f==="json"&&(n.responseValidator&&await n.responseValidator(y),n.responseTransformer&&(y=await n.responseTransformer(y))),n.responseStyle==="data"?y:{data:y,...O}}let T=await c.text(),E;try{E=JSON.parse(T)}catch (e4){}let A=_nullishCoalesce(E, () => (T)),R=A;for(let f of o.error.fns)f&&(R=await f(A,c,g,n));if(R=R||{},n.throwOnError)throw R;return n.responseStyle==="data"?void 0:{error:R,...O}},a=u=>n=>d({...n,method:u}),p=u=>async n=>{let{opts:m,url:C}=await l(n);return M({...m,body:m.body,headers:m.headers,method:u,onRequest:async(g,L)=>{let c=new Request(g,L);for(let O of o.request.fns)O&&(c=await O(c,m));return c},serializedBody:v(m),url:C})};return{buildUrl:I,connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:r,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:d,setConfig:i,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:a("TRACE")}};var s=z(D({baseUrl:"https://notification.services.rehive.com/api/"}));var he=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _21 => _21.headers])}}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _22 => _22.client]), () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _23 => _23.headers])}}),Re=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _24 => _24.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/",...e}),Te=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e}),be=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e}),xe=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ce=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/credentials/{credential_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layout-templates/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layout-templates/{id}/",...e}),ke=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/",...e}),De=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ze=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e}),Ue=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Pe=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/layouts/{id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),je=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/",...e}),qe=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/{log_id}/",...e}),Ne=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/logs/{log_id}/send/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ve=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _28 => _28.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/",...e}),Ie=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (s))).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),We=e=>(_nullishCoalesce(e.client, () => (s))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/notifications/{notification_id}/trigger/",...e,headers:{"Content-Type":"application/json",...e.headers}}),He=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/templates/",...e}),Ve=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/templates/{template_id}/",...e}),Fe=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/admin/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Je=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Me=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _30 => _30.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/",...e}),Qe=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e}),Ge=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xe=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/logs/{log_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/",...e}),Ze=e=>(_nullishCoalesce(e.client, () => (s))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e}),et=e=>(_nullishCoalesce(e.client, () => (s))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),tt=e=>(_nullishCoalesce(e.client, () => (s))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/notifications/{notification_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),rt=e=>(_nullishCoalesce(e.client, () => (s))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function nt(e){let t=z(_chunkGR5TETAUjs.c.call(void 0, e,"https://notification.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, B,t)}exports.createNotificationsApi = nt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as F,c as J}from"../chunk-
|
|
1
|
+
import{a as F,c as J}from"../chunk-S5UXBHRU.mjs";import{a as ie}from"../chunk-S4QKN5WW.mjs";var B={};ie(B,{activateCreate:()=>he,adminCompanyPartialUpdate:()=>ge,adminCompanyRetrieve:()=>Oe,adminCompanyUpdate:()=>we,adminCredentialsCreate:()=>Te,adminCredentialsDestroy:()=>Ae,adminCredentialsList:()=>Re,adminCredentialsPartialUpdate:()=>xe,adminCredentialsRetrieve:()=>be,adminCredentialsUpdate:()=>Ce,adminLayoutTemplatesList:()=>Ee,adminLayoutTemplatesRetrieve:()=>Se,adminLayoutsCreate:()=>De,adminLayoutsDestroy:()=>ze,adminLayoutsList:()=>ke,adminLayoutsPartialUpdate:()=>Ue,adminLayoutsRetrieve:()=>Le,adminLayoutsUpdate:()=>Pe,adminLogsList:()=>je,adminLogsRetrieve:()=>qe,adminLogsSendCreate:()=>Ne,adminNotificationsCreate:()=>Ie,adminNotificationsDestroy:()=>Ke,adminNotificationsList:()=>ve,adminNotificationsPartialUpdate:()=>$e,adminNotificationsRetrieve:()=>Be,adminNotificationsTriggerCreate:()=>We,adminNotificationsUpdate:()=>_e,adminTemplatesList:()=>He,adminTemplatesRetrieve:()=>Ve,adminWebhookCreate:()=>Fe,deactivateCreate:()=>Je,userLogsList:()=>Me,userLogsPartialUpdate:()=>Ge,userLogsRetrieve:()=>Qe,userLogsUpdate:()=>Xe,userNotificationsList:()=>Ye,userNotificationsPartialUpdate:()=>et,userNotificationsRetrieve:()=>Ze,userNotificationsUpdate:()=>tt,webhookCreate:()=>rt});var N={bodySerializer:e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():r)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},it=Object.entries(ae);var M=({onRequest:e,onSseError:t,onSseEvent:r,responseTransformer:i,responseValidator:o,sseDefaultRetryDelay:l,sseMaxRetryAttempts:d,sseMaxRetryDelay:a,sseSleepFn:p,url:u,...n})=>{let m,C=p??(c=>new Promise(O=>setTimeout(O,c)));return{stream:async function*(){let c=l??3e3,O=0,T=n.signal??new AbortController().signal;for(;!T.aborted;){O++;let E=n.headers instanceof Headers?n.headers:new Headers(n.headers);m!==void 0&&E.set("Last-Event-ID",m);try{let A={redirect:"follow",...n,body:n.serializedBody,headers:E,signal:T},R=new Request(u,A);e&&(R=await e(u,A));let y=await(n.fetch??globalThis.fetch)(R);if(!y.ok)throw new Error(`SSE failed: ${y.status} ${y.statusText}`);if(!y.body)throw new Error("No body in SSE response");let h=y.body.pipeThrough(new TextDecoderStream).getReader(),S="",$=()=>{try{h.cancel()}catch{}};T.addEventListener("abort",$);try{for(;;){let{done:te,value:re}=await h.read();if(te)break;S+=re,S=S.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let _=S.split(`
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-2vNCP2LN.mjs';
|
|
2
|
+
import '../create-auth-CHzmb_8_.mjs';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-D-Z8R83N.js';
|
|
2
|
+
import '../create-auth-CHzmb_8_.js';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -249,7 +249,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
249
249
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
250
250
|
responseStyle: TResponseStyle;
|
|
251
251
|
throwOnError: ThrowOnError;
|
|
252
|
-
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
252
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
253
253
|
/**
|
|
254
254
|
* Any body that you want to add to your request.
|
|
255
255
|
*
|