palbase 0.78.1 → 0.80.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.
Files changed (62) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai-sdk/index.js +2 -2
  3. package/dist/backend/engine.js +2 -2
  4. package/dist/backend/env.js +1 -1
  5. package/dist/backend/index.js +3 -3
  6. package/dist/backend/stack.js +1 -1
  7. package/dist/backend/test.js +2 -2
  8. package/dist/chunks/{35KQJQ77.js → 2NB7UENO.js} +2 -2
  9. package/dist/chunks/{3XF644A5.js → 5BQM5XTX.js} +2 -2
  10. package/dist/chunks/{VNUCKM7H.js → 6INSGN37.js} +1 -1
  11. package/dist/chunks/{ROV6TJZK.js → 6PUARVHY.js} +1 -1
  12. package/dist/chunks/{TFPVJ3C3.js → 7NOXAQOX.js} +2 -2
  13. package/dist/chunks/{L63FWRZX.js → 7QS5ABCT.js} +2 -2
  14. package/dist/chunks/{RB4JQXKZ.js → 7XQVUV65.js} +2 -2
  15. package/dist/chunks/{UUDOMSKW.js → BQUNZH5E.js} +2 -2
  16. package/dist/chunks/{FCCX2OTM.js → DP6WZPTF.js} +2 -2
  17. package/dist/chunks/{WTFMJKDB.js → FUNHIQCH.js} +2 -2
  18. package/dist/chunks/G4PGGIAO.js +2 -0
  19. package/dist/chunks/{LXS7JHPJ.js → IK4MB3HQ.js} +2 -2
  20. package/dist/chunks/{JY7YG3BO.js → IS5HMTJX.js} +2 -2
  21. package/dist/chunks/{2T3EX52E.js → LZXD4SBY.js} +1 -1
  22. package/dist/chunks/{6Y4ICGZ7.js → N767RMLK.js} +2 -2
  23. package/dist/chunks/{ZIHVYOXE.js → OY6JSD3B.js} +2 -2
  24. package/dist/chunks/{EUMY6SCM.js → QV53HO4D.js} +1 -1
  25. package/dist/chunks/{ZBTOHVML.js → RGCK6WN2.js} +2 -2
  26. package/dist/chunks/{QWKOKJKM.js → RU3A4ASQ.js} +1 -1
  27. package/dist/chunks/{25KG2TVU.js → T2XBJBUC.js} +1 -1
  28. package/dist/chunks/TNNTPBI3.js +23 -0
  29. package/dist/chunks/{5KGMQFET.js → TOGOOVTU.js} +1 -1
  30. package/dist/chunks/{LONPNPNX.js → UKM6LWJ3.js} +2 -2
  31. package/dist/chunks/{IO5HB5B6.js → VZQI2MW2.js} +2 -2
  32. package/dist/chunks/WUOSCBJ3.js +13 -0
  33. package/dist/cli.js +5 -4
  34. package/dist/cloud/index.js +2 -2
  35. package/dist/refuse/ai-sdk.js +1 -1
  36. package/dist/refuse/ai.js +1 -1
  37. package/dist/refuse/backend.js +1 -1
  38. package/dist/refuse/cloud.js +1 -1
  39. package/dist/refuse/server.js +1 -1
  40. package/dist/server/index.js +2 -2
  41. package/dist/server/testing.js +2 -2
  42. package/dist/web/index.js +2 -2
  43. package/dist/web/message.js +2 -2
  44. package/dist/web/palbe.js +2 -2
  45. package/dist/web/payments-ui.js +2 -2
  46. package/dist/web/paywall.js +2 -2
  47. package/dist/web/push-sw.js +1 -1
  48. package/dist/web/ssr.js +2 -2
  49. package/dist/web/vite.js +2 -2
  50. package/package.json +2 -2
  51. package/types/cloud/src/generated/project.d.ts +2 -2
  52. package/types/internal/src/chat.d.ts +17 -0
  53. package/types/internal/src/modules/ai.d.ts +48 -3
  54. package/types/internal/src/modules/commerce.d.ts +38 -12
  55. package/types/internal/src/modules/events.d.ts +2 -2
  56. package/types/internal/src/modules/iap.d.ts +112 -101
  57. package/types/internal/src/modules/payments.d.ts +828 -18
  58. package/types/web/src/chat.d.ts +4 -2
  59. package/types/web/src/iap.d.ts +6 -0
  60. package/dist/chunks/3TJFV35H.js +0 -2
  61. package/dist/chunks/426QPZNS.js +0 -13
  62. package/dist/chunks/4XE4HLPK.js +0 -23
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /*! palbase 0.78.1 — Palbase SDK License (see LICENSE) */
2
+ /*! palbase 0.80.0 — Palbase SDK License (see LICENSE) */
3
3
  var Q0=Object.defineProperty;var wt=(e,t)=>{for(var n in t)Q0(e,n,{get:t[n],enumerable:!0})};import{parseArgs as MS}from"node:util";var eS=Symbol.for("palbase.data"),tS=globalThis,Ou=tS[eS]??=new WeakSet;function nS(e){return e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer}function Fi(e){let t=[e];for(;t.length>0;){let n=t.pop();if(!(typeof n!="object"||n===null||Ou.has(n)||nS(n))){Ou.add(n);for(let s of Array.isArray(n)?n:Object.values(n))t.push(s)}}return e}var sS="X-PoW-Challenge-ID",aS="X-PoW-Nonce";function xu(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.error!=="pow_required"||typeof t.challenge!="object"||t.challenge===null)return null;let{id:n,prefix:s,difficulty:a}=t.challenge;return typeof n!="string"||typeof s!="string"||typeof a!="number"||!Number.isInteger(a)||a<0?null:{id:n,prefix:s,difficulty:a}}function oS(e){return 8*2**e}var Oa;async function iS(){if(Oa)return Oa;let e=globalThis;if(e.process?.versions?.node!==void 0||e.process?.versions?.bun!==void 0)try{let s=(await import("node:crypto")).createHash;if(typeof s=="function")return Oa=a=>new Uint8Array(s("sha256").update(a).digest()),Oa}catch{}let t=new TextEncoder;return Oa=async n=>new Uint8Array(await crypto.subtle.digest("SHA-256",t.encode(n))),Oa}function rS(e){let t=0;for(let n of e){if(n===0){t+=8;continue}return t+Math.clz32(n)-24}return t}var lS=4096,pS=typeof globalThis.setImmediate=="function"?()=>new Promise(e=>globalThis.setImmediate(e)):()=>new Promise(e=>setTimeout(e,0));async function Lu(e,t={}){if(e.difficulty>24)throw new Error(`proof-of-work: difficulty ${e.difficulty} is above auth's ceiling of 24`);let n=await iS(),s=oS(e.difficulty),a=Date.now()+(t.timeLimitMs??12e4);for(let o=0;o<s;o++){if(o%lS===0&&o>0){if(await pS(),t.signal?.aborted)throw t.signal.reason??new DOMException("proof-of-work aborted","AbortError");if(Date.now()>a)throw new Error(`proof-of-work: gave up on difficulty ${e.difficulty} after ${o} attempts`)}let i=n(e.prefix+o),r=i instanceof Uint8Array?i:await i;if(rS(r)>=e.difficulty)return{[sS]:e.id,[aS]:String(o)}}throw new Error(`proof-of-work: no nonce for difficulty ${e.difficulty} within ${s} attempts`)}var G=class extends Error{status;code;requestId;retryAfter;body;op;get isNetworkError(){return this.code==="network_error"}constructor(t){super(t.message,t.cause===void 0?void 0:{cause:t.cause}),this.name="PalbaseError",this.op=t.op,this.status=t.status,this.code=t.code,this.requestId=t.requestId,this.retryAfter=t.retryAfter,this.body=t.body}};function c(e,t,n){let s=String(n);if(s===""||s==="."||s==="..")throw new G({op:e,status:0,code:"invalid_path_parameter",message:`${e}: ${t} cannot be ${s===""?"empty":JSON.stringify(s)}`});return encodeURIComponent(s)}var dS=new Set(["apikey","authorization"]),cS=64*1024;function pp(e){let t=Bi(e.baseUrl),n=e.fetch??globalThis.fetch,s=e.solveProofOfWork??!0,a=async(o,i)=>{let r=gS(t,o),l=new Headers;for(let[y,w]of Object.entries(o.headers??{}))w!=null&&!dS.has(y.toLowerCase())&&l.set(y,String(w));for(let[y,w]of Object.entries(i))l.set(y,w);await hS(o,e.credentials,l),l.has("accept")||l.set("accept","application/json");let p={method:o.method,headers:l,redirect:"manual",signal:o.signal,...o.keepalive?{keepalive:!0}:{}};o.body&&o.body.value!==void 0&&(l.set("content-type",o.body.contentType),p.body=yS(o.body.kind,o.body.value),xa(p.body)||(p.duplex="half"));let d;try{d=o.onUploadProgress&&e.xmlHttpRequest?await uS(e.xmlHttpRequest,o.op,r,p,o.onUploadProgress):await n(r,p)}catch(y){throw o.signal?.aborted||y instanceof G?y:new G({op:o.op,status:0,code:"network_error",message:`${o.op}: the request did not reach ${t.origin}`,cause:y})}let u=o.answers[d.status]??(o.ownResponse&&d.status>=200&&d.status<300?"raw":void 0);if(u===void 0)throw d.status>=200&&d.status<300?(await d.body?.cancel(),new G({op:o.op,status:d.status,code:"undeclared_answer",message:`${o.op}: the server answered ${d.status}, which its contract does not declare; the request may have taken effect`})):await bS(o.op,d);let m;switch(u){case"json":try{m=Fi(await d.json())}catch(y){throw new G({op:o.op,status:d.status,code:"invalid_json",message:`${o.op}: the answer is not JSON`,cause:y})}break;case"raw":m=d;break;default:await d.body?.cancel(),m=void 0}return{status:d.status,data:m,headers:d.headers}};return{async send(o){try{return await a(o,{})}catch(i){let r=s&&i instanceof G&&i.status===403?xu(i.body):null,l=o.body?.value;if(!r||o.body?.kind==="raw"&&!xa(l))throw i;let p=i,d;try{d=await Lu(r,{signal:o.signal})}catch(u){throw o.signal?.aborted?u:new G({op:o.op,status:403,code:"pow_unsolved",message:`${o.op}: ${u instanceof Error?u.message:String(u)}`,requestId:p.requestId,body:p.body,cause:u})}return a(o,d)}}}}function uS(e,t,n,s,a){return new Promise((o,i)=>{let r=s.signal;if(r?.aborted)return i(r.reason);let l=new e,p=()=>l.abort();r?.addEventListener("abort",p,{once:!0});let d=u=>{r?.removeEventListener("abort",p),u()};l.open(s.method??"GET",n.href),l.responseType="arraybuffer",new Headers(s.headers).forEach((u,m)=>l.setRequestHeader(m,u)),l.upload&&(l.upload.onprogress=u=>{u.lengthComputable&&a(u.loaded,u.total)}),l.onload=()=>d(()=>{if(l.responseURL!==""&&l.responseURL!==n.href){i(new G({op:t,status:0,code:"undeclared_redirect",message:`${t}: the server redirected; the answer is another address's, and was not read`}));return}if(l.status<200||l.status>599)return i(new TypeError(`${t}: answered ${l.status}`));let u=l.status===204||l.status===205||l.status===304;o(new Response(u?null:l.response,{status:l.status,statusText:l.statusText,headers:mS(l.getAllResponseHeaders())}))}),l.onerror=()=>d(()=>i(new TypeError(`${t}: the request failed`))),l.onabort=()=>d(()=>i(r?.reason??new DOMException("The request was aborted","AbortError"))),l.send(s.body)})}function mS(e){let t=new Headers;for(let n of e.split(/\r?\n/)){let s=n.indexOf(":");if(!(s<=0))try{t.append(n.slice(0,s).trim(),n.slice(s+1).trim())}catch{}}return t}function Bi(e){let t;try{t=new URL(e)}catch{throw new TypeError(`baseUrl ${JSON.stringify(e)} is not an absolute URL`)}let n=t.hostname==="localhost"||t.hostname.endsWith(".localhost")||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol!=="https:"&&!(t.protocol==="http:"&&n))throw new TypeError(`baseUrl must be https (http only for a loopback address): ${t.origin}`);if(t.username||t.password||t.search||t.hash)throw new TypeError("baseUrl carries no user, query or fragment");if(t.pathname!=="/"&&t.pathname!=="")throw new TypeError("baseUrl is the project origin alone, with no path");return t}function gS(e,t){if(!t.path.startsWith("/")||t.path.startsWith("//"))throw new G({op:t.op,status:0,code:"invalid_path",message:`${t.op}: path ${JSON.stringify(t.path)} is not absolute`});let n=new URL(t.path+fS(t.query),e);if(n.origin!==e.origin)throw new G({op:t.op,status:0,code:"invalid_path",message:`${t.op}: path leaves the project's origin`});return n}async function hS(e,t,n){if(e.auth.length===0)return;let s=e.auth.some(i=>i.includes("userJWT"))?await t.accessToken?.():void 0,a=i=>{switch(i){case"ApiKeyAuth":return!!(t.publishableKey??t.secretKey);case"SecretKeyAuth":case"AdminAuth":return!!(t.secretKey??t.token);case"PalbaseBearer":return!!t.token;case"userJWT":return!!s&&!t.token;default:return!1}},o=e.auth.filter(i=>i.every(a)).reduce((i,r)=>i===void 0||r.length>i.length?r:i,void 0);if(!o)throw new G({op:e.op,status:0,code:"missing_credential",message:`${e.op} needs one of: ${e.auth.map(i=>i.length===0?"nothing":i.join(" + ")).join(" | ")}`});for(let i of o)i==="ApiKeyAuth"?n.set("apikey",t.publishableKey??t.secretKey):(i==="SecretKeyAuth"||i==="AdminAuth"||i==="PalbaseBearer")&&t.token?n.set("authorization",`Bearer ${t.token}`):i==="SecretKeyAuth"||i==="AdminAuth"?n.set("apikey",t.secretKey):i==="userJWT"&&n.set("authorization",`Bearer ${s}`)}function yS(e,t){switch(e){case"json":return JSON.stringify(t);case"form":{let n=new URLSearchParams;for(let[s,a]of Object.entries(t))dp(n,s,a);return n}case"raw":return t}}function xa(e){return!!(e==null||typeof e=="string"||e instanceof URLSearchParams||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||ArrayBuffer.isView(e))}function fS(e){if(!e)return"";let t=new URLSearchParams;for(let[s,a]of Object.entries(e))dp(t,s,a);let n=t.toString();return n===""?"":`?${n}`}function dp(e,t,n){if(n!=null){if(Array.isArray(n)){for(let s of n)dp(e,t,s);return}if(n instanceof Date){e.append(t,n.toISOString());return}e.append(t,typeof n=="object"?JSON.stringify(n):String(n))}}async function bS(e,t){let n=await wS(t,cS).catch(()=>""),s;try{s=n===""?void 0:JSON.parse(n)}catch{s=n}let a=vS(s)?s:void 0,o=Number(t.headers.get("retry-after")),i=t.status>=300&&t.status<400;return new G({op:e,status:t.status,code:a?.error??(i?"undeclared_redirect":`http_${t.status}`),message:a?.error_description??(i?`${e}: the server redirected (${t.status}); the request was not followed, its credentials stay here`:`${e}: ${t.status} ${t.statusText}`.trim()),requestId:a?.request_id??t.headers.get("x-request-id")??void 0,retryAfter:a?.retry_after??(Number.isFinite(o)&&o>0?o:void 0),body:s})}async function wS(e,t){if(!e.body)return"";let n=e.body.getReader(),s=[],a=0;for(;a<t;){let{done:r,value:l}=await n.read();if(r)break;s.push(l),a+=l.byteLength}await n.cancel().catch(()=>{});let o=new Uint8Array(Math.min(a,t)),i=0;for(let r of s){let l=Math.min(r.byteLength,o.byteLength-i);if(o.set(r.subarray(0,l),i),i+=l,i>=o.byteLength)break}return new TextDecoder().decode(o)}function vS(e){return typeof e=="object"&&e!==null&&typeof e.error=="string"}var Ji={project:{type:"string",short:"P",value:"project",description:"the project (name or id; org/project when the name is in two organizations)"},env:{type:"string",short:"E",value:"env",description:"the project's environment (slug or ref)"},json:{type:"boolean",description:"print the answer as JSON"},"non-interactive":{type:"boolean",description:"never ask: refuse what would need a question"},yes:{type:"boolean",short:"y",description:"confirm a change to a production environment without asking"},debug:{type:"boolean",description:"print each request the command sends"},help:{type:"boolean",short:"h",description:"show help"}};var b=class extends Error{exitCode;hint;code;reported;constructor(t,n,s={}){super(n),this.name="CliError",this.code=t,this.hint=s.hint,this.exitCode=s.exitCode??1,this.reported=s.reported??!1}};function h(e,t){return new b("usage",e,{hint:t,exitCode:2})}var Hi=class{io;json;constructor(t,n){this.io=t,this.json=n}result(t,n){this.json?this.io.stdout(`${JSON.stringify(t,null,2)}
4
4
  `):n()}line(t=""){this.io.stdout(`${le(t)}
5
5
  `)}note(t){this.io.stderr(`${le(t)}
@@ -9,7 +9,7 @@ var Q0=Object.defineProperty;var wt=(e,t)=>{for(var n in t)Q0(e,n,{get:t[n],enum
9
9
  `);let i;try{i=await this.io.fetch(t,{method:n.method,headers:{...n.headers,...a},body:n.body,signal:n.signal,...s?{}:{duplex:"half"},redirect:"manual"})}catch(l){throw n.signal?.aborted?l:new b("network_error",`${new URL(t).origin} could not be reached: ${l instanceof Error?l.message:String(l)}`)}if(this.debug&&this.io.stderr(`< ${i.status} ${i.headers.get("x-request-id")??""}
10
10
  `),i.status!==503||!s||o>=LS||!xS.has(await gp(i)??""))return i;await i.body?.cancel();let r=Number(i.headers.get("retry-after")??"");await this.io.sleep((Number.isFinite(r)&&r>0?Math.min(r,30):1)*1e3)}}async exchange(t,n,s){let a=await this.token(),o=await this.send(t,n,s,a.value);if(o.status===401&&a.renewable){let i=await this.renew(await this.currentSession());o=await this.send(t,n,s,i.access_token)}return{res:o,renewable:a.renewable}}async answered(t,n,s,a){if(s.status===204)return;let o=await s.text(),i=o===""?void 0:IS(o);if(s.ok)return i;let r=i??{};throw s.status===401?r.error==="token_not_for_machines"?Vu(new URL(this.cloud.studioApi).host):a?La():this.tokenRefused("Studio"):new G({op:`${t} ${n}`,status:s.status,code:r.error??`http_${s.status}`,message:r.error_description??`Studio answered ${s.status}`,requestId:r.request_id??s.headers.get("x-request-id")??void 0,body:i})}tokenRefused(t){return(this.io.env.PALBASE_TOKEN??"").startsWith("pbe_")?new b("token_refused",`${t} refused PALBASE_TOKEN, an environment's token: it ended (a few hours at most), it was revoked, or what minted it no longer holds`,{hint:"mint another: palbase env:tokens:create --scope <scope> (an admin), or with the environment's secret key (Studio's POST /environments/{ref}/tokens)"}):(this.io.env.PALBASE_TOKEN??"").startsWith("pbu_")?new b("token_refused",`${t} refused PALBASE_TOKEN, an account token: it was revoked, it ended, or, in this organization, the one who made it left it`,{hint:"its maker makes a new one: palbase account:tokens:create <name>"}):new b("token_refused",`${t} refused PALBASE_TOKEN: it was revoked, it ended, or the one who made it no longer holds its role`,{hint:"an admin makes a new one: palbase tokens:create <name>"})}async token(){let t=this.io.env.PALBASE_TOKEN;return t&&t!==""?{value:t,renewable:!1}:{value:(await this.currentSession()).access_token,renewable:!0}}async renew(t){let n=await Fu(this.io,this.cloud,t);return await this.state.writeSession(n),this.session=n,n}async send(t,n,s,a){let o=`${this.cloud.studioApi}${OS}${n}`;this.debug&&this.io.stderr(`> ${t} ${o}
11
11
  `);try{let i=await this.io.fetch(o,{method:t,headers:{...a===void 0?{}:{authorization:`Bearer ${a}`},accept:"application/json",...s===void 0?{}:{"content-type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s),redirect:"manual"});return this.debug&&this.io.stderr(`< ${i.status} ${i.headers.get("x-request-id")??""}
12
- `),i}catch(i){throw new b("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function Vu(e){return new b("token_not_for_machines",`the platform's edge refused PALBASE_TOKEN at ${e}, taking it for a machine's address (token_not_for_machines): the token itself was not refused`,{hint:"nothing is wrong with the token: run this again in a few minutes, and tell Palbase if it lasts"})}async function gp(e){let t=await e.clone().json().catch(()=>null),n=t&&typeof t=="object"?t.error:void 0;return typeof n=="string"&&/^(console|token|edge)_/.test(n)?n:void 0}function IS(e){try{return JSON.parse(e)}catch{return e}}var Xu={version:"0.78.1"};var Qi=Xu.version;async function tm(e,t,n,s){let a=new Map(n.map(r=>[r.name,r])),o=e.includes("--json"),i=e.includes("--debug");try{let{name:r,at:l}=DS(e);if(r===void 0)return e.includes("--version")?(t.stdout(`palbase ${Qi}
12
+ `),i}catch(i){throw new b("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function Vu(e){return new b("token_not_for_machines",`the platform's edge refused PALBASE_TOKEN at ${e}, taking it for a machine's address (token_not_for_machines): the token itself was not refused`,{hint:"nothing is wrong with the token: run this again in a few minutes, and tell Palbase if it lasts"})}async function gp(e){let t=await e.clone().json().catch(()=>null),n=t&&typeof t=="object"?t.error:void 0;return typeof n=="string"&&/^(console|token|edge)_/.test(n)?n:void 0}function IS(e){try{return JSON.parse(e)}catch{return e}}var Xu={version:"0.80.0"};var Qi=Xu.version;async function tm(e,t,n,s){let a=new Map(n.map(r=>[r.name,r])),o=e.includes("--json"),i=e.includes("--debug");try{let{name:r,at:l}=DS(e);if(r===void 0)return e.includes("--version")?(t.stdout(`palbase ${Qi}
13
13
  `),0):(t.stdout(em(n)),e.length===0||e.includes("--help")||e.includes("-h")?0:2);if(r==="help"){let E=e[l+1],C=E===void 0?void 0:a.get(E);if(E!==void 0&&!C)throw Yu(E,n);return t.stdout(C?Qu(C):em(n)),0}let p=a.get(r);if(!p)throw Yu(r,n);let d=[...e.slice(0,l),...e.slice(l+1)],u=d.includes("--")?d.slice(0,d.indexOf("--")):d;if(u.includes("--help")||u.includes("-h"))return t.stdout(Qu(p)),0;let{flags:m,positionals:y}=zS(p,d),w=p.args??{min:0,max:0};if(y.length<w.min)throw h(`${p.name} needs ${w.min===1?"an argument":`${w.min} arguments`}`,yp(p));if(y.length>w.max)throw h(`${p.name} takes ${w.max===0?"no argument":`at most ${w.max}`}: ${JSON.stringify(y.slice(w.max))} is left over`,yp(p));let v={project:m.project,env:m.env,json:m.json===!0,nonInteractive:m["non-interactive"]===!0,yes:m.yes===!0,debug:m.debug===!0},P=qu(t.env),A=new Xi(Ku(t.configDir,P)),T={io:t,state:A,out:new Hi(t,v.json),global:v,args:y,flags:m,interactive:t.interactive&&!v.nonInteractive,cloud:P,studio:new Zi(t,P,A,v.debug,s?.callPlatform)};return await p.run(T)??0}catch(r){return qS(r,t,o,i)}}function DS(e){let t=new Set;for(let[n,s]of Object.entries(Ji))s.type==="string"&&(t.add(`--${n}`),s.short&&t.add(`-${s.short}`));for(let n=0;n<e.length;n++){let s=e[n];if(s==="--")return{at:-1};if(t.has(s)){n++;continue}if(!s.startsWith("-"))return{name:s,at:n}}return{at:-1}}function zS(e,t){let n={...Ji,...e.flags??{}},s={};for(let[a,o]of Object.entries(n))s[a]={type:o.type,...o.short?{short:o.short}:{},...o.multiple?{multiple:!0}:{}};try{let{values:a,positionals:o}=MS({args:t,options:s,strict:!0,allowPositionals:!0});return{flags:a,positionals:o}}catch(a){throw h(a instanceof Error?a.message.replace(/^.*?: /,""):String(a),`palbase help ${e.name}`)}}function qS(e,t,n,s){let a="error",o,i,r=1,l;return e instanceof b?(a=e.code,o=e.message,i=e.hint,r=e.exitCode):e instanceof G?(a=e.code,o=e.message,l=e.requestId,e.code==="token_out_of_scope"&&t.env.PALBASE_TOKEN&&(o=`${e.op} refused PALBASE_TOKEN: ${e.message}`,i="this is the token's reach, fixed when it was minted: a person's yes does not change it \u2014 mint a token whose scopes name this call, or have a person run it signed in")):o=e instanceof Error?e.message:String(e),n&&e instanceof b&&e.reported||(n&&t.stdout(`${JSON.stringify({error:a,message:o,...i?{hint:i}:{},...l?{request_id:l}:{}},null,2)}
14
14
  `),t.stderr(`error: ${le(o)}${l?` (request ${le(l)})`:""}
15
15
  `),i&&t.stderr(` ${le(i)}
@@ -18,7 +18,7 @@ var Q0=Object.defineProperty;var wt=(e,t)=>{for(var n in t)Q0(e,n,{get:t[n],enum
18
18
  `)}
19
19
  `}function em(e){let t=new Map;for(let a of e){let o=a.name.includes(":")?a.name.slice(0,a.name.indexOf(":")):"";t.set(o,[...t.get(o)??[],a])}let n=Math.max(...e.map(a=>a.name.length)),s=["palbase \u2014 your Palbase organizations, projects and environments from the terminal","","usage: palbase <command> [flags]",""];for(let[a,o]of t){s.push(a===""?"Commands:":`${a}:`);for(let i of o)s.push(` ${i.name.padEnd(n)} ${i.summary}`);s.push("")}return s.push("palbase help <command> shows a command in full."),`${s.join(`
20
20
  `)}
21
- `}function Q(e,t){try{return c("palbase",e,t)}catch(n){throw n instanceof G&&n.code==="invalid_path_parameter"?new b("unsafe_path",`${e} cannot be ${t===""?"empty":JSON.stringify(t)}: a request's path cannot carry it`):n}}function fp(e){return{name:"login",summary:"sign in with your Studio account",details:["Shows a one-time code and opens Studio, where you approve it while signed in there.","The CLI then holds a session of yours: Studio lists it with your others, and ending it there signs the CLI out.","On a machine with no browser (a server, an agent), open the address it prints on any device."],flags:{"no-browser":{type:"boolean",description:"print the address instead of opening a browser"},...e?{owner:{type:"boolean",description:"Palbase's own project's owner: confirm with your passkey in this computer's browser, for 15 minutes of changes to it"}}:{}},scope:"none",async run(t){if(t.io.env.PALBASE_TOKEN)throw new b("token_in_use","PALBASE_TOKEN is set: the CLI acts with that token, and a sign-in would not be used",{hint:"unset PALBASE_TOKEN to sign in as yourself"});if(e&&t.flags.owner===!0){await e(t);return}let n=await Uu(t.io,t.cloud),s=`${t.cloud.studioWeb}/device`;t.out.note(""),t.out.note(` Enter this code in your browser: ${n.user_code}`),t.out.note("");let a=t.flags["no-browser"]!==!0&&t.interactive&&await t.io.openBrowser(s);t.out.note(a?`Opened ${s} \u2014 sign in there if asked, then enter the code.`:`Open ${s} on any device, sign in, and enter the code.`),t.out.note("Waiting for the approval\u2026");let o=await Wu(t.io,t.cloud,n);await t.state.writeSession(o),t.out.result({user:o.user},()=>t.out.line(`Signed in as ${o.user.email??o.user.id}.`))}}}var OK=fp(),nm={name:"logout",summary:"sign out: the session is ended at Palbase and forgotten on this computer",scope:"none",async run(e){if(e.io.env.PALBASE_TOKEN)throw new b("token_in_use","PALBASE_TOKEN is set: logout ends your own sign-in, and the CLI acts with the token",{hint:"unset PALBASE_TOKEN to sign out"});let t=await e.state.readSession();if(!t){e.out.result({signed_out:!0},()=>e.out.line("You were not signed in."));return}for(let[n,s]of Object.entries(await e.state.personalKeys()))try{await e.studio.request("DELETE",`/environments/${Q("the environment's ref",n)}/personal-key/${Q("the personal key's id",s.id)}`)}catch(a){a instanceof Error&&"status"in a&&a.status===404||e.out.warn(`your key at ${n} (${s.label}) could not be revoked: ${a instanceof Error?a.message:String(a)} \u2014 revoke it in Studio, or it ends ${s.expires_at}`)}await e.state.forgetPersonalKeys(),await e.state.forget("owner.json");try{await Bu(e.io,e.cloud,t)}catch(n){e.out.warn(`${n instanceof Error?n.message:String(n)} \u2014 end the session in Studio (Account \u203A Sessions)`)}await e.state.clearSession(),e.out.result({signed_out:!0},()=>e.out.line(`Signed out ${t.user.email??t.user.id}.`))}},sm={name:"whoami",summary:"the account the CLI acts as, and the environment chosen for this directory",scope:"account",async run(e){let t=e.io.env.PALBASE_TOKEN,n;if(t?.startsWith("pbu_")){let{organizations:a}=await e.studio.get("/orgs");n={id:`account token \u2026${t.slice(-4)}`,via:"token",organizations:a.length}}else if(t?.startsWith("pbo_")){let{organizations:a}=await e.studio.get("/orgs"),o=a[0];n={id:`token \u2026${t.slice(-4)}`,via:"token",...o&&{organization:{id:o.id,name:o.name,role:o.role}}}}else if(t){let a=up(t);n={id:String(a.sub??""),...typeof a.email=="string"?{email:a.email}:{},via:"token"}}else n={...(await e.studio.currentSession()).user,via:"session"};let s=await e.state.targetFor(e.io.cwd);e.out.result({user:n,target:s?.target??null,target_dir:s?.dir??null},()=>{e.out.line(n.organization?`an access token of ${le(n.organization.name)} (${n.organization.role}), ${n.id} (PALBASE_TOKEN)`:n.organizations!==void 0?`an ${n.id} (PALBASE_TOKEN): an admin of the ${n.organizations} organization${n.organizations===1?"":"s"} it opened`:`${n.email??n.id}${n.via==="token"?" (PALBASE_TOKEN)":""}`),s&&e.out.line(`${s.target.org_name} \u203A ${s.target.project_name} \u203A ${s.target.env_name} (${s.target.env_slug}) \u2014 chosen for ${s.dir}`)})}};var KS={name:"account:tokens:list",summary:"your account tokens (for a program that opens organizations): name, how many organizations they reach, when they end and were last used \u2014 never their values",scope:"account",async run(e){let{tokens:t}=await e.studio.get("/account/tokens");e.out.result({tokens:t},()=>{t.length===0?e.out.line("You have no account token yet: palbase account:tokens:create <name> makes one."):e.out.table(t,[{header:"name",value:n=>le(n.name)},{header:"token",value:n=>`pbu_\u2026${n.hint}`},{header:"organizations",value:n=>String(n.organizations)},{header:"ends",value:n=>n.expires_at.slice(0,10)},{header:"last used",value:n=>n.last_used_at?.slice(0,16).replace("T"," ")??"never"},{header:"id",value:n=>n.id}])})}},US={name:"account:tokens:create",summary:"make an account token for a program that opens organizations; its value is shown this once",usage:"<name> [--days <n>]",details:["Give it to the program as its secret (PALBASE_TOKEN, or palbase/cloud's token): it opens organizations \u2014 you their owner, the token their admin \u2014 and builds projects and environments there.","It reaches only the organizations it opened, never your others; it makes no token or key and changes no one's place. It ends after --days (default 90, at most 365), when it is revoked, and, in an organization, when you leave it."],args:{min:1,max:1},flags:{days:{type:"string",value:"n",description:"how many days it is good for (default 90)"}},scope:"account",async run(e){let t=e.flags.days===void 0?90:Number(e.flags.days);if(!Number.isInteger(t)||t<1||t>365)throw h("--days is a whole number from 1 to 365");let n=await e.studio.post("/account/tokens",{name:e.args[0],expires_in_days:t});e.out.result(n,()=>{e.out.line(`Made the account token ${le(n.name)} (until ${n.expires_at.slice(0,10)}).`),e.out.line(`token (shown this once \u2014 keep it as the program's secret PALBASE_TOKEN): ${n.token}`)})}},WS={name:"account:tokens:revoke",summary:"revoke one of your account tokens (by its name or id): refused from its next request on; the organizations it opened stay yours",usage:"<name|id>",args:{min:1,max:1},scope:"account",async run(e){let{tokens:t}=await e.studio.get("/account/tokens"),n=t.filter(s=>s.id===e.args[0]||s.name===e.args[0]);if(n.length===0)throw new b("no_such_token",`you have no account token ${JSON.stringify(e.args[0])}`,{hint:"palbase account:tokens:list shows them"});if(n.length>1)throw new b("ambiguous_token",`${JSON.stringify(e.args[0])} names more than one token`,{hint:"pass its id"});await e.studio.request("DELETE",`/account/tokens/${Q("the token's id",n[0].id)}`),e.out.result({revoked:n[0].id},()=>e.out.line(`Revoked the account token ${le(n[0].name)}.`))}},am=[KS,US,WS];var er={};wt(er,{client:()=>FS});function FS(e){return{async draftAgent(t){return e.send({op:"DraftAgent",method:"POST",path:"/ai/agent-drafts",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAgents(t){return e.send({op:"ListAgents",method:"GET",path:"/ai/agents",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getAgent(t){return e.send({op:"GetAgent",method:"GET",path:"/ai/agents/"+c("GetAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putAgent(t){return e.send({op:"PutAgent",method:"PUT",path:"/ai/agents/"+c("PutAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteAgent(t){return e.send({op:"DeleteAgent",method:"DELETE",path:"/ai/agents/"+c("DeleteAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async publishAgent(t){return e.send({op:"PublishAgent",method:"POST",path:"/ai/agents/"+c("PublishAgent","name",t.path.name)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rollbackAgent(t){return e.send({op:"RollbackAgent",method:"POST",path:"/ai/agents/"+c("RollbackAgent","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAgentVersions(t){return e.send({op:"ListAgentVersions",method:"GET",path:"/ai/agents/"+c("ListAgentVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createAudioSpeech(t){return e.send({op:"CreateAudioSpeech",method:"POST",path:"/ai/audio/speech",auth:[["SecretKeyAuth"]],answers:{200:"raw"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createAudioTranscription(t){return e.send({op:"CreateAudioTranscription",method:"POST",path:"/ai/audio/transcriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChats(t){return e.send({op:"ListChats",method:"GET",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createChat(t){return e.send({op:"CreateChat",method:"POST",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChat(t){return e.send({op:"GetChat",method:"GET",path:"/ai/chats/"+c("GetChat","chat_id",t.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteChat(t){return e.send({op:"DeleteChat",method:"DELETE",path:"/ai/chats/"+c("DeleteChat","chat_id",t.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async decideChatApproval(t){return e.send({op:"DecideChatApproval",method:"POST",path:"/ai/chats/"+c("DecideChatApproval","chat_id",t.path.chat_id)+"/approvals/"+c("DecideChatApproval","approval_id",t.path.approval_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatExecution(t){return e.send({op:"GetChatExecution",method:"GET",path:"/ai/chats/"+c("GetChatExecution","chat_id",t.path.chat_id)+"/execution",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async patchChatExecution(t){return e.send({op:"PatchChatExecution",method:"PATCH",path:"/ai/chats/"+c("PatchChatExecution","chat_id",t.path.chat_id)+"/execution",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async forkChat(t){return e.send({op:"ForkChat",method:"POST",path:"/ai/chats/"+c("ForkChat","chat_id",t.path.chat_id)+"/fork",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatGoal(t){return e.send({op:"GetChatGoal",method:"GET",path:"/ai/chats/"+c("GetChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setChatGoal(t){return e.send({op:"SetChatGoal",method:"PUT",path:"/ai/chats/"+c("SetChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearChatGoal(t){return e.send({op:"ClearChatGoal",method:"DELETE",path:"/ai/chats/"+c("ClearChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async updateChatGoal(t){return e.send({op:"UpdateChatGoal",method:"PATCH",path:"/ai/chats/"+c("UpdateChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async handoffChat(t){return e.send({op:"HandoffChat",method:"POST",path:"/ai/chats/"+c("HandoffChat","chat_id",t.path.chat_id)+"/handoff",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async putChatMember(t){return e.send({op:"PutChatMember",method:"PUT",path:"/ai/chats/"+c("PutChatMember","chat_id",t.path.chat_id)+"/members/"+c("PutChatMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteChatMember(t){return e.send({op:"DeleteChatMember",method:"DELETE",path:"/ai/chats/"+c("DeleteChatMember","chat_id",t.path.chat_id)+"/members/"+c("DeleteChatMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listChatMessages(t){return e.send({op:"ListChatMessages",method:"GET",path:"/ai/chats/"+c("ListChatMessages","chat_id",t.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sendChatMessage(t){return e.send({op:"SendChatMessage",method:"POST",path:"/ai/chats/"+c("SendChatMessage","chat_id",t.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatMessageAttachment(t){return e.send({op:"GetChatMessageAttachment",method:"GET",path:"/ai/chats/"+c("GetChatMessageAttachment","chat_id",t.path.chat_id)+"/messages/"+c("GetChatMessageAttachment","message_id",t.path.message_id)+"/attachments/"+c("GetChatMessageAttachment","position",t.path.position),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async listChatParts(t){return e.send({op:"ListChatParts",method:"GET",path:"/ai/chats/"+c("ListChatParts","chat_id",t.path.chat_id)+"/parts",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putChatPipe(t){return e.send({op:"PutChatPipe",method:"PUT",path:"/ai/chats/"+c("PutChatPipe","chat_id",t.path.chat_id)+"/pipe",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteChatPipe(t){return e.send({op:"DeleteChatPipe",method:"DELETE",path:"/ai/chats/"+c("DeleteChatPipe","chat_id",t.path.chat_id)+"/pipe",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async sendSubagentMessage(t){return e.send({op:"SendSubagentMessage",method:"POST",path:"/ai/chats/"+c("SendSubagentMessage","chat_id",t.path.chat_id)+"/runs/"+c("SendSubagentMessage","run_id",t.path.run_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopSubagent(t){return e.send({op:"StopSubagent",method:"POST",path:"/ai/chats/"+c("StopSubagent","chat_id",t.path.chat_id)+"/runs/"+c("StopSubagent","run_id",t.path.run_id)+"/stop",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopChat(t){return e.send({op:"StopChat",method:"POST",path:"/ai/chats/"+c("StopChat","chat_id",t.path.chat_id)+"/stop",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTurnToolCalls(t){return e.send({op:"ListTurnToolCalls",method:"GET",path:"/ai/chats/"+c("ListTurnToolCalls","chat_id",t.path.chat_id)+"/tool-calls",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getChatToolCall(t){return e.send({op:"GetChatToolCall",method:"GET",path:"/ai/chats/"+c("GetChatToolCall","chat_id",t.path.chat_id)+"/tool-calls/"+c("GetChatToolCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async answerChatToolCall(t){return e.send({op:"AnswerChatToolCall",method:"POST",path:"/ai/chats/"+c("AnswerChatToolCall","chat_id",t.path.chat_id)+"/tool-outputs/"+c("AnswerChatToolCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChatTurnArtifacts(t){return e.send({op:"ListChatTurnArtifacts",method:"GET",path:"/ai/chats/"+c("ListChatTurnArtifacts","chat_id",t.path.chat_id)+"/turns/"+c("ListChatTurnArtifacts","response_id",t.path.response_id)+"/artifacts",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getChatTurnArtifact(t){return e.send({op:"GetChatTurnArtifact",method:"GET",path:"/ai/chats/"+c("GetChatTurnArtifact","chat_id",t.path.chat_id)+"/turns/"+c("GetChatTurnArtifact","response_id",t.path.response_id)+"/artifacts/"+c("GetChatTurnArtifact","artifact_id",t.path.artifact_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async getChatTurnCost(t){return e.send({op:"GetChatTurnCost",method:"GET",path:"/ai/chats/"+c("GetChatTurnCost","chat_id",t.path.chat_id)+"/turns/"+c("GetChatTurnCost","response_id",t.path.response_id)+"/cost",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async startChatVoice(t){return e.send({op:"StartChatVoice",method:"POST",path:"/ai/chats/"+c("StartChatVoice","chat_id",t.path.chat_id)+"/voice",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatVoice(t){return e.send({op:"GetChatVoice",method:"GET",path:"/ai/chats/"+c("GetChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("GetChatVoice","voice_id",t.path.voice_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async closeChatVoice(t){return e.send({op:"CloseChatVoice",method:"DELETE",path:"/ai/chats/"+c("CloseChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("CloseChatVoice","voice_id",t.path.voice_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async commandChatVoice(t){return e.send({op:"CommandChatVoice",method:"POST",path:"/ai/chats/"+c("CommandChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("CommandChatVoice","voice_id",t.path.voice_id)+"/commands",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createEmbeddings(t){return e.send({op:"CreateEmbeddings",method:"POST",path:"/ai/embeddings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEndpoints(t){return e.send({op:"ListEndpoints",method:"GET",path:"/ai/endpoints",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putEndpoint(t){return e.send({op:"PutEndpoint",method:"PUT",path:"/ai/endpoints/"+c("PutEndpoint","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEndpoint(t){return e.send({op:"DeleteEndpoint",method:"DELETE",path:"/ai/endpoints/"+c("DeleteEndpoint","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnv(t){return e.send({op:"ListEnv",method:"GET",path:"/ai/env",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listEnvAllowances(t){return e.send({op:"ListEnvAllowances",method:"GET",path:"/ai/env/allowances",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async deleteEnvAllowance(t){return e.send({op:"DeleteEnvAllowance",method:"DELETE",path:"/ai/env/allowances/"+c("DeleteEnvAllowance","allowance_id",t.path.allowance_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnvHostRequests(t){return e.send({op:"ListEnvHostRequests",method:"GET",path:"/ai/env/host-requests",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async allowEnvHostRequest(t){return e.send({op:"AllowEnvHostRequest",method:"POST",path:"/ai/env/host-requests/"+c("AllowEnvHostRequest","request_id",t.path.request_id)+"/allow",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async dismissEnvHostRequest(t){return e.send({op:"DismissEnvHostRequest",method:"POST",path:"/ai/env/host-requests/"+c("DismissEnvHostRequest","request_id",t.path.request_id)+"/dismiss",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEnv(t){return e.send({op:"PutEnv",method:"PUT",path:"/ai/env/"+c("PutEnv","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnv(t){return e.send({op:"DeleteEnv",method:"DELETE",path:"/ai/env/"+c("DeleteEnv","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async allowEnvHost(t){return e.send({op:"AllowEnvHost",method:"POST",path:"/ai/env/"+c("AllowEnvHost","key",t.path.key)+"/hosts",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEnvironments(t){return e.send({op:"ListEnvironments",method:"GET",path:"/ai/environments",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createEnvironment(t){return e.send({op:"CreateEnvironment",method:"POST",path:"/ai/environments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getEnvironment(t){return e.send({op:"GetEnvironment",method:"GET",path:"/ai/environments/"+c("GetEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEnvironment(t){return e.send({op:"PutEnvironment",method:"PUT",path:"/ai/environments/"+c("PutEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnvironment(t){return e.send({op:"DeleteEnvironment",method:"DELETE",path:"/ai/environments/"+c("DeleteEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async createImage(t){return e.send({op:"CreateImage",method:"POST",path:"/ai/images",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getImage(t){return e.send({op:"GetImage",method:"GET",path:"/ai/images/"+c("GetImage","image_id",t.path.image_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getImageFile(t){return e.send({op:"GetImageFile",method:"GET",path:"/ai/images/"+c("GetImageFile","image_id",t.path.image_id)+"/files/"+c("GetImageFile","position",t.path.position),auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async getMachine(t){return e.send({op:"GetMachine",method:"GET",path:"/ai/machines/"+c("GetMachine","machine",t.path.machine),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMachine(t){return e.send({op:"DeleteMachine",method:"DELETE",path:"/ai/machines/"+c("DeleteMachine","machine",t.path.machine),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async cordonMachine(t){return e.send({op:"CordonMachine",method:"POST",path:"/ai/machines/"+c("CordonMachine","machine",t.path.machine)+"/cordon",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async resumeMachine(t){return e.send({op:"ResumeMachine",method:"POST",path:"/ai/machines/"+c("ResumeMachine","machine",t.path.machine)+"/resume",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listModels(t){return e.send({op:"ListModels",method:"GET",path:"/ai/models",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async revokePoolKey(t){return e.send({op:"RevokePoolKey",method:"POST",path:"/ai/pool-keys/"+c("RevokePoolKey","key",t.path.key)+"/revoke",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listPools(t){return e.send({op:"ListPools",method:"GET",path:"/ai/pools",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPool(t){return e.send({op:"CreatePool",method:"POST",path:"/ai/pools",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePool(t){return e.send({op:"DeletePool",method:"DELETE",path:"/ai/pools/"+c("DeletePool","pool",t.path.pool),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listPoolKeys(t){return e.send({op:"ListPoolKeys",method:"GET",path:"/ai/pools/"+c("ListPoolKeys","pool",t.path.pool)+"/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPoolKey(t){return e.send({op:"CreatePoolKey",method:"POST",path:"/ai/pools/"+c("CreatePoolKey","pool",t.path.pool)+"/keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPoolState(t){return e.send({op:"GetPoolState",method:"GET",path:"/ai/pools/"+c("GetPoolState","pool",t.path.pool)+"/state",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listProviders(t){return e.send({op:"ListProviders",method:"GET",path:"/ai/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectProvider(t){return e.send({op:"ConnectProvider",method:"PUT",path:"/ai/providers/"+c("ConnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async disconnectProvider(t){return e.send({op:"DisconnectProvider",method:"DELETE",path:"/ai/providers/"+c("DisconnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async createResponse(t){return e.send({op:"CreateResponse",method:"POST",path:"/ai/responses",auth:[["SecretKeyAuth"]],answers:{200:"raw",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getResponse(t){return e.send({op:"GetResponse",method:"GET",path:"/ai/responses/"+c("GetResponse","response_id",t.path.response_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelResponse(t){return e.send({op:"CancelResponse",method:"POST",path:"/ai/responses/"+c("CancelResponse","response_id",t.path.response_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async followResponse(t){return e.send({op:"FollowResponse",method:"GET",path:"/ai/responses/"+c("FollowResponse","response_id",t.path.response_id)+"/live",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSpend(t){return e.send({op:"GetSpend",method:"GET",path:"/ai/spend",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async askSupport(t){return e.send({op:"AskSupport",method:"POST",path:"/ai/support-questions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTools(t){return e.send({op:"ListTools",method:"GET",path:"/ai/tools",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listUsage(t){return e.send({op:"ListUsage",method:"GET",path:"/ai/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async gatewayAudioSpeech(t){return e.send({op:"GatewayAudioSpeech",method:"POST",path:"/ai/v1/audio/speech",auth:[["SecretKeyAuth"]],answers:{200:"raw"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayAudioTranscriptions(t){return e.send({op:"GatewayAudioTranscriptions",method:"POST",path:"/ai/v1/audio/transcriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayChatCompletions(t){return e.send({op:"GatewayChatCompletions",method:"POST",path:"/ai/v1/chat/completions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayEmbeddings(t){return e.send({op:"GatewayEmbeddings",method:"POST",path:"/ai/v1/embeddings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayImagesGenerations(t){return e.send({op:"GatewayImagesGenerations",method:"POST",path:"/ai/v1/images/generations",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayAnthropicMessages(t){return e.send({op:"GatewayAnthropicMessages",method:"POST",path:"/ai/v1/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayListModels(t){return e.send({op:"GatewayListModels",method:"GET",path:"/ai/v1/models",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async gatewayResponses(t){return e.send({op:"GatewayResponses",method:"POST",path:"/ai/v1/responses",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createVideo(t){return e.send({op:"CreateVideo",method:"POST",path:"/ai/videos",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getVideo(t){return e.send({op:"GetVideo",method:"GET",path:"/ai/videos/"+c("GetVideo","video_id",t.path.video_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelVideo(t){return e.send({op:"CancelVideo",method:"POST",path:"/ai/videos/"+c("CancelVideo","video_id",t.path.video_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTriggers(t){return e.send({op:"ListTriggers",method:"GET",path:"/ai/triggers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTrigger(t){return e.send({op:"CreateTrigger",method:"POST",path:"/ai/triggers",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTrigger(t){return e.send({op:"GetTrigger",method:"GET",path:"/ai/triggers/"+c("GetTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteTrigger(t){return e.send({op:"DeleteTrigger",method:"DELETE",path:"/ai/triggers/"+c("DeleteTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateTrigger(t){return e.send({op:"UpdateTrigger",method:"PATCH",path:"/ai/triggers/"+c("UpdateTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async testTrigger(t){return e.send({op:"TestTrigger",method:"POST",path:"/ai/triggers/"+c("TestTrigger","trigger_id",t.path.trigger_id)+"/test",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async invokeTriggerWebhook(t){return e.send({op:"InvokeTriggerWebhook",method:"POST",path:"/ai/triggers/"+c("InvokeTriggerWebhook","trigger_id",t.path.trigger_id)+"/hook",auth:[],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWaits(t){return e.send({op:"ListWaits",method:"GET",path:"/ai/waits",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getWait(t){return e.send({op:"GetWait",method:"GET",path:"/ai/waits/"+c("GetWait","wait_id",t.path.wait_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async signalWait(t){return e.send({op:"SignalWait",method:"POST",path:"/ai/waits/"+c("SignalWait","wait_id",t.path.wait_id)+"/signal",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelWait(t){return e.send({op:"CancelWait",method:"POST",path:"/ai/waits/"+c("CancelWait","wait_id",t.path.wait_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listWorkflowRuns(t){return e.send({op:"ListWorkflowRuns",method:"GET",path:"/ai/workflows/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createWorkflowRun(t){return e.send({op:"CreateWorkflowRun",method:"POST",path:"/ai/workflows/runs",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWorkflowRun(t){return e.send({op:"GetWorkflowRun",method:"GET",path:"/ai/workflows/runs/"+c("GetWorkflowRun","run_id",t.path.run_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async recordWorkflowStep(t){return e.send({op:"RecordWorkflowStep",method:"POST",path:"/ai/workflows/runs/"+c("RecordWorkflowStep","run_id",t.path.run_id)+"/steps/"+c("RecordWorkflowStep","step_key",t.path.step_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeWorkflowRun(t){return e.send({op:"CompleteWorkflowRun",method:"POST",path:"/ai/workflows/runs/"+c("CompleteWorkflowRun","run_id",t.path.run_id)+"/complete",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async replayWorkflowRun(t){return e.send({op:"ReplayWorkflowRun",method:"POST",path:"/ai/workflows/runs/"+c("ReplayWorkflowRun","run_id",t.path.run_id)+"/replay",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopRunTree(t){return e.send({op:"StopRunTree",method:"POST",path:"/ai/runs/"+c("StopRunTree","root_id",t.path.root_id)+"/stop-tree",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getMemory(t){return e.send({op:"GetMemory",method:"GET",path:"/ai/memory/"+c("GetMemory","namespace",t.path.namespace)+"/"+c("GetMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putMemory(t){return e.send({op:"PutMemory",method:"PUT",path:"/ai/memory/"+c("PutMemory","namespace",t.path.namespace)+"/"+c("PutMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMemory(t){return e.send({op:"DeleteMemory",method:"DELETE",path:"/ai/memory/"+c("DeleteMemory","namespace",t.path.namespace)+"/"+c("DeleteMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async searchMemory(t){return e.send({op:"SearchMemory",method:"POST",path:"/ai/memory/search",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listActorGroupMembers(t){return e.send({op:"ListActorGroupMembers",method:"GET",path:"/ai/groups/"+c("ListActorGroupMembers","group_id",t.path.group_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addActorGroupMember(t){return e.send({op:"AddActorGroupMember",method:"POST",path:"/ai/groups/"+c("AddActorGroupMember","group_id",t.path.group_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async broadcastActorGroup(t){return e.send({op:"BroadcastActorGroup",method:"POST",path:"/ai/groups/"+c("BroadcastActorGroup","group_id",t.path.group_id)+"/broadcast",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getA2AAgentCard(t){return e.send({op:"GetA2AAgentCard",method:"GET",path:"/.well-known/agent.json",auth:[],answers:{200:"json"},signal:t?.signal})},async callA2Arpc(t){return e.send({op:"CallA2ARPC",method:"POST",path:"/ai/a2a",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async putMcpUserCredential(t){return e.send({op:"PutMCPUserCredential",method:"POST",path:"/ai/endpoints/"+c("PutMCPUserCredential","name",t.path.name)+"/user-credentials/"+c("PutMCPUserCredential","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMcpUserCredential(t){return e.send({op:"DeleteMCPUserCredential",method:"DELETE",path:"/ai/endpoints/"+c("DeleteMCPUserCredential","name",t.path.name)+"/user-credentials/"+c("DeleteMCPUserCredential","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async startMcpoAuth(t){return e.send({op:"StartMCPOAuth",method:"GET",path:"/ai/endpoints/"+c("StartMCPOAuth","name",t.path.name)+"/oauth/start",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async completeMcpoAuthCallback(t){return e.send({op:"CompleteMCPOAuthCallback",method:"GET",path:"/ai/mcp/oauth/callback",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listTemplates(t){return e.send({op:"ListTemplates",method:"GET",path:"/ai/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplate(t){return e.send({op:"GetTemplate",method:"GET",path:"/ai/templates/"+c("GetTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putTemplate(t){return e.send({op:"PutTemplate",method:"PUT",path:"/ai/templates/"+c("PutTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTemplate(t){return e.send({op:"DeleteTemplate",method:"DELETE",path:"/ai/templates/"+c("DeleteTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async publishTemplate(t){return e.send({op:"PublishTemplate",method:"POST",path:"/ai/templates/"+c("PublishTemplate","name",t.path.name)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rollbackTemplate(t){return e.send({op:"RollbackTemplate",method:"POST",path:"/ai/templates/"+c("RollbackTemplate","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTemplateVersions(t){return e.send({op:"ListTemplateVersions",method:"GET",path:"/ai/templates/"+c("ListTemplateVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listUserSpend(t){return e.send({op:"ListUserSpend",method:"GET",path:"/ai/users/spend",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getUserQuota(t){return e.send({op:"GetUserQuota",method:"GET",path:"/ai/users/"+c("GetUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putUserQuota(t){return e.send({op:"PutUserQuota",method:"PUT",path:"/ai/users/"+c("PutUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserQuota(t){return e.send({op:"DeleteUserQuota",method:"DELETE",path:"/ai/users/"+c("DeleteUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async clientAttestChallenge(t){return e.send({op:"ClientAttestChallenge",method:"POST",path:"/ai/client/attest-challenge",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async runClientTemplate(t){return e.send({op:"RunClientTemplate",method:"POST",path:"/ai/client/templates/"+c("RunClientTemplate","name",t.path.name)+"/run",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async voiceClientTemplate(t){return e.send({op:"VoiceClientTemplate",method:"POST",path:"/ai/client/templates/"+c("VoiceClientTemplate","name",t.path.name)+"/voice",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMachineKey(t){return e.send({op:"CreateMachineKey",method:"POST",path:"/ai/machine-keys",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachines(t){return e.send({op:"ListMachines",method:"GET",path:"/ai/machines",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var Co={};wt(Co,{client:()=>BS});function BS(e){return{async listAudiences(t){return e.send({op:"ListAudiences",method:"GET",path:"/analytics/audiences",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createAudience(t){return e.send({op:"CreateAudience",method:"POST",path:"/analytics/audiences",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async previewAudience(t){return e.send({op:"PreviewAudience",method:"POST",path:"/analytics/audiences/preview",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAudience(t){return e.send({op:"GetAudience",method:"GET",path:"/analytics/audiences/"+c("GetAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteAudience(t){return e.send({op:"DeleteAudience",method:"DELETE",path:"/analytics/audiences/"+c("DeleteAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateAudience(t){return e.send({op:"UpdateAudience",method:"PATCH",path:"/analytics/audiences/"+c("UpdateAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAudienceMembers(t){return e.send({op:"ListAudienceMembers",method:"GET",path:"/analytics/audiences/"+c("ListAudienceMembers","id",t.path.id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async alias(t){return e.send({op:"Alias",method:"POST",path:"/analytics/alias",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async batch(t){return e.send({op:"Batch",method:"POST",path:"/analytics/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getEventBreakdown(t){return e.send({op:"GetEventBreakdown",method:"GET",path:"/analytics/breakdown",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async capture(t){return e.send({op:"Capture",method:"POST",path:"/analytics/capture",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendConsoleHistory(t){return e.send({op:"SendConsoleHistory",method:"POST",path:"/analytics/console-breadcrumbs",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getConsoleConfig(t){return e.send({op:"GetConsoleConfig",method:"GET",path:"/analytics/console-breadcrumbs/config",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listConsoleRecords(t){return e.send({op:"ListConsoleRecords",method:"GET",path:"/analytics/console-records",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listEventNames(t){return e.send({op:"ListEventNames",method:"GET",path:"/analytics/event-names",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listEvents(t){return e.send({op:"ListEvents",method:"GET",path:"/analytics/events",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getEventTimeline(t){return e.send({op:"GetEventTimeline",method:"GET",path:"/analytics/events/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async runFunnel(t){return e.send({op:"RunFunnel",method:"POST",path:"/analytics/funnel",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async identify(t){return e.send({op:"Identify",method:"POST",path:"/analytics/identify",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async page(t){return e.send({op:"Page",method:"POST",path:"/analytics/page",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendPerf(t){return e.send({op:"SendPerf",method:"POST",path:"/analytics/perf",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPerfGroups(t){return e.send({op:"ListPerfGroups",method:"GET",path:"/analytics/perf/client",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getPerfConfig(t){return e.send({op:"GetPerfConfig",method:"GET",path:"/analytics/perf/config",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t?.headers,signal:t?.signal})},async getPerfTimeline(t){return e.send({op:"GetPerfTimeline",method:"GET",path:"/analytics/perf/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listRequestLines(t){return e.send({op:"ListRequestLines",method:"GET",path:"/analytics/requests",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMachineTraffic(t){return e.send({op:"GetMachineTraffic",method:"GET",path:"/analytics/machines/"+c("GetMachineTraffic","name",t.path.name)+"/traffic",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async runRetention(t){return e.send({op:"RunRetention",method:"POST",path:"/analytics/retention",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async screen(t){return e.send({op:"Screen",method:"POST",path:"/analytics/screen",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSummary(t){return e.send({op:"GetSummary",method:"GET",path:"/analytics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listTraces(t){return e.send({op:"ListTraces",method:"GET",path:"/analytics/traces",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async sendTrace(t){return e.send({op:"SendTrace",method:"POST",path:"/analytics/traces",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendTraceBatch(t){return e.send({op:"SendTraceBatch",method:"POST",path:"/analytics/traces/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTraceHops(t){return e.send({op:"GetTraceHops",method:"GET",path:"/analytics/traces/by-trace",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listSessionTraces(t){return e.send({op:"ListSessionTraces",method:"GET",path:"/analytics/traces/session",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getTraceSummary(t){return e.send({op:"GetTraceSummary",method:"GET",path:"/analytics/traces/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getTraceTimeline(t){return e.send({op:"GetTraceTimeline",method:"GET",path:"/analytics/traces/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async searchPeople(t){return e.send({op:"SearchPeople",method:"GET",path:"/analytics/people",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setPersonProperties(t){return e.send({op:"SetPersonProperties",method:"POST",path:"/analytics/people",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPerson(t){return e.send({op:"GetPerson",method:"GET",path:"/analytics/people/"+c("GetPerson","person_id",t.path.person_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPersonEvents(t){return e.send({op:"ListPersonEvents",method:"GET",path:"/analytics/people/"+c("ListPersonEvents","person_id",t.path.person_id)+"/events",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getEventCatalog(t){return e.send({op:"GetEventCatalog",method:"GET",path:"/analytics/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async defineEvent(t){return e.send({op:"DefineEvent",method:"PUT",path:"/analytics/catalog/"+c("DefineEvent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Oo={};wt(Oo,{client:()=>JS});function JS(e){return{async getAppleAppSiteAssociation(t){return e.send({op:"GetAppleAppSiteAssociation",method:"GET",path:"/.well-known/apple-app-site-association",auth:[],answers:{200:"json"},signal:t?.signal})},async getAssetLinks(t){return e.send({op:"GetAssetLinks",method:"GET",path:"/.well-known/assetlinks.json",auth:[],answers:{200:"json"},signal:t?.signal})},async getJwks(t){return e.send({op:"GetJWKS",method:"GET",path:"/.well-known/jwks.json",auth:[],answers:{200:"json"},signal:t?.signal})},async getOidcDiscovery(t){return e.send({op:"GetOIDCDiscovery",method:"GET",path:"/.well-known/openid-configuration",auth:[],answers:{200:"json"},signal:t?.signal})},async getWebAuthnRelatedOrigins(t){return e.send({op:"GetWebAuthnRelatedOrigins",method:"GET",path:"/.well-known/webauthn",auth:[],answers:{200:"json"},signal:t?.signal})},async adminVerifyDeviceAssertion(t){return e.send({op:"AdminVerifyDeviceAssertion",method:"POST",path:"/admin/attest/devices/assert",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetAttestPolicy(t){return e.send({op:"AdminGetAttestPolicy",method:"GET",path:"/admin/attest/devices/attest-policy",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetAttestObservations(t){return e.send({op:"AdminGetAttestObservations",method:"GET",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminRecordAttestObservations(t){return e.send({op:"AdminRecordAttestObservations",method:"POST",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListAuditEvents(t){return e.send({op:"AdminListAuditEvents",method:"GET",path:"/admin/audit",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminExportAuditEvents(t){return e.send({op:"AdminExportAuditEvents",method:"GET",path:"/admin/audit/export",auth:[["AdminAuth"]],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async adminVerifyAuditTrail(t){return e.send({op:"AdminVerifyAuditTrail",method:"GET",path:"/admin/audit/verify",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetAuthSettings(t){return e.send({op:"AdminGetAuthSettings",method:"GET",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpdateAuthSettings(t){return e.send({op:"AdminUpdateAuthSettings",method:"PUT",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetBreachWatch(t){return e.send({op:"AdminGetBreachWatch",method:"GET",path:"/admin/breach-watch",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminListHooks(t){return e.send({op:"AdminListHooks",method:"GET",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateHook(t){return e.send({op:"AdminCreateHook",method:"POST",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminUpdateHook(t){return e.send({op:"AdminUpdateHook",method:"PUT",path:"/admin/hooks/"+c("AdminUpdateHook","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteHook(t){return e.send({op:"AdminDeleteHook",method:"DELETE",path:"/admin/hooks/"+c("AdminDeleteHook","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListHookExecutions(t){return e.send({op:"AdminListHookExecutions",method:"GET",path:"/admin/hooks/"+c("AdminListHookExecutions","id",t.path.id)+"/executions",auth:[["AdminAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminListIntegrations(t){return e.send({op:"AdminListIntegrations",method:"GET",path:"/admin/integrations",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminPutIntegration(t){return e.send({op:"AdminPutIntegration",method:"PUT",path:"/admin/integrations/"+c("AdminPutIntegration","name",t.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteIntegration(t){return e.send({op:"AdminDeleteIntegration",method:"DELETE",path:"/admin/integrations/"+c("AdminDeleteIntegration","name",t.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListOAuthClients(t){return e.send({op:"AdminListOAuthClients",method:"GET",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateOAuthClient(t){return e.send({op:"AdminCreateOAuthClient",method:"POST",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetOAuthClient(t){return e.send({op:"AdminGetOAuthClient",method:"GET",path:"/admin/oauth-clients/"+c("AdminGetOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteOAuthClient(t){return e.send({op:"AdminDeleteOAuthClient",method:"DELETE",path:"/admin/oauth-clients/"+c("AdminDeleteOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateOAuthClient(t){return e.send({op:"AdminUpdateOAuthClient",method:"PATCH",path:"/admin/oauth-clients/"+c("AdminUpdateOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListProviders(t){return e.send({op:"AdminListProviders",method:"GET",path:"/admin/providers",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetPhoneSettings(t){return e.send({op:"AdminGetPhoneSettings",method:"GET",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpdatePhoneSettings(t){return e.send({op:"AdminUpdatePhoneSettings",method:"PUT",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminToggleProvider(t){return e.send({op:"AdminToggleProvider",method:"POST",path:"/admin/providers/"+c("AdminToggleProvider","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListRoles(t){return e.send({op:"AdminListRoles",method:"GET",path:"/admin/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpsertRole(t){return e.send({op:"AdminUpsertRole",method:"PUT",path:"/admin/roles/"+c("AdminUpsertRole","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteRole(t){return e.send({op:"AdminDeleteRole",method:"DELETE",path:"/admin/roles/"+c("AdminDeleteRole","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminListServiceAccounts(t){return e.send({op:"AdminListServiceAccounts",method:"GET",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateServiceAccount(t){return e.send({op:"AdminCreateServiceAccount",method:"POST",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetServiceAccount(t){return e.send({op:"AdminGetServiceAccount",method:"GET",path:"/admin/service-accounts/"+c("AdminGetServiceAccount","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeServiceAccount(t){return e.send({op:"AdminRevokeServiceAccount",method:"DELETE",path:"/admin/service-accounts/"+c("AdminRevokeServiceAccount","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminRotateServiceAccount(t){return e.send({op:"AdminRotateServiceAccount",method:"POST",path:"/admin/service-accounts/"+c("AdminRotateServiceAccount","id",t.path.id)+"/rotate",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async adminListSessions(t){return e.send({op:"AdminListSessions",method:"GET",path:"/admin/sessions",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminRevokeSession(t){return e.send({op:"AdminRevokeSession",method:"DELETE",path:"/admin/sessions/"+c("AdminRevokeSession","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListSigningKeys(t){return e.send({op:"AdminListSigningKeys",method:"GET",path:"/admin/signing-keys",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminRotateSigningKey(t){return e.send({op:"AdminRotateSigningKey",method:"POST",path:"/admin/signing-keys/rotate",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async socialAdminConfig(t){return e.send({op:"SocialAdminConfig",method:"GET",path:"/admin/social-auth",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async socialCredentialPut(t){return e.send({op:"SocialCredentialPut",method:"PUT",path:"/admin/social-auth/credentials/"+c("SocialCredentialPut","key",t.path.key),auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCredentialDelete(t){return e.send({op:"SocialCredentialDelete",method:"DELETE",path:"/admin/social-auth/credentials/"+c("SocialCredentialDelete","key",t.path.key),auth:[["AdminAuth"]],answers:{204:"empty"},headers:t.headers,signal:t.signal})},async socialProviderPatch(t){return e.send({op:"SocialProviderPatch",method:"PATCH",path:"/admin/social-auth/providers/"+c("SocialProviderPatch","provider",t.path.provider),auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetStats(t){return e.send({op:"AdminGetStats",method:"GET",path:"/admin/stats",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminSendTestTemplate(t){return e.send({op:"AdminSendTestTemplate",method:"POST",path:"/admin/templates/"+c("AdminSendTestTemplate","key",t.path.key)+"/send-test",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListTestUsers(t){return e.send({op:"AdminListTestUsers",method:"GET",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateTestUsers(t){return e.send({op:"AdminCreateTestUsers",method:"POST",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminSetTestUserPhone(t){return e.send({op:"AdminSetTestUserPhone",method:"PUT",path:"/admin/test-users/phone",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminCreateTestSignupAddress(t){return e.send({op:"AdminCreateTestSignupAddress",method:"POST",path:"/admin/test-users/addresses",auth:[["AdminAuth"]],answers:{201:"json"},signal:t?.signal})},async adminDeleteTestUser(t){return e.send({op:"AdminDeleteTestUser",method:"DELETE",path:"/admin/test-users/"+c("AdminDeleteTestUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminCreateCustomToken(t){return e.send({op:"AdminCreateCustomToken",method:"POST",path:"/admin/token/custom",auth:[["AdminAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListUsers(t){return e.send({op:"AdminListUsers",method:"GET",path:"/admin/users",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminCreateUser(t){return e.send({op:"AdminCreateUser",method:"POST",path:"/admin/users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminImportUsers(t){return e.send({op:"AdminImportUsers",method:"POST",path:"/admin/users/import",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetUser(t){return e.send({op:"AdminGetUser",method:"GET",path:"/admin/users/"+c("AdminGetUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteUser(t){return e.send({op:"AdminDeleteUser",method:"DELETE",path:"/admin/users/"+c("AdminDeleteUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateUser(t){return e.send({op:"AdminUpdateUser",method:"PATCH",path:"/admin/users/"+c("AdminUpdateUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminBanUser(t){return e.send({op:"AdminBanUser",method:"POST",path:"/admin/users/"+c("AdminBanUser","uid",t.path.uid)+"/ban",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetUserConsents(t){return e.send({op:"AdminGetUserConsents",method:"GET",path:"/admin/users/"+c("AdminGetUserConsents","uid",t.path.uid)+"/consents",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserCredentials(t){return e.send({op:"AdminRevokeUserCredentials",method:"POST",path:"/admin/users/"+c("AdminRevokeUserCredentials","uid",t.path.uid)+"/credentials/revoke-all",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminExportUser(t){return e.send({op:"AdminExportUser",method:"GET",path:"/admin/users/"+c("AdminExportUser","uid",t.path.uid)+"/export",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminListUserMfaFactors(t){return e.send({op:"AdminListUserMFAFactors",method:"GET",path:"/admin/users/"+c("AdminListUserMFAFactors","uid",t.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminResetUserMfa(t){return e.send({op:"AdminResetUserMFA",method:"DELETE",path:"/admin/users/"+c("AdminResetUserMFA","uid",t.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminResetUserPassword(t){return e.send({op:"AdminResetUserPassword",method:"POST",path:"/admin/users/"+c("AdminResetUserPassword","uid",t.path.uid)+"/reset-password",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminListUserRoles(t){return e.send({op:"AdminListUserRoles",method:"GET",path:"/admin/users/"+c("AdminListUserRoles","uid",t.path.uid)+"/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminAssignUserRole(t){return e.send({op:"AdminAssignUserRole",method:"PUT",path:"/admin/users/"+c("AdminAssignUserRole","uid",t.path.uid)+"/roles/"+c("AdminAssignUserRole","role",t.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserRole(t){return e.send({op:"AdminRevokeUserRole",method:"DELETE",path:"/admin/users/"+c("AdminRevokeUserRole","uid",t.path.uid)+"/roles/"+c("AdminRevokeUserRole","role",t.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserSessions(t){return e.send({op:"AdminRevokeUserSessions",method:"POST",path:"/admin/users/"+c("AdminRevokeUserSessions","uid",t.path.uid)+"/sessions/revoke-all",auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUnbanUser(t){return e.send({op:"AdminUnbanUser",method:"POST",path:"/admin/users/"+c("AdminUnbanUser","uid",t.path.uid)+"/unban",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async signInAnonymously(t){return e.send({op:"SignInAnonymously",method:"POST",path:"/auth/anonymous",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:t?.headers,body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async convertAnonymousUser(t){return e.send({op:"ConvertAnonymousUser",method:"POST",path:"/auth/anonymous/convert",auth:[["ApiKeyAuth","userJWT"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async verifyAnonymousConversion(t){return e.send({op:"VerifyAnonymousConversion",method:"POST",path:"/auth/anonymous/convert/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async devicePendingRequest(t){return e.send({op:"DevicePendingRequest",method:"GET",path:"/auth/device/requests/"+c("DevicePendingRequest","user_code",t.path.user_code),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deviceVerifyPage(t){return e.send({op:"DeviceVerifyPage",method:"GET",path:"/auth/device/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async deviceVerifySubmit(t){return e.send({op:"DeviceVerifySubmit",method:"POST",path:"/auth/device/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/auth/devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async attestAndroidDevice(t){return e.send({op:"AttestAndroidDevice",method:"POST",path:"/auth/devices/attest/android",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attestIosDevice(t){return e.send({op:"AttestIOSDevice",method:"POST",path:"/auth/devices/attest/ios",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bindDeviceKey(t){return e.send({op:"BindDeviceKey",method:"POST",path:"/auth/devices/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createDeviceChallenge(t){return e.send({op:"CreateDeviceChallenge",method:"POST",path:"/auth/devices/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t?.headers,signal:t?.signal})},async verifyAndroidIntegrity(t){return e.send({op:"VerifyAndroidIntegrity",method:"POST",path:"/auth/devices/verify/android",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteDevice(t){return e.send({op:"DeleteDevice",method:"DELETE",path:"/auth/devices/"+c("DeleteDevice","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async verifyDeviceSignature(t){return e.send({op:"VerifyDeviceSignature",method:"POST",path:"/auth/devices/"+c("VerifyDeviceSignature","id",t.path.id)+"/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listIdentities(t){return e.send({op:"ListIdentities",method:"GET",path:"/auth/identities",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async unlinkIdentity(t){return e.send({op:"UnlinkIdentity",method:"DELETE",path:"/auth/identities/"+c("UnlinkIdentity","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async createInstallation(t){return e.send({op:"CreateInstallation",method:"POST",path:"/auth/installations",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bindInstallation(t){return e.send({op:"BindInstallation",method:"POST",path:"/auth/installations/"+c("BindInstallation","id",t.path.id)+"/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refreshInstallation(t){return e.send({op:"RefreshInstallation",method:"POST",path:"/auth/installations/"+c("RefreshInstallation","id",t.path.id)+"/refresh",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async revokeInstallation(t){return e.send({op:"RevokeInstallation",method:"POST",path:"/auth/installations/"+c("RevokeInstallation","id",t.path.id)+"/revoke",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unbindInstallation(t){return e.send({op:"UnbindInstallation",method:"POST",path:"/auth/installations/"+c("UnbindInstallation","id",t.path.id)+"/unbind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async login(t){return e.send({op:"Login",method:"POST",path:"/auth/login",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async logout(t){return e.send({op:"Logout",method:"POST",path:"/auth/logout",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async magicLinkRequest(t){return e.send({op:"MagicLinkRequest",method:"POST",path:"/auth/magic-link",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async magicLinkVerify(t){return e.send({op:"MagicLinkVerify",method:"POST",path:"/auth/magic-link/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMe(t){return e.send({op:"GetMe",method:"GET",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMe(t){return e.send({op:"UpdateMe",method:"PATCH",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaChallenge(t){return e.send({op:"MfaChallenge",method:"POST",path:"/auth/mfa/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEmailChallenge(t){return e.send({op:"MfaEmailChallenge",method:"POST",path:"/auth/mfa/email/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEmailEnroll(t){return e.send({op:"MfaEmailEnroll",method:"POST",path:"/auth/mfa/email/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaEmailVerify(t){return e.send({op:"MfaEmailVerify",method:"POST",path:"/auth/mfa/email/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEnroll(t){return e.send({op:"MfaEnroll",method:"POST",path:"/auth/mfa/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaListFactors(t){return e.send({op:"MfaListFactors",method:"GET",path:"/auth/mfa/factors",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaRemoveFactor(t){return e.send({op:"MfaRemoveFactor",method:"DELETE",path:"/auth/mfa/factors/"+c("MfaRemoveFactor","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaRecovery(t){return e.send({op:"MfaRecovery",method:"POST",path:"/auth/mfa/recovery",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaRegenerateRecoveryCodes(t){return e.send({op:"MfaRegenerateRecoveryCodes",method:"POST",path:"/auth/mfa/recovery-codes/regenerate",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaSmsChallenge(t){return e.send({op:"MfaSMSChallenge",method:"POST",path:"/auth/mfa/sms/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaSmsEnroll(t){return e.send({op:"MfaSMSEnroll",method:"POST",path:"/auth/mfa/sms/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaSmsVerifyEnrollment(t){return e.send({op:"MfaSMSVerifyEnrollment",method:"POST",path:"/auth/mfa/sms/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaVerifyEnrollment(t){return e.send({op:"MfaVerifyEnrollment",method:"POST",path:"/auth/mfa/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCallbackApple(t){return e.send({op:"SocialCallbackApple",method:"GET",path:"/auth/oauth/callback/apple",auth:[],answers:{},signal:t?.signal})},async socialCallbackApplePost(t){return e.send({op:"SocialCallbackApplePost",method:"POST",path:"/auth/oauth/callback/apple",auth:[],answers:{303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async socialCallbackGitHub(t){return e.send({op:"SocialCallbackGitHub",method:"GET",path:"/auth/oauth/callback/github",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackGitHubPost(t){return e.send({op:"SocialCallbackGitHubPost",method:"POST",path:"/auth/oauth/callback/github",auth:[],answers:{},signal:t?.signal})},async socialCallbackGoogle(t){return e.send({op:"SocialCallbackGoogle",method:"GET",path:"/auth/oauth/callback/google",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackGooglePost(t){return e.send({op:"SocialCallbackGooglePost",method:"POST",path:"/auth/oauth/callback/google",auth:[],answers:{},signal:t?.signal})},async socialCallbackMicrosoft(t){return e.send({op:"SocialCallbackMicrosoft",method:"GET",path:"/auth/oauth/callback/microsoft",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackMicrosoftPost(t){return e.send({op:"SocialCallbackMicrosoftPost",method:"POST",path:"/auth/oauth/callback/microsoft",auth:[],answers:{},signal:t?.signal})},async socialConfig(t){return e.send({op:"SocialConfig",method:"GET",path:"/auth/oauth/config",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async socialBegin(t){return e.send({op:"SocialBegin",method:"POST",path:"/auth/oauth/transactions",auth:[["ApiKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCancel(t){return e.send({op:"SocialCancel",method:"POST",path:"/auth/oauth/transactions/"+c("SocialCancel","id",t.path.id)+"/cancel",auth:[["ApiKeyAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialComplete(t){return e.send({op:"SocialComplete",method:"POST",path:"/auth/oauth/transactions/"+c("SocialComplete","id",t.path.id)+"/complete",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestPhoneOtp(t){return e.send({op:"RequestPhoneOTP",method:"POST",path:"/auth/otp",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async verifyPhoneOtp(t){return e.send({op:"VerifyPhoneOTP",method:"POST",path:"/auth/otp/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async hostedRecoveryApprovalPage(t){return e.send({op:"HostedRecoveryApprovalPage",method:"GET",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedRecoveryApprovalSubmit(t){return e.send({op:"HostedRecoveryApprovalSubmit",method:"POST",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedRecoveryContactPage(t){return e.send({op:"HostedRecoveryContactPage",method:"GET",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedRecoveryContactSubmit(t){return e.send({op:"HostedRecoveryContactSubmit",method:"POST",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedResetPasswordPage(t){return e.send({op:"HostedResetPasswordPage",method:"GET",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedResetPasswordSubmit(t){return e.send({op:"HostedResetPasswordSubmit",method:"POST",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedVerifyEmailPage(t){return e.send({op:"HostedVerifyEmailPage",method:"GET",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedVerifyEmailSubmit(t){return e.send({op:"HostedVerifyEmailSubmit",method:"POST",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async passwordChange(t){return e.send({op:"PasswordChange",method:"POST",path:"/auth/password/change",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async passwordResetRequest(t){return e.send({op:"PasswordResetRequest",method:"POST",path:"/auth/password/reset",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async passwordResetConfirm(t){return e.send({op:"PasswordResetConfirm",method:"POST",path:"/auth/password/reset/confirm",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setPassword(t){return e.send({op:"SetPassword",method:"POST",path:"/auth/password/set",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async powChallenge(t){return e.send({op:"PowChallenge",method:"POST",path:"/auth/pow/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async approveRecovery(t){return e.send({op:"ApproveRecovery",method:"POST",path:"/auth/recovery/approve",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRecoveryContacts(t){return e.send({op:"ListRecoveryContacts",method:"GET",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async addRecoveryContact(t){return e.send({op:"AddRecoveryContact",method:"POST",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteRecoveryContact(t){return e.send({op:"DeleteRecoveryContact",method:"DELETE",path:"/auth/recovery/contacts/"+c("DeleteRecoveryContact","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async verifyRecoveryContact(t){return e.send({op:"VerifyRecoveryContact",method:"POST",path:"/auth/recovery/contacts/"+c("VerifyRecoveryContact","id",t.path.id)+"/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async denyRecovery(t){return e.send({op:"DenyRecovery",method:"POST",path:"/auth/recovery/deny",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async initiateRecovery(t){return e.send({op:"InitiateRecovery",method:"POST",path:"/auth/recovery/initiate",auth:[["ApiKeyAuth"]],answers:{200:"json",202:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRecoveryStatus(t){return e.send({op:"GetRecoveryStatus",method:"GET",path:"/auth/recovery/status",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async resendVerification(t){return e.send({op:"ResendVerification",method:"POST",path:"/auth/resend-verification",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSessions(t){return e.send({op:"ListSessions",method:"GET",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async revokeAllSessions(t){return e.send({op:"RevokeAllSessions",method:"DELETE",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async revokeSession(t){return e.send({op:"RevokeSession",method:"DELETE",path:"/auth/sessions/"+c("RevokeSession","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async signup(t){return e.send({op:"Signup",method:"POST",path:"/auth/signup",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stepUp(t){return e.send({op:"StepUp",method:"POST",path:"/auth/step-up",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stepUpStatus(t){return e.send({op:"StepUpStatus",method:"GET",path:"/auth/step-up/status",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async stepUpWebAuthnBegin(t){return e.send({op:"StepUpWebAuthnBegin",method:"POST",path:"/auth/step-up/webauthn/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async stepUpSmsSend(t){return e.send({op:"StepUpSMSSend",method:"POST",path:"/auth/step-up/sms/send",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async exchangeCustomToken(t){return e.send({op:"ExchangeCustomToken",method:"POST",path:"/auth/token/exchange",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refreshToken(t){return e.send({op:"RefreshToken",method:"POST",path:"/auth/token/refresh",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeRefreshToken(t){return e.send({op:"RevokeRefreshToken",method:"POST",path:"/auth/token/revoke",auth:[["ApiKeyAuth"]],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTransactions(t){return e.send({op:"ListTransactions",method:"GET",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createTransaction(t){return e.send({op:"CreateTransaction",method:"POST",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTransaction(t){return e.send({op:"GetTransaction",method:"GET",path:"/auth/transactions/"+c("GetTransaction","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async approveTransaction(t){return e.send({op:"ApproveTransaction",method:"POST",path:"/auth/transactions/"+c("ApproveTransaction","id",t.path.id)+"/approve",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async denyTransaction(t){return e.send({op:"DenyTransaction",method:"POST",path:"/auth/transactions/"+c("DenyTransaction","id",t.path.id)+"/deny",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTrustedDevices(t){return e.send({op:"ListTrustedDevices",method:"GET",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async registerTrustedDevice(t){return e.send({op:"RegisterTrustedDevice",method:"POST",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeTrustedDevice(t){return e.send({op:"RevokeTrustedDevice",method:"DELETE",path:"/auth/trusted-devices/"+c("RevokeTrustedDevice","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async verifyTokenUser(t){return e.send({op:"VerifyTokenUser",method:"GET",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async deleteAccount(t){return e.send({op:"DeleteAccount",method:"DELETE",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async verifyEmail(t){return e.send({op:"VerifyEmail",method:"POST",path:"/auth/verify-email",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnListCredentials(t){return e.send({op:"WebauthnListCredentials",method:"GET",path:"/auth/webauthn/credentials",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async webauthnRenameCredential(t){return e.send({op:"WebauthnRenameCredential",method:"PUT",path:"/auth/webauthn/credentials/"+c("WebauthnRenameCredential","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnDeleteCredential(t){return e.send({op:"WebauthnDeleteCredential",method:"DELETE",path:"/auth/webauthn/credentials/"+c("WebauthnDeleteCredential","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async webauthnLoginBegin(t){return e.send({op:"WebauthnLoginBegin",method:"POST",path:"/auth/webauthn/login/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnLoginFinish(t){return e.send({op:"WebauthnLoginFinish",method:"POST",path:"/auth/webauthn/login/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRecoveryBegin(t){return e.send({op:"WebauthnRecoveryBegin",method:"POST",path:"/auth/webauthn/recovery/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async webauthnRecoveryFinish(t){return e.send({op:"WebauthnRecoveryFinish",method:"POST",path:"/auth/webauthn/recovery/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRecoveryRegisterBegin(t){return e.send({op:"WebauthnRecoveryRegisterBegin",method:"POST",path:"/auth/webauthn/recovery/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnRecoveryRegisterFinish(t){return e.send({op:"WebauthnRecoveryRegisterFinish",method:"POST",path:"/auth/webauthn/recovery/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRegisterBegin(t){return e.send({op:"WebauthnRegisterBegin",method:"POST",path:"/auth/webauthn/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnRegisterFinish(t){return e.send({op:"WebauthnRegisterFinish",method:"POST",path:"/auth/webauthn/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnSignupBegin(t){return e.send({op:"WebauthnSignupBegin",method:"POST",path:"/auth/webauthn/signup/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnSignupFinish(t){return e.send({op:"WebauthnSignupFinish",method:"POST",path:"/auth/webauthn/signup/finish",auth:[["ApiKeyAuth"]],answers:{201:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async oauthAuthorize(t){return e.send({op:"OauthAuthorize",method:"GET",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},query:t?.query,signal:t?.signal})},async oauthAuthorizePost(t){return e.send({op:"OauthAuthorizePost",method:"POST",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthAuthorizeCallback(t){return e.send({op:"OauthAuthorizeCallback",method:"GET",path:"/oauth/authorize/callback",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async oauthAuthorizeEmailLink(t){return e.send({op:"OauthAuthorizeEmailLink",method:"GET",path:"/oauth/authorize/email",auth:[],answers:{200:"raw",303:"redirect"},query:t.query,signal:t.signal})},async oauthDeviceAuthorize(t){return e.send({op:"OauthDeviceAuthorize",method:"POST",path:"/oauth/device",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthIntrospect(t){return e.send({op:"OauthIntrospect",method:"POST",path:"/oauth/introspect",auth:[["AdminAuth"],["OAuthClient"],[]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async oauthLogout(t){return e.send({op:"OauthLogout",method:"GET",path:"/oauth/logout",auth:[],answers:{302:"redirect"},query:t?.query,signal:t?.signal})},async oauthLogoutPost(t){return e.send({op:"OauthLogoutPost",method:"POST",path:"/oauth/logout",auth:[],answers:{302:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t?.body},signal:t?.signal})},async oauthPar(t){return e.send({op:"OauthPAR",method:"POST",path:"/oauth/par",auth:[["OAuthClient"],[]],answers:{201:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthRevoke(t){return e.send({op:"OauthRevoke",method:"POST",path:"/oauth/revoke",auth:[["OAuthClient"],[]],answers:{200:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthToken(t){return e.send({op:"OauthToken",method:"POST",path:"/oauth/token",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthUserinfo(t){return e.send({op:"OauthUserinfo",method:"GET",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:t?.signal})},async oauthUserinfoPost(t){return e.send({op:"OauthUserinfoPost",method:"POST",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:t?.signal})},async ownerCliCode(t){return e.send({op:"OwnerCLICode",method:"POST",path:"/auth/cli/owner-code",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listConsentKeys(t){return e.send({op:"ListConsentKeys",method:"GET",path:"/auth/consents/keys",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getConsents(t){return e.send({op:"GetConsents",method:"GET",path:"/auth/consents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,headers:t.headers,signal:t.signal})},async chooseConsents(t){return e.send({op:"ChooseConsents",method:"PUT",path:"/auth/consents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async linkConsents(t){return e.send({op:"LinkConsents",method:"POST",path:"/auth/consents/link",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetInstallationConsents(t){return e.send({op:"AdminGetInstallationConsents",method:"GET",path:"/admin/installations/"+c("AdminGetInstallationConsents","installation_id",t.path.installation_id)+"/consents",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRefuseConsents(t){return e.send({op:"AdminRefuseConsents",method:"POST",path:"/admin/consents/refuse",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminInviteUser(t){return e.send({op:"AdminInviteUser",method:"POST",path:"/admin/users/invite",auth:[["AdminAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async acceptInvitation(t){return e.send({op:"AcceptInvitation",method:"POST",path:"/auth/invitations/accept",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async hostedAcceptInvitationPage(t){return e.send({op:"HostedAcceptInvitationPage",method:"GET",path:"/auth/pages/accept-invitation",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedAcceptInvitationSubmit(t){return e.send({op:"HostedAcceptInvitationSubmit",method:"POST",path:"/auth/pages/accept-invitation",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedNotMePage(t){return e.send({op:"HostedNotMePage",method:"GET",path:"/auth/pages/not-me",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedNotMeSubmit(t){return e.send({op:"HostedNotMeSubmit",method:"POST",path:"/auth/pages/not-me",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})}}}var tr={};wt(tr,{client:()=>HS});function HS(e){return{async getCacheEntry(t){return e.send({op:"GetCacheEntry",method:"GET",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putCacheEntry(t){return e.send({op:"PutCacheEntry",method:"PUT",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCacheEntry(t){return e.send({op:"DeleteCacheEntry",method:"DELETE",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async incrementCacheEntry(t){return e.send({op:"IncrementCacheEntry",method:"POST",path:"/cache/entry/increment",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCacheUsage(t){return e.send({op:"GetCacheUsage",method:"GET",path:"/cache/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})}}}var nr={};wt(nr,{client:()=>VS});function VS(e){return{async listCalls(t){return e.send({op:"ListCalls",method:"GET",path:"/calls",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startCall(t){return e.send({op:"StartCall",method:"POST",path:"/calls",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListCalls(t){return e.send({op:"AdminListCalls",method:"GET",path:"/calls/admin/calls",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminGetCall(t){return e.send({op:"AdminGetCall",method:"GET",path:"/calls/admin/calls/"+c("AdminGetCall","call_id",t.path.call_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminEndCall(t){return e.send({op:"AdminEndCall",method:"POST",path:"/calls/admin/calls/"+c("AdminEndCall","call_id",t.path.call_id)+"/end",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createCallTicket(t){return e.send({op:"CreateCallTicket",method:"POST",path:"/calls/admin/calls/"+c("CreateCallTicket","call_id",t.path.call_id)+"/tickets",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetCallTranscription(t){return e.send({op:"AdminGetCallTranscription",method:"GET",path:"/calls/admin/calls/"+c("AdminGetCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminStartCallTranscription(t){return e.send({op:"AdminStartCallTranscription",method:"POST",path:"/calls/admin/calls/"+c("AdminStartCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminStopCallTranscription(t){return e.send({op:"AdminStopCallTranscription",method:"DELETE",path:"/calls/admin/calls/"+c("AdminStopCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminIngestCallTranscriptionAudio(t){return e.send({op:"AdminIngestCallTranscriptionAudio",method:"POST",path:"/calls/admin/calls/"+c("AdminIngestCallTranscriptionAudio","call_id",t.path.call_id)+"/transcription/audio",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})},async getCallPlace(t){return e.send({op:"GetCallPlace",method:"GET",path:"/calls/places/"+c("GetCallPlace","place",t.path.place),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async watchCallPlace(t){return e.send({op:"WatchCallPlace",method:"POST",path:"/calls/places/"+c("WatchCallPlace","place",t.path.place)+"/watch",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unwatchCallPlace(t){return e.send({op:"UnwatchCallPlace",method:"DELETE",path:"/calls/places/"+c("UnwatchCallPlace","place",t.path.place)+"/watch",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async getCallSettings(t){return e.send({op:"GetCallSettings",method:"GET",path:"/calls/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putCallSettings(t){return e.send({op:"PutCallSettings",method:"PUT",path:"/calls/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateCallHookSecret(t){return e.send({op:"RotateCallHookSecret",method:"POST",path:"/calls/settings/hook-secret",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getCall(t){return e.send({op:"GetCall",method:"GET",path:"/calls/"+c("GetCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async acceptCall(t){return e.send({op:"AcceptCall",method:"POST",path:"/calls/"+c("AcceptCall","call_id",t.path.call_id)+"/accept",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineCall(t){return e.send({op:"DeclineCall",method:"POST",path:"/calls/"+c("DeclineCall","call_id",t.path.call_id)+"/decline",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async callHeartbeat(t){return e.send({op:"CallHeartbeat",method:"POST",path:"/calls/"+c("CallHeartbeat","call_id",t.path.call_id)+"/heartbeat",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async joinCall(t){return e.send({op:"JoinCall",method:"POST",path:"/calls/"+c("JoinCall","call_id",t.path.call_id)+"/join",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async leaveCall(t){return e.send({op:"LeaveCall",method:"POST",path:"/calls/"+c("LeaveCall","call_id",t.path.call_id)+"/leave",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async getCallMedia(t){return e.send({op:"GetCallMedia",method:"POST",path:"/calls/"+c("GetCallMedia","call_id",t.path.call_id)+"/media",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async inviteToCall(t){return e.send({op:"InviteToCall",method:"POST",path:"/calls/"+c("InviteToCall","call_id",t.path.call_id)+"/participants",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCallTranscription(t){return e.send({op:"GetCallTranscription",method:"GET",path:"/calls/"+c("GetCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async ingestCallTranscriptionAudio(t){return e.send({op:"IngestCallTranscriptionAudio",method:"POST",path:"/calls/"+c("IngestCallTranscriptionAudio","call_id",t.path.call_id)+"/transcription/audio",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})}}}var sr={};wt(sr,{client:()=>XS});function XS(e){return{async listBroadcasts(t){return e.send({op:"ListBroadcasts",method:"GET",path:"/campaigns/broadcasts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createBroadcast(t){return e.send({op:"CreateBroadcast",method:"POST",path:"/campaigns/broadcasts",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordBroadcastConversion(t){return e.send({op:"RecordBroadcastConversion",method:"POST",path:"/campaigns/broadcasts/conversions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getBroadcast(t){return e.send({op:"GetBroadcast",method:"GET",path:"/campaigns/broadcasts/"+c("GetBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateBroadcast(t){return e.send({op:"UpdateBroadcast",method:"PUT",path:"/campaigns/broadcasts/"+c("UpdateBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteBroadcast(t){return e.send({op:"DeleteBroadcast",method:"DELETE",path:"/campaigns/broadcasts/"+c("DeleteBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async cancelBroadcast(t){return e.send({op:"CancelBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("CancelBroadcast","id",t.path.id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async pauseBroadcast(t){return e.send({op:"PauseBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("PauseBroadcast","id",t.path.id)+"/pause",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async startBroadcast(t){return e.send({op:"StartBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("StartBroadcast","id",t.path.id)+"/start",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getBroadcastStats(t){return e.send({op:"GetBroadcastStats",method:"GET",path:"/campaigns/broadcasts/"+c("GetBroadcastStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTrackingLinks(t){return e.send({op:"ListTrackingLinks",method:"GET",path:"/campaigns/links",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTrackingLink(t){return e.send({op:"CreateTrackingLink",method:"POST",path:"/campaigns/links",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attributeLinkConversion(t){return e.send({op:"AttributeLinkConversion",method:"POST",path:"/campaigns/links/attribute",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTrackingLink(t){return e.send({op:"GetTrackingLink",method:"GET",path:"/campaigns/links/"+c("GetTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateTrackingLink(t){return e.send({op:"UpdateTrackingLink",method:"PUT",path:"/campaigns/links/"+c("UpdateTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTrackingLink(t){return e.send({op:"DeleteTrackingLink",method:"DELETE",path:"/campaigns/links/"+c("DeleteTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getTrackingLinkStats(t){return e.send({op:"GetTrackingLinkStats",method:"GET",path:"/campaigns/links/"+c("GetTrackingLinkStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listOnSiteCampaigns(t){return e.send({op:"ListOnSiteCampaigns",method:"GET",path:"/campaigns/onsite",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createOnSiteCampaign(t){return e.send({op:"CreateOnSiteCampaign",method:"POST",path:"/campaigns/onsite",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createOnSiteImpression(t){return e.send({op:"CreateOnSiteImpression",method:"POST",path:"/campaigns/onsite/impressions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordOnSiteEvent(t){return e.send({op:"RecordOnSiteEvent",method:"POST",path:"/campaigns/onsite/impressions/"+c("RecordOnSiteEvent","id",t.path.id)+"/events",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOnSiteMessages(t){return e.send({op:"ListOnSiteMessages",method:"GET",path:"/campaigns/onsite/messages",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getOnSiteSettings(t){return e.send({op:"GetOnSiteSettings",method:"GET",path:"/campaigns/onsite/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putOnSiteSettings(t){return e.send({op:"PutOnSiteSettings",method:"PUT",path:"/campaigns/onsite/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOnSiteTemplates(t){return e.send({op:"ListOnSiteTemplates",method:"GET",path:"/campaigns/onsite/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getOnSiteCampaign(t){return e.send({op:"GetOnSiteCampaign",method:"GET",path:"/campaigns/onsite/"+c("GetOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateOnSiteCampaign(t){return e.send({op:"UpdateOnSiteCampaign",method:"PUT",path:"/campaigns/onsite/"+c("UpdateOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteOnSiteCampaign(t){return e.send({op:"DeleteOnSiteCampaign",method:"DELETE",path:"/campaigns/onsite/"+c("DeleteOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getOnSiteCampaignStats(t){return e.send({op:"GetOnSiteCampaignStats",method:"GET",path:"/campaigns/onsite/"+c("GetOnSiteCampaignStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async redirectTrackingLink(t){return e.send({op:"RedirectTrackingLink",method:"GET",path:"/l/"+c("RedirectTrackingLink","slug",t.path.slug),auth:[[]],answers:{302:"redirect"},signal:t.signal})},async headTrackingLink(t){return e.send({op:"HeadTrackingLink",method:"HEAD",path:"/l/"+c("HeadTrackingLink","slug",t.path.slug),auth:[[]],answers:{302:"redirect"},signal:t.signal})}}}var ar={};wt(ar,{client:()=>YS});function YS(e){return{async listBrands(t){return e.send({op:"ListBrands",method:"GET",path:"/commerce/brands",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createBrand(t){return e.send({op:"CreateBrand",method:"POST",path:"/commerce/brands",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createCart(t){return e.send({op:"CreateCart",method:"POST",path:"/commerce/carts",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCart(t){return e.send({op:"GetCart",method:"GET",path:"/commerce/carts/"+c("GetCart","cart_id",t.path.cart_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCart(t){return e.send({op:"UpdateCart",method:"PATCH",path:"/commerce/carts/"+c("UpdateCart","cart_id",t.path.cart_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async checkoutCart(t){return e.send({op:"CheckoutCart",method:"POST",path:"/commerce/carts/"+c("CheckoutCart","cart_id",t.path.cart_id)+"/checkout",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addCartItem(t){return e.send({op:"AddCartItem",method:"POST",path:"/commerce/carts/"+c("AddCartItem","cart_id",t.path.cart_id)+"/items",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCartItem(t){return e.send({op:"DeleteCartItem",method:"DELETE",path:"/commerce/carts/"+c("DeleteCartItem","cart_id",t.path.cart_id)+"/items/"+c("DeleteCartItem","line_id",t.path.line_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCartItem(t){return e.send({op:"UpdateCartItem",method:"PATCH",path:"/commerce/carts/"+c("UpdateCartItem","cart_id",t.path.cart_id)+"/items/"+c("UpdateCartItem","line_id",t.path.line_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mergeGuestCart(t){return e.send({op:"MergeGuestCart",method:"POST",path:"/commerce/carts/"+c("MergeGuestCart","cart_id",t.path.cart_id)+"/merge",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async applyCartPromoCode(t){return e.send({op:"ApplyCartPromoCode",method:"POST",path:"/commerce/carts/"+c("ApplyCartPromoCode","cart_id",t.path.cart_id)+"/promo-codes",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeCartPromoCode(t){return e.send({op:"RemoveCartPromoCode",method:"DELETE",path:"/commerce/carts/"+c("RemoveCartPromoCode","cart_id",t.path.cart_id)+"/promo-codes/"+c("RemoveCartPromoCode","code",t.path.code),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async selectCartShipping(t){return e.send({op:"SelectCartShipping",method:"POST",path:"/commerce/carts/"+c("SelectCartShipping","cart_id",t.path.cart_id)+"/shipping",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontListBrands(t){return e.send({op:"StorefrontListBrands",method:"GET",path:"/commerce/catalog/brands",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListCategories(t){return e.send({op:"StorefrontListCategories",method:"GET",path:"/commerce/catalog/categories",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListChannels(t){return e.send({op:"StorefrontListChannels",method:"GET",path:"/commerce/catalog/channels",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListCollections(t){return e.send({op:"StorefrontListCollections",method:"GET",path:"/commerce/catalog/collections",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListProducts(t){return e.send({op:"StorefrontListProducts",method:"GET",path:"/commerce/catalog/products",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontSearchProducts(t){return e.send({op:"StorefrontSearchProducts",method:"POST",path:"/commerce/catalog/search",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontSuggest(t){return e.send({op:"StorefrontSuggest",method:"GET",path:"/commerce/catalog/suggest",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontRecommendProducts(t){return e.send({op:"StorefrontRecommendProducts",method:"POST",path:"/commerce/catalog/recommend",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontProductRecommendations(t){return e.send({op:"StorefrontProductRecommendations",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontProductRecommendations","product_id_or_handle",t.path.product_id_or_handle)+"/recommendations",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async storefrontGetProduct(t){return e.send({op:"StorefrontGetProduct",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontGetProduct","product_id_or_handle",t.path.product_id_or_handle),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async storefrontListProductReviews(t){return e.send({op:"StorefrontListProductReviews",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontListProductReviews","product_id_or_handle",t.path.product_id_or_handle)+"/reviews",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async storefrontListRegions(t){return e.send({op:"StorefrontListRegions",method:"GET",path:"/commerce/catalog/regions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListStores(t){return e.send({op:"StorefrontListStores",method:"GET",path:"/commerce/catalog/stores",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontGetStore(t){return e.send({op:"StorefrontGetStore",method:"GET",path:"/commerce/catalog/stores/"+c("StorefrontGetStore","store_id_or_slug",t.path.store_id_or_slug),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async storefrontListStoreReviews(t){return e.send({op:"StorefrontListStoreReviews",method:"GET",path:"/commerce/catalog/stores/"+c("StorefrontListStoreReviews","store_id_or_slug",t.path.store_id_or_slug)+"/reviews",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listCategories(t){return e.send({op:"ListCategories",method:"GET",path:"/commerce/categories",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCategory(t){return e.send({op:"CreateCategory",method:"POST",path:"/commerce/categories",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChannels(t){return e.send({op:"ListChannels",method:"GET",path:"/commerce/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createChannel(t){return e.send({op:"CreateChannel",method:"POST",path:"/commerce/channels",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attachChannelRegion(t){return e.send({op:"AttachChannelRegion",method:"PUT",path:"/commerce/channels/"+c("AttachChannelRegion","channel_id",t.path.channel_id)+"/regions/"+c("AttachChannelRegion","region_id",t.path.region_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async attachChannelStore(t){return e.send({op:"AttachChannelStore",method:"PUT",path:"/commerce/channels/"+c("AttachChannelStore","channel_id",t.path.channel_id)+"/stores/"+c("AttachChannelStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async detachChannelStore(t){return e.send({op:"DetachChannelStore",method:"DELETE",path:"/commerce/channels/"+c("DetachChannelStore","channel_id",t.path.channel_id)+"/stores/"+c("DetachChannelStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCollections(t){return e.send({op:"ListCollections",method:"GET",path:"/commerce/collections",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCollection(t){return e.send({op:"CreateCollection",method:"POST",path:"/commerce/collections",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addCollectionProduct(t){return e.send({op:"AddCollectionProduct",method:"PUT",path:"/commerce/collections/"+c("AddCollectionProduct","collection_id",t.path.collection_id)+"/products/"+c("AddCollectionProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async removeCollectionProduct(t){return e.send({op:"RemoveCollectionProduct",method:"DELETE",path:"/commerce/collections/"+c("RemoveCollectionProduct","collection_id",t.path.collection_id)+"/products/"+c("RemoveCollectionProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createDigitalAsset(t){return e.send({op:"CreateDigitalAsset",method:"POST",path:"/commerce/digital-assets",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateFulfillment(t){return e.send({op:"UpdateFulfillment",method:"PATCH",path:"/commerce/fulfillments/"+c("UpdateFulfillment","fulfillment_id",t.path.fulfillment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addShipmentEvent(t){return e.send({op:"AddShipmentEvent",method:"POST",path:"/commerce/fulfillments/"+c("AddShipmentEvent","fulfillment_id",t.path.fulfillment_id)+"/events",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDiscoveryStrategies(t){return e.send({op:"ListDiscoveryStrategies",method:"GET",path:"/commerce/discovery/strategies",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createDiscoveryStrategy(t){return e.send({op:"CreateDiscoveryStrategy",method:"POST",path:"/commerce/discovery/strategies",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDiscoveryStrategy(t){return e.send({op:"GetDiscoveryStrategy",method:"GET",path:"/commerce/discovery/strategies/"+c("GetDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteDiscoveryStrategy(t){return e.send({op:"DeleteDiscoveryStrategy",method:"DELETE",path:"/commerce/discovery/strategies/"+c("DeleteDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateDiscoveryStrategy(t){return e.send({op:"UpdateDiscoveryStrategy",method:"PATCH",path:"/commerce/discovery/strategies/"+c("UpdateDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMerchandisingRules(t){return e.send({op:"ListMerchandisingRules",method:"GET",path:"/commerce/discovery/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createMerchandisingRule(t){return e.send({op:"CreateMerchandisingRule",method:"POST",path:"/commerce/discovery/rules",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMerchandisingRule(t){return e.send({op:"GetMerchandisingRule",method:"GET",path:"/commerce/discovery/rules/"+c("GetMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMerchandisingRule(t){return e.send({op:"DeleteMerchandisingRule",method:"DELETE",path:"/commerce/discovery/rules/"+c("DeleteMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateMerchandisingRule(t){return e.send({op:"UpdateMerchandisingRule",method:"PATCH",path:"/commerce/discovery/rules/"+c("UpdateMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSearchSynonyms(t){return e.send({op:"ListSearchSynonyms",method:"GET",path:"/commerce/discovery/synonyms",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createSearchSynonym(t){return e.send({op:"CreateSearchSynonym",method:"POST",path:"/commerce/discovery/synonyms",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSearchSynonym(t){return e.send({op:"DeleteSearchSynonym",method:"DELETE",path:"/commerce/discovery/synonyms/"+c("DeleteSearchSynonym","synonym_id",t.path.synonym_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async refreshDiscoverySignals(t){return e.send({op:"RefreshDiscoverySignals",method:"POST",path:"/commerce/discovery/signals/refresh",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listHooks(t){return e.send({op:"ListHooks",method:"GET",path:"/commerce/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertHook(t){return e.send({op:"UpsertHook",method:"POST",path:"/commerce/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteHook(t){return e.send({op:"DeleteHook",method:"DELETE",path:"/commerce/hooks/"+c("DeleteHook","hook_id",t.path.hook_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listInventory(t){return e.send({op:"ListInventory",method:"GET",path:"/commerce/inventory",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adjustInventory(t){return e.send({op:"AdjustInventory",method:"POST",path:"/commerce/inventory/adjust",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bulkSyncInventory(t){return e.send({op:"BulkSyncInventory",method:"POST",path:"/commerce/inventory/bulk-sync",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInventoryMovements(t){return e.send({op:"ListInventoryMovements",method:"GET",path:"/commerce/inventory/movements",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listInvoices(t){return e.send({op:"ListInvoices",method:"GET",path:"/commerce/invoices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createInvoice(t){return e.send({op:"CreateInvoice",method:"POST",path:"/commerce/invoices",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateInvoice(t){return e.send({op:"UpdateInvoice",method:"PATCH",path:"/commerce/invoices/"+c("UpdateInvoice","invoice_id",t.path.invoice_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listListings(t){return e.send({op:"ListListings",method:"GET",path:"/commerce/listings",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createListing(t){return e.send({op:"CreateListing",method:"POST",path:"/commerce/listings",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateListing(t){return e.send({op:"UpdateListing",method:"PATCH",path:"/commerce/listings/"+c("UpdateListing","listing_id",t.path.listing_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async importLicenseKeys(t){return e.send({op:"ImportLicenseKeys",method:"POST",path:"/commerce/listings/"+c("ImportLicenseKeys","listing_id",t.path.listing_id)+"/license-keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertPrice(t){return e.send({op:"UpsertPrice",method:"POST",path:"/commerce/listings/"+c("UpsertPrice","listing_id",t.path.listing_id)+"/prices",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyOrders(t){return e.send({op:"ListMyOrders",method:"GET",path:"/commerce/me/orders",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMyOrder(t){return e.send({op:"GetMyOrder",method:"GET",path:"/commerce/me/orders/"+c("GetMyOrder","order_id",t.path.order_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async getMyOrderDownloads(t){return e.send({op:"GetMyOrderDownloads",method:"GET",path:"/commerce/me/orders/"+c("GetMyOrderDownloads","order_id",t.path.order_id)+"/downloads",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async createProductReview(t){return e.send({op:"CreateProductReview",method:"POST",path:"/commerce/me/products/"+c("CreateProductReview","product_id_or_handle",t.path.product_id_or_handle)+"/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyReturns(t){return e.send({op:"ListMyReturns",method:"GET",path:"/commerce/me/returns",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async listMyReviews(t){return e.send({op:"ListMyReviews",method:"GET",path:"/commerce/me/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mintReviewUploadUrl(t){return e.send({op:"MintReviewUploadURL",method:"POST",path:"/commerce/me/reviews/upload-url",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMyReview(t){return e.send({op:"DeleteMyReview",method:"DELETE",path:"/commerce/me/reviews/"+c("DeleteMyReview","review_id",t.path.review_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async voteReview(t){return e.send({op:"VoteReview",method:"POST",path:"/commerce/me/reviews/"+c("VoteReview","review_id",t.path.review_id)+"/vote",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestMyReturn(t){return e.send({op:"RequestMyReturn",method:"POST",path:"/commerce/me/store-orders/"+c("RequestMyReturn","store_order_id",t.path.store_order_id)+"/returns",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createStoreReview(t){return e.send({op:"CreateStoreReview",method:"POST",path:"/commerce/me/stores/"+c("CreateStoreReview","store_id_or_slug",t.path.store_id_or_slug)+"/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMediaAsset(t){return e.send({op:"CreateMediaAsset",method:"POST",path:"/commerce/media",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOrders(t){return e.send({op:"ListOrders",method:"GET",path:"/commerce/orders",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getGuestOrder(t){return e.send({op:"GetGuestOrder",method:"GET",path:"/commerce/orders/guest/"+c("GetGuestOrder","order_number",t.path.order_number),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getOrder(t){return e.send({op:"GetOrder",method:"GET",path:"/commerce/orders/"+c("GetOrder","order_id",t.path.order_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async markOrderPaid(t){return e.send({op:"MarkOrderPaid",method:"POST",path:"/commerce/orders/"+c("MarkOrderPaid","order_id",t.path.order_id)+"/mark-paid",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPriceLists(t){return e.send({op:"ListPriceLists",method:"GET",path:"/commerce/price-lists",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPriceList(t){return e.send({op:"CreatePriceList",method:"POST",path:"/commerce/price-lists",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listProducts(t){return e.send({op:"ListProducts",method:"GET",path:"/commerce/products",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createProduct(t){return e.send({op:"CreateProduct",method:"POST",path:"/commerce/products",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createQuickProduct(t){return e.send({op:"CreateQuickProduct",method:"POST",path:"/commerce/products/quick",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getProduct(t){return e.send({op:"GetProduct",method:"GET",path:"/commerce/products/"+c("GetProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateProduct(t){return e.send({op:"UpdateProduct",method:"PATCH",path:"/commerce/products/"+c("UpdateProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async approveProduct(t){return e.send({op:"ApproveProduct",method:"POST",path:"/commerce/products/"+c("ApproveProduct","product_id",t.path.product_id)+"/approval",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertProductOption(t){return e.send({op:"UpsertProductOption",method:"POST",path:"/commerce/products/"+c("UpsertProductOption","product_id",t.path.product_id)+"/options",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createVariant(t){return e.send({op:"CreateVariant",method:"POST",path:"/commerce/products/"+c("CreateVariant","product_id",t.path.product_id)+"/variants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRegions(t){return e.send({op:"ListRegions",method:"GET",path:"/commerce/regions",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createRegion(t){return e.send({op:"CreateRegion",method:"POST",path:"/commerce/regions",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateRegion(t){return e.send({op:"UpdateRegion",method:"PATCH",path:"/commerce/regions/"+c("UpdateRegion","region_id",t.path.region_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listReturns(t){return e.send({op:"ListReturns",method:"GET",path:"/commerce/returns",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async approveReturn(t){return e.send({op:"ApproveReturn",method:"POST",path:"/commerce/returns/"+c("ApproveReturn","return_id",t.path.return_id)+"/approve",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rejectReturn(t){return e.send({op:"RejectReturn",method:"POST",path:"/commerce/returns/"+c("RejectReturn","return_id",t.path.return_id)+"/reject",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeReturn(t){return e.send({op:"CompleteReturn",method:"POST",path:"/commerce/returns/"+c("CompleteReturn","return_id",t.path.return_id)+"/complete",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveReturn(t){return e.send({op:"ReceiveReturn",method:"POST",path:"/commerce/returns/"+c("ReceiveReturn","return_id",t.path.return_id)+"/receive",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListReviews(t){return e.send({op:"AdminListReviews",method:"GET",path:"/commerce/reviews",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminDeleteReview(t){return e.send({op:"AdminDeleteReview",method:"DELETE",path:"/commerce/reviews/"+c("AdminDeleteReview","review_id",t.path.review_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminModerateReview(t){return e.send({op:"AdminModerateReview",method:"PATCH",path:"/commerce/reviews/"+c("AdminModerateReview","review_id",t.path.review_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCommerceSettings(t){return e.send({op:"GetCommerceSettings",method:"GET",path:"/commerce/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateCommerceSettings(t){return e.send({op:"UpdateCommerceSettings",method:"PUT",path:"/commerce/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSettlements(t){return e.send({op:"ListSettlements",method:"GET",path:"/commerce/settlements",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async generateSettlement(t){return e.send({op:"GenerateSettlement",method:"POST",path:"/commerce/settlements/generate",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async markSettlementPaid(t){return e.send({op:"MarkSettlementPaid",method:"POST",path:"/commerce/settlements/"+c("MarkSettlementPaid","settlement_id",t.path.settlement_id)+"/mark-paid",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listShippingOptions(t){return e.send({op:"ListShippingOptions",method:"GET",path:"/commerce/shipping-options",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createShippingOption(t){return e.send({op:"CreateShippingOption",method:"POST",path:"/commerce/shipping-options",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listShippingProfiles(t){return e.send({op:"ListShippingProfiles",method:"GET",path:"/commerce/shipping-profiles",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createShippingProfile(t){return e.send({op:"CreateShippingProfile",method:"POST",path:"/commerce/shipping-profiles",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStockLocations(t){return e.send({op:"ListStockLocations",method:"GET",path:"/commerce/stock-locations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createStockLocation(t){return e.send({op:"CreateStockLocation",method:"POST",path:"/commerce/stock-locations",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStoreOrders(t){return e.send({op:"ListStoreOrders",method:"GET",path:"/commerce/store-orders",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getStoreOrder(t){return e.send({op:"GetStoreOrder",method:"GET",path:"/commerce/store-orders/"+c("GetStoreOrder","store_order_id",t.path.store_order_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelStoreOrder(t){return e.send({op:"CancelStoreOrder",method:"POST",path:"/commerce/store-orders/"+c("CancelStoreOrder","store_order_id",t.path.store_order_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createFulfillment(t){return e.send({op:"CreateFulfillment",method:"POST",path:"/commerce/store-orders/"+c("CreateFulfillment","store_order_id",t.path.store_order_id)+"/fulfillments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createReturn(t){return e.send({op:"CreateReturn",method:"POST",path:"/commerce/store-orders/"+c("CreateReturn","store_order_id",t.path.store_order_id)+"/returns",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStores(t){return e.send({op:"ListStores",method:"GET",path:"/commerce/stores",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createStore(t){return e.send({op:"CreateStore",method:"POST",path:"/commerce/stores",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStore(t){return e.send({op:"GetStore",method:"GET",path:"/commerce/stores/"+c("GetStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateStore(t){return e.send({op:"UpdateStore",method:"PATCH",path:"/commerce/stores/"+c("UpdateStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpdateFulfillment(t){return e.send({op:"SellerUpdateFulfillment",method:"PATCH",path:"/commerce/stores/"+c("SellerUpdateFulfillment","store_id",t.path.store_id)+"/fulfillments/"+c("SellerUpdateFulfillment","fulfillment_id",t.path.fulfillment_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerAddShipmentEvent(t){return e.send({op:"SellerAddShipmentEvent",method:"POST",path:"/commerce/stores/"+c("SellerAddShipmentEvent","store_id",t.path.store_id)+"/fulfillments/"+c("SellerAddShipmentEvent","fulfillment_id",t.path.fulfillment_id)+"/events",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListInventory(t){return e.send({op:"SellerListInventory",method:"GET",path:"/commerce/stores/"+c("SellerListInventory","store_id",t.path.store_id)+"/inventory",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerAdjustInventory(t){return e.send({op:"SellerAdjustInventory",method:"POST",path:"/commerce/stores/"+c("SellerAdjustInventory","store_id",t.path.store_id)+"/inventory/adjust",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerBulkSyncInventory(t){return e.send({op:"SellerBulkSyncInventory",method:"POST",path:"/commerce/stores/"+c("SellerBulkSyncInventory","store_id",t.path.store_id)+"/inventory/bulk-sync",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListListings(t){return e.send({op:"SellerListListings",method:"GET",path:"/commerce/stores/"+c("SellerListListings","store_id",t.path.store_id)+"/listings",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateListing(t){return e.send({op:"SellerCreateListing",method:"POST",path:"/commerce/stores/"+c("SellerCreateListing","store_id",t.path.store_id)+"/listings",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpdateListing(t){return e.send({op:"SellerUpdateListing",method:"PATCH",path:"/commerce/stores/"+c("SellerUpdateListing","store_id",t.path.store_id)+"/listings/"+c("SellerUpdateListing","listing_id",t.path.listing_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerImportLicenseKeys(t){return e.send({op:"SellerImportLicenseKeys",method:"POST",path:"/commerce/stores/"+c("SellerImportLicenseKeys","store_id",t.path.store_id)+"/listings/"+c("SellerImportLicenseKeys","listing_id",t.path.listing_id)+"/license-keys",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpsertPrice(t){return e.send({op:"SellerUpsertPrice",method:"POST",path:"/commerce/stores/"+c("SellerUpsertPrice","store_id",t.path.store_id)+"/listings/"+c("SellerUpsertPrice","listing_id",t.path.listing_id)+"/prices",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListStockLocations(t){return e.send({op:"SellerListStockLocations",method:"GET",path:"/commerce/stores/"+c("SellerListStockLocations","store_id",t.path.store_id)+"/locations",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateStockLocation(t){return e.send({op:"SellerCreateStockLocation",method:"POST",path:"/commerce/stores/"+c("SellerCreateStockLocation","store_id",t.path.store_id)+"/locations",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addStoreMember(t){return e.send({op:"AddStoreMember",method:"POST",path:"/commerce/stores/"+c("AddStoreMember","store_id",t.path.store_id)+"/members",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeStoreMember(t){return e.send({op:"RemoveStoreMember",method:"DELETE",path:"/commerce/stores/"+c("RemoveStoreMember","store_id",t.path.store_id)+"/members/"+c("RemoveStoreMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerGetMetrics(t){return e.send({op:"SellerGetMetrics",method:"GET",path:"/commerce/stores/"+c("SellerGetMetrics","store_id",t.path.store_id)+"/metrics",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerListStoreOrders(t){return e.send({op:"SellerListStoreOrders",method:"GET",path:"/commerce/stores/"+c("SellerListStoreOrders","store_id",t.path.store_id)+"/orders",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerGetStoreOrder(t){return e.send({op:"SellerGetStoreOrder",method:"GET",path:"/commerce/stores/"+c("SellerGetStoreOrder","store_id",t.path.store_id)+"/orders/"+c("SellerGetStoreOrder","store_order_id",t.path.store_order_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCancelStoreOrder(t){return e.send({op:"SellerCancelStoreOrder",method:"POST",path:"/commerce/stores/"+c("SellerCancelStoreOrder","store_id",t.path.store_id)+"/orders/"+c("SellerCancelStoreOrder","store_order_id",t.path.store_order_id)+"/cancel",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreateFulfillment(t){return e.send({op:"SellerCreateFulfillment",method:"POST",path:"/commerce/stores/"+c("SellerCreateFulfillment","store_id",t.path.store_id)+"/orders/"+c("SellerCreateFulfillment","store_order_id",t.path.store_order_id)+"/fulfillments",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async onboardStorePaymentAccount(t){return e.send({op:"OnboardStorePaymentAccount",method:"POST",path:"/commerce/stores/"+c("OnboardStorePaymentAccount","store_id",t.path.store_id)+"/payment-accounts",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerOnboardPayouts(t){return e.send({op:"SellerOnboardPayouts",method:"POST",path:"/commerce/stores/"+c("SellerOnboardPayouts","store_id",t.path.store_id)+"/payouts/onboard",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerOnboardingLink(t){return e.send({op:"SellerOnboardingLink",method:"POST",path:"/commerce/stores/"+c("SellerOnboardingLink","store_id",t.path.store_id)+"/payouts/onboarding-link",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListProducts(t){return e.send({op:"SellerListProducts",method:"GET",path:"/commerce/stores/"+c("SellerListProducts","store_id",t.path.store_id)+"/products",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerCreateProduct(t){return e.send({op:"SellerCreateProduct",method:"POST",path:"/commerce/stores/"+c("SellerCreateProduct","store_id",t.path.store_id)+"/products",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreateQuickProduct(t){return e.send({op:"SellerCreateQuickProduct",method:"POST",path:"/commerce/stores/"+c("SellerCreateQuickProduct","store_id",t.path.store_id)+"/products/quick",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreatePromotionRule(t){return e.send({op:"SellerCreatePromotionRule",method:"POST",path:"/commerce/stores/"+c("SellerCreatePromotionRule","store_id",t.path.store_id)+"/promotions/rules",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListReturns(t){return e.send({op:"SellerListReturns",method:"GET",path:"/commerce/stores/"+c("SellerListReturns","store_id",t.path.store_id)+"/returns",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerApproveReturn(t){return e.send({op:"SellerApproveReturn",method:"POST",path:"/commerce/stores/"+c("SellerApproveReturn","store_id",t.path.store_id)+"/returns/"+c("SellerApproveReturn","return_id",t.path.return_id)+"/approve",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerRejectReturn(t){return e.send({op:"SellerRejectReturn",method:"POST",path:"/commerce/stores/"+c("SellerRejectReturn","store_id",t.path.store_id)+"/returns/"+c("SellerRejectReturn","return_id",t.path.return_id)+"/reject",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCompleteReturn(t){return e.send({op:"SellerCompleteReturn",method:"POST",path:"/commerce/stores/"+c("SellerCompleteReturn","store_id",t.path.store_id)+"/returns/"+c("SellerCompleteReturn","return_id",t.path.return_id)+"/complete",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerReceiveReturn(t){return e.send({op:"SellerReceiveReturn",method:"POST",path:"/commerce/stores/"+c("SellerReceiveReturn","store_id",t.path.store_id)+"/returns/"+c("SellerReceiveReturn","return_id",t.path.return_id)+"/receive",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListReviews(t){return e.send({op:"SellerListReviews",method:"GET",path:"/commerce/stores/"+c("SellerListReviews","store_id",t.path.store_id)+"/reviews",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerReplyReview(t){return e.send({op:"SellerReplyReview",method:"POST",path:"/commerce/stores/"+c("SellerReplyReview","store_id",t.path.store_id)+"/reviews/"+c("SellerReplyReview","review_id",t.path.review_id)+"/reply",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListSettlements(t){return e.send({op:"SellerListSettlements",method:"GET",path:"/commerce/stores/"+c("SellerListSettlements","store_id",t.path.store_id)+"/settlements",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateShippingOption(t){return e.send({op:"SellerCreateShippingOption",method:"POST",path:"/commerce/stores/"+c("SellerCreateShippingOption","store_id",t.path.store_id)+"/shipping-options",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTaxRates(t){return e.send({op:"ListTaxRates",method:"GET",path:"/commerce/tax-rates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertTaxRate(t){return e.send({op:"UpsertTaxRate",method:"PUT",path:"/commerce/tax-rates",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateVariant(t){return e.send({op:"UpdateVariant",method:"PATCH",path:"/commerce/variants/"+c("UpdateVariant","variant_id",t.path.variant_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setBundleItems(t){return e.send({op:"SetBundleItems",method:"POST",path:"/commerce/variants/"+c("SetBundleItems","variant_id",t.path.variant_id)+"/bundle-items",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recomputeVariantBuyBox(t){return e.send({op:"RecomputeVariantBuyBox",method:"POST",path:"/commerce/variants/"+c("RecomputeVariantBuyBox","variant_id",t.path.variant_id)+"/buybox/recompute",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async revokePromotionCode(t){return e.send({op:"RevokePromotionCode",method:"DELETE",path:"/promotions/codes/"+c("RevokePromotionCode","code_id",t.path.code_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async evaluatePromotions(t){return e.send({op:"EvaluatePromotions",method:"POST",path:"/promotions/evaluate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async holdPromotions(t){return e.send({op:"HoldPromotions",method:"POST",path:"/promotions/holds",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitPromotionHold(t){return e.send({op:"CommitPromotionHold",method:"POST",path:"/promotions/holds/"+c("CommitPromotionHold","hold_id",t.path.hold_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releasePromotionHold(t){return e.send({op:"ReleasePromotionHold",method:"POST",path:"/promotions/holds/"+c("ReleasePromotionHold","hold_id",t.path.hold_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPromotionRedemptions(t){return e.send({op:"ListPromotionRedemptions",method:"GET",path:"/promotions/redemptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async reversePromotionRedemption(t){return e.send({op:"ReversePromotionRedemption",method:"POST",path:"/promotions/redemptions/"+c("ReversePromotionRedemption","redemption_id",t.path.redemption_id)+"/reverse",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPromotionRules(t){return e.send({op:"ListPromotionRules",method:"GET",path:"/promotions/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createPromotionRule(t){return e.send({op:"CreatePromotionRule",method:"POST",path:"/promotions/rules",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPromotionRule(t){return e.send({op:"GetPromotionRule",method:"GET",path:"/promotions/rules/"+c("GetPromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async archivePromotionRule(t){return e.send({op:"ArchivePromotionRule",method:"DELETE",path:"/promotions/rules/"+c("ArchivePromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updatePromotionRule(t){return e.send({op:"UpdatePromotionRule",method:"PATCH",path:"/promotions/rules/"+c("UpdatePromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertPromotionBudget(t){return e.send({op:"UpsertPromotionBudget",method:"PUT",path:"/promotions/rules/"+c("UpsertPromotionBudget","rule_id",t.path.rule_id)+"/budgets/"+c("UpsertPromotionBudget","currency",t.path.currency),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPromotionCodes(t){return e.send({op:"ListPromotionCodes",method:"GET",path:"/promotions/rules/"+c("ListPromotionCodes","rule_id",t.path.rule_id)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPromotionCode(t){return e.send({op:"CreatePromotionCode",method:"POST",path:"/promotions/rules/"+c("CreatePromotionCode","rule_id",t.path.rule_id)+"/codes",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async generatePromotionCodeBatch(t){return e.send({op:"GeneratePromotionCodeBatch",method:"POST",path:"/promotions/rules/"+c("GeneratePromotionCodeBatch","rule_id",t.path.rule_id)+"/codes/batch",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var xo={};wt(xo,{client:()=>ZS});function ZS(e){return{async getValues(t){return e.send({op:"GetValues",method:"GET",path:"/flags",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},headers:t?.headers,signal:t?.signal})},async batchUserValues(t){return e.send({op:"BatchUserValues",method:"POST",path:"/flags/batch",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDelta(t){return e.send({op:"GetDelta",method:"GET",path:"/flags/delta",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},query:t?.query,headers:t?.headers,signal:t?.signal})},async getEvaluations(t){return e.send({op:"GetEvaluations",method:"GET",path:"/flags/evaluations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/flags/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/flags/experiments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getExperiment(t){return e.send({op:"GetExperiment",method:"GET",path:"/flags/experiments/"+c("GetExperiment","experiment_id",t.path.experiment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getExperimentResults(t){return e.send({op:"GetExperimentResults",method:"GET",path:"/flags/experiments/"+c("GetExperimentResults","experiment_id",t.path.experiment_id)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async stopExperiment(t){return e.send({op:"StopExperiment",method:"POST",path:"/flags/experiments/"+c("StopExperiment","experiment_id",t.path.experiment_id)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async declareExperimentWinner(t){return e.send({op:"DeclareExperimentWinner",method:"POST",path:"/flags/experiments/"+c("DeclareExperimentWinner","experiment_id",t.path.experiment_id)+"/winner",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCurrentInstallations(t){return e.send({op:"GetCurrentInstallations",method:"GET",path:"/flags/installations/current",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getInstallationsDaily(t){return e.send({op:"GetInstallationsDaily",method:"GET",path:"/flags/installations/daily",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getSnapshot(t){return e.send({op:"GetSnapshot",method:"GET",path:"/flags/snapshot",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t?.headers,signal:t?.signal})},async listDefinitions(t){return e.send({op:"ListDefinitions",method:"GET",path:"/flags/system",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getDefinition(t){return e.send({op:"GetDefinition",method:"GET",path:"/flags/system/"+c("GetDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putDefinition(t){return e.send({op:"PutDefinition",method:"PUT",path:"/flags/system/"+c("PutDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteDefinition(t){return e.send({op:"DeleteDefinition",method:"DELETE",path:"/flags/system/"+c("DeleteDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async activateTemplates(t){return e.send({op:"ActivateTemplates",method:"POST",path:"/flags/templates/activation",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getActiveTemplate(t){return e.send({op:"GetActiveTemplate",method:"GET",path:"/flags/templates/active",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplateCapabilities(t){return e.send({op:"GetTemplateCapabilities",method:"GET",path:"/flags/templates/capabilities",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplateDraft(t){return e.send({op:"GetTemplateDraft",method:"GET",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTemplateDraft(t){return e.send({op:"CreateTemplateDraft",method:"POST",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async discardTemplateDraft(t){return e.send({op:"DiscardTemplateDraft",method:"DELETE",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{204:"empty"},headers:t.headers,signal:t.signal})},async putTemplateParameter(t){return e.send({op:"PutTemplateParameter",method:"PUT",path:"/flags/templates/draft/parameters/"+c("PutTemplateParameter","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeTemplateParameter(t){return e.send({op:"RemoveTemplateParameter",method:"DELETE",path:"/flags/templates/draft/parameters/"+c("RemoveTemplateParameter","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})},async reviewTemplateDraft(t){return e.send({op:"ReviewTemplateDraft",method:"GET",path:"/flags/templates/draft/review",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async publishTemplate(t){return e.send({op:"PublishTemplate",method:"POST",path:"/flags/templates/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPublishReceipt(t){return e.send({op:"GetPublishReceipt",method:"POST",path:"/flags/templates/publish/receipt",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async restoreTemplateVersion(t){return e.send({op:"RestoreTemplateVersion",method:"POST",path:"/flags/templates/restore/"+c("RestoreTemplateVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTemplateVersions(t){return e.send({op:"ListTemplateVersions",method:"GET",path:"/flags/templates/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getTemplateVersion(t){return e.send({op:"GetTemplateVersion",method:"GET",path:"/flags/templates/versions/"+c("GetTemplateVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getUserValues(t){return e.send({op:"GetUserValues",method:"GET",path:"/flags/users/"+c("GetUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})},async putUserValues(t){return e.send({op:"PutUserValues",method:"PUT",path:"/flags/users/"+c("PutUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserValues(t){return e.send({op:"DeleteUserValues",method:"DELETE",path:"/flags/users/"+c("DeleteUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putUserValue(t){return e.send({op:"PutUserValue",method:"PUT",path:"/flags/users/"+c("PutUserValue","user_id",t.path.user_id)+"/"+c("PutUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserValue(t){return e.send({op:"DeleteUserValue",method:"DELETE",path:"/flags/users/"+c("DeleteUserValue","user_id",t.path.user_id)+"/"+c("DeleteUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})}}}var Lo={};wt(Lo,{client:()=>QS});function QS(e){return{async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/iap/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/iap/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleAccountToken(t){return e.send({op:"GetAppleAccountToken",method:"POST",path:"/iap/apple/account-token",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getAppleConnectPage(t){return e.send({op:"GetAppleConnectPage",method:"GET",path:"/iap/apple/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/iap/apple/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createAppleGrant(t){return e.send({op:"CreateAppleGrant",method:"POST",path:"/iap/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleReadiness(t){return e.send({op:"GetAppleReadiness",method:"GET",path:"/iap/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async reportAppleTransactions(t){return e.send({op:"ReportAppleTransactions",method:"POST",path:"/iap/apple/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setXcodeCertificate(t){return e.send({op:"SetXcodeCertificate",method:"PUT",path:"/iap/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearXcodeCertificate(t){return e.send({op:"ClearXcodeCertificate",method:"DELETE",path:"/iap/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async setXcodeOfferKey(t){return e.send({op:"SetXcodeOfferKey",method:"PUT",path:"/iap/apple/xcode-offer-key",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCatalog(t){return e.send({op:"GetCatalog",method:"GET",path:"/iap/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async saveCatalog(t){return e.send({op:"SaveCatalog",method:"PUT",path:"/iap/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planCatalog(t){return e.send({op:"PlanCatalog",method:"POST",path:"/iap/catalog/plans",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getCatalogPlan(t){return e.send({op:"GetCatalogPlan",method:"GET",path:"/iap/catalog/plans/"+c("GetCatalogPlan","plan_id",t.path.plan_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async confirmCatalogPlan(t){return e.send({op:"ConfirmCatalogPlan",method:"POST",path:"/iap/catalog/plans/"+c("ConfirmCatalogPlan","plan_id",t.path.plan_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineCatalogPlan(t){return e.send({op:"DeclineCatalogPlan",method:"POST",path:"/iap/catalog/plans/"+c("DeclineCatalogPlan","plan_id",t.path.plan_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listCatalogRevisions(t){return e.send({op:"ListCatalogRevisions",method:"GET",path:"/iap/catalog/revisions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getCatalogRevision(t){return e.send({op:"GetCatalogRevision",method:"GET",path:"/iap/catalog/revisions/"+c("GetCatalogRevision","revision",t.path.revision),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async restoreCatalogRevision(t){return e.send({op:"RestoreCatalogRevision",method:"POST",path:"/iap/catalog/revisions/"+c("RestoreCatalogRevision","revision",t.path.revision)+"/restore",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async validateCatalog(t){return e.send({op:"ValidateCatalog",method:"POST",path:"/iap/catalog/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCharts(t){return e.send({op:"ListCharts",method:"GET",path:"/iap/charts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getChartsOverview(t){return e.send({op:"GetChartsOverview",method:"GET",path:"/iap/charts/overview",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getChart(t){return e.send({op:"GetChart",method:"GET",path:"/iap/charts/"+c("GetChart","chart",t.path.chart),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createCheckout(t){return e.send({op:"CreateCheckout",method:"POST",path:"/iap/checkout",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createCheckoutRedemption(t){return e.send({op:"CreateCheckoutRedemption",method:"POST",path:"/iap/checkout/redemption",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCoupons(t){return e.send({op:"ListCoupons",method:"GET",path:"/iap/coupons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCoupon(t){return e.send({op:"CreateCoupon",method:"POST",path:"/iap/coupons",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async redeemCoupon(t){return e.send({op:"RedeemCoupon",method:"POST",path:"/iap/coupons/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCoupon(t){return e.send({op:"GetCoupon",method:"GET",path:"/iap/coupons/"+c("GetCoupon","coupon_key",t.path.coupon_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async revokeCoupon(t){return e.send({op:"RevokeCoupon",method:"DELETE",path:"/iap/coupons/"+c("RevokeCoupon","coupon_key",t.path.coupon_key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listCouponCodes(t){return e.send({op:"ListCouponCodes",method:"GET",path:"/iap/coupons/"+c("ListCouponCodes","coupon_key",t.path.coupon_key)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async searchCustomers(t){return e.send({op:"SearchCustomers",method:"GET",path:"/iap/customers",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/iap/customers/"+c("GetCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async grantCredits(t){return e.send({op:"GrantCredits",method:"POST",path:"/iap/customers/"+c("GrantCredits","customer_id",t.path.customer_id)+"/credits",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCreditEntries(t){return e.send({op:"ListCreditEntries",method:"GET",path:"/iap/customers/"+c("ListCreditEntries","customer_id",t.path.customer_id)+"/credits/entries",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async forgiveCredits(t){return e.send({op:"ForgiveCredits",method:"POST",path:"/iap/customers/"+c("ForgiveCredits","customer_id",t.path.customer_id)+"/credits/forgive",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCustomerGrants(t){return e.send({op:"ListCustomerGrants",method:"GET",path:"/iap/customers/"+c("ListCustomerGrants","customer_id",t.path.customer_id)+"/grants",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async grantEntitlement(t){return e.send({op:"GrantEntitlement",method:"POST",path:"/iap/customers/"+c("GrantEntitlement","customer_id",t.path.customer_id)+"/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeGrant(t){return e.send({op:"RevokeGrant",method:"DELETE",path:"/iap/customers/"+c("RevokeGrant","customer_id",t.path.customer_id)+"/grants/"+c("RevokeGrant","grant_id",t.path.grant_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getCustomerHistory(t){return e.send({op:"GetCustomerHistory",method:"GET",path:"/iap/customers/"+c("GetCustomerHistory","customer_id",t.path.customer_id)+"/history",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async holdSpend(t){return e.send({op:"HoldSpend",method:"POST",path:"/iap/customers/"+c("HoldSpend","customer_id",t.path.customer_id)+"/holds",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setCustomerLimit(t){return e.send({op:"SetCustomerLimit",method:"PUT",path:"/iap/customers/"+c("SetCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+c("SetCustomerLimit","limit_key",t.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearCustomerLimit(t){return e.send({op:"ClearCustomerLimit",method:"DELETE",path:"/iap/customers/"+c("ClearCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+c("ClearCustomerLimit","limit_key",t.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async grantLimit(t){return e.send({op:"GrantLimit",method:"POST",path:"/iap/customers/"+c("GrantLimit","customer_id",t.path.customer_id)+"/limits/"+c("GrantLimit","limit_key",t.path.limit_key)+"/grants",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async spend(t){return e.send({op:"Spend",method:"POST",path:"/iap/customers/"+c("Spend","customer_id",t.path.customer_id)+"/spend",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitSpend(t){return e.send({op:"CommitSpend",method:"POST",path:"/iap/customers/"+c("CommitSpend","customer_id",t.path.customer_id)+"/spends/"+c("CommitSpend","spend_id",t.path.spend_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendHold(t){return e.send({op:"ExtendHold",method:"POST",path:"/iap/customers/"+c("ExtendHold","customer_id",t.path.customer_id)+"/spends/"+c("ExtendHold","spend_id",t.path.spend_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseSpend(t){return e.send({op:"ReleaseSpend",method:"POST",path:"/iap/customers/"+c("ReleaseSpend","customer_id",t.path.customer_id)+"/spends/"+c("ReleaseSpend","spend_id",t.path.spend_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reverseSpend(t){return e.send({op:"ReverseSpend",method:"POST",path:"/iap/customers/"+c("ReverseSpend","customer_id",t.path.customer_id)+"/spends/"+c("ReverseSpend","spend_id",t.path.spend_id)+"/reverse",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/iap/customers/"+c("CancelSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("CancelSubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/iap/customers/"+c("ExtendSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("ExtendSubscription","subscription_id",t.path.subscription_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refundSubscription(t){return e.send({op:"RefundSubscription",method:"POST",path:"/iap/customers/"+c("RefundSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("RefundSubscription","subscription_id",t.path.subscription_id)+"/refund",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/iap/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/iap/experiments",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getExperiment(t){return e.send({op:"GetExperiment",method:"GET",path:"/iap/experiments/"+c("GetExperiment","experiment_id",t.path.experiment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getExperimentResults(t){return e.send({op:"GetExperimentResults",method:"GET",path:"/iap/experiments/"+c("GetExperimentResults","experiment_id",t.path.experiment_id)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async stopExperiment(t){return e.send({op:"StopExperiment",method:"POST",path:"/iap/experiments/"+c("StopExperiment","experiment_id",t.path.experiment_id)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async declareExperimentWinner(t){return e.send({op:"DeclareExperimentWinner",method:"POST",path:"/iap/experiments/"+c("DeclareExperimentWinner","experiment_id",t.path.experiment_id)+"/winner",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async disconnectGoogle(t){return e.send({op:"DisconnectGoogle",method:"DELETE",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getGoogleAccountId(t){return e.send({op:"GetGoogleAccountID",method:"POST",path:"/iap/google/account-id",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async reportGooglePurchases(t){return e.send({op:"ReportGooglePurchases",method:"POST",path:"/iap/google/purchases",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMyCustomerInfo(t){return e.send({op:"GetMyCustomerInfo",method:"GET",path:"/iap/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mergeGuest(t){return e.send({op:"MergeGuest",method:"POST",path:"/iap/me/merge",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMergeGrant(t){return e.send({op:"CreateMergeGrant",method:"POST",path:"/iap/me/merge-grant",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t?.signal})},async setRefundDataConsent(t){return e.send({op:"SetRefundDataConsent",method:"PUT",path:"/iap/me/refund-data-consent",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getOfferings(t){return e.send({op:"GetOfferings",method:"GET",path:"/iap/offerings",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listMyOffers(t){return e.send({op:"ListMyOffers",method:"GET",path:"/iap/offers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getOfferStats(t){return e.send({op:"GetOfferStats",method:"GET",path:"/iap/offers/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async signAppleOffer(t){return e.send({op:"SignAppleOffer",method:"POST",path:"/iap/offers/"+c("SignAppleOffer","offer_key",t.path.offer_key)+"/apple-signature",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async claimOffer(t){return e.send({op:"ClaimOffer",method:"POST",path:"/iap/offers/"+c("ClaimOffer","offer_key",t.path.offer_key)+"/claim",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async recordOfferView(t){return e.send({op:"RecordOfferView",method:"POST",path:"/iap/offers/"+c("RecordOfferView","offer_key",t.path.offer_key)+"/views",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async listPaywalls(t){return e.send({op:"ListPaywalls",method:"GET",path:"/iap/paywalls",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPaywall(t){return e.send({op:"CreatePaywall",method:"POST",path:"/iap/paywalls",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPaywallAssets(t){return e.send({op:"ListPaywallAssets",method:"GET",path:"/iap/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async registerPaywallAsset(t){return e.send({op:"RegisterPaywallAsset",method:"POST",path:"/iap/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePaywallAsset(t){return e.send({op:"DeletePaywallAsset",method:"DELETE",path:"/iap/paywalls/assets/"+c("DeletePaywallAsset","asset_id",t.path.asset_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPaywallTemplates(t){return e.send({op:"ListPaywallTemplates",method:"GET",path:"/iap/paywalls/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPaywallTemplateAsset(t){return e.send({op:"GetPaywallTemplateAsset",method:"GET",path:"/iap/paywalls/templates/"+c("GetPaywallTemplateAsset","key",t.path.key)+"/assets/"+c("GetPaywallTemplateAsset","asset_id",t.path.asset_id),auth:[["SecretKeyAuth"]],answers:{200:"raw",304:"empty"},headers:t.headers,signal:t.signal})},async validatePaywall(t){return e.send({op:"ValidatePaywall",method:"POST",path:"/iap/paywalls/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPaywall(t){return e.send({op:"GetPaywall",method:"GET",path:"/iap/paywalls/"+c("GetPaywall","paywall_id",t.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deletePaywall(t){return e.send({op:"DeletePaywall",method:"DELETE",path:"/iap/paywalls/"+c("DeletePaywall","paywall_id",t.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async savePaywallDraft(t){return e.send({op:"SavePaywallDraft",method:"PUT",path:"/iap/paywalls/"+c("SavePaywallDraft","paywall_id",t.path.paywall_id)+"/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async publishPaywall(t){return e.send({op:"PublishPaywall",method:"POST",path:"/iap/paywalls/"+c("PublishPaywall","paywall_id",t.path.paywall_id)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPaywallVersions(t){return e.send({op:"ListPaywallVersions",method:"GET",path:"/iap/paywalls/"+c("ListPaywallVersions","paywall_id",t.path.paywall_id)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getPaywallVersion(t){return e.send({op:"GetPaywallVersion",method:"GET",path:"/iap/paywalls/"+c("GetPaywallVersion","paywall_id",t.path.paywall_id)+"/versions/"+c("GetPaywallVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPlacements(t){return e.send({op:"ListPlacements",method:"GET",path:"/iap/placements",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listAttributeKeys(t){return e.send({op:"ListAttributeKeys",method:"GET",path:"/iap/placements/attributes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async setPlacement(t){return e.send({op:"SetPlacement",method:"PUT",path:"/iap/placements/"+c("SetPlacement","placement",t.path.placement),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePlacement(t){return e.send({op:"DeletePlacement",method:"DELETE",path:"/iap/placements/"+c("DeletePlacement","placement",t.path.placement),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async recordPaywallExposure(t){return e.send({op:"RecordPaywallExposure",method:"POST",path:"/iap/placements/"+c("RecordPaywallExposure","placement",t.path.placement)+"/exposures",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPlacementPaywall(t){return e.send({op:"GetPlacementPaywall",method:"GET",path:"/iap/placements/"+c("GetPlacementPaywall","placement",t.path.placement)+"/paywall",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",204:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async previewPlacement(t){return e.send({op:"PreviewPlacement",method:"POST",path:"/iap/placements/"+c("PreviewPlacement","placement",t.path.placement)+"/resolve-preview",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPlacementResults(t){return e.send({op:"GetPlacementResults",method:"GET",path:"/iap/placements/"+c("GetPlacementResults","placement",t.path.placement)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getPlacementRules(t){return e.send({op:"GetPlacementRules",method:"GET",path:"/iap/placements/"+c("GetPlacementRules","placement",t.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setPlacementRules(t){return e.send({op:"SetPlacementRules",method:"PUT",path:"/iap/placements/"+c("SetPlacementRules","placement",t.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createPortalSession(t){return e.send({op:"CreatePortalSession",method:"POST",path:"/iap/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRedemptionPage(t){return e.send({op:"GetRedemptionPage",method:"GET",path:"/iap/redeem",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async redeemPurchase(t){return e.send({op:"RedeemPurchase",method:"POST",path:"/iap/redemptions/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/iap/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/iap/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveAppleNotification(t){return e.send({op:"ReceiveAppleNotification",method:"POST",path:"/iap/webhooks/apple",auth:[],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveGoogleNotification(t){return e.send({op:"ReceiveGoogleNotification",method:"POST",path:"/iap/webhooks/google",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var or={};wt(or,{client:()=>e$});function e$(e){return{async listJourneys(t){return e.send({op:"ListJourneys",method:"GET",path:"/journeys",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createJourney(t){return e.send({op:"CreateJourney",method:"POST",path:"/journeys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBlueprints(t){return e.send({op:"ListBlueprints",method:"GET",path:"/journeys/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listPersonRuns(t){return e.send({op:"ListPersonRuns",method:"GET",path:"/journeys/people/"+c("ListPersonRuns","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async simulateJourney(t){return e.send({op:"SimulateJourney",method:"POST",path:"/journeys/simulate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStoreBlueprints(t){return e.send({op:"ListStoreBlueprints",method:"GET",path:"/journeys/stores/"+c("ListStoreBlueprints","store_id",t.path.store_id)+"/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async activateStoreBlueprint(t){return e.send({op:"ActivateStoreBlueprint",method:"POST",path:"/journeys/stores/"+c("ActivateStoreBlueprint","store_id",t.path.store_id)+"/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteStoreBlueprint(t){return e.send({op:"DeleteStoreBlueprint",method:"DELETE",path:"/journeys/stores/"+c("DeleteStoreBlueprint","store_id",t.path.store_id)+"/blueprints/"+c("DeleteStoreBlueprint","key",t.path.key),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async validateJourney(t){return e.send({op:"ValidateJourney",method:"POST",path:"/journeys/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getJourney(t){return e.send({op:"GetJourney",method:"GET",path:"/journeys/"+c("GetJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateJourney(t){return e.send({op:"UpdateJourney",method:"PUT",path:"/journeys/"+c("UpdateJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteJourney(t){return e.send({op:"DeleteJourney",method:"DELETE",path:"/journeys/"+c("DeleteJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async copyJourney(t){return e.send({op:"CopyJourney",method:"POST",path:"/journeys/"+c("CopyJourney","key",t.path.key)+"/copy",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async publishJourney(t){return e.send({op:"PublishJourney",method:"POST",path:"/journeys/"+c("PublishJourney","key",t.path.key)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listJourneyRuns(t){return e.send({op:"ListJourneyRuns",method:"GET",path:"/journeys/"+c("ListJourneyRuns","key",t.path.key)+"/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getJourneyStats(t){return e.send({op:"GetJourneyStats",method:"GET",path:"/journeys/"+c("GetJourneyStats","key",t.path.key)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async stopJourney(t){return e.send({op:"StopJourney",method:"POST",path:"/journeys/"+c("StopJourney","key",t.path.key)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async testJourney(t){return e.send({op:"TestJourney",method:"POST",path:"/journeys/"+c("TestJourney","key",t.path.key)+"/test",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Io={};wt(Io,{client:()=>t$});function t$(e){return{async listMachines(t){return e.send({op:"ListMachines",method:"GET",path:"/machines",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createMachine(t){return e.send({op:"CreateMachine",method:"POST",path:"/machines",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachineSizes(t){return e.send({op:"ListMachineSizes",method:"GET",path:"/machines/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getMachineNetwork(t){return e.send({op:"GetMachineNetwork",method:"GET",path:"/machines/network",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGitHub(t){return e.send({op:"ConnectGitHub",method:"POST",path:"/machines/github/connect",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listInstallations(t){return e.send({op:"ListInstallations",method:"GET",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async linkInstallation(t){return e.send({op:"LinkInstallation",method:"POST",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async shareInstallation(t){return e.send({op:"ShareInstallation",method:"POST",path:"/machines/github/installations/share",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async unlinkInstallation(t){return e.send({op:"UnlinkInstallation",method:"DELETE",path:"/machines/github/installations/"+c("UnlinkInstallation","installation",t.path.installation),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listRepositories(t){return e.send({op:"ListRepositories",method:"GET",path:"/machines/github/repositories",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getMachine(t){return e.send({op:"GetMachine",method:"GET",path:"/machines/"+c("GetMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMachine(t){return e.send({op:"DeleteMachine",method:"DELETE",path:"/machines/"+c("DeleteMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateMachine(t){return e.send({op:"UpdateMachine",method:"PATCH",path:"/machines/"+c("UpdateMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBuilds(t){return e.send({op:"ListBuilds",method:"GET",path:"/machines/"+c("ListBuilds","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async deployMachine(t){return e.send({op:"DeployMachine",method:"POST",path:"/machines/"+c("DeployMachine","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachinePreviews(t){return e.send({op:"ListMachinePreviews",method:"GET",path:"/machines/"+c("ListMachinePreviews","name",t.path.name)+"/previews",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putMachinePreview(t){return e.send({op:"PutMachinePreview",method:"PUT",path:"/machines/"+c("PutMachinePreview","name",t.path.name)+"/previews/"+c("PutMachinePreview","pull_request",t.path.pull_request),auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachinePreview(t){return e.send({op:"DeleteMachinePreview",method:"DELETE",path:"/machines/"+c("DeleteMachinePreview","name",t.path.name)+"/previews/"+c("DeleteMachinePreview","pull_request",t.path.pull_request),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listMachineDomains(t){return e.send({op:"ListMachineDomains",method:"GET",path:"/machines/"+c("ListMachineDomains","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addMachineDomain(t){return e.send({op:"AddMachineDomain",method:"POST",path:"/machines/"+c("AddMachineDomain","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachineDomain(t){return e.send({op:"DeleteMachineDomain",method:"DELETE",path:"/machines/"+c("DeleteMachineDomain","name",t.path.name)+"/domains/"+c("DeleteMachineDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateMachineDomain(t){return e.send({op:"UpdateMachineDomain",method:"PATCH",path:"/machines/"+c("UpdateMachineDomain","name",t.path.name)+"/domains/"+c("UpdateMachineDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getBuild(t){return e.send({op:"GetBuild",method:"GET",path:"/machines/"+c("GetBuild","name",t.path.name)+"/builds/"+c("GetBuild","build",t.path.build),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getBuildLog(t){return e.send({op:"GetBuildLog",method:"GET",path:"/machines/"+c("GetBuildLog","name",t.path.name)+"/builds/"+c("GetBuildLog","build",t.path.build)+"/log",auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async rollbackMachine(t){return e.send({op:"RollbackMachine",method:"POST",path:"/machines/"+c("RollbackMachine","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDatabases(t){return e.send({op:"ListDatabases",method:"GET",path:"/databases",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createDatabase(t){return e.send({op:"CreateDatabase",method:"POST",path:"/databases",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDatabaseSizes(t){return e.send({op:"ListDatabaseSizes",method:"GET",path:"/databases/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getDatabase(t){return e.send({op:"GetDatabase",method:"GET",path:"/databases/"+c("GetDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteDatabase(t){return e.send({op:"DeleteDatabase",method:"DELETE",path:"/databases/"+c("DeleteDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateDatabase(t){return e.send({op:"UpdateDatabase",method:"PATCH",path:"/databases/"+c("UpdateDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async undeleteDatabase(t){return e.send({op:"UndeleteDatabase",method:"POST",path:"/databases/"+c("UndeleteDatabase","name",t.path.name)+"/undelete",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async purgeDatabase(t){return e.send({op:"PurgeDatabase",method:"POST",path:"/databases/"+c("PurgeDatabase","name",t.path.name)+"/purge",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getDatabaseCredentials(t){return e.send({op:"GetDatabaseCredentials",method:"GET",path:"/databases/"+c("GetDatabaseCredentials","name",t.path.name)+"/credentials",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async changeDatabasePassword(t){return e.send({op:"ChangeDatabasePassword",method:"POST",path:"/databases/"+c("ChangeDatabasePassword","name",t.path.name)+"/password",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async readMachineLogs(t){return e.send({op:"ReadMachineLogs",method:"GET",path:"/machines/"+c("ReadMachineLogs","name",t.path.name)+"/logs",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async execInMachine(t){return e.send({op:"ExecInMachine",method:"POST",path:"/machines/"+c("ExecInMachine","name",t.path.name)+"/exec",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachineExecs(t){return e.send({op:"ListMachineExecs",method:"GET",path:"/machines/"+c("ListMachineExecs","name",t.path.name)+"/execs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMachineMetrics(t){return e.send({op:"GetMachineMetrics",method:"GET",path:"/machines/"+c("GetMachineMetrics","name",t.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMachineContract(t){return e.send({op:"GetMachineContract",method:"GET",path:"/machines/"+c("GetMachineContract","name",t.path.name)+"/openapi",auth:[["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t.headers,signal:t.signal})},async restoreDatabase(t){return e.send({op:"RestoreDatabase",method:"POST",path:"/databases/"+c("RestoreDatabase","name",t.path.name)+"/restore",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDatabaseSchema(t){return e.send({op:"GetDatabaseSchema",method:"GET",path:"/databases/"+c("GetDatabaseSchema","name",t.path.name)+"/schema",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getDatabaseMetrics(t){return e.send({op:"GetDatabaseMetrics",method:"GET",path:"/databases/"+c("GetDatabaseMetrics","name",t.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async queryDatabase(t){return e.send({op:"QueryDatabase",method:"POST",path:"/databases/"+c("QueryDatabase","name",t.path.name)+"/sql",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCrons(t){return e.send({op:"ListCrons",method:"GET",path:"/machines/"+c("ListCrons","name",t.path.name)+"/crons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCronRuns(t){return e.send({op:"ListCronRuns",method:"GET",path:"/machines/"+c("ListCronRuns","name",t.path.name)+"/crons/"+c("ListCronRuns","cron",t.path.cron)+"/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async runCron(t){return e.send({op:"RunCron",method:"POST",path:"/machines/"+c("RunCron","name",t.path.name)+"/crons/"+c("RunCron","cron",t.path.cron)+"/run",auth:[["SecretKeyAuth"]],answers:{201:"json"},signal:t.signal})},async pauseCron(t){return e.send({op:"PauseCron",method:"POST",path:"/machines/"+c("PauseCron","name",t.path.name)+"/crons/"+c("PauseCron","cron",t.path.cron)+"/pause",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async resumeCron(t){return e.send({op:"ResumeCron",method:"POST",path:"/machines/"+c("ResumeCron","name",t.path.name)+"/crons/"+c("ResumeCron","cron",t.path.cron)+"/resume",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTasks(t){return e.send({op:"ListTasks",method:"GET",path:"/machines/"+c("ListTasks","name",t.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async enqueueTask(t){return e.send({op:"EnqueueTask",method:"POST",path:"/machines/"+c("EnqueueTask","name",t.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTask(t){return e.send({op:"GetTask",method:"GET",path:"/machines/"+c("GetTask","name",t.path.name)+"/tasks/"+c("GetTask","task",t.path.task),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelTask(t){return e.send({op:"CancelTask",method:"POST",path:"/machines/"+c("CancelTask","name",t.path.name)+"/tasks/"+c("CancelTask","task",t.path.task)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async retryTask(t){return e.send({op:"RetryTask",method:"POST",path:"/machines/"+c("RetryTask","name",t.path.name)+"/tasks/"+c("RetryTask","task",t.path.task)+"/retry",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTaskTypes(t){return e.send({op:"ListTaskTypes",method:"GET",path:"/machines/"+c("ListTaskTypes","name",t.path.name)+"/task-types",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async makeTemplatedTestUsers(t){return e.send({op:"MakeTemplatedTestUsers",method:"POST",path:"/machines/"+c("MakeTemplatedTestUsers","name",t.path.name)+"/test-users",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async templateTestUser(t){return e.send({op:"TemplateTestUser",method:"POST",path:"/machines/"+c("TemplateTestUser","name",t.path.name)+"/test-users/"+c("TemplateTestUser","user",t.path.user)+"/templates/"+c("TemplateTestUser","template",t.path.template),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteTemplatedTestUser(t){return e.send({op:"DeleteTemplatedTestUser",method:"DELETE",path:"/machines/"+c("DeleteTemplatedTestUser","name",t.path.name)+"/test-users/"+c("DeleteTemplatedTestUser","user",t.path.user),auth:[["SecretKeyAuth"]],answers:{200:"json",204:"empty"},headers:t.headers,signal:t.signal})},async listSites(t){return e.send({op:"ListSites",method:"GET",path:"/sites",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createSite(t){return e.send({op:"CreateSite",method:"POST",path:"/sites",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSite(t){return e.send({op:"GetSite",method:"GET",path:"/sites/"+c("GetSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteSite(t){return e.send({op:"DeleteSite",method:"DELETE",path:"/sites/"+c("DeleteSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateSite(t){return e.send({op:"UpdateSite",method:"PATCH",path:"/sites/"+c("UpdateSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSiteReleases(t){return e.send({op:"ListSiteReleases",method:"GET",path:"/sites/"+c("ListSiteReleases","name",t.path.name)+"/releases",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSiteRelease(t){return e.send({op:"CreateSiteRelease",method:"POST",path:"/sites/"+c("CreateSiteRelease","name",t.path.name)+"/releases",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async uploadSiteFile(t){return e.send({op:"UploadSiteFile",method:"PUT",path:"/sites/"+c("UploadSiteFile","name",t.path.name)+"/releases/"+c("UploadSiteFile","release",t.path.release)+"/files/"+c("UploadSiteFile","digest",t.path.digest),auth:[["SecretKeyAuth"]],answers:{204:"empty"},body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async finishSiteRelease(t){return e.send({op:"FinishSiteRelease",method:"POST",path:"/sites/"+c("FinishSiteRelease","name",t.path.name)+"/releases/"+c("FinishSiteRelease","release",t.path.release)+"/finish",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async rollbackSite(t){return e.send({op:"RollbackSite",method:"POST",path:"/sites/"+c("RollbackSite","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSiteBuilds(t){return e.send({op:"ListSiteBuilds",method:"GET",path:"/sites/"+c("ListSiteBuilds","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deploySite(t){return e.send({op:"DeploySite",method:"POST",path:"/sites/"+c("DeploySite","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:t.signal})},async listSitePreviews(t){return e.send({op:"ListSitePreviews",method:"GET",path:"/sites/"+c("ListSitePreviews","name",t.path.name)+"/previews",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSiteDomains(t){return e.send({op:"ListSiteDomains",method:"GET",path:"/sites/"+c("ListSiteDomains","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addSiteDomain(t){return e.send({op:"AddSiteDomain",method:"POST",path:"/sites/"+c("AddSiteDomain","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSiteDomain(t){return e.send({op:"DeleteSiteDomain",method:"DELETE",path:"/sites/"+c("DeleteSiteDomain","name",t.path.name)+"/domains/"+c("DeleteSiteDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateSiteDomain(t){return e.send({op:"UpdateSiteDomain",method:"PATCH",path:"/sites/"+c("UpdateSiteDomain","name",t.path.name)+"/domains/"+c("UpdateSiteDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSiteBuild(t){return e.send({op:"GetSiteBuild",method:"GET",path:"/sites/"+c("GetSiteBuild","name",t.path.name)+"/builds/"+c("GetSiteBuild","build",t.path.build),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async authorizeSitePreview(t){return e.send({op:"AuthorizeSitePreview",method:"POST",path:"/sites/"+c("AuthorizeSitePreview","name",t.path.name)+"/previews/"+c("AuthorizeSitePreview","pull_request",t.path.pull_request)+"/authorize",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async authorizeMachinePreview(t){return e.send({op:"AuthorizeMachinePreview",method:"POST",path:"/machines/"+c("AuthorizeMachinePreview","name",t.path.name)+"/previews/"+c("AuthorizeMachinePreview","pull_request",t.path.pull_request)+"/authorize",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async openMachinePreview(t){return e.send({op:"OpenMachinePreview",method:"POST",path:"/machines/"+c("OpenMachinePreview","name",t.path.name)+"/previews/"+c("OpenMachinePreview","pull_request",t.path.pull_request)+"/open",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:t.signal})},async moveMachine(t){return e.send({op:"MoveMachine",method:"POST",path:"/machines/"+c("MoveMachine","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveSite(t){return e.send({op:"MoveSite",method:"POST",path:"/sites/"+c("MoveSite","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveDatabase(t){return e.send({op:"MoveDatabase",method:"POST",path:"/databases/"+c("MoveDatabase","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSiteBuild(t){return e.send({op:"CancelSiteBuild",method:"POST",path:"/sites/"+c("CancelSiteBuild","name",t.path.name)+"/builds/"+c("CancelSiteBuild","build",t.path.build)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelBuild(t){return e.send({op:"CancelBuild",method:"POST",path:"/machines/"+c("CancelBuild","name",t.path.name)+"/builds/"+c("CancelBuild","build",t.path.build)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSiteHooks(t){return e.send({op:"ListSiteHooks",method:"GET",path:"/sites/"+c("ListSiteHooks","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSiteHook(t){return e.send({op:"CreateSiteHook",method:"POST",path:"/sites/"+c("CreateSiteHook","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSiteHook(t){return e.send({op:"DeleteSiteHook",method:"DELETE",path:"/sites/"+c("DeleteSiteHook","name",t.path.name)+"/hooks/"+c("DeleteSiteHook","hook",t.path.hook),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listMachineHooks(t){return e.send({op:"ListMachineHooks",method:"GET",path:"/machines/"+c("ListMachineHooks","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createMachineHook(t){return e.send({op:"CreateMachineHook",method:"POST",path:"/machines/"+c("CreateMachineHook","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachineHook(t){return e.send({op:"DeleteMachineHook",method:"DELETE",path:"/machines/"+c("DeleteMachineHook","name",t.path.name)+"/hooks/"+c("DeleteMachineHook","hook",t.path.hook),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async detectProject(t){return e.send({op:"DetectProject",method:"GET",path:"/machines/github/detect",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createPreviewPass(t){return e.send({op:"CreatePreviewPass",method:"POST",path:"/sites/"+c("CreatePreviewPass","name",t.path.name)+"/previews/pass",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPreviewLinks(t){return e.send({op:"ListPreviewLinks",method:"GET",path:"/sites/"+c("ListPreviewLinks","name",t.path.name)+"/previews/links",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPreviewLink(t){return e.send({op:"CreatePreviewLink",method:"POST",path:"/sites/"+c("CreatePreviewLink","name",t.path.name)+"/previews/links",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePreviewLink(t){return e.send({op:"DeletePreviewLink",method:"DELETE",path:"/sites/"+c("DeletePreviewLink","name",t.path.name)+"/previews/links/"+c("DeletePreviewLink","link",t.path.link),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnvironmentDomains(t){return e.send({op:"ListEnvironmentDomains",method:"GET",path:"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async addEnvironmentDomain(t){return e.send({op:"AddEnvironmentDomain",method:"POST",path:"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnvironmentDomain(t){return e.send({op:"DeleteEnvironmentDomain",method:"DELETE",path:"/domains/"+c("DeleteEnvironmentDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async setEnvironmentSignInDomain(t){return e.send({op:"SetEnvironmentSignInDomain",method:"PATCH",path:"/domains/"+c("SetEnvironmentSignInDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var ir={};wt(ir,{client:()=>n$});function n$(e){return{async adminAccessLog(t){return e.send({op:"AdminAccessLog",method:"GET",path:"/messaging/admin/access-log",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminListConversations(t){return e.send({op:"AdminListConversations",method:"GET",path:"/messaging/admin/conversations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminCreateConversation(t){return e.send({op:"AdminCreateConversation",method:"POST",path:"/messaging/admin/conversations",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetConversation(t){return e.send({op:"AdminGetConversation",method:"GET",path:"/messaging/admin/conversations/"+c("AdminGetConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteConversation(t){return e.send({op:"AdminDeleteConversation",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminDeleteConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateConversation(t){return e.send({op:"AdminUpdateConversation",method:"PATCH",path:"/messaging/admin/conversations/"+c("AdminUpdateConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminAddMembers(t){return e.send({op:"AdminAddMembers",method:"POST",path:"/messaging/admin/conversations/"+c("AdminAddMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminRemoveMember(t){return e.send({op:"AdminRemoveMember",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminRemoveMember","conversation_id",t.path.conversation_id)+"/members/"+c("AdminRemoveMember","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListMessages(t){return e.send({op:"AdminListMessages",method:"GET",path:"/messaging/admin/conversations/"+c("AdminListMessages","conversation_id",t.path.conversation_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminSendMessage(t){return e.send({op:"AdminSendMessage",method:"POST",path:"/messaging/admin/conversations/"+c("AdminSendMessage","conversation_id",t.path.conversation_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteMessage(t){return e.send({op:"AdminDeleteMessage",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminDeleteMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("AdminDeleteMessage","message_id",t.path.message_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminFileUrl(t){return e.send({op:"AdminFileURL",method:"GET",path:"/messaging/admin/conversations/"+c("AdminFileURL","conversation_id",t.path.conversation_id)+"/messages/"+c("AdminFileURL","message_id",t.path.message_id)+"/attachments/"+c("AdminFileURL","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminPutProfile(t){return e.send({op:"AdminPutProfile",method:"PUT",path:"/messaging/admin/profiles/"+c("AdminPutProfile","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListReports(t){return e.send({op:"AdminListReports",method:"GET",path:"/messaging/admin/reports",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminGetReport(t){return e.send({op:"AdminGetReport",method:"GET",path:"/messaging/admin/reports/"+c("AdminGetReport","report_id",t.path.report_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminReportFileUrl(t){return e.send({op:"AdminReportFileURL",method:"GET",path:"/messaging/admin/reports/"+c("AdminReportFileURL","report_id",t.path.report_id)+"/attachments/"+c("AdminReportFileURL","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminResolveReport(t){return e.send({op:"AdminResolveReport",method:"POST",path:"/messaging/admin/reports/"+c("AdminResolveReport","report_id",t.path.report_id)+"/resolve",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBlocks(t){return e.send({op:"ListBlocks",method:"GET",path:"/messaging/blocks",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async block(t){return e.send({op:"Block",method:"PUT",path:"/messaging/blocks/"+c("Block","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unblock(t){return e.send({op:"Unblock",method:"DELETE",path:"/messaging/blocks/"+c("Unblock","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async listConversations(t){return e.send({op:"ListConversations",method:"GET",path:"/messaging/conversations",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async openDirectConversation(t){return e.send({op:"OpenDirectConversation",method:"POST",path:"/messaging/conversations/direct",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createGroup(t){return e.send({op:"CreateGroup",method:"POST",path:"/messaging/conversations/group",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getConversation(t){return e.send({op:"GetConversation",method:"GET",path:"/messaging/conversations/"+c("GetConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deleteConversation(t){return e.send({op:"DeleteConversation",method:"DELETE",path:"/messaging/conversations/"+c("DeleteConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateConversation(t){return e.send({op:"UpdateConversation",method:"PATCH",path:"/messaging/conversations/"+c("UpdateConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearConversation(t){return e.send({op:"ClearConversation",method:"POST",path:"/messaging/conversations/"+c("ClearConversation","conversation_id",t.path.conversation_id)+"/clear",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async closeConversation(t){return e.send({op:"CloseConversation",method:"POST",path:"/messaging/conversations/"+c("CloseConversation","conversation_id",t.path.conversation_id)+"/close",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async joinGroup(t){return e.send({op:"JoinGroup",method:"POST",path:"/messaging/conversations/"+c("JoinGroup","conversation_id",t.path.conversation_id)+"/join",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listMembers(t){return e.send({op:"ListMembers",method:"GET",path:"/messaging/conversations/"+c("ListMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async addMembers(t){return e.send({op:"AddMembers",method:"POST",path:"/messaging/conversations/"+c("AddMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeMember(t){return e.send({op:"RemoveMember",method:"DELETE",path:"/messaging/conversations/"+c("RemoveMember","conversation_id",t.path.conversation_id)+"/members/"+c("RemoveMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateMember(t){return e.send({op:"UpdateMember",method:"PATCH",path:"/messaging/conversations/"+c("UpdateMember","conversation_id",t.path.conversation_id)+"/members/"+c("UpdateMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMessages(t){return e.send({op:"ListMessages",method:"GET",path:"/messaging/conversations/"+c("ListMessages","conversation_id",t.path.conversation_id)+"/messages",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sendMessage(t){return e.send({op:"SendMessage",method:"POST",path:"/messaging/conversations/"+c("SendMessage","conversation_id",t.path.conversation_id)+"/messages",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMessage(t){return e.send({op:"GetMessage",method:"GET",path:"/messaging/conversations/"+c("GetMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("GetMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deleteMessage(t){return e.send({op:"DeleteMessage",method:"DELETE",path:"/messaging/conversations/"+c("DeleteMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("DeleteMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",204:"empty"},query:t.query,signal:t.signal})},async editMessage(t){return e.send({op:"EditMessage",method:"PATCH",path:"/messaging/conversations/"+c("EditMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("EditMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attachmentUrl(t){return e.send({op:"AttachmentURL",method:"GET",path:"/messaging/conversations/"+c("AttachmentURL","conversation_id",t.path.conversation_id)+"/messages/"+c("AttachmentURL","message_id",t.path.message_id)+"/attachments/"+c("AttachmentURL","attachment_id",t.path.attachment_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async react(t){return e.send({op:"React",method:"PUT",path:"/messaging/conversations/"+c("React","conversation_id",t.path.conversation_id)+"/messages/"+c("React","message_id",t.path.message_id)+"/reactions/"+c("React","emoji",t.path.emoji),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async unreact(t){return e.send({op:"Unreact",method:"DELETE",path:"/messaging/conversations/"+c("Unreact","conversation_id",t.path.conversation_id)+"/messages/"+c("Unreact","message_id",t.path.message_id)+"/reactions/"+c("Unreact","emoji",t.path.emoji),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async messageReaders(t){return e.send({op:"MessageReaders",method:"GET",path:"/messaging/conversations/"+c("MessageReaders","conversation_id",t.path.conversation_id)+"/messages/"+c("MessageReaders","message_id",t.path.message_id)+"/readers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listReplies(t){return e.send({op:"ListReplies",method:"GET",path:"/messaging/conversations/"+c("ListReplies","conversation_id",t.path.conversation_id)+"/messages/"+c("ListReplies","message_id",t.path.message_id)+"/replies",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async viewOnce(t){return e.send({op:"ViewOnce",method:"POST",path:"/messaging/conversations/"+c("ViewOnce","conversation_id",t.path.conversation_id)+"/messages/"+c("ViewOnce","message_id",t.path.message_id)+"/view",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async setConversationNotifications(t){return e.send({op:"SetConversationNotifications",method:"PUT",path:"/messaging/conversations/"+c("SetConversationNotifications","conversation_id",t.path.conversation_id)+"/notifications",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reportScreenshot(t){return e.send({op:"ReportScreenshot",method:"POST",path:"/messaging/conversations/"+c("ReportScreenshot","conversation_id",t.path.conversation_id)+"/screenshot",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async typing(t){return e.send({op:"Typing",method:"POST",path:"/messaging/conversations/"+c("Typing","conversation_id",t.path.conversation_id)+"/typing",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createUpload(t){return e.send({op:"CreateUpload",method:"POST",path:"/messaging/conversations/"+c("CreateUpload","conversation_id",t.path.conversation_id)+"/uploads",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOpenGroups(t){return e.send({op:"ListOpenGroups",method:"GET",path:"/messaging/groups/open",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMyProfile(t){return e.send({op:"GetMyProfile",method:"GET",path:"/messaging/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMyProfile(t){return e.send({op:"UpdateMyProfile",method:"PATCH",path:"/messaging/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async presence(t){return e.send({op:"Presence",method:"POST",path:"/messaging/me/presence",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t?.signal})},async getProfiles(t){return e.send({op:"GetProfiles",method:"GET",path:"/messaging/profiles",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async receipts(t){return e.send({op:"Receipts",method:"POST",path:"/messaging/receipts",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async report(t){return e.send({op:"Report",method:"POST",path:"/messaging/reports",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listScheduled(t){return e.send({op:"ListScheduled",method:"GET",path:"/messaging/scheduled",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async cancelScheduled(t){return e.send({op:"CancelScheduled",method:"DELETE",path:"/messaging/scheduled/"+c("CancelScheduled","scheduled_id",t.path.scheduled_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateScheduled(t){return e.send({op:"UpdateScheduled",method:"PATCH",path:"/messaging/scheduled/"+c("UpdateScheduled","scheduled_id",t.path.scheduled_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async searchMessages(t){return e.send({op:"SearchMessages",method:"GET",path:"/messaging/search",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/messaging/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/messaging/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateHookSecret(t){return e.send({op:"RotateHookSecret",method:"POST",path:"/messaging/settings/hook-secret",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async sync(t){return e.send({op:"Sync",method:"GET",path:"/messaging/sync",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listThreads(t){return e.send({op:"ListThreads",method:"GET",path:"/messaging/threads",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var No={};wt(No,{client:()=>s$});function s$(e){return{async getDeliverability(t){return e.send({op:"GetDeliverability",method:"GET",path:"/notify/deliverability",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/notify/devices",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async registerDevice(t){return e.send({op:"RegisterDevice",method:"POST",path:"/notify/devices",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDeviceStats(t){return e.send({op:"GetDeviceStats",method:"GET",path:"/notify/devices/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async deleteMyDevice(t){return e.send({op:"DeleteMyDevice",method:"DELETE",path:"/notify/devices/"+c("DeleteMyDevice","device_id",t.path.device_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async sendEmail(t){return e.send({op:"SendEmail",method:"POST",path:"/notify/email",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInAppCampaigns(t){return e.send({op:"ListInAppCampaigns",method:"GET",path:"/notify/in-app/campaigns",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createInAppCampaign(t){return e.send({op:"CreateInAppCampaign",method:"POST",path:"/notify/in-app/campaigns",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getInAppCampaign(t){return e.send({op:"GetInAppCampaign",method:"GET",path:"/notify/in-app/campaigns/"+c("GetInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putInAppCampaign(t){return e.send({op:"PutInAppCampaign",method:"PUT",path:"/notify/in-app/campaigns/"+c("PutInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteInAppCampaign(t){return e.send({op:"DeleteInAppCampaign",method:"DELETE",path:"/notify/in-app/campaigns/"+c("DeleteInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getInAppCampaignStats(t){return e.send({op:"GetInAppCampaignStats",method:"GET",path:"/notify/in-app/campaigns/"+c("GetInAppCampaignStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async showInAppMessage(t){return e.send({op:"ShowInAppMessage",method:"POST",path:"/notify/in-app/impressions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reportInAppEvent(t){return e.send({op:"ReportInAppEvent",method:"POST",path:"/notify/in-app/impressions/"+c("ReportInAppEvent","id",t.path.id)+"/events",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,query:t.query,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyInAppMessages(t){return e.send({op:"ListMyInAppMessages",method:"GET",path:"/notify/in-app/messages",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listInAppTemplates(t){return e.send({op:"ListInAppTemplates",method:"GET",path:"/notify/in-app/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listMyInbox(t){return e.send({op:"ListMyInbox",method:"GET",path:"/notify/inbox",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async sendInbox(t){return e.send({op:"SendInbox",method:"POST",path:"/notify/inbox",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInboxMessages(t){return e.send({op:"ListInboxMessages",method:"GET",path:"/notify/inbox/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async readMyInbox(t){return e.send({op:"ReadMyInbox",method:"POST",path:"/notify/inbox/read",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMyInboxMessage(t){return e.send({op:"DeleteMyInboxMessage",method:"DELETE",path:"/notify/inbox/"+c("DeleteMyInboxMessage","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listNotifyMessages(t){return e.send({op:"ListNotifyMessages",method:"GET",path:"/notify/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getNotifyMessage(t){return e.send({op:"GetNotifyMessage",method:"GET",path:"/notify/messages/"+c("GetNotifyMessage","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelMessage(t){return e.send({op:"CancelMessage",method:"POST",path:"/notify/messages/"+c("CancelMessage","id",t.path.id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getMetricsSummary(t){return e.send({op:"GetMetricsSummary",method:"GET",path:"/notify/metrics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMyPreferences(t){return e.send({op:"GetMyPreferences",method:"GET",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async setMyPreferences(t){return e.send({op:"SetMyPreferences",method:"PUT",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listNotifyProviders(t){return e.send({op:"ListNotifyProviders",method:"GET",path:"/notify/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putNotifyProvider(t){return e.send({op:"PutNotifyProvider",method:"PUT",path:"/notify/providers/"+c("PutNotifyProvider","channel",t.path.channel)+"/"+c("PutNotifyProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteNotifyProvider(t){return e.send({op:"DeleteNotifyProvider",method:"DELETE",path:"/notify/providers/"+c("DeleteNotifyProvider","channel",t.path.channel)+"/"+c("DeleteNotifyProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async sendPush(t){return e.send({op:"SendPush",method:"POST",path:"/notify/push",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordPushReceipts(t){return e.send({op:"RecordPushReceipts",method:"POST",path:"/notify/receipts",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getNotifySettings(t){return e.send({op:"GetNotifySettings",method:"GET",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putNotifySettings(t){return e.send({op:"PutNotifySettings",method:"PUT",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendSms(t){return e.send({op:"SendSMS",method:"POST",path:"/notify/sms",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEmailTemplates(t){return e.send({op:"ListEmailTemplates",method:"GET",path:"/notify/templates/email",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getEmailTemplate(t){return e.send({op:"GetEmailTemplate",method:"GET",path:"/notify/templates/email/"+c("GetEmailTemplate","slug",t.path.slug)+"/"+c("GetEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEmailTemplate(t){return e.send({op:"PutEmailTemplate",method:"PUT",path:"/notify/templates/email/"+c("PutEmailTemplate","slug",t.path.slug)+"/"+c("PutEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEmailTemplate(t){return e.send({op:"DeleteEmailTemplate",method:"DELETE",path:"/notify/templates/email/"+c("DeleteEmailTemplate","slug",t.path.slug)+"/"+c("DeleteEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPushTemplates(t){return e.send({op:"ListPushTemplates",method:"GET",path:"/notify/templates/push",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPushTemplate(t){return e.send({op:"GetPushTemplate",method:"GET",path:"/notify/templates/push/"+c("GetPushTemplate","slug",t.path.slug)+"/"+c("GetPushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putPushTemplate(t){return e.send({op:"PutPushTemplate",method:"PUT",path:"/notify/templates/push/"+c("PutPushTemplate","slug",t.path.slug)+"/"+c("PutPushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePushTemplate(t){return e.send({op:"DeletePushTemplate",method:"DELETE",path:"/notify/templates/push/"+c("DeletePushTemplate","slug",t.path.slug)+"/"+c("DeletePushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listSmsTemplates(t){return e.send({op:"ListSMSTemplates",method:"GET",path:"/notify/templates/sms",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getSmsTemplate(t){return e.send({op:"GetSMSTemplate",method:"GET",path:"/notify/templates/sms/"+c("GetSMSTemplate","slug",t.path.slug)+"/"+c("GetSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putSmsTemplate(t){return e.send({op:"PutSMSTemplate",method:"PUT",path:"/notify/templates/sms/"+c("PutSMSTemplate","slug",t.path.slug)+"/"+c("PutSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSmsTemplate(t){return e.send({op:"DeleteSMSTemplate",method:"DELETE",path:"/notify/templates/sms/"+c("DeleteSMSTemplate","slug",t.path.slug)+"/"+c("DeleteSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listWhatsAppTemplates(t){return e.send({op:"ListWhatsAppTemplates",method:"GET",path:"/notify/templates/whatsapp",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getWhatsAppTemplate(t){return e.send({op:"GetWhatsAppTemplate",method:"GET",path:"/notify/templates/whatsapp/"+c("GetWhatsAppTemplate","slug",t.path.slug)+"/"+c("GetWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putWhatsAppTemplate(t){return e.send({op:"PutWhatsAppTemplate",method:"PUT",path:"/notify/templates/whatsapp/"+c("PutWhatsAppTemplate","slug",t.path.slug)+"/"+c("PutWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteWhatsAppTemplate(t){return e.send({op:"DeleteWhatsAppTemplate",method:"DELETE",path:"/notify/templates/whatsapp/"+c("DeleteWhatsAppTemplate","slug",t.path.slug)+"/"+c("DeleteWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listTestUserMessages(t){return e.send({op:"ListTestUserMessages",method:"GET",path:"/notify/test-users/"+c("ListTestUserMessages","user_id",t.path.user_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listTopics(t){return e.send({op:"ListTopics",method:"GET",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createTopic(t){return e.send({op:"CreateTopic",method:"POST",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTopic(t){return e.send({op:"DeleteTopic",method:"DELETE",path:"/notify/topics/"+c("DeleteTopic","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async changeTopic(t){return e.send({op:"ChangeTopic",method:"PATCH",path:"/notify/topics/"+c("ChangeTopic","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addTopicSubscribers(t){return e.send({op:"AddTopicSubscribers",method:"POST",path:"/notify/topics/"+c("AddTopicSubscribers","name",t.path.name)+"/subscribers",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeTopicSubscriber(t){return e.send({op:"RemoveTopicSubscriber",method:"DELETE",path:"/notify/topics/"+c("RemoveTopicSubscriber","name",t.path.name)+"/subscribers/"+c("RemoveTopicSubscriber","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async followTopic(t){return e.send({op:"FollowTopic",method:"POST",path:"/notify/topics/"+c("FollowTopic","name",t.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async unfollowTopic(t){return e.send({op:"UnfollowTopic",method:"DELETE",path:"/notify/topics/"+c("UnfollowTopic","name",t.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listUserDevices(t){return e.send({op:"ListUserDevices",method:"GET",path:"/notify/users/"+c("ListUserDevices","user_id",t.path.user_id)+"/devices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getUserPreferences(t){return e.send({op:"GetUserPreferences",method:"GET",path:"/notify/users/"+c("GetUserPreferences","user_id",t.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setUserPreferences(t){return e.send({op:"SetUserPreferences",method:"PUT",path:"/notify/users/"+c("SetUserPreferences","user_id",t.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async startVerification(t){return e.send({op:"StartVerification",method:"POST",path:"/notify/verifications",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async checkVerification(t){return e.send({op:"CheckVerification",method:"POST",path:"/notify/verifications/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveSendGridEvents(t){return e.send({op:"ReceiveSendGridEvents",method:"POST",path:"/notify/webhooks/email/sendgrid",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveTwilioStatus(t){return e.send({op:"ReceiveTwilioStatus",method:"POST",path:"/notify/webhooks/sms/twilio",auth:[],answers:{204:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async receiveTwilioText(t){return e.send({op:"ReceiveTwilioText",method:"POST",path:"/notify/webhooks/sms/twilio/inbound",auth:[],answers:{204:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async receiveVonageReceiptQuery(t){return e.send({op:"ReceiveVonageReceiptQuery",method:"GET",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},query:t?.query,signal:t?.signal})},async receiveVonageReceipt(t){return e.send({op:"ReceiveVonageReceipt",method:"POST",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async subscribeMetaWebhook(t){return e.send({op:"SubscribeMetaWebhook",method:"GET",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async receiveMetaNotification(t){return e.send({op:"ReceiveMetaNotification",method:"POST",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWebPushStatus(t){return e.send({op:"GetWebPushStatus",method:"GET",path:"/notify/webpush",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getWebPushKey(t){return e.send({op:"GetWebPushKey",method:"GET",path:"/notify/webpush/key",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async sendWhatsApp(t){return e.send({op:"SendWhatsApp",method:"POST",path:"/notify/whatsapp",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWhatsAppInbound(t){return e.send({op:"ListWhatsAppInbound",method:"GET",path:"/notify/whatsapp/inbound",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var Mo={};wt(Mo,{client:()=>a$});function a$(e){return{async auditCashFlow(t){return e.send({op:"AuditCashFlow",method:"GET",path:"/payments/audit/cashflow",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async auditDrift(t){return e.send({op:"AuditDrift",method:"GET",path:"/payments/audit/drift",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async auditLedger(t){return e.send({op:"AuditLedger",method:"GET",path:"/payments/audit/ledger",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async exportAuditLedgerCsv(t){return e.send({op:"ExportAuditLedgerCSV",method:"GET",path:"/payments/audit/ledger/export",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async providerCallbackGet(t){return e.send({op:"ProviderCallbackGet",method:"GET",path:"/payments/callback/"+c("ProviderCallbackGet","provider",t.path.provider)+"/"+c("ProviderCallbackGet","attempt_id",t.path.attempt_id),auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async providerCallbackPost(t){return e.send({op:"ProviderCallbackPost",method:"POST",path:"/payments/callback/"+c("ProviderCallbackPost","provider",t.path.provider)+"/"+c("ProviderCallbackPost","attempt_id",t.path.attempt_id),auth:[],answers:{200:"raw"},signal:t.signal})},async getCapabilities(t){return e.send({op:"GetCapabilities",method:"GET",path:"/payments/capabilities",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listChannels(t){return e.send({op:"ListChannels",method:"GET",path:"/payments/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectChannel(t){return e.send({op:"ConnectChannel",method:"POST",path:"/payments/channels",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createChannelGrant(t){return e.send({op:"CreateChannelGrant",method:"POST",path:"/payments/channels/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChannel(t){return e.send({op:"GetChannel",method:"GET",path:"/payments/channels/"+c("GetChannel","channel_key",t.path.channel_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteChannel(t){return e.send({op:"DeleteChannel",method:"DELETE",path:"/payments/channels/"+c("DeleteChannel","channel_key",t.path.channel_key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async checkChannel(t){return e.send({op:"CheckChannel",method:"POST",path:"/payments/channels/"+c("CheckChannel","channel_key",t.path.channel_key)+"/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setDefaultChannel(t){return e.send({op:"SetDefaultChannel",method:"POST",path:"/payments/channels/"+c("SetDefaultChannel","channel_key",t.path.channel_key)+"/default",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async connectChannelPage(t){return e.send({op:"ConnectChannelPage",method:"GET",path:"/payments/connect",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async connectChannelSubmit(t){return e.send({op:"ConnectChannelSubmit",method:"POST",path:"/payments/connect",auth:[],answers:{200:"json"},signal:t?.signal})},async listDisputes(t){return e.send({op:"ListDisputes",method:"GET",path:"/payments/disputes",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async lookupInstallments(t){return e.send({op:"LookupInstallments",method:"POST",path:"/payments/installments",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listIntents(t){return e.send({op:"ListIntents",method:"GET",path:"/payments/intents",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createIntent(t){return e.send({op:"CreateIntent",method:"POST",path:"/payments/intents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getIntent(t){return e.send({op:"GetIntent",method:"GET",path:"/payments/intents/"+c("GetIntent","intent_id",t.path.intent_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listIntentAttempts(t){return e.send({op:"ListIntentAttempts",method:"GET",path:"/payments/intents/"+c("ListIntentAttempts","intent_id",t.path.intent_id)+"/attempts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelIntent(t){return e.send({op:"CancelIntent",method:"POST",path:"/payments/intents/"+c("CancelIntent","intent_id",t.path.intent_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async settlePendingRefund(t){return e.send({op:"SettlePendingRefund",method:"POST",path:"/payments/intents/"+c("SettlePendingRefund","intent_id",t.path.intent_id)+"/pending-refund",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async captureIntent(t){return e.send({op:"CaptureIntent",method:"POST",path:"/payments/intents/"+c("CaptureIntent","intent_id",t.path.intent_id)+"/capture",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async confirmIntent(t){return e.send({op:"ConfirmIntent",method:"POST",path:"/payments/intents/"+c("ConfirmIntent","intent_id",t.path.intent_id)+"/confirm",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async submitIntentOtp(t){return e.send({op:"SubmitIntentOTP",method:"POST",path:"/payments/intents/"+c("SubmitIntentOTP","intent_id",t.path.intent_id)+"/otp",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyMethods(t){return e.send({op:"ListMyMethods",method:"GET",path:"/payments/me/methods",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async addMyMethod(t){return e.send({op:"AddMyMethod",method:"POST",path:"/payments/me/methods",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async deleteMyMethod(t){return e.send({op:"DeleteMyMethod",method:"DELETE",path:"/payments/me/methods/"+c("DeleteMyMethod","method_id",t.path.method_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async createMyPortal(t){return e.send({op:"CreateMyPortal",method:"POST",path:"/payments/me/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMyProfile(t){return e.send({op:"GetMyProfile",method:"GET",path:"/payments/me/profile",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMyProfile(t){return e.send({op:"UpdateMyProfile",method:"PUT",path:"/payments/me/profile",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMySubscriptions(t){return e.send({op:"ListMySubscriptions",method:"GET",path:"/payments/me/subscriptions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async cancelMySubscription(t){return e.send({op:"CancelMySubscription",method:"POST",path:"/payments/me/subscriptions/"+c("CancelMySubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listMyWallets(t){return e.send({op:"ListMyWallets",method:"GET",path:"/payments/me/wallets",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async createMySpendToken(t){return e.send({op:"CreateMySpendToken",method:"POST",path:"/payments/me/wallets/spend-tokens",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async topUpMyWallet(t){return e.send({op:"TopUpMyWallet",method:"POST",path:"/payments/me/wallets/top-up",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRefunds(t){return e.send({op:"ListRefunds",method:"GET",path:"/payments/refunds",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createRefund(t){return e.send({op:"CreateRefund",method:"POST",path:"/payments/refunds",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRoutingRules(t){return e.send({op:"ListRoutingRules",method:"GET",path:"/payments/routing-rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async replaceRoutingRules(t){return e.send({op:"ReplaceRoutingRules",method:"PUT",path:"/payments/routing-rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSellerAccount(t){return e.send({op:"GetSellerAccount",method:"GET",path:"/payments/seller-accounts/"+c("GetSellerAccount","seller_ref",t.path.seller_ref),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSellerLedger(t){return e.send({op:"ListSellerLedger",method:"GET",path:"/payments/seller-accounts/"+c("ListSellerLedger","seller_ref",t.path.seller_ref)+"/ledger",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/payments/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/payments/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPaymentSplits(t){return e.send({op:"ListPaymentSplits",method:"GET",path:"/payments/splits",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async updatePaymentSplit(t){return e.send({op:"UpdatePaymentSplit",method:"PUT",path:"/payments/splits/"+c("UpdatePaymentSplit","split_id",t.path.split_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async approvePaymentSplit(t){return e.send({op:"ApprovePaymentSplit",method:"POST",path:"/payments/splits/"+c("ApprovePaymentSplit","split_id",t.path.split_id)+"/approve",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async disapprovePaymentSplit(t){return e.send({op:"DisapprovePaymentSplit",method:"POST",path:"/payments/splits/"+c("DisapprovePaymentSplit","split_id",t.path.split_id)+"/disapprove",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async refundPaymentSplit(t){return e.send({op:"RefundPaymentSplit",method:"POST",path:"/payments/splits/"+c("RefundPaymentSplit","split_id",t.path.split_id)+"/refund",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stripeAppCallback(t){return e.send({op:"StripeAppCallback",method:"GET",path:"/payments/stripe/app/callback",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async createStripeAppGrant(t){return e.send({op:"CreateStripeAppGrant",method:"POST",path:"/payments/stripe/app/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async stripeAppInstallPage(t){return e.send({op:"StripeAppInstallPage",method:"GET",path:"/payments/stripe/app/install",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async stripeAppInstallStart(t){return e.send({op:"StripeAppInstallStart",method:"POST",path:"/payments/stripe/app/install",auth:[],answers:{303:"redirect"},signal:t?.signal})},async listSubMerchants(t){return e.send({op:"ListSubMerchants",method:"GET",path:"/payments/sub-merchants",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async upsertSubMerchant(t){return e.send({op:"UpsertSubMerchant",method:"POST",path:"/payments/sub-merchants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSubMerchant(t){return e.send({op:"GetSubMerchant",method:"GET",path:"/payments/sub-merchants/"+c("GetSubMerchant","sub_merchant_id",t.path.sub_merchant_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSubMerchantOnboardingLink(t){return e.send({op:"CreateSubMerchantOnboardingLink",method:"POST",path:"/payments/sub-merchants/"+c("CreateSubMerchantOnboardingLink","sub_merchant_id",t.path.sub_merchant_id)+"/onboarding-link",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async syncSubMerchant(t){return e.send({op:"SyncSubMerchant",method:"POST",path:"/payments/sub-merchants/"+c("SyncSubMerchant","sub_merchant_id",t.path.sub_merchant_id)+"/sync",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSubscriptions(t){return e.send({op:"ListSubscriptions",method:"GET",path:"/payments/subscriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createSubscription(t){return e.send({op:"CreateSubscription",method:"POST",path:"/payments/subscriptions",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/payments/subscriptions/"+c("CancelSubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/payments/subscriptions/"+c("ExtendSubscription","subscription_id",t.path.subscription_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWallets(t){return e.send({op:"ListWallets",method:"GET",path:"/payments/wallets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertWallet(t){return e.send({op:"UpsertWallet",method:"POST",path:"/payments/wallets",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async chargeWallet(t){return e.send({op:"ChargeWallet",method:"POST",path:"/payments/wallets/charge",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async creditWallet(t){return e.send({op:"CreditWallet",method:"POST",path:"/payments/wallets/credit",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCustomerWallets(t){return e.send({op:"GetCustomerWallets",method:"GET",path:"/payments/wallets/customers/"+c("GetCustomerWallets","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async freezeWallet(t){return e.send({op:"FreezeWallet",method:"PUT",path:"/payments/wallets/customers/"+c("FreezeWallet","customer_id",t.path.customer_id)+"/"+c("FreezeWallet","wallet_key",t.path.wallet_key)+"/freeze",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createWalletHold(t){return e.send({op:"CreateWalletHold",method:"POST",path:"/payments/wallets/holds",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitWalletHold(t){return e.send({op:"CommitWalletHold",method:"POST",path:"/payments/wallets/holds/"+c("CommitWalletHold","hold_id",t.path.hold_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseWalletHold(t){return e.send({op:"ReleaseWalletHold",method:"POST",path:"/payments/wallets/holds/"+c("ReleaseWalletHold","hold_id",t.path.hold_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async voidPendingWalletCredits(t){return e.send({op:"VoidPendingWalletCredits",method:"POST",path:"/payments/wallets/pending/void",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async transferWallet(t){return e.send({op:"TransferWallet",method:"POST",path:"/payments/wallets/transfer",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async iyzicoWebhook(t){return e.send({op:"IyzicoWebhook",method:"POST",path:"/payments/webhooks/iyzico",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeWebhook(t){return e.send({op:"StripeWebhook",method:"POST",path:"/payments/webhooks/stripe",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeAppWebhook(t){return e.send({op:"StripeAppWebhook",method:"POST",path:"/payments/webhooks/stripe-app",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeConnectWebhook(t){return e.send({op:"StripeConnectWebhook",method:"POST",path:"/payments/webhooks/stripe/connect",auth:[],answers:{200:"empty"},signal:t?.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/payments/customers/"+c("GetCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCustomer(t){return e.send({op:"UpdateCustomer",method:"PUT",path:"/payments/customers/"+c("UpdateCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCustomer(t){return e.send({op:"DeleteCustomer",method:"DELETE",path:"/payments/customers/"+c("DeleteCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCustomerMethods(t){return e.send({op:"ListCustomerMethods",method:"GET",path:"/payments/customers/"+c("ListCustomerMethods","customer_id",t.path.customer_id)+"/methods",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addCustomerMethod(t){return e.send({op:"AddCustomerMethod",method:"POST",path:"/payments/customers/"+c("AddCustomerMethod","customer_id",t.path.customer_id)+"/methods",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCustomerMethod(t){return e.send({op:"DeleteCustomerMethod",method:"DELETE",path:"/payments/customers/"+c("DeleteCustomerMethod","customer_id",t.path.customer_id)+"/methods/"+c("DeleteCustomerMethod","method_id",t.path.method_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async setCustomerDefaultMethod(t){return e.send({op:"SetCustomerDefaultMethod",method:"POST",path:"/payments/customers/"+c("SetCustomerDefaultMethod","customer_id",t.path.customer_id)+"/methods/"+c("SetCustomerDefaultMethod","method_id",t.path.method_id)+"/default",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createCustomerPortal(t){return e.send({op:"CreateCustomerPortal",method:"POST",path:"/payments/customers/"+c("CreateCustomerPortal","customer_id",t.path.customer_id)+"/portal",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Do={};wt(Do,{client:()=>o$});function o$(e){return{async broadcast(t){return e.send({op:"Broadcast",method:"POST",path:"/realtime/broadcast",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChannels(t){return e.send({op:"GetChannels",method:"GET",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putChannels(t){return e.send({op:"PutChannels",method:"PUT",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getLimits(t){return e.send({op:"GetLimits",method:"GET",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putLimits(t){return e.send({op:"PutLimits",method:"PUT",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revalidate(t){return e.send({op:"Revalidate",method:"POST",path:"/realtime/revalidate",auth:[["SecretKeyAuth"]],answers:{202:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async writeState(t){return e.send({op:"WriteState",method:"POST",path:"/realtime/state",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStats(t){return e.send({op:"GetStats",method:"GET",path:"/realtime/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var zo={};wt(zo,{client:()=>i$});function i$(e){return{async listSecretAudit(t){return e.send({op:"ListSecretAudit",method:"GET",path:"/secrets/audit",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listFieldKeys(t){return e.send({op:"ListFieldKeys",method:"GET",path:"/secrets/fields",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getFieldKeys(t){return e.send({op:"GetFieldKeys",method:"GET",path:"/secrets/fields/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async openFields(t){return e.send({op:"OpenFields",method:"POST",path:"/secrets/fields/open",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sealPlaceholder(t){return e.send({op:"SealPlaceholder",method:"POST",path:"/secrets/fields/placeholder",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateFieldKeys(t){return e.send({op:"RotateFieldKeys",method:"POST",path:"/secrets/fields/rotate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async listTransitKeys(t){return e.send({op:"ListTransitKeys",method:"GET",path:"/secrets/transit",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTransitKeys(t){return e.send({op:"GetTransitKeys",method:"GET",path:"/secrets/transit/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTransitPublicKeys(t){return e.send({op:"GetTransitPublicKeys",method:"GET",path:"/secrets/transit/public",auth:[["ApiKeyAuth"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async rotateTransitKeys(t){return e.send({op:"RotateTransitKeys",method:"POST",path:"/secrets/transit/rotate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async retireTransitKey(t){return e.send({op:"RetireTransitKey",method:"POST",path:"/secrets/transit/"+c("RetireTransitKey","kid",t.path.kid)+"/retire",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listSecrets(t){return e.send({op:"ListSecrets",method:"GET",path:"/secrets/"+c("ListSecrets","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getEnvironmentValues(t){return e.send({op:"GetEnvironmentValues",method:"GET",path:"/secrets/"+c("GetEnvironmentValues","environment",t.path.environment)+"/values",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getSecret(t){return e.send({op:"GetSecret",method:"GET",path:"/secrets/"+c("GetSecret","environment",t.path.environment)+"/"+c("GetSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putSecret(t){return e.send({op:"PutSecret",method:"PUT",path:"/secrets/"+c("PutSecret","environment",t.path.environment)+"/"+c("PutSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSecret(t){return e.send({op:"DeleteSecret",method:"DELETE",path:"/secrets/"+c("DeleteSecret","environment",t.path.environment)+"/"+c("DeleteSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async rollbackSecret(t){return e.send({op:"RollbackSecret",method:"POST",path:"/secrets/"+c("RollbackSecret","environment",t.path.environment)+"/"+c("RollbackSecret","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSecretVersions(t){return e.send({op:"ListSecretVersions",method:"GET",path:"/secrets/"+c("ListSecretVersions","environment",t.path.environment)+"/"+c("ListSecretVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})}}}var qo={};wt(qo,{client:()=>r$});function r$(e){return{async listBuckets(t){return e.send({op:"ListBuckets",method:"GET",path:"/storage/buckets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getBucket(t){return e.send({op:"GetBucket",method:"GET",path:"/storage/buckets/"+c("GetBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putBucket(t){return e.send({op:"PutBucket",method:"PUT",path:"/storage/buckets/"+c("PutBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteBucket(t){return e.send({op:"DeleteBucket",method:"DELETE",path:"/storage/buckets/"+c("DeleteBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async copyObject(t){return e.send({op:"CopyObject",method:"POST",path:"/storage/buckets/"+c("CopyObject","bucket",t.path.bucket)+"/copy",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveObject(t){return e.send({op:"MoveObject",method:"POST",path:"/storage/buckets/"+c("MoveObject","bucket",t.path.bucket)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listObjects(t){return e.send({op:"ListObjects",method:"GET",path:"/storage/buckets/"+c("ListObjects","bucket",t.path.bucket)+"/objects",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getObject(t){return e.send({op:"GetObject",method:"GET",path:"/storage/buckets/"+c("GetObject","bucket",t.path.bucket)+"/objects/"+c("GetObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putObject(t){return e.send({op:"PutObject",method:"PUT",path:"/storage/buckets/"+c("PutObject","bucket",t.path.bucket)+"/objects/"+c("PutObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async deleteObject(t){return e.send({op:"DeleteObject",method:"DELETE",path:"/storage/buckets/"+c("DeleteObject","bucket",t.path.bucket)+"/objects/"+c("DeleteObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async headObject(t){return e.send({op:"HeadObject",method:"HEAD",path:"/storage/buckets/"+c("HeadObject","bucket",t.path.bucket)+"/objects/"+c("HeadObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async createSignedUrl(t){return e.send({op:"CreateSignedUrl",method:"POST",path:"/storage/buckets/"+c("CreateSignedUrl","bucket",t.path.bucket)+"/signed-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createUploadUrl(t){return e.send({op:"CreateUploadUrl",method:"POST",path:"/storage/buckets/"+c("CreateUploadUrl","bucket",t.path.bucket)+"/upload-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPublicObject(t){return e.send({op:"GetPublicObject",method:"GET",path:"/storage/public/"+c("GetPublicObject","bucket",t.path.bucket)+"/"+c("GetPublicObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async headPublicObject(t){return e.send({op:"HeadPublicObject",method:"HEAD",path:"/storage/public/"+c("HeadPublicObject","bucket",t.path.bucket)+"/"+c("HeadPublicObject","path",t.path.path),auth:[],answers:{200:"empty",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getSignedObject(t){return e.send({op:"GetSignedObject",method:"GET",path:"/storage/signed/"+c("GetSignedObject","bucket",t.path.bucket)+"/"+c("GetSignedObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putSignedObject(t){return e.send({op:"PutSignedObject",method:"PUT",path:"/storage/signed/"+c("PutSignedObject","bucket",t.path.bucket)+"/"+c("PutSignedObject","path",t.path.path),auth:[],answers:{200:"json",201:"json"},query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async headSignedObject(t){return e.send({op:"HeadSignedObject",method:"HEAD",path:"/storage/signed/"+c("HeadSignedObject","bucket",t.path.bucket)+"/"+c("HeadSignedObject","path",t.path.path),auth:[],answers:{200:"empty",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getStorageStats(t){return e.send({op:"GetStorageStats",method:"GET",path:"/storage/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async upload(t){return e.send({op:"Upload",method:"POST",path:"/storage/upload/"+c("Upload","machine",t.path.machine)+"/"+c("Upload","route",t.path.route),auth:[["ApiKeyAuth","userJWT"],["ApiKeyAuth"]],answers:{},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})}}}var Go={};wt(Go,{client:()=>l$});function l$(e){return{async listActions(t){return e.send({op:"ListActions",method:"GET",path:"/stores/actions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getAction(t){return e.send({op:"GetAction",method:"GET",path:"/stores/actions/"+c("GetAction","action_id",t.path.action_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async confirmAction(t){return e.send({op:"ConfirmAction",method:"POST",path:"/stores/actions/"+c("ConfirmAction","action_id",t.path.action_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineAction(t){return e.send({op:"DeclineAction",method:"POST",path:"/stores/actions/"+c("DeclineAction","action_id",t.path.action_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkAppleAccount(t){return e.send({op:"CheckAppleAccount",method:"POST",path:"/stores/apple/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createAppleGrant(t){return e.send({op:"CreateAppleGrant",method:"POST",path:"/stores/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getSandboxReadiness(t){return e.send({op:"GetSandboxReadiness",method:"GET",path:"/stores/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listSandboxTesters(t){return e.send({op:"ListSandboxTesters",method:"GET",path:"/stores/apple/sandbox-testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async clearSandboxPurchaseHistory(t){return e.send({op:"ClearSandboxPurchaseHistory",method:"POST",path:"/stores/apple/sandbox-testers/clear-purchase-history",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateSandboxTester(t){return e.send({op:"UpdateSandboxTester",method:"PATCH",path:"/stores/apple/sandbox-testers/"+c("UpdateSandboxTester","tester_id",t.path.tester_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listApps(t){return e.send({op:"ListApps",method:"GET",path:"/stores/apps",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listFeedback(t){return e.send({op:"ListFeedback",method:"GET",path:"/stores/apps/"+c("ListFeedback","app_id",t.path.app_id)+"/feedback",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getFeedback(t){return e.send({op:"GetFeedback",method:"GET",path:"/stores/apps/"+c("GetFeedback","app_id",t.path.app_id)+"/feedback/"+c("GetFeedback","kind",t.path.kind)+"/"+c("GetFeedback","feedback_id",t.path.feedback_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listGroups(t){return e.send({op:"ListGroups",method:"GET",path:"/stores/apps/"+c("ListGroups","app_id",t.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createGroup(t){return e.send({op:"CreateGroup",method:"POST",path:"/stores/apps/"+c("CreateGroup","app_id",t.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async linkApp(t){return e.send({op:"LinkApp",method:"POST",path:"/stores/apps/"+c("LinkApp","app_id",t.path.app_id)+"/link",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getListing(t){return e.send({op:"GetListing",method:"GET",path:"/stores/apps/"+c("GetListing","app_id",t.path.app_id)+"/listing",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setListing(t){return e.send({op:"SetListing",method:"PUT",path:"/stores/apps/"+c("SetListing","app_id",t.path.app_id)+"/listing",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planListing(t){return e.send({op:"PlanListing",method:"POST",path:"/stores/apps/"+c("PlanListing","app_id",t.path.app_id)+"/listing/plan",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async createPackage(t){return e.send({op:"CreatePackage",method:"POST",path:"/stores/apps/"+c("CreatePackage","app_id",t.path.app_id)+"/packages",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async uploadScreenshot(t){return e.send({op:"UploadScreenshot",method:"PUT",path:"/stores/apps/"+c("UploadScreenshot","app_id",t.path.app_id)+"/screenshots",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"image/png",value:t.body},signal:t.signal})},async getReviewInfo(t){return e.send({op:"GetReviewInfo",method:"GET",path:"/stores/apps/"+c("GetReviewInfo","app_id",t.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setReviewInfo(t){return e.send({op:"SetReviewInfo",method:"PUT",path:"/stores/apps/"+c("SetReviewInfo","app_id",t.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getUploadKey(t){return e.send({op:"GetUploadKey",method:"GET",path:"/stores/apps/"+c("GetUploadKey","app_id",t.path.app_id)+"/upload-key",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getAppStoreVersion(t){return e.send({op:"GetAppStoreVersion",method:"GET",path:"/stores/apps/"+c("GetAppStoreVersion","app_id",t.path.app_id)+"/version",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async prepareAppStoreVersion(t){return e.send({op:"PrepareAppStoreVersion",method:"PUT",path:"/stores/apps/"+c("PrepareAppStoreVersion","app_id",t.path.app_id)+"/version",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planPhasedRelease(t){return e.send({op:"PlanPhasedRelease",method:"POST",path:"/stores/apps/"+c("PlanPhasedRelease","app_id",t.path.app_id)+"/version/phased-release",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planReleaseVersion(t){return e.send({op:"PlanReleaseVersion",method:"POST",path:"/stores/apps/"+c("PlanReleaseVersion","app_id",t.path.app_id)+"/version/release",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planSubmitReview(t){return e.send({op:"PlanSubmitReview",method:"POST",path:"/stores/apps/"+c("PlanSubmitReview","app_id",t.path.app_id)+"/version/submit",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planWithdrawReview(t){return e.send({op:"PlanWithdrawReview",method:"POST",path:"/stores/apps/"+c("PlanWithdrawReview","app_id",t.path.app_id)+"/version/withdraw",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppVitals(t){return e.send({op:"GetAppVitals",method:"GET",path:"/stores/apps/"+c("GetAppVitals","app_id",t.path.app_id)+"/vitals",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getAppWebhook(t){return e.send({op:"GetAppWebhook",method:"GET",path:"/stores/apps/"+c("GetAppWebhook","app_id",t.path.app_id)+"/webhook",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async makeAppWebhook(t){return e.send({op:"MakeAppWebhook",method:"POST",path:"/stores/apps/"+c("MakeAppWebhook","app_id",t.path.app_id)+"/webhook",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async pingAppWebhook(t){return e.send({op:"PingAppWebhook",method:"POST",path:"/stores/apps/"+c("PingAppWebhook","app_id",t.path.app_id)+"/webhook/ping",auth:[["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async downloadSignedBundle(t){return e.send({op:"DownloadSignedBundle",method:"GET",path:"/stores/bundles",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getConnectPage(t){return e.send({op:"GetConnectPage",method:"GET",path:"/stores/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/stores/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async disconnectGoogle(t){return e.send({op:"DisconnectGoogle",method:"DELETE",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkGoogleAccount(t){return e.send({op:"CheckGoogleAccount",method:"POST",path:"/stores/google/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async deleteGroup(t){return e.send({op:"DeleteGroup",method:"DELETE",path:"/stores/groups/"+c("DeleteGroup","group_id",t.path.group_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async renameGroup(t){return e.send({op:"RenameGroup",method:"PATCH",path:"/stores/groups/"+c("RenameGroup","group_id",t.path.group_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addGroupBuild(t){return e.send({op:"AddGroupBuild",method:"POST",path:"/stores/groups/"+c("AddGroupBuild","group_id",t.path.group_id)+"/builds",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTesters(t){return e.send({op:"ListTesters",method:"GET",path:"/stores/groups/"+c("ListTesters","group_id",t.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setTesters(t){return e.send({op:"SetTesters",method:"PUT",path:"/stores/groups/"+c("SetTesters","group_id",t.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPackages(t){return e.send({op:"ListPackages",method:"GET",path:"/stores/packages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getPackage(t){return e.send({op:"GetPackage",method:"GET",path:"/stores/packages/"+c("GetPackage","package_id",t.path.package_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async uploadArtifact(t){return e.send({op:"UploadArtifact",method:"PUT",path:"/stores/packages/"+c("UploadArtifact","package_id",t.path.package_id)+"/artifact",auth:[],answers:{200:"json"},headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async planBetaReview(t){return e.send({op:"PlanBetaReview",method:"POST",path:"/stores/packages/"+c("PlanBetaReview","package_id",t.path.package_id)+"/beta-review",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listDeliveries(t){return e.send({op:"ListDeliveries",method:"GET",path:"/stores/packages/"+c("ListDeliveries","package_id",t.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deliver(t){return e.send({op:"Deliver",method:"POST",path:"/stores/packages/"+c("Deliver","package_id",t.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSignedBundleLink(t){return e.send({op:"GetSignedBundleLink",method:"POST",path:"/stores/packages/"+c("GetSignedBundleLink","package_id",t.path.package_id)+"/deliveries/"+c("GetSignedBundleLink","channel",t.path.channel)+"/bundle-link",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planExpire(t){return e.send({op:"PlanExpire",method:"POST",path:"/stores/packages/"+c("PlanExpire","package_id",t.path.package_id)+"/expire",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planExportCompliance(t){return e.send({op:"PlanExportCompliance",method:"POST",path:"/stores/packages/"+c("PlanExportCompliance","package_id",t.path.package_id)+"/export-compliance",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setWhatToTest(t){return e.send({op:"SetWhatToTest",method:"PUT",path:"/stores/packages/"+c("SetWhatToTest","package_id",t.path.package_id)+"/what-to-test",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async takeAppleWebhook(t){return e.send({op:"TakeAppleWebhook",method:"POST",path:"/stores/webhooks/apple/"+c("TakeAppleWebhook","app_id",t.path.app_id),auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAppleSession(t){return e.send({op:"GetAppleSession",method:"GET",path:"/stores/apple/session",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectAppleSession(t){return e.send({op:"DisconnectAppleSession",method:"DELETE",path:"/stores/apple/session",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkAppleSession(t){return e.send({op:"CheckAppleSession",method:"POST",path:"/stores/apple/session/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createAppleIdGrant(t){return e.send({op:"CreateAppleIDGrant",method:"POST",path:"/stores/apple/session/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleIdPage(t){return e.send({op:"GetAppleIDPage",method:"GET",path:"/stores/connect/apple-id",auth:[],answers:{200:"raw"},signal:t?.signal})},async signInAppleId(t){return e.send({op:"SignInAppleID",method:"POST",path:"/stores/connect/apple-id",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async submitAppleIdCode(t){return e.send({op:"SubmitAppleIDCode",method:"POST",path:"/stores/connect/apple-id/code",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async chooseAppleIdTeam(t){return e.send({op:"ChooseAppleIDTeam",method:"POST",path:"/stores/connect/apple-id/team",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAppReview(t){return e.send({op:"GetAppReview",method:"GET",path:"/stores/apps/"+c("GetAppReview","app_id",t.path.app_id)+"/review",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getReviewAttachment(t){return e.send({op:"GetReviewAttachment",method:"GET",path:"/stores/apps/"+c("GetReviewAttachment","app_id",t.path.app_id)+"/review/threads/"+c("GetReviewAttachment","thread_id",t.path.thread_id)+"/attachments/"+c("GetReviewAttachment","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async setReviewDraft(t){return e.send({op:"SetReviewDraft",method:"PUT",path:"/stores/apps/"+c("SetReviewDraft","app_id",t.path.app_id)+"/review/threads/"+c("SetReviewDraft","thread_id",t.path.thread_id)+"/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendReviewDraft(t){return e.send({op:"SendReviewDraft",method:"POST",path:"/stores/apps/"+c("SendReviewDraft","app_id",t.path.app_id)+"/review/threads/"+c("SendReviewDraft","thread_id",t.path.thread_id)+"/draft/send",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppPrivacy(t){return e.send({op:"GetAppPrivacy",method:"GET",path:"/stores/apps/"+c("GetAppPrivacy","app_id",t.path.app_id)+"/privacy",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setAppPrivacy(t){return e.send({op:"SetAppPrivacy",method:"PUT",path:"/stores/apps/"+c("SetAppPrivacy","app_id",t.path.app_id)+"/privacy",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async makeAppRecord(t){return e.send({op:"MakeAppRecord",method:"POST",path:"/stores/apps/"+c("MakeAppRecord","app_id",t.path.app_id)+"/record",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeAppRecord(t){return e.send({op:"RemoveAppRecord",method:"DELETE",path:"/stores/apps/"+c("RemoveAppRecord","app_id",t.path.app_id)+"/record",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listMadeAppleKeys(t){return e.send({op:"ListMadeAppleKeys",method:"GET",path:"/stores/apple/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async makeAppleKey(t){return e.send({op:"MakeAppleKey",method:"POST",path:"/stores/apple/keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeMadeAppleKey(t){return e.send({op:"RevokeMadeAppleKey",method:"DELETE",path:"/stores/apple/keys/"+c("RevokeMadeAppleKey","key_id",t.path.key_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async shareAppleSession(t){return e.send({op:"ShareAppleSession",method:"PUT",path:"/stores/apple/session/shares/"+c("ShareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async unshareAppleSession(t){return e.send({op:"UnshareAppleSession",method:"DELETE",path:"/stores/apple/session/shares/"+c("UnshareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getInstallPage(t){return e.send({op:"GetInstallPage",method:"GET",path:"/stores/install",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getInstallStatus(t){return e.send({op:"GetInstallStatus",method:"GET",path:"/stores/install/status",auth:[],answers:{200:"json"},query:t.query,signal:t.signal})},async retryInstall(t){return e.send({op:"RetryInstall",method:"POST",path:"/stores/install/retry",auth:[],answers:{204:"empty"},query:t.query,signal:t.signal})},async getInstallEnrollment(t){return e.send({op:"GetInstallEnrollment",method:"GET",path:"/stores/install/enroll",auth:[],answers:{200:"raw",303:"redirect"},query:t.query,signal:t.signal})},async registerInstallDevice(t){return e.send({op:"RegisterInstallDevice",method:"POST",path:"/stores/install/device",auth:[],answers:{200:"raw",301:"redirect"},query:t.query,body:{kind:"raw",contentType:t.contentType??"application/pkcs7-signature",value:t.body},signal:t.signal})},async getInstallManifest(t){return e.send({op:"GetInstallManifest",method:"GET",path:"/stores/install/manifest",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getInstallBuild(t){return e.send({op:"GetInstallBuild",method:"GET",path:"/stores/install/app",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async headInstallBuild(t){return e.send({op:"HeadInstallBuild",method:"HEAD",path:"/stores/install/app",auth:[],answers:{200:"empty"},query:t.query,signal:t.signal})},async getInstallIcon(t){return e.send({op:"GetInstallIcon",method:"GET",path:"/stores/install/icon",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async listInvitations(t){return e.send({op:"ListInvitations",method:"GET",path:"/stores/packages/"+c("ListInvitations","package_id",t.path.package_id)+"/invitations",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async invitePerson(t){return e.send({op:"InvitePerson",method:"POST",path:"/stores/packages/"+c("InvitePerson","package_id",t.path.package_id)+"/invitations",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeInvitation(t){return e.send({op:"RevokeInvitation",method:"DELETE",path:"/stores/invitations/"+c("RevokeInvitation","invitation_id",t.path.invitation_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/stores/devices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})}}}var rr={};wt(rr,{client:()=>p$});function p$(e){return{async listWorkspaces(t){return e.send({op:"ListWorkspaces",method:"GET",path:"/workspaces",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createWorkspace(t){return e.send({op:"CreateWorkspace",method:"POST",path:"/workspaces",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async testWorkspaceByos(t){return e.send({op:"TestWorkspaceBYOS",method:"POST",path:"/workspaces/byos/test",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listProjectS3Keys(t){return e.send({op:"ListProjectS3Keys",method:"GET",path:"/workspaces/s3-keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createProjectS3Key(t){return e.send({op:"CreateProjectS3Key",method:"POST",path:"/workspaces/s3-keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async deleteProjectS3Key(t){return e.send({op:"DeleteProjectS3Key",method:"DELETE",path:"/workspaces/s3-keys/"+c("DeleteProjectS3Key","token_id",t.path.token_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getWorkspace(t){return e.send({op:"GetWorkspace",method:"GET",path:"/workspaces/"+c("GetWorkspace","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteWorkspace(t){return e.send({op:"DeleteWorkspace",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspace","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async updateWorkspaceStorage(t){return e.send({op:"UpdateWorkspaceStorage",method:"PUT",path:"/workspaces/"+c("UpdateWorkspaceStorage","id",t.path.id)+"/storage",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWorkspaceFiles(t){return e.send({op:"GetWorkspaceFiles",method:"GET",path:"/workspaces/"+c("GetWorkspaceFiles","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putWorkspaceFile(t){return e.send({op:"PutWorkspaceFile",method:"PUT",path:"/workspaces/"+c("PutWorkspaceFile","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async deleteWorkspaceFile(t){return e.send({op:"DeleteWorkspaceFile",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspaceFile","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async listWorkspaceTokens(t){return e.send({op:"ListWorkspaceTokens",method:"GET",path:"/workspaces/"+c("ListWorkspaceTokens","id",t.path.id)+"/tokens",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createWorkspaceToken(t){return e.send({op:"CreateWorkspaceToken",method:"POST",path:"/workspaces/"+c("CreateWorkspaceToken","id",t.path.id)+"/tokens",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteWorkspaceToken(t){return e.send({op:"DeleteWorkspaceToken",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspaceToken","id",t.path.id)+"/tokens/"+c("DeleteWorkspaceToken","token_id",t.path.token_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listWorkspaceLocks(t){return e.send({op:"ListWorkspaceLocks",method:"GET",path:"/workspaces/"+c("ListWorkspaceLocks","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async acquireWorkspaceLock(t){return e.send({op:"AcquireWorkspaceLock",method:"POST",path:"/workspaces/"+c("AcquireWorkspaceLock","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseWorkspaceLock(t){return e.send({op:"ReleaseWorkspaceLock",method:"DELETE",path:"/workspaces/"+c("ReleaseWorkspaceLock","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async getSyncHead(t){return e.send({op:"GetSyncHead",method:"GET",path:"/workspaces/sync/head",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getSyncChanges(t){return e.send({op:"GetSyncChanges",method:"GET",path:"/workspaces/sync/changes",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async publishSyncChanges(t){return e.send({op:"PublishSyncChanges",method:"POST",path:"/workspaces/sync/publish",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestSyncUploadGrants(t){return e.send({op:"RequestSyncUploadGrants",method:"POST",path:"/workspaces/sync/blobs/upload-grants",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestSyncDownloadGrants(t){return e.send({op:"RequestSyncDownloadGrants",method:"POST",path:"/workspaces/sync/blobs/download-grants",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async downloadSignedSyncBlob(t){return e.send({op:"DownloadSignedSyncBlob",method:"GET",path:"/workspaces/sync/blobs/"+c("DownloadSignedSyncBlob","digest",t.path.digest),auth:[],answers:{200:"empty"},signal:t.signal})},async uploadSignedSyncBlob(t){return e.send({op:"UploadSignedSyncBlob",method:"PUT",path:"/workspaces/sync/blobs/"+c("UploadSignedSyncBlob","digest",t.path.digest),auth:[],answers:{200:"empty"},signal:t.signal})},async streamSyncEvents(t){return e.send({op:"StreamSyncEvents",method:"GET",path:"/workspaces/sync/events",auth:[],answers:{200:"raw"},signal:t?.signal})}}}var lr={attempts:3,maxWaitSeconds:30},d$=new Set([429,502,503,504]);function bp(e,t=lr){let n=t.sleep??m$;return{async send(s){let a=c$(s),o=a.body,i=!o||o.kind!=="raw"||xa(o.value),r=(a.method==="GET"||a.method==="HEAD"||a.idempotent===!0)&&i;for(let l=1;;l++)try{return await e.send(a)}catch(p){if(!r||l>=t.attempts||!(p instanceof G)||a.signal?.aborted)throw p;let d=u$(p,l,t.maxWaitSeconds);if(d===void 0)throw p;await n(d*1e3,a.signal)}}}}function c$(e){return e.idempotent?Object.entries(e.headers??{}).some(([n,s])=>n.toLowerCase()==="idempotency-key"&&s!==void 0&&s!==null&&s!=="")?e:{...e,headers:{...e.headers,"Idempotency-Key":g$()}}:e}function u$(e,t,n){return d$.has(e.status)||e.code==="network_error"?e.retryAfter!==void 0?e.retryAfter<=n?e.retryAfter:void 0:Math.min(.5*2**(t-1),n)*(.8+Math.random()*.4):void 0}function m$(e,t){return new Promise((n,s)=>{if(t?.aborted)return s(t.reason);let a=()=>{clearTimeout(o),s(t?.reason)},o=setTimeout(()=>{t?.removeEventListener("abort",a),n()},e);t?.addEventListener("abort",a,{once:!0})})}function g$(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}import{hostname as h$}from"node:os";var y$=new Set(["apikey","authorization",hp]);function f$(e){let t={accept:"application/json"};for(let[n,s]of Object.entries(e??{}))s!=null&&!y$.has(n.toLowerCase())&&(t[n.toLowerCase()]=String(s));return t}function b$(e,t,n){let s=null;try{s=n.startsWith("/")?new URL(n,e):null}catch{s=null}if(!s||s.origin!==new URL(e).origin)throw new G({op:t,status:0,code:"invalid_path",message:`${t}: a module's path stays at its environment's address`});return s.href}async function w$(e){let t=e.status===204||e.status===304?"":await e.text();if(t!=="")try{return JSON.parse(t)}catch{return t}}function v$(e,t,n){let s=n??{},a=Number(t.headers.get("retry-after")??"");return new G({op:e,status:t.status,code:typeof s.error=="string"?s.error:`http_${t.status}`,message:pr(n,t.status),requestId:typeof s.request_id=="string"?s.request_id:t.headers.get("x-request-id")??void 0,retryAfter:Number.isFinite(a)&&a>0?a:typeof s.retry_after=="number"?s.retry_after:void 0,body:n})}var Hs=class{bytes;contentType;constructor(t,n){this.bytes=t,this.contentType=n}};function k$(e){return e instanceof Hs?{headers:{"content-type":e.contentType,"content-length":String(e.bytes.size)},body:e.bytes}:e===void 0?{headers:{}}:{headers:{"content-type":"application/json"},body:JSON.stringify(e)}}async function et(e,t,n,s,a,o){if(e.callPlatform&&t===cp)return e.callPlatform(e,n,s,a,o);let i=`${n} ${s}`,r=k$(a),l=await e.module(b$(Qt(e.cloud,t),i,s),{method:n,headers:{...f$(o),...r.headers},body:r.body}),p=await w$(l);if(l.status>=200&&l.status<300)return{status:l.status,body:Fi(p),etag:l.headers.get("etag")??void 0};throw v$(i,l,p)}var _$=10080*60*1e3;async function wp(e,t,n=!1){let s=await e.state.personalKey(t);if(!n&&s&&Date.parse(s.expires_at)-e.io.now()>_$)return s;let a=await e.post(`/environments/${Q("the environment's ref",t)}/personal-key`,{host:h$().slice(0,100)||"computer"});return await e.state.keepPersonalKey(t,a),a}function pr(e,t){let n=e??{},s=typeof n.error_description=="string"?n.error_description:`the module answered ${t}`,a=Array.isArray(n.field_errors)?n.field_errors.flatMap(o=>{let{pointer:i,message:r}=o??{};return typeof r=="string"?[`${typeof i=="string"&&i!==""?`${i}: `:""}${r}`]:[]}):[];return a.length>0?`${s}: ${a.join("; ")}`:s}import{relative as S$}from"node:path";async function Ia(e,t){let n=await e.run("git",["rev-parse","--show-toplevel"],{cwd:t});if(n.code!==0)return null;let s=n.stdout.trim(),a=await e.run("git",["remote","get-url","origin"],{cwd:t}),o=await e.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}),i=o.code===0?o.stdout.trim():"";return{root:s,repository:a.code===0?$$(a.stdout.trim()):void 0,branch:i!==""&&i!=="HEAD"?i:void 0,path:S$(s,t).split("\\").join("/")}}function $$(e){let t=/^(?:https?:\/\/(?:[^@/]+@)?github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:void 0}async function Na(e,t){let n=await rt(e);return new Map(n.filter(s=>s.project_id===t.project_id).map(s=>[s.ref,s.slug]))}function as(e,t){return t?e.get(t.ref)??t.ref:""}var Mt="main";async function rt(e){let[t,n]=await Promise.all([e.get("/environments"),e.get("/orgs")]),s=new Map(n.organizations.map(a=>[a.id,a.name]));return t.environments.map(a=>({...a,org_name:s.get(a.organization_id)??a.organization_id}))}function Ge(e){return{org_id:e.organization_id,org_name:e.org_name,project_id:e.project_id,project_name:e.project_name,env_ref:e.ref,env_slug:e.slug,env_name:e.name}}function ee(e){return`${e.org_name} \u203A ${e.project_name} \u203A ${e.env_name}${e.env_name!==e.env_slug?` (${e.env_slug})`:""}`}function wn(e){return(e.env.PALBASE_TOKEN??"").startsWith("pbe_")}async function Ko(e){let[t]=await rt(e.studio);if(!t)throw new b("token_refused","Studio names no environment for PALBASE_TOKEN",{hint:"mint another: palbase env:tokens:create"});let n=Ge(t),s=i=>new b("token_environment",`PALBASE_TOKEN is ${ee(n)}'s environment token: it acts there alone, not in ${i}`,{hint:"mint one there: palbase env:tokens:create -P <project> -E <env>"}),{project:a,env:o}=e.global;if(a!==void 0&&t.project_id!==a&&!_p(t.project_name,a.slice(a.indexOf("/")+1)))throw s(a);if(o!==void 0&&o!==t.slug&&o!==t.ref)throw s(o);if(a===void 0&&o===void 0){let i=await e.state.targetFor(e.io.cwd);if(i&&i.target.env_ref!==t.ref)throw s(`${ee(i.target)}, chosen for ${i.dir}`)}return t}async function f(e){if(wn(e.io))return Ge(await Ko(e));let{project:t,env:n}=e.global;if(t!==void 0||n!==void 0){let i=await rt(e.studio),r;if(t!==void 0)r=As(i,t);else{let l=await e.state.targetFor(e.io.cwd);if(!l)throw kp("-E names an environment of the project chosen here, and none is chosen: add -P <project>");r=i.filter(p=>p.project_id===l.target.project_id)}if(n!==void 0){let l=r.find(p=>p.slug===n||p.ref===n);if(!l)throw new b("no_such_environment",`the project has no environment ${JSON.stringify(n)}`,{hint:`its environments: ${r.map(p=>p.slug).join(", ")}`});return Ge(l)}return r.length===1?Ge(r[0]):Ge(await vp(e,r,"Which environment?"))}let s=await e.state.targetFor(e.io.cwd);if(s)return s.target;if(!e.interactive)throw kp("no environment is chosen for this directory");let a=await rt(e.studio);if(a.length===0)throw new b("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let o=Ge(await vp(e,a,"Which environment?"));return e.out.note(`Acting on ${ee(o)}. palbase use remembers it for this directory.`),o}async function Vs(e){return(await Ss(e)).t}async function Ss(e){if(wn(e.io))return{t:Ge(await Ko(e)),by:"token"};let t=await e.state.targetFor(e.io.cwd);if(e.global.project===void 0&&e.global.env===void 0&&t)return{t:t.target,by:"here"};let n=await rm(e,t?.target);if(e.global.env!==void 0)return{t:Ge(Sp(n,e.global.env)),by:"env"};let s=n.find(a=>a.ref===t?.target.env_ref);return s?{t:Ge(s),by:"here"}:{t:Ge(n.find(a=>a.slug===Mt)??n[0]),by:"fallback"}}function dr(e,t){return e.by==="fallback"?t:`${t}${t.includes("?")?"&":"?"}environment=${encodeURIComponent(e.t.env_ref)}`}var im=1e3;async function $s(e){let t=[],n=new Set,s;for(;;){let a=await e(s);if(t.push(...a.items),!a.next)return t;if(n.has(a.next)||n.size>=im)throw new b("list_unending",`the platform's list did not end: ${n.has(a.next)?`it gave the cursor ${JSON.stringify(a.next)} twice`:`it ran past ${im} pages`}`);n.add(a.next),s=a.next}}async function Xs(e,t,n,s,a){if(t.by==="env"||t.by==="token"||t.by==="here"&&(n.environment?.ref??t.t.env_ref)===t.t.env_ref)return;let o=(await s()).filter(r=>r.name===n.name);if(o.length<2)return;let i=await Na(e.studio,t.t);throw new b("ambiguous_name",`${a} is held by more than one of ${t.t.project_name}'s environments: ${o.map(r=>as(i,r.environment)).join(", ")}`,{hint:"name the environment: -E <env>"})}async function Ys(e){if(wn(e.io))return Ge(await Ko(e));let t=await e.state.targetFor(e.io.cwd);if(e.global.project===void 0&&e.global.env===void 0&&t)return t.target;let n=await rm(e,t?.target);if(e.global.env!==void 0)return Ge(Sp(n,e.global.env));let s=n.find(o=>o.ref===t?.target.env_ref);if(s)return Ge(s);let a=n[0].project_name;if(!e.interactive)throw h(`which environment of ${a} is it bound to? name it with -E <env>`,`its environments: ${n.map(o=>o.slug).join(", ")}`);return Ge(await vp(e,n,le(`Which environment of ${a} does it belong to?`)))}async function Zs(e,t,n,s){if(!n||n.ref===t.env_ref)return t;let a=(await rt(e.studio)).find(o=>o.ref===n.ref);if(e.global.env!==void 0){let o=a?.slug??n.name??n.ref;throw new b("bound_elsewhere",`${s} is bound to ${t.project_name}'s environment ${o}, not ${t.env_slug}`,{hint:`leave -E out: the command acts where it is bound${a?` (or name it, -E ${a.slug})`:""}`})}if(!a)throw new b("environment_out_of_reach",`${s} is bound to ${t.project_name}'s environment ${n.name||n.ref}, which your account does not reach`,{hint:"an admin of the project's organization adds you to that environment"});return Ge(a)}function cr(e,t,n){return e.global.env===void 0?n:`${n}${n.includes("?")?"&":"?"}environment=${encodeURIComponent(t.env_ref)}`}async function Uo(e,t,n){let s=(await rt(e.studio)).filter(a=>a.project_id===t.project_id);return Sp(s,n)}function Ce(e){return`The ${e} is the project's: the command acts in the environment it is bound to. -E picks it where two environments hold its name, and is refused when it names another.`}var Qs="It is bound to the environment -E names, or to the one chosen for this directory: a person at the terminal is asked which, anyone else names it with -E.";async function rm(e,t){let n=await rt(e.studio);if(e.global.project!==void 0)return As(n,e.global.project);if(t){let a=n.filter(o=>o.project_id===t.project_id);if(a.length===0)throw new b("no_such_project",`the project chosen here (${t.project_name}) is not among yours any more`,{hint:"palbase use another"});return a}if(!e.interactive)throw new b("no_target","which project? none is chosen for this directory",{hint:"pass -P <project>, or choose one here with palbase use"});if(n.length===0)throw new b("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let s=[...new Map(n.map(a=>[a.project_id,a])).values()];for(s.forEach((a,o)=>e.out.note(` ${String(o+1).padStart(2)}) ${a.org_name} \u203A ${a.project_name}`));;){let a=Number((await e.io.prompt(`Which project? [1-${s.length}] `)).trim());if(Number.isInteger(a)&&a>=1&&a<=s.length){let o=s[a-1];return e.out.note(`Acting on ${o.org_name} \u203A ${o.project_name}. palbase use remembers one for this directory.`),n.filter(i=>i.project_id===o.project_id)}e.out.note(`answer with a number from 1 to ${s.length}`)}}function Sp(e,t){let n=e.find(s=>s.slug===t||s.ref===t);if(!n)throw new b("no_such_environment",`the project has no environment ${JSON.stringify(t)}`,{hint:`its environments: ${e.map(s=>s.slug).join(", ")}`});return n}function As(e,t){let n=e.filter(l=>l.project_id===t);if(n.length>0)return n;let s=t.indexOf("/"),[a,o]=s>=0?[t.slice(0,s),t.slice(s+1)]:[void 0,t],i=e.filter(l=>_p(l.project_name,o)&&(a===void 0||_p(l.org_name,a)||l.organization_id===a)),r=new Set(i.map(l=>l.project_id));if(r.size===0)throw new b("no_such_project",`no project ${JSON.stringify(t)} among yours`,{hint:"palbase projects:list shows them"});if(r.size>1){let l=[...new Set(i.map(p=>`${p.org_name}/${p.project_name}`))].join(", ");throw new b("ambiguous_project",`${JSON.stringify(t)} is a project in more than one organization: ${l}`,{hint:"name it as org/project"})}return i}async function k(e,t,n,s){e.out.note(`${ee(t)}: ${n}${e.global.yes?" (confirmed with -y)":""}`);let a=t.env_slug===Mt;if(!a&&s===void 0||e.global.yes)return;if(!e.interactive){let i=wn(e.io)?"confirm with -y: with PALBASE_TOKEN, -y is the go-ahead (the CLI asks no one else, and a person's yes elsewhere is not one)":"confirm with -y";throw new b("confirmation_needed",a?`${t.project_name} \u203A ${t.env_name} is the project's production environment`:s,{hint:i})}let o=(await e.io.prompt(le(`${a?`This is ${t.project_name}'s production environment`:s}. Go ahead? [y/N] `))).trim().toLowerCase();if(o!=="y"&&o!=="yes")throw new b("cancelled","nothing was changed")}async function vp(e,t,n){if(!e.interactive)throw kp(`${n.replace(/\?$/,"")}: ${t.map(s=>`${s.project_name}/${s.slug}`).join(", ")}`);for(t.forEach((s,a)=>e.out.note(` ${String(a+1).padStart(2)}) ${ee(Ge(s))}`));;){let s=(await e.io.prompt(`${n} [1-${t.length}] `)).trim(),a=Number(s);if(Number.isInteger(a)&&a>=1&&a<=t.length)return t[a-1];e.out.note(`answer with a number from 1 to ${t.length}`)}}function kp(e){return new b("no_target",e,{hint:"choose one here with palbase use, or pass -P <project> -E <env>"})}function _p(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})===0}import{randomUUID as A$}from"node:crypto";import{readFile as R$}from"node:fs/promises";import{resolve as P$}from"node:path";var j$=6,$p=0,lm=[];async function T$(e){$p<j$?$p++:await new Promise(t=>lm.push(t));try{return await e()}finally{let t=lm.shift();t?t():$p--}}async function Rt(e,t,n,s,a,o){return T$(()=>et(e.studio,t.env_ref,n,s,a,o))}async function g(e,t,n,s,a,o){return(await Rt(e,t,n,s,a,o)).body}async function Pt(e,t,n){let s=await Rt(e,t,"GET",n);return{body:s.body,etag:s.etag}}function vt(e){return e?{"if-match":e}:void 0}function D(){return{"idempotency-key":A$()}}function R(e){return encodeURIComponent(e)}function Rs(e){return e.map(t=>{let n=t.indexOf("=");if(n<=0)throw h(`a setting is key=value, not ${JSON.stringify(t)}`);let s=t.slice(0,n).split(".");if(s.some(a=>a===""||a==="__proto__"||a==="constructor"||a==="prototype"))throw h(`${JSON.stringify(t.slice(0,n))} is not a key`);return{path:s,value:qn(t.slice(n+1))}})}function qn(e){try{return JSON.parse(e)}catch{return e}}function Ps(e,t){let n=structuredClone(e);for(let{path:s,value:a}of t){let o=n;for(let i of s.slice(0,-1)){let r=o[i];(typeof r!="object"||r===null)&&(o[i]={}),o=o[i]}o[s[s.length-1]]=a}return n}function os(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(n=>!Dt(e[n],t[n])).sort()}function pm(e){return JSON.stringify(e,(t,n)=>n!==null&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).sort(([s],[a])=>s<a?-1:s>a?1:0)):n)}function Dt(e,t){return pm(e)===pm(t)}function kt(e){return e===void 0?"(not set)":typeof e=="string"&&e!==""?e:JSON.stringify(e)}function Ma(e,t){let n=Object.keys(t).sort(),s=Math.max(0,...n.map(a=>a.length));for(let a of n)e.out.line(`${a.padEnd(s)} ${kt(t[a])}`)}function zt(e,t,n){e.out.result({settings:n,changed:[]},()=>e.out.line(`Nothing to change: ${t} already ${t.endsWith("s")?"are":"is"} so.`))}async function ze(e,t,n){let s;if(t!==void 0&&t!=="-")try{s=await R$(P$(e.io.cwd,t),"utf8")}catch(a){throw new b("unreadable_file",`${t} could not be read: ${a instanceof Error?a.message:String(a)}`)}else e.io.interactive&&e.out.note(`Reading ${n} from stdin; end it with Ctrl-D.`),s=await e.io.readStdin();if(s.trim()==="")throw h(`no ${n} was given`,t===void 0?"pass --file <path>, or pipe it in":void 0);return s}function Ne(e,t){try{return JSON.parse(e)}catch(n){throw h(`${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}}async function lt(e,t){e.io.interactive&&e.out.note(`Paste ${t}, then Ctrl-D (it is read from stdin, never from the command line):`);let n=(await e.io.readStdin()).trim();if(n==="")throw h(`no ${t} was piped in`,"pipe it in: palbase \u2026 < file");return n}function Da(e){if(e.flags.enable===!0&&e.flags.disable===!0)throw h("--enable and --disable are one or the other");if(e.flags.enable===!0)return!0;if(e.flags.disable===!0)return!1}function Gn(e,t){if(e!==void 0){if(e==="yes"||e==="true")return!0;if(e==="no"||e==="false")return!1;throw h(`--${t} is yes or no`)}}function Me(e){return e===void 0?void 0:(Array.isArray(e)?e:[e]).flatMap(n=>String(n).split(",")).map(n=>n.trim()).filter(n=>n!=="")}function we(e,t){if(e===void 0)return;let n=Number(e);if(!Number.isInteger(n)||n<0)throw h(`--${t} is a whole number`);return n}var Wo={enable:{type:"boolean",description:"turn it on"},disable:{type:"boolean",description:"turn it off"}};async function Ee(e,t,n){try{await n(),e.done(t)}catch(s){if(!(s instanceof G))throw s;e.left(`${t}: refused \u2014 ${s.message}`)}}function Ze(e,t){return e.filter(n=>n.key.startsWith(t)).map(n=>({...n,name:n.key.slice(t.length)}))}function Ap(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>!(t==null||t===""||Array.isArray(t)&&t.length===0)))}import{writeFile as E$}from"node:fs/promises";var C$=/^[A-Z][A-Z0-9_]{0,127}$/,za={dev:{type:"boolean",description:"the development set (what a backend on a developer's computer reads, and a machine started with it), not production \u2014 whatever the environment is named"}};function qa(e){return e.flags.dev===!0?"development":"production"}function Fo(e){let t=e.args[0];if(!C$.test(t))throw h(`${JSON.stringify(t)} is not a secret's name: capital letters, digits and _, a letter first`);return t}async function Rp(e,t,n){try{let s=await $s(async a=>{let o=await g(e,t,"GET",`/machines?limit=100&environment=${encodeURIComponent(t.env_ref)}${a?`&cursor=${encodeURIComponent(a)}`:""}`);return{items:o.machines,next:o.next_cursor}});return{using:s.filter(a=>a.secrets===n).map(a=>a.name).sort(),others:s.filter(a=>a.secrets!==n)}}catch(s){return{unread:s instanceof Error?s.message:String(s)}}}function Pp(e,t,n,s){if("unread"in s){e.out.note(`which machines start with the ${n} set could not be read (${s.unread}): palbase machines:list -E ${t.env_slug} says each one's`);return}if(s.using.length>0){let r=s.using.join(", ");e.out.line(`${r} ${s.using.length===1?"starts":"start"} with the ${n} set: rolling out with the new value \u2014 palbase machines:list -E ${t.env_slug} shows it until every copy runs it.`);return}let a=n==="production"?"development":"production",o=n==="development"?" Only a backend run on a computer (palbase run, env:pull) reads it.":"";if(s.others.length===0){n==="production"&&e.out.note(`${ee(t)} has no machine yet: one started with the ${n} set reads it.`);return}let i=s.others.map(r=>`${r.name} starts with ${r.secrets?`the ${r.secrets} set`:"no set"}`).join(", ");e.out.warn(`no machine of ${ee(t)} starts with the ${n} set (${i}): this value reaches none of them.${o} palbase machines:update <name> --secrets ${n} starts a machine with it; ${n==="production"?"--dev writes":"leaving --dev out writes"} the ${a} set.`)}async function ea(e,t,n){let s=[],a;do{let o=await g(e,t,"GET",`/secrets/${n}?limit=1000${a?`&cursor=${encodeURIComponent(a)}`:""}`);s.push(...o.secrets),a=o.next_cursor}while(a);return s}var O$={name:"secrets:list",summary:"the environment's secrets by name, with their version \u2014 never their values",usage:"[--dev]",flags:za,scope:"environment",async run(e){let t=await f(e),n=qa(e),s=await ea(e,t,n);e.out.result({set:n,secrets:s},()=>{s.length===0&&e.out.line(`No ${n} secrets.`);for(let a of s)e.out.line(`${a.name} v${a.version} ${a.updated_at}`)})}},x$={name:"secrets:set",summary:"set a secret: its value is read from stdin, never from the command line",usage:"<NAME> [--dev] < value",details:["An environment has two sets, production and development, whatever the environment is named: Development's machines may start with its production set. A machine starts with the set it names (machines:update --secrets), and a change of that set rolls it out with the new value; a backend run with palbase run or env:pull reads development.","It says which of the environment's machines start with the set, and warns when none does."],args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=qa(e),a=await lt(e,`the value of ${n}`);await k(e,t,`set the ${s} secret ${n}`);let o=await g(e,t,"PUT",`/secrets/${s}/${n}`,{value:a}),i=await Rp(e,t,s);e.out.result({set:s,name:n,version:o.version,environment:t.env_slug,machines:"using"in i?i.using:null},()=>{e.out.line(`Set ${n} v${o.version} in the ${s} set of ${ee(t)}.`),Pp(e,t,s,i)})}},L$={name:"secrets:unset",summary:"take a secret away",usage:"<NAME> [--dev]",args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=qa(e);await k(e,t,`take away the ${s} secret ${n}`),await g(e,t,"DELETE",`/secrets/${s}/${n}`);let a=await Rp(e,t,s);e.out.result({set:s,name:n,deleted:!0,environment:t.env_slug,machines:"using"in a?a.using:null},()=>{e.out.line(`Took ${n} away from the ${s} set of ${ee(t)}.`),Pp(e,t,s,a)})}},I$={name:"secrets:get",summary:"print one development secret's value (an admin's): a production secret's is never read back",usage:"<NAME> --dev",details:["A production secret's value is never read back, by anyone: only the machines that start with it are given it, and it is changed by setting it again (secrets:set). The development set is what a backend on your computer reads (palbase run, env:pull): secrets:get NAME --dev prints one."],args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=await g(e,t,"GET",`/secrets/${qa(e)}/${n}`);e.out.result({name:n,version:s.version,value:s.value},()=>e.out.line(s.value))}},N$={name:"secrets:versions",summary:"a secret's versions, newest first \u2014 never their values",usage:"<NAME> [--dev]",args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=await g(e,t,"GET",`/secrets/${qa(e)}/${n}/versions`);e.out.result(s,()=>{for(let a of s.versions)e.out.line(`v${a.version} ${a.created_at}${a.current?" (current)":""}`)})}},M$={name:"secrets:rollback",summary:"put a secret back to one of its versions (a new version with that value)",usage:"<NAME> --version <n> [--dev]",args:{min:1,max:1},flags:{...za,version:{type:"string",value:"n",description:"the version to go back to"}},scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=Number(e.flags.version);if(!Number.isInteger(s)||s<1)throw h("--version is a version number (secrets:versions lists them)");let a=qa(e);await k(e,t,`put the ${a} secret ${n} back to v${s}`);let o=await g(e,t,"POST",`/secrets/${a}/${n}/rollback`,{version:s}),i=await Rp(e,t,a);e.out.result({set:a,name:n,version:o.version,environment:t.env_slug,machines:"using"in i?i.using:null},()=>{e.out.line(`${n} in the ${a} set of ${ee(t)} is v${s}'s value again, as v${o.version}.`),Pp(e,t,a,i)})}},D$={name:"secrets:audit",summary:"every read and write of the environment's secrets, newest first: which secret, which key did it, when \u2014 never a value",usage:"[--name <NAME>] [--dev | --prod] [--limit <n>]",details:["A backend that reads the secrets at boot (palbase run, a machine) shows here as a read, with the key it read with: palbase keys:list names the key.","An encrypted column's values opened through Palbase (Studio's table, a secret key) are recorded under the column's address: --name patients.tc lists who opened them, and when."],flags:{name:{type:"string",value:"NAME",description:"only this secret's, or an encrypted field's opens (table.column)"},dev:{type:"boolean",description:"only the development secrets"},prod:{type:"boolean",description:"only the production secrets"},limit:{type:"string",value:"n",description:"how many (default 30)"}},scope:"environment",async run(e){let t=await f(e);if(e.flags.dev===!0&&e.flags.prod===!0)throw h("--dev or --prod, not both");let n=Number(e.flags.limit??30);if(!Number.isInteger(n)||n<1||n>500)throw h("--limit is a whole number from 1 to 500");let s=new URLSearchParams({limit:String(n),...e.flags.name?{name:e.flags.name}:{},...e.flags.dev===!0?{environment:"development"}:e.flags.prod===!0?{environment:"production"}:{}}),a=await g(e,t,"GET",`/secrets/audit?${s}`);e.out.result(a,()=>{a.entries.length===0?e.out.line("No read or write of a secret yet."):e.out.table(a.entries,[{header:"when",value:o=>o.at.slice(0,19).replace("T"," ")},{header:"what",value:o=>o.action},{header:"set",value:o=>o.environment??""},{header:"secret",value:o=>o.name?`${o.name}${o.version?` v${o.version}`:""}`:"every one"},{header:"key",value:o=>o.key_id}])})}};function dm(e,t){e.out.table(t.keys,[{header:"key",value:n=>`${n.id}${n.id===t.current?" (in force)":""}`},{header:"in force from",value:n=>n.activates_at.slice(0,19).replace("T"," ")},{header:"made by",value:n=>n.created_by}])}var z$={name:"fields:list",summary:"the keys the environment's encrypted database fields are sealed with \u2014 never the keys themselves",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/secrets/fields");e.out.result(n,()=>dm(e,n))}},q$={name:"fields:rotate",summary:"make a new key for the environment's encrypted fields (an owner's or an admin's)",details:["It comes into force in five minutes: by then every running backend has fetched it. New values are sealed with it from then on; a palbase/backend app seals its older values again with it, in the background.","The older keys go on opening what they sealed."],scope:"environment",async run(e){let t=await f(e);await k(e,t,"rotate the encrypted fields' key");let n=await g(e,t,"POST","/secrets/fields/rotate"),s=n.keys[n.keys.length-1];e.out.result(n,()=>{e.out.line(`Made ${s.id} in ${ee(t)}: in force from ${s.activates_at.slice(0,19).replace("T"," ")} UTC.`),dm(e,n)})}},G$={name:"fields:keys",summary:"download the environment's field keys into a file (its owner's): what opens a dump of its database elsewhere",usage:"--out <file>",details:["The file opens every encrypted field of the environment: keep it as you would the database's password. It is the shape palbase/server's Fields reads: new Fields({ fetch: async () => JSON.parse(readFileSync(file, 'utf8')) }).","The download is in the secrets audit trail (secrets:audit)."],flags:{out:{type:"string",value:"file",description:"where the keys go (made readable by you alone); never the screen"}},scope:"environment",async run(e){let t=e.flags.out;if(!t)throw h("fields:keys writes the keys into a file: --out <file> (never onto the screen, which keeps them)");let n=await f(e),s=await g(e,n,"GET","/secrets/fields/keys");await E$(t,`${JSON.stringify(s,null,2)}
21
+ `}function Q(e,t){try{return c("palbase",e,t)}catch(n){throw n instanceof G&&n.code==="invalid_path_parameter"?new b("unsafe_path",`${e} cannot be ${t===""?"empty":JSON.stringify(t)}: a request's path cannot carry it`):n}}function fp(e){return{name:"login",summary:"sign in with your Studio account",details:["Shows a one-time code and opens Studio, where you approve it while signed in there.","The CLI then holds a session of yours: Studio lists it with your others, and ending it there signs the CLI out.","On a machine with no browser (a server, an agent), open the address it prints on any device."],flags:{"no-browser":{type:"boolean",description:"print the address instead of opening a browser"},...e?{owner:{type:"boolean",description:"Palbase's own project's owner: confirm with your passkey in this computer's browser, for 15 minutes of changes to it"}}:{}},scope:"none",async run(t){if(t.io.env.PALBASE_TOKEN)throw new b("token_in_use","PALBASE_TOKEN is set: the CLI acts with that token, and a sign-in would not be used",{hint:"unset PALBASE_TOKEN to sign in as yourself"});if(e&&t.flags.owner===!0){await e(t);return}let n=await Uu(t.io,t.cloud),s=`${t.cloud.studioWeb}/device`;t.out.note(""),t.out.note(` Enter this code in your browser: ${n.user_code}`),t.out.note("");let a=t.flags["no-browser"]!==!0&&t.interactive&&await t.io.openBrowser(s);t.out.note(a?`Opened ${s} \u2014 sign in there if asked, then enter the code.`:`Open ${s} on any device, sign in, and enter the code.`),t.out.note("Waiting for the approval\u2026");let o=await Wu(t.io,t.cloud,n);await t.state.writeSession(o),t.out.result({user:o.user},()=>t.out.line(`Signed in as ${o.user.email??o.user.id}.`))}}}var OK=fp(),nm={name:"logout",summary:"sign out: the session is ended at Palbase and forgotten on this computer",scope:"none",async run(e){if(e.io.env.PALBASE_TOKEN)throw new b("token_in_use","PALBASE_TOKEN is set: logout ends your own sign-in, and the CLI acts with the token",{hint:"unset PALBASE_TOKEN to sign out"});let t=await e.state.readSession();if(!t){e.out.result({signed_out:!0},()=>e.out.line("You were not signed in."));return}for(let[n,s]of Object.entries(await e.state.personalKeys()))try{await e.studio.request("DELETE",`/environments/${Q("the environment's ref",n)}/personal-key/${Q("the personal key's id",s.id)}`)}catch(a){a instanceof Error&&"status"in a&&a.status===404||e.out.warn(`your key at ${n} (${s.label}) could not be revoked: ${a instanceof Error?a.message:String(a)} \u2014 revoke it in Studio, or it ends ${s.expires_at}`)}await e.state.forgetPersonalKeys(),await e.state.forget("owner.json");try{await Bu(e.io,e.cloud,t)}catch(n){e.out.warn(`${n instanceof Error?n.message:String(n)} \u2014 end the session in Studio (Account \u203A Sessions)`)}await e.state.clearSession(),e.out.result({signed_out:!0},()=>e.out.line(`Signed out ${t.user.email??t.user.id}.`))}},sm={name:"whoami",summary:"the account the CLI acts as, and the environment chosen for this directory",scope:"account",async run(e){let t=e.io.env.PALBASE_TOKEN,n;if(t?.startsWith("pbu_")){let{organizations:a}=await e.studio.get("/orgs");n={id:`account token \u2026${t.slice(-4)}`,via:"token",organizations:a.length}}else if(t?.startsWith("pbo_")){let{organizations:a}=await e.studio.get("/orgs"),o=a[0];n={id:`token \u2026${t.slice(-4)}`,via:"token",...o&&{organization:{id:o.id,name:o.name,role:o.role}}}}else if(t){let a=up(t);n={id:String(a.sub??""),...typeof a.email=="string"?{email:a.email}:{},via:"token"}}else n={...(await e.studio.currentSession()).user,via:"session"};let s=await e.state.targetFor(e.io.cwd);e.out.result({user:n,target:s?.target??null,target_dir:s?.dir??null},()=>{e.out.line(n.organization?`an access token of ${le(n.organization.name)} (${n.organization.role}), ${n.id} (PALBASE_TOKEN)`:n.organizations!==void 0?`an ${n.id} (PALBASE_TOKEN): an admin of the ${n.organizations} organization${n.organizations===1?"":"s"} it opened`:`${n.email??n.id}${n.via==="token"?" (PALBASE_TOKEN)":""}`),s&&e.out.line(`${s.target.org_name} \u203A ${s.target.project_name} \u203A ${s.target.env_name} (${s.target.env_slug}) \u2014 chosen for ${s.dir}`)})}};var KS={name:"account:tokens:list",summary:"your account tokens (for a program that opens organizations): name, how many organizations they reach, when they end and were last used \u2014 never their values",scope:"account",async run(e){let{tokens:t}=await e.studio.get("/account/tokens");e.out.result({tokens:t},()=>{t.length===0?e.out.line("You have no account token yet: palbase account:tokens:create <name> makes one."):e.out.table(t,[{header:"name",value:n=>le(n.name)},{header:"token",value:n=>`pbu_\u2026${n.hint}`},{header:"organizations",value:n=>String(n.organizations)},{header:"ends",value:n=>n.expires_at.slice(0,10)},{header:"last used",value:n=>n.last_used_at?.slice(0,16).replace("T"," ")??"never"},{header:"id",value:n=>n.id}])})}},US={name:"account:tokens:create",summary:"make an account token for a program that opens organizations; its value is shown this once",usage:"<name> [--days <n>]",details:["Give it to the program as its secret (PALBASE_TOKEN, or palbase/cloud's token): it opens organizations \u2014 you their owner, the token their admin \u2014 and builds projects and environments there.","It reaches only the organizations it opened, never your others; it makes no token or key and changes no one's place. It ends after --days (default 90, at most 365), when it is revoked, and, in an organization, when you leave it."],args:{min:1,max:1},flags:{days:{type:"string",value:"n",description:"how many days it is good for (default 90)"}},scope:"account",async run(e){let t=e.flags.days===void 0?90:Number(e.flags.days);if(!Number.isInteger(t)||t<1||t>365)throw h("--days is a whole number from 1 to 365");let n=await e.studio.post("/account/tokens",{name:e.args[0],expires_in_days:t});e.out.result(n,()=>{e.out.line(`Made the account token ${le(n.name)} (until ${n.expires_at.slice(0,10)}).`),e.out.line(`token (shown this once \u2014 keep it as the program's secret PALBASE_TOKEN): ${n.token}`)})}},WS={name:"account:tokens:revoke",summary:"revoke one of your account tokens (by its name or id): refused from its next request on; the organizations it opened stay yours",usage:"<name|id>",args:{min:1,max:1},scope:"account",async run(e){let{tokens:t}=await e.studio.get("/account/tokens"),n=t.filter(s=>s.id===e.args[0]||s.name===e.args[0]);if(n.length===0)throw new b("no_such_token",`you have no account token ${JSON.stringify(e.args[0])}`,{hint:"palbase account:tokens:list shows them"});if(n.length>1)throw new b("ambiguous_token",`${JSON.stringify(e.args[0])} names more than one token`,{hint:"pass its id"});await e.studio.request("DELETE",`/account/tokens/${Q("the token's id",n[0].id)}`),e.out.result({revoked:n[0].id},()=>e.out.line(`Revoked the account token ${le(n[0].name)}.`))}},am=[KS,US,WS];var er={};wt(er,{client:()=>FS});function FS(e){return{async draftAgent(t){return e.send({op:"DraftAgent",method:"POST",path:"/ai/agent-drafts",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAgents(t){return e.send({op:"ListAgents",method:"GET",path:"/ai/agents",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getAgent(t){return e.send({op:"GetAgent",method:"GET",path:"/ai/agents/"+c("GetAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putAgent(t){return e.send({op:"PutAgent",method:"PUT",path:"/ai/agents/"+c("PutAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteAgent(t){return e.send({op:"DeleteAgent",method:"DELETE",path:"/ai/agents/"+c("DeleteAgent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async publishAgent(t){return e.send({op:"PublishAgent",method:"POST",path:"/ai/agents/"+c("PublishAgent","name",t.path.name)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rollbackAgent(t){return e.send({op:"RollbackAgent",method:"POST",path:"/ai/agents/"+c("RollbackAgent","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAgentVersions(t){return e.send({op:"ListAgentVersions",method:"GET",path:"/ai/agents/"+c("ListAgentVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createAudioSpeech(t){return e.send({op:"CreateAudioSpeech",method:"POST",path:"/ai/audio/speech",auth:[["SecretKeyAuth"]],answers:{200:"raw"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createAudioTranscription(t){return e.send({op:"CreateAudioTranscription",method:"POST",path:"/ai/audio/transcriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChats(t){return e.send({op:"ListChats",method:"GET",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createChat(t){return e.send({op:"CreateChat",method:"POST",path:"/ai/chats",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChat(t){return e.send({op:"GetChat",method:"GET",path:"/ai/chats/"+c("GetChat","chat_id",t.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteChat(t){return e.send({op:"DeleteChat",method:"DELETE",path:"/ai/chats/"+c("DeleteChat","chat_id",t.path.chat_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async decideChatApproval(t){return e.send({op:"DecideChatApproval",method:"POST",path:"/ai/chats/"+c("DecideChatApproval","chat_id",t.path.chat_id)+"/approvals/"+c("DecideChatApproval","approval_id",t.path.approval_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatExecution(t){return e.send({op:"GetChatExecution",method:"GET",path:"/ai/chats/"+c("GetChatExecution","chat_id",t.path.chat_id)+"/execution",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async patchChatExecution(t){return e.send({op:"PatchChatExecution",method:"PATCH",path:"/ai/chats/"+c("PatchChatExecution","chat_id",t.path.chat_id)+"/execution",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async forkChat(t){return e.send({op:"ForkChat",method:"POST",path:"/ai/chats/"+c("ForkChat","chat_id",t.path.chat_id)+"/fork",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatGoal(t){return e.send({op:"GetChatGoal",method:"GET",path:"/ai/chats/"+c("GetChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setChatGoal(t){return e.send({op:"SetChatGoal",method:"PUT",path:"/ai/chats/"+c("SetChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearChatGoal(t){return e.send({op:"ClearChatGoal",method:"DELETE",path:"/ai/chats/"+c("ClearChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async updateChatGoal(t){return e.send({op:"UpdateChatGoal",method:"PATCH",path:"/ai/chats/"+c("UpdateChatGoal","chat_id",t.path.chat_id)+"/goal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async handoffChat(t){return e.send({op:"HandoffChat",method:"POST",path:"/ai/chats/"+c("HandoffChat","chat_id",t.path.chat_id)+"/handoff",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async putChatMember(t){return e.send({op:"PutChatMember",method:"PUT",path:"/ai/chats/"+c("PutChatMember","chat_id",t.path.chat_id)+"/members/"+c("PutChatMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteChatMember(t){return e.send({op:"DeleteChatMember",method:"DELETE",path:"/ai/chats/"+c("DeleteChatMember","chat_id",t.path.chat_id)+"/members/"+c("DeleteChatMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listChatMessages(t){return e.send({op:"ListChatMessages",method:"GET",path:"/ai/chats/"+c("ListChatMessages","chat_id",t.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sendChatMessage(t){return e.send({op:"SendChatMessage",method:"POST",path:"/ai/chats/"+c("SendChatMessage","chat_id",t.path.chat_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatMessageAttachment(t){return e.send({op:"GetChatMessageAttachment",method:"GET",path:"/ai/chats/"+c("GetChatMessageAttachment","chat_id",t.path.chat_id)+"/messages/"+c("GetChatMessageAttachment","message_id",t.path.message_id)+"/attachments/"+c("GetChatMessageAttachment","position",t.path.position),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async listChatParts(t){return e.send({op:"ListChatParts",method:"GET",path:"/ai/chats/"+c("ListChatParts","chat_id",t.path.chat_id)+"/parts",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putChatPipe(t){return e.send({op:"PutChatPipe",method:"PUT",path:"/ai/chats/"+c("PutChatPipe","chat_id",t.path.chat_id)+"/pipe",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteChatPipe(t){return e.send({op:"DeleteChatPipe",method:"DELETE",path:"/ai/chats/"+c("DeleteChatPipe","chat_id",t.path.chat_id)+"/pipe",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async sendSubagentMessage(t){return e.send({op:"SendSubagentMessage",method:"POST",path:"/ai/chats/"+c("SendSubagentMessage","chat_id",t.path.chat_id)+"/runs/"+c("SendSubagentMessage","run_id",t.path.run_id)+"/messages",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopSubagent(t){return e.send({op:"StopSubagent",method:"POST",path:"/ai/chats/"+c("StopSubagent","chat_id",t.path.chat_id)+"/runs/"+c("StopSubagent","run_id",t.path.run_id)+"/stop",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopChat(t){return e.send({op:"StopChat",method:"POST",path:"/ai/chats/"+c("StopChat","chat_id",t.path.chat_id)+"/stop",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTurnToolCalls(t){return e.send({op:"ListTurnToolCalls",method:"GET",path:"/ai/chats/"+c("ListTurnToolCalls","chat_id",t.path.chat_id)+"/tool-calls",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getChatToolCall(t){return e.send({op:"GetChatToolCall",method:"GET",path:"/ai/chats/"+c("GetChatToolCall","chat_id",t.path.chat_id)+"/tool-calls/"+c("GetChatToolCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async answerChatToolCall(t){return e.send({op:"AnswerChatToolCall",method:"POST",path:"/ai/chats/"+c("AnswerChatToolCall","chat_id",t.path.chat_id)+"/tool-outputs/"+c("AnswerChatToolCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChatTurnArtifacts(t){return e.send({op:"ListChatTurnArtifacts",method:"GET",path:"/ai/chats/"+c("ListChatTurnArtifacts","chat_id",t.path.chat_id)+"/turns/"+c("ListChatTurnArtifacts","response_id",t.path.response_id)+"/artifacts",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getChatTurnArtifact(t){return e.send({op:"GetChatTurnArtifact",method:"GET",path:"/ai/chats/"+c("GetChatTurnArtifact","chat_id",t.path.chat_id)+"/turns/"+c("GetChatTurnArtifact","response_id",t.path.response_id)+"/artifacts/"+c("GetChatTurnArtifact","artifact_id",t.path.artifact_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async getChatTurnCost(t){return e.send({op:"GetChatTurnCost",method:"GET",path:"/ai/chats/"+c("GetChatTurnCost","chat_id",t.path.chat_id)+"/turns/"+c("GetChatTurnCost","response_id",t.path.response_id)+"/cost",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async startChatVoice(t){return e.send({op:"StartChatVoice",method:"POST",path:"/ai/chats/"+c("StartChatVoice","chat_id",t.path.chat_id)+"/voice",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChatVoice(t){return e.send({op:"GetChatVoice",method:"GET",path:"/ai/chats/"+c("GetChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("GetChatVoice","voice_id",t.path.voice_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async closeChatVoice(t){return e.send({op:"CloseChatVoice",method:"DELETE",path:"/ai/chats/"+c("CloseChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("CloseChatVoice","voice_id",t.path.voice_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async commandChatVoice(t){return e.send({op:"CommandChatVoice",method:"POST",path:"/ai/chats/"+c("CommandChatVoice","chat_id",t.path.chat_id)+"/voice/"+c("CommandChatVoice","voice_id",t.path.voice_id)+"/commands",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createEmbeddings(t){return e.send({op:"CreateEmbeddings",method:"POST",path:"/ai/embeddings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEndpoints(t){return e.send({op:"ListEndpoints",method:"GET",path:"/ai/endpoints",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putEndpoint(t){return e.send({op:"PutEndpoint",method:"PUT",path:"/ai/endpoints/"+c("PutEndpoint","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEndpoint(t){return e.send({op:"DeleteEndpoint",method:"DELETE",path:"/ai/endpoints/"+c("DeleteEndpoint","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnv(t){return e.send({op:"ListEnv",method:"GET",path:"/ai/env",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listEnvAllowances(t){return e.send({op:"ListEnvAllowances",method:"GET",path:"/ai/env/allowances",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async deleteEnvAllowance(t){return e.send({op:"DeleteEnvAllowance",method:"DELETE",path:"/ai/env/allowances/"+c("DeleteEnvAllowance","allowance_id",t.path.allowance_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnvHostRequests(t){return e.send({op:"ListEnvHostRequests",method:"GET",path:"/ai/env/host-requests",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async allowEnvHostRequest(t){return e.send({op:"AllowEnvHostRequest",method:"POST",path:"/ai/env/host-requests/"+c("AllowEnvHostRequest","request_id",t.path.request_id)+"/allow",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async dismissEnvHostRequest(t){return e.send({op:"DismissEnvHostRequest",method:"POST",path:"/ai/env/host-requests/"+c("DismissEnvHostRequest","request_id",t.path.request_id)+"/dismiss",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEnv(t){return e.send({op:"PutEnv",method:"PUT",path:"/ai/env/"+c("PutEnv","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnv(t){return e.send({op:"DeleteEnv",method:"DELETE",path:"/ai/env/"+c("DeleteEnv","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async allowEnvHost(t){return e.send({op:"AllowEnvHost",method:"POST",path:"/ai/env/"+c("AllowEnvHost","key",t.path.key)+"/hosts",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEnvironments(t){return e.send({op:"ListEnvironments",method:"GET",path:"/ai/environments",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createEnvironment(t){return e.send({op:"CreateEnvironment",method:"POST",path:"/ai/environments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getEnvironment(t){return e.send({op:"GetEnvironment",method:"GET",path:"/ai/environments/"+c("GetEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEnvironment(t){return e.send({op:"PutEnvironment",method:"PUT",path:"/ai/environments/"+c("PutEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnvironment(t){return e.send({op:"DeleteEnvironment",method:"DELETE",path:"/ai/environments/"+c("DeleteEnvironment","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async createImage(t){return e.send({op:"CreateImage",method:"POST",path:"/ai/images",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getImage(t){return e.send({op:"GetImage",method:"GET",path:"/ai/images/"+c("GetImage","image_id",t.path.image_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getImageFile(t){return e.send({op:"GetImageFile",method:"GET",path:"/ai/images/"+c("GetImageFile","image_id",t.path.image_id)+"/files/"+c("GetImageFile","position",t.path.position),auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async getMachine(t){return e.send({op:"GetMachine",method:"GET",path:"/ai/machines/"+c("GetMachine","machine",t.path.machine),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMachine(t){return e.send({op:"DeleteMachine",method:"DELETE",path:"/ai/machines/"+c("DeleteMachine","machine",t.path.machine),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async cordonMachine(t){return e.send({op:"CordonMachine",method:"POST",path:"/ai/machines/"+c("CordonMachine","machine",t.path.machine)+"/cordon",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async resumeMachine(t){return e.send({op:"ResumeMachine",method:"POST",path:"/ai/machines/"+c("ResumeMachine","machine",t.path.machine)+"/resume",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listModels(t){return e.send({op:"ListModels",method:"GET",path:"/ai/models",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async revokePoolKey(t){return e.send({op:"RevokePoolKey",method:"POST",path:"/ai/pool-keys/"+c("RevokePoolKey","key",t.path.key)+"/revoke",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listPools(t){return e.send({op:"ListPools",method:"GET",path:"/ai/pools",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPool(t){return e.send({op:"CreatePool",method:"POST",path:"/ai/pools",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePool(t){return e.send({op:"DeletePool",method:"DELETE",path:"/ai/pools/"+c("DeletePool","pool",t.path.pool),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listPoolKeys(t){return e.send({op:"ListPoolKeys",method:"GET",path:"/ai/pools/"+c("ListPoolKeys","pool",t.path.pool)+"/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPoolKey(t){return e.send({op:"CreatePoolKey",method:"POST",path:"/ai/pools/"+c("CreatePoolKey","pool",t.path.pool)+"/keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPoolState(t){return e.send({op:"GetPoolState",method:"GET",path:"/ai/pools/"+c("GetPoolState","pool",t.path.pool)+"/state",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listProviders(t){return e.send({op:"ListProviders",method:"GET",path:"/ai/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectProvider(t){return e.send({op:"ConnectProvider",method:"PUT",path:"/ai/providers/"+c("ConnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async disconnectProvider(t){return e.send({op:"DisconnectProvider",method:"DELETE",path:"/ai/providers/"+c("DisconnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async createResponse(t){return e.send({op:"CreateResponse",method:"POST",path:"/ai/responses",auth:[["SecretKeyAuth"]],answers:{200:"raw",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getResponse(t){return e.send({op:"GetResponse",method:"GET",path:"/ai/responses/"+c("GetResponse","response_id",t.path.response_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelResponse(t){return e.send({op:"CancelResponse",method:"POST",path:"/ai/responses/"+c("CancelResponse","response_id",t.path.response_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async followResponse(t){return e.send({op:"FollowResponse",method:"GET",path:"/ai/responses/"+c("FollowResponse","response_id",t.path.response_id)+"/live",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/ai/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSpend(t){return e.send({op:"GetSpend",method:"GET",path:"/ai/spend",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async askSupport(t){return e.send({op:"AskSupport",method:"POST",path:"/ai/support-questions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTools(t){return e.send({op:"ListTools",method:"GET",path:"/ai/tools",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listUsage(t){return e.send({op:"ListUsage",method:"GET",path:"/ai/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async gatewayAudioSpeech(t){return e.send({op:"GatewayAudioSpeech",method:"POST",path:"/ai/v1/audio/speech",auth:[["SecretKeyAuth"]],answers:{200:"raw"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayAudioTranscriptions(t){return e.send({op:"GatewayAudioTranscriptions",method:"POST",path:"/ai/v1/audio/transcriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayChatCompletions(t){return e.send({op:"GatewayChatCompletions",method:"POST",path:"/ai/v1/chat/completions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayEmbeddings(t){return e.send({op:"GatewayEmbeddings",method:"POST",path:"/ai/v1/embeddings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayImagesGenerations(t){return e.send({op:"GatewayImagesGenerations",method:"POST",path:"/ai/v1/images/generations",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayAnthropicMessages(t){return e.send({op:"GatewayAnthropicMessages",method:"POST",path:"/ai/v1/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async gatewayListModels(t){return e.send({op:"GatewayListModels",method:"GET",path:"/ai/v1/models",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async gatewayResponses(t){return e.send({op:"GatewayResponses",method:"POST",path:"/ai/v1/responses",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createVideo(t){return e.send({op:"CreateVideo",method:"POST",path:"/ai/videos",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getVideo(t){return e.send({op:"GetVideo",method:"GET",path:"/ai/videos/"+c("GetVideo","video_id",t.path.video_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelVideo(t){return e.send({op:"CancelVideo",method:"POST",path:"/ai/videos/"+c("CancelVideo","video_id",t.path.video_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTriggers(t){return e.send({op:"ListTriggers",method:"GET",path:"/ai/triggers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTrigger(t){return e.send({op:"CreateTrigger",method:"POST",path:"/ai/triggers",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTrigger(t){return e.send({op:"GetTrigger",method:"GET",path:"/ai/triggers/"+c("GetTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteTrigger(t){return e.send({op:"DeleteTrigger",method:"DELETE",path:"/ai/triggers/"+c("DeleteTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateTrigger(t){return e.send({op:"UpdateTrigger",method:"PATCH",path:"/ai/triggers/"+c("UpdateTrigger","trigger_id",t.path.trigger_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async testTrigger(t){return e.send({op:"TestTrigger",method:"POST",path:"/ai/triggers/"+c("TestTrigger","trigger_id",t.path.trigger_id)+"/test",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async invokeTriggerWebhook(t){return e.send({op:"InvokeTriggerWebhook",method:"POST",path:"/ai/triggers/"+c("InvokeTriggerWebhook","trigger_id",t.path.trigger_id)+"/hook",auth:[],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWaits(t){return e.send({op:"ListWaits",method:"GET",path:"/ai/waits",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getWait(t){return e.send({op:"GetWait",method:"GET",path:"/ai/waits/"+c("GetWait","wait_id",t.path.wait_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async signalWait(t){return e.send({op:"SignalWait",method:"POST",path:"/ai/waits/"+c("SignalWait","wait_id",t.path.wait_id)+"/signal",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelWait(t){return e.send({op:"CancelWait",method:"POST",path:"/ai/waits/"+c("CancelWait","wait_id",t.path.wait_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listWorkflowRuns(t){return e.send({op:"ListWorkflowRuns",method:"GET",path:"/ai/workflows/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createWorkflowRun(t){return e.send({op:"CreateWorkflowRun",method:"POST",path:"/ai/workflows/runs",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWorkflowRun(t){return e.send({op:"GetWorkflowRun",method:"GET",path:"/ai/workflows/runs/"+c("GetWorkflowRun","run_id",t.path.run_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async recordWorkflowStep(t){return e.send({op:"RecordWorkflowStep",method:"POST",path:"/ai/workflows/runs/"+c("RecordWorkflowStep","run_id",t.path.run_id)+"/steps/"+c("RecordWorkflowStep","step_key",t.path.step_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeWorkflowRun(t){return e.send({op:"CompleteWorkflowRun",method:"POST",path:"/ai/workflows/runs/"+c("CompleteWorkflowRun","run_id",t.path.run_id)+"/complete",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async replayWorkflowRun(t){return e.send({op:"ReplayWorkflowRun",method:"POST",path:"/ai/workflows/runs/"+c("ReplayWorkflowRun","run_id",t.path.run_id)+"/replay",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stopRunTree(t){return e.send({op:"StopRunTree",method:"POST",path:"/ai/runs/"+c("StopRunTree","root_id",t.path.root_id)+"/stop-tree",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getMemory(t){return e.send({op:"GetMemory",method:"GET",path:"/ai/memory/"+c("GetMemory","namespace",t.path.namespace)+"/"+c("GetMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putMemory(t){return e.send({op:"PutMemory",method:"PUT",path:"/ai/memory/"+c("PutMemory","namespace",t.path.namespace)+"/"+c("PutMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMemory(t){return e.send({op:"DeleteMemory",method:"DELETE",path:"/ai/memory/"+c("DeleteMemory","namespace",t.path.namespace)+"/"+c("DeleteMemory","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async searchMemory(t){return e.send({op:"SearchMemory",method:"POST",path:"/ai/memory/search",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listActorGroupMembers(t){return e.send({op:"ListActorGroupMembers",method:"GET",path:"/ai/groups/"+c("ListActorGroupMembers","group_id",t.path.group_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addActorGroupMember(t){return e.send({op:"AddActorGroupMember",method:"POST",path:"/ai/groups/"+c("AddActorGroupMember","group_id",t.path.group_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async broadcastActorGroup(t){return e.send({op:"BroadcastActorGroup",method:"POST",path:"/ai/groups/"+c("BroadcastActorGroup","group_id",t.path.group_id)+"/broadcast",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getA2AAgentCard(t){return e.send({op:"GetA2AAgentCard",method:"GET",path:"/.well-known/agent.json",auth:[],answers:{200:"json"},signal:t?.signal})},async callA2Arpc(t){return e.send({op:"CallA2ARPC",method:"POST",path:"/ai/a2a",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async putMcpUserCredential(t){return e.send({op:"PutMCPUserCredential",method:"POST",path:"/ai/endpoints/"+c("PutMCPUserCredential","name",t.path.name)+"/user-credentials/"+c("PutMCPUserCredential","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMcpUserCredential(t){return e.send({op:"DeleteMCPUserCredential",method:"DELETE",path:"/ai/endpoints/"+c("DeleteMCPUserCredential","name",t.path.name)+"/user-credentials/"+c("DeleteMCPUserCredential","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async startMcpoAuth(t){return e.send({op:"StartMCPOAuth",method:"GET",path:"/ai/endpoints/"+c("StartMCPOAuth","name",t.path.name)+"/oauth/start",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async completeMcpoAuthCallback(t){return e.send({op:"CompleteMCPOAuthCallback",method:"GET",path:"/ai/mcp/oauth/callback",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listTemplates(t){return e.send({op:"ListTemplates",method:"GET",path:"/ai/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplate(t){return e.send({op:"GetTemplate",method:"GET",path:"/ai/templates/"+c("GetTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putTemplate(t){return e.send({op:"PutTemplate",method:"PUT",path:"/ai/templates/"+c("PutTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTemplate(t){return e.send({op:"DeleteTemplate",method:"DELETE",path:"/ai/templates/"+c("DeleteTemplate","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async publishTemplate(t){return e.send({op:"PublishTemplate",method:"POST",path:"/ai/templates/"+c("PublishTemplate","name",t.path.name)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rollbackTemplate(t){return e.send({op:"RollbackTemplate",method:"POST",path:"/ai/templates/"+c("RollbackTemplate","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTemplateVersions(t){return e.send({op:"ListTemplateVersions",method:"GET",path:"/ai/templates/"+c("ListTemplateVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listUserSpend(t){return e.send({op:"ListUserSpend",method:"GET",path:"/ai/users/spend",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getUserQuota(t){return e.send({op:"GetUserQuota",method:"GET",path:"/ai/users/"+c("GetUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putUserQuota(t){return e.send({op:"PutUserQuota",method:"PUT",path:"/ai/users/"+c("PutUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserQuota(t){return e.send({op:"DeleteUserQuota",method:"DELETE",path:"/ai/users/"+c("DeleteUserQuota","user_id",t.path.user_id)+"/quota",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async clientAttestChallenge(t){return e.send({op:"ClientAttestChallenge",method:"POST",path:"/ai/client/attest-challenge",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async runClientTemplate(t){return e.send({op:"RunClientTemplate",method:"POST",path:"/ai/client/templates/"+c("RunClientTemplate","name",t.path.name)+"/run",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async voiceClientTemplate(t){return e.send({op:"VoiceClientTemplate",method:"POST",path:"/ai/client/templates/"+c("VoiceClientTemplate","name",t.path.name)+"/voice",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMachineKey(t){return e.send({op:"CreateMachineKey",method:"POST",path:"/ai/machine-keys",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachines(t){return e.send({op:"ListMachines",method:"GET",path:"/ai/machines",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var Co={};wt(Co,{client:()=>BS});function BS(e){return{async listAudiences(t){return e.send({op:"ListAudiences",method:"GET",path:"/analytics/audiences",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createAudience(t){return e.send({op:"CreateAudience",method:"POST",path:"/analytics/audiences",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async previewAudience(t){return e.send({op:"PreviewAudience",method:"POST",path:"/analytics/audiences/preview",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAudience(t){return e.send({op:"GetAudience",method:"GET",path:"/analytics/audiences/"+c("GetAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteAudience(t){return e.send({op:"DeleteAudience",method:"DELETE",path:"/analytics/audiences/"+c("DeleteAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateAudience(t){return e.send({op:"UpdateAudience",method:"PATCH",path:"/analytics/audiences/"+c("UpdateAudience","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listAudienceMembers(t){return e.send({op:"ListAudienceMembers",method:"GET",path:"/analytics/audiences/"+c("ListAudienceMembers","id",t.path.id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async alias(t){return e.send({op:"Alias",method:"POST",path:"/analytics/alias",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async batch(t){return e.send({op:"Batch",method:"POST",path:"/analytics/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getEventBreakdown(t){return e.send({op:"GetEventBreakdown",method:"GET",path:"/analytics/breakdown",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async capture(t){return e.send({op:"Capture",method:"POST",path:"/analytics/capture",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendConsoleHistory(t){return e.send({op:"SendConsoleHistory",method:"POST",path:"/analytics/console-breadcrumbs",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getConsoleConfig(t){return e.send({op:"GetConsoleConfig",method:"GET",path:"/analytics/console-breadcrumbs/config",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listConsoleRecords(t){return e.send({op:"ListConsoleRecords",method:"GET",path:"/analytics/console-records",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listEventNames(t){return e.send({op:"ListEventNames",method:"GET",path:"/analytics/event-names",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listEvents(t){return e.send({op:"ListEvents",method:"GET",path:"/analytics/events",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getEventTimeline(t){return e.send({op:"GetEventTimeline",method:"GET",path:"/analytics/events/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async runFunnel(t){return e.send({op:"RunFunnel",method:"POST",path:"/analytics/funnel",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async identify(t){return e.send({op:"Identify",method:"POST",path:"/analytics/identify",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async page(t){return e.send({op:"Page",method:"POST",path:"/analytics/page",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendPerf(t){return e.send({op:"SendPerf",method:"POST",path:"/analytics/perf",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPerfGroups(t){return e.send({op:"ListPerfGroups",method:"GET",path:"/analytics/perf/client",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getPerfConfig(t){return e.send({op:"GetPerfConfig",method:"GET",path:"/analytics/perf/config",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t?.headers,signal:t?.signal})},async getPerfTimeline(t){return e.send({op:"GetPerfTimeline",method:"GET",path:"/analytics/perf/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listRequestLines(t){return e.send({op:"ListRequestLines",method:"GET",path:"/analytics/requests",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMachineTraffic(t){return e.send({op:"GetMachineTraffic",method:"GET",path:"/analytics/machines/"+c("GetMachineTraffic","name",t.path.name)+"/traffic",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async runRetention(t){return e.send({op:"RunRetention",method:"POST",path:"/analytics/retention",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async screen(t){return e.send({op:"Screen",method:"POST",path:"/analytics/screen",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/analytics/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSummary(t){return e.send({op:"GetSummary",method:"GET",path:"/analytics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listTraces(t){return e.send({op:"ListTraces",method:"GET",path:"/analytics/traces",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async sendTrace(t){return e.send({op:"SendTrace",method:"POST",path:"/analytics/traces",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendTraceBatch(t){return e.send({op:"SendTraceBatch",method:"POST",path:"/analytics/traces/batch",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"json",207:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTraceHops(t){return e.send({op:"GetTraceHops",method:"GET",path:"/analytics/traces/by-trace",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listSessionTraces(t){return e.send({op:"ListSessionTraces",method:"GET",path:"/analytics/traces/session",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getTraceSummary(t){return e.send({op:"GetTraceSummary",method:"GET",path:"/analytics/traces/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getTraceTimeline(t){return e.send({op:"GetTraceTimeline",method:"GET",path:"/analytics/traces/timeline",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async searchPeople(t){return e.send({op:"SearchPeople",method:"GET",path:"/analytics/people",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setPersonProperties(t){return e.send({op:"SetPersonProperties",method:"POST",path:"/analytics/people",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{202:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPerson(t){return e.send({op:"GetPerson",method:"GET",path:"/analytics/people/"+c("GetPerson","person_id",t.path.person_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPersonEvents(t){return e.send({op:"ListPersonEvents",method:"GET",path:"/analytics/people/"+c("ListPersonEvents","person_id",t.path.person_id)+"/events",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getEventCatalog(t){return e.send({op:"GetEventCatalog",method:"GET",path:"/analytics/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async defineEvent(t){return e.send({op:"DefineEvent",method:"PUT",path:"/analytics/catalog/"+c("DefineEvent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Oo={};wt(Oo,{client:()=>JS});function JS(e){return{async getAppleAppSiteAssociation(t){return e.send({op:"GetAppleAppSiteAssociation",method:"GET",path:"/.well-known/apple-app-site-association",auth:[],answers:{200:"json"},signal:t?.signal})},async getAssetLinks(t){return e.send({op:"GetAssetLinks",method:"GET",path:"/.well-known/assetlinks.json",auth:[],answers:{200:"json"},signal:t?.signal})},async getJwks(t){return e.send({op:"GetJWKS",method:"GET",path:"/.well-known/jwks.json",auth:[],answers:{200:"json"},signal:t?.signal})},async getOidcDiscovery(t){return e.send({op:"GetOIDCDiscovery",method:"GET",path:"/.well-known/openid-configuration",auth:[],answers:{200:"json"},signal:t?.signal})},async getWebAuthnRelatedOrigins(t){return e.send({op:"GetWebAuthnRelatedOrigins",method:"GET",path:"/.well-known/webauthn",auth:[],answers:{200:"json"},signal:t?.signal})},async adminVerifyDeviceAssertion(t){return e.send({op:"AdminVerifyDeviceAssertion",method:"POST",path:"/admin/attest/devices/assert",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetAttestPolicy(t){return e.send({op:"AdminGetAttestPolicy",method:"GET",path:"/admin/attest/devices/attest-policy",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetAttestObservations(t){return e.send({op:"AdminGetAttestObservations",method:"GET",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminRecordAttestObservations(t){return e.send({op:"AdminRecordAttestObservations",method:"POST",path:"/admin/attest/devices/observations",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListAuditEvents(t){return e.send({op:"AdminListAuditEvents",method:"GET",path:"/admin/audit",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminExportAuditEvents(t){return e.send({op:"AdminExportAuditEvents",method:"GET",path:"/admin/audit/export",auth:[["AdminAuth"]],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async adminVerifyAuditTrail(t){return e.send({op:"AdminVerifyAuditTrail",method:"GET",path:"/admin/audit/verify",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetAuthSettings(t){return e.send({op:"AdminGetAuthSettings",method:"GET",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpdateAuthSettings(t){return e.send({op:"AdminUpdateAuthSettings",method:"PUT",path:"/admin/auth-settings",auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetBreachWatch(t){return e.send({op:"AdminGetBreachWatch",method:"GET",path:"/admin/breach-watch",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminListHooks(t){return e.send({op:"AdminListHooks",method:"GET",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateHook(t){return e.send({op:"AdminCreateHook",method:"POST",path:"/admin/hooks",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminUpdateHook(t){return e.send({op:"AdminUpdateHook",method:"PUT",path:"/admin/hooks/"+c("AdminUpdateHook","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteHook(t){return e.send({op:"AdminDeleteHook",method:"DELETE",path:"/admin/hooks/"+c("AdminDeleteHook","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListHookExecutions(t){return e.send({op:"AdminListHookExecutions",method:"GET",path:"/admin/hooks/"+c("AdminListHookExecutions","id",t.path.id)+"/executions",auth:[["AdminAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminListIntegrations(t){return e.send({op:"AdminListIntegrations",method:"GET",path:"/admin/integrations",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminPutIntegration(t){return e.send({op:"AdminPutIntegration",method:"PUT",path:"/admin/integrations/"+c("AdminPutIntegration","name",t.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteIntegration(t){return e.send({op:"AdminDeleteIntegration",method:"DELETE",path:"/admin/integrations/"+c("AdminDeleteIntegration","name",t.path.name),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListOAuthClients(t){return e.send({op:"AdminListOAuthClients",method:"GET",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateOAuthClient(t){return e.send({op:"AdminCreateOAuthClient",method:"POST",path:"/admin/oauth-clients",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetOAuthClient(t){return e.send({op:"AdminGetOAuthClient",method:"GET",path:"/admin/oauth-clients/"+c("AdminGetOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteOAuthClient(t){return e.send({op:"AdminDeleteOAuthClient",method:"DELETE",path:"/admin/oauth-clients/"+c("AdminDeleteOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateOAuthClient(t){return e.send({op:"AdminUpdateOAuthClient",method:"PATCH",path:"/admin/oauth-clients/"+c("AdminUpdateOAuthClient","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListProviders(t){return e.send({op:"AdminListProviders",method:"GET",path:"/admin/providers",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminGetPhoneSettings(t){return e.send({op:"AdminGetPhoneSettings",method:"GET",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpdatePhoneSettings(t){return e.send({op:"AdminUpdatePhoneSettings",method:"PUT",path:"/admin/providers/phone/settings",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminToggleProvider(t){return e.send({op:"AdminToggleProvider",method:"POST",path:"/admin/providers/"+c("AdminToggleProvider","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListRoles(t){return e.send({op:"AdminListRoles",method:"GET",path:"/admin/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminUpsertRole(t){return e.send({op:"AdminUpsertRole",method:"PUT",path:"/admin/roles/"+c("AdminUpsertRole","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteRole(t){return e.send({op:"AdminDeleteRole",method:"DELETE",path:"/admin/roles/"+c("AdminDeleteRole","name",t.path.name),auth:[["AdminAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminListServiceAccounts(t){return e.send({op:"AdminListServiceAccounts",method:"GET",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateServiceAccount(t){return e.send({op:"AdminCreateServiceAccount",method:"POST",path:"/admin/service-accounts",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetServiceAccount(t){return e.send({op:"AdminGetServiceAccount",method:"GET",path:"/admin/service-accounts/"+c("AdminGetServiceAccount","id",t.path.id),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeServiceAccount(t){return e.send({op:"AdminRevokeServiceAccount",method:"DELETE",path:"/admin/service-accounts/"+c("AdminRevokeServiceAccount","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminRotateServiceAccount(t){return e.send({op:"AdminRotateServiceAccount",method:"POST",path:"/admin/service-accounts/"+c("AdminRotateServiceAccount","id",t.path.id)+"/rotate",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async adminListSessions(t){return e.send({op:"AdminListSessions",method:"GET",path:"/admin/sessions",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminRevokeSession(t){return e.send({op:"AdminRevokeSession",method:"DELETE",path:"/admin/sessions/"+c("AdminRevokeSession","id",t.path.id),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListSigningKeys(t){return e.send({op:"AdminListSigningKeys",method:"GET",path:"/admin/signing-keys",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminRotateSigningKey(t){return e.send({op:"AdminRotateSigningKey",method:"POST",path:"/admin/signing-keys/rotate",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async socialAdminConfig(t){return e.send({op:"SocialAdminConfig",method:"GET",path:"/admin/social-auth",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async socialCredentialPut(t){return e.send({op:"SocialCredentialPut",method:"PUT",path:"/admin/social-auth/credentials/"+c("SocialCredentialPut","key",t.path.key),auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCredentialDelete(t){return e.send({op:"SocialCredentialDelete",method:"DELETE",path:"/admin/social-auth/credentials/"+c("SocialCredentialDelete","key",t.path.key),auth:[["AdminAuth"]],answers:{204:"empty"},headers:t.headers,signal:t.signal})},async socialProviderPatch(t){return e.send({op:"SocialProviderPatch",method:"PATCH",path:"/admin/social-auth/providers/"+c("SocialProviderPatch","provider",t.path.provider),auth:[["AdminAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetStats(t){return e.send({op:"AdminGetStats",method:"GET",path:"/admin/stats",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminSendTestTemplate(t){return e.send({op:"AdminSendTestTemplate",method:"POST",path:"/admin/templates/"+c("AdminSendTestTemplate","key",t.path.key)+"/send-test",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListTestUsers(t){return e.send({op:"AdminListTestUsers",method:"GET",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{200:"json"},signal:t?.signal})},async adminCreateTestUsers(t){return e.send({op:"AdminCreateTestUsers",method:"POST",path:"/admin/test-users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminSetTestUserPhone(t){return e.send({op:"AdminSetTestUserPhone",method:"PUT",path:"/admin/test-users/phone",auth:[["AdminAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminCreateTestSignupAddress(t){return e.send({op:"AdminCreateTestSignupAddress",method:"POST",path:"/admin/test-users/addresses",auth:[["AdminAuth"]],answers:{201:"json"},signal:t?.signal})},async adminDeleteTestUser(t){return e.send({op:"AdminDeleteTestUser",method:"DELETE",path:"/admin/test-users/"+c("AdminDeleteTestUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminCreateCustomToken(t){return e.send({op:"AdminCreateCustomToken",method:"POST",path:"/admin/token/custom",auth:[["AdminAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListUsers(t){return e.send({op:"AdminListUsers",method:"GET",path:"/admin/users",auth:[["AdminAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminCreateUser(t){return e.send({op:"AdminCreateUser",method:"POST",path:"/admin/users",auth:[["AdminAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminImportUsers(t){return e.send({op:"AdminImportUsers",method:"POST",path:"/admin/users/import",auth:[["AdminAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetUser(t){return e.send({op:"AdminGetUser",method:"GET",path:"/admin/users/"+c("AdminGetUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteUser(t){return e.send({op:"AdminDeleteUser",method:"DELETE",path:"/admin/users/"+c("AdminDeleteUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateUser(t){return e.send({op:"AdminUpdateUser",method:"PATCH",path:"/admin/users/"+c("AdminUpdateUser","uid",t.path.uid),auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminBanUser(t){return e.send({op:"AdminBanUser",method:"POST",path:"/admin/users/"+c("AdminBanUser","uid",t.path.uid)+"/ban",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetUserConsents(t){return e.send({op:"AdminGetUserConsents",method:"GET",path:"/admin/users/"+c("AdminGetUserConsents","uid",t.path.uid)+"/consents",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserCredentials(t){return e.send({op:"AdminRevokeUserCredentials",method:"POST",path:"/admin/users/"+c("AdminRevokeUserCredentials","uid",t.path.uid)+"/credentials/revoke-all",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminExportUser(t){return e.send({op:"AdminExportUser",method:"GET",path:"/admin/users/"+c("AdminExportUser","uid",t.path.uid)+"/export",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminListUserMfaFactors(t){return e.send({op:"AdminListUserMFAFactors",method:"GET",path:"/admin/users/"+c("AdminListUserMFAFactors","uid",t.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminResetUserMfa(t){return e.send({op:"AdminResetUserMFA",method:"DELETE",path:"/admin/users/"+c("AdminResetUserMFA","uid",t.path.uid)+"/mfa",auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminResetUserPassword(t){return e.send({op:"AdminResetUserPassword",method:"POST",path:"/admin/users/"+c("AdminResetUserPassword","uid",t.path.uid)+"/reset-password",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminListUserRoles(t){return e.send({op:"AdminListUserRoles",method:"GET",path:"/admin/users/"+c("AdminListUserRoles","uid",t.path.uid)+"/roles",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminAssignUserRole(t){return e.send({op:"AdminAssignUserRole",method:"PUT",path:"/admin/users/"+c("AdminAssignUserRole","uid",t.path.uid)+"/roles/"+c("AdminAssignUserRole","role",t.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserRole(t){return e.send({op:"AdminRevokeUserRole",method:"DELETE",path:"/admin/users/"+c("AdminRevokeUserRole","uid",t.path.uid)+"/roles/"+c("AdminRevokeUserRole","role",t.path.role),auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRevokeUserSessions(t){return e.send({op:"AdminRevokeUserSessions",method:"POST",path:"/admin/users/"+c("AdminRevokeUserSessions","uid",t.path.uid)+"/sessions/revoke-all",auth:[["AdminAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUnbanUser(t){return e.send({op:"AdminUnbanUser",method:"POST",path:"/admin/users/"+c("AdminUnbanUser","uid",t.path.uid)+"/unban",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async signInAnonymously(t){return e.send({op:"SignInAnonymously",method:"POST",path:"/auth/anonymous",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:t?.headers,body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async convertAnonymousUser(t){return e.send({op:"ConvertAnonymousUser",method:"POST",path:"/auth/anonymous/convert",auth:[["ApiKeyAuth","userJWT"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async verifyAnonymousConversion(t){return e.send({op:"VerifyAnonymousConversion",method:"POST",path:"/auth/anonymous/convert/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async devicePendingRequest(t){return e.send({op:"DevicePendingRequest",method:"GET",path:"/auth/device/requests/"+c("DevicePendingRequest","user_code",t.path.user_code),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deviceVerifyPage(t){return e.send({op:"DeviceVerifyPage",method:"GET",path:"/auth/device/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async deviceVerifySubmit(t){return e.send({op:"DeviceVerifySubmit",method:"POST",path:"/auth/device/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/auth/devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async attestAndroidDevice(t){return e.send({op:"AttestAndroidDevice",method:"POST",path:"/auth/devices/attest/android",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attestIosDevice(t){return e.send({op:"AttestIOSDevice",method:"POST",path:"/auth/devices/attest/ios",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bindDeviceKey(t){return e.send({op:"BindDeviceKey",method:"POST",path:"/auth/devices/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createDeviceChallenge(t){return e.send({op:"CreateDeviceChallenge",method:"POST",path:"/auth/devices/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t?.headers,signal:t?.signal})},async verifyAndroidIntegrity(t){return e.send({op:"VerifyAndroidIntegrity",method:"POST",path:"/auth/devices/verify/android",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteDevice(t){return e.send({op:"DeleteDevice",method:"DELETE",path:"/auth/devices/"+c("DeleteDevice","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async verifyDeviceSignature(t){return e.send({op:"VerifyDeviceSignature",method:"POST",path:"/auth/devices/"+c("VerifyDeviceSignature","id",t.path.id)+"/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listIdentities(t){return e.send({op:"ListIdentities",method:"GET",path:"/auth/identities",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async unlinkIdentity(t){return e.send({op:"UnlinkIdentity",method:"DELETE",path:"/auth/identities/"+c("UnlinkIdentity","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async createInstallation(t){return e.send({op:"CreateInstallation",method:"POST",path:"/auth/installations",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bindInstallation(t){return e.send({op:"BindInstallation",method:"POST",path:"/auth/installations/"+c("BindInstallation","id",t.path.id)+"/bind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refreshInstallation(t){return e.send({op:"RefreshInstallation",method:"POST",path:"/auth/installations/"+c("RefreshInstallation","id",t.path.id)+"/refresh",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async revokeInstallation(t){return e.send({op:"RevokeInstallation",method:"POST",path:"/auth/installations/"+c("RevokeInstallation","id",t.path.id)+"/revoke",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unbindInstallation(t){return e.send({op:"UnbindInstallation",method:"POST",path:"/auth/installations/"+c("UnbindInstallation","id",t.path.id)+"/unbind",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async login(t){return e.send({op:"Login",method:"POST",path:"/auth/login",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async logout(t){return e.send({op:"Logout",method:"POST",path:"/auth/logout",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async magicLinkRequest(t){return e.send({op:"MagicLinkRequest",method:"POST",path:"/auth/magic-link",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async magicLinkVerify(t){return e.send({op:"MagicLinkVerify",method:"POST",path:"/auth/magic-link/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMe(t){return e.send({op:"GetMe",method:"GET",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMe(t){return e.send({op:"UpdateMe",method:"PATCH",path:"/auth/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaChallenge(t){return e.send({op:"MfaChallenge",method:"POST",path:"/auth/mfa/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEmailChallenge(t){return e.send({op:"MfaEmailChallenge",method:"POST",path:"/auth/mfa/email/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEmailEnroll(t){return e.send({op:"MfaEmailEnroll",method:"POST",path:"/auth/mfa/email/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaEmailVerify(t){return e.send({op:"MfaEmailVerify",method:"POST",path:"/auth/mfa/email/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaEnroll(t){return e.send({op:"MfaEnroll",method:"POST",path:"/auth/mfa/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaListFactors(t){return e.send({op:"MfaListFactors",method:"GET",path:"/auth/mfa/factors",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaRemoveFactor(t){return e.send({op:"MfaRemoveFactor",method:"DELETE",path:"/auth/mfa/factors/"+c("MfaRemoveFactor","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaRecovery(t){return e.send({op:"MfaRecovery",method:"POST",path:"/auth/mfa/recovery",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaRegenerateRecoveryCodes(t){return e.send({op:"MfaRegenerateRecoveryCodes",method:"POST",path:"/auth/mfa/recovery-codes/regenerate",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mfaSmsChallenge(t){return e.send({op:"MfaSMSChallenge",method:"POST",path:"/auth/mfa/sms/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaSmsEnroll(t){return e.send({op:"MfaSMSEnroll",method:"POST",path:"/auth/mfa/sms/enroll",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaSmsVerifyEnrollment(t){return e.send({op:"MfaSMSVerifyEnrollment",method:"POST",path:"/auth/mfa/sms/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mfaVerifyEnrollment(t){return e.send({op:"MfaVerifyEnrollment",method:"POST",path:"/auth/mfa/verify",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCallbackApple(t){return e.send({op:"SocialCallbackApple",method:"GET",path:"/auth/oauth/callback/apple",auth:[],answers:{},signal:t?.signal})},async socialCallbackApplePost(t){return e.send({op:"SocialCallbackApplePost",method:"POST",path:"/auth/oauth/callback/apple",auth:[],answers:{303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async socialCallbackGitHub(t){return e.send({op:"SocialCallbackGitHub",method:"GET",path:"/auth/oauth/callback/github",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackGitHubPost(t){return e.send({op:"SocialCallbackGitHubPost",method:"POST",path:"/auth/oauth/callback/github",auth:[],answers:{},signal:t?.signal})},async socialCallbackGoogle(t){return e.send({op:"SocialCallbackGoogle",method:"GET",path:"/auth/oauth/callback/google",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackGooglePost(t){return e.send({op:"SocialCallbackGooglePost",method:"POST",path:"/auth/oauth/callback/google",auth:[],answers:{},signal:t?.signal})},async socialCallbackMicrosoft(t){return e.send({op:"SocialCallbackMicrosoft",method:"GET",path:"/auth/oauth/callback/microsoft",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async socialCallbackMicrosoftPost(t){return e.send({op:"SocialCallbackMicrosoftPost",method:"POST",path:"/auth/oauth/callback/microsoft",auth:[],answers:{},signal:t?.signal})},async socialConfig(t){return e.send({op:"SocialConfig",method:"GET",path:"/auth/oauth/config",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async socialBegin(t){return e.send({op:"SocialBegin",method:"POST",path:"/auth/oauth/transactions",auth:[["ApiKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialCancel(t){return e.send({op:"SocialCancel",method:"POST",path:"/auth/oauth/transactions/"+c("SocialCancel","id",t.path.id)+"/cancel",auth:[["ApiKeyAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async socialComplete(t){return e.send({op:"SocialComplete",method:"POST",path:"/auth/oauth/transactions/"+c("SocialComplete","id",t.path.id)+"/complete",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestPhoneOtp(t){return e.send({op:"RequestPhoneOTP",method:"POST",path:"/auth/otp",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async verifyPhoneOtp(t){return e.send({op:"VerifyPhoneOTP",method:"POST",path:"/auth/otp/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async hostedRecoveryApprovalPage(t){return e.send({op:"HostedRecoveryApprovalPage",method:"GET",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedRecoveryApprovalSubmit(t){return e.send({op:"HostedRecoveryApprovalSubmit",method:"POST",path:"/auth/pages/recovery-approval",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedRecoveryContactPage(t){return e.send({op:"HostedRecoveryContactPage",method:"GET",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedRecoveryContactSubmit(t){return e.send({op:"HostedRecoveryContactSubmit",method:"POST",path:"/auth/pages/recovery-contact",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedResetPasswordPage(t){return e.send({op:"HostedResetPasswordPage",method:"GET",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedResetPasswordSubmit(t){return e.send({op:"HostedResetPasswordSubmit",method:"POST",path:"/auth/pages/reset-password",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedVerifyEmailPage(t){return e.send({op:"HostedVerifyEmailPage",method:"GET",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedVerifyEmailSubmit(t){return e.send({op:"HostedVerifyEmailSubmit",method:"POST",path:"/auth/pages/verify-email",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async passwordChange(t){return e.send({op:"PasswordChange",method:"POST",path:"/auth/password/change",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async passwordResetRequest(t){return e.send({op:"PasswordResetRequest",method:"POST",path:"/auth/password/reset",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async passwordResetConfirm(t){return e.send({op:"PasswordResetConfirm",method:"POST",path:"/auth/password/reset/confirm",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setPassword(t){return e.send({op:"SetPassword",method:"POST",path:"/auth/password/set",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async powChallenge(t){return e.send({op:"PowChallenge",method:"POST",path:"/auth/pow/challenge",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async approveRecovery(t){return e.send({op:"ApproveRecovery",method:"POST",path:"/auth/recovery/approve",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRecoveryContacts(t){return e.send({op:"ListRecoveryContacts",method:"GET",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async addRecoveryContact(t){return e.send({op:"AddRecoveryContact",method:"POST",path:"/auth/recovery/contacts",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteRecoveryContact(t){return e.send({op:"DeleteRecoveryContact",method:"DELETE",path:"/auth/recovery/contacts/"+c("DeleteRecoveryContact","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async verifyRecoveryContact(t){return e.send({op:"VerifyRecoveryContact",method:"POST",path:"/auth/recovery/contacts/"+c("VerifyRecoveryContact","id",t.path.id)+"/verify",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async denyRecovery(t){return e.send({op:"DenyRecovery",method:"POST",path:"/auth/recovery/deny",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async initiateRecovery(t){return e.send({op:"InitiateRecovery",method:"POST",path:"/auth/recovery/initiate",auth:[["ApiKeyAuth"]],answers:{200:"json",202:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRecoveryStatus(t){return e.send({op:"GetRecoveryStatus",method:"GET",path:"/auth/recovery/status",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async resendVerification(t){return e.send({op:"ResendVerification",method:"POST",path:"/auth/resend-verification",auth:[["ApiKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSessions(t){return e.send({op:"ListSessions",method:"GET",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async revokeAllSessions(t){return e.send({op:"RevokeAllSessions",method:"DELETE",path:"/auth/sessions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async revokeSession(t){return e.send({op:"RevokeSession",method:"DELETE",path:"/auth/sessions/"+c("RevokeSession","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async signup(t){return e.send({op:"Signup",method:"POST",path:"/auth/signup",auth:[["ApiKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stepUp(t){return e.send({op:"StepUp",method:"POST",path:"/auth/step-up",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stepUpStatus(t){return e.send({op:"StepUpStatus",method:"GET",path:"/auth/step-up/status",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async stepUpWebAuthnBegin(t){return e.send({op:"StepUpWebAuthnBegin",method:"POST",path:"/auth/step-up/webauthn/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async stepUpSmsSend(t){return e.send({op:"StepUpSMSSend",method:"POST",path:"/auth/step-up/sms/send",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async exchangeCustomToken(t){return e.send({op:"ExchangeCustomToken",method:"POST",path:"/auth/token/exchange",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refreshToken(t){return e.send({op:"RefreshToken",method:"POST",path:"/auth/token/refresh",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeRefreshToken(t){return e.send({op:"RevokeRefreshToken",method:"POST",path:"/auth/token/revoke",auth:[["ApiKeyAuth"]],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTransactions(t){return e.send({op:"ListTransactions",method:"GET",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createTransaction(t){return e.send({op:"CreateTransaction",method:"POST",path:"/auth/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTransaction(t){return e.send({op:"GetTransaction",method:"GET",path:"/auth/transactions/"+c("GetTransaction","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async approveTransaction(t){return e.send({op:"ApproveTransaction",method:"POST",path:"/auth/transactions/"+c("ApproveTransaction","id",t.path.id)+"/approve",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async denyTransaction(t){return e.send({op:"DenyTransaction",method:"POST",path:"/auth/transactions/"+c("DenyTransaction","id",t.path.id)+"/deny",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTrustedDevices(t){return e.send({op:"ListTrustedDevices",method:"GET",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async registerTrustedDevice(t){return e.send({op:"RegisterTrustedDevice",method:"POST",path:"/auth/trusted-devices",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeTrustedDevice(t){return e.send({op:"RevokeTrustedDevice",method:"DELETE",path:"/auth/trusted-devices/"+c("RevokeTrustedDevice","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async verifyTokenUser(t){return e.send({op:"VerifyTokenUser",method:"GET",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async deleteAccount(t){return e.send({op:"DeleteAccount",method:"DELETE",path:"/auth/user",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async verifyEmail(t){return e.send({op:"VerifyEmail",method:"POST",path:"/auth/verify-email",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnListCredentials(t){return e.send({op:"WebauthnListCredentials",method:"GET",path:"/auth/webauthn/credentials",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async webauthnRenameCredential(t){return e.send({op:"WebauthnRenameCredential",method:"PUT",path:"/auth/webauthn/credentials/"+c("WebauthnRenameCredential","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnDeleteCredential(t){return e.send({op:"WebauthnDeleteCredential",method:"DELETE",path:"/auth/webauthn/credentials/"+c("WebauthnDeleteCredential","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async webauthnLoginBegin(t){return e.send({op:"WebauthnLoginBegin",method:"POST",path:"/auth/webauthn/login/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnLoginFinish(t){return e.send({op:"WebauthnLoginFinish",method:"POST",path:"/auth/webauthn/login/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRecoveryBegin(t){return e.send({op:"WebauthnRecoveryBegin",method:"POST",path:"/auth/webauthn/recovery/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async webauthnRecoveryFinish(t){return e.send({op:"WebauthnRecoveryFinish",method:"POST",path:"/auth/webauthn/recovery/finish",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRecoveryRegisterBegin(t){return e.send({op:"WebauthnRecoveryRegisterBegin",method:"POST",path:"/auth/webauthn/recovery/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnRecoveryRegisterFinish(t){return e.send({op:"WebauthnRecoveryRegisterFinish",method:"POST",path:"/auth/webauthn/recovery/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnRegisterBegin(t){return e.send({op:"WebauthnRegisterBegin",method:"POST",path:"/auth/webauthn/register/begin",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async webauthnRegisterFinish(t){return e.send({op:"WebauthnRegisterFinish",method:"POST",path:"/auth/webauthn/register/finish",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnSignupBegin(t){return e.send({op:"WebauthnSignupBegin",method:"POST",path:"/auth/webauthn/signup/begin",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async webauthnSignupFinish(t){return e.send({op:"WebauthnSignupFinish",method:"POST",path:"/auth/webauthn/signup/finish",auth:[["ApiKeyAuth"]],answers:{201:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async oauthAuthorize(t){return e.send({op:"OauthAuthorize",method:"GET",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},query:t?.query,signal:t?.signal})},async oauthAuthorizePost(t){return e.send({op:"OauthAuthorizePost",method:"POST",path:"/oauth/authorize",auth:[],answers:{302:"redirect",303:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthAuthorizeCallback(t){return e.send({op:"OauthAuthorizeCallback",method:"GET",path:"/oauth/authorize/callback",auth:[],answers:{303:"redirect"},query:t.query,signal:t.signal})},async oauthAuthorizeEmailLink(t){return e.send({op:"OauthAuthorizeEmailLink",method:"GET",path:"/oauth/authorize/email",auth:[],answers:{200:"raw",303:"redirect"},query:t.query,signal:t.signal})},async oauthDeviceAuthorize(t){return e.send({op:"OauthDeviceAuthorize",method:"POST",path:"/oauth/device",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthIntrospect(t){return e.send({op:"OauthIntrospect",method:"POST",path:"/oauth/introspect",auth:[["AdminAuth"],["OAuthClient"],[]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async oauthLogout(t){return e.send({op:"OauthLogout",method:"GET",path:"/oauth/logout",auth:[],answers:{302:"redirect"},query:t?.query,signal:t?.signal})},async oauthLogoutPost(t){return e.send({op:"OauthLogoutPost",method:"POST",path:"/oauth/logout",auth:[],answers:{302:"redirect"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t?.body},signal:t?.signal})},async oauthPar(t){return e.send({op:"OauthPAR",method:"POST",path:"/oauth/par",auth:[["OAuthClient"],[]],answers:{201:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthRevoke(t){return e.send({op:"OauthRevoke",method:"POST",path:"/oauth/revoke",auth:[["OAuthClient"],[]],answers:{200:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthToken(t){return e.send({op:"OauthToken",method:"POST",path:"/oauth/token",auth:[["OAuthClient"],[]],answers:{200:"json"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async oauthUserinfo(t){return e.send({op:"OauthUserinfo",method:"GET",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:t?.signal})},async oauthUserinfoPost(t){return e.send({op:"OauthUserinfoPost",method:"POST",path:"/oauth/userinfo",auth:[["OAuthAccessToken"]],answers:{200:"json"},signal:t?.signal})},async ownerCliCode(t){return e.send({op:"OwnerCLICode",method:"POST",path:"/auth/cli/owner-code",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listConsentKeys(t){return e.send({op:"ListConsentKeys",method:"GET",path:"/auth/consents/keys",auth:[["ApiKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getConsents(t){return e.send({op:"GetConsents",method:"GET",path:"/auth/consents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,headers:t.headers,signal:t.signal})},async chooseConsents(t){return e.send({op:"ChooseConsents",method:"PUT",path:"/auth/consents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async linkConsents(t){return e.send({op:"LinkConsents",method:"POST",path:"/auth/consents/link",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetInstallationConsents(t){return e.send({op:"AdminGetInstallationConsents",method:"GET",path:"/admin/installations/"+c("AdminGetInstallationConsents","installation_id",t.path.installation_id)+"/consents",auth:[["AdminAuth"]],answers:{200:"json"},signal:t.signal})},async adminRefuseConsents(t){return e.send({op:"AdminRefuseConsents",method:"POST",path:"/admin/consents/refuse",auth:[["AdminAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminInviteUser(t){return e.send({op:"AdminInviteUser",method:"POST",path:"/admin/users/invite",auth:[["AdminAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async acceptInvitation(t){return e.send({op:"AcceptInvitation",method:"POST",path:"/auth/invitations/accept",auth:[["ApiKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async hostedAcceptInvitationPage(t){return e.send({op:"HostedAcceptInvitationPage",method:"GET",path:"/auth/pages/accept-invitation",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedAcceptInvitationSubmit(t){return e.send({op:"HostedAcceptInvitationSubmit",method:"POST",path:"/auth/pages/accept-invitation",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async hostedNotMePage(t){return e.send({op:"HostedNotMePage",method:"GET",path:"/auth/pages/not-me",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async hostedNotMeSubmit(t){return e.send({op:"HostedNotMeSubmit",method:"POST",path:"/auth/pages/not-me",auth:[],answers:{200:"raw"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})}}}var tr={};wt(tr,{client:()=>HS});function HS(e){return{async getCacheEntry(t){return e.send({op:"GetCacheEntry",method:"GET",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putCacheEntry(t){return e.send({op:"PutCacheEntry",method:"PUT",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCacheEntry(t){return e.send({op:"DeleteCacheEntry",method:"DELETE",path:"/cache/entry",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async incrementCacheEntry(t){return e.send({op:"IncrementCacheEntry",method:"POST",path:"/cache/entry/increment",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCacheUsage(t){return e.send({op:"GetCacheUsage",method:"GET",path:"/cache/usage",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})}}}var nr={};wt(nr,{client:()=>VS});function VS(e){return{async listCalls(t){return e.send({op:"ListCalls",method:"GET",path:"/calls",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startCall(t){return e.send({op:"StartCall",method:"POST",path:"/calls",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListCalls(t){return e.send({op:"AdminListCalls",method:"GET",path:"/calls/admin/calls",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminGetCall(t){return e.send({op:"AdminGetCall",method:"GET",path:"/calls/admin/calls/"+c("AdminGetCall","call_id",t.path.call_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminEndCall(t){return e.send({op:"AdminEndCall",method:"POST",path:"/calls/admin/calls/"+c("AdminEndCall","call_id",t.path.call_id)+"/end",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createCallTicket(t){return e.send({op:"CreateCallTicket",method:"POST",path:"/calls/admin/calls/"+c("CreateCallTicket","call_id",t.path.call_id)+"/tickets",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetCallTranscription(t){return e.send({op:"AdminGetCallTranscription",method:"GET",path:"/calls/admin/calls/"+c("AdminGetCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminStartCallTranscription(t){return e.send({op:"AdminStartCallTranscription",method:"POST",path:"/calls/admin/calls/"+c("AdminStartCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminStopCallTranscription(t){return e.send({op:"AdminStopCallTranscription",method:"DELETE",path:"/calls/admin/calls/"+c("AdminStopCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminIngestCallTranscriptionAudio(t){return e.send({op:"AdminIngestCallTranscriptionAudio",method:"POST",path:"/calls/admin/calls/"+c("AdminIngestCallTranscriptionAudio","call_id",t.path.call_id)+"/transcription/audio",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})},async getCallPlace(t){return e.send({op:"GetCallPlace",method:"GET",path:"/calls/places/"+c("GetCallPlace","place",t.path.place),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async watchCallPlace(t){return e.send({op:"WatchCallPlace",method:"POST",path:"/calls/places/"+c("WatchCallPlace","place",t.path.place)+"/watch",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unwatchCallPlace(t){return e.send({op:"UnwatchCallPlace",method:"DELETE",path:"/calls/places/"+c("UnwatchCallPlace","place",t.path.place)+"/watch",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async getCallSettings(t){return e.send({op:"GetCallSettings",method:"GET",path:"/calls/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putCallSettings(t){return e.send({op:"PutCallSettings",method:"PUT",path:"/calls/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateCallHookSecret(t){return e.send({op:"RotateCallHookSecret",method:"POST",path:"/calls/settings/hook-secret",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getCall(t){return e.send({op:"GetCall",method:"GET",path:"/calls/"+c("GetCall","call_id",t.path.call_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async acceptCall(t){return e.send({op:"AcceptCall",method:"POST",path:"/calls/"+c("AcceptCall","call_id",t.path.call_id)+"/accept",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineCall(t){return e.send({op:"DeclineCall",method:"POST",path:"/calls/"+c("DeclineCall","call_id",t.path.call_id)+"/decline",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async callHeartbeat(t){return e.send({op:"CallHeartbeat",method:"POST",path:"/calls/"+c("CallHeartbeat","call_id",t.path.call_id)+"/heartbeat",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async joinCall(t){return e.send({op:"JoinCall",method:"POST",path:"/calls/"+c("JoinCall","call_id",t.path.call_id)+"/join",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async leaveCall(t){return e.send({op:"LeaveCall",method:"POST",path:"/calls/"+c("LeaveCall","call_id",t.path.call_id)+"/leave",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async getCallMedia(t){return e.send({op:"GetCallMedia",method:"POST",path:"/calls/"+c("GetCallMedia","call_id",t.path.call_id)+"/media",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async inviteToCall(t){return e.send({op:"InviteToCall",method:"POST",path:"/calls/"+c("InviteToCall","call_id",t.path.call_id)+"/participants",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCallTranscription(t){return e.send({op:"GetCallTranscription",method:"GET",path:"/calls/"+c("GetCallTranscription","call_id",t.path.call_id)+"/transcription",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async ingestCallTranscriptionAudio(t){return e.send({op:"IngestCallTranscriptionAudio",method:"POST",path:"/calls/"+c("IngestCallTranscriptionAudio","call_id",t.path.call_id)+"/transcription/audio",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})}}}var sr={};wt(sr,{client:()=>XS});function XS(e){return{async listBroadcasts(t){return e.send({op:"ListBroadcasts",method:"GET",path:"/campaigns/broadcasts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createBroadcast(t){return e.send({op:"CreateBroadcast",method:"POST",path:"/campaigns/broadcasts",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordBroadcastConversion(t){return e.send({op:"RecordBroadcastConversion",method:"POST",path:"/campaigns/broadcasts/conversions",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getBroadcast(t){return e.send({op:"GetBroadcast",method:"GET",path:"/campaigns/broadcasts/"+c("GetBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateBroadcast(t){return e.send({op:"UpdateBroadcast",method:"PUT",path:"/campaigns/broadcasts/"+c("UpdateBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteBroadcast(t){return e.send({op:"DeleteBroadcast",method:"DELETE",path:"/campaigns/broadcasts/"+c("DeleteBroadcast","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async cancelBroadcast(t){return e.send({op:"CancelBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("CancelBroadcast","id",t.path.id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async pauseBroadcast(t){return e.send({op:"PauseBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("PauseBroadcast","id",t.path.id)+"/pause",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async startBroadcast(t){return e.send({op:"StartBroadcast",method:"POST",path:"/campaigns/broadcasts/"+c("StartBroadcast","id",t.path.id)+"/start",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getBroadcastStats(t){return e.send({op:"GetBroadcastStats",method:"GET",path:"/campaigns/broadcasts/"+c("GetBroadcastStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTrackingLinks(t){return e.send({op:"ListTrackingLinks",method:"GET",path:"/campaigns/links",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTrackingLink(t){return e.send({op:"CreateTrackingLink",method:"POST",path:"/campaigns/links",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attributeLinkConversion(t){return e.send({op:"AttributeLinkConversion",method:"POST",path:"/campaigns/links/attribute",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTrackingLink(t){return e.send({op:"GetTrackingLink",method:"GET",path:"/campaigns/links/"+c("GetTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateTrackingLink(t){return e.send({op:"UpdateTrackingLink",method:"PUT",path:"/campaigns/links/"+c("UpdateTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTrackingLink(t){return e.send({op:"DeleteTrackingLink",method:"DELETE",path:"/campaigns/links/"+c("DeleteTrackingLink","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getTrackingLinkStats(t){return e.send({op:"GetTrackingLinkStats",method:"GET",path:"/campaigns/links/"+c("GetTrackingLinkStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listOnSiteCampaigns(t){return e.send({op:"ListOnSiteCampaigns",method:"GET",path:"/campaigns/onsite",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createOnSiteCampaign(t){return e.send({op:"CreateOnSiteCampaign",method:"POST",path:"/campaigns/onsite",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createOnSiteImpression(t){return e.send({op:"CreateOnSiteImpression",method:"POST",path:"/campaigns/onsite/impressions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordOnSiteEvent(t){return e.send({op:"RecordOnSiteEvent",method:"POST",path:"/campaigns/onsite/impressions/"+c("RecordOnSiteEvent","id",t.path.id)+"/events",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOnSiteMessages(t){return e.send({op:"ListOnSiteMessages",method:"GET",path:"/campaigns/onsite/messages",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getOnSiteSettings(t){return e.send({op:"GetOnSiteSettings",method:"GET",path:"/campaigns/onsite/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putOnSiteSettings(t){return e.send({op:"PutOnSiteSettings",method:"PUT",path:"/campaigns/onsite/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOnSiteTemplates(t){return e.send({op:"ListOnSiteTemplates",method:"GET",path:"/campaigns/onsite/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getOnSiteCampaign(t){return e.send({op:"GetOnSiteCampaign",method:"GET",path:"/campaigns/onsite/"+c("GetOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateOnSiteCampaign(t){return e.send({op:"UpdateOnSiteCampaign",method:"PUT",path:"/campaigns/onsite/"+c("UpdateOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteOnSiteCampaign(t){return e.send({op:"DeleteOnSiteCampaign",method:"DELETE",path:"/campaigns/onsite/"+c("DeleteOnSiteCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getOnSiteCampaignStats(t){return e.send({op:"GetOnSiteCampaignStats",method:"GET",path:"/campaigns/onsite/"+c("GetOnSiteCampaignStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async redirectTrackingLink(t){return e.send({op:"RedirectTrackingLink",method:"GET",path:"/l/"+c("RedirectTrackingLink","slug",t.path.slug),auth:[[]],answers:{302:"redirect"},signal:t.signal})},async headTrackingLink(t){return e.send({op:"HeadTrackingLink",method:"HEAD",path:"/l/"+c("HeadTrackingLink","slug",t.path.slug),auth:[[]],answers:{302:"redirect"},signal:t.signal})}}}var ar={};wt(ar,{client:()=>YS});function YS(e){return{async listBrands(t){return e.send({op:"ListBrands",method:"GET",path:"/commerce/brands",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createBrand(t){return e.send({op:"CreateBrand",method:"POST",path:"/commerce/brands",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createCart(t){return e.send({op:"CreateCart",method:"POST",path:"/commerce/carts",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCart(t){return e.send({op:"GetCart",method:"GET",path:"/commerce/carts/"+c("GetCart","cart_id",t.path.cart_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCart(t){return e.send({op:"UpdateCart",method:"PATCH",path:"/commerce/carts/"+c("UpdateCart","cart_id",t.path.cart_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async checkoutCart(t){return e.send({op:"CheckoutCart",method:"POST",path:"/commerce/carts/"+c("CheckoutCart","cart_id",t.path.cart_id)+"/checkout",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addCartItem(t){return e.send({op:"AddCartItem",method:"POST",path:"/commerce/carts/"+c("AddCartItem","cart_id",t.path.cart_id)+"/items",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCartItem(t){return e.send({op:"DeleteCartItem",method:"DELETE",path:"/commerce/carts/"+c("DeleteCartItem","cart_id",t.path.cart_id)+"/items/"+c("DeleteCartItem","line_id",t.path.line_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCartItem(t){return e.send({op:"UpdateCartItem",method:"PATCH",path:"/commerce/carts/"+c("UpdateCartItem","cart_id",t.path.cart_id)+"/items/"+c("UpdateCartItem","line_id",t.path.line_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async mergeGuestCart(t){return e.send({op:"MergeGuestCart",method:"POST",path:"/commerce/carts/"+c("MergeGuestCart","cart_id",t.path.cart_id)+"/merge",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async applyCartPromoCode(t){return e.send({op:"ApplyCartPromoCode",method:"POST",path:"/commerce/carts/"+c("ApplyCartPromoCode","cart_id",t.path.cart_id)+"/promo-codes",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeCartPromoCode(t){return e.send({op:"RemoveCartPromoCode",method:"DELETE",path:"/commerce/carts/"+c("RemoveCartPromoCode","cart_id",t.path.cart_id)+"/promo-codes/"+c("RemoveCartPromoCode","code",t.path.code),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async selectCartShipping(t){return e.send({op:"SelectCartShipping",method:"POST",path:"/commerce/carts/"+c("SelectCartShipping","cart_id",t.path.cart_id)+"/shipping",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontListBrands(t){return e.send({op:"StorefrontListBrands",method:"GET",path:"/commerce/catalog/brands",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListCategories(t){return e.send({op:"StorefrontListCategories",method:"GET",path:"/commerce/catalog/categories",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListChannels(t){return e.send({op:"StorefrontListChannels",method:"GET",path:"/commerce/catalog/channels",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListCollections(t){return e.send({op:"StorefrontListCollections",method:"GET",path:"/commerce/catalog/collections",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListProducts(t){return e.send({op:"StorefrontListProducts",method:"GET",path:"/commerce/catalog/products",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontSearchProducts(t){return e.send({op:"StorefrontSearchProducts",method:"POST",path:"/commerce/catalog/search",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontSuggest(t){return e.send({op:"StorefrontSuggest",method:"GET",path:"/commerce/catalog/suggest",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontRecommendProducts(t){return e.send({op:"StorefrontRecommendProducts",method:"POST",path:"/commerce/catalog/recommend",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async storefrontProductRecommendations(t){return e.send({op:"StorefrontProductRecommendations",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontProductRecommendations","product_id_or_handle",t.path.product_id_or_handle)+"/recommendations",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async storefrontGetProduct(t){return e.send({op:"StorefrontGetProduct",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontGetProduct","product_id_or_handle",t.path.product_id_or_handle),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async storefrontListProductReviews(t){return e.send({op:"StorefrontListProductReviews",method:"GET",path:"/commerce/catalog/products/"+c("StorefrontListProductReviews","product_id_or_handle",t.path.product_id_or_handle)+"/reviews",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async storefrontListRegions(t){return e.send({op:"StorefrontListRegions",method:"GET",path:"/commerce/catalog/regions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async storefrontListStores(t){return e.send({op:"StorefrontListStores",method:"GET",path:"/commerce/catalog/stores",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async storefrontGetStore(t){return e.send({op:"StorefrontGetStore",method:"GET",path:"/commerce/catalog/stores/"+c("StorefrontGetStore","store_id_or_slug",t.path.store_id_or_slug),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async storefrontListStoreReviews(t){return e.send({op:"StorefrontListStoreReviews",method:"GET",path:"/commerce/catalog/stores/"+c("StorefrontListStoreReviews","store_id_or_slug",t.path.store_id_or_slug)+"/reviews",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listCategories(t){return e.send({op:"ListCategories",method:"GET",path:"/commerce/categories",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCategory(t){return e.send({op:"CreateCategory",method:"POST",path:"/commerce/categories",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listChannels(t){return e.send({op:"ListChannels",method:"GET",path:"/commerce/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createChannel(t){return e.send({op:"CreateChannel",method:"POST",path:"/commerce/channels",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attachChannelRegion(t){return e.send({op:"AttachChannelRegion",method:"PUT",path:"/commerce/channels/"+c("AttachChannelRegion","channel_id",t.path.channel_id)+"/regions/"+c("AttachChannelRegion","region_id",t.path.region_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async attachChannelStore(t){return e.send({op:"AttachChannelStore",method:"PUT",path:"/commerce/channels/"+c("AttachChannelStore","channel_id",t.path.channel_id)+"/stores/"+c("AttachChannelStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async detachChannelStore(t){return e.send({op:"DetachChannelStore",method:"DELETE",path:"/commerce/channels/"+c("DetachChannelStore","channel_id",t.path.channel_id)+"/stores/"+c("DetachChannelStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCollections(t){return e.send({op:"ListCollections",method:"GET",path:"/commerce/collections",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCollection(t){return e.send({op:"CreateCollection",method:"POST",path:"/commerce/collections",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addCollectionProduct(t){return e.send({op:"AddCollectionProduct",method:"PUT",path:"/commerce/collections/"+c("AddCollectionProduct","collection_id",t.path.collection_id)+"/products/"+c("AddCollectionProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async removeCollectionProduct(t){return e.send({op:"RemoveCollectionProduct",method:"DELETE",path:"/commerce/collections/"+c("RemoveCollectionProduct","collection_id",t.path.collection_id)+"/products/"+c("RemoveCollectionProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createDigitalAsset(t){return e.send({op:"CreateDigitalAsset",method:"POST",path:"/commerce/digital-assets",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateFulfillment(t){return e.send({op:"UpdateFulfillment",method:"PATCH",path:"/commerce/fulfillments/"+c("UpdateFulfillment","fulfillment_id",t.path.fulfillment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addShipmentEvent(t){return e.send({op:"AddShipmentEvent",method:"POST",path:"/commerce/fulfillments/"+c("AddShipmentEvent","fulfillment_id",t.path.fulfillment_id)+"/events",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDiscoveryStrategies(t){return e.send({op:"ListDiscoveryStrategies",method:"GET",path:"/commerce/discovery/strategies",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createDiscoveryStrategy(t){return e.send({op:"CreateDiscoveryStrategy",method:"POST",path:"/commerce/discovery/strategies",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDiscoveryStrategy(t){return e.send({op:"GetDiscoveryStrategy",method:"GET",path:"/commerce/discovery/strategies/"+c("GetDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteDiscoveryStrategy(t){return e.send({op:"DeleteDiscoveryStrategy",method:"DELETE",path:"/commerce/discovery/strategies/"+c("DeleteDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateDiscoveryStrategy(t){return e.send({op:"UpdateDiscoveryStrategy",method:"PATCH",path:"/commerce/discovery/strategies/"+c("UpdateDiscoveryStrategy","strategy_id",t.path.strategy_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMerchandisingRules(t){return e.send({op:"ListMerchandisingRules",method:"GET",path:"/commerce/discovery/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createMerchandisingRule(t){return e.send({op:"CreateMerchandisingRule",method:"POST",path:"/commerce/discovery/rules",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMerchandisingRule(t){return e.send({op:"GetMerchandisingRule",method:"GET",path:"/commerce/discovery/rules/"+c("GetMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMerchandisingRule(t){return e.send({op:"DeleteMerchandisingRule",method:"DELETE",path:"/commerce/discovery/rules/"+c("DeleteMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateMerchandisingRule(t){return e.send({op:"UpdateMerchandisingRule",method:"PATCH",path:"/commerce/discovery/rules/"+c("UpdateMerchandisingRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSearchSynonyms(t){return e.send({op:"ListSearchSynonyms",method:"GET",path:"/commerce/discovery/synonyms",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createSearchSynonym(t){return e.send({op:"CreateSearchSynonym",method:"POST",path:"/commerce/discovery/synonyms",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSearchSynonym(t){return e.send({op:"DeleteSearchSynonym",method:"DELETE",path:"/commerce/discovery/synonyms/"+c("DeleteSearchSynonym","synonym_id",t.path.synonym_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async refreshDiscoverySignals(t){return e.send({op:"RefreshDiscoverySignals",method:"POST",path:"/commerce/discovery/signals/refresh",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listHooks(t){return e.send({op:"ListHooks",method:"GET",path:"/commerce/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertHook(t){return e.send({op:"UpsertHook",method:"POST",path:"/commerce/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteHook(t){return e.send({op:"DeleteHook",method:"DELETE",path:"/commerce/hooks/"+c("DeleteHook","hook_id",t.path.hook_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listInventory(t){return e.send({op:"ListInventory",method:"GET",path:"/commerce/inventory",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adjustInventory(t){return e.send({op:"AdjustInventory",method:"POST",path:"/commerce/inventory/adjust",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async bulkSyncInventory(t){return e.send({op:"BulkSyncInventory",method:"POST",path:"/commerce/inventory/bulk-sync",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInventoryMovements(t){return e.send({op:"ListInventoryMovements",method:"GET",path:"/commerce/inventory/movements",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listInvoices(t){return e.send({op:"ListInvoices",method:"GET",path:"/commerce/invoices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createInvoice(t){return e.send({op:"CreateInvoice",method:"POST",path:"/commerce/invoices",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateInvoice(t){return e.send({op:"UpdateInvoice",method:"PATCH",path:"/commerce/invoices/"+c("UpdateInvoice","invoice_id",t.path.invoice_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listListings(t){return e.send({op:"ListListings",method:"GET",path:"/commerce/listings",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createListing(t){return e.send({op:"CreateListing",method:"POST",path:"/commerce/listings",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateListing(t){return e.send({op:"UpdateListing",method:"PATCH",path:"/commerce/listings/"+c("UpdateListing","listing_id",t.path.listing_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async importLicenseKeys(t){return e.send({op:"ImportLicenseKeys",method:"POST",path:"/commerce/listings/"+c("ImportLicenseKeys","listing_id",t.path.listing_id)+"/license-keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertPrice(t){return e.send({op:"UpsertPrice",method:"POST",path:"/commerce/listings/"+c("UpsertPrice","listing_id",t.path.listing_id)+"/prices",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyOrders(t){return e.send({op:"ListMyOrders",method:"GET",path:"/commerce/me/orders",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMyOrder(t){return e.send({op:"GetMyOrder",method:"GET",path:"/commerce/me/orders/"+c("GetMyOrder","order_id",t.path.order_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async getMyOrderDownloads(t){return e.send({op:"GetMyOrderDownloads",method:"GET",path:"/commerce/me/orders/"+c("GetMyOrderDownloads","order_id",t.path.order_id)+"/downloads",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async createProductReview(t){return e.send({op:"CreateProductReview",method:"POST",path:"/commerce/me/products/"+c("CreateProductReview","product_id_or_handle",t.path.product_id_or_handle)+"/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyReturns(t){return e.send({op:"ListMyReturns",method:"GET",path:"/commerce/me/returns",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async listMyReviews(t){return e.send({op:"ListMyReviews",method:"GET",path:"/commerce/me/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mintReviewUploadUrl(t){return e.send({op:"MintReviewUploadURL",method:"POST",path:"/commerce/me/reviews/upload-url",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMyReview(t){return e.send({op:"DeleteMyReview",method:"DELETE",path:"/commerce/me/reviews/"+c("DeleteMyReview","review_id",t.path.review_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async voteReview(t){return e.send({op:"VoteReview",method:"POST",path:"/commerce/me/reviews/"+c("VoteReview","review_id",t.path.review_id)+"/vote",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestMyReturn(t){return e.send({op:"RequestMyReturn",method:"POST",path:"/commerce/me/store-orders/"+c("RequestMyReturn","store_order_id",t.path.store_order_id)+"/returns",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createStoreReview(t){return e.send({op:"CreateStoreReview",method:"POST",path:"/commerce/me/stores/"+c("CreateStoreReview","store_id_or_slug",t.path.store_id_or_slug)+"/reviews",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMediaAsset(t){return e.send({op:"CreateMediaAsset",method:"POST",path:"/commerce/media",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOrders(t){return e.send({op:"ListOrders",method:"GET",path:"/commerce/orders",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getGuestOrder(t){return e.send({op:"GetGuestOrder",method:"GET",path:"/commerce/orders/guest/"+c("GetGuestOrder","order_number",t.path.order_number),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getOrder(t){return e.send({op:"GetOrder",method:"GET",path:"/commerce/orders/"+c("GetOrder","order_id",t.path.order_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async markOrderPaid(t){return e.send({op:"MarkOrderPaid",method:"POST",path:"/commerce/orders/"+c("MarkOrderPaid","order_id",t.path.order_id)+"/mark-paid",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPriceLists(t){return e.send({op:"ListPriceLists",method:"GET",path:"/commerce/price-lists",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPriceList(t){return e.send({op:"CreatePriceList",method:"POST",path:"/commerce/price-lists",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listProducts(t){return e.send({op:"ListProducts",method:"GET",path:"/commerce/products",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createProduct(t){return e.send({op:"CreateProduct",method:"POST",path:"/commerce/products",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createQuickProduct(t){return e.send({op:"CreateQuickProduct",method:"POST",path:"/commerce/products/quick",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getProduct(t){return e.send({op:"GetProduct",method:"GET",path:"/commerce/products/"+c("GetProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateProduct(t){return e.send({op:"UpdateProduct",method:"PATCH",path:"/commerce/products/"+c("UpdateProduct","product_id",t.path.product_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async approveProduct(t){return e.send({op:"ApproveProduct",method:"POST",path:"/commerce/products/"+c("ApproveProduct","product_id",t.path.product_id)+"/approval",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertProductOption(t){return e.send({op:"UpsertProductOption",method:"POST",path:"/commerce/products/"+c("UpsertProductOption","product_id",t.path.product_id)+"/options",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createVariant(t){return e.send({op:"CreateVariant",method:"POST",path:"/commerce/products/"+c("CreateVariant","product_id",t.path.product_id)+"/variants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRegions(t){return e.send({op:"ListRegions",method:"GET",path:"/commerce/regions",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createRegion(t){return e.send({op:"CreateRegion",method:"POST",path:"/commerce/regions",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateRegion(t){return e.send({op:"UpdateRegion",method:"PATCH",path:"/commerce/regions/"+c("UpdateRegion","region_id",t.path.region_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listReturns(t){return e.send({op:"ListReturns",method:"GET",path:"/commerce/returns",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async approveReturn(t){return e.send({op:"ApproveReturn",method:"POST",path:"/commerce/returns/"+c("ApproveReturn","return_id",t.path.return_id)+"/approve",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rejectReturn(t){return e.send({op:"RejectReturn",method:"POST",path:"/commerce/returns/"+c("RejectReturn","return_id",t.path.return_id)+"/reject",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeReturn(t){return e.send({op:"CompleteReturn",method:"POST",path:"/commerce/returns/"+c("CompleteReturn","return_id",t.path.return_id)+"/complete",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveReturn(t){return e.send({op:"ReceiveReturn",method:"POST",path:"/commerce/returns/"+c("ReceiveReturn","return_id",t.path.return_id)+"/receive",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListReviews(t){return e.send({op:"AdminListReviews",method:"GET",path:"/commerce/reviews",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminDeleteReview(t){return e.send({op:"AdminDeleteReview",method:"DELETE",path:"/commerce/reviews/"+c("AdminDeleteReview","review_id",t.path.review_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminModerateReview(t){return e.send({op:"AdminModerateReview",method:"PATCH",path:"/commerce/reviews/"+c("AdminModerateReview","review_id",t.path.review_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCommerceSettings(t){return e.send({op:"GetCommerceSettings",method:"GET",path:"/commerce/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateCommerceSettings(t){return e.send({op:"UpdateCommerceSettings",method:"PUT",path:"/commerce/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSettlements(t){return e.send({op:"ListSettlements",method:"GET",path:"/commerce/settlements",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async generateSettlement(t){return e.send({op:"GenerateSettlement",method:"POST",path:"/commerce/settlements/generate",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async markSettlementPaid(t){return e.send({op:"MarkSettlementPaid",method:"POST",path:"/commerce/settlements/"+c("MarkSettlementPaid","settlement_id",t.path.settlement_id)+"/mark-paid",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listShippingOptions(t){return e.send({op:"ListShippingOptions",method:"GET",path:"/commerce/shipping-options",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createShippingOption(t){return e.send({op:"CreateShippingOption",method:"POST",path:"/commerce/shipping-options",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listShippingProfiles(t){return e.send({op:"ListShippingProfiles",method:"GET",path:"/commerce/shipping-profiles",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createShippingProfile(t){return e.send({op:"CreateShippingProfile",method:"POST",path:"/commerce/shipping-profiles",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStockLocations(t){return e.send({op:"ListStockLocations",method:"GET",path:"/commerce/stock-locations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createStockLocation(t){return e.send({op:"CreateStockLocation",method:"POST",path:"/commerce/stock-locations",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStoreOrders(t){return e.send({op:"ListStoreOrders",method:"GET",path:"/commerce/store-orders",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getStoreOrder(t){return e.send({op:"GetStoreOrder",method:"GET",path:"/commerce/store-orders/"+c("GetStoreOrder","store_order_id",t.path.store_order_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelStoreOrder(t){return e.send({op:"CancelStoreOrder",method:"POST",path:"/commerce/store-orders/"+c("CancelStoreOrder","store_order_id",t.path.store_order_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createFulfillment(t){return e.send({op:"CreateFulfillment",method:"POST",path:"/commerce/store-orders/"+c("CreateFulfillment","store_order_id",t.path.store_order_id)+"/fulfillments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createReturn(t){return e.send({op:"CreateReturn",method:"POST",path:"/commerce/store-orders/"+c("CreateReturn","store_order_id",t.path.store_order_id)+"/returns",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStores(t){return e.send({op:"ListStores",method:"GET",path:"/commerce/stores",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createStore(t){return e.send({op:"CreateStore",method:"POST",path:"/commerce/stores",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStore(t){return e.send({op:"GetStore",method:"GET",path:"/commerce/stores/"+c("GetStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateStore(t){return e.send({op:"UpdateStore",method:"PATCH",path:"/commerce/stores/"+c("UpdateStore","store_id",t.path.store_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpdateFulfillment(t){return e.send({op:"SellerUpdateFulfillment",method:"PATCH",path:"/commerce/stores/"+c("SellerUpdateFulfillment","store_id",t.path.store_id)+"/fulfillments/"+c("SellerUpdateFulfillment","fulfillment_id",t.path.fulfillment_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerAddShipmentEvent(t){return e.send({op:"SellerAddShipmentEvent",method:"POST",path:"/commerce/stores/"+c("SellerAddShipmentEvent","store_id",t.path.store_id)+"/fulfillments/"+c("SellerAddShipmentEvent","fulfillment_id",t.path.fulfillment_id)+"/events",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListInventory(t){return e.send({op:"SellerListInventory",method:"GET",path:"/commerce/stores/"+c("SellerListInventory","store_id",t.path.store_id)+"/inventory",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerAdjustInventory(t){return e.send({op:"SellerAdjustInventory",method:"POST",path:"/commerce/stores/"+c("SellerAdjustInventory","store_id",t.path.store_id)+"/inventory/adjust",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerBulkSyncInventory(t){return e.send({op:"SellerBulkSyncInventory",method:"POST",path:"/commerce/stores/"+c("SellerBulkSyncInventory","store_id",t.path.store_id)+"/inventory/bulk-sync",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListListings(t){return e.send({op:"SellerListListings",method:"GET",path:"/commerce/stores/"+c("SellerListListings","store_id",t.path.store_id)+"/listings",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateListing(t){return e.send({op:"SellerCreateListing",method:"POST",path:"/commerce/stores/"+c("SellerCreateListing","store_id",t.path.store_id)+"/listings",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpdateListing(t){return e.send({op:"SellerUpdateListing",method:"PATCH",path:"/commerce/stores/"+c("SellerUpdateListing","store_id",t.path.store_id)+"/listings/"+c("SellerUpdateListing","listing_id",t.path.listing_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerImportLicenseKeys(t){return e.send({op:"SellerImportLicenseKeys",method:"POST",path:"/commerce/stores/"+c("SellerImportLicenseKeys","store_id",t.path.store_id)+"/listings/"+c("SellerImportLicenseKeys","listing_id",t.path.listing_id)+"/license-keys",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerUpsertPrice(t){return e.send({op:"SellerUpsertPrice",method:"POST",path:"/commerce/stores/"+c("SellerUpsertPrice","store_id",t.path.store_id)+"/listings/"+c("SellerUpsertPrice","listing_id",t.path.listing_id)+"/prices",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListStockLocations(t){return e.send({op:"SellerListStockLocations",method:"GET",path:"/commerce/stores/"+c("SellerListStockLocations","store_id",t.path.store_id)+"/locations",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateStockLocation(t){return e.send({op:"SellerCreateStockLocation",method:"POST",path:"/commerce/stores/"+c("SellerCreateStockLocation","store_id",t.path.store_id)+"/locations",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addStoreMember(t){return e.send({op:"AddStoreMember",method:"POST",path:"/commerce/stores/"+c("AddStoreMember","store_id",t.path.store_id)+"/members",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeStoreMember(t){return e.send({op:"RemoveStoreMember",method:"DELETE",path:"/commerce/stores/"+c("RemoveStoreMember","store_id",t.path.store_id)+"/members/"+c("RemoveStoreMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerGetMetrics(t){return e.send({op:"SellerGetMetrics",method:"GET",path:"/commerce/stores/"+c("SellerGetMetrics","store_id",t.path.store_id)+"/metrics",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerListStoreOrders(t){return e.send({op:"SellerListStoreOrders",method:"GET",path:"/commerce/stores/"+c("SellerListStoreOrders","store_id",t.path.store_id)+"/orders",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerGetStoreOrder(t){return e.send({op:"SellerGetStoreOrder",method:"GET",path:"/commerce/stores/"+c("SellerGetStoreOrder","store_id",t.path.store_id)+"/orders/"+c("SellerGetStoreOrder","store_order_id",t.path.store_order_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCancelStoreOrder(t){return e.send({op:"SellerCancelStoreOrder",method:"POST",path:"/commerce/stores/"+c("SellerCancelStoreOrder","store_id",t.path.store_id)+"/orders/"+c("SellerCancelStoreOrder","store_order_id",t.path.store_order_id)+"/cancel",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreateFulfillment(t){return e.send({op:"SellerCreateFulfillment",method:"POST",path:"/commerce/stores/"+c("SellerCreateFulfillment","store_id",t.path.store_id)+"/orders/"+c("SellerCreateFulfillment","store_order_id",t.path.store_order_id)+"/fulfillments",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async onboardStorePaymentAccount(t){return e.send({op:"OnboardStorePaymentAccount",method:"POST",path:"/commerce/stores/"+c("OnboardStorePaymentAccount","store_id",t.path.store_id)+"/payment-accounts",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerOnboardPayouts(t){return e.send({op:"SellerOnboardPayouts",method:"POST",path:"/commerce/stores/"+c("SellerOnboardPayouts","store_id",t.path.store_id)+"/payouts/onboard",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerOnboardingLink(t){return e.send({op:"SellerOnboardingLink",method:"POST",path:"/commerce/stores/"+c("SellerOnboardingLink","store_id",t.path.store_id)+"/payouts/onboarding-link",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListProducts(t){return e.send({op:"SellerListProducts",method:"GET",path:"/commerce/stores/"+c("SellerListProducts","store_id",t.path.store_id)+"/products",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerCreateProduct(t){return e.send({op:"SellerCreateProduct",method:"POST",path:"/commerce/stores/"+c("SellerCreateProduct","store_id",t.path.store_id)+"/products",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreateQuickProduct(t){return e.send({op:"SellerCreateQuickProduct",method:"POST",path:"/commerce/stores/"+c("SellerCreateQuickProduct","store_id",t.path.store_id)+"/products/quick",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCreatePromotionRule(t){return e.send({op:"SellerCreatePromotionRule",method:"POST",path:"/commerce/stores/"+c("SellerCreatePromotionRule","store_id",t.path.store_id)+"/promotions/rules",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListReturns(t){return e.send({op:"SellerListReturns",method:"GET",path:"/commerce/stores/"+c("SellerListReturns","store_id",t.path.store_id)+"/returns",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerApproveReturn(t){return e.send({op:"SellerApproveReturn",method:"POST",path:"/commerce/stores/"+c("SellerApproveReturn","store_id",t.path.store_id)+"/returns/"+c("SellerApproveReturn","return_id",t.path.return_id)+"/approve",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerRejectReturn(t){return e.send({op:"SellerRejectReturn",method:"POST",path:"/commerce/stores/"+c("SellerRejectReturn","store_id",t.path.store_id)+"/returns/"+c("SellerRejectReturn","return_id",t.path.return_id)+"/reject",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerCompleteReturn(t){return e.send({op:"SellerCompleteReturn",method:"POST",path:"/commerce/stores/"+c("SellerCompleteReturn","store_id",t.path.store_id)+"/returns/"+c("SellerCompleteReturn","return_id",t.path.return_id)+"/complete",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerReceiveReturn(t){return e.send({op:"SellerReceiveReturn",method:"POST",path:"/commerce/stores/"+c("SellerReceiveReturn","store_id",t.path.store_id)+"/returns/"+c("SellerReceiveReturn","return_id",t.path.return_id)+"/receive",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListReviews(t){return e.send({op:"SellerListReviews",method:"GET",path:"/commerce/stores/"+c("SellerListReviews","store_id",t.path.store_id)+"/reviews",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sellerReplyReview(t){return e.send({op:"SellerReplyReview",method:"POST",path:"/commerce/stores/"+c("SellerReplyReview","store_id",t.path.store_id)+"/reviews/"+c("SellerReplyReview","review_id",t.path.review_id)+"/reply",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sellerListSettlements(t){return e.send({op:"SellerListSettlements",method:"GET",path:"/commerce/stores/"+c("SellerListSettlements","store_id",t.path.store_id)+"/settlements",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sellerCreateShippingOption(t){return e.send({op:"SellerCreateShippingOption",method:"POST",path:"/commerce/stores/"+c("SellerCreateShippingOption","store_id",t.path.store_id)+"/shipping-options",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTaxRates(t){return e.send({op:"ListTaxRates",method:"GET",path:"/commerce/tax-rates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertTaxRate(t){return e.send({op:"UpsertTaxRate",method:"PUT",path:"/commerce/tax-rates",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateVariant(t){return e.send({op:"UpdateVariant",method:"PATCH",path:"/commerce/variants/"+c("UpdateVariant","variant_id",t.path.variant_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setBundleItems(t){return e.send({op:"SetBundleItems",method:"POST",path:"/commerce/variants/"+c("SetBundleItems","variant_id",t.path.variant_id)+"/bundle-items",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recomputeVariantBuyBox(t){return e.send({op:"RecomputeVariantBuyBox",method:"POST",path:"/commerce/variants/"+c("RecomputeVariantBuyBox","variant_id",t.path.variant_id)+"/buybox/recompute",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async revokePromotionCode(t){return e.send({op:"RevokePromotionCode",method:"DELETE",path:"/promotions/codes/"+c("RevokePromotionCode","code_id",t.path.code_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async evaluatePromotions(t){return e.send({op:"EvaluatePromotions",method:"POST",path:"/promotions/evaluate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async holdPromotions(t){return e.send({op:"HoldPromotions",method:"POST",path:"/promotions/holds",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitPromotionHold(t){return e.send({op:"CommitPromotionHold",method:"POST",path:"/promotions/holds/"+c("CommitPromotionHold","hold_id",t.path.hold_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releasePromotionHold(t){return e.send({op:"ReleasePromotionHold",method:"POST",path:"/promotions/holds/"+c("ReleasePromotionHold","hold_id",t.path.hold_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPromotionRedemptions(t){return e.send({op:"ListPromotionRedemptions",method:"GET",path:"/promotions/redemptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async reversePromotionRedemption(t){return e.send({op:"ReversePromotionRedemption",method:"POST",path:"/promotions/redemptions/"+c("ReversePromotionRedemption","redemption_id",t.path.redemption_id)+"/reverse",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPromotionRules(t){return e.send({op:"ListPromotionRules",method:"GET",path:"/promotions/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createPromotionRule(t){return e.send({op:"CreatePromotionRule",method:"POST",path:"/promotions/rules",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPromotionRule(t){return e.send({op:"GetPromotionRule",method:"GET",path:"/promotions/rules/"+c("GetPromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async archivePromotionRule(t){return e.send({op:"ArchivePromotionRule",method:"DELETE",path:"/promotions/rules/"+c("ArchivePromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updatePromotionRule(t){return e.send({op:"UpdatePromotionRule",method:"PATCH",path:"/promotions/rules/"+c("UpdatePromotionRule","rule_id",t.path.rule_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async upsertPromotionBudget(t){return e.send({op:"UpsertPromotionBudget",method:"PUT",path:"/promotions/rules/"+c("UpsertPromotionBudget","rule_id",t.path.rule_id)+"/budgets/"+c("UpsertPromotionBudget","currency",t.path.currency),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPromotionCodes(t){return e.send({op:"ListPromotionCodes",method:"GET",path:"/promotions/rules/"+c("ListPromotionCodes","rule_id",t.path.rule_id)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPromotionCode(t){return e.send({op:"CreatePromotionCode",method:"POST",path:"/promotions/rules/"+c("CreatePromotionCode","rule_id",t.path.rule_id)+"/codes",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async generatePromotionCodeBatch(t){return e.send({op:"GeneratePromotionCodeBatch",method:"POST",path:"/promotions/rules/"+c("GeneratePromotionCodeBatch","rule_id",t.path.rule_id)+"/codes/batch",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var xo={};wt(xo,{client:()=>ZS});function ZS(e){return{async getValues(t){return e.send({op:"GetValues",method:"GET",path:"/flags",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},headers:t?.headers,signal:t?.signal})},async batchUserValues(t){return e.send({op:"BatchUserValues",method:"POST",path:"/flags/batch",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDelta(t){return e.send({op:"GetDelta",method:"GET",path:"/flags/delta",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},query:t?.query,headers:t?.headers,signal:t?.signal})},async getEvaluations(t){return e.send({op:"GetEvaluations",method:"GET",path:"/flags/evaluations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/flags/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/flags/experiments",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getExperiment(t){return e.send({op:"GetExperiment",method:"GET",path:"/flags/experiments/"+c("GetExperiment","experiment_id",t.path.experiment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getExperimentResults(t){return e.send({op:"GetExperimentResults",method:"GET",path:"/flags/experiments/"+c("GetExperimentResults","experiment_id",t.path.experiment_id)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async stopExperiment(t){return e.send({op:"StopExperiment",method:"POST",path:"/flags/experiments/"+c("StopExperiment","experiment_id",t.path.experiment_id)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async declareExperimentWinner(t){return e.send({op:"DeclareExperimentWinner",method:"POST",path:"/flags/experiments/"+c("DeclareExperimentWinner","experiment_id",t.path.experiment_id)+"/winner",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCurrentInstallations(t){return e.send({op:"GetCurrentInstallations",method:"GET",path:"/flags/installations/current",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getInstallationsDaily(t){return e.send({op:"GetInstallationsDaily",method:"GET",path:"/flags/installations/daily",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getSnapshot(t){return e.send({op:"GetSnapshot",method:"GET",path:"/flags/snapshot",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t?.headers,signal:t?.signal})},async listDefinitions(t){return e.send({op:"ListDefinitions",method:"GET",path:"/flags/system",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getDefinition(t){return e.send({op:"GetDefinition",method:"GET",path:"/flags/system/"+c("GetDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putDefinition(t){return e.send({op:"PutDefinition",method:"PUT",path:"/flags/system/"+c("PutDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteDefinition(t){return e.send({op:"DeleteDefinition",method:"DELETE",path:"/flags/system/"+c("DeleteDefinition","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async activateTemplates(t){return e.send({op:"ActivateTemplates",method:"POST",path:"/flags/templates/activation",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getActiveTemplate(t){return e.send({op:"GetActiveTemplate",method:"GET",path:"/flags/templates/active",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplateCapabilities(t){return e.send({op:"GetTemplateCapabilities",method:"GET",path:"/flags/templates/capabilities",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTemplateDraft(t){return e.send({op:"GetTemplateDraft",method:"GET",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createTemplateDraft(t){return e.send({op:"CreateTemplateDraft",method:"POST",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async discardTemplateDraft(t){return e.send({op:"DiscardTemplateDraft",method:"DELETE",path:"/flags/templates/draft",auth:[["SecretKeyAuth"]],answers:{204:"empty"},headers:t.headers,signal:t.signal})},async putTemplateParameter(t){return e.send({op:"PutTemplateParameter",method:"PUT",path:"/flags/templates/draft/parameters/"+c("PutTemplateParameter","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeTemplateParameter(t){return e.send({op:"RemoveTemplateParameter",method:"DELETE",path:"/flags/templates/draft/parameters/"+c("RemoveTemplateParameter","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})},async reviewTemplateDraft(t){return e.send({op:"ReviewTemplateDraft",method:"GET",path:"/flags/templates/draft/review",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async publishTemplate(t){return e.send({op:"PublishTemplate",method:"POST",path:"/flags/templates/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPublishReceipt(t){return e.send({op:"GetPublishReceipt",method:"POST",path:"/flags/templates/publish/receipt",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async restoreTemplateVersion(t){return e.send({op:"RestoreTemplateVersion",method:"POST",path:"/flags/templates/restore/"+c("RestoreTemplateVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{201:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTemplateVersions(t){return e.send({op:"ListTemplateVersions",method:"GET",path:"/flags/templates/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getTemplateVersion(t){return e.send({op:"GetTemplateVersion",method:"GET",path:"/flags/templates/versions/"+c("GetTemplateVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getUserValues(t){return e.send({op:"GetUserValues",method:"GET",path:"/flags/users/"+c("GetUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})},async putUserValues(t){return e.send({op:"PutUserValues",method:"PUT",path:"/flags/users/"+c("PutUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserValues(t){return e.send({op:"DeleteUserValues",method:"DELETE",path:"/flags/users/"+c("DeleteUserValues","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putUserValue(t){return e.send({op:"PutUserValue",method:"PUT",path:"/flags/users/"+c("PutUserValue","user_id",t.path.user_id)+"/"+c("PutUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteUserValue(t){return e.send({op:"DeleteUserValue",method:"DELETE",path:"/flags/users/"+c("DeleteUserValue","user_id",t.path.user_id)+"/"+c("DeleteUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})}}}var Lo={};wt(Lo,{client:()=>QS});function QS(e){return{async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/iap/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/iap/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleAccountToken(t){return e.send({op:"GetAppleAccountToken",method:"POST",path:"/iap/apple/account-token",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getAppleConnectPage(t){return e.send({op:"GetAppleConnectPage",method:"GET",path:"/iap/apple/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/iap/apple/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createAppleGrant(t){return e.send({op:"CreateAppleGrant",method:"POST",path:"/iap/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleReadiness(t){return e.send({op:"GetAppleReadiness",method:"GET",path:"/iap/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async reportAppleTransactions(t){return e.send({op:"ReportAppleTransactions",method:"POST",path:"/iap/apple/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setXcodeCertificate(t){return e.send({op:"SetXcodeCertificate",method:"PUT",path:"/iap/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearXcodeCertificate(t){return e.send({op:"ClearXcodeCertificate",method:"DELETE",path:"/iap/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async setXcodeOfferKey(t){return e.send({op:"SetXcodeOfferKey",method:"PUT",path:"/iap/apple/xcode-offer-key",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCatalog(t){return e.send({op:"GetCatalog",method:"GET",path:"/iap/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async saveCatalog(t){return e.send({op:"SaveCatalog",method:"PUT",path:"/iap/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planCatalog(t){return e.send({op:"PlanCatalog",method:"POST",path:"/iap/catalog/plans",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getCatalogPlan(t){return e.send({op:"GetCatalogPlan",method:"GET",path:"/iap/catalog/plans/"+c("GetCatalogPlan","plan_id",t.path.plan_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async confirmCatalogPlan(t){return e.send({op:"ConfirmCatalogPlan",method:"POST",path:"/iap/catalog/plans/"+c("ConfirmCatalogPlan","plan_id",t.path.plan_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineCatalogPlan(t){return e.send({op:"DeclineCatalogPlan",method:"POST",path:"/iap/catalog/plans/"+c("DeclineCatalogPlan","plan_id",t.path.plan_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listCatalogRevisions(t){return e.send({op:"ListCatalogRevisions",method:"GET",path:"/iap/catalog/revisions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getCatalogRevision(t){return e.send({op:"GetCatalogRevision",method:"GET",path:"/iap/catalog/revisions/"+c("GetCatalogRevision","revision",t.path.revision),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async restoreCatalogRevision(t){return e.send({op:"RestoreCatalogRevision",method:"POST",path:"/iap/catalog/revisions/"+c("RestoreCatalogRevision","revision",t.path.revision)+"/restore",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async validateCatalog(t){return e.send({op:"ValidateCatalog",method:"POST",path:"/iap/catalog/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCharts(t){return e.send({op:"ListCharts",method:"GET",path:"/iap/charts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getChartsOverview(t){return e.send({op:"GetChartsOverview",method:"GET",path:"/iap/charts/overview",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getChart(t){return e.send({op:"GetChart",method:"GET",path:"/iap/charts/"+c("GetChart","chart",t.path.chart),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createCheckout(t){return e.send({op:"CreateCheckout",method:"POST",path:"/iap/checkout",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createCheckoutRedemption(t){return e.send({op:"CreateCheckoutRedemption",method:"POST",path:"/iap/checkout/redemption",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCoupons(t){return e.send({op:"ListCoupons",method:"GET",path:"/iap/coupons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCoupon(t){return e.send({op:"CreateCoupon",method:"POST",path:"/iap/coupons",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async redeemCoupon(t){return e.send({op:"RedeemCoupon",method:"POST",path:"/iap/coupons/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCoupon(t){return e.send({op:"GetCoupon",method:"GET",path:"/iap/coupons/"+c("GetCoupon","coupon_key",t.path.coupon_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async revokeCoupon(t){return e.send({op:"RevokeCoupon",method:"DELETE",path:"/iap/coupons/"+c("RevokeCoupon","coupon_key",t.path.coupon_key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listCouponCodes(t){return e.send({op:"ListCouponCodes",method:"GET",path:"/iap/coupons/"+c("ListCouponCodes","coupon_key",t.path.coupon_key)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async searchCustomers(t){return e.send({op:"SearchCustomers",method:"GET",path:"/iap/customers",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/iap/customers/"+c("GetCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async grantCredits(t){return e.send({op:"GrantCredits",method:"POST",path:"/iap/customers/"+c("GrantCredits","customer_id",t.path.customer_id)+"/credits",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCreditEntries(t){return e.send({op:"ListCreditEntries",method:"GET",path:"/iap/customers/"+c("ListCreditEntries","customer_id",t.path.customer_id)+"/credits/entries",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async forgiveCredits(t){return e.send({op:"ForgiveCredits",method:"POST",path:"/iap/customers/"+c("ForgiveCredits","customer_id",t.path.customer_id)+"/credits/forgive",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCustomerGrants(t){return e.send({op:"ListCustomerGrants",method:"GET",path:"/iap/customers/"+c("ListCustomerGrants","customer_id",t.path.customer_id)+"/grants",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async grantEntitlement(t){return e.send({op:"GrantEntitlement",method:"POST",path:"/iap/customers/"+c("GrantEntitlement","customer_id",t.path.customer_id)+"/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeGrant(t){return e.send({op:"RevokeGrant",method:"DELETE",path:"/iap/customers/"+c("RevokeGrant","customer_id",t.path.customer_id)+"/grants/"+c("RevokeGrant","grant_id",t.path.grant_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getCustomerHistory(t){return e.send({op:"GetCustomerHistory",method:"GET",path:"/iap/customers/"+c("GetCustomerHistory","customer_id",t.path.customer_id)+"/history",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async holdSpend(t){return e.send({op:"HoldSpend",method:"POST",path:"/iap/customers/"+c("HoldSpend","customer_id",t.path.customer_id)+"/holds",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setCustomerLimit(t){return e.send({op:"SetCustomerLimit",method:"PUT",path:"/iap/customers/"+c("SetCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+c("SetCustomerLimit","limit_key",t.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearCustomerLimit(t){return e.send({op:"ClearCustomerLimit",method:"DELETE",path:"/iap/customers/"+c("ClearCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+c("ClearCustomerLimit","limit_key",t.path.limit_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async grantLimit(t){return e.send({op:"GrantLimit",method:"POST",path:"/iap/customers/"+c("GrantLimit","customer_id",t.path.customer_id)+"/limits/"+c("GrantLimit","limit_key",t.path.limit_key)+"/grants",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async spend(t){return e.send({op:"Spend",method:"POST",path:"/iap/customers/"+c("Spend","customer_id",t.path.customer_id)+"/spend",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitSpend(t){return e.send({op:"CommitSpend",method:"POST",path:"/iap/customers/"+c("CommitSpend","customer_id",t.path.customer_id)+"/spends/"+c("CommitSpend","spend_id",t.path.spend_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendHold(t){return e.send({op:"ExtendHold",method:"POST",path:"/iap/customers/"+c("ExtendHold","customer_id",t.path.customer_id)+"/spends/"+c("ExtendHold","spend_id",t.path.spend_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseSpend(t){return e.send({op:"ReleaseSpend",method:"POST",path:"/iap/customers/"+c("ReleaseSpend","customer_id",t.path.customer_id)+"/spends/"+c("ReleaseSpend","spend_id",t.path.spend_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reverseSpend(t){return e.send({op:"ReverseSpend",method:"POST",path:"/iap/customers/"+c("ReverseSpend","customer_id",t.path.customer_id)+"/spends/"+c("ReverseSpend","spend_id",t.path.spend_id)+"/reverse",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/iap/customers/"+c("CancelSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("CancelSubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/iap/customers/"+c("ExtendSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("ExtendSubscription","subscription_id",t.path.subscription_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async refundSubscription(t){return e.send({op:"RefundSubscription",method:"POST",path:"/iap/customers/"+c("RefundSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+c("RefundSubscription","subscription_id",t.path.subscription_id)+"/refund",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/iap/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/iap/experiments",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getExperiment(t){return e.send({op:"GetExperiment",method:"GET",path:"/iap/experiments/"+c("GetExperiment","experiment_id",t.path.experiment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getExperimentResults(t){return e.send({op:"GetExperimentResults",method:"GET",path:"/iap/experiments/"+c("GetExperimentResults","experiment_id",t.path.experiment_id)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async stopExperiment(t){return e.send({op:"StopExperiment",method:"POST",path:"/iap/experiments/"+c("StopExperiment","experiment_id",t.path.experiment_id)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async declareExperimentWinner(t){return e.send({op:"DeclareExperimentWinner",method:"POST",path:"/iap/experiments/"+c("DeclareExperimentWinner","experiment_id",t.path.experiment_id)+"/winner",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async disconnectGoogle(t){return e.send({op:"DisconnectGoogle",method:"DELETE",path:"/iap/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getGoogleAccountId(t){return e.send({op:"GetGoogleAccountID",method:"POST",path:"/iap/google/account-id",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async reportGooglePurchases(t){return e.send({op:"ReportGooglePurchases",method:"POST",path:"/iap/google/purchases",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMyCustomerInfo(t){return e.send({op:"GetMyCustomerInfo",method:"GET",path:"/iap/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mergeGuest(t){return e.send({op:"MergeGuest",method:"POST",path:"/iap/me/merge",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createMergeGrant(t){return e.send({op:"CreateMergeGrant",method:"POST",path:"/iap/me/merge-grant",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t?.signal})},async setRefundDataConsent(t){return e.send({op:"SetRefundDataConsent",method:"PUT",path:"/iap/me/refund-data-consent",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getOfferings(t){return e.send({op:"GetOfferings",method:"GET",path:"/iap/offerings",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listMyOffers(t){return e.send({op:"ListMyOffers",method:"GET",path:"/iap/offers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getOfferStats(t){return e.send({op:"GetOfferStats",method:"GET",path:"/iap/offers/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async signAppleOffer(t){return e.send({op:"SignAppleOffer",method:"POST",path:"/iap/offers/"+c("SignAppleOffer","offer_key",t.path.offer_key)+"/apple-signature",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async claimOffer(t){return e.send({op:"ClaimOffer",method:"POST",path:"/iap/offers/"+c("ClaimOffer","offer_key",t.path.offer_key)+"/claim",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async recordOfferView(t){return e.send({op:"RecordOfferView",method:"POST",path:"/iap/offers/"+c("RecordOfferView","offer_key",t.path.offer_key)+"/views",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async listPaywalls(t){return e.send({op:"ListPaywalls",method:"GET",path:"/iap/paywalls",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPaywall(t){return e.send({op:"CreatePaywall",method:"POST",path:"/iap/paywalls",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPaywallAssets(t){return e.send({op:"ListPaywallAssets",method:"GET",path:"/iap/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async registerPaywallAsset(t){return e.send({op:"RegisterPaywallAsset",method:"POST",path:"/iap/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePaywallAsset(t){return e.send({op:"DeletePaywallAsset",method:"DELETE",path:"/iap/paywalls/assets/"+c("DeletePaywallAsset","asset_id",t.path.asset_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPaywallTemplates(t){return e.send({op:"ListPaywallTemplates",method:"GET",path:"/iap/paywalls/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPaywallTemplateAsset(t){return e.send({op:"GetPaywallTemplateAsset",method:"GET",path:"/iap/paywalls/templates/"+c("GetPaywallTemplateAsset","key",t.path.key)+"/assets/"+c("GetPaywallTemplateAsset","asset_id",t.path.asset_id),auth:[["SecretKeyAuth"]],answers:{200:"raw",304:"empty"},headers:t.headers,signal:t.signal})},async validatePaywall(t){return e.send({op:"ValidatePaywall",method:"POST",path:"/iap/paywalls/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPaywall(t){return e.send({op:"GetPaywall",method:"GET",path:"/iap/paywalls/"+c("GetPaywall","paywall_id",t.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deletePaywall(t){return e.send({op:"DeletePaywall",method:"DELETE",path:"/iap/paywalls/"+c("DeletePaywall","paywall_id",t.path.paywall_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async savePaywallDraft(t){return e.send({op:"SavePaywallDraft",method:"PUT",path:"/iap/paywalls/"+c("SavePaywallDraft","paywall_id",t.path.paywall_id)+"/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async publishPaywall(t){return e.send({op:"PublishPaywall",method:"POST",path:"/iap/paywalls/"+c("PublishPaywall","paywall_id",t.path.paywall_id)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPaywallVersions(t){return e.send({op:"ListPaywallVersions",method:"GET",path:"/iap/paywalls/"+c("ListPaywallVersions","paywall_id",t.path.paywall_id)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getPaywallVersion(t){return e.send({op:"GetPaywallVersion",method:"GET",path:"/iap/paywalls/"+c("GetPaywallVersion","paywall_id",t.path.paywall_id)+"/versions/"+c("GetPaywallVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPlacements(t){return e.send({op:"ListPlacements",method:"GET",path:"/iap/placements",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listAttributeKeys(t){return e.send({op:"ListAttributeKeys",method:"GET",path:"/iap/placements/attributes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async setPlacement(t){return e.send({op:"SetPlacement",method:"PUT",path:"/iap/placements/"+c("SetPlacement","placement",t.path.placement),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePlacement(t){return e.send({op:"DeletePlacement",method:"DELETE",path:"/iap/placements/"+c("DeletePlacement","placement",t.path.placement),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async recordPaywallExposure(t){return e.send({op:"RecordPaywallExposure",method:"POST",path:"/iap/placements/"+c("RecordPaywallExposure","placement",t.path.placement)+"/exposures",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPlacementPaywall(t){return e.send({op:"GetPlacementPaywall",method:"GET",path:"/iap/placements/"+c("GetPlacementPaywall","placement",t.path.placement)+"/paywall",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json",204:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async previewPlacement(t){return e.send({op:"PreviewPlacement",method:"POST",path:"/iap/placements/"+c("PreviewPlacement","placement",t.path.placement)+"/resolve-preview",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPlacementResults(t){return e.send({op:"GetPlacementResults",method:"GET",path:"/iap/placements/"+c("GetPlacementResults","placement",t.path.placement)+"/results",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getPlacementRules(t){return e.send({op:"GetPlacementRules",method:"GET",path:"/iap/placements/"+c("GetPlacementRules","placement",t.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setPlacementRules(t){return e.send({op:"SetPlacementRules",method:"PUT",path:"/iap/placements/"+c("SetPlacementRules","placement",t.path.placement)+"/rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createPortalSession(t){return e.send({op:"CreatePortalSession",method:"POST",path:"/iap/portal",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRedemptionPage(t){return e.send({op:"GetRedemptionPage",method:"GET",path:"/iap/redeem",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async redeemPurchase(t){return e.send({op:"RedeemPurchase",method:"POST",path:"/iap/redemptions/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/iap/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/iap/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveAppleNotification(t){return e.send({op:"ReceiveAppleNotification",method:"POST",path:"/iap/webhooks/apple",auth:[],answers:{200:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveGoogleNotification(t){return e.send({op:"ReceiveGoogleNotification",method:"POST",path:"/iap/webhooks/google",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var or={};wt(or,{client:()=>e$});function e$(e){return{async listJourneys(t){return e.send({op:"ListJourneys",method:"GET",path:"/journeys",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createJourney(t){return e.send({op:"CreateJourney",method:"POST",path:"/journeys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBlueprints(t){return e.send({op:"ListBlueprints",method:"GET",path:"/journeys/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listPersonRuns(t){return e.send({op:"ListPersonRuns",method:"GET",path:"/journeys/people/"+c("ListPersonRuns","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async simulateJourney(t){return e.send({op:"SimulateJourney",method:"POST",path:"/journeys/simulate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listStoreBlueprints(t){return e.send({op:"ListStoreBlueprints",method:"GET",path:"/journeys/stores/"+c("ListStoreBlueprints","store_id",t.path.store_id)+"/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async activateStoreBlueprint(t){return e.send({op:"ActivateStoreBlueprint",method:"POST",path:"/journeys/stores/"+c("ActivateStoreBlueprint","store_id",t.path.store_id)+"/blueprints",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteStoreBlueprint(t){return e.send({op:"DeleteStoreBlueprint",method:"DELETE",path:"/journeys/stores/"+c("DeleteStoreBlueprint","store_id",t.path.store_id)+"/blueprints/"+c("DeleteStoreBlueprint","key",t.path.key),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async validateJourney(t){return e.send({op:"ValidateJourney",method:"POST",path:"/journeys/validate",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getJourney(t){return e.send({op:"GetJourney",method:"GET",path:"/journeys/"+c("GetJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateJourney(t){return e.send({op:"UpdateJourney",method:"PUT",path:"/journeys/"+c("UpdateJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteJourney(t){return e.send({op:"DeleteJourney",method:"DELETE",path:"/journeys/"+c("DeleteJourney","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async copyJourney(t){return e.send({op:"CopyJourney",method:"POST",path:"/journeys/"+c("CopyJourney","key",t.path.key)+"/copy",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async publishJourney(t){return e.send({op:"PublishJourney",method:"POST",path:"/journeys/"+c("PublishJourney","key",t.path.key)+"/publish",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listJourneyRuns(t){return e.send({op:"ListJourneyRuns",method:"GET",path:"/journeys/"+c("ListJourneyRuns","key",t.path.key)+"/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getJourneyStats(t){return e.send({op:"GetJourneyStats",method:"GET",path:"/journeys/"+c("GetJourneyStats","key",t.path.key)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async stopJourney(t){return e.send({op:"StopJourney",method:"POST",path:"/journeys/"+c("StopJourney","key",t.path.key)+"/stop",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async testJourney(t){return e.send({op:"TestJourney",method:"POST",path:"/journeys/"+c("TestJourney","key",t.path.key)+"/test",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Io={};wt(Io,{client:()=>t$});function t$(e){return{async listMachines(t){return e.send({op:"ListMachines",method:"GET",path:"/machines",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createMachine(t){return e.send({op:"CreateMachine",method:"POST",path:"/machines",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachineSizes(t){return e.send({op:"ListMachineSizes",method:"GET",path:"/machines/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getMachineNetwork(t){return e.send({op:"GetMachineNetwork",method:"GET",path:"/machines/network",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGitHub(t){return e.send({op:"ConnectGitHub",method:"POST",path:"/machines/github/connect",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listInstallations(t){return e.send({op:"ListInstallations",method:"GET",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async linkInstallation(t){return e.send({op:"LinkInstallation",method:"POST",path:"/machines/github/installations",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async shareInstallation(t){return e.send({op:"ShareInstallation",method:"POST",path:"/machines/github/installations/share",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async unlinkInstallation(t){return e.send({op:"UnlinkInstallation",method:"DELETE",path:"/machines/github/installations/"+c("UnlinkInstallation","installation",t.path.installation),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listRepositories(t){return e.send({op:"ListRepositories",method:"GET",path:"/machines/github/repositories",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getMachine(t){return e.send({op:"GetMachine",method:"GET",path:"/machines/"+c("GetMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteMachine(t){return e.send({op:"DeleteMachine",method:"DELETE",path:"/machines/"+c("DeleteMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateMachine(t){return e.send({op:"UpdateMachine",method:"PATCH",path:"/machines/"+c("UpdateMachine","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBuilds(t){return e.send({op:"ListBuilds",method:"GET",path:"/machines/"+c("ListBuilds","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async deployMachine(t){return e.send({op:"DeployMachine",method:"POST",path:"/machines/"+c("DeployMachine","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachinePreviews(t){return e.send({op:"ListMachinePreviews",method:"GET",path:"/machines/"+c("ListMachinePreviews","name",t.path.name)+"/previews",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putMachinePreview(t){return e.send({op:"PutMachinePreview",method:"PUT",path:"/machines/"+c("PutMachinePreview","name",t.path.name)+"/previews/"+c("PutMachinePreview","pull_request",t.path.pull_request),auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachinePreview(t){return e.send({op:"DeleteMachinePreview",method:"DELETE",path:"/machines/"+c("DeleteMachinePreview","name",t.path.name)+"/previews/"+c("DeleteMachinePreview","pull_request",t.path.pull_request),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listMachineDomains(t){return e.send({op:"ListMachineDomains",method:"GET",path:"/machines/"+c("ListMachineDomains","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addMachineDomain(t){return e.send({op:"AddMachineDomain",method:"POST",path:"/machines/"+c("AddMachineDomain","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachineDomain(t){return e.send({op:"DeleteMachineDomain",method:"DELETE",path:"/machines/"+c("DeleteMachineDomain","name",t.path.name)+"/domains/"+c("DeleteMachineDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateMachineDomain(t){return e.send({op:"UpdateMachineDomain",method:"PATCH",path:"/machines/"+c("UpdateMachineDomain","name",t.path.name)+"/domains/"+c("UpdateMachineDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getBuild(t){return e.send({op:"GetBuild",method:"GET",path:"/machines/"+c("GetBuild","name",t.path.name)+"/builds/"+c("GetBuild","build",t.path.build),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getBuildLog(t){return e.send({op:"GetBuildLog",method:"GET",path:"/machines/"+c("GetBuildLog","name",t.path.name)+"/builds/"+c("GetBuildLog","build",t.path.build)+"/log",auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async rollbackMachine(t){return e.send({op:"RollbackMachine",method:"POST",path:"/machines/"+c("RollbackMachine","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDatabases(t){return e.send({op:"ListDatabases",method:"GET",path:"/databases",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createDatabase(t){return e.send({op:"CreateDatabase",method:"POST",path:"/databases",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listDatabaseSizes(t){return e.send({op:"ListDatabaseSizes",method:"GET",path:"/databases/sizes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getDatabase(t){return e.send({op:"GetDatabase",method:"GET",path:"/databases/"+c("GetDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteDatabase(t){return e.send({op:"DeleteDatabase",method:"DELETE",path:"/databases/"+c("DeleteDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateDatabase(t){return e.send({op:"UpdateDatabase",method:"PATCH",path:"/databases/"+c("UpdateDatabase","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async undeleteDatabase(t){return e.send({op:"UndeleteDatabase",method:"POST",path:"/databases/"+c("UndeleteDatabase","name",t.path.name)+"/undelete",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async purgeDatabase(t){return e.send({op:"PurgeDatabase",method:"POST",path:"/databases/"+c("PurgeDatabase","name",t.path.name)+"/purge",auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getDatabaseCredentials(t){return e.send({op:"GetDatabaseCredentials",method:"GET",path:"/databases/"+c("GetDatabaseCredentials","name",t.path.name)+"/credentials",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async changeDatabasePassword(t){return e.send({op:"ChangeDatabasePassword",method:"POST",path:"/databases/"+c("ChangeDatabasePassword","name",t.path.name)+"/password",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async readMachineLogs(t){return e.send({op:"ReadMachineLogs",method:"GET",path:"/machines/"+c("ReadMachineLogs","name",t.path.name)+"/logs",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async execInMachine(t){return e.send({op:"ExecInMachine",method:"POST",path:"/machines/"+c("ExecInMachine","name",t.path.name)+"/exec",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMachineExecs(t){return e.send({op:"ListMachineExecs",method:"GET",path:"/machines/"+c("ListMachineExecs","name",t.path.name)+"/execs",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMachineMetrics(t){return e.send({op:"GetMachineMetrics",method:"GET",path:"/machines/"+c("GetMachineMetrics","name",t.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMachineContract(t){return e.send({op:"GetMachineContract",method:"GET",path:"/machines/"+c("GetMachineContract","name",t.path.name)+"/openapi",auth:[["SecretKeyAuth"]],answers:{200:"json",304:"empty"},headers:t.headers,signal:t.signal})},async restoreDatabase(t){return e.send({op:"RestoreDatabase",method:"POST",path:"/databases/"+c("RestoreDatabase","name",t.path.name)+"/restore",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDatabaseSchema(t){return e.send({op:"GetDatabaseSchema",method:"GET",path:"/databases/"+c("GetDatabaseSchema","name",t.path.name)+"/schema",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getDatabaseMetrics(t){return e.send({op:"GetDatabaseMetrics",method:"GET",path:"/databases/"+c("GetDatabaseMetrics","name",t.path.name)+"/metrics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async queryDatabase(t){return e.send({op:"QueryDatabase",method:"POST",path:"/databases/"+c("QueryDatabase","name",t.path.name)+"/sql",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCrons(t){return e.send({op:"ListCrons",method:"GET",path:"/machines/"+c("ListCrons","name",t.path.name)+"/crons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCronRuns(t){return e.send({op:"ListCronRuns",method:"GET",path:"/machines/"+c("ListCronRuns","name",t.path.name)+"/crons/"+c("ListCronRuns","cron",t.path.cron)+"/runs",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async runCron(t){return e.send({op:"RunCron",method:"POST",path:"/machines/"+c("RunCron","name",t.path.name)+"/crons/"+c("RunCron","cron",t.path.cron)+"/run",auth:[["SecretKeyAuth"]],answers:{201:"json"},signal:t.signal})},async pauseCron(t){return e.send({op:"PauseCron",method:"POST",path:"/machines/"+c("PauseCron","name",t.path.name)+"/crons/"+c("PauseCron","cron",t.path.cron)+"/pause",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async resumeCron(t){return e.send({op:"ResumeCron",method:"POST",path:"/machines/"+c("ResumeCron","name",t.path.name)+"/crons/"+c("ResumeCron","cron",t.path.cron)+"/resume",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTasks(t){return e.send({op:"ListTasks",method:"GET",path:"/machines/"+c("ListTasks","name",t.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async enqueueTask(t){return e.send({op:"EnqueueTask",method:"POST",path:"/machines/"+c("EnqueueTask","name",t.path.name)+"/tasks",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getTask(t){return e.send({op:"GetTask",method:"GET",path:"/machines/"+c("GetTask","name",t.path.name)+"/tasks/"+c("GetTask","task",t.path.task),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelTask(t){return e.send({op:"CancelTask",method:"POST",path:"/machines/"+c("CancelTask","name",t.path.name)+"/tasks/"+c("CancelTask","task",t.path.task)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async retryTask(t){return e.send({op:"RetryTask",method:"POST",path:"/machines/"+c("RetryTask","name",t.path.name)+"/tasks/"+c("RetryTask","task",t.path.task)+"/retry",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listTaskTypes(t){return e.send({op:"ListTaskTypes",method:"GET",path:"/machines/"+c("ListTaskTypes","name",t.path.name)+"/task-types",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async makeTemplatedTestUsers(t){return e.send({op:"MakeTemplatedTestUsers",method:"POST",path:"/machines/"+c("MakeTemplatedTestUsers","name",t.path.name)+"/test-users",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async templateTestUser(t){return e.send({op:"TemplateTestUser",method:"POST",path:"/machines/"+c("TemplateTestUser","name",t.path.name)+"/test-users/"+c("TemplateTestUser","user",t.path.user)+"/templates/"+c("TemplateTestUser","template",t.path.template),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteTemplatedTestUser(t){return e.send({op:"DeleteTemplatedTestUser",method:"DELETE",path:"/machines/"+c("DeleteTemplatedTestUser","name",t.path.name)+"/test-users/"+c("DeleteTemplatedTestUser","user",t.path.user),auth:[["SecretKeyAuth"]],answers:{200:"json",204:"empty"},headers:t.headers,signal:t.signal})},async listSites(t){return e.send({op:"ListSites",method:"GET",path:"/sites",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createSite(t){return e.send({op:"CreateSite",method:"POST",path:"/sites",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSite(t){return e.send({op:"GetSite",method:"GET",path:"/sites/"+c("GetSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteSite(t){return e.send({op:"DeleteSite",method:"DELETE",path:"/sites/"+c("DeleteSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateSite(t){return e.send({op:"UpdateSite",method:"PATCH",path:"/sites/"+c("UpdateSite","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSiteReleases(t){return e.send({op:"ListSiteReleases",method:"GET",path:"/sites/"+c("ListSiteReleases","name",t.path.name)+"/releases",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSiteRelease(t){return e.send({op:"CreateSiteRelease",method:"POST",path:"/sites/"+c("CreateSiteRelease","name",t.path.name)+"/releases",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async uploadSiteFile(t){return e.send({op:"UploadSiteFile",method:"PUT",path:"/sites/"+c("UploadSiteFile","name",t.path.name)+"/releases/"+c("UploadSiteFile","release",t.path.release)+"/files/"+c("UploadSiteFile","digest",t.path.digest),auth:[["SecretKeyAuth"]],answers:{204:"empty"},body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async finishSiteRelease(t){return e.send({op:"FinishSiteRelease",method:"POST",path:"/sites/"+c("FinishSiteRelease","name",t.path.name)+"/releases/"+c("FinishSiteRelease","release",t.path.release)+"/finish",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async rollbackSite(t){return e.send({op:"RollbackSite",method:"POST",path:"/sites/"+c("RollbackSite","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSiteBuilds(t){return e.send({op:"ListSiteBuilds",method:"GET",path:"/sites/"+c("ListSiteBuilds","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deploySite(t){return e.send({op:"DeploySite",method:"POST",path:"/sites/"+c("DeploySite","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:t.signal})},async listSitePreviews(t){return e.send({op:"ListSitePreviews",method:"GET",path:"/sites/"+c("ListSitePreviews","name",t.path.name)+"/previews",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSiteDomains(t){return e.send({op:"ListSiteDomains",method:"GET",path:"/sites/"+c("ListSiteDomains","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addSiteDomain(t){return e.send({op:"AddSiteDomain",method:"POST",path:"/sites/"+c("AddSiteDomain","name",t.path.name)+"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSiteDomain(t){return e.send({op:"DeleteSiteDomain",method:"DELETE",path:"/sites/"+c("DeleteSiteDomain","name",t.path.name)+"/domains/"+c("DeleteSiteDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async updateSiteDomain(t){return e.send({op:"UpdateSiteDomain",method:"PATCH",path:"/sites/"+c("UpdateSiteDomain","name",t.path.name)+"/domains/"+c("UpdateSiteDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSiteBuild(t){return e.send({op:"GetSiteBuild",method:"GET",path:"/sites/"+c("GetSiteBuild","name",t.path.name)+"/builds/"+c("GetSiteBuild","build",t.path.build),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async authorizeSitePreview(t){return e.send({op:"AuthorizeSitePreview",method:"POST",path:"/sites/"+c("AuthorizeSitePreview","name",t.path.name)+"/previews/"+c("AuthorizeSitePreview","pull_request",t.path.pull_request)+"/authorize",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async authorizeMachinePreview(t){return e.send({op:"AuthorizeMachinePreview",method:"POST",path:"/machines/"+c("AuthorizeMachinePreview","name",t.path.name)+"/previews/"+c("AuthorizeMachinePreview","pull_request",t.path.pull_request)+"/authorize",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async openMachinePreview(t){return e.send({op:"OpenMachinePreview",method:"POST",path:"/machines/"+c("OpenMachinePreview","name",t.path.name)+"/previews/"+c("OpenMachinePreview","pull_request",t.path.pull_request)+"/open",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:t.signal})},async moveMachine(t){return e.send({op:"MoveMachine",method:"POST",path:"/machines/"+c("MoveMachine","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveSite(t){return e.send({op:"MoveSite",method:"POST",path:"/sites/"+c("MoveSite","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveDatabase(t){return e.send({op:"MoveDatabase",method:"POST",path:"/databases/"+c("MoveDatabase","name",t.path.name)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSiteBuild(t){return e.send({op:"CancelSiteBuild",method:"POST",path:"/sites/"+c("CancelSiteBuild","name",t.path.name)+"/builds/"+c("CancelSiteBuild","build",t.path.build)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelBuild(t){return e.send({op:"CancelBuild",method:"POST",path:"/machines/"+c("CancelBuild","name",t.path.name)+"/builds/"+c("CancelBuild","build",t.path.build)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSiteHooks(t){return e.send({op:"ListSiteHooks",method:"GET",path:"/sites/"+c("ListSiteHooks","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSiteHook(t){return e.send({op:"CreateSiteHook",method:"POST",path:"/sites/"+c("CreateSiteHook","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSiteHook(t){return e.send({op:"DeleteSiteHook",method:"DELETE",path:"/sites/"+c("DeleteSiteHook","name",t.path.name)+"/hooks/"+c("DeleteSiteHook","hook",t.path.hook),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listMachineHooks(t){return e.send({op:"ListMachineHooks",method:"GET",path:"/machines/"+c("ListMachineHooks","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createMachineHook(t){return e.send({op:"CreateMachineHook",method:"POST",path:"/machines/"+c("CreateMachineHook","name",t.path.name)+"/hooks",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMachineHook(t){return e.send({op:"DeleteMachineHook",method:"DELETE",path:"/machines/"+c("DeleteMachineHook","name",t.path.name)+"/hooks/"+c("DeleteMachineHook","hook",t.path.hook),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async detectProject(t){return e.send({op:"DetectProject",method:"GET",path:"/machines/github/detect",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createPreviewPass(t){return e.send({op:"CreatePreviewPass",method:"POST",path:"/sites/"+c("CreatePreviewPass","name",t.path.name)+"/previews/pass",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPreviewLinks(t){return e.send({op:"ListPreviewLinks",method:"GET",path:"/sites/"+c("ListPreviewLinks","name",t.path.name)+"/previews/links",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createPreviewLink(t){return e.send({op:"CreatePreviewLink",method:"POST",path:"/sites/"+c("CreatePreviewLink","name",t.path.name)+"/previews/links",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePreviewLink(t){return e.send({op:"DeletePreviewLink",method:"DELETE",path:"/sites/"+c("DeletePreviewLink","name",t.path.name)+"/previews/links/"+c("DeletePreviewLink","link",t.path.link),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listEnvironmentDomains(t){return e.send({op:"ListEnvironmentDomains",method:"GET",path:"/domains",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async addEnvironmentDomain(t){return e.send({op:"AddEnvironmentDomain",method:"POST",path:"/domains",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEnvironmentDomain(t){return e.send({op:"DeleteEnvironmentDomain",method:"DELETE",path:"/domains/"+c("DeleteEnvironmentDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async setEnvironmentSignInDomain(t){return e.send({op:"SetEnvironmentSignInDomain",method:"PATCH",path:"/domains/"+c("SetEnvironmentSignInDomain","host",t.path.host),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var ir={};wt(ir,{client:()=>n$});function n$(e){return{async adminAccessLog(t){return e.send({op:"AdminAccessLog",method:"GET",path:"/messaging/admin/access-log",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminListConversations(t){return e.send({op:"AdminListConversations",method:"GET",path:"/messaging/admin/conversations",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminCreateConversation(t){return e.send({op:"AdminCreateConversation",method:"POST",path:"/messaging/admin/conversations",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminGetConversation(t){return e.send({op:"AdminGetConversation",method:"GET",path:"/messaging/admin/conversations/"+c("AdminGetConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminDeleteConversation(t){return e.send({op:"AdminDeleteConversation",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminDeleteConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminUpdateConversation(t){return e.send({op:"AdminUpdateConversation",method:"PATCH",path:"/messaging/admin/conversations/"+c("AdminUpdateConversation","conversation_id",t.path.conversation_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminAddMembers(t){return e.send({op:"AdminAddMembers",method:"POST",path:"/messaging/admin/conversations/"+c("AdminAddMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminRemoveMember(t){return e.send({op:"AdminRemoveMember",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminRemoveMember","conversation_id",t.path.conversation_id)+"/members/"+c("AdminRemoveMember","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminListMessages(t){return e.send({op:"AdminListMessages",method:"GET",path:"/messaging/admin/conversations/"+c("AdminListMessages","conversation_id",t.path.conversation_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async adminSendMessage(t){return e.send({op:"AdminSendMessage",method:"POST",path:"/messaging/admin/conversations/"+c("AdminSendMessage","conversation_id",t.path.conversation_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminDeleteMessage(t){return e.send({op:"AdminDeleteMessage",method:"DELETE",path:"/messaging/admin/conversations/"+c("AdminDeleteMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("AdminDeleteMessage","message_id",t.path.message_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async adminFileUrl(t){return e.send({op:"AdminFileURL",method:"GET",path:"/messaging/admin/conversations/"+c("AdminFileURL","conversation_id",t.path.conversation_id)+"/messages/"+c("AdminFileURL","message_id",t.path.message_id)+"/attachments/"+c("AdminFileURL","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminPutProfile(t){return e.send({op:"AdminPutProfile",method:"PUT",path:"/messaging/admin/profiles/"+c("AdminPutProfile","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async adminListReports(t){return e.send({op:"AdminListReports",method:"GET",path:"/messaging/admin/reports",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async adminGetReport(t){return e.send({op:"AdminGetReport",method:"GET",path:"/messaging/admin/reports/"+c("AdminGetReport","report_id",t.path.report_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminReportFileUrl(t){return e.send({op:"AdminReportFileURL",method:"GET",path:"/messaging/admin/reports/"+c("AdminReportFileURL","report_id",t.path.report_id)+"/attachments/"+c("AdminReportFileURL","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async adminResolveReport(t){return e.send({op:"AdminResolveReport",method:"POST",path:"/messaging/admin/reports/"+c("AdminResolveReport","report_id",t.path.report_id)+"/resolve",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listBlocks(t){return e.send({op:"ListBlocks",method:"GET",path:"/messaging/blocks",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async block(t){return e.send({op:"Block",method:"PUT",path:"/messaging/blocks/"+c("Block","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async unblock(t){return e.send({op:"Unblock",method:"DELETE",path:"/messaging/blocks/"+c("Unblock","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async listConversations(t){return e.send({op:"ListConversations",method:"GET",path:"/messaging/conversations",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async openDirectConversation(t){return e.send({op:"OpenDirectConversation",method:"POST",path:"/messaging/conversations/direct",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createGroup(t){return e.send({op:"CreateGroup",method:"POST",path:"/messaging/conversations/group",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getConversation(t){return e.send({op:"GetConversation",method:"GET",path:"/messaging/conversations/"+c("GetConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deleteConversation(t){return e.send({op:"DeleteConversation",method:"DELETE",path:"/messaging/conversations/"+c("DeleteConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateConversation(t){return e.send({op:"UpdateConversation",method:"PATCH",path:"/messaging/conversations/"+c("UpdateConversation","conversation_id",t.path.conversation_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async clearConversation(t){return e.send({op:"ClearConversation",method:"POST",path:"/messaging/conversations/"+c("ClearConversation","conversation_id",t.path.conversation_id)+"/clear",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async closeConversation(t){return e.send({op:"CloseConversation",method:"POST",path:"/messaging/conversations/"+c("CloseConversation","conversation_id",t.path.conversation_id)+"/close",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async joinGroup(t){return e.send({op:"JoinGroup",method:"POST",path:"/messaging/conversations/"+c("JoinGroup","conversation_id",t.path.conversation_id)+"/join",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listMembers(t){return e.send({op:"ListMembers",method:"GET",path:"/messaging/conversations/"+c("ListMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async addMembers(t){return e.send({op:"AddMembers",method:"POST",path:"/messaging/conversations/"+c("AddMembers","conversation_id",t.path.conversation_id)+"/members",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeMember(t){return e.send({op:"RemoveMember",method:"DELETE",path:"/messaging/conversations/"+c("RemoveMember","conversation_id",t.path.conversation_id)+"/members/"+c("RemoveMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateMember(t){return e.send({op:"UpdateMember",method:"PATCH",path:"/messaging/conversations/"+c("UpdateMember","conversation_id",t.path.conversation_id)+"/members/"+c("UpdateMember","user_id",t.path.user_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMessages(t){return e.send({op:"ListMessages",method:"GET",path:"/messaging/conversations/"+c("ListMessages","conversation_id",t.path.conversation_id)+"/messages",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async sendMessage(t){return e.send({op:"SendMessage",method:"POST",path:"/messaging/conversations/"+c("SendMessage","conversation_id",t.path.conversation_id)+"/messages",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",201:"json",202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMessage(t){return e.send({op:"GetMessage",method:"GET",path:"/messaging/conversations/"+c("GetMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("GetMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async deleteMessage(t){return e.send({op:"DeleteMessage",method:"DELETE",path:"/messaging/conversations/"+c("DeleteMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("DeleteMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json",204:"empty"},query:t.query,signal:t.signal})},async editMessage(t){return e.send({op:"EditMessage",method:"PATCH",path:"/messaging/conversations/"+c("EditMessage","conversation_id",t.path.conversation_id)+"/messages/"+c("EditMessage","message_id",t.path.message_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async attachmentUrl(t){return e.send({op:"AttachmentURL",method:"GET",path:"/messaging/conversations/"+c("AttachmentURL","conversation_id",t.path.conversation_id)+"/messages/"+c("AttachmentURL","message_id",t.path.message_id)+"/attachments/"+c("AttachmentURL","attachment_id",t.path.attachment_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async react(t){return e.send({op:"React",method:"PUT",path:"/messaging/conversations/"+c("React","conversation_id",t.path.conversation_id)+"/messages/"+c("React","message_id",t.path.message_id)+"/reactions/"+c("React","emoji",t.path.emoji),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async unreact(t){return e.send({op:"Unreact",method:"DELETE",path:"/messaging/conversations/"+c("Unreact","conversation_id",t.path.conversation_id)+"/messages/"+c("Unreact","message_id",t.path.message_id)+"/reactions/"+c("Unreact","emoji",t.path.emoji),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async messageReaders(t){return e.send({op:"MessageReaders",method:"GET",path:"/messaging/conversations/"+c("MessageReaders","conversation_id",t.path.conversation_id)+"/messages/"+c("MessageReaders","message_id",t.path.message_id)+"/readers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listReplies(t){return e.send({op:"ListReplies",method:"GET",path:"/messaging/conversations/"+c("ListReplies","conversation_id",t.path.conversation_id)+"/messages/"+c("ListReplies","message_id",t.path.message_id)+"/replies",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async viewOnce(t){return e.send({op:"ViewOnce",method:"POST",path:"/messaging/conversations/"+c("ViewOnce","conversation_id",t.path.conversation_id)+"/messages/"+c("ViewOnce","message_id",t.path.message_id)+"/view",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async setConversationNotifications(t){return e.send({op:"SetConversationNotifications",method:"PUT",path:"/messaging/conversations/"+c("SetConversationNotifications","conversation_id",t.path.conversation_id)+"/notifications",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reportScreenshot(t){return e.send({op:"ReportScreenshot",method:"POST",path:"/messaging/conversations/"+c("ReportScreenshot","conversation_id",t.path.conversation_id)+"/screenshot",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async typing(t){return e.send({op:"Typing",method:"POST",path:"/messaging/conversations/"+c("Typing","conversation_id",t.path.conversation_id)+"/typing",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createUpload(t){return e.send({op:"CreateUpload",method:"POST",path:"/messaging/conversations/"+c("CreateUpload","conversation_id",t.path.conversation_id)+"/uploads",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listOpenGroups(t){return e.send({op:"ListOpenGroups",method:"GET",path:"/messaging/groups/open",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getMyProfile(t){return e.send({op:"GetMyProfile",method:"GET",path:"/messaging/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMyProfile(t){return e.send({op:"UpdateMyProfile",method:"PATCH",path:"/messaging/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async presence(t){return e.send({op:"Presence",method:"POST",path:"/messaging/me/presence",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t?.signal})},async getProfiles(t){return e.send({op:"GetProfiles",method:"GET",path:"/messaging/profiles",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async receipts(t){return e.send({op:"Receipts",method:"POST",path:"/messaging/receipts",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async report(t){return e.send({op:"Report",method:"POST",path:"/messaging/reports",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listScheduled(t){return e.send({op:"ListScheduled",method:"GET",path:"/messaging/scheduled",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async cancelScheduled(t){return e.send({op:"CancelScheduled",method:"DELETE",path:"/messaging/scheduled/"+c("CancelScheduled","scheduled_id",t.path.scheduled_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async updateScheduled(t){return e.send({op:"UpdateScheduled",method:"PATCH",path:"/messaging/scheduled/"+c("UpdateScheduled","scheduled_id",t.path.scheduled_id),auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async searchMessages(t){return e.send({op:"SearchMessages",method:"GET",path:"/messaging/search",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/messaging/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putSettings(t){return e.send({op:"PutSettings",method:"PUT",path:"/messaging/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateHookSecret(t){return e.send({op:"RotateHookSecret",method:"POST",path:"/messaging/settings/hook-secret",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async sync(t){return e.send({op:"Sync",method:"GET",path:"/messaging/sync",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listThreads(t){return e.send({op:"ListThreads",method:"GET",path:"/messaging/threads",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var No={};wt(No,{client:()=>s$});function s$(e){return{async getDeliverability(t){return e.send({op:"GetDeliverability",method:"GET",path:"/notify/deliverability",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/notify/devices",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async registerDevice(t){return e.send({op:"RegisterDevice",method:"POST",path:"/notify/devices",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getDeviceStats(t){return e.send({op:"GetDeviceStats",method:"GET",path:"/notify/devices/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async deleteMyDevice(t){return e.send({op:"DeleteMyDevice",method:"DELETE",path:"/notify/devices/"+c("DeleteMyDevice","device_id",t.path.device_id),auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async sendEmail(t){return e.send({op:"SendEmail",method:"POST",path:"/notify/email",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInAppCampaigns(t){return e.send({op:"ListInAppCampaigns",method:"GET",path:"/notify/in-app/campaigns",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createInAppCampaign(t){return e.send({op:"CreateInAppCampaign",method:"POST",path:"/notify/in-app/campaigns",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getInAppCampaign(t){return e.send({op:"GetInAppCampaign",method:"GET",path:"/notify/in-app/campaigns/"+c("GetInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putInAppCampaign(t){return e.send({op:"PutInAppCampaign",method:"PUT",path:"/notify/in-app/campaigns/"+c("PutInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteInAppCampaign(t){return e.send({op:"DeleteInAppCampaign",method:"DELETE",path:"/notify/in-app/campaigns/"+c("DeleteInAppCampaign","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getInAppCampaignStats(t){return e.send({op:"GetInAppCampaignStats",method:"GET",path:"/notify/in-app/campaigns/"+c("GetInAppCampaignStats","id",t.path.id)+"/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async showInAppMessage(t){return e.send({op:"ShowInAppMessage",method:"POST",path:"/notify/in-app/impressions",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async reportInAppEvent(t){return e.send({op:"ReportInAppEvent",method:"POST",path:"/notify/in-app/impressions/"+c("ReportInAppEvent","id",t.path.id)+"/events",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,query:t.query,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyInAppMessages(t){return e.send({op:"ListMyInAppMessages",method:"GET",path:"/notify/in-app/messages",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listInAppTemplates(t){return e.send({op:"ListInAppTemplates",method:"GET",path:"/notify/in-app/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listMyInbox(t){return e.send({op:"ListMyInbox",method:"GET",path:"/notify/inbox",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async sendInbox(t){return e.send({op:"SendInbox",method:"POST",path:"/notify/inbox",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listInboxMessages(t){return e.send({op:"ListInboxMessages",method:"GET",path:"/notify/inbox/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async readMyInbox(t){return e.send({op:"ReadMyInbox",method:"POST",path:"/notify/inbox/read",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteMyInboxMessage(t){return e.send({op:"DeleteMyInboxMessage",method:"DELETE",path:"/notify/inbox/"+c("DeleteMyInboxMessage","id",t.path.id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listNotifyMessages(t){return e.send({op:"ListNotifyMessages",method:"GET",path:"/notify/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getNotifyMessage(t){return e.send({op:"GetNotifyMessage",method:"GET",path:"/notify/messages/"+c("GetNotifyMessage","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelMessage(t){return e.send({op:"CancelMessage",method:"POST",path:"/notify/messages/"+c("CancelMessage","id",t.path.id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getMetricsSummary(t){return e.send({op:"GetMetricsSummary",method:"GET",path:"/notify/metrics/summary",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getMyPreferences(t){return e.send({op:"GetMyPreferences",method:"GET",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async setMyPreferences(t){return e.send({op:"SetMyPreferences",method:"PUT",path:"/notify/preferences",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listNotifyProviders(t){return e.send({op:"ListNotifyProviders",method:"GET",path:"/notify/providers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putNotifyProvider(t){return e.send({op:"PutNotifyProvider",method:"PUT",path:"/notify/providers/"+c("PutNotifyProvider","channel",t.path.channel)+"/"+c("PutNotifyProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteNotifyProvider(t){return e.send({op:"DeleteNotifyProvider",method:"DELETE",path:"/notify/providers/"+c("DeleteNotifyProvider","channel",t.path.channel)+"/"+c("DeleteNotifyProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async sendPush(t){return e.send({op:"SendPush",method:"POST",path:"/notify/push",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async recordPushReceipts(t){return e.send({op:"RecordPushReceipts",method:"POST",path:"/notify/receipts",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getNotifySettings(t){return e.send({op:"GetNotifySettings",method:"GET",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putNotifySettings(t){return e.send({op:"PutNotifySettings",method:"PUT",path:"/notify/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendSms(t){return e.send({op:"SendSMS",method:"POST",path:"/notify/sms",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listEmailTemplates(t){return e.send({op:"ListEmailTemplates",method:"GET",path:"/notify/templates/email",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getEmailTemplate(t){return e.send({op:"GetEmailTemplate",method:"GET",path:"/notify/templates/email/"+c("GetEmailTemplate","slug",t.path.slug)+"/"+c("GetEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putEmailTemplate(t){return e.send({op:"PutEmailTemplate",method:"PUT",path:"/notify/templates/email/"+c("PutEmailTemplate","slug",t.path.slug)+"/"+c("PutEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteEmailTemplate(t){return e.send({op:"DeleteEmailTemplate",method:"DELETE",path:"/notify/templates/email/"+c("DeleteEmailTemplate","slug",t.path.slug)+"/"+c("DeleteEmailTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listPushTemplates(t){return e.send({op:"ListPushTemplates",method:"GET",path:"/notify/templates/push",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPushTemplate(t){return e.send({op:"GetPushTemplate",method:"GET",path:"/notify/templates/push/"+c("GetPushTemplate","slug",t.path.slug)+"/"+c("GetPushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putPushTemplate(t){return e.send({op:"PutPushTemplate",method:"PUT",path:"/notify/templates/push/"+c("PutPushTemplate","slug",t.path.slug)+"/"+c("PutPushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deletePushTemplate(t){return e.send({op:"DeletePushTemplate",method:"DELETE",path:"/notify/templates/push/"+c("DeletePushTemplate","slug",t.path.slug)+"/"+c("DeletePushTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listSmsTemplates(t){return e.send({op:"ListSMSTemplates",method:"GET",path:"/notify/templates/sms",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getSmsTemplate(t){return e.send({op:"GetSMSTemplate",method:"GET",path:"/notify/templates/sms/"+c("GetSMSTemplate","slug",t.path.slug)+"/"+c("GetSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putSmsTemplate(t){return e.send({op:"PutSMSTemplate",method:"PUT",path:"/notify/templates/sms/"+c("PutSMSTemplate","slug",t.path.slug)+"/"+c("PutSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSmsTemplate(t){return e.send({op:"DeleteSMSTemplate",method:"DELETE",path:"/notify/templates/sms/"+c("DeleteSMSTemplate","slug",t.path.slug)+"/"+c("DeleteSMSTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listWhatsAppTemplates(t){return e.send({op:"ListWhatsAppTemplates",method:"GET",path:"/notify/templates/whatsapp",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getWhatsAppTemplate(t){return e.send({op:"GetWhatsAppTemplate",method:"GET",path:"/notify/templates/whatsapp/"+c("GetWhatsAppTemplate","slug",t.path.slug)+"/"+c("GetWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putWhatsAppTemplate(t){return e.send({op:"PutWhatsAppTemplate",method:"PUT",path:"/notify/templates/whatsapp/"+c("PutWhatsAppTemplate","slug",t.path.slug)+"/"+c("PutWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteWhatsAppTemplate(t){return e.send({op:"DeleteWhatsAppTemplate",method:"DELETE",path:"/notify/templates/whatsapp/"+c("DeleteWhatsAppTemplate","slug",t.path.slug)+"/"+c("DeleteWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listTestUserMessages(t){return e.send({op:"ListTestUserMessages",method:"GET",path:"/notify/test-users/"+c("ListTestUserMessages","user_id",t.path.user_id)+"/messages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listTopics(t){return e.send({op:"ListTopics",method:"GET",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createTopic(t){return e.send({op:"CreateTopic",method:"POST",path:"/notify/topics",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteTopic(t){return e.send({op:"DeleteTopic",method:"DELETE",path:"/notify/topics/"+c("DeleteTopic","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async changeTopic(t){return e.send({op:"ChangeTopic",method:"PATCH",path:"/notify/topics/"+c("ChangeTopic","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addTopicSubscribers(t){return e.send({op:"AddTopicSubscribers",method:"POST",path:"/notify/topics/"+c("AddTopicSubscribers","name",t.path.name)+"/subscribers",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeTopicSubscriber(t){return e.send({op:"RemoveTopicSubscriber",method:"DELETE",path:"/notify/topics/"+c("RemoveTopicSubscriber","name",t.path.name)+"/subscribers/"+c("RemoveTopicSubscriber","user_id",t.path.user_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async followTopic(t){return e.send({op:"FollowTopic",method:"POST",path:"/notify/topics/"+c("FollowTopic","name",t.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async unfollowTopic(t){return e.send({op:"UnfollowTopic",method:"DELETE",path:"/notify/topics/"+c("UnfollowTopic","name",t.path.name)+"/subscription",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listUserDevices(t){return e.send({op:"ListUserDevices",method:"GET",path:"/notify/users/"+c("ListUserDevices","user_id",t.path.user_id)+"/devices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getUserPreferences(t){return e.send({op:"GetUserPreferences",method:"GET",path:"/notify/users/"+c("GetUserPreferences","user_id",t.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setUserPreferences(t){return e.send({op:"SetUserPreferences",method:"PUT",path:"/notify/users/"+c("SetUserPreferences","user_id",t.path.user_id)+"/preferences",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async startVerification(t){return e.send({op:"StartVerification",method:"POST",path:"/notify/verifications",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async checkVerification(t){return e.send({op:"CheckVerification",method:"POST",path:"/notify/verifications/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveSendGridEvents(t){return e.send({op:"ReceiveSendGridEvents",method:"POST",path:"/notify/webhooks/email/sendgrid",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveTwilioStatus(t){return e.send({op:"ReceiveTwilioStatus",method:"POST",path:"/notify/webhooks/sms/twilio",auth:[],answers:{204:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async receiveTwilioText(t){return e.send({op:"ReceiveTwilioText",method:"POST",path:"/notify/webhooks/sms/twilio/inbound",auth:[],answers:{204:"empty"},body:{kind:"form",contentType:"application/x-www-form-urlencoded",value:t.body},signal:t.signal})},async receiveVonageReceiptQuery(t){return e.send({op:"ReceiveVonageReceiptQuery",method:"GET",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},query:t?.query,signal:t?.signal})},async receiveVonageReceipt(t){return e.send({op:"ReceiveVonageReceipt",method:"POST",path:"/notify/webhooks/sms/vonage",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async subscribeMetaWebhook(t){return e.send({op:"SubscribeMetaWebhook",method:"GET",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async receiveMetaNotification(t){return e.send({op:"ReceiveMetaNotification",method:"POST",path:"/notify/webhooks/whatsapp/meta",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWebPushStatus(t){return e.send({op:"GetWebPushStatus",method:"GET",path:"/notify/webpush",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getWebPushKey(t){return e.send({op:"GetWebPushKey",method:"GET",path:"/notify/webpush/key",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async sendWhatsApp(t){return e.send({op:"SendWhatsApp",method:"POST",path:"/notify/whatsapp",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWhatsAppInbound(t){return e.send({op:"ListWhatsAppInbound",method:"GET",path:"/notify/whatsapp/inbound",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var Mo={};wt(Mo,{client:()=>a$});function a$(e){return{async auditCashFlow(t){return e.send({op:"AuditCashFlow",method:"GET",path:"/payments/audit/cashflow",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async auditDrift(t){return e.send({op:"AuditDrift",method:"GET",path:"/payments/audit/drift",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async auditLedger(t){return e.send({op:"AuditLedger",method:"GET",path:"/payments/audit/ledger",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async exportAuditLedgerCsv(t){return e.send({op:"ExportAuditLedgerCSV",method:"GET",path:"/payments/audit/ledger/export",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async providerCallbackGet(t){return e.send({op:"ProviderCallbackGet",method:"GET",path:"/payments/callback/"+c("ProviderCallbackGet","provider",t.path.provider)+"/"+c("ProviderCallbackGet","attempt_id",t.path.attempt_id),auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async providerCallbackPost(t){return e.send({op:"ProviderCallbackPost",method:"POST",path:"/payments/callback/"+c("ProviderCallbackPost","provider",t.path.provider)+"/"+c("ProviderCallbackPost","attempt_id",t.path.attempt_id),auth:[],answers:{200:"raw"},signal:t.signal})},async getCapabilities(t){return e.send({op:"GetCapabilities",method:"GET",path:"/payments/capabilities",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listChannels(t){return e.send({op:"ListChannels",method:"GET",path:"/payments/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectChannel(t){return e.send({op:"ConnectChannel",method:"POST",path:"/payments/channels",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createChannelGrant(t){return e.send({op:"CreateChannelGrant",method:"POST",path:"/payments/channels/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChannel(t){return e.send({op:"GetChannel",method:"GET",path:"/payments/channels/"+c("GetChannel","channel_key",t.path.channel_key),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteChannel(t){return e.send({op:"DeleteChannel",method:"DELETE",path:"/payments/channels/"+c("DeleteChannel","channel_key",t.path.channel_key),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async checkChannel(t){return e.send({op:"CheckChannel",method:"POST",path:"/payments/channels/"+c("CheckChannel","channel_key",t.path.channel_key)+"/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setDefaultChannel(t){return e.send({op:"SetDefaultChannel",method:"POST",path:"/payments/channels/"+c("SetDefaultChannel","channel_key",t.path.channel_key)+"/default",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async connectChannelPage(t){return e.send({op:"ConnectChannelPage",method:"GET",path:"/payments/connect",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async connectChannelSubmit(t){return e.send({op:"ConnectChannelSubmit",method:"POST",path:"/payments/connect",auth:[],answers:{200:"json"},signal:t?.signal})},async listDisputes(t){return e.send({op:"ListDisputes",method:"GET",path:"/payments/disputes",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async lookupInstallments(t){return e.send({op:"LookupInstallments",method:"POST",path:"/payments/installments",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listIntents(t){return e.send({op:"ListIntents",method:"GET",path:"/payments/intents",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createIntent(t){return e.send({op:"CreateIntent",method:"POST",path:"/payments/intents",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getIntent(t){return e.send({op:"GetIntent",method:"GET",path:"/payments/intents/"+c("GetIntent","intent_id",t.path.intent_id),auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listIntentAttempts(t){return e.send({op:"ListIntentAttempts",method:"GET",path:"/payments/intents/"+c("ListIntentAttempts","intent_id",t.path.intent_id)+"/attempts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async cancelIntent(t){return e.send({op:"CancelIntent",method:"POST",path:"/payments/intents/"+c("CancelIntent","intent_id",t.path.intent_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async settlePendingRefund(t){return e.send({op:"SettlePendingRefund",method:"POST",path:"/payments/intents/"+c("SettlePendingRefund","intent_id",t.path.intent_id)+"/pending-refund",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async captureIntent(t){return e.send({op:"CaptureIntent",method:"POST",path:"/payments/intents/"+c("CaptureIntent","intent_id",t.path.intent_id)+"/capture",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async confirmIntent(t){return e.send({op:"ConfirmIntent",method:"POST",path:"/payments/intents/"+c("ConfirmIntent","intent_id",t.path.intent_id)+"/confirm",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async submitIntentOtp(t){return e.send({op:"SubmitIntentOTP",method:"POST",path:"/payments/intents/"+c("SubmitIntentOTP","intent_id",t.path.intent_id)+"/otp",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyMethods(t){return e.send({op:"ListMyMethods",method:"GET",path:"/payments/me/methods",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async addMyMethod(t){return e.send({op:"AddMyMethod",method:"POST",path:"/payments/me/methods",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async deleteMyMethod(t){return e.send({op:"DeleteMyMethod",method:"DELETE",path:"/payments/me/methods/"+c("DeleteMyMethod","method_id",t.path.method_id),auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async createMyPortal(t){return e.send({op:"CreateMyPortal",method:"POST",path:"/payments/me/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getMyProfile(t){return e.send({op:"GetMyProfile",method:"GET",path:"/payments/me/profile",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async updateMyProfile(t){return e.send({op:"UpdateMyProfile",method:"PUT",path:"/payments/me/profile",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMySubscriptions(t){return e.send({op:"ListMySubscriptions",method:"GET",path:"/payments/me/subscriptions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async cancelMySubscription(t){return e.send({op:"CancelMySubscription",method:"POST",path:"/payments/me/subscriptions/"+c("CancelMySubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t.signal})},async listMyWallets(t){return e.send({op:"ListMyWallets",method:"GET",path:"/payments/me/wallets",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async createMySpendToken(t){return e.send({op:"CreateMySpendToken",method:"POST",path:"/payments/me/wallets/spend-tokens",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async topUpMyWallet(t){return e.send({op:"TopUpMyWallet",method:"POST",path:"/payments/me/wallets/top-up",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRefunds(t){return e.send({op:"ListRefunds",method:"GET",path:"/payments/refunds",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createRefund(t){return e.send({op:"CreateRefund",method:"POST",path:"/payments/refunds",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listRoutingRules(t){return e.send({op:"ListRoutingRules",method:"GET",path:"/payments/routing-rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async replaceRoutingRules(t){return e.send({op:"ReplaceRoutingRules",method:"PUT",path:"/payments/routing-rules",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSellerAccount(t){return e.send({op:"GetSellerAccount",method:"GET",path:"/payments/seller-accounts/"+c("GetSellerAccount","seller_ref",t.path.seller_ref),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSellerLedger(t){return e.send({op:"ListSellerLedger",method:"GET",path:"/payments/seller-accounts/"+c("ListSellerLedger","seller_ref",t.path.seller_ref)+"/ledger",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/payments/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/payments/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPaymentSplits(t){return e.send({op:"ListPaymentSplits",method:"GET",path:"/payments/splits",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async updatePaymentSplit(t){return e.send({op:"UpdatePaymentSplit",method:"PUT",path:"/payments/splits/"+c("UpdatePaymentSplit","split_id",t.path.split_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async approvePaymentSplit(t){return e.send({op:"ApprovePaymentSplit",method:"POST",path:"/payments/splits/"+c("ApprovePaymentSplit","split_id",t.path.split_id)+"/approve",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async disapprovePaymentSplit(t){return e.send({op:"DisapprovePaymentSplit",method:"POST",path:"/payments/splits/"+c("DisapprovePaymentSplit","split_id",t.path.split_id)+"/disapprove",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async refundPaymentSplit(t){return e.send({op:"RefundPaymentSplit",method:"POST",path:"/payments/splits/"+c("RefundPaymentSplit","split_id",t.path.split_id)+"/refund",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async stripeAppCallback(t){return e.send({op:"StripeAppCallback",method:"GET",path:"/payments/stripe/app/callback",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async createStripeAppGrant(t){return e.send({op:"CreateStripeAppGrant",method:"POST",path:"/payments/stripe/app/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async stripeAppInstallPage(t){return e.send({op:"StripeAppInstallPage",method:"GET",path:"/payments/stripe/app/install",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async stripeAppInstallStart(t){return e.send({op:"StripeAppInstallStart",method:"POST",path:"/payments/stripe/app/install",auth:[],answers:{303:"redirect"},signal:t?.signal})},async listSubMerchants(t){return e.send({op:"ListSubMerchants",method:"GET",path:"/payments/sub-merchants",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async upsertSubMerchant(t){return e.send({op:"UpsertSubMerchant",method:"POST",path:"/payments/sub-merchants",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSubMerchant(t){return e.send({op:"GetSubMerchant",method:"GET",path:"/payments/sub-merchants/"+c("GetSubMerchant","sub_merchant_id",t.path.sub_merchant_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createSubMerchantOnboardingLink(t){return e.send({op:"CreateSubMerchantOnboardingLink",method:"POST",path:"/payments/sub-merchants/"+c("CreateSubMerchantOnboardingLink","sub_merchant_id",t.path.sub_merchant_id)+"/onboarding-link",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async syncSubMerchant(t){return e.send({op:"SyncSubMerchant",method:"POST",path:"/payments/sub-merchants/"+c("SyncSubMerchant","sub_merchant_id",t.path.sub_merchant_id)+"/sync",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listSubscriptions(t){return e.send({op:"ListSubscriptions",method:"GET",path:"/payments/subscriptions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async createSubscription(t){return e.send({op:"CreateSubscription",method:"POST",path:"/payments/subscriptions",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/payments/subscriptions/"+c("CancelSubscription","subscription_id",t.path.subscription_id)+"/cancel",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/payments/subscriptions/"+c("ExtendSubscription","subscription_id",t.path.subscription_id)+"/extend",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async changeSubscriptionQuantity(t){return e.send({op:"ChangeSubscriptionQuantity",method:"POST",path:"/payments/subscriptions/"+c("ChangeSubscriptionQuantity","subscription_id",t.path.subscription_id)+"/quantity",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listWallets(t){return e.send({op:"ListWallets",method:"GET",path:"/payments/wallets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async upsertWallet(t){return e.send({op:"UpsertWallet",method:"POST",path:"/payments/wallets",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async chargeWallet(t){return e.send({op:"ChargeWallet",method:"POST",path:"/payments/wallets/charge",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async creditWallet(t){return e.send({op:"CreditWallet",method:"POST",path:"/payments/wallets/credit",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCustomerWallets(t){return e.send({op:"GetCustomerWallets",method:"GET",path:"/payments/wallets/customers/"+c("GetCustomerWallets","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async freezeWallet(t){return e.send({op:"FreezeWallet",method:"PUT",path:"/payments/wallets/customers/"+c("FreezeWallet","customer_id",t.path.customer_id)+"/"+c("FreezeWallet","wallet_key",t.path.wallet_key)+"/freeze",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createWalletHold(t){return e.send({op:"CreateWalletHold",method:"POST",path:"/payments/wallets/holds",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async commitWalletHold(t){return e.send({op:"CommitWalletHold",method:"POST",path:"/payments/wallets/holds/"+c("CommitWalletHold","hold_id",t.path.hold_id)+"/commit",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseWalletHold(t){return e.send({op:"ReleaseWalletHold",method:"POST",path:"/payments/wallets/holds/"+c("ReleaseWalletHold","hold_id",t.path.hold_id)+"/release",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async voidPendingWalletCredits(t){return e.send({op:"VoidPendingWalletCredits",method:"POST",path:"/payments/wallets/pending/void",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async transferWallet(t){return e.send({op:"TransferWallet",method:"POST",path:"/payments/wallets/transfer",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async iyzicoWebhook(t){return e.send({op:"IyzicoWebhook",method:"POST",path:"/payments/webhooks/iyzico",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeWebhook(t){return e.send({op:"StripeWebhook",method:"POST",path:"/payments/webhooks/stripe",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeAppWebhook(t){return e.send({op:"StripeAppWebhook",method:"POST",path:"/payments/webhooks/stripe-app",auth:[],answers:{200:"empty"},signal:t?.signal})},async stripeConnectWebhook(t){return e.send({op:"StripeConnectWebhook",method:"POST",path:"/payments/webhooks/stripe/connect",auth:[],answers:{200:"empty"},signal:t?.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/payments/customers/"+c("GetCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async updateCustomer(t){return e.send({op:"UpdateCustomer",method:"PUT",path:"/payments/customers/"+c("UpdateCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCustomer(t){return e.send({op:"DeleteCustomer",method:"DELETE",path:"/payments/customers/"+c("DeleteCustomer","customer_id",t.path.customer_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listCustomerMethods(t){return e.send({op:"ListCustomerMethods",method:"GET",path:"/payments/customers/"+c("ListCustomerMethods","customer_id",t.path.customer_id)+"/methods",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async addCustomerMethod(t){return e.send({op:"AddCustomerMethod",method:"POST",path:"/payments/customers/"+c("AddCustomerMethod","customer_id",t.path.customer_id)+"/methods",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteCustomerMethod(t){return e.send({op:"DeleteCustomerMethod",method:"DELETE",path:"/payments/customers/"+c("DeleteCustomerMethod","customer_id",t.path.customer_id)+"/methods/"+c("DeleteCustomerMethod","method_id",t.path.method_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async setCustomerDefaultMethod(t){return e.send({op:"SetCustomerDefaultMethod",method:"POST",path:"/payments/customers/"+c("SetCustomerDefaultMethod","customer_id",t.path.customer_id)+"/methods/"+c("SetCustomerDefaultMethod","method_id",t.path.method_id)+"/default",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createCustomerPortal(t){return e.send({op:"CreateCustomerPortal",method:"POST",path:"/payments/customers/"+c("CreateCustomerPortal","customer_id",t.path.customer_id)+"/portal",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listCustomerInvoices(t){return e.send({op:"ListCustomerInvoices",method:"GET",path:"/payments/customers/"+c("ListCustomerInvoices","customer_id",t.path.customer_id)+"/invoices",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createCustomerInvoice(t){return e.send({op:"CreateCustomerInvoice",method:"POST",path:"/payments/customers/"+c("CreateCustomerInvoice","customer_id",t.path.customer_id)+"/invoices",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getInvoice(t){return e.send({op:"GetInvoice",method:"GET",path:"/payments/invoices/"+c("GetInvoice","invoice_id",t.path.invoice_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async payInvoice(t){return e.send({op:"PayInvoice",method:"POST",path:"/payments/invoices/"+c("PayInvoice","invoice_id",t.path.invoice_id)+"/pay",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async voidInvoice(t){return e.send({op:"VoidInvoice",method:"POST",path:"/payments/invoices/"+c("VoidInvoice","invoice_id",t.path.invoice_id)+"/void",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async markInvoiceUncollectible(t){return e.send({op:"MarkInvoiceUncollectible",method:"POST",path:"/payments/invoices/"+c("MarkInvoiceUncollectible","invoice_id",t.path.invoice_id)+"/uncollectible",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async sendInvoice(t){return e.send({op:"SendInvoice",method:"POST",path:"/payments/invoices/"+c("SendInvoice","invoice_id",t.path.invoice_id)+"/send",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})}}}var Do={};wt(Do,{client:()=>o$});function o$(e){return{async broadcast(t){return e.send({op:"Broadcast",method:"POST",path:"/realtime/broadcast",auth:[["SecretKeyAuth"]],answers:{202:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getChannels(t){return e.send({op:"GetChannels",method:"GET",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putChannels(t){return e.send({op:"PutChannels",method:"PUT",path:"/realtime/channels",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getLimits(t){return e.send({op:"GetLimits",method:"GET",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async putLimits(t){return e.send({op:"PutLimits",method:"PUT",path:"/realtime/limits",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revalidate(t){return e.send({op:"Revalidate",method:"POST",path:"/realtime/revalidate",auth:[["SecretKeyAuth"]],answers:{202:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async writeState(t){return e.send({op:"WriteState",method:"POST",path:"/realtime/state",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStats(t){return e.send({op:"GetStats",method:"GET",path:"/realtime/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})}}}var zo={};wt(zo,{client:()=>i$});function i$(e){return{async listSecretAudit(t){return e.send({op:"ListSecretAudit",method:"GET",path:"/secrets/audit",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listFieldKeys(t){return e.send({op:"ListFieldKeys",method:"GET",path:"/secrets/fields",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getFieldKeys(t){return e.send({op:"GetFieldKeys",method:"GET",path:"/secrets/fields/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async openFields(t){return e.send({op:"OpenFields",method:"POST",path:"/secrets/fields/open",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sealPlaceholder(t){return e.send({op:"SealPlaceholder",method:"POST",path:"/secrets/fields/placeholder",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async rotateFieldKeys(t){return e.send({op:"RotateFieldKeys",method:"POST",path:"/secrets/fields/rotate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async listTransitKeys(t){return e.send({op:"ListTransitKeys",method:"GET",path:"/secrets/transit",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTransitKeys(t){return e.send({op:"GetTransitKeys",method:"GET",path:"/secrets/transit/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getTransitPublicKeys(t){return e.send({op:"GetTransitPublicKeys",method:"GET",path:"/secrets/transit/public",auth:[["ApiKeyAuth"],["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async rotateTransitKeys(t){return e.send({op:"RotateTransitKeys",method:"POST",path:"/secrets/transit/rotate",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async retireTransitKey(t){return e.send({op:"RetireTransitKey",method:"POST",path:"/secrets/transit/"+c("RetireTransitKey","kid",t.path.kid)+"/retire",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listSecrets(t){return e.send({op:"ListSecrets",method:"GET",path:"/secrets/"+c("ListSecrets","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getEnvironmentValues(t){return e.send({op:"GetEnvironmentValues",method:"GET",path:"/secrets/"+c("GetEnvironmentValues","environment",t.path.environment)+"/values",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getSecret(t){return e.send({op:"GetSecret",method:"GET",path:"/secrets/"+c("GetSecret","environment",t.path.environment)+"/"+c("GetSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putSecret(t){return e.send({op:"PutSecret",method:"PUT",path:"/secrets/"+c("PutSecret","environment",t.path.environment)+"/"+c("PutSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteSecret(t){return e.send({op:"DeleteSecret",method:"DELETE",path:"/secrets/"+c("DeleteSecret","environment",t.path.environment)+"/"+c("DeleteSecret","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async rollbackSecret(t){return e.send({op:"RollbackSecret",method:"POST",path:"/secrets/"+c("RollbackSecret","environment",t.path.environment)+"/"+c("RollbackSecret","name",t.path.name)+"/rollback",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listSecretVersions(t){return e.send({op:"ListSecretVersions",method:"GET",path:"/secrets/"+c("ListSecretVersions","environment",t.path.environment)+"/"+c("ListSecretVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})}}}var qo={};wt(qo,{client:()=>r$});function r$(e){return{async listBuckets(t){return e.send({op:"ListBuckets",method:"GET",path:"/storage/buckets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getBucket(t){return e.send({op:"GetBucket",method:"GET",path:"/storage/buckets/"+c("GetBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async putBucket(t){return e.send({op:"PutBucket",method:"PUT",path:"/storage/buckets/"+c("PutBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteBucket(t){return e.send({op:"DeleteBucket",method:"DELETE",path:"/storage/buckets/"+c("DeleteBucket","bucket",t.path.bucket),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async copyObject(t){return e.send({op:"CopyObject",method:"POST",path:"/storage/buckets/"+c("CopyObject","bucket",t.path.bucket)+"/copy",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async moveObject(t){return e.send({op:"MoveObject",method:"POST",path:"/storage/buckets/"+c("MoveObject","bucket",t.path.bucket)+"/move",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listObjects(t){return e.send({op:"ListObjects",method:"GET",path:"/storage/buckets/"+c("ListObjects","bucket",t.path.bucket)+"/objects",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getObject(t){return e.send({op:"GetObject",method:"GET",path:"/storage/buckets/"+c("GetObject","bucket",t.path.bucket)+"/objects/"+c("GetObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putObject(t){return e.send({op:"PutObject",method:"PUT",path:"/storage/buckets/"+c("PutObject","bucket",t.path.bucket)+"/objects/"+c("PutObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async deleteObject(t){return e.send({op:"DeleteObject",method:"DELETE",path:"/storage/buckets/"+c("DeleteObject","bucket",t.path.bucket)+"/objects/"+c("DeleteObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async headObject(t){return e.send({op:"HeadObject",method:"HEAD",path:"/storage/buckets/"+c("HeadObject","bucket",t.path.bucket)+"/objects/"+c("HeadObject","path",t.path.path),auth:[["SecretKeyAuth"]],answers:{200:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async createSignedUrl(t){return e.send({op:"CreateSignedUrl",method:"POST",path:"/storage/buckets/"+c("CreateSignedUrl","bucket",t.path.bucket)+"/signed-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async createUploadUrl(t){return e.send({op:"CreateUploadUrl",method:"POST",path:"/storage/buckets/"+c("CreateUploadUrl","bucket",t.path.bucket)+"/upload-urls",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getPublicObject(t){return e.send({op:"GetPublicObject",method:"GET",path:"/storage/public/"+c("GetPublicObject","bucket",t.path.bucket)+"/"+c("GetPublicObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async headPublicObject(t){return e.send({op:"HeadPublicObject",method:"HEAD",path:"/storage/public/"+c("HeadPublicObject","bucket",t.path.bucket)+"/"+c("HeadPublicObject","path",t.path.path),auth:[],answers:{200:"empty",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getSignedObject(t){return e.send({op:"GetSignedObject",method:"GET",path:"/storage/signed/"+c("GetSignedObject","bucket",t.path.bucket)+"/"+c("GetSignedObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putSignedObject(t){return e.send({op:"PutSignedObject",method:"PUT",path:"/storage/signed/"+c("PutSignedObject","bucket",t.path.bucket)+"/"+c("PutSignedObject","path",t.path.path),auth:[],answers:{200:"json",201:"json"},query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async headSignedObject(t){return e.send({op:"HeadSignedObject",method:"HEAD",path:"/storage/signed/"+c("HeadSignedObject","bucket",t.path.bucket)+"/"+c("HeadSignedObject","path",t.path.path),auth:[],answers:{200:"empty",302:"redirect",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getStorageStats(t){return e.send({op:"GetStorageStats",method:"GET",path:"/storage/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async upload(t){return e.send({op:"Upload",method:"POST",path:"/storage/upload/"+c("Upload","machine",t.path.machine)+"/"+c("Upload","route",t.path.route),auth:[["ApiKeyAuth","userJWT"],["ApiKeyAuth"]],answers:{},body:{kind:"raw",contentType:t.contentType??"multipart/form-data",value:t.body},signal:t.signal})}}}var Go={};wt(Go,{client:()=>l$});function l$(e){return{async listActions(t){return e.send({op:"ListActions",method:"GET",path:"/stores/actions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getAction(t){return e.send({op:"GetAction",method:"GET",path:"/stores/actions/"+c("GetAction","action_id",t.path.action_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async confirmAction(t){return e.send({op:"ConfirmAction",method:"POST",path:"/stores/actions/"+c("ConfirmAction","action_id",t.path.action_id)+"/confirm",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async declineAction(t){return e.send({op:"DeclineAction",method:"POST",path:"/stores/actions/"+c("DeclineAction","action_id",t.path.action_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/stores/apple",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkAppleAccount(t){return e.send({op:"CheckAppleAccount",method:"POST",path:"/stores/apple/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createAppleGrant(t){return e.send({op:"CreateAppleGrant",method:"POST",path:"/stores/apple/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getSandboxReadiness(t){return e.send({op:"GetSandboxReadiness",method:"GET",path:"/stores/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listSandboxTesters(t){return e.send({op:"ListSandboxTesters",method:"GET",path:"/stores/apple/sandbox-testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async clearSandboxPurchaseHistory(t){return e.send({op:"ClearSandboxPurchaseHistory",method:"POST",path:"/stores/apple/sandbox-testers/clear-purchase-history",auth:[["SecretKeyAuth"]],answers:{202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async updateSandboxTester(t){return e.send({op:"UpdateSandboxTester",method:"PATCH",path:"/stores/apple/sandbox-testers/"+c("UpdateSandboxTester","tester_id",t.path.tester_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listApps(t){return e.send({op:"ListApps",method:"GET",path:"/stores/apps",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listFeedback(t){return e.send({op:"ListFeedback",method:"GET",path:"/stores/apps/"+c("ListFeedback","app_id",t.path.app_id)+"/feedback",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getFeedback(t){return e.send({op:"GetFeedback",method:"GET",path:"/stores/apps/"+c("GetFeedback","app_id",t.path.app_id)+"/feedback/"+c("GetFeedback","kind",t.path.kind)+"/"+c("GetFeedback","feedback_id",t.path.feedback_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listGroups(t){return e.send({op:"ListGroups",method:"GET",path:"/stores/apps/"+c("ListGroups","app_id",t.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async createGroup(t){return e.send({op:"CreateGroup",method:"POST",path:"/stores/apps/"+c("CreateGroup","app_id",t.path.app_id)+"/groups",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async linkApp(t){return e.send({op:"LinkApp",method:"POST",path:"/stores/apps/"+c("LinkApp","app_id",t.path.app_id)+"/link",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getListing(t){return e.send({op:"GetListing",method:"GET",path:"/stores/apps/"+c("GetListing","app_id",t.path.app_id)+"/listing",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setListing(t){return e.send({op:"SetListing",method:"PUT",path:"/stores/apps/"+c("SetListing","app_id",t.path.app_id)+"/listing",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planListing(t){return e.send({op:"PlanListing",method:"POST",path:"/stores/apps/"+c("PlanListing","app_id",t.path.app_id)+"/listing/plan",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async createPackage(t){return e.send({op:"CreatePackage",method:"POST",path:"/stores/apps/"+c("CreatePackage","app_id",t.path.app_id)+"/packages",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async uploadScreenshot(t){return e.send({op:"UploadScreenshot",method:"PUT",path:"/stores/apps/"+c("UploadScreenshot","app_id",t.path.app_id)+"/screenshots",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,query:t.query,headers:t.headers,body:{kind:"raw",contentType:t.contentType??"image/png",value:t.body},signal:t.signal})},async getReviewInfo(t){return e.send({op:"GetReviewInfo",method:"GET",path:"/stores/apps/"+c("GetReviewInfo","app_id",t.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async setReviewInfo(t){return e.send({op:"SetReviewInfo",method:"PUT",path:"/stores/apps/"+c("SetReviewInfo","app_id",t.path.app_id)+"/testflight/review-info",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getUploadKey(t){return e.send({op:"GetUploadKey",method:"GET",path:"/stores/apps/"+c("GetUploadKey","app_id",t.path.app_id)+"/upload-key",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getAppStoreVersion(t){return e.send({op:"GetAppStoreVersion",method:"GET",path:"/stores/apps/"+c("GetAppStoreVersion","app_id",t.path.app_id)+"/version",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async prepareAppStoreVersion(t){return e.send({op:"PrepareAppStoreVersion",method:"PUT",path:"/stores/apps/"+c("PrepareAppStoreVersion","app_id",t.path.app_id)+"/version",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planPhasedRelease(t){return e.send({op:"PlanPhasedRelease",method:"POST",path:"/stores/apps/"+c("PlanPhasedRelease","app_id",t.path.app_id)+"/version/phased-release",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planReleaseVersion(t){return e.send({op:"PlanReleaseVersion",method:"POST",path:"/stores/apps/"+c("PlanReleaseVersion","app_id",t.path.app_id)+"/version/release",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planSubmitReview(t){return e.send({op:"PlanSubmitReview",method:"POST",path:"/stores/apps/"+c("PlanSubmitReview","app_id",t.path.app_id)+"/version/submit",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async planWithdrawReview(t){return e.send({op:"PlanWithdrawReview",method:"POST",path:"/stores/apps/"+c("PlanWithdrawReview","app_id",t.path.app_id)+"/version/withdraw",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppVitals(t){return e.send({op:"GetAppVitals",method:"GET",path:"/stores/apps/"+c("GetAppVitals","app_id",t.path.app_id)+"/vitals",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getAppWebhook(t){return e.send({op:"GetAppWebhook",method:"GET",path:"/stores/apps/"+c("GetAppWebhook","app_id",t.path.app_id)+"/webhook",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async makeAppWebhook(t){return e.send({op:"MakeAppWebhook",method:"POST",path:"/stores/apps/"+c("MakeAppWebhook","app_id",t.path.app_id)+"/webhook",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async pingAppWebhook(t){return e.send({op:"PingAppWebhook",method:"POST",path:"/stores/apps/"+c("PingAppWebhook","app_id",t.path.app_id)+"/webhook/ping",auth:[["SecretKeyAuth"]],answers:{202:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async downloadSignedBundle(t){return e.send({op:"DownloadSignedBundle",method:"GET",path:"/stores/bundles",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getConnectPage(t){return e.send({op:"GetConnectPage",method:"GET",path:"/stores/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/stores/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async disconnectGoogle(t){return e.send({op:"DisconnectGoogle",method:"DELETE",path:"/stores/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkGoogleAccount(t){return e.send({op:"CheckGoogleAccount",method:"POST",path:"/stores/google/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async deleteGroup(t){return e.send({op:"DeleteGroup",method:"DELETE",path:"/stores/groups/"+c("DeleteGroup","group_id",t.path.group_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async renameGroup(t){return e.send({op:"RenameGroup",method:"PATCH",path:"/stores/groups/"+c("RenameGroup","group_id",t.path.group_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async addGroupBuild(t){return e.send({op:"AddGroupBuild",method:"POST",path:"/stores/groups/"+c("AddGroupBuild","group_id",t.path.group_id)+"/builds",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listTesters(t){return e.send({op:"ListTesters",method:"GET",path:"/stores/groups/"+c("ListTesters","group_id",t.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setTesters(t){return e.send({op:"SetTesters",method:"PUT",path:"/stores/groups/"+c("SetTesters","group_id",t.path.group_id)+"/testers",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listPackages(t){return e.send({op:"ListPackages",method:"GET",path:"/stores/packages",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getPackage(t){return e.send({op:"GetPackage",method:"GET",path:"/stores/packages/"+c("GetPackage","package_id",t.path.package_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async uploadArtifact(t){return e.send({op:"UploadArtifact",method:"PUT",path:"/stores/packages/"+c("UploadArtifact","package_id",t.path.package_id)+"/artifact",auth:[],answers:{200:"json"},headers:t.headers,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async planBetaReview(t){return e.send({op:"PlanBetaReview",method:"POST",path:"/stores/packages/"+c("PlanBetaReview","package_id",t.path.package_id)+"/beta-review",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async listDeliveries(t){return e.send({op:"ListDeliveries",method:"GET",path:"/stores/packages/"+c("ListDeliveries","package_id",t.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deliver(t){return e.send({op:"Deliver",method:"POST",path:"/stores/packages/"+c("Deliver","package_id",t.path.package_id)+"/deliveries",auth:[["SecretKeyAuth"]],answers:{200:"json",202:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getSignedBundleLink(t){return e.send({op:"GetSignedBundleLink",method:"POST",path:"/stores/packages/"+c("GetSignedBundleLink","package_id",t.path.package_id)+"/deliveries/"+c("GetSignedBundleLink","channel",t.path.channel)+"/bundle-link",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planExpire(t){return e.send({op:"PlanExpire",method:"POST",path:"/stores/packages/"+c("PlanExpire","package_id",t.path.package_id)+"/expire",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async planExportCompliance(t){return e.send({op:"PlanExportCompliance",method:"POST",path:"/stores/packages/"+c("PlanExportCompliance","package_id",t.path.package_id)+"/export-compliance",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async setWhatToTest(t){return e.send({op:"SetWhatToTest",method:"PUT",path:"/stores/packages/"+c("SetWhatToTest","package_id",t.path.package_id)+"/what-to-test",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async takeAppleWebhook(t){return e.send({op:"TakeAppleWebhook",method:"POST",path:"/stores/webhooks/apple/"+c("TakeAppleWebhook","app_id",t.path.app_id),auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAppleSession(t){return e.send({op:"GetAppleSession",method:"GET",path:"/stores/apple/session",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectAppleSession(t){return e.send({op:"DisconnectAppleSession",method:"DELETE",path:"/stores/apple/session",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkAppleSession(t){return e.send({op:"CheckAppleSession",method:"POST",path:"/stores/apple/session/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createAppleIdGrant(t){return e.send({op:"CreateAppleIDGrant",method:"POST",path:"/stores/apple/session/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getAppleIdPage(t){return e.send({op:"GetAppleIDPage",method:"GET",path:"/stores/connect/apple-id",auth:[],answers:{200:"raw"},signal:t?.signal})},async signInAppleId(t){return e.send({op:"SignInAppleID",method:"POST",path:"/stores/connect/apple-id",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async submitAppleIdCode(t){return e.send({op:"SubmitAppleIDCode",method:"POST",path:"/stores/connect/apple-id/code",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async chooseAppleIdTeam(t){return e.send({op:"ChooseAppleIDTeam",method:"POST",path:"/stores/connect/apple-id/team",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getAppReview(t){return e.send({op:"GetAppReview",method:"GET",path:"/stores/apps/"+c("GetAppReview","app_id",t.path.app_id)+"/review",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async getReviewAttachment(t){return e.send({op:"GetReviewAttachment",method:"GET",path:"/stores/apps/"+c("GetReviewAttachment","app_id",t.path.app_id)+"/review/threads/"+c("GetReviewAttachment","thread_id",t.path.thread_id)+"/attachments/"+c("GetReviewAttachment","attachment_id",t.path.attachment_id),auth:[["SecretKeyAuth"]],answers:{200:"raw"},signal:t.signal})},async setReviewDraft(t){return e.send({op:"SetReviewDraft",method:"PUT",path:"/stores/apps/"+c("SetReviewDraft","app_id",t.path.app_id)+"/review/threads/"+c("SetReviewDraft","thread_id",t.path.thread_id)+"/draft",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async sendReviewDraft(t){return e.send({op:"SendReviewDraft",method:"POST",path:"/stores/apps/"+c("SendReviewDraft","app_id",t.path.app_id)+"/review/threads/"+c("SendReviewDraft","thread_id",t.path.thread_id)+"/draft/send",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async getAppPrivacy(t){return e.send({op:"GetAppPrivacy",method:"GET",path:"/stores/apps/"+c("GetAppPrivacy","app_id",t.path.app_id)+"/privacy",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setAppPrivacy(t){return e.send({op:"SetAppPrivacy",method:"PUT",path:"/stores/apps/"+c("SetAppPrivacy","app_id",t.path.app_id)+"/privacy",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async makeAppRecord(t){return e.send({op:"MakeAppRecord",method:"POST",path:"/stores/apps/"+c("MakeAppRecord","app_id",t.path.app_id)+"/record",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async removeAppRecord(t){return e.send({op:"RemoveAppRecord",method:"DELETE",path:"/stores/apps/"+c("RemoveAppRecord","app_id",t.path.app_id)+"/record",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listMadeAppleKeys(t){return e.send({op:"ListMadeAppleKeys",method:"GET",path:"/stores/apple/keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async makeAppleKey(t){return e.send({op:"MakeAppleKey",method:"POST",path:"/stores/apple/keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeMadeAppleKey(t){return e.send({op:"RevokeMadeAppleKey",method:"DELETE",path:"/stores/apple/keys/"+c("RevokeMadeAppleKey","key_id",t.path.key_id),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async shareAppleSession(t){return e.send({op:"ShareAppleSession",method:"PUT",path:"/stores/apple/session/shares/"+c("ShareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async unshareAppleSession(t){return e.send({op:"UnshareAppleSession",method:"DELETE",path:"/stores/apple/session/shares/"+c("UnshareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async getInstallPage(t){return e.send({op:"GetInstallPage",method:"GET",path:"/stores/install",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getInstallStatus(t){return e.send({op:"GetInstallStatus",method:"GET",path:"/stores/install/status",auth:[],answers:{200:"json"},query:t.query,signal:t.signal})},async retryInstall(t){return e.send({op:"RetryInstall",method:"POST",path:"/stores/install/retry",auth:[],answers:{204:"empty"},query:t.query,signal:t.signal})},async getInstallEnrollment(t){return e.send({op:"GetInstallEnrollment",method:"GET",path:"/stores/install/enroll",auth:[],answers:{200:"raw",303:"redirect"},query:t.query,signal:t.signal})},async registerInstallDevice(t){return e.send({op:"RegisterInstallDevice",method:"POST",path:"/stores/install/device",auth:[],answers:{200:"raw",301:"redirect"},query:t.query,body:{kind:"raw",contentType:t.contentType??"application/pkcs7-signature",value:t.body},signal:t.signal})},async getInstallManifest(t){return e.send({op:"GetInstallManifest",method:"GET",path:"/stores/install/manifest",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async getInstallBuild(t){return e.send({op:"GetInstallBuild",method:"GET",path:"/stores/install/app",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async headInstallBuild(t){return e.send({op:"HeadInstallBuild",method:"HEAD",path:"/stores/install/app",auth:[],answers:{200:"empty"},query:t.query,signal:t.signal})},async getInstallIcon(t){return e.send({op:"GetInstallIcon",method:"GET",path:"/stores/install/icon",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async listInvitations(t){return e.send({op:"ListInvitations",method:"GET",path:"/stores/packages/"+c("ListInvitations","package_id",t.path.package_id)+"/invitations",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async invitePerson(t){return e.send({op:"InvitePerson",method:"POST",path:"/stores/packages/"+c("InvitePerson","package_id",t.path.package_id)+"/invitations",auth:[["SecretKeyAuth"]],answers:{200:"json",201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async revokeInvitation(t){return e.send({op:"RevokeInvitation",method:"DELETE",path:"/stores/invitations/"+c("RevokeInvitation","invitation_id",t.path.invitation_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async listDevices(t){return e.send({op:"ListDevices",method:"GET",path:"/stores/devices",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})}}}var rr={};wt(rr,{client:()=>p$});function p$(e){return{async listWorkspaces(t){return e.send({op:"ListWorkspaces",method:"GET",path:"/workspaces",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createWorkspace(t){return e.send({op:"CreateWorkspace",method:"POST",path:"/workspaces",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async testWorkspaceByos(t){return e.send({op:"TestWorkspaceBYOS",method:"POST",path:"/workspaces/byos/test",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listProjectS3Keys(t){return e.send({op:"ListProjectS3Keys",method:"GET",path:"/workspaces/s3-keys",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createProjectS3Key(t){return e.send({op:"CreateProjectS3Key",method:"POST",path:"/workspaces/s3-keys",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t?.body},signal:t?.signal})},async deleteProjectS3Key(t){return e.send({op:"DeleteProjectS3Key",method:"DELETE",path:"/workspaces/s3-keys/"+c("DeleteProjectS3Key","token_id",t.path.token_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async getWorkspace(t){return e.send({op:"GetWorkspace",method:"GET",path:"/workspaces/"+c("GetWorkspace","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async deleteWorkspace(t){return e.send({op:"DeleteWorkspace",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspace","id",t.path.id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async updateWorkspaceStorage(t){return e.send({op:"UpdateWorkspaceStorage",method:"PUT",path:"/workspaces/"+c("UpdateWorkspaceStorage","id",t.path.id)+"/storage",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getWorkspaceFiles(t){return e.send({op:"GetWorkspaceFiles",method:"GET",path:"/workspaces/"+c("GetWorkspaceFiles","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async putWorkspaceFile(t){return e.send({op:"PutWorkspaceFile",method:"PUT",path:"/workspaces/"+c("PutWorkspaceFile","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,body:{kind:"raw",contentType:t.contentType??"application/octet-stream",value:t.body},signal:t.signal})},async deleteWorkspaceFile(t){return e.send({op:"DeleteWorkspaceFile",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspaceFile","id",t.path.id)+"/files",auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async listWorkspaceTokens(t){return e.send({op:"ListWorkspaceTokens",method:"GET",path:"/workspaces/"+c("ListWorkspaceTokens","id",t.path.id)+"/tokens",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async createWorkspaceToken(t){return e.send({op:"CreateWorkspaceToken",method:"POST",path:"/workspaces/"+c("CreateWorkspaceToken","id",t.path.id)+"/tokens",auth:[["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteWorkspaceToken(t){return e.send({op:"DeleteWorkspaceToken",method:"DELETE",path:"/workspaces/"+c("DeleteWorkspaceToken","id",t.path.id)+"/tokens/"+c("DeleteWorkspaceToken","token_id",t.path.token_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listWorkspaceLocks(t){return e.send({op:"ListWorkspaceLocks",method:"GET",path:"/workspaces/"+c("ListWorkspaceLocks","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async acquireWorkspaceLock(t){return e.send({op:"AcquireWorkspaceLock",method:"POST",path:"/workspaces/"+c("AcquireWorkspaceLock","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async releaseWorkspaceLock(t){return e.send({op:"ReleaseWorkspaceLock",method:"DELETE",path:"/workspaces/"+c("ReleaseWorkspaceLock","id",t.path.id)+"/locks",auth:[["SecretKeyAuth"]],answers:{204:"empty"},query:t.query,signal:t.signal})},async getSyncHead(t){return e.send({op:"GetSyncHead",method:"GET",path:"/workspaces/sync/head",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getSyncChanges(t){return e.send({op:"GetSyncChanges",method:"GET",path:"/workspaces/sync/changes",auth:[],answers:{200:"json"},query:t?.query,signal:t?.signal})},async publishSyncChanges(t){return e.send({op:"PublishSyncChanges",method:"POST",path:"/workspaces/sync/publish",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestSyncUploadGrants(t){return e.send({op:"RequestSyncUploadGrants",method:"POST",path:"/workspaces/sync/blobs/upload-grants",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async requestSyncDownloadGrants(t){return e.send({op:"RequestSyncDownloadGrants",method:"POST",path:"/workspaces/sync/blobs/download-grants",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async downloadSignedSyncBlob(t){return e.send({op:"DownloadSignedSyncBlob",method:"GET",path:"/workspaces/sync/blobs/"+c("DownloadSignedSyncBlob","digest",t.path.digest),auth:[],answers:{200:"empty"},signal:t.signal})},async uploadSignedSyncBlob(t){return e.send({op:"UploadSignedSyncBlob",method:"PUT",path:"/workspaces/sync/blobs/"+c("UploadSignedSyncBlob","digest",t.path.digest),auth:[],answers:{200:"empty"},signal:t.signal})},async streamSyncEvents(t){return e.send({op:"StreamSyncEvents",method:"GET",path:"/workspaces/sync/events",auth:[],answers:{200:"raw"},signal:t?.signal})}}}var lr={attempts:3,maxWaitSeconds:30},d$=new Set([429,502,503,504]);function bp(e,t=lr){let n=t.sleep??m$;return{async send(s){let a=c$(s),o=a.body,i=!o||o.kind!=="raw"||xa(o.value),r=(a.method==="GET"||a.method==="HEAD"||a.idempotent===!0)&&i;for(let l=1;;l++)try{return await e.send(a)}catch(p){if(!r||l>=t.attempts||!(p instanceof G)||a.signal?.aborted)throw p;let d=u$(p,l,t.maxWaitSeconds);if(d===void 0)throw p;await n(d*1e3,a.signal)}}}}function c$(e){return e.idempotent?Object.entries(e.headers??{}).some(([n,s])=>n.toLowerCase()==="idempotency-key"&&s!==void 0&&s!==null&&s!=="")?e:{...e,headers:{...e.headers,"Idempotency-Key":g$()}}:e}function u$(e,t,n){return d$.has(e.status)||e.code==="network_error"?e.retryAfter!==void 0?e.retryAfter<=n?e.retryAfter:void 0:Math.min(.5*2**(t-1),n)*(.8+Math.random()*.4):void 0}function m$(e,t){return new Promise((n,s)=>{if(t?.aborted)return s(t.reason);let a=()=>{clearTimeout(o),s(t?.reason)},o=setTimeout(()=>{t?.removeEventListener("abort",a),n()},e);t?.addEventListener("abort",a,{once:!0})})}function g$(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}import{hostname as h$}from"node:os";var y$=new Set(["apikey","authorization",hp]);function f$(e){let t={accept:"application/json"};for(let[n,s]of Object.entries(e??{}))s!=null&&!y$.has(n.toLowerCase())&&(t[n.toLowerCase()]=String(s));return t}function b$(e,t,n){let s=null;try{s=n.startsWith("/")?new URL(n,e):null}catch{s=null}if(!s||s.origin!==new URL(e).origin)throw new G({op:t,status:0,code:"invalid_path",message:`${t}: a module's path stays at its environment's address`});return s.href}async function w$(e){let t=e.status===204||e.status===304?"":await e.text();if(t!=="")try{return JSON.parse(t)}catch{return t}}function v$(e,t,n){let s=n??{},a=Number(t.headers.get("retry-after")??"");return new G({op:e,status:t.status,code:typeof s.error=="string"?s.error:`http_${t.status}`,message:pr(n,t.status),requestId:typeof s.request_id=="string"?s.request_id:t.headers.get("x-request-id")??void 0,retryAfter:Number.isFinite(a)&&a>0?a:typeof s.retry_after=="number"?s.retry_after:void 0,body:n})}var Hs=class{bytes;contentType;constructor(t,n){this.bytes=t,this.contentType=n}};function k$(e){return e instanceof Hs?{headers:{"content-type":e.contentType,"content-length":String(e.bytes.size)},body:e.bytes}:e===void 0?{headers:{}}:{headers:{"content-type":"application/json"},body:JSON.stringify(e)}}async function et(e,t,n,s,a,o){if(e.callPlatform&&t===cp)return e.callPlatform(e,n,s,a,o);let i=`${n} ${s}`,r=k$(a),l=await e.module(b$(Qt(e.cloud,t),i,s),{method:n,headers:{...f$(o),...r.headers},body:r.body}),p=await w$(l);if(l.status>=200&&l.status<300)return{status:l.status,body:Fi(p),etag:l.headers.get("etag")??void 0};throw v$(i,l,p)}var _$=10080*60*1e3;async function wp(e,t,n=!1){let s=await e.state.personalKey(t);if(!n&&s&&Date.parse(s.expires_at)-e.io.now()>_$)return s;let a=await e.post(`/environments/${Q("the environment's ref",t)}/personal-key`,{host:h$().slice(0,100)||"computer"});return await e.state.keepPersonalKey(t,a),a}function pr(e,t){let n=e??{},s=typeof n.error_description=="string"?n.error_description:`the module answered ${t}`,a=Array.isArray(n.field_errors)?n.field_errors.flatMap(o=>{let{pointer:i,message:r}=o??{};return typeof r=="string"?[`${typeof i=="string"&&i!==""?`${i}: `:""}${r}`]:[]}):[];return a.length>0?`${s}: ${a.join("; ")}`:s}import{relative as S$}from"node:path";async function Ia(e,t){let n=await e.run("git",["rev-parse","--show-toplevel"],{cwd:t});if(n.code!==0)return null;let s=n.stdout.trim(),a=await e.run("git",["remote","get-url","origin"],{cwd:t}),o=await e.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}),i=o.code===0?o.stdout.trim():"";return{root:s,repository:a.code===0?$$(a.stdout.trim()):void 0,branch:i!==""&&i!=="HEAD"?i:void 0,path:S$(s,t).split("\\").join("/")}}function $$(e){let t=/^(?:https?:\/\/(?:[^@/]+@)?github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:void 0}async function Na(e,t){let n=await rt(e);return new Map(n.filter(s=>s.project_id===t.project_id).map(s=>[s.ref,s.slug]))}function as(e,t){return t?e.get(t.ref)??t.ref:""}var Mt="main";async function rt(e){let[t,n]=await Promise.all([e.get("/environments"),e.get("/orgs")]),s=new Map(n.organizations.map(a=>[a.id,a.name]));return t.environments.map(a=>({...a,org_name:s.get(a.organization_id)??a.organization_id}))}function Ge(e){return{org_id:e.organization_id,org_name:e.org_name,project_id:e.project_id,project_name:e.project_name,env_ref:e.ref,env_slug:e.slug,env_name:e.name}}function ee(e){return`${e.org_name} \u203A ${e.project_name} \u203A ${e.env_name}${e.env_name!==e.env_slug?` (${e.env_slug})`:""}`}function wn(e){return(e.env.PALBASE_TOKEN??"").startsWith("pbe_")}async function Ko(e){let[t]=await rt(e.studio);if(!t)throw new b("token_refused","Studio names no environment for PALBASE_TOKEN",{hint:"mint another: palbase env:tokens:create"});let n=Ge(t),s=i=>new b("token_environment",`PALBASE_TOKEN is ${ee(n)}'s environment token: it acts there alone, not in ${i}`,{hint:"mint one there: palbase env:tokens:create -P <project> -E <env>"}),{project:a,env:o}=e.global;if(a!==void 0&&t.project_id!==a&&!_p(t.project_name,a.slice(a.indexOf("/")+1)))throw s(a);if(o!==void 0&&o!==t.slug&&o!==t.ref)throw s(o);if(a===void 0&&o===void 0){let i=await e.state.targetFor(e.io.cwd);if(i&&i.target.env_ref!==t.ref)throw s(`${ee(i.target)}, chosen for ${i.dir}`)}return t}async function f(e){if(wn(e.io))return Ge(await Ko(e));let{project:t,env:n}=e.global;if(t!==void 0||n!==void 0){let i=await rt(e.studio),r;if(t!==void 0)r=As(i,t);else{let l=await e.state.targetFor(e.io.cwd);if(!l)throw kp("-E names an environment of the project chosen here, and none is chosen: add -P <project>");r=i.filter(p=>p.project_id===l.target.project_id)}if(n!==void 0){let l=r.find(p=>p.slug===n||p.ref===n);if(!l)throw new b("no_such_environment",`the project has no environment ${JSON.stringify(n)}`,{hint:`its environments: ${r.map(p=>p.slug).join(", ")}`});return Ge(l)}return r.length===1?Ge(r[0]):Ge(await vp(e,r,"Which environment?"))}let s=await e.state.targetFor(e.io.cwd);if(s)return s.target;if(!e.interactive)throw kp("no environment is chosen for this directory");let a=await rt(e.studio);if(a.length===0)throw new b("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let o=Ge(await vp(e,a,"Which environment?"));return e.out.note(`Acting on ${ee(o)}. palbase use remembers it for this directory.`),o}async function Vs(e){return(await Ss(e)).t}async function Ss(e){if(wn(e.io))return{t:Ge(await Ko(e)),by:"token"};let t=await e.state.targetFor(e.io.cwd);if(e.global.project===void 0&&e.global.env===void 0&&t)return{t:t.target,by:"here"};let n=await rm(e,t?.target);if(e.global.env!==void 0)return{t:Ge(Sp(n,e.global.env)),by:"env"};let s=n.find(a=>a.ref===t?.target.env_ref);return s?{t:Ge(s),by:"here"}:{t:Ge(n.find(a=>a.slug===Mt)??n[0]),by:"fallback"}}function dr(e,t){return e.by==="fallback"?t:`${t}${t.includes("?")?"&":"?"}environment=${encodeURIComponent(e.t.env_ref)}`}var im=1e3;async function $s(e){let t=[],n=new Set,s;for(;;){let a=await e(s);if(t.push(...a.items),!a.next)return t;if(n.has(a.next)||n.size>=im)throw new b("list_unending",`the platform's list did not end: ${n.has(a.next)?`it gave the cursor ${JSON.stringify(a.next)} twice`:`it ran past ${im} pages`}`);n.add(a.next),s=a.next}}async function Xs(e,t,n,s,a){if(t.by==="env"||t.by==="token"||t.by==="here"&&(n.environment?.ref??t.t.env_ref)===t.t.env_ref)return;let o=(await s()).filter(r=>r.name===n.name);if(o.length<2)return;let i=await Na(e.studio,t.t);throw new b("ambiguous_name",`${a} is held by more than one of ${t.t.project_name}'s environments: ${o.map(r=>as(i,r.environment)).join(", ")}`,{hint:"name the environment: -E <env>"})}async function Ys(e){if(wn(e.io))return Ge(await Ko(e));let t=await e.state.targetFor(e.io.cwd);if(e.global.project===void 0&&e.global.env===void 0&&t)return t.target;let n=await rm(e,t?.target);if(e.global.env!==void 0)return Ge(Sp(n,e.global.env));let s=n.find(o=>o.ref===t?.target.env_ref);if(s)return Ge(s);let a=n[0].project_name;if(!e.interactive)throw h(`which environment of ${a} is it bound to? name it with -E <env>`,`its environments: ${n.map(o=>o.slug).join(", ")}`);return Ge(await vp(e,n,le(`Which environment of ${a} does it belong to?`)))}async function Zs(e,t,n,s){if(!n||n.ref===t.env_ref)return t;let a=(await rt(e.studio)).find(o=>o.ref===n.ref);if(e.global.env!==void 0){let o=a?.slug??n.name??n.ref;throw new b("bound_elsewhere",`${s} is bound to ${t.project_name}'s environment ${o}, not ${t.env_slug}`,{hint:`leave -E out: the command acts where it is bound${a?` (or name it, -E ${a.slug})`:""}`})}if(!a)throw new b("environment_out_of_reach",`${s} is bound to ${t.project_name}'s environment ${n.name||n.ref}, which your account does not reach`,{hint:"an admin of the project's organization adds you to that environment"});return Ge(a)}function cr(e,t,n){return e.global.env===void 0?n:`${n}${n.includes("?")?"&":"?"}environment=${encodeURIComponent(t.env_ref)}`}async function Uo(e,t,n){let s=(await rt(e.studio)).filter(a=>a.project_id===t.project_id);return Sp(s,n)}function Ce(e){return`The ${e} is the project's: the command acts in the environment it is bound to. -E picks it where two environments hold its name, and is refused when it names another.`}var Qs="It is bound to the environment -E names, or to the one chosen for this directory: a person at the terminal is asked which, anyone else names it with -E.";async function rm(e,t){let n=await rt(e.studio);if(e.global.project!==void 0)return As(n,e.global.project);if(t){let a=n.filter(o=>o.project_id===t.project_id);if(a.length===0)throw new b("no_such_project",`the project chosen here (${t.project_name}) is not among yours any more`,{hint:"palbase use another"});return a}if(!e.interactive)throw new b("no_target","which project? none is chosen for this directory",{hint:"pass -P <project>, or choose one here with palbase use"});if(n.length===0)throw new b("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let s=[...new Map(n.map(a=>[a.project_id,a])).values()];for(s.forEach((a,o)=>e.out.note(` ${String(o+1).padStart(2)}) ${a.org_name} \u203A ${a.project_name}`));;){let a=Number((await e.io.prompt(`Which project? [1-${s.length}] `)).trim());if(Number.isInteger(a)&&a>=1&&a<=s.length){let o=s[a-1];return e.out.note(`Acting on ${o.org_name} \u203A ${o.project_name}. palbase use remembers one for this directory.`),n.filter(i=>i.project_id===o.project_id)}e.out.note(`answer with a number from 1 to ${s.length}`)}}function Sp(e,t){let n=e.find(s=>s.slug===t||s.ref===t);if(!n)throw new b("no_such_environment",`the project has no environment ${JSON.stringify(t)}`,{hint:`its environments: ${e.map(s=>s.slug).join(", ")}`});return n}function As(e,t){let n=e.filter(l=>l.project_id===t);if(n.length>0)return n;let s=t.indexOf("/"),[a,o]=s>=0?[t.slice(0,s),t.slice(s+1)]:[void 0,t],i=e.filter(l=>_p(l.project_name,o)&&(a===void 0||_p(l.org_name,a)||l.organization_id===a)),r=new Set(i.map(l=>l.project_id));if(r.size===0)throw new b("no_such_project",`no project ${JSON.stringify(t)} among yours`,{hint:"palbase projects:list shows them"});if(r.size>1){let l=[...new Set(i.map(p=>`${p.org_name}/${p.project_name}`))].join(", ");throw new b("ambiguous_project",`${JSON.stringify(t)} is a project in more than one organization: ${l}`,{hint:"name it as org/project"})}return i}async function k(e,t,n,s){e.out.note(`${ee(t)}: ${n}${e.global.yes?" (confirmed with -y)":""}`);let a=t.env_slug===Mt;if(!a&&s===void 0||e.global.yes)return;if(!e.interactive){let i=wn(e.io)?"confirm with -y: with PALBASE_TOKEN, -y is the go-ahead (the CLI asks no one else, and a person's yes elsewhere is not one)":"confirm with -y";throw new b("confirmation_needed",a?`${t.project_name} \u203A ${t.env_name} is the project's production environment`:s,{hint:i})}let o=(await e.io.prompt(le(`${a?`This is ${t.project_name}'s production environment`:s}. Go ahead? [y/N] `))).trim().toLowerCase();if(o!=="y"&&o!=="yes")throw new b("cancelled","nothing was changed")}async function vp(e,t,n){if(!e.interactive)throw kp(`${n.replace(/\?$/,"")}: ${t.map(s=>`${s.project_name}/${s.slug}`).join(", ")}`);for(t.forEach((s,a)=>e.out.note(` ${String(a+1).padStart(2)}) ${ee(Ge(s))}`));;){let s=(await e.io.prompt(`${n} [1-${t.length}] `)).trim(),a=Number(s);if(Number.isInteger(a)&&a>=1&&a<=t.length)return t[a-1];e.out.note(`answer with a number from 1 to ${t.length}`)}}function kp(e){return new b("no_target",e,{hint:"choose one here with palbase use, or pass -P <project> -E <env>"})}function _p(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})===0}import{randomUUID as A$}from"node:crypto";import{readFile as R$}from"node:fs/promises";import{resolve as P$}from"node:path";var j$=6,$p=0,lm=[];async function T$(e){$p<j$?$p++:await new Promise(t=>lm.push(t));try{return await e()}finally{let t=lm.shift();t?t():$p--}}async function Rt(e,t,n,s,a,o){return T$(()=>et(e.studio,t.env_ref,n,s,a,o))}async function g(e,t,n,s,a,o){return(await Rt(e,t,n,s,a,o)).body}async function Pt(e,t,n){let s=await Rt(e,t,"GET",n);return{body:s.body,etag:s.etag}}function vt(e){return e?{"if-match":e}:void 0}function D(){return{"idempotency-key":A$()}}function R(e){return encodeURIComponent(e)}function Rs(e){return e.map(t=>{let n=t.indexOf("=");if(n<=0)throw h(`a setting is key=value, not ${JSON.stringify(t)}`);let s=t.slice(0,n).split(".");if(s.some(a=>a===""||a==="__proto__"||a==="constructor"||a==="prototype"))throw h(`${JSON.stringify(t.slice(0,n))} is not a key`);return{path:s,value:qn(t.slice(n+1))}})}function qn(e){try{return JSON.parse(e)}catch{return e}}function Ps(e,t){let n=structuredClone(e);for(let{path:s,value:a}of t){let o=n;for(let i of s.slice(0,-1)){let r=o[i];(typeof r!="object"||r===null)&&(o[i]={}),o=o[i]}o[s[s.length-1]]=a}return n}function os(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(n=>!Dt(e[n],t[n])).sort()}function pm(e){return JSON.stringify(e,(t,n)=>n!==null&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).sort(([s],[a])=>s<a?-1:s>a?1:0)):n)}function Dt(e,t){return pm(e)===pm(t)}function kt(e){return e===void 0?"(not set)":typeof e=="string"&&e!==""?e:JSON.stringify(e)}function Ma(e,t){let n=Object.keys(t).sort(),s=Math.max(0,...n.map(a=>a.length));for(let a of n)e.out.line(`${a.padEnd(s)} ${kt(t[a])}`)}function zt(e,t,n){e.out.result({settings:n,changed:[]},()=>e.out.line(`Nothing to change: ${t} already ${t.endsWith("s")?"are":"is"} so.`))}async function ze(e,t,n){let s;if(t!==void 0&&t!=="-")try{s=await R$(P$(e.io.cwd,t),"utf8")}catch(a){throw new b("unreadable_file",`${t} could not be read: ${a instanceof Error?a.message:String(a)}`)}else e.io.interactive&&e.out.note(`Reading ${n} from stdin; end it with Ctrl-D.`),s=await e.io.readStdin();if(s.trim()==="")throw h(`no ${n} was given`,t===void 0?"pass --file <path>, or pipe it in":void 0);return s}function Ne(e,t){try{return JSON.parse(e)}catch(n){throw h(`${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}}async function lt(e,t){e.io.interactive&&e.out.note(`Paste ${t}, then Ctrl-D (it is read from stdin, never from the command line):`);let n=(await e.io.readStdin()).trim();if(n==="")throw h(`no ${t} was piped in`,"pipe it in: palbase \u2026 < file");return n}function Da(e){if(e.flags.enable===!0&&e.flags.disable===!0)throw h("--enable and --disable are one or the other");if(e.flags.enable===!0)return!0;if(e.flags.disable===!0)return!1}function Gn(e,t){if(e!==void 0){if(e==="yes"||e==="true")return!0;if(e==="no"||e==="false")return!1;throw h(`--${t} is yes or no`)}}function Me(e){return e===void 0?void 0:(Array.isArray(e)?e:[e]).flatMap(n=>String(n).split(",")).map(n=>n.trim()).filter(n=>n!=="")}function we(e,t){if(e===void 0)return;let n=Number(e);if(!Number.isInteger(n)||n<0)throw h(`--${t} is a whole number`);return n}var Wo={enable:{type:"boolean",description:"turn it on"},disable:{type:"boolean",description:"turn it off"}};async function Ee(e,t,n){try{await n(),e.done(t)}catch(s){if(!(s instanceof G))throw s;e.left(`${t}: refused \u2014 ${s.message}`)}}function Ze(e,t){return e.filter(n=>n.key.startsWith(t)).map(n=>({...n,name:n.key.slice(t.length)}))}function Ap(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>!(t==null||t===""||Array.isArray(t)&&t.length===0)))}import{writeFile as E$}from"node:fs/promises";var C$=/^[A-Z][A-Z0-9_]{0,127}$/,za={dev:{type:"boolean",description:"the development set (what a backend on a developer's computer reads, and a machine started with it), not production \u2014 whatever the environment is named"}};function qa(e){return e.flags.dev===!0?"development":"production"}function Fo(e){let t=e.args[0];if(!C$.test(t))throw h(`${JSON.stringify(t)} is not a secret's name: capital letters, digits and _, a letter first`);return t}async function Rp(e,t,n){try{let s=await $s(async a=>{let o=await g(e,t,"GET",`/machines?limit=100&environment=${encodeURIComponent(t.env_ref)}${a?`&cursor=${encodeURIComponent(a)}`:""}`);return{items:o.machines,next:o.next_cursor}});return{using:s.filter(a=>a.secrets===n).map(a=>a.name).sort(),others:s.filter(a=>a.secrets!==n)}}catch(s){return{unread:s instanceof Error?s.message:String(s)}}}function Pp(e,t,n,s){if("unread"in s){e.out.note(`which machines start with the ${n} set could not be read (${s.unread}): palbase machines:list -E ${t.env_slug} says each one's`);return}if(s.using.length>0){let r=s.using.join(", ");e.out.line(`${r} ${s.using.length===1?"starts":"start"} with the ${n} set: rolling out with the new value \u2014 palbase machines:list -E ${t.env_slug} shows it until every copy runs it.`);return}let a=n==="production"?"development":"production",o=n==="development"?" Only a backend run on a computer (palbase run, env:pull) reads it.":"";if(s.others.length===0){n==="production"&&e.out.note(`${ee(t)} has no machine yet: one started with the ${n} set reads it.`);return}let i=s.others.map(r=>`${r.name} starts with ${r.secrets?`the ${r.secrets} set`:"no set"}`).join(", ");e.out.warn(`no machine of ${ee(t)} starts with the ${n} set (${i}): this value reaches none of them.${o} palbase machines:update <name> --secrets ${n} starts a machine with it; ${n==="production"?"--dev writes":"leaving --dev out writes"} the ${a} set.`)}async function ea(e,t,n){let s=[],a;do{let o=await g(e,t,"GET",`/secrets/${n}?limit=1000${a?`&cursor=${encodeURIComponent(a)}`:""}`);s.push(...o.secrets),a=o.next_cursor}while(a);return s}var O$={name:"secrets:list",summary:"the environment's secrets by name, with their version \u2014 never their values",usage:"[--dev]",flags:za,scope:"environment",async run(e){let t=await f(e),n=qa(e),s=await ea(e,t,n);e.out.result({set:n,secrets:s},()=>{s.length===0&&e.out.line(`No ${n} secrets.`);for(let a of s)e.out.line(`${a.name} v${a.version} ${a.updated_at}`)})}},x$={name:"secrets:set",summary:"set a secret: its value is read from stdin, never from the command line",usage:"<NAME> [--dev] < value",details:["An environment has two sets, production and development, whatever the environment is named: Development's machines may start with its production set. A machine starts with the set it names (machines:update --secrets), and a change of that set rolls it out with the new value; a backend run with palbase run or env:pull reads development.","It says which of the environment's machines start with the set, and warns when none does."],args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=qa(e),a=await lt(e,`the value of ${n}`);await k(e,t,`set the ${s} secret ${n}`);let o=await g(e,t,"PUT",`/secrets/${s}/${n}`,{value:a}),i=await Rp(e,t,s);e.out.result({set:s,name:n,version:o.version,environment:t.env_slug,machines:"using"in i?i.using:null},()=>{e.out.line(`Set ${n} v${o.version} in the ${s} set of ${ee(t)}.`),Pp(e,t,s,i)})}},L$={name:"secrets:unset",summary:"take a secret away",usage:"<NAME> [--dev]",args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=qa(e);await k(e,t,`take away the ${s} secret ${n}`),await g(e,t,"DELETE",`/secrets/${s}/${n}`);let a=await Rp(e,t,s);e.out.result({set:s,name:n,deleted:!0,environment:t.env_slug,machines:"using"in a?a.using:null},()=>{e.out.line(`Took ${n} away from the ${s} set of ${ee(t)}.`),Pp(e,t,s,a)})}},I$={name:"secrets:get",summary:"print one development secret's value (an admin's): a production secret's is never read back",usage:"<NAME> --dev",details:["A production secret's value is never read back, by anyone: only the machines that start with it are given it, and it is changed by setting it again (secrets:set). The development set is what a backend on your computer reads (palbase run, env:pull): secrets:get NAME --dev prints one."],args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=await g(e,t,"GET",`/secrets/${qa(e)}/${n}`);e.out.result({name:n,version:s.version,value:s.value},()=>e.out.line(s.value))}},N$={name:"secrets:versions",summary:"a secret's versions, newest first \u2014 never their values",usage:"<NAME> [--dev]",args:{min:1,max:1},flags:za,scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=await g(e,t,"GET",`/secrets/${qa(e)}/${n}/versions`);e.out.result(s,()=>{for(let a of s.versions)e.out.line(`v${a.version} ${a.created_at}${a.current?" (current)":""}`)})}},M$={name:"secrets:rollback",summary:"put a secret back to one of its versions (a new version with that value)",usage:"<NAME> --version <n> [--dev]",args:{min:1,max:1},flags:{...za,version:{type:"string",value:"n",description:"the version to go back to"}},scope:"environment",async run(e){let t=await f(e),n=Fo(e),s=Number(e.flags.version);if(!Number.isInteger(s)||s<1)throw h("--version is a version number (secrets:versions lists them)");let a=qa(e);await k(e,t,`put the ${a} secret ${n} back to v${s}`);let o=await g(e,t,"POST",`/secrets/${a}/${n}/rollback`,{version:s}),i=await Rp(e,t,a);e.out.result({set:a,name:n,version:o.version,environment:t.env_slug,machines:"using"in i?i.using:null},()=>{e.out.line(`${n} in the ${a} set of ${ee(t)} is v${s}'s value again, as v${o.version}.`),Pp(e,t,a,i)})}},D$={name:"secrets:audit",summary:"every read and write of the environment's secrets, newest first: which secret, which key did it, when \u2014 never a value",usage:"[--name <NAME>] [--dev | --prod] [--limit <n>]",details:["A backend that reads the secrets at boot (palbase run, a machine) shows here as a read, with the key it read with: palbase keys:list names the key.","An encrypted column's values opened through Palbase (Studio's table, a secret key) are recorded under the column's address: --name patients.tc lists who opened them, and when."],flags:{name:{type:"string",value:"NAME",description:"only this secret's, or an encrypted field's opens (table.column)"},dev:{type:"boolean",description:"only the development secrets"},prod:{type:"boolean",description:"only the production secrets"},limit:{type:"string",value:"n",description:"how many (default 30)"}},scope:"environment",async run(e){let t=await f(e);if(e.flags.dev===!0&&e.flags.prod===!0)throw h("--dev or --prod, not both");let n=Number(e.flags.limit??30);if(!Number.isInteger(n)||n<1||n>500)throw h("--limit is a whole number from 1 to 500");let s=new URLSearchParams({limit:String(n),...e.flags.name?{name:e.flags.name}:{},...e.flags.dev===!0?{environment:"development"}:e.flags.prod===!0?{environment:"production"}:{}}),a=await g(e,t,"GET",`/secrets/audit?${s}`);e.out.result(a,()=>{a.entries.length===0?e.out.line("No read or write of a secret yet."):e.out.table(a.entries,[{header:"when",value:o=>o.at.slice(0,19).replace("T"," ")},{header:"what",value:o=>o.action},{header:"set",value:o=>o.environment??""},{header:"secret",value:o=>o.name?`${o.name}${o.version?` v${o.version}`:""}`:"every one"},{header:"key",value:o=>o.key_id}])})}};function dm(e,t){e.out.table(t.keys,[{header:"key",value:n=>`${n.id}${n.id===t.current?" (in force)":""}`},{header:"in force from",value:n=>n.activates_at.slice(0,19).replace("T"," ")},{header:"made by",value:n=>n.created_by}])}var z$={name:"fields:list",summary:"the keys the environment's encrypted database fields are sealed with \u2014 never the keys themselves",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/secrets/fields");e.out.result(n,()=>dm(e,n))}},q$={name:"fields:rotate",summary:"make a new key for the environment's encrypted fields (an owner's or an admin's)",details:["It comes into force in five minutes: by then every running backend has fetched it. New values are sealed with it from then on; a palbase/backend app seals its older values again with it, in the background.","The older keys go on opening what they sealed."],scope:"environment",async run(e){let t=await f(e);await k(e,t,"rotate the encrypted fields' key");let n=await g(e,t,"POST","/secrets/fields/rotate"),s=n.keys[n.keys.length-1];e.out.result(n,()=>{e.out.line(`Made ${s.id} in ${ee(t)}: in force from ${s.activates_at.slice(0,19).replace("T"," ")} UTC.`),dm(e,n)})}},G$={name:"fields:keys",summary:"download the environment's field keys into a file (its owner's): what opens a dump of its database elsewhere",usage:"--out <file>",details:["The file opens every encrypted field of the environment: keep it as you would the database's password. It is the shape palbase/server's Fields reads: new Fields({ fetch: async () => JSON.parse(readFileSync(file, 'utf8')) }).","The download is in the secrets audit trail (secrets:audit)."],flags:{out:{type:"string",value:"file",description:"where the keys go (made readable by you alone); never the screen"}},scope:"environment",async run(e){let t=e.flags.out;if(!t)throw h("fields:keys writes the keys into a file: --out <file> (never onto the screen, which keeps them)");let n=await f(e),s=await g(e,n,"GET","/secrets/fields/keys");await E$(t,`${JSON.stringify(s,null,2)}
22
22
  `,{mode:384,flag:"wx"}),e.out.result({file:t,keys:s.keys.map(a=>a.id)},()=>e.out.line(`Wrote the keys of ${ee(n)} (${s.keys.map(a=>a.id).join(", ")}) to ${t}.`))}};function jp(e,t){e.out.table(t.keys,[{header:"key",value:n=>`${n.id}${n.id===t.current?" (in use)":""}`},{header:"made",value:n=>n.created_at.slice(0,19).replace("T"," ")},{header:"made by",value:n=>n.created_by},{header:"retired",value:n=>n.retired_at?`${n.retired_at.slice(0,19).replace("T"," ")} by ${n.retired_by}`:""}])}var K$={name:"transit:list",summary:"the keys the encrypted fields of a request to the environment's backend are sealed to \u2014 their public halves alone",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/secrets/transit");e.out.result(n,()=>jp(e,n))}},U$={name:"transit:rotate",summary:"make a new key for the encrypted fields of requests to the backend (an owner's or an admin's)",usage:"[--retire-previous]",details:["Apps seal to it from their next fetch of the project's keys (within the hour), or at once with --retire-previous: every older key is retired with it \u2014 what to do when one may have been taken \u2014 and an app that seals to a retired one is told so, fetches the keys again and sends its call once more.","No app needs a new build: an app holds the project's signing key, not its keys."],flags:{"retire-previous":{type:"boolean",description:"retire every older key at once"}},scope:"environment",async run(e){let t=await f(e),n=e.flags["retire-previous"]===!0;await k(e,t,n?"rotate the transit keys, retiring every older one":"rotate the transit keys");let s=await g(e,t,"POST","/secrets/transit/rotate",{retire_previous:n});e.out.result(s,()=>{e.out.line(`Made ${s.current} in ${ee(t)}: apps seal to it from now${n?"; every older key is retired":""}.`),jp(e,s)})}},W$={name:"transit:retire",summary:"retire a transit key that is not the one in use: no request sealed to it opens from then on",usage:"<key>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=e.args[0];if(!/^t[1-9][0-9]{0,5}$/.test(n))throw h(`${n} is not a transit key's id`,"palbase transit:list names them (t1, t2, \u2026)");await k(e,t,`retire the transit key ${n}`);let s=await g(e,t,"POST",`/secrets/transit/${n}/retire`);e.out.result(s,()=>{e.out.line(`Retired ${n} in ${ee(t)}.`),jp(e,s)})}},cm=[O$,x$,I$,L$,N$,M$,D$,z$,q$,G$,K$,U$,W$];import{randomBytes as qm}from"node:crypto";import{chmod as $A,lstat as AA,mkdir as RA,readFile as Im,realpath as xm,rename as PA,rm as jA,writeFile as Nm}from"node:fs/promises";function um(){let e=globalThis;if(typeof e.document<"u"||e.navigator?.product==="ReactNative")return!0;let t=e.navigator?.userAgent;return typeof t=="string"&&t.startsWith("Mozilla/")}var is=class extends Error{code;constructor(t,n){super(n),this.name="FieldError",this.code=t}},ur="pbe1.",F$="pbl1.",B$=6e4,Tp="[A-Za-z_][A-Za-z0-9_$]{0,62}",J$=new RegExp(`^${Tp}\\.${Tp}(\\.${Tp})?$`);function H$(e){return J$.test(e)}var Bo=class{crypto;keys=new Map;lookupKey;timer;opts;now;constructor(t){this.opts=t,this.now=t.now??Date.now}get loaded(){return this.lookupKey!==void 0}async load(t){this.crypto??=await import("node:crypto"),this.take(await this.opts.fetch(t)),this.timer===void 0&&(this.timer=setInterval(()=>{this.opts.fetch().then(n=>this.take(n),()=>{})},B$),this.timer.unref?.())}close(){clearInterval(this.timer),this.timer=void 0}take(t){let n=new Map;for(let s of t.keys)n.set(s.id,{id:s.id,key:Buffer.from(s.key,"base64url"),activatesAt:Date.parse(s.activates_at)});this.keys=n,this.lookupKey=Buffer.from(t.lookup,"base64url")}ready(){if(this.crypto===void 0||this.lookupKey===void 0)throw new is("not_loaded","the project's field keys are not loaded: await palbase.fields.load() at startup");return this.crypto}currentKey(){this.ready();let t;for(let n of this.keys.values())n.activatesAt<=this.now()&&(t===void 0||n.activatesAt>=t.activatesAt)&&(t=n);if(t===void 0)throw new is("unknown_key","the project has no field key in force");return t.id}encrypt(t,n){let s=this.ready();Ep(t);let a=this.currentKey(),o=s.randomBytes(12);return V$(s,this.keys.get(a).key,o,a,t,n)}decrypt(t,n){let s=this.ready();if(Ep(t),!n.startsWith(ur))throw new is("not_encrypted",`${t} holds a value that is not encrypted`);let a=n.slice(ur.length),o=a.indexOf("."),i=o<0?a:a.slice(0,o),r=this.keys.get(i);if(r===void 0)throw new is("unknown_key",`${t} was sealed with field key ${i}, which this project does not hold`);let l=Buffer.from(a.slice(o+1),"base64url");if(o<0||l.length<28||l.toString("base64url")!==a.slice(o+1))throw new is("unopenable",`${t} holds a value that does not open here`);try{let p=s.createDecipheriv("aes-256-gcm",r.key,l.subarray(0,12));return p.setAAD(mm(t)),p.setAuthTag(l.subarray(l.length-16)),Buffer.concat([p.update(l.subarray(12,l.length-16)),p.final()]).toString("utf8")}catch{throw new is("unopenable",`${t} holds a value that does not open here: tampered, or another column's`)}}isEncrypted(t){return t.startsWith(ur)}lookup(t,n){let s=this.ready();return Ep(t),X$(s,this.lookupKey,t,n)}};function Ep(e){if(!H$(e))throw new TypeError(`a field's address is table.column, or schema.table.column, not ${JSON.stringify(e)}`)}function mm(e){return Buffer.from(`pbe1\0${e}`,"utf8")}function V$(e,t,n,s,a,o){let i=e.createCipheriv("aes-256-gcm",t,n);i.setAAD(mm(a));let r=Buffer.concat([n,i.update(o,"utf8"),i.final(),i.getAuthTag()]);return`${ur}${s}.${r.toString("base64url")}`}function X$(e,t,n,s){let a=e.createHmac("sha256",t);return a.update(`pbl1\0${n}\0`,"utf8"),a.update(s,"utf8"),`${F$}${a.digest("base64url")}`}var Op="pbt1.",vn="Palbase-Encryption";var hr="x-palbase-encrypted",pt=class extends Error{code;constructor(t,n){super(n),this.name="TransitError",this.code=t}},js=new TextEncoder,Y$=new TextDecoder("utf-8",{fatal:!0}),kn=()=>{let e=globalThis.crypto?.subtle;if(!e)throw new Error("encrypted fields need WebCrypto (crypto.subtle): a secure context \u2014 https, or localhost");return e};function Et(e){return new Uint8Array(new ArrayBuffer(e))}function _n(...e){let t=Et(e.reduce((s,a)=>s+a.length,0)),n=0;for(let s of e)t.set(s,n),n+=s.length;return t}function Kn(e){return _n(e)}function Ho(e,t){let n=Et(t);for(let s=t-1;s>=0;s--)n[s]=e&255,e>>>=8;return n}function Vo(e){let t="";for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Un(e){let t=e.replace(/=+$/,"");if(!/^[A-Za-z0-9_-]*$/.test(t)||t.length%4===1)throw new pt("malformed","not base64url");let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4)),s=Et(n.length);for(let a=0;a<n.length;a++)s[a]=n.charCodeAt(a);return s}var gm=_n(js.encode("KEM"),Ho(32,2)),Jo=_n(js.encode("HPKE"),Ho(32,2),Ho(1,2),Ho(1,2)),hm=js.encode("HPKE-v1"),Z$=16,Q$=12,eA=32,ym=Uint8Array.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);async function fm(e,t){let n=await kn().importKey("raw",e.length===0?Et(32):Kn(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return new Uint8Array(await kn().sign("HMAC",n,Kn(t)))}async function mr(e,t,n,s){return fm(t,_n(hm,e,js.encode(n),s))}async function Cp(e,t,n,s,a){let o=_n(Ho(a,2),hm,e,js.encode(n),s),i=Et(a),r=Et(0);for(let l=1,p=0;p<a;l++)r=await fm(t,_n(r,o,Uint8Array.of(l))),i.set(r.subarray(0,Math.min(r.length,a-p)),p),p+=r.length;return i}async function bm(e){if(e.length!==32)throw new pt("malformed","an X25519 private key is 32 bytes");return kn().importKey("pkcs8",_n(ym,e),{name:"X25519"},!1,["deriveBits"])}async function wm(e){if(e.length!==32)throw new pt("malformed","an X25519 public key is 32 bytes");return kn().importKey("raw",Kn(e),{name:"X25519"},!1,[])}async function vm(e,t){return new Uint8Array(await kn().deriveBits({name:"X25519",public:t},e,256))}async function km(e,t,n){let s=await mr(gm,Et(0),"eae_prk",e);return Cp(gm,s,"shared_secret",_n(t,n),eA)}async function _m(e,t){let n=await mr(Jo,Et(0),"psk_id_hash",Et(0)),s=await mr(Jo,Et(0),"info_hash",t),a=_n(Uint8Array.of(0),n,s),o=await mr(Jo,e,"secret",Et(0));return{key:await Cp(Jo,o,"key",a,Z$),nonce:await Cp(Jo,o,"base_nonce",a,Q$)}}async function yr(e,t,n,s,a){let o=await kn().importKey("raw",Kn(t),"AES-GCM",!1,[e]);return new Uint8Array(await kn()[e]({name:"AES-GCM",iv:Kn(n),additionalData:Kn(s)},o,Kn(a)))}async function xp(e,t,n,s=Et(0),a){let o,i;if(a)o=await bm(a.privateKey),i=Kn(a.publicKey);else{let d=await kn().generateKey({name:"X25519"},!0,["deriveBits"]);o=d.privateKey,i=new Uint8Array(await kn().exportKey("raw",d.publicKey))}let r=await km(await vm(o,await wm(e)),i,e),{key:l,nonce:p}=await _m(r,t);return{enc:i,ct:await yr("encrypt",l,p,s,n)}}async function tA(e,t,n,s,a,o=Et(0)){if(n.length!==32)throw new pt("malformed","an encapsulated X25519 key is 32 bytes");try{let i=await km(await vm(await bm(e),await wm(n)),n,t),{key:r,nonce:l}=await _m(i,s);return await yr("decrypt",r,l,o,a)}catch{throw new pt("unopenable","the request's key does not open with the project's key it names")}}async function Sm(e){let t=await kn().importKey("pkcs8",_n(ym,e),{name:"X25519"},!0,["deriveBits"]),n=await kn().exportKey("jwk",t);return Un(n.x)}function fr(e,t,n,s=[]){if(s.some(a=>a.includes("\0")))throw new pt("malformed","a path's value holds no NUL");return js.encode(["palbase-encryption","1",e,t.toUpperCase(),nA(n),...s].join("\0"))}function nA(e){return e.replace(/\{[^/{}]*\}/g,"{}")}async function $m(e,t,n,s={}){let a=s.key?Kn(s.key):crypto.getRandomValues(Et(32)),{enc:o,ct:i}=await xp(t,n,a,Et(0),s.ephemeral);return{kid:e,key:a,header:`1.${e}.${Vo(o)}.${Vo(i)}`}}function Lp(e){let t=e.trim().split(".");if(t.length!==4||t[0]!=="1"||!/^t[1-9][0-9]{0,5}$/.test(t[1]))throw new pt("malformed",`${vn} is 1.<key id>.<enc>.<ct>`);let n=Un(t[2]),s=Un(t[3]);if(n.length!==32||s.length!==48)throw new pt("malformed",`${vn} carries a 32-byte encapsulated key and a sealed 32-byte key`);return{kid:t[1],enc:n,ct:s}}async function Am(e,t,n,s){let{enc:a,ct:o}=Lp(e),i=await tA(t,n,a,s,o);if(i.length!==32)throw new pt("unopenable","the request's key is not 32 bytes");return i}function Rm(e){return js.encode(`pbt1\0${e}`)}async function Xo(e,t,n,s){let a=s?Kn(s):crypto.getRandomValues(Et(12)),o=JSON.stringify(n);if(o===void 0)throw new pt("malformed",`${t}: an encrypted field holds a JSON value`);let i=await yr("encrypt",e,a,Rm(t),js.encode(o));return Op+Vo(_n(a,i))}function Yo(e){return typeof e=="string"&&e.startsWith(Op)}async function br(e,t,n){if(!Yo(n))throw new pt("unopenable",`${t} is not an encrypted field`);let s;try{s=Un(n.slice(Op.length))}catch{throw new pt("unopenable",`${t} is not an encrypted field`)}if(s.length<28)throw new pt("unopenable",`${t} is too short to be an encrypted field`);let a;try{a=await yr("decrypt",e,s.subarray(0,12),Rm(t),s.subarray(12))}catch{throw new pt("unopenable",`${t} does not open: changed, moved from another field, or another request's`)}try{return JSON.parse(Y$.decode(a))}catch{throw new pt("unopenable",`${t} opens to no JSON value`)}}function wr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1").replace(/\*/g,"~2")}function sA(e){return e.replace(/~2/g,"*").replace(/~1/g,"/").replace(/~0/g,"~")}var Pm=Symbol("items");function aA(e,t){if(!(e!==t&&!e.startsWith(t+"/")))return e===t?[]:e.slice(t.length+1).split("/").map(n=>n==="*"?Pm:sA(n))}async function Ga(e,t,n,s){let a=e;for(let o of n){let i=aA(o,t);i!==void 0&&(a=await gr(a,i,t,s))}return a}async function gr(e,t,n,s){if(t.length===0)return e===void 0?void 0:s(n,e);let[a,...o]=t;if(a===Pm){if(!Array.isArray(e))return e;let r=[];for(let[l,p]of e.entries())r.push(await gr(p,o,`${n}/${l}`,s));return r}if(Array.isArray(e)){if(!/^(0|[1-9][0-9]*)$/.test(a)||Number(a)>=e.length)return e;let r=[...e];return r[Number(a)]=await gr(r[Number(a)],o,`${n}/${a}`,s),r}if(typeof e!="object"||e===null||Array.isArray(e)||!Object.hasOwn(e,a))return e;let i={...e};return i[a]=await gr(i[a],o,`${n}/${wr(a)}`,s),i}var Sn=class extends Error{status=400;code;data;constructor(t,n,s={}){super(n),this.name="TransitRefusal",this.code=t,this.data=s}},oA=6e4,iA=1e3;function Ip(e){return/^t[1-9][0-9]{0,5}$/.test(e)?Number(e.slice(1)):0}var Zo=class{keys=new Map;retired=new Set;order=[];project;timer;fetchedAt=0;heldFrom=0;fetching;opts;now;sleep;constructor(t){this.opts=t,this.now=t.now??Date.now,this.sleep=t.sleep??(n=>new Promise(s=>setTimeout(s,n)))}get loaded(){return this.project!==void 0}get projectId(){if(this.project===void 0)throw new Error("the project's transit keys are not loaded: await palbase.transit.load() at startup");return this.project}current(){return this.order[0]}async load(t){await this.refresh(t),this.timer===void 0&&(this.timer=setInterval(()=>{this.refresh().catch(()=>{})},oA),this.timer.unref?.())}close(){clearInterval(this.timer),this.timer=void 0}refresh(t){return this.fetching??=(async()=>{let n=this.now();try{let s=await this.opts.fetch(t),a=new Map;for(let o of s.keys){let i=Un(o.key);a.set(o.id,{privateKey:i,publicKey:this.keys.get(o.id)?.publicKey??await Sm(i)})}this.keys=a,this.order=s.keys.map(o=>o.id),this.retired=new Set(s.retired),this.project=s.project,this.fetchedAt=this.now(),this.heldFrom=n}finally{this.fetching=void 0}})(),this.fetching}newest(){return Math.max(0,...this.order.map(Ip),...[...this.retired].map(Ip))}async key(t){let n=this.now();for(;Ip(t)>this.newest()&&this.heldFrom<n;){let o=this.fetchedAt+iA-this.now();if(o>0){await this.sleep(o);continue}await this.refresh()}let s=this.keys.get(t),a=this.current();if(this.retired.has(t))throw new Sn("encryption_key_retired",`the request is sealed to ${t}, retired: fetch the project's keys again`,{current:a});if(s===void 0)throw new Sn("encryption_key_unknown",`the request is sealed to ${t}, which the project has not made`,{current:a});return s}async request(t){if(t.header===void 0||t.header===null||t.header==="")throw new Sn("encryption_required",`this route carries encrypted fields: the request names its key in ${vn}`,{field:vn,current:this.current()});let n;try{n=Lp(t.header).kid}catch{throw new Sn("encryption_unopenable",`${vn} is not one`,{field:vn})}let s=await this.key(n),a;try{a=fr(this.projectId,t.method,t.path,t.params??[])}catch{throw new Sn("encryption_unopenable","the request's path holds a value no key is sealed for",{field:vn})}try{return new vr(n,await Am(t.header,s.privateKey,s.publicKey,a))}catch(o){throw o instanceof pt?new Sn("encryption_unopenable","the request's key does not open: sealed for another project, route or path, or changed",{field:vn}):o}}},vr=class{kid;key;constructor(t,n){this.kid=t,this.key=n}async open(t,n,s){return Ga(t,n,s,async(a,o)=>{if(!Yo(o))throw new Sn("encryption_required",`${a} is an encrypted field: it came plain`,{field:a});try{return await br(this.key,a,o)}catch{throw new Sn("encryption_unopenable",`${a} does not open: changed, moved from another field, or another request's`,{field:a})}})}async seal(t,n){return Ga(t,"/response",n,(s,a)=>Xo(this.key,s,a))}sealField(t,n){return Xo(this.key,t,n)}};var rA=/^pb_[a-z0-9]+_s/;function kr(e){if(um())throw new TypeError("palbase/server runs on a server: its secret key never goes into a browser or a mobile app \u2014 apps use palbase/web (or the native SDKs) with the publishable key");if(typeof e.secretKey!="string"||!rA.test(e.secretKey))throw new TypeError("secretKey is the project secret key (pb_<ref>_s\u2026); a publishable key belongs in palbase/web");let t=bp(pp({baseUrl:e.url,credentials:{secretKey:e.secretKey},fetch:e.fetch,solveProofOfWork:e.solveProofOfWork??!1}),e.retry??lr),n=zo.client(t);return{ai:er.client(t),analytics:Co.client(t),auth:Oo.client(t),cache:tr.client(t),calls:nr.client(t),fields:new Bo({fetch:async s=>(await n.getFieldKeys({signal:s})).data}),flags:xo.client(t),iap:Lo.client(t),machines:Io.client(t),messaging:ir.client(t),notify:No.client(t),payments:Mo.client(t),campaigns:sr.client(t),commerce:ar.client(t),journeys:or.client(t),realtime:Do.client(t),secrets:n,storage:qo.client(t),stores:Go.client(t),workspaces:rr.client(t),transit:new Zo({fetch:async s=>(await n.getTransitKeys({signal:s})).data}),transport:t,url:new URL(e.url).origin}}var BU=1024*1024;var VU=8*1024;var tW=16*1024,nW=10*6e4;var cA=/^[A-Za-z_][A-Za-z0-9_]{0,127}$/,uA=/^(PALBASE_|NODE_|BUN_|NPM_|LD_|DYLD_|GIT_|SSH_)|^(PATH|HOME|SHELL|USER|TMPDIR|TMP|TEMP|PWD|IFS|ENV|BASH_ENV|SSL_CERT_FILE|SSL_CERT_DIR|CURL_CA_BUNDLE|REQUESTS_CA_BUNDLE|NO_PROXY|ALL_PROXY|HTTP_PROXY|HTTPS_PROXY|PG\w*)$/i;function Qo(e){return!cA.test(e)||uA.test(e)||/_PROXY$/i.test(e)}var mA=/^(PORT|PALBASE_(URL|PROJECT_ID|MACHINE|REPLICAS|SECRET_KEY|WEBHOOK_SECRET|PLATFORM_SECRET|CONTRACT_OUT|CONTRACT_ENTRY|WEB_ORIGINS|SECRETS|DB_[A-Z0-9_]+))$/;function Np(e){return mA.test(e)}import{dirname as TA,join as EA,relative as CA,resolve as Fp,sep as Lm}from"node:path";import{lstat as gA,mkdir as hA,readFile as yA,rename as fA,rm as bA,writeFile as wA}from"node:fs/promises";import{dirname as Tm,join as vA,relative as kA,resolve as zp,sep as jm}from"node:path";var Em="// palbase:stack:begin",Cm="// palbase:stack:end",_A=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Mp=e=>_A.test(e)?e:JSON.stringify(e),ei=e=>[...new Set(e)].sort();function Dp(e,t){return t.length===0?[` interface ${e} {}`]:[` interface ${e} {`,...t.map(n=>` ${n}`)," }"]}function qp(e){let t=[...e.buckets].sort((n,s)=>n.name<s.name?-1:n.name>s.name?1:0);return[Em,'declare module "palbase/backend/stack" {',...Dp("Secrets",ei(e.secrets).map(n=>`${Mp(n)}: true;`)),"",...Dp("Flags",ei(e.flags).map(n=>`${Mp(n)}: true;`)),"",...Dp("Buckets",t.map(n=>{let s=ei(n.variants);return`${Mp(n.name)}: { variants: ${s.length===0?"never":s.map(a=>JSON.stringify(a)).join(" | ")} };`})),"}",Cm].join(`
23
23
  `)}var SA=/(\n*)export\s*\{\s*\}\s*;?\s*$/;function Ka(e,t,n={begin:Em,end:Cm,said:"palbase types:pull writes the block between the markers: the names this environment holds, for palbase/backend/stack."}){if(e===void 0)return`// ${n.said}
24
24
  ${t}
@@ -8868,6 +8868,7 @@ dyn.home-webserver.de
8868
8868
  myhome-server.de
8869
8869
  ddnss.org
8870
8870
  debian.net
8871
+ deepdynamic.space
8871
8872
  definima.io
8872
8873
  definima.net
8873
8874
  deno.dev
@@ -11195,7 +11196,7 @@ ${t}}`}var cs=e=>["",e.toUpperCase(),"-".repeat(e.length)],GO=[{title:"One packa
11195
11196
  `)}
11196
11197
  `}var xk={flow:"total",snapshot:"last",ratio:"overall"};function Lk(e){return(e.segments[0]?.points??[]).map(t=>t.period)}function EN(e,t,n){let s=t.segments[0];if(!s)return;let a=n?.measures??Object.keys(s.summary.measures).map(r=>({key:r,unit:t.unit,description:""})),o=[...s.points,{period:xk[t.kind]??"summary",value:s.summary.value,measures:s.summary.measures}],i=[{header:"period",value:r=>`${r.period}${r.incomplete?" *":""}`},{header:"value",value:r=>Pi(t.unit,r.value,t.currency)},...a.map(r=>({header:I(r.key),value:l=>r.key in l.measures?Pi(r.unit,l.measures[r.key],t.currency):"\u2014"}))];e.out.table(o,i)}function CN(e,t){let s=Lk(t).map((a,o)=>({period:a,values:t.segments.map(i=>i.points[o]?.value),incomplete:t.segments.some(i=>i.points[o]?.incomplete===!0)}));s.push({period:xk[t.kind]??"summary",values:t.segments.map(a=>a.summary.value),incomplete:!1}),e.out.table(s,[{header:"period",value:a=>`${a.period}${a.incomplete?" *":""}`},...t.segments.map((a,o)=>({header:I(a.label??a.key),value:i=>i.values[o]===void 0?"\u2014":Pi(t.unit,i.values[o],t.currency)}))])}function ON(e,t){for(let n of t.segments){let s=Math.max(0,...n.points.map(o=>o.ages?.length??0),n.summary.ages?.length??0),a=[...n.points.map(o=>({cohort:o.period,size:o.value,ages:o.ages??[],incomplete:o.incomplete})),{cohort:"all",size:n.summary.value,ages:n.summary.ages??[]}];t.segments.length>1&&e.out.line(`${I(n.label??n.key)}:`),e.out.table(a,[{header:"cohort",value:o=>`${o.cohort}${o.incomplete?" *":""}`},{header:"size",value:o=>Pi(t.unit,o.size,t.currency)},...Array.from({length:s},(o,i)=>({header:`+${i}`,value:r=>{let l=r.ages.find(p=>p.age===i);return l?`${Pi(t.age_unit,l.value,t.currency)}${l.incomplete?"*":""}`:""}}))])}}function xN(e){let t=[`${e.from} to ${e.to} (UTC) by ${e.resolution}`];return(e.unit==="currency"||e.age_unit==="currency"||e.revenue_type)&&t.push(`in ${e.currency}${e.revenue_type?`, ${Mc[e.revenue_type]??e.revenue_type}`:""}`),e.segment&&t.push(`by ${e.segment}`),e.filters.length>0&&t.push(`only ${e.filters.map(n=>`${n.dimension}:${n.value}`).join(", ")}`),e.window_days!==void 0&&t.push(`within ${e.window_days} day(s)`),e.cohort&&t.push(`cohorts of ${e.cohort==="new_paying_customers"?"new paying customers":"new customers"}`),t.push(`test purchases ${e.sandbox?"included":"left out"}`),`${e.name}: ${t.join(", ")}`}var LN={name:"iap:charts:get",summary:"one purchase chart, period by period \u2014 a table of its periods and segments, or the module's CSV",usage:"<chart> [--from <YYYY-MM-DD>] [--to <YYYY-MM-DD>] [--resolution day|week|month] [--segment <dimension>] [--filter <dimension:value>]\u2026 [--revenue-type <type>] [--currency <code>] [--window-days <n>] [--cohort new_customers|new_paying_customers] [--sandbox] [--csv [--out <palbase/\u2026.csv>]]",details:["Days are UTC; from and to are both included, at most two years apart (by default the last 30 days, 12 weeks or 12 months). A period marked * is not over: its value may still change.","Money is in the reporting currency (iap:charts:settings) at the European Central Bank's rate of the day it was paid; proceeds take off the store's commission and Stripe's fee, which the ledger does not hold: they are estimated, and so are taxes a store did not state.",`--csv prints the module's CSV (a row a segment and period) \u2014 on the terminal its control characters escaped \u2014; with --out it is written to that file, under ${ue}/. A cell that would start a spreadsheet formula (=, +, -, @) begins with a quote.`],args:{min:1,max:1},flags:{from:{type:"string",value:"YYYY-MM-DD",description:"the first day"},to:{type:"string",value:"YYYY-MM-DD",description:"the last day, included (default today)"},resolution:{type:"string",value:"resolution",description:"day (default), week or month"},segment:{type:"string",value:"dimension",description:"split by a dimension (iap:charts lists them)"},filter:{type:"string",multiple:!0,value:"dimension:value",description:"keep only this value, one each --filter: --filter store:app_store --filter country:TR"},"revenue-type":{type:"string",value:"type",description:"gross (default), net_of_taxes or proceeds"},currency:{type:"string",value:"code",description:"the currency to report money in (default: the reporting currency)"},"window-days":{type:"string",value:"n",description:"the conversion window or customer lifetime, in days from a customer's first day, 0 to 730 (default: to now)"},cohort:{type:"string",value:"cohort",description:"the cohort explorer's cohorts: new_customers (default) or new_paying_customers"},sandbox:{type:"boolean",description:"count the stores' test purchases too"},csv:{type:"boolean",description:"the module's CSV instead of a table"},out:{type:"string",value:"file",description:`with --csv, write it to this file, under ${ue}/`}},scope:"environment",async run(e){let t=e.args[0];if(!/^[a-z_]+$/.test(t))throw h(`${JSON.stringify(t)} is not a chart's key`,"palbase iap:charts lists them");for(let E of["from","to"]){let C=e.flags[E];if(C!==void 0&&(typeof C!="string"||!yN.test(C)))throw h(`--${E} is a day: 2026-10-01`)}let n=Ri(e,"resolution",bN),s=Ri(e,"revenue-type",Ek),a=Ri(e,"cohort",wN),o=Kl(e,"currency"),i=we(e.flags["window-days"],"window-days");if(i!==void 0&&i>730)throw h("--window-days is 0 to 730");let r=AN(e.flags.filter),l=e.flags.segment;if(l!==void 0&&!/^[a-z][a-z_]{0,31}$/.test(l))throw h(`--segment ${l}: a dimension (iap:charts lists them)`);let p=e.flags.csv===!0,d=e.flags.out;if(d!==void 0&&!p)throw h("--out writes the CSV: give --csv with it");if(p&&d===void 0&&e.global.json)throw h("--csv and --json are two forms of the answer: give one");let u=d!==void 0?Kt(e,"out",d,".csv",`${hN}/${t}.csv`):void 0,m=await f(e),y;try{y=await g(e,m,"GET","/iap/charts")}catch(E){ql(E,t)}let w=y.charts.find(E=>E.key===t);if(!w)throw new b("chart_not_found",`no chart ${JSON.stringify(t)}`,{hint:"palbase iap:charts lists them"});let v=y.dimensions.map(E=>E.key);if((l!==void 0||r.length>0)&&!w.segmentable)throw h(`${t} is not segmented or filtered by a dimension`);for(let E of[...l!==void 0?[l]:[],...r.map(C=>C.dimension)])if(!v.includes(E))throw h(`${E} is not a dimension the charts are cut by: ${v.map(I).join(", ")}`);let P=new URLSearchParams({...e.flags.from!==void 0?{from:e.flags.from}:{},...e.flags.to!==void 0?{to:e.flags.to}:{},...n?{resolution:n}:{},...e.flags.sandbox===!0?{sandbox:"true"}:{},...l?{segment:l}:{},...o?{currency:o}:{},...s?{revenue_type:s}:{},...i!==void 0?{window_days:String(i)}:{},...a?{cohort:a}:{}});for(let E of r)P.append("filter",`${E.dimension}:${E.value}`);let A=`/iap/charts/${R(t)}${P.size>0?`?${P}`:""}`;if(p){let E;try{E=await g(e,m,"GET",A,void 0,{accept:"text/csv"})}catch(K){ql(K,t)}if(typeof E!="string")throw new b("not_csv","the iap module did not answer the chart as CSV");let C=TN(E);if(u===void 0){e.io.stdout(le(C));return}let W=await Be(e.io.cwd,u);await uN(gN(W),{recursive:!0}),await Be(e.io.cwd,u),await mN(W,C);let z=Math.max(0,Ok(C).length-1);e.out.result({file:u,chart:t,rows:z},()=>e.out.line(`Wrote ${t} to ${u} (${z} row${z===1?"":"s"}).`));return}let T;try{T=await g(e,m,"GET",A)}catch(E){ql(E,t)}e.out.result(T,()=>{e.out.line(I(xN(T))),T.segments.length===0||Lk(T).length===0?e.out.line("Nothing in these days."):T.kind==="cohort"?(ON(e,T),e.out.line(T.chart==="subscription_retention"?"Ages are renewals: +0 is the first paid period; a value is the share that reached it.":`Ages are ${I(T.resolution)}s from each customer's first day; a value is realized LTV per customer.`)):T.segment===void 0&&T.segments.length===1?EN(e,T,w):CN(e,T),T.segments.some(E=>E.points.some(C=>C.incomplete||C.ages?.some(W=>W.incomplete)))&&e.out.line("* not over yet: the value may still change."),T.estimated&&e.out.line("Estimated: the money holds what the ledger does not state \u2014 taxes a store did not, the stores' commission and Stripe's fee, a Google Play offer's period at its plan's price \u2014 in any revenue type, gross too."),T.chart==="active_customers"&&e.out.line("Customers are counted from the day the module began keeping the days they were seen: days before it count none."),Ck(e,T.unconverted),e.out.line(`Counted ${I(Z(T.computed_at))}.`)})}};function IN(e){return`${Ik(e.web_fee_bps)} + ${Gl(e.web_fee_fixed_micros/1e6,e.web_fee_fixed_currency)}`}function Ik(e){return`${(e/100).toFixed(2).replace(/\.?0+$/,"")}%`}function NN(e){if(e===void 0)return;let t=Number(e);if(typeof e!="string"||!/^\d+(\.\d{1,2})?$/.test(e)||t>20)throw h("--web-percent is a share of a payment, 0 to 20, with at most two decimals: 2.9");return Math.round(t*100)}function MN(e){if(e===void 0)return;if(typeof e!="string"||!/^\d+(\.\d{1,6})?$/.test(e)||Number(e)>1e5)throw h("--web-fixed is an amount, 0 to 100000, with at most six decimals: 0.30");let[t,n=""]=e.split(".");return Number(t)*1e6+Number(n.padEnd(6,"0"))}function DN(e){if(e===void 0)return;let t=Number(e);if(typeof e!="string"||!/^\d+(\.\d{1,2})?$/.test(e)||t>30)throw h("--app-store-link-percent is a share of a web purchase, 0 to 30, with at most two decimals: 27");return Math.round(t*100)}function zN(e){if(e!==void 0){if(typeof e!="string"||!/^\d{1,2}$/.test(e)||Number(e)<1||Number(e)>90)throw h("--app-store-link-days is a number of days, 1 to 90: 7");return Number(e)}}var qN={name:"iap:charts:settings",summary:"the charts' settings \u2014 the reporting currency, the stores' commission, web payment processing fee and the App Store's fee on web purchases linked out of the app \u2014 read, or changed with the flags given",usage:"[--currency <code>] [--commission standard|small_business] [--web-percent <n>] [--web-fixed <amount>] [--web-fixed-currency <code>] [--app-store-link-percent <n>] [--app-store-link-days <n>]",details:["Every amount is converted to the reporting currency at the European Central Bank's rate of the day it was paid; the ledger keeps what was paid as it was paid, so a change redraws every chart from its first day.","The commission is what proceeds take off App Store and Google Play payments: standard (30%; 15% of a subscription's renewals after its first paid year in the App Store, and of every Google Play subscription) or small_business (15%). Web fee \u2014 its share and fixed part \u2014 is taken off web payments; the ledger does not hold it, so proceeds are estimated.","The App Store's link fee is what Apple takes of a web purchase bought through a link out of the iOS app in its United States storefront, within the days after the link: nothing today (App Review Guideline 3.1.1(a)), set here once Apple charges one."],flags:{currency:{type:"string",value:"code",description:"the reporting currency, one the European Central Bank published a rate for in the last ten days"},commission:{type:"string",value:"commission",description:"standard (30%) or small_business (15%)"},"web-percent":{type:"string",value:"n",description:"web payment provider share of a payment, in percent (2.9)"},"web-fixed":{type:"string",value:"amount",description:"web payment provider fixed fee per payment (0.30)"},"web-fixed-currency":{type:"string",value:"code",description:"currency of the web fixed fee (USD)"},"app-store-link-percent":{type:"string",value:"n",description:"the App Store's share of a web purchase linked out of the iOS app, in percent (0)"},"app-store-link-days":{type:"string",value:"n",description:"for how many days after the link a purchase owes it (7)"}},scope:"environment",async run(e){let t={},n=Kl(e,"currency");n!==void 0&&(t.reporting_currency=n);let s=Ri(e,"commission",vN);s!==void 0&&(t.store_commission=s);let a=NN(e.flags["web-percent"]);a!==void 0&&(t.web_fee_bps=a);let o=MN(e.flags["web-fixed"]);o!==void 0&&(t.web_fee_fixed_micros=o);let i=Kl(e,"web-fixed-currency");i!==void 0&&(t.web_fee_fixed_currency=i);let r=DN(e.flags["app-store-link-percent"]);r!==void 0&&(t.app_store_link_fee_bps=r);let l=zN(e.flags["app-store-link-days"]);l!==void 0&&(t.app_store_link_attribution_days=l);let p=await f(e),d;Object.keys(t).length===0?d=await g(e,p,"GET","/iap/settings"):d=await GN(e,p,t),e.out.result({reporting_currency:d.reporting_currency,store_commission:d.store_commission,web_fee_bps:d.web_fee_bps,web_fee_fixed_micros:d.web_fee_fixed_micros,web_fee_fixed_currency:d.web_fee_fixed_currency,app_store_link_fee_bps:d.app_store_link_fee_bps,app_store_link_attribution_days:d.app_store_link_attribution_days},()=>{e.out.table([["Reporting currency",d.reporting_currency],["Store commission",kN[d.store_commission]??d.store_commission],["Web payment fee",IN(d)],["App Store's link fee",`${Ik(d.app_store_link_fee_bps)} within ${d.app_store_link_attribution_days} day${d.app_store_link_attribution_days===1?"":"s"} of the link`]],[{header:"setting",value:u=>u[0]},{header:"value",value:u=>u[1]}])})}};async function GN(e,t,n){let s=[n.reporting_currency&&`report money in ${n.reporting_currency}`,n.store_commission&&`take the ${n.store_commission==="small_business"?"Small Business (15%)":"standard (30%)"} commission off store payments`,(n.web_fee_bps!==void 0||n.web_fee_fixed_micros!==void 0||n.web_fee_fixed_currency)&&"change the web payment fee",(n.app_store_link_fee_bps!==void 0||n.app_store_link_attribution_days!==void 0)&&"change the App Store's link fee"].filter(Boolean);return await k(e,t,`charts: ${s.join(", ")}`),g(e,t,"PUT","/iap/settings",n)}var Nk=[SN,$N,LN,qN];import{X509Certificate as KN}from"node:crypto";import{mkdir as UN,readFile as zc,stat as zk,writeFile as qc}from"node:fs/promises";import{basename as WN,dirname as FN,relative as BN,resolve as ji,sep as JN}from"node:path";var Mk={apple:"App Store",google:"Google Play"};function Je(e,t,n){let s=e.args[t];if(s===void 0||s.trim()==="")throw h(`${n} is required`);return s}function qk(e){return`"${e}"`}async function Gk(e){let t=Ne(await ze(e,e.flags.file,"the catalog"),"the catalog");if(typeof t!="object"||t===null||Array.isArray(t))throw h("the catalog is a JSON object: { base_locale, products, entitlements, credits, limits }");if("catalog"in t&&"revision"in t)throw h('the file is a saved revision (catalog:get --json): give its "catalog" alone, as catalog:get --out writes it');return t}function Kk(e,t){for(let n of t)e.out.note(` ${n.warning?"warning":"problem"} ${n.path}: ${n.message} (${n.code}${n.channel?`, ${n.channel}`:""})`)}function Gc(e,t,n){if(t instanceof G&&t.code==="invalid_catalog"){let s=(t.body??{}).problems??[];throw s.length>0&&(e.out.note(`The catalog breaks ${s.filter(a=>!a.warning).length} rule(s):`),Kk(e,s)),new b("invalid_catalog",`${n}: ${t.message}`,{hint:"fix each problem in the file (palbase iap:catalog:validate checks it without saving)"})}throw t}function Uk(e,t){if(t.revision===0){e.out.line("No catalog yet (revision 0)."),e.out.line("Write one and save it: palbase iap:catalog:put --file catalog.json --revision 0");return}let n=t.catalog;e.out.line(`Catalog revision ${t.revision}${t.created_at?`, saved ${Z(t.created_at)}`:""}${t.created_by?` by ${t.created_by}`:""}`),e.out.line(`base language: ${n.base_locale}`),e.out.table(n.products,[{header:"product",value:s=>s.key},{header:"type",value:s=>s.type},{header:"plans",value:s=>s.plans.map(a=>a.key).join(", ")},{header:"channels",value:s=>Object.keys(s.channels).sort().join(", ")},{header:"gives",value:s=>[...s.entitlements??[],...s.credits?[`${s.credits.amount} ${s.credits.currency}`]:[]].join(", ")}]),n.products.length===0&&e.out.line("No product."),n.entitlements.length>0&&e.out.line(`entitlements: ${n.entitlements.map(s=>s.key).join(", ")}`),n.credits.length>0&&e.out.line(`credits: ${n.credits.map(s=>s.key).join(", ")}`),n.limits.length>0&&e.out.line(`limits: ${n.limits.map(s=>s.key).join(", ")}`)}var HN={name:"iap:catalog:get",summary:"the environment's catalog: its newest revision, the products it sells and what they give",usage:"[--out <catalog.json>]",details:["--out writes the catalog to a file to edit; catalog:put saves the edit with the revision it was edited from, which is printed."],flags:{out:{type:"string",value:"catalog.json",description:"write the catalog (the JSON catalog:put takes) to this file"}},scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/iap/catalog"),s=e.flags.out;if(s!==void 0){await qc(ji(e.io.cwd,s),`${JSON.stringify(n.catalog,null,2)}
11197
11198
  `),e.out.result({file:s,revision:n.revision},()=>{e.out.line(`Wrote revision ${n.revision} of the catalog to ${s}.`),e.out.line(`Save an edit of it: palbase iap:catalog:put --file ${s} --revision ${n.revision}`)});return}e.out.result(n,()=>Uk(e,n))}},VN={name:"iap:catalog:put",summary:"save a new revision of the whole catalog, on the revision it was edited from; nothing is written to a store",usage:"--file <catalog.json> --revision <n>",details:["The module checks it first: a catalog that breaks a rule is refused with every problem, and nothing is saved.","Of two people editing at once, the second is told \u2014 the catalog moved past the revision they edited \u2014 never overwritten.","The stores are brought to it by a plan: palbase iap:catalog:plan."],flags:{file:{type:"string",value:"catalog.json",description:"the catalog, as catalog:get --out wrote it ('-' or none: stdin)"},revision:{type:"string",value:"n",description:"the revision it was edited from (0 for the first), as catalog:get printed it"}},scope:"environment",async run(e){let t=await f(e),n=we(e.flags.revision,"revision");if(n===void 0)throw h("--revision is the revision the catalog was edited from (0 for the first): of two edits at once, the second is told, not saved over the first");let s=await Gk(e);await k(e,t,`save the catalog (${s.products?.length??0} products) over revision ${n}`);let a;try{a=await g(e,t,"PUT","/iap/catalog",s,{"if-match":qk(n),...D()})}catch(o){if(o instanceof G&&o.status===412)throw new b("catalog_changed",`the catalog is no longer at revision ${n}: someone saved a newer one since it was read \u2014 nothing was saved`,{hint:"read it again (palbase iap:catalog:get --out <file>), make the edit on it, and save it with that revision"});Gc(e,o,"the catalog was not saved")}e.out.result(a,()=>{e.out.line(`Saved revision ${a.revision} of the catalog.`),e.out.line("Bring the stores to it: palbase iap:catalog:plan")})}},XN={name:"iap:catalog:validate",summary:"check a catalog without saving it: every problem, with its path and the store whose rule it breaks",usage:"--file <catalog.json>",flags:{file:{type:"string",value:"catalog.json",description:"the catalog ('-' or none: stdin)"}},scope:"environment",async run(e){let t=await f(e),n=await Gk(e),s;try{s=await g(e,t,"POST","/iap/catalog/validate",n,D())}catch(a){Gc(e,a,"the catalog cannot be read")}if(e.out.result(s,()=>{s.problems.length>0&&Kk(e,s.problems),e.out.line(s.valid?`The catalog can be saved${s.problems.length>0?`, with ${s.problems.length} warning(s)`:""}.`:"The catalog cannot be saved as it is.")}),!s.valid)throw new b("invalid_catalog",`the catalog breaks ${s.problems.filter(a=>!a.warning).length} rule(s)`)}};function Dk(e,t,n){e.out.line(`${t}${n.store_env?` (${n.store_env})`:""}: ${n.steps.length===0?"nothing to write":`${n.steps.length} step(s)`}`);for(let s of n.steps)e.out.line(` ${s.op} ${s.product}${s.plan?`/${s.plan}`:""}${s.store_id?` (${s.store_id})`:""}${s.irreversible?" \u2014 permanent":""}${s.note?`: ${s.note}`:""}`);n.note&&e.out.line(` ${n.note}`)}function Kc(e){let t=Je(e,0,"the plan's id");if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw h(`${t} is no plan's id: it is the id iap:catalog:plan printed`);return t}function YN(e,t){if(e.out.line(`Plan ${t.id} for revision ${t.revision}: ${t.status}`),Dk(e,Mk.apple,t.apple),Dk(e,Mk.google,t.google),t.problems.length>0){e.out.line("Warnings of the revision:");for(let o of t.problems)e.out.line(` ${o.path}: ${o.message}${o.channel?` (${o.channel})`:""}`)}t.status==="failed"&&t.error&&e.out.line(`It failed: ${t.error}`);let n=t.apple_result;if(!n&&t.apple.steps.length>0&&(t.status==="applying"||t.status==="applied")&&e.out.line("App Store Connect: waiting for the stores module"),n){e.out.line(`App Store Connect (${n.bundle_id}): ${n.ok?"written":`not all written${n.error?`: ${n.error}`:""}`}`);for(let o of n.steps){let i=o.price?`, ${o.price.customer_price} ${o.price.currency}`:"",r=o.next_price?`, ${o.next_price.customer_price} ${o.next_price.currency} from ${o.next_price.from}`:"";e.out.line(` ${o.op} ${o.store_id}${o.state?`: ${o.state}`:""}${i}${r}${o.error?` \u2014 ${o.error}`:""}`)}}let s=t.google_result;if(s){e.out.line(`Google Play (${s.package_name}): ${s.pending?"waiting for the stores module":s.ok?"written":`not all written${s.error?`: ${s.error}`:""}`}`);for(let o of s.steps)e.out.line(` ${o.op} ${o.store_id}${o.state?`: ${o.state}`:""}${o.error?` \u2014 ${o.error}`:""}`)}let a=t.apple.hash||t.google.hash;t.status==="planned"&&a&&(e.out.line(` hash: ${a}`),e.out.line(t.apple.hash?"The App Store part is written only when confirmed (the stores module writes it to App Store Connect):":"The Google Play part is written only when confirmed (the stores module writes it to Google Play):"),e.out.line(` palbase iap:catalog:confirm ${t.id} --hash ${a}`))}var ZN={name:"iap:catalog:plan",summary:"plan bringing the stores to the catalog's newest revision, store by store, before anything is written",usage:"[<plan id>]",details:["A plan is confirmed with its hash (iap:catalog:confirm); the App Store and Google Play parts are written by the stores module once their accounts are connected.","With a plan's id it makes none: it shows that plan, and once confirmed what each store answered \u2014 the state of every product written, and a price that changes on a later day."],args:{min:0,max:1},scope:"environment",async run(e){let t=await f(e),n=e.args.length===0?await g(e,t,"POST","/iap/catalog/plans",void 0,D()):await g(e,t,"GET",`/iap/catalog/plans/${R(Kc(e))}`);e.out.result(n,()=>YN(e,n))}},QN={name:"iap:catalog:confirm",summary:"write a plan to App Store Connect and Google Play through the stores module: it names the hash of the plan that was shown, and is asked about first",usage:"<plan id> --hash <hash>",details:["What it writes is shown, then asked about \u2014 in every environment: a product made in App Store Connect or Google Play never goes away. -y confirms without asking."],args:{min:1,max:1},flags:{hash:{type:"string",value:"hash",description:"the hash the plan printed"}},scope:"environment",async run(e){let t=await f(e),n=Kc(e),s=e.flags.hash;if(s===void 0||s.trim()==="")throw h("--hash is the hash iap:catalog:plan printed: a confirmation names the plan it saw");let a=await g(e,t,"GET",`/iap/catalog/plans/${R(n)}`);if(a.status!=="planned")throw new b("plan_not_open",`the plan ${n} is ${a.status}: only a planned one is confirmed`,{hint:"make a new one: palbase iap:catalog:plan"});let o=a.apple.steps.length,i=a.google.steps.length;if(a.apple.hash&&o>0)await k(e,t,`write ${o} step(s) of revision ${a.revision} to App Store Connect${i>0?`, and ${i} to Google Play`:""}`,"It makes the products in App Store Connect, where a product id never goes away");else if(a.google.hash&&i>0)await k(e,t,`write ${i} step(s) of revision ${a.revision} to Google Play`,"It makes the products in Google Play, where a product id never goes away");else throw new b("nothing_to_confirm",`the plan ${n} has nothing for App Store Connect or Google Play to confirm`);let r=await g(e,t,"POST",`/iap/catalog/plans/${R(n)}/confirm`,{hash:s},D());if(e.out.result(r,()=>{e.out.line(`Plan ${r.id}: ${r.status}${r.applied_at?` (${Z(r.applied_at)})`:""}.`),r.status==="failed"&&r.error&&e.out.line(`It failed: ${r.error}`);let l=[o>0&&!r.apple_result?"App Store Connect":"",i>0&&(!r.google_result||r.google_result.pending)?"Google Play":""].filter(Boolean);l.length>0&&e.out.line(`The stores module is writing to ${l.join(" and ")}: palbase iap:catalog:plan ${r.id} shows what it wrote.`)}),r.status==="failed")throw new b("plan_failed",`the plan ${r.id} failed: a new plan picks up where it stopped`)}},eM={name:"iap:catalog:decline",summary:"decline a plan: its Stripe part is never written",usage:"<plan id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Kc(e);await k(e,t,`decline the plan ${n}`);let s=await g(e,t,"POST",`/iap/catalog/plans/${R(n)}/decline`,void 0,D());e.out.result(s,()=>e.out.line(`Declined the plan ${s.id}.`))}};function Wk(e){let t=e.args[0],n=Number(t);if(t===void 0||!Number.isInteger(n)||n<1)throw h("the revision's number is required (iap:catalog:revisions lists them)");return n}var tM={name:"iap:catalog:revisions",summary:"every revision the catalog was saved as, the newest first: who saved it, when, and when a plan of it was written to the stores",usage:"[--limit <n>] [--cursor <next>]",details:["iap:catalog:revision <n> reads one; iap:catalog:restore <n> puts it back as the next revision."],flags:{limit:{type:"string",value:"n",description:"revisions a page (default 50, at most 200)"},cursor:{type:"string",value:"next",description:"the next page, as the last one printed it"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams,s=we(e.flags.limit,"limit");s!==void 0&&n.set("limit",String(s)),e.flags.cursor!==void 0&&n.set("cursor",String(e.flags.cursor));let a=await g(e,t,"GET",`/iap/catalog/revisions${n.size?`?${n}`:""}`);e.out.result(a,()=>{if(a.revisions.length===0){e.out.line("No catalog yet: palbase iap:catalog:put --file catalog.json --revision 0");return}e.out.table(a.revisions,[{header:"revision",value:o=>`${o.revision}${o.current?" (now)":""}`},{header:"saved",value:o=>Z(o.created_at)},{header:"by",value:o=>o.created_by},{header:"products",value:o=>String(o.products)},{header:"entitlements",value:o=>String(o.entitlements)},{header:"offers",value:o=>String(o.offers)},{header:"written to stores",value:o=>Z(o.applied_at)}]),a.next_cursor&&e.out.line(`Older: palbase iap:catalog:revisions --cursor ${a.next_cursor}`)})}},nM={name:"iap:catalog:revision",summary:"the catalog as it was saved at a revision",usage:"<revision> [--out <catalog.json>]",details:["--out writes that revision's catalog to a file, as catalog:get --out writes the newest."],args:{min:1,max:1},flags:{out:{type:"string",value:"catalog.json",description:"write the revision's catalog to this file"}},scope:"environment",async run(e){let t=await f(e),n=Wk(e),s=await g(e,t,"GET",`/iap/catalog/revisions/${n}`),a=e.flags.out;if(a!==void 0){await qc(ji(e.io.cwd,a),`${JSON.stringify(s.catalog,null,2)}
11198
- `),e.out.result({file:a,revision:s.revision},()=>e.out.line(`Wrote revision ${s.revision} of the catalog to ${a}.`));return}e.out.result(s,()=>Uk(e,s))}},sM={name:"iap:catalog:restore",summary:"put an older revision of the catalog back, as its next revision; nothing is written to a store",usage:"<revision>",details:["It is saved as an edit is: checked against today's rules, what customers bought kept in it \u2014 a revision that breaks one is refused with every problem.","The stores are brought to it by a plan, confirmed: palbase iap:catalog:plan."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Wk(e),s=await g(e,t,"GET","/iap/catalog");await k(e,t,`put revision ${n} of the catalog back, over revision ${s.revision}`);let a;try{a=await g(e,t,"POST",`/iap/catalog/revisions/${n}/restore`,void 0,{"if-match":qk(s.revision),...D()})}catch(o){if(o instanceof G&&o.status===412)throw new b("catalog_changed",`the catalog moved past revision ${s.revision} while this ran \u2014 nothing was saved`,{hint:`run it again: palbase iap:catalog:restore ${n}`});Gc(e,o,`revision ${n} was not put back`)}e.out.result(a,()=>{e.out.line(`Saved revision ${n}'s catalog as revision ${a.revision}.`),e.out.line("Bring the stores to it: palbase iap:catalog:plan")})}};function Dc(e){return e===null?"for life":Z(e)}function aM(e,t){e.out.line(`Customer ${t.customer_id}${t.guest?" (guest)":""}: revision ${t.revision}, as of ${Z(t.requested_at)}`);let n=Object.entries(t.entitlements).sort(([s],[a])=>s<a?-1:s>a?1:0);e.out.line(n.length===0?"No entitlement.":"Entitlements:"),e.out.table(n,[{header:"entitlement",value:([s])=>s},{header:"active",value:([,s])=>s.active?"yes":"no"},{header:"until",value:([,s])=>Dc(s.expires_at)},{header:"store",value:([,s])=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"renews",value:([,s])=>s.will_renew?"yes":"no"},{header:"product",value:([,s])=>s.product??"\u2014"}]),t.subscriptions.length>0&&(e.out.line("Subscriptions:"),e.out.table(t.subscriptions,[{header:"product",value:s=>`${s.product??"\u2014"}${s.plan?`/${s.plan}`:""}`},{header:"store",value:s=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"state",value:s=>s.state},{header:"until",value:s=>Dc(s.expires_at)},{header:"renews",value:s=>s.will_renew?"yes":"no"},{header:"id",value:s=>s.id}])),t.purchases.length>0&&(e.out.line("Purchases:"),e.out.table(t.purchases,[{header:"product",value:s=>s.product??"\u2014"},{header:"store",value:s=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"state",value:s=>s.state},{header:"bought",value:s=>Z(s.purchased_at)}])),t.credits.length>0&&(e.out.line("Credits:"),e.out.table(t.credits,[{header:"credit",value:s=>s.currency},{header:"balance",value:s=>String(s.balance)},{header:"available",value:s=>String(s.available)},{header:"held",value:s=>String(s.reserved)},{header:"owed",value:s=>String(s.debt)},{header:"next expiry",value:s=>Z(s.next_expiry)}])),t.limits.length>0&&(e.out.line("Limits:"),e.out.table(t.limits,[{header:"limit",value:s=>s.limit},{header:"used",value:s=>`${s.used} of ${s.max}`},{header:"held",value:s=>String(s.reserved)},{header:"left",value:s=>String(s.remaining)},{header:"resets",value:s=>Z(s.resets_at)}]))}var oM={name:"iap:customer:get",summary:"what a customer has, whatever store they bought in: entitlements, subscriptions, purchases, credits and limits",usage:"<customer id>",details:["The customer is the user's id; a guest merged into an account answers as the account."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=await g(e,t,"GET",`/iap/customers/${R(n)}`);e.out.result(s,()=>aM(e,s))}};function Uc(e){let t=e.flags.until,n=e.flags.for;if(t!==void 0&&n!==void 0)throw h("--until or --for, not both");if(t!==void 0){let s=Date.parse(t);if(!Number.isFinite(s))throw h(`--until ${t}: a date or time (2026-12-31, 2026-12-31T18:00:00Z)`);if(s<=e.io.now())throw h(`--until ${t} is not in the future`);return new Date(s).toISOString()}if(n!==void 0){let s=/^([1-9][0-9]{0,4})([hdw])$/.exec(n.trim());if(!s)throw h(`--for ${n}: a number of hours, days or weeks (12h, 30d, 2w)`);let a=Number(s[1])*{h:1,d:24,w:168}[s[2]];return new Date(e.io.now()+a*36e5).toISOString()}}var iM={name:"iap:customer:grant",summary:"give a customer one of the catalog's entitlements, for a while or for life, saying why \u2014 a promotion, a support case, a tester",usage:"<customer id> <entitlement> --reason <why> [--for 30d | --until <date>]",details:["The reason is the record. Without --for or --until the grant is for life. It prints the grant's id: iap:customer:revoke ends it.","A customer not seen before is made; nothing is charged, in any store."],args:{min:2,max:2},flags:{reason:{type:"string",value:"why",description:"why it is given (500 characters at most): the record"},for:{type:"string",value:"span",description:"how long: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when it ends (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the entitlement"),a=e.flags.reason?.trim();if(!a)throw h("--reason says why it is given: the grant's record");if(a.length>500)throw h("--reason is 500 characters at most");let o=Uc(e);await k(e,t,`give ${n} ${s} ${o?`until ${Z(o)}`:"for life"}`);let i={entitlement:s,reason:a,...o?{expires_at:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/grants`,i,D());e.out.result(r,()=>{e.out.line(`Gave ${r.customer_id} ${r.entitlement} ${r.expires_at?`until ${Z(r.expires_at)}`:"for life"} (grant ${r.id}).`),e.out.line(`End it: palbase iap:customer:revoke ${r.customer_id} ${r.id}`)})}},rM={name:"iap:customer:revoke",summary:"end a granted entitlement now; what the customer bought is not touched",usage:"<customer id> <grant id>",details:["The grant's id is the one iap:customer:grant printed. The entitlement stays on while a purchase still gives it."],args:{min:2,max:2},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the grant's id");await k(e,t,`end the grant ${s} of ${n}`),await g(e,t,"DELETE",`/iap/customers/${R(n)}/grants/${R(s)}`,void 0,D()),e.out.result({revoked:s,customer_id:n},()=>e.out.line(`Ended the grant ${s} of ${n}.`))}};function lM(e,t){return e==null?"":`${(e/1e6).toFixed(2)}${t?` ${t}`:""}`}var pM={name:"iap:customers",summary:"find customers by what a person writing in has: their id, an id their store gave a purchase, or the email they bought with on the web",usage:"<query>",details:["The query is a customer's id; Apple's original transaction id or any transaction id; a Google order id (GPA.\u2026, a renewal's ..N or not); Stripe's subscription, payment intent, invoice or customer id; or an email address.","An email finds a buyer who had no account at checkout, matched whole (case aside): the address is never kept, an HMAC of it is."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"what to look for (an id, a store id, an email)"),s=await g(e,t,"GET",`/iap/customers?q=${encodeURIComponent(n)}`);e.out.result(s,()=>{if(s.customers.length===0){e.out.line(`No customer found by ${s.query}.`);return}e.out.table(s.customers,[{header:"customer",value:o=>o.customer_id??"\u2014 (not redeemed yet)"},{header:"found by",value:o=>o.matched_by},{header:"store",value:o=>o.store?`${o.store}${o.is_sandbox?" (sandbox)":""}`:""},{header:"product",value:o=>o.product??""},{header:"since",value:o=>Z(o.at)}]);let a=s.customers.find(o=>o.customer_id);a&&e.out.line(`What happened to them: palbase iap:customer:history ${a.customer_id}`)})}},dM={name:"iap:customer:history",summary:"what happened to a customer, the newest first: payments, refunds, cancellations, grants, credits, moves \u2014 with who did each, and why",usage:"<customer id> [--limit <n>] [--cursor <next>]",details:["Credits spent are the credits' own entries; here are the credits given, taken back, expired and forgiven."],args:{min:1,max:1},flags:{limit:{type:"string",value:"n",description:"events a page (default 50, at most 200)"},cursor:{type:"string",value:"next",description:"the next page, as the last one printed it"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=new URLSearchParams,a=we(e.flags.limit,"limit");a!==void 0&&s.set("limit",String(a)),e.flags.cursor!==void 0&&s.set("cursor",String(e.flags.cursor));let o=await g(e,t,"GET",`/iap/customers/${R(n)}/history${s.size?`?${s}`:""}`);e.out.result(o,()=>{e.out.line(`History of ${o.customer_id}, the newest first:`),o.events.length===0&&e.out.line("Nothing yet."),e.out.table(o.events,[{header:"when",value:i=>Z(i.at)},{header:"what",value:i=>i.kind},{header:"store",value:i=>i.store?`${i.store}${i.is_sandbox?" (sandbox)":""}`:""},{header:"product",value:i=>[i.product,i.plan].filter(Boolean).join("/")||i.entitlement||""},{header:"amount",value:i=>i.credits?`${i.credits.delta>0?"+":""}${i.credits.delta} ${i.credits.currency}`:lM(i.amount_micros,i.currency)},{header:"why",value:i=>i.credits?[i.credits.kind,i.reason].filter(Boolean).join(": "):i.reason??""},{header:"by",value:i=>i.actor}]),o.next_cursor&&e.out.line(`Older: palbase iap:customer:history ${o.customer_id} --cursor ${o.next_cursor}`)})}},cM={name:"iap:customer:grants",summary:"the entitlements given a customer \u2014 active, ended and revoked \u2014 with each grant's id, reason and who gave it",usage:"<customer id>",details:["End one: palbase iap:customer:revoke <customer id> <grant id>."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=await g(e,t,"GET",`/iap/customers/${R(n)}/grants`);e.out.result(s,()=>{if(s.grants.length===0){e.out.line(`${s.customer_id} was given nothing.`);return}e.out.table(s.grants,[{header:"grant",value:a=>a.id},{header:"entitlement",value:a=>a.entitlement},{header:"active",value:a=>a.active?"yes":"no"},{header:"ends",value:a=>a.revoked_at?`revoked ${Z(a.revoked_at)}`:a.expires_at?Z(a.expires_at):"for life"},{header:"why",value:a=>a.reason},{header:"by",value:a=>a.revoked_by?`${a.granted_by}, revoked by ${a.revoked_by}`:a.granted_by}])})}};function Wc(e){let t=e.flags.note?.trim();if(t!==void 0&&t.length>500)throw h("--note is 500 characters at most");return t||void 0}function Fc(e,t,n){let s=t.subscription;e.out.line(`${n} (${t.action.store}, by ${t.action.actor}).`),e.out.line(`${s.product??"\u2014"}${s.plan?`/${s.plan}`:""}: ${s.state}, ${s.active?"on":"off"} until ${Dc(s.expires_at)}, ${s.will_renew?"renews":"does not renew"}.`)}var Bc={note:{type:"string",value:"why",description:"what support writes of it (500 characters at most): the record"}},uM={name:"iap:customer:extend",summary:"move a customer's subscription renewal days later, for free: the App Store's extension, Google Play's deferral, Stripe's next charge moved",usage:"<customer id> <subscription id> --days <1-90> --reason customer_satisfaction|service_issue|other [--note <why>]",details:["The subscription's id is the one iap:customer:get prints. The App Store extends a paid, active subscription, at most 90 days and twice a year.","The store is asked again after: the new expiry is printed, and the customer's history keeps it with who did it."],args:{min:2,max:2},flags:{days:{type:"string",value:"n",description:"how many days (1 to 90)"},reason:{type:"string",value:"why",description:"customer_satisfaction, service_issue or other: as the App Store asks it"},...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=we(e.flags.days,"days");if(a===void 0||a<1||a>90)throw h("--days is 1 to 90");let o=e.flags.reason;if(o!=="customer_satisfaction"&&o!=="service_issue"&&o!=="other")throw h("--reason is customer_satisfaction, service_issue or other");let i=Wc(e);await k(e,t,`extend ${n}'s subscription ${s} by ${a} day(s)`);let r={days:a,reason:o,...i?{note:i}:{}},l=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/extend`,r,D());e.out.result(l,()=>Fc(e,l,`Extended ${n}'s subscription by ${a} day(s)`))}},mM={name:"iap:customer:refund",summary:"refund a customer's subscription \u2014 its latest payment, or what is left of its period \u2014 and end it now: Google Play and Stripe",usage:"<customer id> <subscription id> --mode full|prorated [--note <why>]",details:["The customer's access ends as it answers. The App Store decides its own refunds: the customer asks Apple, which asks the app what they used \u2014 Palbase answers it when they consented in the app."],args:{min:2,max:2},flags:{mode:{type:"string",value:"kind",description:"full: the latest payment; prorated: what is left of its period"},...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=e.flags.mode;if(a!=="full"&&a!=="prorated")throw h("--mode is full (the latest payment) or prorated (what is left of its period)");let o=Wc(e);await k(e,t,`refund ${n}'s subscription ${s} (${a}) and end it now`);let i={mode:a,...o?{note:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/refund`,i,D());e.out.result(r,()=>Fc(e,r,`Refunded ${n}'s subscription (${a}); it ended`))}},gM={name:"iap:customer:cancel",summary:"turn a customer's subscription renewal off: it ends at its period's end, the customer keeping what they paid for \u2014 Google Play and Stripe",usage:"<customer id> <subscription id> [--note <why>]",details:["An App Store subscription's renewal is the customer's to turn off (Settings \u203A Apple ID \u203A Subscriptions)."],args:{min:2,max:2},flags:{...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=Wc(e);await k(e,t,`turn the renewal of ${n}'s subscription ${s} off`);let o=a?{note:a}:{},i=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/cancel`,o,D());e.out.result(i,()=>Fc(e,i,`Turned the renewal of ${n}'s subscription off`))}},Fk={source:{type:"string",value:"kind",description:"support (the default) or promotion"}};function Bk(e){let t=e.flags.source??"support";if(t!=="support"&&t!=="promotion")throw h("--source is support or promotion");return t}function Ul(e,t){let n=e.flags.reason?.trim();if(!n)throw h(`--reason says why ${t}: the record`);if(n.length>500)throw h("--reason is 500 characters at most");return n}function Jk(e,t,n){let s=Je(e,t,n),a=Number(s);if(!Number.isInteger(a)||a<1)throw h(`${n} is a whole number above 0: ${s}`);return a}var hM={name:"iap:customer:credits",summary:"a customer's credit entries, the newest first: given, spent, taken back, expired, forgiven \u2014 with who did each, and why",usage:"<customer id> [--credits <key>] [--limit <n>] [--cursor <next>]",args:{min:1,max:1},flags:{credits:{type:"string",value:"key",description:"one of the catalog's credits alone"},limit:{type:"string",value:"n",description:"entries a page (default 50, at most 200)"},cursor:{type:"string",value:"next",description:"the next page, as the last one printed it"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=new URLSearchParams;e.flags.credits!==void 0&&s.set("credits",String(e.flags.credits));let a=we(e.flags.limit,"limit");a!==void 0&&s.set("limit",String(a)),e.flags.cursor!==void 0&&s.set("cursor",String(e.flags.cursor));let o=await g(e,t,"GET",`/iap/customers/${R(n)}/credits/entries${s.size?`?${s}`:""}`);e.out.result(o,()=>{o.entries.length===0&&e.out.line(`${n} has no credit entry.`),e.out.table(o.entries,[{header:"when",value:i=>Z(i.created_at)},{header:"credit",value:i=>i.currency},{header:"what",value:i=>i.kind},{header:"amount",value:i=>`${i.delta>0?"+":""}${i.delta}`},{header:"owed",value:i=>i.debt_delta?`${i.debt_delta>0?"+":""}${i.debt_delta}`:""},{header:"why",value:i=>i.reason??""},{header:"by",value:i=>i.actor??""}]),o.next_cursor&&e.out.line(`Older: palbase iap:customer:credits ${n} --cursor ${o.next_cursor}`)})}},yM={name:"iap:customer:credits:give",summary:"give a customer credits, saying why \u2014 a support case, a promotion \u2014 for a while or until spent",usage:"<customer id> <credits> <amount> --reason <why> [--source support|promotion] [--for 30d | --until <date>]",details:["What they owe is paid first from what is given. Nothing is charged, in any store."],args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why they are given (500 characters at most): the record"},...Fk,for:{type:"string",value:"span",description:"how long they last: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when they expire (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the credits (the catalog's key)"),a=Jk(e,2,"the amount"),o=Ul(e,"they are given"),i=Bk(e),r=Uc(e);await k(e,t,`give ${n} ${a} ${s}${r?` until ${Z(r)}`:""}`);let l={credits:s,amount:a,source:i,reason:o,...r?{expires_at:r}:{}},p=await g(e,t,"POST",`/iap/customers/${R(n)}/credits`,l,D());e.out.result(p,()=>e.out.line(`Gave ${n} ${p.original} ${p.currency}${p.expires_at?` until ${Z(p.expires_at)}`:""}; ${p.remaining} left of it.`))}},fM={name:"iap:customer:credits:forgive",summary:"forgive what a customer owes of a credit \u2014 all of it, or an amount \u2014 saying why",usage:"<customer id> <credits> --reason <why> [--amount <n>]",args:{min:2,max:2},flags:{reason:{type:"string",value:"why",description:"why it is forgiven (500 characters at most): the record"},amount:{type:"string",value:"n",description:"how much of it (default: all they owe)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the credits (the catalog's key)"),a=Ul(e,"it is forgiven"),o=we(e.flags.amount,"amount");if(o===0)throw h("--amount is above 0");await k(e,t,`forgive ${o??"all"} of what ${n} owes of ${s}`);let i={credits:s,reason:a,...o!==void 0?{amount:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/credits/forgive`,i,D());e.out.result(r,()=>e.out.line(`Forgave ${r.forgiven} ${r.credits} ${n} owed; they owe ${r.debt}, ${r.available} available.`))}};function Jc(e,t,n){e.out.line(`${t}: ${n.used} of ${n.max} used, ${n.remaining} left, resets ${Z(n.resets_at)}.`)}var bM={name:"iap:customer:limit:set",summary:"set a customer's own maximum of a limit \u2014 above or below the catalog's \u2014 saying why, for a while or until cleared",usage:"<customer id> <limit> <max> --reason <why> [--for 30d | --until <date>]",args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why (500 characters at most): the record"},for:{type:"string",value:"span",description:"how long: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when it ends (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)"),a=Je(e,2,"the maximum"),o=Number(a);if(!Number.isInteger(o)||o<0)throw h(`the maximum is a whole number: ${a}`);let i=Ul(e,"it is set"),r=Uc(e);await k(e,t,`set ${n}'s ${s} to ${o}${r?` until ${Z(r)}`:""}`);let l={max:o,reason:i,...r?{expires_at:r}:{}},p=await g(e,t,"PUT",`/iap/customers/${R(n)}/limits/${R(s)}`,l,D());e.out.result(p,()=>Jc(e,`Set ${n}'s ${p.limit} to ${p.max}`,p))}},wM={name:"iap:customer:limit:clear",summary:"clear a customer's own maximum of a limit: the catalog's counts again",usage:"<customer id> <limit>",args:{min:2,max:2},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)");await k(e,t,`clear ${n}'s own ${s}`);let a=await g(e,t,"DELETE",`/iap/customers/${R(n)}/limits/${R(s)}`,void 0,D());e.out.result(a,()=>Jc(e,`Cleared ${n}'s own ${a.limit}; the catalog's ${a.max} counts`,a))}},vM={name:"iap:customer:limit:give",summary:"give a customer more of a limit for its current period, saying why \u2014 a gift on top of their maximum",usage:"<customer id> <limit> <amount> --reason <why> [--source support|promotion]",args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why it is given (500 characters at most): the record"},...Fk},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)"),a=Jk(e,2,"the amount"),o=Ul(e,"it is given"),i=Bk(e);await k(e,t,`give ${n} ${a} more ${s} this period`);let r={amount:a,source:i,reason:o},l=await g(e,t,"POST",`/iap/customers/${R(n)}/limits/${R(s)}/grants`,r,D());e.out.result(l,()=>Jc(e,`Gave ${n} ${a} more ${l.limit}`,l))}};function kM(e){let t=n=>/^[\w./@:-]+$/.test(n)?n:JSON.stringify(n);return`${e.global.project!==void 0?` -P ${t(e.global.project)}`:""}${e.global.env!==void 0?` -E ${t(e.global.env)}`:""}`}async function Hc(e,t){let n=(await Vt(e,t.project_id)).filter(r=>r.deleted_at===null),s=n.filter(r=>r.platform==="ios"),a=e.flags.app;if(a!==void 0){let r=un(n,a);if(r.platform!=="ios")throw h(`${r.slug} is a ${r.platform} app: a StoreKit configuration is an iOS app's`,`the project's iOS apps: ${s.map(l=>l.slug).join(", ")||"none"}`);return r}let o=(await nl(e.io.cwd))?.apps.filter(r=>r.platform==="ios").map(r=>r.id)??[],i=s.filter(r=>o.includes(r.id));if(i.length===1)return i[0];if(s.length===1)return s[0];throw s.length===0?new b("no_ios_app",`${t.project_name} has no iOS app`,{hint:"register it: palbase apps:create ios <name> --team-id <team id>"}):h("name the iOS app the file is for: --app <app>",`the project's iOS apps: ${s.map(r=>r.slug).join(", ")}`)}function _M(e,t){let n=BN(e.io.cwd,ji(e.io.cwd,t)).split(JN).join("/");if(!n.startsWith(`${ue}/`)||n.split("/").includes(".."))throw h(`--out ${t}: the file goes under ${ue}/, as the CLI writes nothing else in the checkout`,`palbase iap:storekit --out ${ue}/<name>.storekit`);if(!n.endsWith(".storekit"))throw h(`--out ${t}: Xcode takes a StoreKit configuration by its .storekit extension`);return n}function SM(e){let t=new Map;for(let n of e.products)for(let s of n.channels.ios?.plans??[])t.set(s.price.currency.toUpperCase(),(t.get(s.price.currency.toUpperCase())??0)+1);return[...t].sort(([n,s],[a,o])=>o-s||(n<a?-1:1))[0]?.[0]}var $M={name:"iap:storekit",summary:"an Xcode StoreKit configuration of the environment's iOS products, under palbase/: a build Xcode runs buys them with no App Store",usage:"[--app <app>] [--out <palbase/\u2026.storekit>] [--storefront <code>]",details:["Each plan is the App Store product its store id names, with its text in every language the catalog has and its price; a subscription is in its group, at its tier's level, with its introductory offer and the catalog's offers on it as promotional offers (a grant has no store).","Prices are in the storefront's currency: the catalog's price, or the amount set by hand in that currency. The storefront is --storefront, else the one the file has, else the one the catalog's currency is the App Store's own price in (USD: USA, EUR: Germany, TRY: Turkey \u2026), else USA.","Made again, the file is made whole from the catalog \u2014 the same catalog, the same file \u2014 keeping the test settings Xcode's Editor menu wrote in it. Nothing outside palbase/ is written: Xcode is pointed at the file in the scheme."],flags:{app:{type:"string",value:"app",description:"the iOS app it is for (default: the one this checkout syncs, or the project's only one)"},out:{type:"string",value:"palbase/\u2026.storekit",description:"where under palbase/ (default: palbase/environments/<env>/<app>.storekit)"},storefront:{type:"string",value:"code",description:"the App Store storefront prices are in, by its three letters (USA, DEU, TUR, GBR, JPN \u2026)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.storefront?.trim().toUpperCase();if(n!==void 0&&!lo.has(n))throw h(`--storefront ${e.flags.storefront}: not an App Store storefront`,"a storefront is three letters, its country's ISO 3166-1 code: USA, DEU, TUR, GBR, JPN \u2026");let s=await Hc(e,t);if(!/^[A-Za-z][A-Za-z0-9-]{0,38}$/.test(t.env_slug))throw new b("unexpected_answer",`the environment's slug ${JSON.stringify(t.env_slug)} is not one`);if(!/^[a-z][a-z0-9-]{0,38}[a-z0-9]$/.test(s.slug))throw new b("unexpected_answer",`the project answered app ${JSON.stringify(s.slug)}, which is not one`);let a=e.flags.out!==void 0?_M(e,e.flags.out):`${ue}/environments/${t.env_slug}/${s.slug}.storekit`,o=await g(e,t,"GET","/iap/offerings?channel=ios");if(!o.products.some(E=>(E.channels.ios?.plans.length??0)>0))throw new b("nothing_on_ios",`${t.env_name}'s catalog sells nothing on iOS yet: there is no product for Xcode to sell`,{hint:"give a product channels.ios in the catalog (palbase iap:catalog:get --out catalog.json, then iap:catalog:put)"});let i=await Be(e.io.cwd,a),r,l;try{r=await zc(i,"utf8");let E=JSON.parse(r);typeof E.settings=="object"&&E.settings!==null&&!Array.isArray(E.settings)&&(l=E.settings)}catch{}let p=typeof l?._storefront=="string"&&lo.has(l._storefront)?l._storefront:void 0,d=SM(o);n??=p??(d!==void 0?Gw(d):void 0)??"USA";let{catalog:u}=await g(e,t,"GET","/iap/catalog"),m=Ww(o,{seed:`${t.env_ref}/${s.id}`,storefront:n,settings:l,offers:u.offers??[]}),y=r!==m.text;y&&(await UN(FN(i),{recursive:!0}),await Be(e.io.cwd,a),await qc(i,m.text));for(let E of m.notes)e.out.warn(E);let w=t.env_slug===Mt,v=kM(e),P=[`In Xcode: Product \u203A Scheme \u203A Edit Scheme\u2026 \u203A Run \u203A Options \u203A StoreKit Configuration \u2014 choose ${a} (not listed yet? add it from that menu).`,w?`${t.project_name} \u203A ${t.env_name} is the project's production environment: it never takes a purchase Xcode signs. Make the file for a test environment (-E <env>) to see a purchase reach the server.`:`Then select the file in Xcode, choose Editor \u203A Save Public Certificate, and let ${t.env_name} take the purchases Xcode signs: palbase iap:apple:xcode-certificate <the saved .cer file>${v}`,`Run the app and buy: Xcode sells the products itself, nothing goes to the App Store. After the catalog changes: palbase iap:storekit${e.flags.app!==void 0?` --app ${s.slug}`:""}${e.flags.out!==void 0?` --out ${a}`:""}${v}`],A=m.counts,T=[A.subscriptions>0?`${A.subscriptions} subscription${A.subscriptions===1?"":"s"} in ${A.groups} group${A.groups===1?"":"s"}`:"",A.products>0?`${A.products} in-app purchase${A.products===1?"":"s"}`:"",A.non_renewing>0?`${A.non_renewing} non-renewing subscription${A.non_renewing===1?"":"s"}`:""].filter(E=>E!=="").join(", ");e.out.result({file:a,app:s.slug,environment:t.env_slug,revision:o.revision,storefront:m.storefront,currency:m.currency,locale:m.locale,...A,written:y,next:P},()=>{e.out.line(`${y?"Wrote":"Up to date:"} ${a} \u2014 ${T}, priced in ${m.currency} (storefront ${m.storefront}), catalog revision ${o.revision}.`),e.out.line(""),P.forEach((E,C)=>e.out.line(`${C+1}. ${E}`))})}},AM=/^SubscriptionKey_([A-Z0-9]{10})\.p8$/,RM=/^AuthKey_[A-Z0-9]{10}\.p8$/,PM=8192,jM=16384;function Hk(e,t){if(!t.connected)e.out.line("No In-App Purchase key is connected: the App Store's purchases are not taken."),e.out.line("Connect one: palbase iap:apple:connect --key-file SubscriptionKey_<KEYID>.p8");else{e.out.line(`In-App Purchase key ${t.key_id??"?"} (issuer ${t.issuer_id??"?"}) for ${t.bundle_id??"?"}${t.app_apple_id?`, Apple ID ${t.app_apple_id}`:", its Apple ID not known yet"}`),e.out.line(`status: ${t.status??"not checked"}${t.checked_at?` (checked ${Z(t.checked_at)})`:""}`);let s=t.notifications;s&&e.out.line(`notifications: ${s.url} \u2014 ${s.bound?`bound ${Z(s.bound_at)}`:`not bound${s.error?`: ${s.error}`:""}`}; Apple's TEST notification ${s.verified_at?`arrived ${Z(s.verified_at)}`:"not arrived yet"}`),t.connected_at&&e.out.line(`connected ${Z(t.connected_at)}${t.connected_by?` by ${t.connected_by}`:""}`),t.action&&e.out.line(`To do: ${t.action}`)}let n=t.xcode_certificate;e.out.line(n?`Xcode's StoreKit Testing purchases: taken, signed with ${n.subject} until ${Z(n.not_after)} (sha256 ${n.fingerprint.slice(0,16)}\u2026)`:"Xcode's StoreKit Testing purchases: not taken (palbase iap:apple:xcode-certificate <file> takes them)")}var TM={name:"iap:apple",summary:"the environment's App Store connection: the In-App Purchase key, where the App Store reports, whether Xcode's purchases are taken",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/iap/apple");e.out.result(n,()=>Hk(e,n))}};function EM(e,t){let n=e.environments.find(s=>s.ref===t.env_ref)?.ios?.bundle;if(n===void 0)throw new b("app_not_in_environment",`${e.slug} is not set in ${t.env_name}: the key is connected for the app's bundle there`,{hint:`palbase apps:env:set ${e.slug} -E ${t.env_slug} --bundle <bundle id>`});return n}var CM={name:"iap:apple:connect",summary:"connect an In-App Purchase key for an iOS app: it goes from this computer straight to the environment, never through Studio",usage:"--key-file <SubscriptionKey_KEYID.p8> [--key-id <KEYID>] [--issuer-id <issuer id>] [--app <app>] | --print-link",details:["App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase makes the key (SubscriptionKey_<KEYID>.p8) and shows the Issuer ID \u2014 the team's, the same as its App Store Connect API keys': left out, the one stores:apple connected is taken.","The environment verifies the app's purchases and reads its subscriptions with it, and has the stores module point the App Store's notifications at the environment.","Studio is asked for a one-time grant alone; the key is posted with it to the environment's own address. --print-link prints a link that takes the key in a browser instead."],flags:{"key-file":{type:"string",value:"SubscriptionKey_KEYID.p8",description:"the .p8 file Apple gave when the key was made"},"key-id":{type:"string",value:"KEYID",description:"the key's id (default: from the file's name)"},"issuer-id":{type:"string",value:"issuer id",description:"the team's issuer id (default: the connected App Store Connect key's)"},app:{type:"string",value:"app",description:"the iOS app (default: the one this checkout syncs, or the project's only one)"},"print-link":{type:"boolean",description:"only print a link that takes the key in a browser (valid 30 minutes, once)"}},scope:"environment",async run(e){let t=await f(e);if(e.flags["print-link"]===!0){if(e.flags["key-file"]!==void 0)throw h("--print-link or --key-file, not both");await k(e,t,"make a link that connects an In-App Purchase key");let y=await g(e,t,"POST","/iap/apple/grants",void 0,D());mn(e,t,y.connect_url,"the connect link"),e.out.result({connect_url:y.connect_url,expires_at:y.expires_at},()=>{e.out.line(y.connect_url),e.out.note(`Open it in a browser, pick the app and the .p8 file; it works once, until ${Z(y.expires_at)}.`)});return}let n=e.flags["key-file"];if(n===void 0)throw h("--key-file names the In-App Purchase key's .p8 file","or --print-link for a link a browser opens");let s=WN(n),a=e.flags["key-id"];if(a===void 0){if(RM.test(s))throw h(`${s} is an App Store Connect API key (palbase stores:apple:connect takes it): this is the In-App Purchase key, SubscriptionKey_<KEYID>.p8`,"App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase makes one");if(a=AM.exec(s)?.[1],a===void 0)throw h(`--key-id is needed: ${s} is not named SubscriptionKey_<KEYID>.p8`)}let o;try{let y=ji(e.io.cwd,n);if((await zk(y)).size>PM)throw new b("not_a_key",`${n} is larger than a .p8 key`);o=await zc(y,"utf8")}catch(y){throw y instanceof b?y:new b("unreadable_file",`${n} could not be read: ${y instanceof Error?y.message:String(y)}`)}if(!o.includes("-----BEGIN PRIVATE KEY-----"))throw new b("not_a_key",`${n} is not a .p8 key (no "BEGIN PRIVATE KEY")`);let i=e.flags["issuer-id"]?.trim();if(i===void 0||i===""){let y=await g(e,t,"GET","/stores/apple");if(i=y.connected?y.issuer_id:void 0,i===void 0)throw h("--issuer-id is the team's issuer id (App Store Connect \u2192 Users and Access \u2192 Integrations): no App Store Connect key is connected to read it from")}let r=await Hc(e,t),l=EM(r,t);await k(e,t,`connect the In-App Purchase key ${a} for ${l}`);let p=await g(e,t,"POST","/iap/apple/grants",void 0,D()),d=mn(e,t,p.connect_url,"the connect link"),u={grant:p.grant,issuer_id:i,key_id:a,private_key:o,bundle_id:l},m=await wi(e,`${d}/iap/apple/connect`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(u)},"connecting the In-App Purchase key");e.out.result(m,()=>{e.out.line(`Connected key ${a} for ${l} to ${ee(t)}.`),Hk(e,m),e.out.line("Check what else the App Store needs: palbase iap:doctor")})}},OM={name:"iap:apple:disconnect",summary:"forget the environment's In-App Purchase key: the App Store's purchases and notifications are refused from then on (what was bought stays)",scope:"environment",async run(e){let t=await f(e);await k(e,t,"disconnect the In-App Purchase key"),await g(e,t,"DELETE","/iap/apple",void 0,D()),e.out.result({disconnected:!0},()=>e.out.line(`Disconnected the In-App Purchase key from ${ee(t)}.`))}};function Vk(e,t){if(t.service_account===void 0){e.out.line("The project has no Google Play connection: Palbase reads the app's purchases as the account your Play Console invites."),e.out.line("Connect it first: palbase stores:google:connect");return}if(e.out.line(`Play connection: ${t.service_account} (${t.play_status??"not checked"})`),!t.connected){e.out.line("Google Play purchases are not connected: palbase iap:google:connect --app <android app>");return}e.out.line(`app: ${t.package_name??"?"}`),e.out.line(`topic: ${t.topic??"?"} (Play Console \u203A Monetize with Play \u203A Monetization setup \u203A Real-time developer notifications)`),e.out.line(`notifications: ${t.notification_url??"?"} \u2014 Play's test notification ${t.verified_at?`arrived ${Z(t.verified_at)}`:"not arrived yet"}`),t.connected_at&&e.out.line(`connected ${Z(t.connected_at)}${t.connected_by?` by ${t.connected_by}`:""}`),t.action&&e.out.line(`To do: ${t.action}`)}var xM={name:"iap:google",summary:"the environment's Google Play purchases: the app they are made in, the topic its Play Console names, whether Play's test notification arrived",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/iap/google");e.out.result(n,()=>Vk(e,n))}};async function LM(e,t){let n=(await Vt(e,t.project_id)).filter(r=>r.deleted_at===null),s=n.filter(r=>r.platform==="android"),a=e.flags.app;if(a!==void 0){let r=un(n,a);if(r.platform!=="android")throw h(`${r.slug} is a ${r.platform} app: Google Play purchases are an Android app's`,`the project's Android apps: ${s.map(l=>l.slug).join(", ")||"none"}`);return r}let o=(await nl(e.io.cwd))?.apps.filter(r=>r.platform==="android").map(r=>r.id)??[],i=s.filter(r=>o.includes(r.id));if(i.length===1)return i[0];if(s.length===1)return s[0];throw s.length===0?new b("no_android_app",`${t.project_name} has no Android app`,{hint:"register it: palbase apps:create android <name>"}):h("name the Android app: --app <app>",`the project's Android apps: ${s.map(r=>r.slug).join(", ")}`)}var IM={name:"iap:google:connect",summary:"sell on Google Play in one of the project's Android apps: Palbase makes the app's notifications topic and has it pushed to this environment",usage:"[--app <app>]",details:["The project's Play connection (palbase stores:google:connect) is the account Palbase reads and acknowledges the app's purchases as: its Play Console invites it with View financial data and Manage orders and subscriptions.","Then, in Play Console: Monetize with Play \u203A Monetization setup \u203A Real-time developer notifications, the topic this prints, Save, and Send test notification \u2014 palbase iap:google says when it arrived."],flags:{app:{type:"string",value:"app",description:"the Android app (default: the one this checkout syncs, or the project's only one)"}},scope:"environment",async run(e){let t=await f(e),n=await LM(e,t);await k(e,t,`connect Google Play purchases for ${n.slug}`);let s={app_id:n.id},a=await g(e,t,"POST","/iap/google",s,D());e.out.result(a,()=>{e.out.line(`Google Play purchases connected for ${a.package_name??n.slug} in ${ee(t)}.`),Vk(e,a)})}},NM={name:"iap:google:disconnect",summary:"stop taking the environment's Google Play purchases: Play's notifications stop reaching it, and the app's reports are refused (what was bought stays)",scope:"environment",async run(e){let t=await f(e);await k(e,t,"disconnect Google Play purchases"),await g(e,t,"DELETE","/iap/google",void 0,D()),e.out.result({disconnected:!0},()=>e.out.line(`Disconnected Google Play purchases from ${ee(t)}.`))}};async function MM(e,t){let n=(await Vt(e,t.project_id)).find(s=>s.deleted_at===null&&s.environments.some(a=>a.ref===t.env_ref));return n===void 0?t.env_slug===Mt:(await e.studio.get(`/environments/${t.env_ref}/apps/${n.id}/config`)).environment.production}async function DM(e,t){let n;try{let o=ji(t,e);if((await zk(o)).size>jM)throw new b("not_a_certificate",`${e} is larger than Xcode's certificate`);n=await zc(o)}catch(o){throw o instanceof b?o:new b("unreadable_file",`${e} could not be read: ${o instanceof Error?o.message:String(o)}`)}let s;try{s=new KN(n)}catch{throw new b("not_a_certificate",`${e} is not a certificate`,{hint:"the one Xcode saves: select the .storekit file, then Editor \u203A Save Public Certificate"})}let a=n.toString("latin1");return{certificate:a.includes("-----BEGIN CERTIFICATE-----")?a.trim():n.toString("base64"),x509:s}}var zM={name:"iap:apple:xcode-certificate",summary:"take the purchases Xcode's StoreKit Testing signs with this certificate, as test purchases \u2014 never on production; --remove stops",usage:"<certificate.cer> | --remove",details:["Xcode saves the certificate: select the .storekit file (palbase iap:storekit makes it), then Editor \u203A Save Public Certificate.","From then on what the app reports signed with it \u2014 Xcode's own purchases, on a developer's Mac \u2014 is a test purchase of the environment, with or without an In-App Purchase key; nothing of it is asked of Apple. Set again, it replaces the one before.","The production environment takes only what the App Store signed: it is refused there."],args:{min:0,max:1},flags:{remove:{type:"boolean",description:"stop taking Xcode's purchases (those taken stay)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.remove===!0,s=e.args[0];if(n===(s!==void 0))throw h("name the certificate file, or --remove","palbase iap:apple:xcode-certificate StoreKitTestCertificate.cer");if(n){await k(e,t,"stop taking Xcode's StoreKit Testing purchases"),await g(e,t,"DELETE","/iap/apple/xcode-certificate",void 0,D()),e.out.result({removed:!0},()=>e.out.line(`${ee(t)} no longer takes Xcode's purchases; those it took stay.`));return}let a=await DM(s,e.io.cwd);if(await MM(e,t))throw new b("production_environment",`${t.project_name} \u203A ${t.env_name} is the project's production environment: it takes only purchases the App Store signed, never Xcode's`,{hint:"set the certificate on a test environment: palbase iap:apple:xcode-certificate <file> -E <env>"});await k(e,t,`take the purchases Xcode signs with ${a.x509.subject.replaceAll(`
11199
+ `),e.out.result({file:a,revision:s.revision},()=>e.out.line(`Wrote revision ${s.revision} of the catalog to ${a}.`));return}e.out.result(s,()=>Uk(e,s))}},sM={name:"iap:catalog:restore",summary:"put an older revision of the catalog back, as its next revision; nothing is written to a store",usage:"<revision>",details:["It is saved as an edit is: checked against today's rules, what customers bought kept in it \u2014 a revision that breaks one is refused with every problem.","The stores are brought to it by a plan, confirmed: palbase iap:catalog:plan."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Wk(e),s=await g(e,t,"GET","/iap/catalog");await k(e,t,`put revision ${n} of the catalog back, over revision ${s.revision}`);let a;try{a=await g(e,t,"POST",`/iap/catalog/revisions/${n}/restore`,void 0,{"if-match":qk(s.revision),...D()})}catch(o){if(o instanceof G&&o.status===412)throw new b("catalog_changed",`the catalog moved past revision ${s.revision} while this ran \u2014 nothing was saved`,{hint:`run it again: palbase iap:catalog:restore ${n}`});Gc(e,o,`revision ${n} was not put back`)}e.out.result(a,()=>{e.out.line(`Saved revision ${n}'s catalog as revision ${a.revision}.`),e.out.line("Bring the stores to it: palbase iap:catalog:plan")})}};function Dc(e){return e===null?"for life":Z(e)}function aM(e,t){e.out.line(`Customer ${t.customer_id}${t.guest?" (guest)":""}: revision ${t.revision}, as of ${Z(t.requested_at)}`);let n=Object.entries(t.entitlements).sort(([s],[a])=>s<a?-1:s>a?1:0);e.out.line(n.length===0?"No entitlement.":"Entitlements:"),e.out.table(n,[{header:"entitlement",value:([s])=>s},{header:"active",value:([,s])=>s.active?"yes":"no"},{header:"until",value:([,s])=>Dc(s.expires_at)},{header:"store",value:([,s])=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"renews",value:([,s])=>s.will_renew?"yes":"no"},{header:"product",value:([,s])=>s.product??"\u2014"}]),t.subscriptions.length>0&&(e.out.line("Subscriptions:"),e.out.table(t.subscriptions,[{header:"product",value:s=>`${s.product??"\u2014"}${s.plan?`/${s.plan}`:""}`},{header:"store",value:s=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"state",value:s=>s.state},{header:"until",value:s=>Dc(s.expires_at)},{header:"renews",value:s=>s.will_renew?"yes":"no"},{header:"seats",value:s=>s.quantity===void 0?"\u2014":s.renewal_quantity===void 0?String(s.quantity):`${s.quantity} (${s.renewal_quantity} at renewal)`},{header:"id",value:s=>s.id}])),t.purchases.length>0&&(e.out.line("Purchases:"),e.out.table(t.purchases,[{header:"product",value:s=>s.product??"\u2014"},{header:"store",value:s=>`${s.store}${s.is_sandbox?" (sandbox)":""}`},{header:"state",value:s=>s.state},{header:"bought",value:s=>Z(s.purchased_at)}])),t.credits.length>0&&(e.out.line("Credits:"),e.out.table(t.credits,[{header:"credit",value:s=>s.currency},{header:"balance",value:s=>String(s.balance)},{header:"available",value:s=>String(s.available)},{header:"held",value:s=>String(s.reserved)},{header:"owed",value:s=>String(s.debt)},{header:"next expiry",value:s=>Z(s.next_expiry)}])),t.limits.length>0&&(e.out.line("Limits:"),e.out.table(t.limits,[{header:"limit",value:s=>s.limit},{header:"used",value:s=>`${s.used} of ${s.max}`},{header:"held",value:s=>String(s.reserved)},{header:"left",value:s=>String(s.remaining)},{header:"resets",value:s=>Z(s.resets_at)}]))}var oM={name:"iap:customer:get",summary:"what a customer has, whatever store they bought in: entitlements, subscriptions, purchases, credits and limits",usage:"<customer id>",details:["The customer is the user's id; a guest merged into an account answers as the account."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=await g(e,t,"GET",`/iap/customers/${R(n)}`);e.out.result(s,()=>aM(e,s))}};function Uc(e){let t=e.flags.until,n=e.flags.for;if(t!==void 0&&n!==void 0)throw h("--until or --for, not both");if(t!==void 0){let s=Date.parse(t);if(!Number.isFinite(s))throw h(`--until ${t}: a date or time (2026-12-31, 2026-12-31T18:00:00Z)`);if(s<=e.io.now())throw h(`--until ${t} is not in the future`);return new Date(s).toISOString()}if(n!==void 0){let s=/^([1-9][0-9]{0,4})([hdw])$/.exec(n.trim());if(!s)throw h(`--for ${n}: a number of hours, days or weeks (12h, 30d, 2w)`);let a=Number(s[1])*{h:1,d:24,w:168}[s[2]];return new Date(e.io.now()+a*36e5).toISOString()}}var iM={name:"iap:customer:grant",summary:"give a customer one of the catalog's entitlements, for a while or for life, saying why \u2014 a promotion, a support case, a tester",usage:"<customer id> <entitlement> --reason <why> [--for 30d | --until <date>]",details:["The reason is the record. Without --for or --until the grant is for life. It prints the grant's id: iap:customer:revoke ends it.","A customer not seen before is made; nothing is charged, in any store."],args:{min:2,max:2},flags:{reason:{type:"string",value:"why",description:"why it is given (500 characters at most): the record"},for:{type:"string",value:"span",description:"how long: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when it ends (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the entitlement"),a=e.flags.reason?.trim();if(!a)throw h("--reason says why it is given: the grant's record");if(a.length>500)throw h("--reason is 500 characters at most");let o=Uc(e);await k(e,t,`give ${n} ${s} ${o?`until ${Z(o)}`:"for life"}`);let i={entitlement:s,reason:a,...o?{expires_at:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/grants`,i,D());e.out.result(r,()=>{e.out.line(`Gave ${r.customer_id} ${r.entitlement} ${r.expires_at?`until ${Z(r.expires_at)}`:"for life"} (grant ${r.id}).`),e.out.line(`End it: palbase iap:customer:revoke ${r.customer_id} ${r.id}`)})}},rM={name:"iap:customer:revoke",summary:"end a granted entitlement now; what the customer bought is not touched",usage:"<customer id> <grant id>",details:["The grant's id is the one iap:customer:grant printed. The entitlement stays on while a purchase still gives it."],args:{min:2,max:2},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the grant's id");await k(e,t,`end the grant ${s} of ${n}`),await g(e,t,"DELETE",`/iap/customers/${R(n)}/grants/${R(s)}`,void 0,D()),e.out.result({revoked:s,customer_id:n},()=>e.out.line(`Ended the grant ${s} of ${n}.`))}};function lM(e,t){return e==null?"":`${(e/1e6).toFixed(2)}${t?` ${t}`:""}`}var pM={name:"iap:customers",summary:"find customers by what a person writing in has: their id, an id their store gave a purchase, or the email they bought with on the web",usage:"<query>",details:["The query is a customer's id; Apple's original transaction id or any transaction id; a Google order id (GPA.\u2026, a renewal's ..N or not); Stripe's subscription, payment intent, invoice or customer id; or an email address.","An email finds a buyer who had no account at checkout, matched whole (case aside): the address is never kept, an HMAC of it is."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"what to look for (an id, a store id, an email)"),s=await g(e,t,"GET",`/iap/customers?q=${encodeURIComponent(n)}`);e.out.result(s,()=>{if(s.customers.length===0){e.out.line(`No customer found by ${s.query}.`);return}e.out.table(s.customers,[{header:"customer",value:o=>o.customer_id??"\u2014 (not redeemed yet)"},{header:"found by",value:o=>o.matched_by},{header:"store",value:o=>o.store?`${o.store}${o.is_sandbox?" (sandbox)":""}`:""},{header:"product",value:o=>o.product??""},{header:"since",value:o=>Z(o.at)}]);let a=s.customers.find(o=>o.customer_id);a&&e.out.line(`What happened to them: palbase iap:customer:history ${a.customer_id}`)})}},dM={name:"iap:customer:history",summary:"what happened to a customer, the newest first: payments, refunds, cancellations, grants, credits, moves \u2014 with who did each, and why",usage:"<customer id> [--limit <n>] [--cursor <next>]",details:["Credits spent are the credits' own entries; here are the credits given, taken back, expired and forgiven."],args:{min:1,max:1},flags:{limit:{type:"string",value:"n",description:"events a page (default 50, at most 200)"},cursor:{type:"string",value:"next",description:"the next page, as the last one printed it"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=new URLSearchParams,a=we(e.flags.limit,"limit");a!==void 0&&s.set("limit",String(a)),e.flags.cursor!==void 0&&s.set("cursor",String(e.flags.cursor));let o=await g(e,t,"GET",`/iap/customers/${R(n)}/history${s.size?`?${s}`:""}`);e.out.result(o,()=>{e.out.line(`History of ${o.customer_id}, the newest first:`),o.events.length===0&&e.out.line("Nothing yet."),e.out.table(o.events,[{header:"when",value:i=>Z(i.at)},{header:"what",value:i=>i.kind},{header:"store",value:i=>i.store?`${i.store}${i.is_sandbox?" (sandbox)":""}`:""},{header:"product",value:i=>[i.product,i.plan].filter(Boolean).join("/")||i.entitlement||""},{header:"amount",value:i=>i.credits?`${i.credits.delta>0?"+":""}${i.credits.delta} ${i.credits.currency}`:lM(i.amount_micros,i.currency)},{header:"why",value:i=>i.credits?[i.credits.kind,i.reason].filter(Boolean).join(": "):i.reason??""},{header:"by",value:i=>i.actor}]),o.next_cursor&&e.out.line(`Older: palbase iap:customer:history ${o.customer_id} --cursor ${o.next_cursor}`)})}},cM={name:"iap:customer:grants",summary:"the entitlements given a customer \u2014 active, ended and revoked \u2014 with each grant's id, reason and who gave it",usage:"<customer id>",details:["End one: palbase iap:customer:revoke <customer id> <grant id>."],args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=await g(e,t,"GET",`/iap/customers/${R(n)}/grants`);e.out.result(s,()=>{if(s.grants.length===0){e.out.line(`${s.customer_id} was given nothing.`);return}e.out.table(s.grants,[{header:"grant",value:a=>a.id},{header:"entitlement",value:a=>a.entitlement},{header:"active",value:a=>a.active?"yes":"no"},{header:"ends",value:a=>a.revoked_at?`revoked ${Z(a.revoked_at)}`:a.expires_at?Z(a.expires_at):"for life"},{header:"why",value:a=>a.reason},{header:"by",value:a=>a.revoked_by?`${a.granted_by}, revoked by ${a.revoked_by}`:a.granted_by}])})}};function Wc(e){let t=e.flags.note?.trim();if(t!==void 0&&t.length>500)throw h("--note is 500 characters at most");return t||void 0}function Fc(e,t,n){let s=t.subscription;e.out.line(`${n} (${t.action.store}, by ${t.action.actor}).`),e.out.line(`${s.product??"\u2014"}${s.plan?`/${s.plan}`:""}: ${s.state}, ${s.active?"on":"off"} until ${Dc(s.expires_at)}, ${s.will_renew?"renews":"does not renew"}.`)}var Bc={note:{type:"string",value:"why",description:"what support writes of it (500 characters at most): the record"}},uM={name:"iap:customer:extend",summary:"move a customer's subscription renewal days later, for free: the App Store's extension, Google Play's deferral, Stripe's next charge moved",usage:"<customer id> <subscription id> --days <1-90> --reason customer_satisfaction|service_issue|other [--note <why>]",details:["The subscription's id is the one iap:customer:get prints. The App Store extends a paid, active subscription, at most 90 days and twice a year.","The store is asked again after: the new expiry is printed, and the customer's history keeps it with who did it."],args:{min:2,max:2},flags:{days:{type:"string",value:"n",description:"how many days (1 to 90)"},reason:{type:"string",value:"why",description:"customer_satisfaction, service_issue or other: as the App Store asks it"},...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=we(e.flags.days,"days");if(a===void 0||a<1||a>90)throw h("--days is 1 to 90");let o=e.flags.reason;if(o!=="customer_satisfaction"&&o!=="service_issue"&&o!=="other")throw h("--reason is customer_satisfaction, service_issue or other");let i=Wc(e);await k(e,t,`extend ${n}'s subscription ${s} by ${a} day(s)`);let r={days:a,reason:o,...i?{note:i}:{}},l=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/extend`,r,D());e.out.result(l,()=>Fc(e,l,`Extended ${n}'s subscription by ${a} day(s)`))}},mM={name:"iap:customer:refund",summary:"refund a customer's subscription \u2014 its latest payment, or what is left of its period \u2014 and end it now: Google Play and Stripe",usage:"<customer id> <subscription id> --mode full|prorated [--note <why>]",details:["The customer's access ends as it answers. The App Store decides its own refunds: the customer asks Apple, which asks the app what they used \u2014 Palbase answers it when they consented in the app."],args:{min:2,max:2},flags:{mode:{type:"string",value:"kind",description:"full: the latest payment; prorated: what is left of its period"},...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=e.flags.mode;if(a!=="full"&&a!=="prorated")throw h("--mode is full (the latest payment) or prorated (what is left of its period)");let o=Wc(e);await k(e,t,`refund ${n}'s subscription ${s} (${a}) and end it now`);let i={mode:a,...o?{note:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/refund`,i,D());e.out.result(r,()=>Fc(e,r,`Refunded ${n}'s subscription (${a}); it ended`))}},gM={name:"iap:customer:cancel",summary:"turn a customer's subscription renewal off: it ends at its period's end, the customer keeping what they paid for \u2014 Google Play and Stripe",usage:"<customer id> <subscription id> [--note <why>]",details:["An App Store subscription's renewal is the customer's to turn off (Settings \u203A Apple ID \u203A Subscriptions)."],args:{min:2,max:2},flags:{...Bc},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the subscription's id (iap:customer:get prints it)"),a=Wc(e);await k(e,t,`turn the renewal of ${n}'s subscription ${s} off`);let o=a?{note:a}:{},i=await g(e,t,"POST",`/iap/customers/${R(n)}/subscriptions/${R(s)}/cancel`,o,D());e.out.result(i,()=>Fc(e,i,`Turned the renewal of ${n}'s subscription off`))}},Fk={source:{type:"string",value:"kind",description:"support (the default) or promotion"}};function Bk(e){let t=e.flags.source??"support";if(t!=="support"&&t!=="promotion")throw h("--source is support or promotion");return t}function Ul(e,t){let n=e.flags.reason?.trim();if(!n)throw h(`--reason says why ${t}: the record`);if(n.length>500)throw h("--reason is 500 characters at most");return n}function Jk(e,t,n){let s=Je(e,t,n),a=Number(s);if(!Number.isInteger(a)||a<1)throw h(`${n} is a whole number above 0: ${s}`);return a}var hM={name:"iap:customer:credits",summary:"a customer's credit entries, the newest first: given, spent, taken back, expired, forgiven \u2014 with who did each, and why",usage:"<customer id> [--credits <key>] [--limit <n>] [--cursor <next>]",args:{min:1,max:1},flags:{credits:{type:"string",value:"key",description:"one of the catalog's credits alone"},limit:{type:"string",value:"n",description:"entries a page (default 50, at most 200)"},cursor:{type:"string",value:"next",description:"the next page, as the last one printed it"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=new URLSearchParams;e.flags.credits!==void 0&&s.set("credits",String(e.flags.credits));let a=we(e.flags.limit,"limit");a!==void 0&&s.set("limit",String(a)),e.flags.cursor!==void 0&&s.set("cursor",String(e.flags.cursor));let o=await g(e,t,"GET",`/iap/customers/${R(n)}/credits/entries${s.size?`?${s}`:""}`);e.out.result(o,()=>{o.entries.length===0&&e.out.line(`${n} has no credit entry.`),e.out.table(o.entries,[{header:"when",value:i=>Z(i.created_at)},{header:"credit",value:i=>i.currency},{header:"what",value:i=>i.kind},{header:"amount",value:i=>`${i.delta>0?"+":""}${i.delta}`},{header:"owed",value:i=>i.debt_delta?`${i.debt_delta>0?"+":""}${i.debt_delta}`:""},{header:"why",value:i=>i.reason??""},{header:"by",value:i=>i.actor??""}]),o.next_cursor&&e.out.line(`Older: palbase iap:customer:credits ${n} --cursor ${o.next_cursor}`)})}},yM={name:"iap:customer:credits:give",summary:"give a customer credits, saying why \u2014 a support case, a promotion \u2014 for a while or until spent",usage:"<customer id> <credits> <amount> --reason <why> [--source support|promotion] [--for 30d | --until <date>]",details:["What they owe is paid first from what is given. Nothing is charged, in any store."],args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why they are given (500 characters at most): the record"},...Fk,for:{type:"string",value:"span",description:"how long they last: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when they expire (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the credits (the catalog's key)"),a=Jk(e,2,"the amount"),o=Ul(e,"they are given"),i=Bk(e),r=Uc(e);await k(e,t,`give ${n} ${a} ${s}${r?` until ${Z(r)}`:""}`);let l={credits:s,amount:a,source:i,reason:o,...r?{expires_at:r}:{}},p=await g(e,t,"POST",`/iap/customers/${R(n)}/credits`,l,D());e.out.result(p,()=>e.out.line(`Gave ${n} ${p.original} ${p.currency}${p.expires_at?` until ${Z(p.expires_at)}`:""}; ${p.remaining} left of it.`))}},fM={name:"iap:customer:credits:forgive",summary:"forgive what a customer owes of a credit \u2014 all of it, or an amount \u2014 saying why",usage:"<customer id> <credits> --reason <why> [--amount <n>]",args:{min:2,max:2},flags:{reason:{type:"string",value:"why",description:"why it is forgiven (500 characters at most): the record"},amount:{type:"string",value:"n",description:"how much of it (default: all they owe)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the credits (the catalog's key)"),a=Ul(e,"it is forgiven"),o=we(e.flags.amount,"amount");if(o===0)throw h("--amount is above 0");await k(e,t,`forgive ${o??"all"} of what ${n} owes of ${s}`);let i={credits:s,reason:a,...o!==void 0?{amount:o}:{}},r=await g(e,t,"POST",`/iap/customers/${R(n)}/credits/forgive`,i,D());e.out.result(r,()=>e.out.line(`Forgave ${r.forgiven} ${r.credits} ${n} owed; they owe ${r.debt}, ${r.available} available.`))}};function Jc(e,t,n){e.out.line(`${t}: ${n.used} of ${n.max} used, ${n.remaining} left, resets ${Z(n.resets_at)}.`)}var bM={name:"iap:customer:limit:set",summary:"set a customer's own maximum of a limit \u2014 above or below the catalog's \u2014 saying why, for a while or until cleared",usage:"<customer id> <limit> <max> --reason <why> [--for 30d | --until <date>]",args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why (500 characters at most): the record"},for:{type:"string",value:"span",description:"how long: 12h, 30d, 2w"},until:{type:"string",value:"date",description:"when it ends (2026-12-31, or a time)"}},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)"),a=Je(e,2,"the maximum"),o=Number(a);if(!Number.isInteger(o)||o<0)throw h(`the maximum is a whole number: ${a}`);let i=Ul(e,"it is set"),r=Uc(e);await k(e,t,`set ${n}'s ${s} to ${o}${r?` until ${Z(r)}`:""}`);let l={max:o,reason:i,...r?{expires_at:r}:{}},p=await g(e,t,"PUT",`/iap/customers/${R(n)}/limits/${R(s)}`,l,D());e.out.result(p,()=>Jc(e,`Set ${n}'s ${p.limit} to ${p.max}`,p))}},wM={name:"iap:customer:limit:clear",summary:"clear a customer's own maximum of a limit: the catalog's counts again",usage:"<customer id> <limit>",args:{min:2,max:2},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)");await k(e,t,`clear ${n}'s own ${s}`);let a=await g(e,t,"DELETE",`/iap/customers/${R(n)}/limits/${R(s)}`,void 0,D());e.out.result(a,()=>Jc(e,`Cleared ${n}'s own ${a.limit}; the catalog's ${a.max} counts`,a))}},vM={name:"iap:customer:limit:give",summary:"give a customer more of a limit for its current period, saying why \u2014 a gift on top of their maximum",usage:"<customer id> <limit> <amount> --reason <why> [--source support|promotion]",args:{min:3,max:3},flags:{reason:{type:"string",value:"why",description:"why it is given (500 characters at most): the record"},...Fk},scope:"environment",async run(e){let t=await f(e),n=Je(e,0,"the customer's id (the user's id)"),s=Je(e,1,"the limit (the catalog's key)"),a=Jk(e,2,"the amount"),o=Ul(e,"it is given"),i=Bk(e);await k(e,t,`give ${n} ${a} more ${s} this period`);let r={amount:a,source:i,reason:o},l=await g(e,t,"POST",`/iap/customers/${R(n)}/limits/${R(s)}/grants`,r,D());e.out.result(l,()=>Jc(e,`Gave ${n} ${a} more ${l.limit}`,l))}};function kM(e){let t=n=>/^[\w./@:-]+$/.test(n)?n:JSON.stringify(n);return`${e.global.project!==void 0?` -P ${t(e.global.project)}`:""}${e.global.env!==void 0?` -E ${t(e.global.env)}`:""}`}async function Hc(e,t){let n=(await Vt(e,t.project_id)).filter(r=>r.deleted_at===null),s=n.filter(r=>r.platform==="ios"),a=e.flags.app;if(a!==void 0){let r=un(n,a);if(r.platform!=="ios")throw h(`${r.slug} is a ${r.platform} app: a StoreKit configuration is an iOS app's`,`the project's iOS apps: ${s.map(l=>l.slug).join(", ")||"none"}`);return r}let o=(await nl(e.io.cwd))?.apps.filter(r=>r.platform==="ios").map(r=>r.id)??[],i=s.filter(r=>o.includes(r.id));if(i.length===1)return i[0];if(s.length===1)return s[0];throw s.length===0?new b("no_ios_app",`${t.project_name} has no iOS app`,{hint:"register it: palbase apps:create ios <name> --team-id <team id>"}):h("name the iOS app the file is for: --app <app>",`the project's iOS apps: ${s.map(r=>r.slug).join(", ")}`)}function _M(e,t){let n=BN(e.io.cwd,ji(e.io.cwd,t)).split(JN).join("/");if(!n.startsWith(`${ue}/`)||n.split("/").includes(".."))throw h(`--out ${t}: the file goes under ${ue}/, as the CLI writes nothing else in the checkout`,`palbase iap:storekit --out ${ue}/<name>.storekit`);if(!n.endsWith(".storekit"))throw h(`--out ${t}: Xcode takes a StoreKit configuration by its .storekit extension`);return n}function SM(e){let t=new Map;for(let n of e.products)for(let s of n.channels.ios?.plans??[])t.set(s.price.currency.toUpperCase(),(t.get(s.price.currency.toUpperCase())??0)+1);return[...t].sort(([n,s],[a,o])=>o-s||(n<a?-1:1))[0]?.[0]}var $M={name:"iap:storekit",summary:"an Xcode StoreKit configuration of the environment's iOS products, under palbase/: a build Xcode runs buys them with no App Store",usage:"[--app <app>] [--out <palbase/\u2026.storekit>] [--storefront <code>]",details:["Each plan is the App Store product its store id names, with its text in every language the catalog has and its price; a subscription is in its group, at its tier's level, with its introductory offer and the catalog's offers on it as promotional offers (a grant has no store).","Prices are in the storefront's currency: the catalog's price, or the amount set by hand in that currency. The storefront is --storefront, else the one the file has, else the one the catalog's currency is the App Store's own price in (USD: USA, EUR: Germany, TRY: Turkey \u2026), else USA.","Made again, the file is made whole from the catalog \u2014 the same catalog, the same file \u2014 keeping the test settings Xcode's Editor menu wrote in it. Nothing outside palbase/ is written: Xcode is pointed at the file in the scheme."],flags:{app:{type:"string",value:"app",description:"the iOS app it is for (default: the one this checkout syncs, or the project's only one)"},out:{type:"string",value:"palbase/\u2026.storekit",description:"where under palbase/ (default: palbase/environments/<env>/<app>.storekit)"},storefront:{type:"string",value:"code",description:"the App Store storefront prices are in, by its three letters (USA, DEU, TUR, GBR, JPN \u2026)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.storefront?.trim().toUpperCase();if(n!==void 0&&!lo.has(n))throw h(`--storefront ${e.flags.storefront}: not an App Store storefront`,"a storefront is three letters, its country's ISO 3166-1 code: USA, DEU, TUR, GBR, JPN \u2026");let s=await Hc(e,t);if(!/^[A-Za-z][A-Za-z0-9-]{0,38}$/.test(t.env_slug))throw new b("unexpected_answer",`the environment's slug ${JSON.stringify(t.env_slug)} is not one`);if(!/^[a-z][a-z0-9-]{0,38}[a-z0-9]$/.test(s.slug))throw new b("unexpected_answer",`the project answered app ${JSON.stringify(s.slug)}, which is not one`);let a=e.flags.out!==void 0?_M(e,e.flags.out):`${ue}/environments/${t.env_slug}/${s.slug}.storekit`,o=await g(e,t,"GET","/iap/offerings?channel=ios");if(!o.products.some(E=>(E.channels.ios?.plans.length??0)>0))throw new b("nothing_on_ios",`${t.env_name}'s catalog sells nothing on iOS yet: there is no product for Xcode to sell`,{hint:"give a product channels.ios in the catalog (palbase iap:catalog:get --out catalog.json, then iap:catalog:put)"});let i=await Be(e.io.cwd,a),r,l;try{r=await zc(i,"utf8");let E=JSON.parse(r);typeof E.settings=="object"&&E.settings!==null&&!Array.isArray(E.settings)&&(l=E.settings)}catch{}let p=typeof l?._storefront=="string"&&lo.has(l._storefront)?l._storefront:void 0,d=SM(o);n??=p??(d!==void 0?Gw(d):void 0)??"USA";let{catalog:u}=await g(e,t,"GET","/iap/catalog"),m=Ww(o,{seed:`${t.env_ref}/${s.id}`,storefront:n,settings:l,offers:u.offers??[]}),y=r!==m.text;y&&(await UN(FN(i),{recursive:!0}),await Be(e.io.cwd,a),await qc(i,m.text));for(let E of m.notes)e.out.warn(E);let w=t.env_slug===Mt,v=kM(e),P=[`In Xcode: Product \u203A Scheme \u203A Edit Scheme\u2026 \u203A Run \u203A Options \u203A StoreKit Configuration \u2014 choose ${a} (not listed yet? add it from that menu).`,w?`${t.project_name} \u203A ${t.env_name} is the project's production environment: it never takes a purchase Xcode signs. Make the file for a test environment (-E <env>) to see a purchase reach the server.`:`Then select the file in Xcode, choose Editor \u203A Save Public Certificate, and let ${t.env_name} take the purchases Xcode signs: palbase iap:apple:xcode-certificate <the saved .cer file>${v}`,`Run the app and buy: Xcode sells the products itself, nothing goes to the App Store. After the catalog changes: palbase iap:storekit${e.flags.app!==void 0?` --app ${s.slug}`:""}${e.flags.out!==void 0?` --out ${a}`:""}${v}`],A=m.counts,T=[A.subscriptions>0?`${A.subscriptions} subscription${A.subscriptions===1?"":"s"} in ${A.groups} group${A.groups===1?"":"s"}`:"",A.products>0?`${A.products} in-app purchase${A.products===1?"":"s"}`:"",A.non_renewing>0?`${A.non_renewing} non-renewing subscription${A.non_renewing===1?"":"s"}`:""].filter(E=>E!=="").join(", ");e.out.result({file:a,app:s.slug,environment:t.env_slug,revision:o.revision,storefront:m.storefront,currency:m.currency,locale:m.locale,...A,written:y,next:P},()=>{e.out.line(`${y?"Wrote":"Up to date:"} ${a} \u2014 ${T}, priced in ${m.currency} (storefront ${m.storefront}), catalog revision ${o.revision}.`),e.out.line(""),P.forEach((E,C)=>e.out.line(`${C+1}. ${E}`))})}},AM=/^SubscriptionKey_([A-Z0-9]{10})\.p8$/,RM=/^AuthKey_[A-Z0-9]{10}\.p8$/,PM=8192,jM=16384;function Hk(e,t){if(!t.connected)e.out.line("No In-App Purchase key is connected: the App Store's purchases are not taken."),e.out.line("Connect one: palbase iap:apple:connect --key-file SubscriptionKey_<KEYID>.p8");else{e.out.line(`In-App Purchase key ${t.key_id??"?"} (issuer ${t.issuer_id??"?"}) for ${t.bundle_id??"?"}${t.app_apple_id?`, Apple ID ${t.app_apple_id}`:", its Apple ID not known yet"}`),e.out.line(`status: ${t.status??"not checked"}${t.checked_at?` (checked ${Z(t.checked_at)})`:""}`);let s=t.notifications;s&&e.out.line(`notifications: ${s.url} \u2014 ${s.bound?`bound ${Z(s.bound_at)}`:`not bound${s.error?`: ${s.error}`:""}`}; Apple's TEST notification ${s.verified_at?`arrived ${Z(s.verified_at)}`:"not arrived yet"}`),t.connected_at&&e.out.line(`connected ${Z(t.connected_at)}${t.connected_by?` by ${t.connected_by}`:""}`),t.action&&e.out.line(`To do: ${t.action}`)}let n=t.xcode_certificate;e.out.line(n?`Xcode's StoreKit Testing purchases: taken, signed with ${n.subject} until ${Z(n.not_after)} (sha256 ${n.fingerprint.slice(0,16)}\u2026)`:"Xcode's StoreKit Testing purchases: not taken (palbase iap:apple:xcode-certificate <file> takes them)")}var TM={name:"iap:apple",summary:"the environment's App Store connection: the In-App Purchase key, where the App Store reports, whether Xcode's purchases are taken",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/iap/apple");e.out.result(n,()=>Hk(e,n))}};function EM(e,t){let n=e.environments.find(s=>s.ref===t.env_ref)?.ios?.bundle;if(n===void 0)throw new b("app_not_in_environment",`${e.slug} is not set in ${t.env_name}: the key is connected for the app's bundle there`,{hint:`palbase apps:env:set ${e.slug} -E ${t.env_slug} --bundle <bundle id>`});return n}var CM={name:"iap:apple:connect",summary:"connect an In-App Purchase key for an iOS app: it goes from this computer straight to the environment, never through Studio",usage:"--key-file <SubscriptionKey_KEYID.p8> [--key-id <KEYID>] [--issuer-id <issuer id>] [--app <app>] | --print-link",details:["App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase makes the key (SubscriptionKey_<KEYID>.p8) and shows the Issuer ID \u2014 the team's, the same as its App Store Connect API keys': left out, the one stores:apple connected is taken.","The environment verifies the app's purchases and reads its subscriptions with it, and has the stores module point the App Store's notifications at the environment.","Studio is asked for a one-time grant alone; the key is posted with it to the environment's own address. --print-link prints a link that takes the key in a browser instead."],flags:{"key-file":{type:"string",value:"SubscriptionKey_KEYID.p8",description:"the .p8 file Apple gave when the key was made"},"key-id":{type:"string",value:"KEYID",description:"the key's id (default: from the file's name)"},"issuer-id":{type:"string",value:"issuer id",description:"the team's issuer id (default: the connected App Store Connect key's)"},app:{type:"string",value:"app",description:"the iOS app (default: the one this checkout syncs, or the project's only one)"},"print-link":{type:"boolean",description:"only print a link that takes the key in a browser (valid 30 minutes, once)"}},scope:"environment",async run(e){let t=await f(e);if(e.flags["print-link"]===!0){if(e.flags["key-file"]!==void 0)throw h("--print-link or --key-file, not both");await k(e,t,"make a link that connects an In-App Purchase key");let y=await g(e,t,"POST","/iap/apple/grants",void 0,D());mn(e,t,y.connect_url,"the connect link"),e.out.result({connect_url:y.connect_url,expires_at:y.expires_at},()=>{e.out.line(y.connect_url),e.out.note(`Open it in a browser, pick the app and the .p8 file; it works once, until ${Z(y.expires_at)}.`)});return}let n=e.flags["key-file"];if(n===void 0)throw h("--key-file names the In-App Purchase key's .p8 file","or --print-link for a link a browser opens");let s=WN(n),a=e.flags["key-id"];if(a===void 0){if(RM.test(s))throw h(`${s} is an App Store Connect API key (palbase stores:apple:connect takes it): this is the In-App Purchase key, SubscriptionKey_<KEYID>.p8`,"App Store Connect \u2192 Users and Access \u2192 Integrations \u2192 In-App Purchase makes one");if(a=AM.exec(s)?.[1],a===void 0)throw h(`--key-id is needed: ${s} is not named SubscriptionKey_<KEYID>.p8`)}let o;try{let y=ji(e.io.cwd,n);if((await zk(y)).size>PM)throw new b("not_a_key",`${n} is larger than a .p8 key`);o=await zc(y,"utf8")}catch(y){throw y instanceof b?y:new b("unreadable_file",`${n} could not be read: ${y instanceof Error?y.message:String(y)}`)}if(!o.includes("-----BEGIN PRIVATE KEY-----"))throw new b("not_a_key",`${n} is not a .p8 key (no "BEGIN PRIVATE KEY")`);let i=e.flags["issuer-id"]?.trim();if(i===void 0||i===""){let y=await g(e,t,"GET","/stores/apple");if(i=y.connected?y.issuer_id:void 0,i===void 0)throw h("--issuer-id is the team's issuer id (App Store Connect \u2192 Users and Access \u2192 Integrations): no App Store Connect key is connected to read it from")}let r=await Hc(e,t),l=EM(r,t);await k(e,t,`connect the In-App Purchase key ${a} for ${l}`);let p=await g(e,t,"POST","/iap/apple/grants",void 0,D()),d=mn(e,t,p.connect_url,"the connect link"),u={grant:p.grant,issuer_id:i,key_id:a,private_key:o,bundle_id:l},m=await wi(e,`${d}/iap/apple/connect`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(u)},"connecting the In-App Purchase key");e.out.result(m,()=>{e.out.line(`Connected key ${a} for ${l} to ${ee(t)}.`),Hk(e,m),e.out.line("Check what else the App Store needs: palbase iap:doctor")})}},OM={name:"iap:apple:disconnect",summary:"forget the environment's In-App Purchase key: the App Store's purchases and notifications are refused from then on (what was bought stays)",scope:"environment",async run(e){let t=await f(e);await k(e,t,"disconnect the In-App Purchase key"),await g(e,t,"DELETE","/iap/apple",void 0,D()),e.out.result({disconnected:!0},()=>e.out.line(`Disconnected the In-App Purchase key from ${ee(t)}.`))}};function Vk(e,t){if(t.service_account===void 0){e.out.line("The project has no Google Play connection: Palbase reads the app's purchases as the account your Play Console invites."),e.out.line("Connect it first: palbase stores:google:connect");return}if(e.out.line(`Play connection: ${t.service_account} (${t.play_status??"not checked"})`),!t.connected){e.out.line("Google Play purchases are not connected: palbase iap:google:connect --app <android app>");return}e.out.line(`app: ${t.package_name??"?"}`),e.out.line(`topic: ${t.topic??"?"} (Play Console \u203A Monetize with Play \u203A Monetization setup \u203A Real-time developer notifications)`),e.out.line(`notifications: ${t.notification_url??"?"} \u2014 Play's test notification ${t.verified_at?`arrived ${Z(t.verified_at)}`:"not arrived yet"}`),t.connected_at&&e.out.line(`connected ${Z(t.connected_at)}${t.connected_by?` by ${t.connected_by}`:""}`),t.action&&e.out.line(`To do: ${t.action}`)}var xM={name:"iap:google",summary:"the environment's Google Play purchases: the app they are made in, the topic its Play Console names, whether Play's test notification arrived",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/iap/google");e.out.result(n,()=>Vk(e,n))}};async function LM(e,t){let n=(await Vt(e,t.project_id)).filter(r=>r.deleted_at===null),s=n.filter(r=>r.platform==="android"),a=e.flags.app;if(a!==void 0){let r=un(n,a);if(r.platform!=="android")throw h(`${r.slug} is a ${r.platform} app: Google Play purchases are an Android app's`,`the project's Android apps: ${s.map(l=>l.slug).join(", ")||"none"}`);return r}let o=(await nl(e.io.cwd))?.apps.filter(r=>r.platform==="android").map(r=>r.id)??[],i=s.filter(r=>o.includes(r.id));if(i.length===1)return i[0];if(s.length===1)return s[0];throw s.length===0?new b("no_android_app",`${t.project_name} has no Android app`,{hint:"register it: palbase apps:create android <name>"}):h("name the Android app: --app <app>",`the project's Android apps: ${s.map(r=>r.slug).join(", ")}`)}var IM={name:"iap:google:connect",summary:"sell on Google Play in one of the project's Android apps: Palbase makes the app's notifications topic and has it pushed to this environment",usage:"[--app <app>]",details:["The project's Play connection (palbase stores:google:connect) is the account Palbase reads and acknowledges the app's purchases as: its Play Console invites it with View financial data and Manage orders and subscriptions.","Then, in Play Console: Monetize with Play \u203A Monetization setup \u203A Real-time developer notifications, the topic this prints, Save, and Send test notification \u2014 palbase iap:google says when it arrived."],flags:{app:{type:"string",value:"app",description:"the Android app (default: the one this checkout syncs, or the project's only one)"}},scope:"environment",async run(e){let t=await f(e),n=await LM(e,t);await k(e,t,`connect Google Play purchases for ${n.slug}`);let s={app_id:n.id},a=await g(e,t,"POST","/iap/google",s,D());e.out.result(a,()=>{e.out.line(`Google Play purchases connected for ${a.package_name??n.slug} in ${ee(t)}.`),Vk(e,a)})}},NM={name:"iap:google:disconnect",summary:"stop taking the environment's Google Play purchases: Play's notifications stop reaching it, and the app's reports are refused (what was bought stays)",scope:"environment",async run(e){let t=await f(e);await k(e,t,"disconnect Google Play purchases"),await g(e,t,"DELETE","/iap/google",void 0,D()),e.out.result({disconnected:!0},()=>e.out.line(`Disconnected Google Play purchases from ${ee(t)}.`))}};async function MM(e,t){let n=(await Vt(e,t.project_id)).find(s=>s.deleted_at===null&&s.environments.some(a=>a.ref===t.env_ref));return n===void 0?t.env_slug===Mt:(await e.studio.get(`/environments/${t.env_ref}/apps/${n.id}/config`)).environment.production}async function DM(e,t){let n;try{let o=ji(t,e);if((await zk(o)).size>jM)throw new b("not_a_certificate",`${e} is larger than Xcode's certificate`);n=await zc(o)}catch(o){throw o instanceof b?o:new b("unreadable_file",`${e} could not be read: ${o instanceof Error?o.message:String(o)}`)}let s;try{s=new KN(n)}catch{throw new b("not_a_certificate",`${e} is not a certificate`,{hint:"the one Xcode saves: select the .storekit file, then Editor \u203A Save Public Certificate"})}let a=n.toString("latin1");return{certificate:a.includes("-----BEGIN CERTIFICATE-----")?a.trim():n.toString("base64"),x509:s}}var zM={name:"iap:apple:xcode-certificate",summary:"take the purchases Xcode's StoreKit Testing signs with this certificate, as test purchases \u2014 never on production; --remove stops",usage:"<certificate.cer> | --remove",details:["Xcode saves the certificate: select the .storekit file (palbase iap:storekit makes it), then Editor \u203A Save Public Certificate.","From then on what the app reports signed with it \u2014 Xcode's own purchases, on a developer's Mac \u2014 is a test purchase of the environment, with or without an In-App Purchase key; nothing of it is asked of Apple. Set again, it replaces the one before.","The production environment takes only what the App Store signed: it is refused there."],args:{min:0,max:1},flags:{remove:{type:"boolean",description:"stop taking Xcode's purchases (those taken stay)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.remove===!0,s=e.args[0];if(n===(s!==void 0))throw h("name the certificate file, or --remove","palbase iap:apple:xcode-certificate StoreKitTestCertificate.cer");if(n){await k(e,t,"stop taking Xcode's StoreKit Testing purchases"),await g(e,t,"DELETE","/iap/apple/xcode-certificate",void 0,D()),e.out.result({removed:!0},()=>e.out.line(`${ee(t)} no longer takes Xcode's purchases; those it took stay.`));return}let a=await DM(s,e.io.cwd);if(await MM(e,t))throw new b("production_environment",`${t.project_name} \u203A ${t.env_name} is the project's production environment: it takes only purchases the App Store signed, never Xcode's`,{hint:"set the certificate on a test environment: palbase iap:apple:xcode-certificate <file> -E <env>"});await k(e,t,`take the purchases Xcode signs with ${a.x509.subject.replaceAll(`
11199
11200
  `,", ")}`);let o=await g(e,t,"PUT","/iap/apple/xcode-certificate",{certificate:a.certificate},D());e.out.result(o,()=>{e.out.line(`${ee(t)} takes the purchases Xcode signs with ${o.subject}, until ${Z(o.not_after)} (sha256 ${o.fingerprint.slice(0,16)}\u2026).`),e.out.line("Run the app from Xcode and buy: each purchase is a test purchase of this environment.")})}},qM=new Set(["sandbox_access","xcode_certificate"]),GM={name:"iap:doctor",summary:"whether the environment sells in the App Store now, check by check \u2014 the App Store Connect side and the iap side \u2014 with the fix of each that fails",usage:"[--app <app>]",details:["Apple is asked now: the keys, the agreements, the app's App Store Connect record, where the App Store reports, the sandbox testers, each product's state, the catalog's last confirmation; and whether Xcode's purchases are taken.","It exits 1 while a check that is not informational fails: run it again until every line is \u2713."],flags:{app:{type:"string",value:"app",description:"the iOS app (default: the environment's one linked app)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.app!==void 0?await Hc(e,t):void 0,s=n?`?${new URLSearchParams({app:n.id})}`:"",a=u=>u.then(m=>({value:m}),m=>({error:m})),[o,i]=await Promise.all([a(g(e,t,"GET",`/stores/apple/readiness${s}`)),a(g(e,t,"GET","/iap/apple/readiness"))]),r=(u,m)=>{if(!(m instanceof G))throw m;return{module:u,id:`${u}_unanswered`,ok:!1,informational:!1,message:`The ${u} module could not answer: ${m.message}`,fix:m.status===503||m.status===502?"palbase iap:doctor (again, in a moment)":""}},l=[..."value"in o?o.value.checks.map(u=>({module:"stores",id:u.id,ok:u.ok,informational:!1,message:u.message,fix:u.fix})):[r("stores",o.error)],..."value"in i?i.value.checks.map(u=>({module:"iap",id:u.id,ok:u.ok,informational:qM.has(u.id),message:u.message,fix:u.fix})):[r("iap",i.error)]],p=l.filter(u=>!u.ok&&!u.informational),d=p.length===0;return e.out.result({ready:d,checks:l,stores:"value"in o?o.value:null,iap:"value"in i?i.value:null},()=>{let u=(m,y)=>{e.out.line(y);for(let w of l.filter(v=>v.module===m))e.out.line(` ${w.informational?"i":w.ok?"\u2713":"\u2717"} ${w.message}`),(!w.ok||w.informational)&&w.fix&&e.out.line(` \u2192 ${w.fix}`)};u("stores","App Store Connect (stores)"),u("iap","In-App Purchases (iap)"),e.out.line(""),e.out.line(d?`Ready: ${ee(t)} sells in the App Store.`:`${p.length} of ${l.filter(m=>!m.informational).length} checks fail: fix each, then run palbase iap:doctor again.`)}),d?void 0:1}},Xk=[HN,VN,XN,ZN,QN,eM,tM,nM,sM,pM,oM,dM,cM,iM,rM,uM,mM,gM,hM,yM,fM,bM,wM,vM,$M,TM,CM,OM,zM,xM,IM,NM,GM];import{writeFile as KM}from"node:fs/promises";import{resolve as UM}from"node:path";function hs(e,t,n){let s=e.args[t];if(s===void 0||s.trim()==="")throw h(`${n} is required`);return s.trim()}function WM(e,t){if(t.length===0){e.out.line("No payment channel is connected yet."),e.out.line("Connect Stripe with one click: palbase payments:stripe:install"),e.out.line("Or connect Stripe/iyzico via browser grant: palbase payments:stripe:grant / palbase payments:iyzico:connect");return}e.out.table(t,[{header:"channel",value:n=>`${n.key}${n.is_default?" (default)":""}`},{header:"provider",value:n=>n.provider},{header:"mode",value:n=>n.livemode?"live":"test"},{header:"status",value:n=>n.status},{header:"key",value:n=>n.via==="app"?"stripe app":n.key_hint??"\u2014"},{header:"masterpass",value:n=>n.has_masterpass?"yes":"no"},{header:"checked",value:n=>Z(n.checked_at)}])}var FM={name:"payments:channels",summary:"list the environment's connected payment channels (Stripe, iyzico, Masterpass status and health)",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/payments/channels");e.out.result(n,()=>WM(e,n.channels))}},BM={name:"payments:channels:check",summary:"probe a connected payment channel against its provider API to verify credentials and permissions",usage:"<channel key>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the channel key"),s=await g(e,t,"POST",`/payments/channels/${R(n)}/check`,void 0,D());e.out.result(s,()=>{e.out.line(`Channel ${s.key} (${s.provider}, ${s.livemode?"live":"test"}): ${s.status} (checked ${Z(s.checked_at)}).`),s.permissions.length>0&&e.out.line(`permissions: ${s.permissions.join(", ")}`)})}},JM={name:"payments:channels:default",summary:"set an active payment channel as the default fallback when no routing rule matches",usage:"<channel key>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the channel key");await k(e,t,`set ${n} as the default payment channel`);let s=await g(e,t,"POST",`/payments/channels/${R(n)}/default`,void 0,D());e.out.result(s,()=>e.out.line(`Set ${s.key} (${s.provider}) as the default payment channel for ${ee(t)}.`))}},HM={name:"payments:channels:disconnect",summary:"disable a payment channel and remove its managed provider webhook endpoint",usage:"<channel key>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the channel key");await k(e,t,`disconnect payment channel ${n}`),await g(e,t,"DELETE",`/payments/channels/${R(n)}`,void 0,D()),e.out.result({disconnected:n},()=>e.out.line(`Disconnected payment channel ${n} from ${ee(t)}.`))}},VM={name:"payments:stripe:install",summary:"mint a one-time link to install Palbase's Stripe App with one click (no API key pasted)",usage:"[--channel <key>] [--live]",details:["Opens the one-click Stripe App installation flow; works once for 30 minutes.","Use --live to install in Stripe live mode (test mode otherwise)."],flags:{channel:{type:"string",value:"key",description:"target channel key (default: stripe)"},live:{type:"boolean",description:"install the Stripe App in live mode (test mode otherwise)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.live===!0,s=e.flags.channel?.trim();await k(e,t,`mint a link to install Palbase's Stripe App (${n?"live":"test"} mode)`);let a={livemode:n,...s?{channel_key:s}:{}},o=await g(e,t,"POST","/payments/stripe/app/grants",a,D()),i=Gu(e.cloud),r;try{r=new URL(o.connect_url)}catch{r=void 0}r?.origin===i&&r.pathname==="/payments/stripe/app/install"||mn(e,t,o.connect_url,"the Stripe App install link"),e.out.result({connect_url:o.connect_url,expires_at:o.expires_at},()=>{e.out.line(o.connect_url),e.out.note(`Open in a browser to connect Stripe with one click; expires ${Z(o.expires_at)}.`)})}},XM={name:"payments:stripe:grant",summary:"mint a one-time browser URL to connect a Stripe restricted key directly to the environment",usage:"[--channel <key>]",details:["The restricted key goes straight from your browser to the environment, never through this computer or an AI agent.","Works once, for 30 minutes."],flags:{channel:{type:"string",value:"key",description:"target channel key (default: stripe)"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.channel?.trim();await k(e,t,"mint a one-time link to connect a Stripe restricted key");let s={kind:"stripe_key",...n?{channel_key:n}:{}},a=await g(e,t,"POST","/payments/channels/grants",s,D());mn(e,t,a.connect_url,"the Stripe connect link"),e.out.result({connect_url:a.connect_url,expires_at:a.expires_at},()=>{e.out.line(a.connect_url),e.out.note(`Open in a browser and paste your Stripe restricted key (rk_test_ / rk_live_); expires ${Z(a.expires_at)}.`)})}},YM={name:"payments:iyzico:connect",summary:"connect an iyzico payment channel (browser grant by default, or --stdin JSON for CI)",usage:"[--channel <key>] [--stdin [--live] [--default]]",details:["Without --stdin, mints a one-time browser URL where a human pastes iyzico credentials directly into the environment.",'With --stdin, reads JSON { "api_key", "secret_key", "masterpass"? } from stdin so secrets never appear in command-line arguments.'],flags:{channel:{type:"string",value:"key",description:"channel key (default: iyzico_tr)"},stdin:{type:"boolean",description:"read { api_key, secret_key, masterpass? } JSON from stdin instead of minting a browser link"},live:{type:"boolean",description:"with --stdin: mark credentials as live production mode (sandbox otherwise)"},default:{type:"boolean",description:"with --stdin: set this channel as the project default"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.channel?.trim()||"iyzico_tr";if(e.flags.stdin!==!0){await k(e,t,`mint a one-time link to connect iyzico channel ${n}`);let p=await g(e,t,"POST","/payments/channels/grants",{kind:"iyzico_key",channel_key:n},D());mn(e,t,p.connect_url,"the iyzico connect link"),e.out.result({connect_url:p.connect_url,expires_at:p.expires_at},()=>{e.out.line(p.connect_url),e.out.note(`Open in a browser and enter your iyzico API key & secret key; expires ${Z(p.expires_at)}.`)});return}let s=Ne(await ze(e,"-","iyzico credentials JSON"),"iyzico credentials");if(typeof s!="object"||s===null||Array.isArray(s))throw h("stdin must be a JSON object with api_key and secret_key");let a=s;if(!a.api_key?.trim()||!a.secret_key?.trim())throw h("stdin JSON must include non-empty api_key and secret_key");let o=e.flags.live===!0;await k(e,t,`connect iyzico channel ${n} (${o?"live":"sandbox"})`);let i={key:n,provider:"iyzico",api_key:a.api_key.trim(),secret_key:a.secret_key.trim(),livemode:o,...e.flags.default===!0?{set_default:!0}:{},...a.masterpass?{masterpass:a.masterpass}:{}},r=await g(e,t,"POST","/payments/channels",i,D());e.out.result(r,()=>{e.out.line(`Connected iyzico channel ${r.key} (${r.livemode?"live":"sandbox"}, status: ${r.status}).`)})}},ZM={name:"payments:routing",summary:"list deterministic payment channel routing rules ordered by priority",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/payments/routing-rules");e.out.result(n,()=>{if(n.rules.length===0){e.out.line("No routing rules configured: payments use the default active channel."),e.out.line("Configure rules: palbase payments:routing:put --file rules.json");return}e.out.table(n.rules,[{header:"priority",value:s=>String(s.priority)},{header:"channel",value:s=>s.channel_key},{header:"currency",value:s=>s.currency??"*"},{header:"country",value:s=>s.country??"*"},{header:"kind",value:s=>s.payment_kind??"*"},{header:"enabled",value:s=>s.enabled?"yes":"no"}])})}},QM={name:"payments:routing:put",summary:"replace all deterministic channel routing rules from a JSON file or stdin",usage:"--file <rules.json>",details:['Accepts either `{ "rules": [...] }` or a bare JSON array of routing rule objects.'],flags:{file:{type:"string",value:"rules.json",description:"JSON rules file ('-' or omitted: stdin)"}},scope:"environment",async run(e){let t=await f(e),n=Ne(await ze(e,e.flags.file,"routing rules"),"routing rules"),s=Array.isArray(n)?n:typeof n=="object"&&n!==null&&Array.isArray(n.rules)?n.rules:void 0;if(!s)throw h('routing rules must be a JSON array or `{ "rules": [...] }`');await k(e,t,`replace payment routing rules (${s.length} rule(s))`);let a=await g(e,t,"PUT","/payments/routing-rules",{rules:s},D());e.out.result(a,()=>e.out.line(`Saved ${a.rules.length} routing rule(s) for ${ee(t)}.`))}},eD={name:"payments:wallets",summary:"list configured closed-loop wallet definitions for the environment",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/payments/wallets");e.out.result(n,()=>{if(n.wallets.length===0){e.out.line("No closed-loop wallets configured yet."),e.out.line('Create one: palbase payments:wallets:put --key try --name "TRY Wallet" --currency TRY');return}e.out.table(n.wallets,[{header:"key",value:s=>s.key},{header:"name",value:s=>s.name},{header:"currency",value:s=>s.currency},{header:"kind",value:s=>s.kind},{header:"topup range",value:s=>`${s.topup_min}..${s.topup_max}`},{header:"expiry days",value:s=>s.expires_days?String(s.expires_days):"none"},{header:"active",value:s=>s.active?"yes":"no"}])})}},tD={name:"payments:wallets:put",summary:"create or update a closed-loop wallet definition (currency, top-up bounds, expiry)",usage:"--key <key> --name <name> --currency <ISO> [--kind fiat|points] [--min <minor>] [--max <minor>] [--expires-days <n>] [--inactive]",flags:{key:{type:"string",value:"key",description:"stable lowercase wallet key (e.g. try, usd, store_credit)"},name:{type:"string",value:"name",description:"human-readable wallet display name"},currency:{type:"string",value:"ISO",description:"3-letter ISO 4217 currency code (e.g. TRY, USD)"},kind:{type:"string",value:"fiat|points",description:"wallet kind (default: fiat)"},min:{type:"string",value:"minor",description:"minimum top-up in minor units (default: 100)"},max:{type:"string",value:"minor",description:"maximum top-up in minor units (default: 5000000)"},"expires-days":{type:"string",value:"n",description:"optional default lot expiry in days"},inactive:{type:"boolean",description:"create or mark the wallet inactive"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.key?.trim(),s=e.flags.name?.trim(),a=e.flags.currency?.trim().toUpperCase();if(!n)throw h("--key is required (e.g. --key try)");if(!s)throw h("--name is required");if(!a||!/^[A-Z]{3}$/.test(a))throw h("--currency must be a 3-letter ISO 4217 code (e.g. TRY, USD)");let o=(e.flags.kind??"fiat").trim();if(o!=="fiat"&&o!=="points")throw h("--kind must be fiat or points");let i=we(e.flags.min,"min")??100,r=we(e.flags.max,"max")??5e6,l=we(e.flags["expires-days"],"expires-days"),p={key:n,name:s,currency:a,kind:o,topup_min:i,topup_max:r,active:e.flags.inactive!==!0,...l!==void 0?{expires_days:l}:{}};await k(e,t,`save wallet definition ${n} (${a}, ${o})`);let d=await g(e,t,"POST","/payments/wallets",p,D());e.out.result(d,()=>{e.out.line(`Saved wallet ${d.key} (${d.name}, ${d.currency}, ${d.active?"active":"inactive"}).`)})}},nD={name:"payments:audit:drift",summary:"verify zero-drift double-entry accounting integrity across all ledger entries and wallets",details:["Exits 0 when every double-entry transaction balances and every wallet matches its ledger entries; exits 1 on any discrepancy."],scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/payments/audit/drift");return e.out.result(n,()=>{if(n.ok)e.out.line(`Zero drift verified: ${n.accounts_checked} wallet account(s) and ${n.transactions_checked} double-entry transaction(s) balanced.`);else{e.out.line(`Drift detected (${n.problems.length} problem(s)):`);for(let s of n.problems)e.out.line(` \u2717 ${s}`)}}),n.ok?void 0:1}},sD={name:"payments:audit:export",summary:"export immutable double-entry ledger entries as CSV (default) or JSON",usage:"[--customer <id>] [--wallet <key>] [--kind <kind>] [--from <iso>] [--to <iso>] [--out <file>]",flags:{customer:{type:"string",value:"id",description:"filter by customer UID"},wallet:{type:"string",value:"key",description:"filter by wallet key"},kind:{type:"string",value:"kind",description:"filter by ledger transaction kind"},from:{type:"string",value:"iso",description:"inclusive RFC 3339 start timestamp"},to:{type:"string",value:"iso",description:"exclusive RFC 3339 end timestamp"},out:{type:"string",value:"file",description:"write CSV export to this file path"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams;e.flags.customer!==void 0&&n.set("customer_id",String(e.flags.customer)),e.flags.wallet!==void 0&&n.set("wallet_key",String(e.flags.wallet)),e.flags.kind!==void 0&&n.set("kind",String(e.flags.kind)),e.flags.from!==void 0&&n.set("from",String(e.flags.from)),e.flags.to!==void 0&&n.set("to",String(e.flags.to));let s=n.size?`?${n}`:"";if(e.global.json&&e.flags.out===void 0){let i=await g(e,t,"GET",`/payments/audit/ledger${s}`);e.out.result(i,()=>{});return}let a=await g(e,t,"GET",`/payments/audit/ledger/export${s}`,void 0,{accept:"text/csv"}),o=e.flags.out;if(o!==void 0){await KM(UM(e.io.cwd,o),typeof a=="string"?a:String(a)),e.out.result({file:o},()=>e.out.line(`Wrote double-entry ledger CSV to ${o}.`));return}e.out.result({csv:a},()=>{typeof a=="string"&&e.io.stdout(a.endsWith(`
11200
11201
  `)?a:`${a}
11201
11202
  `)})}},aD={name:"payments:sandbox:verify",summary:"run live env-driven sandbox verification against iyzico Sandbox and/or Stripe Test Mode",usage:"[--use-connected] [--channel <key>] [--currency <ISO>] [--bin <digits>]",details:["Reads PALBASE_IYZICO_SANDBOX_API_KEY + PALBASE_IYZICO_SANDBOX_SECRET_KEY and/or PALBASE_STRIPE_TEST_KEY from the environment (always livemode: false).","Pass --use-connected to verify already-connected test/sandbox channels without connecting new credentials.","Skips gracefully with setup instructions when no sandbox credentials are present."],flags:{"use-connected":{type:"boolean",description:"verify already-connected test/sandbox channels on the environment"},channel:{type:"string",value:"key",description:"optional channel key filter when using --use-connected"},currency:{type:"string",value:"ISO",description:"currency for capabilities/installment probe (default: TRY for iyzico, USD for stripe)"},bin:{type:"string",value:"digits",description:"test card BIN prefix for installment lookup (default: 554960)"}},scope:"environment",async run(e){let t=await f(e),n=e.io.env.PALBASE_IYZICO_SANDBOX_API_KEY?.trim(),s=e.io.env.PALBASE_IYZICO_SANDBOX_SECRET_KEY?.trim(),a=e.io.env.PALBASE_STRIPE_TEST_KEY?.trim(),o=e.flags["use-connected"]===!0;if(!o&&!(n&&s)&&!a){let u={status:"skipped",reason:"no sandbox credentials provided in environment",env_vars:["PALBASE_IYZICO_SANDBOX_API_KEY","PALBASE_IYZICO_SANDBOX_SECRET_KEY","PALBASE_STRIPE_TEST_KEY"]};e.out.result(u,()=>{e.out.line("Skipped sandbox verification: no sandbox credentials set."),e.out.line("Set PALBASE_IYZICO_SANDBOX_API_KEY & PALBASE_IYZICO_SANDBOX_SECRET_KEY (and/or PALBASE_STRIPE_TEST_KEY), or pass --use-connected.")});return}let i=[],r=[];if(n&&s){let u=await g(e,t,"POST","/payments/channels",{key:"iyzico_sandbox",provider:"iyzico",api_key:n,secret_key:s,livemode:!1},D());i.push({name:"connect:iyzico_sandbox",ok:u.status==="active",detail:`status=${u.status}`}),r.push({key:u.key,provider:"iyzico"})}if(a){if(!a.startsWith("rk_test_"))throw new b("live_key_refused","PALBASE_STRIPE_TEST_KEY must be a Stripe test restricted key (rk_test_...)");let u=await g(e,t,"POST","/payments/channels",{key:"stripe_test",provider:"stripe",api_key:a,livemode:!1},D());i.push({name:"connect:stripe_test",ok:u.status==="active",detail:`status=${u.status}`}),r.push({key:u.key,provider:"stripe"})}if(o&&r.length===0){let u=e.flags.channel?.trim(),m=await g(e,t,"GET","/payments/channels");for(let y of m.channels)y.livemode||u&&y.key!==u||r.push({key:y.key,provider:y.provider});if(r.length===0)throw new b("no_sandbox_channel","no non-live payment channel found to verify")}let l=e.flags.bin?.trim()||"554960";for(let u of r){let m=await g(e,t,"POST",`/payments/channels/${R(u.key)}/check`,void 0,D());i.push({name:`health:${u.key}`,ok:m.status==="active",detail:`status=${m.status}`});let y=e.flags.currency?.trim().toUpperCase()||(u.provider==="iyzico"?"TRY":"USD"),w=await g(e,t,"GET",`/payments/capabilities?${new URLSearchParams({channel:u.key,currency:y})}`);if(i.push({name:`capabilities:${u.key}`,ok:w.available,detail:`currency=${w.currency} 3ds=${w.capabilities.three_ds} installments=${w.capabilities.installments}`}),w.available&&w.capabilities.installments){let v=await g(e,t,"POST","/payments/installments",{bin:l,amount:1e4,currency:y,channel:u.key});i.push({name:`installments:${u.key}`,ok:v.options.length>0,detail:`bin=${v.bin} family=${v.card_family??"n/a"} options=${v.options.length}`})}}let p=await g(e,t,"GET","/payments/audit/drift");i.push({name:"audit:drift",ok:p.ok,detail:p.ok?`${p.accounts_checked} accounts, ${p.transactions_checked} txs`:`${p.problems.length} problem(s)`});let d=i.every(u=>u.ok);return e.out.result({status:d?"passed":"failed",checks:i},()=>{for(let u of i)e.out.line(` ${u.ok?"\u2713":"\u2717"} ${u.name}: ${u.detail}`);e.out.line(d?"Sandbox verification passed.":"Sandbox verification failed.")}),d?void 0:1}},oD={name:"payments:sub-merchants",summary:"list marketplace sub-merchants registered across iyzico Pazaryeri and Stripe Connect channels",usage:"[--seller <ref>] [--channel <key>] [--status <status>] [--limit <n>] [--cursor <token>]",flags:{seller:{type:"string",value:"ref",description:"filter by seller_ref"},channel:{type:"string",value:"key",description:"filter by channel key"},status:{type:"string",value:"status",description:"filter by sub-merchant status"},limit:{type:"string",value:"n",description:"maximum rows to return (default 50)"},cursor:{type:"string",value:"token",description:"pagination cursor from previous page"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams;e.flags.seller!==void 0&&n.set("seller_ref",String(e.flags.seller)),e.flags.channel!==void 0&&n.set("channel",String(e.flags.channel)),e.flags.status!==void 0&&n.set("status",String(e.flags.status)),e.flags.limit!==void 0&&n.set("limit",String(we(e.flags.limit,"limit"))),e.flags.cursor!==void 0&&n.set("cursor",String(e.flags.cursor));let s=n.size?`?${n}`:"",a=await g(e,t,"GET",`/payments/sub-merchants${s}`);e.out.result(a,()=>{if(a.sub_merchants.length===0){e.out.line("No marketplace sub-merchants registered yet.");return}e.out.table(a.sub_merchants,[{header:"id",value:o=>o.id},{header:"seller",value:o=>o.seller_ref},{header:"channel",value:o=>`${o.channel_key} (${o.provider})`},{header:"external_id",value:o=>o.external_id},{header:"status",value:o=>o.status},{header:"payouts",value:o=>o.payouts_enabled?"yes":"no"}]),a.next_cursor&&e.out.note(`next cursor: ${a.next_cursor}`)})}},iD={name:"payments:sub-merchants:upsert",summary:"create or update a marketplace sub-merchant (iyzico Pazaryeri or Stripe Connect) from JSON file or stdin",usage:"--file <submerchant.json>",flags:{file:{type:"string",value:"submerchant.json",description:"JSON payload file ('-' or omitted: stdin)"}},scope:"environment",async run(e){let t=await f(e),n=Ne(await ze(e,e.flags.file,"sub-merchant JSON"),"sub-merchant JSON");if(typeof n!="object"||n===null||Array.isArray(n))throw h("sub-merchant payload must be a JSON object with seller_ref");let s=n;if(!s.seller_ref?.trim())throw h("seller_ref is required in sub-merchant JSON");await k(e,t,`upsert marketplace sub-merchant for seller ${s.seller_ref}`);let a=await g(e,t,"POST","/payments/sub-merchants",s,D());e.out.result(a,()=>{e.out.line(`Sub-merchant ${a.id} (${a.seller_ref} on ${a.channel_key}): ${a.status}, external_id=${a.external_id}.`)})}},rD={name:"payments:sub-merchants:sync",summary:"refresh a marketplace sub-merchant status and payout readiness directly from its PSP",usage:"<sub-merchant-id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the sub-merchant id"),s=await g(e,t,"POST",`/payments/sub-merchants/${R(n)}/sync`,void 0,D());e.out.result(s,()=>{e.out.line(`Synced ${s.id} (${s.seller_ref}): status=${s.status}, charges=${s.charges_enabled}, payouts=${s.payouts_enabled}.`)})}},lD={name:"payments:splits",summary:"list marketplace payment splits and escrow settlement state",usage:"[--intent <id>] [--seller <ref>] [--status <escrow_status>] [--limit <n>] [--cursor <token>]",flags:{intent:{type:"string",value:"id",description:"filter by PaymentIntent UUID"},seller:{type:"string",value:"ref",description:"filter by seller_ref"},status:{type:"string",value:"escrow_status",description:"filter by escrow_status (pending, held, approved, transferred, disapproved, refunded)"},limit:{type:"string",value:"n",description:"maximum rows to return (default 50)"},cursor:{type:"string",value:"token",description:"pagination cursor from previous page"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams;e.flags.intent!==void 0&&n.set("intent_id",String(e.flags.intent)),e.flags.seller!==void 0&&n.set("seller_ref",String(e.flags.seller)),e.flags.status!==void 0&&n.set("escrow_status",String(e.flags.status)),e.flags.limit!==void 0&&n.set("limit",String(we(e.flags.limit,"limit"))),e.flags.cursor!==void 0&&n.set("cursor",String(e.flags.cursor));let s=n.size?`?${n}`:"",a=await g(e,t,"GET",`/payments/splits${s}`);e.out.result(a,()=>{if(a.splits.length===0){e.out.line("No marketplace payment splits found.");return}e.out.table(a.splits,[{header:"id",value:o=>o.id},{header:"seller",value:o=>o.seller_ref},{header:"item",value:o=>o.external_item_ref},{header:"net",value:o=>`${o.seller_net_amount} ${o.currency}`},{header:"escrow",value:o=>String(o.psp_escrow_amount)},{header:"fee",value:o=>String(o.platform_fee_amount)},{header:"status",value:o=>o.escrow_status}]),a.next_cursor&&e.out.note(`next cursor: ${a.next_cursor}`)})}},pD={name:"payments:splits:approve",summary:"approve a held marketplace payment split for seller payout (iyzico item/approve or Stripe Connect transfer)",usage:"<split-id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the split id");await k(e,t,`approve marketplace payment split ${n} for payout`);let s=await g(e,t,"POST",`/payments/splits/${R(n)}/approve`,void 0,D());e.out.result(s,()=>{e.out.line(`Approved split ${s.id} (${s.seller_ref}): status=${s.escrow_status}, net=${s.seller_net_amount} ${s.currency}.`)})}},dD={name:"payments:splits:disapprove",summary:"reverse escrow approval on a marketplace payment split (iyzico item/disapprove or Stripe transfer reversal)",usage:"<split-id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the split id");await k(e,t,`disapprove marketplace payment split ${n}`);let s=await g(e,t,"POST",`/payments/splits/${R(n)}/disapprove`,void 0,D());e.out.result(s,()=>{e.out.line(`Disapproved split ${s.id} (${s.seller_ref}): status=${s.escrow_status}.`)})}},cD={name:"payments:splits:refund",summary:"execute a partial or full item-level marketplace split refund with seller clawback",usage:"<split-id> --card <minor> --clawback <minor> [--wallet <minor>] [--fee-reversed <minor>] [--tax-reversed <minor>] [--reason <text>]",flags:{card:{type:"string",value:"minor",description:"card refund amount in minor units"},wallet:{type:"string",value:"minor",description:"wallet refund amount in minor units (default: 0)"},clawback:{type:"string",value:"minor",description:"seller clawback amount in minor units"},"fee-reversed":{type:"string",value:"minor",description:"platform commission reversed in minor units (default: 0)"},"tax-reversed":{type:"string",value:"minor",description:"withholding tax reversed in minor units (default: 0)"},reason:{type:"string",value:"text",description:"optional refund reason"}},args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the split id"),s=we(e.flags.card,"card"),a=we(e.flags.clawback,"clawback");if(s===void 0)throw h("--card is required (minor units)");if(a===void 0)throw h("--clawback is required (minor units)");let o={card_refund_amount:s,seller_clawback_amount:a,...e.flags.wallet!==void 0?{wallet_refund_amount:we(e.flags.wallet,"wallet")}:{},...e.flags["fee-reversed"]!==void 0?{platform_fee_reversed_amount:we(e.flags["fee-reversed"],"fee-reversed")}:{},...e.flags["tax-reversed"]!==void 0?{withholding_tax_reversed_amount:we(e.flags["tax-reversed"],"tax-reversed")}:{},...e.flags.reason!==void 0?{reason:String(e.flags.reason)}:{}};await k(e,t,`refund split ${n} (card=${s}, clawback=${a})`);let i=await g(e,t,"POST",`/payments/splits/${R(n)}/refund`,o,D());e.out.result(i,()=>{e.out.line(`Refunded split ${i.split_id}: refund_id=${i.refund_id}, status=${i.escrow_status}.`)})}},uD={name:"payments:seller-accounts",summary:"inspect channel-independent escrow, top-up escrow, payable, and debt balances for a marketplace seller",usage:"<seller-ref>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the seller ref"),s=await g(e,t,"GET",`/payments/seller-accounts/${R(n)}`);e.out.result(s,()=>{if(s.balances.length===0){e.out.line(`No balances recorded yet for seller ${s.seller_ref}.`);return}e.out.table(s.balances,[{header:"currency",value:a=>a.currency},{header:"escrow",value:a=>String(a.escrow_balance)},{header:"topup_escrow",value:a=>String(a.topup_escrow_balance)},{header:"payable",value:a=>String(a.payable_balance)},{header:"debt",value:a=>String(a.debt_balance)}])})}},mD={name:"payments:seller-accounts:ledger",summary:"list immutable double-entry ledger entries affecting a marketplace seller account",usage:"<seller-ref> [--limit <n>] [--cursor <seq>]",flags:{limit:{type:"string",value:"n",description:"maximum entries to return (default 100)"},cursor:{type:"string",value:"seq",description:"sequence cursor for older entries"}},args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=hs(e,0,"the seller ref"),s=new URLSearchParams;e.flags.limit!==void 0&&s.set("limit",String(we(e.flags.limit,"limit"))),e.flags.cursor!==void 0&&s.set("cursor",String(e.flags.cursor));let a=s.size?`?${s}`:"",o=await g(e,t,"GET",`/payments/seller-accounts/${R(n)}/ledger${a}`);e.out.result(o,()=>{if(o.entries.length===0){e.out.line(`No ledger entries found for seller ${o.seller_ref}.`);return}e.out.table(o.entries,[{header:"seq",value:i=>String(i.seq)},{header:"kind",value:i=>i.kind},{header:"amount",value:i=>`${i.amount} ${i.currency}`},{header:"legs",value:i=>i.legs.map(r=>`${r.direction}:${r.account_id}=${r.amount}`).join(", ")},{header:"at",value:i=>Z(i.created_at)}]),o.next_cursor&&e.out.note(`next cursor: ${o.next_cursor}`)})}},gD={name:"payments:reconcile",summary:"run full payments & marketplace accounting reconciliation (zero-drift Checks 1-6 plus cash-flow summary)",usage:"[--from <iso>] [--to <iso>]",flags:{from:{type:"string",value:"iso",description:"inclusive RFC 3339 start timestamp for cash-flow window"},to:{type:"string",value:"iso",description:"exclusive RFC 3339 end timestamp for cash-flow window"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams;e.flags.from!==void 0&&n.set("from",String(e.flags.from)),e.flags.to!==void 0&&n.set("to",String(e.flags.to));let s=n.size?`?${n}`:"",[a,o]=await Promise.all([g(e,t,"GET","/payments/audit/drift"),g(e,t,"GET",`/payments/audit/cashflow${s}`)]);return e.out.result({drift:a,cashflow:o},()=>{if(a.ok)e.out.line(`Zero drift verified (Checks 1-6): ${a.accounts_checked} account(s), ${a.transactions_checked} double-entry tx(s).`);else{e.out.line(`Drift detected (${a.problems.length} problem(s)):`);for(let i of a.problems)e.out.line(` \u2717 ${i}`)}o.currencies.length>0&&e.out.table(o.currencies,[{header:"currency",value:i=>i.currency},{header:"gross",value:i=>String(i.payment_gross)},{header:"refunded",value:i=>String(i.payment_refunded)},{header:"escrow",value:i=>String(i.marketplace_escrow??0)},{header:"commission",value:i=>String(i.marketplace_commission??0)},{header:"withholding",value:i=>String(i.marketplace_withholding??0)}])}),a.ok?void 0:1}},Yk=[FM,BM,JM,HM,VM,XM,YM,ZM,QM,eD,tD,nD,sD,aD,oD,iD,rD,lD,pD,dD,cD,uD,mD,gD];function Zk(e,t,n){let s=e.args[t];if(s===void 0||s.trim()==="")throw h(`${n} is required`);return s.trim()}async function Ti(e,t){let n=await ze(e,e.flags.file,t),s=Ne(n,t);if(typeof s!="object"||s===null||Array.isArray(s))throw h(`${t} must be a JSON object`);return s}var hD={name:"commerce:settings:get",summary:"show the environment's commerce settings (currency, commission, withholding, escrow)",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/commerce/settings");e.out.result(n,()=>{e.out.line(`Currency: ${n.default_currency??"TRY"}, commission: ${n.default_commission_bps??0} bps, withholding: ${n.default_withholding_bps??0} bps, escrow: ${n.escrow_release_days??0}d`)})}},yD={name:"commerce:settings:set",summary:"update the environment's commerce settings from JSON (--file or stdin)",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with commerce settings"}},scope:"environment",async run(e){let t=await f(e),n=await Ti(e,"commerce settings");await k(e,t,"update commerce settings");let s=await g(e,t,"PUT","/commerce/settings",n,D());e.out.result(s,()=>e.out.line(`Updated commerce settings for ${ee(t)}.`))}},fD={name:"commerce:stores",summary:"list the environment's first-party and marketplace seller stores",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/commerce/stores");e.out.result(n,()=>{if(n.stores.length===0){e.out.line("No stores yet.");return}e.out.table(n.stores,[{header:"id",value:s=>s.id??""},{header:"slug",value:s=>s.slug??""},{header:"name",value:s=>s.name??""},{header:"kind",value:s=>s.kind??""},{header:"status",value:s=>s.status??""}])})}},bD={name:"commerce:stores:create",summary:"create a first-party or marketplace seller store from JSON (--file or stdin)",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with store payload"}},scope:"environment",async run(e){let t=await f(e),n=await Ti(e,"store");await k(e,t,`create store ${String(n.slug??n.name??"")}`);let s=await g(e,t,"POST","/commerce/stores",n,D());e.out.result(s,()=>e.out.line(`Created store ${s.slug} (${s.id}).`))}},wD={name:"commerce:products",summary:"list catalog products (optionally filtered with --q)",usage:"[--q <query>]",flags:{q:{type:"string",value:"query",description:"search query"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.q?.trim(),s=n?`/commerce/products?q=${encodeURIComponent(n)}`:"/commerce/products",a=await g(e,t,"GET",s);e.out.result(a,()=>{if(a.products.length===0){e.out.line("No products yet.");return}e.out.table(a.products,[{header:"id",value:o=>o.id??""},{header:"handle",value:o=>o.handle??""},{header:"title",value:o=>o.title??""},{header:"status",value:o=>o.status??""},{header:"approval",value:o=>o.approval_status??""}])})}},vD={name:"commerce:products:quick",summary:"quick-create a product, default variant, listing, price, and initial stock from JSON",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with quick product payload"}},scope:"environment",async run(e){let t=await f(e),n=await Ti(e,"quick product"),s=await g(e,t,"POST","/commerce/products/quick",n,D());e.out.result(s,()=>e.out.line(`Created product ${s.product?.id??""} (listing ${s.listing?.id??""}).`))}},kD={name:"commerce:orders",summary:"list parent commerce orders (optionally filtered by --status)",usage:"[--status <status>]",flags:{status:{type:"string",value:"status",description:"filter by order status"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.status?.trim(),s=n?`/commerce/orders?status=${encodeURIComponent(n)}`:"/commerce/orders",a=await g(e,t,"GET",s);e.out.result(a,()=>{if(a.orders.length===0){e.out.line("No orders yet.");return}e.out.table(a.orders,[{header:"number",value:o=>o.order_number??""},{header:"status",value:o=>o.status??""},{header:"total",value:o=>`${o.total_amount??0} ${o.currency??""}`},{header:"customer",value:o=>o.customer_id??"guest"}])})}},_D={name:"commerce:orders:get",summary:"inspect a commerce order including its per-store splits and line items",usage:"<order id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Zk(e,0,"the order id"),s=await g(e,t,"GET",`/commerce/orders/${R(n)}`);e.out.result(s,()=>{e.out.line(`Order ${s.order?.order_number??n}: ${s.order?.status??""} (${s.store_orders?.length??0} store orders, ${s.lines?.length??0} lines)`)})}},SD={name:"commerce:store-orders",summary:"list per-seller split store orders",usage:"[--store <store id>] [--status <status>]",flags:{store:{type:"string",value:"id",description:"filter by store UUID"},status:{type:"string",value:"status",description:"filter by status"}},scope:"environment",async run(e){let t=await f(e),n=new URLSearchParams;e.flags.store&&n.set("store_id",String(e.flags.store)),e.flags.status&&n.set("status",String(e.flags.status));let s=n.size>0?`/commerce/store-orders?${n.toString()}`:"/commerce/store-orders",a=await g(e,t,"GET",s);e.out.result(a,()=>{if(a.store_orders.length===0){e.out.line("No store orders yet.");return}e.out.table(a.store_orders,[{header:"number",value:o=>o.store_order_number??""},{header:"store",value:o=>o.store_id??""},{header:"status",value:o=>o.status??""},{header:"seller_net",value:o=>`${o.seller_net_amount??0} ${o.currency??""}`},{header:"escrow",value:o=>o.escrow_status??""}])})}},$D={name:"commerce:returns",summary:"list RMA returns and partial-refund requests",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/commerce/returns");e.out.result(n,()=>{if(n.returns.length===0){e.out.line("No returns yet.");return}e.out.table(n.returns,[{header:"rma",value:s=>s.rma_number??""},{header:"status",value:s=>s.status??""},{header:"refund",value:s=>String(s.refund_total_amount??0)}])})}},AD={name:"commerce:settlements",summary:"list seller settlement statements",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/commerce/settlements");e.out.result(n,()=>{if(n.settlements.length===0){e.out.line("No settlements yet.");return}e.out.table(n.settlements,[{header:"id",value:s=>s.id??""},{header:"store",value:s=>s.store_id??""},{header:"status",value:s=>s.status??""},{header:"net",value:s=>`${s.net_payout_amount??0} ${s.currency??""}`}])})}},RD={name:"commerce:settlements:generate",summary:"generate a deduplicated seller settlement statement from JSON (--file or stdin)",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with store_id, currency, period_start_at, period_end_at"}},scope:"environment",async run(e){let t=await f(e),n=await Ti(e,"settlement request");await k(e,t,"generate seller settlement statement");let s=await g(e,t,"POST","/commerce/settlements/generate",n,D());e.out.result(s,()=>e.out.line(`Generated settlement ${s.id} (net ${s.net_payout_amount??0} ${s.currency??""}).`))}},PD={name:"commerce:hooks",summary:"list configured blocking commerce extension hooks",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/commerce/hooks");e.out.result(n,()=>{if(n.hooks.length===0){e.out.line("No commerce hooks configured.");return}e.out.table(n.hooks,[{header:"id",value:s=>s.id??""},{header:"point",value:s=>s.hook_point??""},{header:"url",value:s=>s.url??""},{header:"fail_mode",value:s=>s.fail_mode??""}])})}},jD={name:"commerce:hooks:set",summary:"register or rotate a blocking commerce hook endpoint (returns signing secret once)",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with hook_point, url, timeout_ms, fail_mode"}},scope:"environment",async run(e){let t=await f(e),n=await Ti(e,"commerce hook");await k(e,t,`set commerce hook ${String(n.hook_point??"")}`);let s=await g(e,t,"POST","/commerce/hooks",n,D());e.out.result(s,()=>{e.out.line(`Registered hook ${s.hook_point} (${s.id}).`),e.out.line(`Signing secret (shown once): ${s.signing_secret}`)})}},TD={name:"commerce:hooks:delete",summary:"delete a blocking commerce extension hook",usage:"<hook id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Zk(e,0,"the hook id");await k(e,t,`delete commerce hook ${n}`);let s=await g(e,t,"DELETE",`/commerce/hooks/${R(n)}`,void 0,D());e.out.result(s,()=>e.out.line(`Deleted commerce hook ${n}.`))}},Qk=[hD,yD,fD,bD,wD,vD,kD,_D,SD,$D,AD,RD,PD,jD,TD];function Vc(e,t,n){let s=e.args[t];if(s===void 0||s.trim()==="")throw h(`${n} is required`);return s.trim()}async function Wl(e,t){let n=await ze(e,e.flags.file,t),s=Ne(n,t);if(typeof s!="object"||s===null||Array.isArray(s))throw h(`${t} must be a JSON object`);return s}var ED={name:"promotions:rules",summary:"list promotion rules (automatic, code, and referral campaigns)",usage:"[--status <status>]",flags:{status:{type:"string",value:"status",description:"filter by status"}},scope:"environment",async run(e){let t=await f(e),n=e.flags.status?.trim(),s=n?`/promotions/rules?status=${encodeURIComponent(n)}`:"/promotions/rules",a=await g(e,t,"GET",s);e.out.result(a,()=>{if(a.rules.length===0){e.out.line("No promotion rules yet.");return}e.out.table(a.rules,[{header:"id",value:o=>o.id??""},{header:"key",value:o=>o.key??""},{header:"trigger",value:o=>o.trigger_kind??""},{header:"effect",value:o=>o.effect_kind??""},{header:"funded_by",value:o=>o.funded_by??""},{header:"status",value:o=>o.status??""}])})}},CD={name:"promotions:rules:create",summary:"create a promotion rule from JSON (--file or stdin)",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with rule definition"}},scope:"environment",async run(e){let t=await f(e),n=await Wl(e,"promotion rule");await k(e,t,`create promotion rule ${String(n.key??n.name??"")}`);let s=await g(e,t,"POST","/promotions/rules",n,D());e.out.result(s,()=>e.out.line(`Created promotion rule ${s.key} (${s.id}).`))}},OD={name:"promotions:rules:archive",summary:"archive a promotion rule",usage:"<rule id>",args:{min:1,max:1},scope:"environment",async run(e){let t=await f(e),n=Vc(e,0,"the rule id");await k(e,t,`archive promotion rule ${n}`);let s=await g(e,t,"DELETE",`/promotions/rules/${R(n)}`,void 0,D());e.out.result(s,()=>e.out.line(`Archived promotion rule ${n}.`))}},xD={name:"promotions:codes:create",summary:"create a single or referral promo code for a rule",usage:"<rule id> [--file <path>]",args:{min:1,max:1},flags:{file:{type:"string",value:"path",description:"JSON file with code payload"}},scope:"environment",async run(e){let t=await f(e),n=Vc(e,0,"the rule id"),s=await Wl(e,"promotion code"),a=await g(e,t,"POST",`/promotions/rules/${R(n)}/codes`,s,D());e.out.result(a,()=>e.out.line(`Created code ${a.code} (${a.id}).`))}},LD={name:"promotions:codes:batch",summary:"generate a batch of single-use promo codes for a rule",usage:"<rule id> [--file <path>]",args:{min:1,max:1},flags:{file:{type:"string",value:"path",description:"JSON file with count, prefix, expires_at"}},scope:"environment",async run(e){let t=await f(e),n=Vc(e,0,"the rule id"),s=await Wl(e,"code batch"),a=await g(e,t,"POST",`/promotions/rules/${R(n)}/codes/batch`,s,D());e.out.result(a,()=>e.out.line(`Generated ${a.count} promotion codes.`))}},ID={name:"promotions:evaluate",summary:"dry-run evaluate applicable promotions against a cart JSON payload",usage:"[--file <path>]",flags:{file:{type:"string",value:"path",description:"JSON file with evaluate request"}},scope:"environment",async run(e){let t=await f(e),n=await Wl(e,"evaluate payload"),s=await g(e,t,"POST","/promotions/evaluate",n);e.out.result(s,()=>{e.out.line(`Discount: ${s.total_discount_amount??0}, shipping discount: ${s.shipping_discount_amount??0}, cashback: ${s.wallet_cashback_amount??0}`)})}},ND={name:"promotions:redemptions",summary:"list committed and reversed promotion redemptions",scope:"environment",async run(e){let t=await f(e),n=await g(e,t,"GET","/promotions/redemptions");e.out.result(n,()=>{if(n.redemptions.length===0){e.out.line("No redemptions yet.");return}e.out.table(n.redemptions,[{header:"id",value:s=>s.id??""},{header:"rule",value:s=>s.rule_id??""},{header:"status",value:s=>s.status??""},{header:"discount",value:s=>`${s.discount_amount??0} ${s.currency??""}`}])})}},e_=[ED,CD,OD,xD,LD,ID,ND];import{readdir as MD,readFile as DD,stat as zD}from"node:fs/promises";import{join as qD,resolve as GD}from"node:path";var KD=1e3,t_=900*1024,UD="palbase-argon2id";function WD(e,t){let n=e.trim();if(n.startsWith("{"))try{let s=JSON.parse(n);if(Array.isArray(s.users)){if(s.hash?.pepper!==void 0)throw h(`${t} holds a pepper: it goes on stdin, not in a file`);let a=s.hash&&typeof s.hash.algorithm=="string"?{algorithm:s.hash.algorithm,...typeof s.hash.recovery_code_prefix=="string"?{recovery_code_prefix:s.hash.recovery_code_prefix}:{}}:void 0;return{users:s.users,hash:a}}}catch(s){if(s instanceof Error&&s.name==="CliError")throw s}return{users:BD(e,t)}}function FD(e){let t=[],n=[],s=0;for(let a of e){let o=Buffer.byteLength(JSON.stringify(a))+1;if(o>t_)throw new b("user_too_large",`the user ${String(a.id??"")} is larger than one call takes (${o} bytes)`);(n.length===KD||s+o>t_)&&(t.push(n),n=[],s=0),n.push(a),s+=o}return n.length>0&&t.push(n),t}function BD(e,t){let n=e.trim();if(n==="")return[];if(n.startsWith("["))try{let s=JSON.parse(n);if(Array.isArray(s)&&s.every(a=>typeof a=="object"&&a!==null&&!Array.isArray(a)))return s}catch{}return n.split(`