palbase 0.19.2 → 0.20.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 (52) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{OSREI5EV.js → 2NYI4FOR.js} +2 -2
  8. package/dist/chunks/{B64PN4SN.js → 45465257.js} +2 -2
  9. package/dist/chunks/{GYAC4XGQ.js → 4UGIL34D.js} +2 -2
  10. package/dist/chunks/{EOMNR25V.js → 5QSFOMN7.js} +2 -2
  11. package/dist/chunks/{HNFLACEJ.js → 6TW5HR5D.js} +1 -1
  12. package/dist/chunks/{CGPI3ZD2.js → 7BSKXUEV.js} +2 -2
  13. package/dist/chunks/{EEZBV4BZ.js → BSJV6PEL.js} +1 -1
  14. package/dist/chunks/{63ALEOYV.js → CFJYJRJ7.js} +2 -2
  15. package/dist/chunks/{2D6UTNAS.js → CGTOJ44L.js} +1 -1
  16. package/dist/chunks/{65XX646N.js → DUO4FFKV.js} +2 -2
  17. package/dist/chunks/{5IKIPSPK.js → ILHFQK3J.js} +1 -1
  18. package/dist/chunks/KGAMXI25.js +2 -0
  19. package/dist/chunks/{34FI7FDO.js → KSRRQWGG.js} +2 -2
  20. package/dist/chunks/{PLAWOADG.js → LN7FO4IE.js} +2 -2
  21. package/dist/chunks/{SPRDYHDI.js → MPCXNC4L.js} +1 -1
  22. package/dist/chunks/{3DPITTIG.js → O65ATC5C.js} +2 -2
  23. package/dist/chunks/{KLXOLRFH.js → Q6OD5IUC.js} +1 -1
  24. package/dist/chunks/{LH6MM4NX.js → U3U53UJF.js} +1 -1
  25. package/dist/chunks/{ANPIBUP7.js → UE4A6DEG.js} +2 -2
  26. package/dist/chunks/{OMXEFKCT.js → W4JKOGHG.js} +3 -3
  27. package/dist/chunks/{AFNLDC5V.js → WXDISYY6.js} +2 -2
  28. package/dist/chunks/{M23DJASA.js → X6Y7MMBI.js} +2 -2
  29. package/dist/chunks/{MLQQWG2B.js → ZYBPLNPD.js} +2 -2
  30. package/dist/cli.js +3 -3
  31. package/dist/cloud/index.js +2 -2
  32. package/dist/refuse/ai.js +1 -1
  33. package/dist/refuse/backend.js +1 -1
  34. package/dist/refuse/cloud.js +1 -1
  35. package/dist/refuse/server.js +1 -1
  36. package/dist/server/index.js +2 -2
  37. package/dist/server/testing.js +2 -2
  38. package/dist/web/index.js +2 -2
  39. package/dist/web/message.js +2 -2
  40. package/dist/web/palbe.js +2 -2
  41. package/dist/web/paywall.js +2 -2
  42. package/dist/web/push-sw.js +1 -1
  43. package/dist/web/ssr.js +2 -2
  44. package/dist/web/vite.js +2 -2
  45. package/package.json +2 -2
  46. package/types/internal/src/messaging/index.d.ts +1 -0
  47. package/types/internal/src/messaging/search.d.ts +19 -0
  48. package/types/internal/src/modules/machines.d.ts +28 -2
  49. package/types/internal/src/modules/messaging.d.ts +69 -2
  50. package/types/web/src/index.d.ts +1 -1
  51. package/types/web/src/messaging.d.ts +119 -9
  52. package/dist/chunks/AJUTYIGD.js +0 -2
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /*! palbase 0.19.2 — Palbase SDK License (see LICENSE) */
2
+ /*! palbase 0.20.0 — Palbase SDK License (see LICENSE) */
3
3
  var Jy=Object.defineProperty;var tt=(e,t)=>{for(var n in t)Jy(e,n,{get:t[n],enumerable:!0})};import{parseArgs as Eb}from"node:util";var Wy=Symbol.for("palbase.data"),Vy=globalThis,Ll=Vy[Wy]??=new WeakSet;function Hy(e){return e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer}function va(e){let t=[e];for(;t.length>0;){let n=t.pop();if(!(typeof n!="object"||n===null||Ll.has(n)||Hy(n))){Ll.add(n);for(let s of Array.isArray(n)?n:Object.values(n))t.push(s)}}return e}var Xy="X-PoW-Challenge-ID",Yy="X-PoW-Nonce";function Dl(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 Zy(e){return 8*2**e}var zn;async function Qy(){if(zn)return zn;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 zn=a=>new Uint8Array(s("sha256").update(a).digest()),zn}catch{}let t=new TextEncoder;return zn=async n=>new Uint8Array(await crypto.subtle.digest("SHA-256",t.encode(n))),zn}function eb(e){let t=0;for(let n of e){if(n===0){t+=8;continue}return t+Math.clz32(n)-24}return t}var tb=4096,nb=typeof globalThis.setImmediate=="function"?()=>new Promise(e=>globalThis.setImmediate(e)):()=>new Promise(e=>setTimeout(e,0));async function Nl(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 Qy(),s=Zy(e.difficulty),a=Date.now()+(t.timeLimitMs??12e4);for(let r=0;r<s;r++){if(r%tb===0&&r>0){if(await nb(),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 ${r} attempts`)}let i=n(e.prefix+r),o=i instanceof Uint8Array?i:await i;if(eb(o)>=e.difficulty)return{[Xy]:e.id,[Yy]:String(r)}}throw new Error(`proof-of-work: no nonce for difficulty ${e.difficulty} within ${s} attempts`)}var O=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 g(e,t,n){let s=String(n);if(s===""||s==="."||s==="..")throw new O({op:e,status:0,code:"invalid_path_parameter",message:`${e}: ${t} cannot be ${s===""?"empty":JSON.stringify(s)}`});return encodeURIComponent(s)}var sb=new Set(["apikey","authorization"]),ab=64*1024;function ai(e){let t=_a(e.baseUrl),n=e.fetch??globalThis.fetch,s=e.solveProofOfWork??!0,a=async(r,i)=>{let o=ob(t,r),l=new Headers;for(let[b,w]of Object.entries(r.headers??{}))w!=null&&!sb.has(b.toLowerCase())&&l.set(b,String(w));for(let[b,w]of Object.entries(i))l.set(b,w);await lb(r,e.credentials,l),l.has("accept")||l.set("accept","application/json");let d={method:r.method,headers:l,redirect:"manual",signal:r.signal,...r.keepalive?{keepalive:!0}:{}};r.body&&r.body.value!==void 0&&(l.set("content-type",r.body.contentType),d.body=pb(r.body.kind,r.body.value),Bn(d.body)||(d.duplex="half"));let p;try{p=r.onUploadProgress&&e.xmlHttpRequest?await rb(e.xmlHttpRequest,r.op,o,d,r.onUploadProgress):await n(o,d)}catch(b){throw r.signal?.aborted||b instanceof O?b:new O({op:r.op,status:0,code:"network_error",message:`${r.op}: the request did not reach ${t.origin}`,cause:b})}let u=r.answers[p.status]??(r.ownResponse&&p.status>=200&&p.status<300?"raw":void 0);if(u===void 0)throw p.status>=200&&p.status<300?(await p.body?.cancel(),new O({op:r.op,status:p.status,code:"undeclared_answer",message:`${r.op}: the server answered ${p.status}, which its contract does not declare; the request may have taken effect`})):await ub(r.op,p);let h;switch(u){case"json":try{h=va(await p.json())}catch(b){throw new O({op:r.op,status:p.status,code:"invalid_json",message:`${r.op}: the answer is not JSON`,cause:b})}break;case"raw":h=p;break;default:await p.body?.cancel(),h=void 0}return{status:p.status,data:h,headers:p.headers}};return{async send(r){try{return await a(r,{})}catch(i){let o=s&&i instanceof O&&i.status===403?Dl(i.body):null,l=r.body?.value;if(!o||r.body?.kind==="raw"&&!Bn(l))throw i;let d=i,p;try{p=await Nl(o,{signal:r.signal})}catch(u){throw r.signal?.aborted?u:new O({op:r.op,status:403,code:"pow_unsolved",message:`${r.op}: ${u instanceof Error?u.message:String(u)}`,requestId:d.requestId,body:d.body,cause:u})}return a(r,p)}}}}function rb(e,t,n,s,a){return new Promise((r,i)=>{let o=s.signal;if(o?.aborted)return i(o.reason);let l=new e,d=()=>l.abort();o?.addEventListener("abort",d,{once:!0});let p=u=>{o?.removeEventListener("abort",d),u()};l.open(s.method??"GET",n.href),l.responseType="arraybuffer",new Headers(s.headers).forEach((u,h)=>l.setRequestHeader(h,u)),l.upload&&(l.upload.onprogress=u=>{u.lengthComputable&&a(u.loaded,u.total)}),l.onload=()=>p(()=>{if(l.responseURL!==""&&l.responseURL!==n.href){i(new O({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;r(new Response(u?null:l.response,{status:l.status,statusText:l.statusText,headers:ib(l.getAllResponseHeaders())}))}),l.onerror=()=>p(()=>i(new TypeError(`${t}: the request failed`))),l.onabort=()=>p(()=>i(o?.reason??new DOMException("The request was aborted","AbortError"))),l.send(s.body)})}function ib(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 _a(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 ob(e,t){if(!t.path.startsWith("/")||t.path.startsWith("//"))throw new O({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+db(t.query),e);if(n.origin!==e.origin)throw new O({op:t.op,status:0,code:"invalid_path",message:`${t.op}: path leaves the project's origin`});return n}async function lb(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}},r=e.auth.filter(i=>i.every(a)).reduce((i,o)=>i===void 0||o.length>i.length?o:i,void 0);if(!r)throw new O({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 r)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 pb(e,t){switch(e){case"json":return JSON.stringify(t);case"form":{let n=new URLSearchParams;for(let[s,a]of Object.entries(t))ri(n,s,a);return n}case"raw":return t}}function Bn(e){return!!(e==null||typeof e=="string"||e instanceof URLSearchParams||e instanceof Blob||e instanceof FormData||e instanceof ArrayBuffer||ArrayBuffer.isView(e))}function db(e){if(!e)return"";let t=new URLSearchParams;for(let[s,a]of Object.entries(e))ri(t,s,a);let n=t.toString();return n===""?"":`?${n}`}function ri(e,t,n){if(n!=null){if(Array.isArray(n)){for(let s of n)ri(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 ub(e,t){let n=await cb(t,ab).catch(()=>""),s;try{s=n===""?void 0:JSON.parse(n)}catch{s=n}let a=gb(s)?s:void 0,r=Number(t.headers.get("retry-after")),i=t.status>=300&&t.status<400;return new O({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(r)&&r>0?r:void 0),body:s})}async function cb(e,t){if(!e.body)return"";let n=e.body.getReader(),s=[],a=0;for(;a<t;){let{done:o,value:l}=await n.read();if(o)break;s.push(l),a+=l.byteLength}await n.cancel().catch(()=>{});let r=new Uint8Array(Math.min(a,t)),i=0;for(let o of s){let l=Math.min(o.byteLength,r.byteLength-i);if(r.set(o.subarray(0,l),i),i+=l,i>=r.byteLength)break}return new TextDecoder().decode(r)}function gb(e){return typeof e=="object"&&e!==null&&typeof e.error=="string"}var ka={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 y=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 m(e,t){return new y("usage",e,{hint:t,exitCode:2})}var Sa=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(`${K(t)}
5
5
  `)}note(t){this.io.stderr(`${K(t)}
@@ -9,7 +9,7 @@ var Jy=Object.defineProperty;var tt=(e,t)=>{for(var n in t)Jy(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 y("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||r>=Ab||!Pb.has(await li(i)??""))return i;await i.body?.cancel();let o=Number(i.headers.get("retry-after")??"");await this.io.sleep((Number.isFinite(o)&&o>0?Math.min(o,30):1)*1e3)}}async exchange(t,n,s){let a=await this.token(),r=await this.send(t,n,s,a.value);if(r.status===401&&a.renewable){let i=await this.renew(await this.currentSession());r=await this.send(t,n,s,i.access_token)}return{res:r,renewable:a.renewable}}async answered(t,n,s,a){if(s.status===204)return;let r=await s.text(),i=r===""?void 0:Rb(r);if(s.ok)return i;let o=i??{};throw s.status===401?o.error==="token_not_for_machines"?ep(new URL(this.cloud.studioApi).host):a?Fn():this.tokenRefused("Studio"):new O({op:`${t} ${n}`,status:s.status,code:o.error??`http_${s.status}`,message:o.error_description??`Studio answered ${s.status}`,requestId:o.request_id??s.headers.get("x-request-id")??void 0,body:i})}tokenRefused(t){return(this.io.env.PALBASE_TOKEN??"").startsWith("pbe_")?new y("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)"}):new y("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 Xl(this.io,this.cloud,t);return await this.state.writeSession(n),this.session=n,n}async send(t,n,s,a){let r=`${this.cloud.studioApi}${$b}${n}`;this.debug&&this.io.stderr(`> ${t} ${r}
11
11
  `);try{let i=await this.io.fetch(r,{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 y("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function ep(e){return new y("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 li(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 Rb(e){try{return JSON.parse(e)}catch{return e}}var tp={version:"0.19.2"};var Ta=tp.version;async function ip(e,t,n){let s=new Map(n.map(i=>[i.name,i])),a=e.includes("--json"),r=e.includes("--debug");try{let{name:i,at:o}=Cb(e);if(i===void 0)return e.includes("--version")?(t.stdout(`palbase ${Ta}
12
+ `),i}catch(i){throw new y("network_error",`Studio (${this.cloud.studioApi}) could not be reached: ${i instanceof Error?i.message:String(i)}`)}}};function ep(e){return new y("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 li(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 Rb(e){try{return JSON.parse(e)}catch{return e}}var tp={version:"0.20.0"};var Ta=tp.version;async function ip(e,t,n){let s=new Map(n.map(i=>[i.name,i])),a=e.includes("--json"),r=e.includes("--debug");try{let{name:i,at:o}=Cb(e);if(i===void 0)return e.includes("--version")?(t.stdout(`palbase ${Ta}
13
13
  `),0):(t.stdout(rp(n)),e.length===0||e.includes("--help")||e.includes("-h")?0:2);if(i==="help"){let S=e[o+1],$=S===void 0?void 0:s.get(S);if(S!==void 0&&!$)throw np(S,n);return t.stdout($?ap($):rp(n)),0}let l=s.get(i);if(!l)throw np(i,n);let d=[...e.slice(0,o),...e.slice(o+1)];if(d.includes("--help")||d.includes("-h"))return t.stdout(ap(l)),0;let{flags:p,positionals:u}=jb(l,d),h=l.args??{min:0,max:0};if(u.length<h.min)throw m(`${l.name} needs ${h.min===1?"an argument":`${h.min} arguments`}`,di(l));if(u.length>h.max)throw m(`${l.name} takes ${h.max===0?"no argument":`at most ${h.max}`}: ${JSON.stringify(u.slice(h.max))} is left over`,di(l));let b={project:p.project,env:p.env,json:p.json===!0,nonInteractive:p["non-interactive"]===!0,yes:p.yes===!0,debug:p.debug===!0},w=Bl(t.env),k=new $a(Wl(t.configDir,w)),C={io:t,state:k,out:new Sa(t,b.json),global:b,args:u,flags:p,interactive:t.interactive&&!b.nonInteractive,cloud:w,studio:new Ra(t,w,k,b.debug)};return await l.run(C)??0}catch(i){return Ob(i,t,a,r)}}function Cb(e){let t=new Set;for(let[n,s]of Object.entries(ka))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 jb(e,t){let n={...ka,...e.flags??{}},s={};for(let[a,r]of Object.entries(n))s[a]={type:r.type,...r.short?{short:r.short}:{},...r.multiple?{multiple:!0}:{}};try{let{values:a,positionals:r}=Eb({args:t,options:s,strict:!0,allowPositionals:!0});return{flags:a,positionals:r}}catch(a){throw m(a instanceof Error?a.message.replace(/^.*?: /,""):String(a),`palbase help ${e.name}`)}}function Ob(e,t,n,s){let a="error",r,i,o=1,l;return e instanceof y?(a=e.code,r=e.message,i=e.hint,o=e.exitCode):e instanceof O?(a=e.code,r=e.message,l=e.requestId):r=e instanceof Error?e.message:String(e),n&&e instanceof y&&e.reported||(n?t.stdout(`${JSON.stringify({error:a,message:r,...i?{hint:i}:{},...l?{request_id:l}:{}},null,2)}
14
14
  `):(t.stderr(`error: ${K(r)}${l?` (request ${K(l)})`:""}
15
15
  `),i&&t.stderr(` ${K(i)}
@@ -18,7 +18,7 @@ var Jy=Object.defineProperty;var tt=(e,t)=>{for(var n in t)Jy(e,n,{get:t[n],enum
18
18
  `)}
19
19
  `}function rp(e){let t=new Map;for(let a of e){let r=a.name.includes(":")?a.name.slice(0,a.name.indexOf(":")):"";t.set(r,[...t.get(r)??[],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,r]of t){s.push(a===""?"Commands:":`${a}:`);for(let i of r)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
- `}import{createHash as vO,randomBytes as _O,timingSafeEqual as kO}from"node:crypto";import{createServer as $O}from"node:http";var ui="owner.json";var RO=300*1e3;function U(e,t){try{return g("palbase",e,t)}catch(n){throw n instanceof O&&n.code==="invalid_path_parameter"?new y("unsafe_path",`${e} cannot be ${t===""?"empty":JSON.stringify(t)}: a request's path cannot carry it`):n}}var op={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"}},scope:"none",async run(e){if(e.io.env.PALBASE_TOKEN)throw new y("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"});let t=await Vl(e.io,e.cloud),n=`${e.cloud.studioWeb}/device`;e.out.note(""),e.out.note(` Enter this code in your browser: ${t.user_code}`),e.out.note("");let s=e.flags["no-browser"]!==!0&&e.interactive&&await e.io.openBrowser(n);e.out.note(s?`Opened ${n} \u2014 sign in there if asked, then enter the code.`:`Open ${n} on any device, sign in, and enter the code.`),e.out.note("Waiting for the approval\u2026");let a=await Hl(e.io,e.cloud,t);await e.state.writeSession(a),e.out.result({user:a.user},()=>e.out.line(`Signed in as ${a.user.email??a.user.id}.`))}},lp={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 y("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/${U("the environment's ref",n)}/personal-key/${U("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(ui);try{await Yl(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}.`))}},pp={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("pbo_")){let{organizations:a}=await e.studio.get("/orgs"),r=a[0];n={id:`token \u2026${t.slice(-4)}`,via:"token",...r&&{organization:{id:r.id,name:r.name,role:r.role}}}}else if(t){let a=Pa(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 ${K(n.organization.name)} (${n.organization.role}), ${n.id} (PALBASE_TOKEN)`:`${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 Ea={};tt(Ea,{client:()=>Mb});function Mb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ListAgentVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,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/"+g("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/"+g("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/"+g("DecideChatApproval","chat_id",t.path.chat_id)+"/approvals/"+g("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 forkChat(t){return e.send({op:"ForkChat",method:"POST",path:"/ai/chats/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 putChatMember(t){return e.send({op:"PutChatMember",method:"PUT",path:"/ai/chats/"+g("PutChatMember","chat_id",t.path.chat_id)+"/members/"+g("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/"+g("DeleteChatMember","chat_id",t.path.chat_id)+"/members/"+g("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/"+g("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/"+g("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/"+g("GetChatMessageAttachment","chat_id",t.path.chat_id)+"/messages/"+g("GetChatMessageAttachment","message_id",t.path.message_id)+"/attachments/"+g("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/"+g("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/"+g("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/"+g("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/"+g("SendSubagentMessage","chat_id",t.path.chat_id)+"/runs/"+g("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/"+g("StopSubagent","chat_id",t.path.chat_id)+"/runs/"+g("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/"+g("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/"+g("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/"+g("GetChatToolCall","chat_id",t.path.chat_id)+"/tool-calls/"+g("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/"+g("AnswerChatToolCall","chat_id",t.path.chat_id)+"/tool-outputs/"+g("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/"+g("ListChatTurnArtifacts","chat_id",t.path.chat_id)+"/turns/"+g("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/"+g("GetChatTurnArtifact","chat_id",t.path.chat_id)+"/turns/"+g("GetChatTurnArtifact","response_id",t.path.response_id)+"/artifacts/"+g("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/"+g("GetChatTurnCost","chat_id",t.path.chat_id)+"/turns/"+g("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/"+g("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/"+g("GetChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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/"+g("CloseChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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/"+g("CommandChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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 getChatWorkspaceFile(t){return e.send({op:"GetChatWorkspaceFile",method:"GET",path:"/ai/chats/"+g("GetChatWorkspaceFile","chat_id",t.path.chat_id)+"/workspace/files",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async addChatWorkspaceRepo(t){return e.send({op:"AddChatWorkspaceRepo",method:"POST",path:"/ai/chats/"+g("AddChatWorkspaceRepo","chat_id",t.path.chat_id)+"/workspace/repos",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"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/"+g("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/"+g("DeleteEndpoint","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/"+g("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/"+g("GetImageFile","image_id",t.path.image_id)+"/files/"+g("GetImageFile","position",t.path.position),auth:[["SecretKeyAuth"]],answers:{200:"raw"},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 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/"+g("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/"+g("DisconnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listRepos(t){return e.send({op:"ListRepos",method:"GET",path:"/ai/repos",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async putRepo(t){return e.send({op:"PutRepo",method:"PUT",path:"/ai/repos/"+g("PutRepo","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteRepo(t){return e.send({op:"DeleteRepo",method:"DELETE",path:"/ai/repos/"+g("DeleteRepo","name",t.path.name),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/"+g("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/"+g("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/"+g("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})}}}var $s={};tt($s,{client:()=>Ib});function Ib(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("DefineEvent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Ps={};tt(Ps,{client:()=>Lb});function Lb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 adminDeleteTestUser(t){return e.send({op:"AdminDeleteTestUser",method:"DELETE",path:"/admin/test-users/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("AdminAssignUserRole","uid",t.path.uid)+"/roles/"+g("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/"+g("AdminRevokeUserRole","uid",t.path.uid)+"/roles/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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"},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/"+g("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/"+g("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/"+g("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"},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/"+g("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/"+g("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"},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"},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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 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/"+g("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})}}}var Ca={};tt(Ca,{client:()=>Db});function Db(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 As={};tt(As,{client:()=>Nb});function Nb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("PutUserValue","user_id",t.path.user_id)+"/"+g("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/"+g("DeleteUserValue","user_id",t.path.user_id)+"/"+g("DeleteUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})}}}var Rs={};tt(Rs,{client:()=>Kb});function Kb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("DeployMachine","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"json"},signal:t.signal})},async getBuild(t){return e.send({op:"GetBuild",method:"GET",path:"/machines/"+g("GetBuild","name",t.path.name)+"/builds/"+g("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/"+g("GetBuildLog","name",t.path.name)+"/builds/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ReadMachineLogs","name",t.path.name)+"/logs",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async getMachineMetrics(t){return e.send({op:"GetMachineMetrics",method:"GET",path:"/machines/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ListCronRuns","name",t.path.name)+"/crons/"+g("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/"+g("RunCron","name",t.path.name)+"/crons/"+g("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/"+g("PauseCron","name",t.path.name)+"/crons/"+g("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/"+g("ResumeCron","name",t.path.name)+"/crons/"+g("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/"+g("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/"+g("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/"+g("GetTask","name",t.path.name)+"/tasks/"+g("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/"+g("CancelTask","name",t.path.name)+"/tasks/"+g("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/"+g("RetryTask","name",t.path.name)+"/tasks/"+g("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/"+g("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/"+g("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/"+g("TemplateTestUser","name",t.path.name)+"/test-users/"+g("TemplateTestUser","user",t.path.user)+"/templates/"+g("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/"+g("DeleteTemplatedTestUser","name",t.path.name)+"/test-users/"+g("DeleteTemplatedTestUser","user",t.path.user),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})}}}var Ts={};tt(Ts,{client:()=>Ub});function Ub(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("PutNotifyProvider","channel",t.path.channel)+"/"+g("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/"+g("DeleteNotifyProvider","channel",t.path.channel)+"/"+g("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/"+g("GetEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetPushTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutPushTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeletePushTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetWhatsAppTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutWhatsAppTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteWhatsAppTemplate","slug",t.path.slug)+"/"+g("DeleteWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,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/"+g("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/"+g("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/"+g("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/"+g("RemoveTopicSubscriber","name",t.path.name)+"/subscribers/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 Es={};tt(Es,{client:()=>zb});function zb(e){return{async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/purchases/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/purchases/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:"/purchases/apple/account-token",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getAppleConnectPage(t){return e.send({op:"GetAppleConnectPage",method:"GET",path:"/purchases/apple/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/purchases/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:"/purchases/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:"/purchases/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async reportAppleTransactions(t){return e.send({op:"ReportAppleTransactions",method:"POST",path:"/purchases/apple/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccountId(t){return e.send({op:"GetGoogleAccountID",method:"POST",path:"/purchases/google/account-id",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async reportGooglePurchases(t){return e.send({op:"ReportGooglePurchases",method:"POST",path:"/purchases/google/purchases",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:"/purchases/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:"/purchases/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/purchases/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/purchases/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:"/purchases/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getCatalog(t){return e.send({op:"GetCatalog",method:"GET",path:"/purchases/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async saveCatalog(t){return e.send({op:"SaveCatalog",method:"PUT",path:"/purchases/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:"/purchases/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:"/purchases/catalog/plans/"+g("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:"/purchases/catalog/plans/"+g("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:"/purchases/catalog/plans/"+g("DeclineCatalogPlan","plan_id",t.path.plan_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async validateCatalog(t){return e.send({op:"ValidateCatalog",method:"POST",path:"/purchases/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:"/purchases/charts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getChartsOverview(t){return e.send({op:"GetChartsOverview",method:"GET",path:"/purchases/charts/overview",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getChart(t){return e.send({op:"GetChart",method:"GET",path:"/purchases/charts/"+g("GetChart","chart",t.path.chart),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getStripeConnectPage(t){return e.send({op:"GetStripeConnectPage",method:"GET",path:"/purchases/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectStripeKey(t){return e.send({op:"ConnectStripeKey",method:"POST",path:"/purchases/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStripeAppInstallPage(t){return e.send({op:"GetStripeAppInstallPage",method:"GET",path:"/purchases/stripe/app/install",auth:[],answers:{200:"raw"},signal:t?.signal})},async startStripeAppInstall(t){return e.send({op:"StartStripeAppInstall",method:"POST",path:"/purchases/stripe/app/install",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeStripeAppInstall(t){return e.send({op:"CompleteStripeAppInstall",method:"GET",path:"/purchases/stripe/app/callback",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("RevokeGrant","customer_id",t.path.customer_id)+"/grants/"+g("RevokeGrant","grant_id",t.path.grant_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async holdSpend(t){return e.send({op:"HoldSpend",method:"POST",path:"/purchases/customers/"+g("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:"/purchases/customers/"+g("SetCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("ClearCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("GrantLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("CommitSpend","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ExtendHold","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ReleaseSpend","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ReverseSpend","customer_id",t.path.customer_id)+"/spends/"+g("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 listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/purchases/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/purchases/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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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 getMyCustomerInfo(t){return e.send({op:"GetMyCustomerInfo",method:"GET",path:"/purchases/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mergeGuest(t){return e.send({op:"MergeGuest",method:"POST",path:"/purchases/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:"/purchases/me/merge-grant",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t?.signal})},async getOfferings(t){return e.send({op:"GetOfferings",method:"GET",path:"/purchases/offerings",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listPaywalls(t){return e.send({op:"ListPaywalls",method:"GET",path:"/purchases/paywalls",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPaywall(t){return e.send({op:"CreatePaywall",method:"POST",path:"/purchases/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:"/purchases/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async registerPaywallAsset(t){return e.send({op:"RegisterPaywallAsset",method:"POST",path:"/purchases/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:"/purchases/paywalls/assets/"+g("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:"/purchases/paywalls/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPaywallTemplateAsset(t){return e.send({op:"GetPaywallTemplateAsset",method:"GET",path:"/purchases/paywalls/templates/"+g("GetPaywallTemplateAsset","key",t.path.key)+"/assets/"+g("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:"/purchases/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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("GetPaywallVersion","paywall_id",t.path.paywall_id)+"/versions/"+g("GetPaywallVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPlacements(t){return e.send({op:"ListPlacements",method:"GET",path:"/purchases/placements",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listAttributeKeys(t){return e.send({op:"ListAttributeKeys",method:"GET",path:"/purchases/placements/attributes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async setPlacement(t){return e.send({op:"SetPlacement",method:"PUT",path:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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 getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStripeAccount(t){return e.send({op:"GetStripeAccount",method:"GET",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectStripe(t){return e.send({op:"DisconnectStripe",method:"DELETE",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkStripeAccount(t){return e.send({op:"CheckStripeAccount",method:"POST",path:"/purchases/stripe/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createCheckout(t){return e.send({op:"CreateCheckout",method:"POST",path:"/purchases/stripe/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:"/purchases/stripe/checkout/redemption",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async redeemPurchase(t){return e.send({op:"RedeemPurchase",method:"POST",path:"/purchases/redemptions/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRedemptionPage(t){return e.send({op:"GetRedemptionPage",method:"GET",path:"/purchases/redeem",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async createStripeGrant(t){return e.send({op:"CreateStripeGrant",method:"POST",path:"/purchases/stripe/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createStripeAppInstall(t){return e.send({op:"CreateStripeAppInstall",method:"POST",path:"/purchases/stripe/app/grants",auth:[["SecretKeyAuth"]],answers:{201:"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:"/purchases/stripe/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveAppleNotification(t){return e.send({op:"ReceiveAppleNotification",method:"POST",path:"/purchases/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:"/purchases/webhooks/google",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveStripeEvent(t){return e.send({op:"ReceiveStripeEvent",method:"POST",path:"/purchases/webhooks/stripe",auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveStripeAppEvent(t){return e.send({op:"ReceiveStripeAppEvent",method:"POST",path:"/purchases/webhooks/stripe-app",auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyOffers(t){return e.send({op:"ListMyOffers",method:"GET",path:"/purchases/offers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async recordOfferView(t){return e.send({op:"RecordOfferView",method:"POST",path:"/purchases/offers/"+g("RecordOfferView","offer_key",t.path.offer_key)+"/views",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async signAppleOffer(t){return e.send({op:"SignAppleOffer",method:"POST",path:"/purchases/offers/"+g("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:"/purchases/offers/"+g("ClaimOffer","offer_key",t.path.offer_key)+"/claim",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async redeemCoupon(t){return e.send({op:"RedeemCoupon",method:"POST",path:"/purchases/coupons/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getOfferStats(t){return e.send({op:"GetOfferStats",method:"GET",path:"/purchases/offers/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listCoupons(t){return e.send({op:"ListCoupons",method:"GET",path:"/purchases/coupons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCoupon(t){return e.send({op:"CreateCoupon",method:"POST",path:"/purchases/coupons",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCoupon(t){return e.send({op:"GetCoupon",method:"GET",path:"/purchases/coupons/"+g("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:"/purchases/coupons/"+g("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:"/purchases/coupons/"+g("ListCouponCodes","coupon_key",t.path.coupon_key)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setXcodeOfferKey(t){return e.send({op:"SetXcodeOfferKey",method:"PUT",path:"/purchases/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 searchCustomers(t){return e.send({op:"SearchCustomers",method:"GET",path:"/purchases/customers",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCustomerHistory(t){return e.send({op:"GetCustomerHistory",method:"GET",path:"/purchases/customers/"+g("GetCustomerHistory","customer_id",t.path.customer_id)+"/history",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listCatalogRevisions(t){return e.send({op:"ListCatalogRevisions",method:"GET",path:"/purchases/catalog/revisions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getCatalogRevision(t){return e.send({op:"GetCatalogRevision",method:"GET",path:"/purchases/catalog/revisions/"+g("GetCatalogRevision","revision",t.path.revision),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async restoreCatalogRevision(t){return e.send({op:"RestoreCatalogRevision",method:"POST",path:"/purchases/catalog/revisions/"+g("RestoreCatalogRevision","revision",t.path.revision)+"/restore",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/purchases/customers/"+g("ExtendSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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:"/purchases/customers/"+g("RefundSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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 cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/purchases/customers/"+g("CancelSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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 setRefundDataConsent(t){return e.send({op:"SetRefundDataConsent",method:"PUT",path:"/purchases/me/refund-data-consent",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Cs={};tt(Cs,{client:()=>Bb});function Bb(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 js={};tt(js,{client:()=>Fb});function Fb(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/"+g("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/"+g("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/"+g("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/"+g("GetSecret","environment",t.path.environment)+"/"+g("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/"+g("PutSecret","environment",t.path.environment)+"/"+g("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/"+g("DeleteSecret","environment",t.path.environment)+"/"+g("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/"+g("RollbackSecret","environment",t.path.environment)+"/"+g("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/"+g("ListSecretVersions","environment",t.path.environment)+"/"+g("ListSecretVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})}}}var Os={};tt(Os,{client:()=>Jb});function Jb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("PutObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("DeleteObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("HeadObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("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/"+g("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/"+g("GetPublicObject","bucket",t.path.bucket)+"/"+g("GetPublicObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async headPublicObject(t){return e.send({op:"HeadPublicObject",method:"HEAD",path:"/storage/public/"+g("HeadPublicObject","bucket",t.path.bucket)+"/"+g("HeadPublicObject","path",t.path.path),auth:[],answers:{200:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getSignedObject(t){return e.send({op:"GetSignedObject",method:"GET",path:"/storage/signed/"+g("GetSignedObject","bucket",t.path.bucket)+"/"+g("GetSignedObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putSignedObject(t){return e.send({op:"PutSignedObject",method:"PUT",path:"/storage/signed/"+g("PutSignedObject","bucket",t.path.bucket)+"/"+g("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/"+g("HeadSignedObject","bucket",t.path.bucket)+"/"+g("HeadSignedObject","path",t.path.path),auth:[],answers:{200:"empty",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/"+g("Upload","machine",t.path.machine)+"/"+g("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 xs={};tt(xs,{client:()=>Wb});function Wb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetFeedback","app_id",t.path.app_id)+"/feedback/"+g("GetFeedback","kind",t.path.kind)+"/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetSignedBundleLink","package_id",t.path.package_id)+"/deliveries/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetReviewAttachment","app_id",t.path.app_id)+"/review/threads/"+g("GetReviewAttachment","thread_id",t.path.thread_id)+"/attachments/"+g("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/"+g("SetReviewDraft","app_id",t.path.app_id)+"/review/threads/"+g("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/"+g("SendReviewDraft","app_id",t.path.app_id)+"/review/threads/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("UnshareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})}}}var ja={attempts:3,maxWaitSeconds:30},Vb=new Set([429,502,503,504]);function ci(e,t=ja){let n=t.sleep??Yb;return{async send(s){let a=Hb(s),r=a.body,i=!r||r.kind!=="raw"||Bn(r.value),o=(a.method==="GET"||a.method==="HEAD"||a.idempotent===!0)&&i;for(let l=1;;l++)try{return await e.send(a)}catch(d){if(!o||l>=t.attempts||!(d instanceof O)||a.signal?.aborted)throw d;let p=Xb(d,l,t.maxWaitSeconds);if(p===void 0)throw d;await n(p*1e3,a.signal)}}}}function Hb(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":Zb()}}:e}function Xb(e,t,n){return Vb.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 Yb(e,t){return new Promise((n,s)=>{if(t?.aborted)return s(t.reason);let a=()=>{clearTimeout(r),s(t?.reason)},r=setTimeout(()=>{t?.removeEventListener("abort",a),n()},e);t?.addEventListener("abort",a,{once:!0})})}function Zb(){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 Qb}from"node:os";var ew=new Set(["apikey","authorization",pi]);function tw(e){let t={accept:"application/json"};for(let[n,s]of Object.entries(e??{}))s!=null&&!ew.has(n.toLowerCase())&&(t[n.toLowerCase()]=String(s));return t}function nw(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 O({op:t,status:0,code:"invalid_path",message:`${t}: a module's path stays at its environment's address`});return s.href}async function sw(e){let t=e.status===204||e.status===304?"":await e.text();if(t!=="")try{return JSON.parse(t)}catch{return t}}function aw(e,t,n){let s=n??{},a=Number(t.headers.get("retry-after")??"");return new O({op:e,status:t.status,code:typeof s.error=="string"?s.error:`http_${t.status}`,message:Oa(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 Ms=class{bytes;contentType;constructor(t,n){this.bytes=t,this.contentType=n}};function rw(e){return e instanceof Ms?{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 we(e,t,n,s,a,r){let i=`${n} ${s}`,o=rw(a),l=await e.module(nw(Ye(e.cloud,t),i,s),{method:n,headers:{...tw(r),...o.headers},body:o.body}),d=await sw(l);if(l.status>=200&&l.status<300)return{status:l.status,body:va(d),etag:l.headers.get("etag")??void 0};throw aw(i,l,d)}var iw=10080*60*1e3;async function gi(e,t,n=!1){let s=await e.state.personalKey(t);if(!n&&s&&Date.parse(s.expires_at)-e.io.now()>iw)return s;let a=await e.post(`/environments/${U("the environment's ref",t)}/personal-key`,{host:Qb().slice(0,100)||"computer"});return await e.state.keepPersonalKey(t,a),a}function Oa(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(r=>{let{pointer:i,message:o}=r??{};return typeof o=="string"?[`${typeof i=="string"&&i!==""?`${i}: `:""}${o}`]:[]}):[];return a.length>0?`${s}: ${a.join("; ")}`:s}import{relative as ow}from"node:path";async function hi(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}),r=await e.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}),i=r.code===0?r.stdout.trim():"";return{root:s,repository:a.code===0?lw(a.stdout.trim()):void 0,branch:i!==""&&i!=="HEAD"?i:void 0,path:ow(s,t).split("\\").join("/")}}function lw(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}var Be="main";async function Ie(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 $e(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 N(e){return`${e.org_name} \u203A ${e.project_name} \u203A ${e.env_name}${e.env_name!==e.env_slug?` (${e.env_slug})`:""}`}function yi(e){return(e.env.PALBASE_TOKEN??"").startsWith("pbe_")}async function bi(e){let[t]=await Ie(e.studio);if(!t)throw new y("token_refused","Studio names no environment for PALBASE_TOKEN",{hint:"mint another: palbase env:tokens:create"});let n=$e(t),s=i=>new y("token_environment",`PALBASE_TOKEN is ${N(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:r}=e.global;if(a!==void 0&&t.project_id!==a&&!fi(t.project_name,a.slice(a.indexOf("/")+1)))throw s(a);if(r!==void 0&&r!==t.slug&&r!==t.ref)throw s(r);if(a===void 0&&r===void 0){let i=await e.state.targetFor(e.io.cwd);if(i&&i.target.env_ref!==t.ref)throw s(`${N(i.target)}, chosen for ${i.dir}`)}return t}async function f(e){if(yi(e.io))return $e(await bi(e));let{project:t,env:n}=e.global;if(t!==void 0||n!==void 0){let i=await Ie(e.studio),o;if(t!==void 0)o=hn(i,t);else{let l=await e.state.targetFor(e.io.cwd);if(!l)throw mi("-E names an environment of the project chosen here, and none is chosen: add -P <project>");o=i.filter(d=>d.project_id===l.target.project_id)}if(n!==void 0){let l=o.find(d=>d.slug===n||d.ref===n);if(!l)throw new y("no_such_environment",`the project has no environment ${JSON.stringify(n)}`,{hint:`its environments: ${o.map(d=>d.slug).join(", ")}`});return $e(l)}return o.length===1?$e(o[0]):$e(await up(e,o,"Which environment?"))}let s=await e.state.targetFor(e.io.cwd);if(s)return s.target;if(!e.interactive)throw mi("no environment is chosen for this directory");let a=await Ie(e.studio);if(a.length===0)throw new y("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let r=$e(await up(e,a,"Which environment?"));return e.out.note(`Acting on ${N(r)}. palbase use remembers it for this directory.`),r}function hn(e,t){let n=e.filter(l=>l.project_id===t);if(n.length>0)return n;let s=t.indexOf("/"),[a,r]=s>=0?[t.slice(0,s),t.slice(s+1)]:[void 0,t],i=e.filter(l=>fi(l.project_name,r)&&(a===void 0||fi(l.org_name,a)||l.organization_id===a)),o=new Set(i.map(l=>l.project_id));if(o.size===0)throw new y("no_such_project",`no project ${JSON.stringify(t)} among yours`,{hint:"palbase projects:list shows them"});if(o.size>1){let l=[...new Set(i.map(d=>`${d.org_name}/${d.project_name}`))].join(", ");throw new y("ambiguous_project",`${JSON.stringify(t)} is a project in more than one organization: ${l}`,{hint:"name it as org/project"})}return i}async function v(e,t,n,s){e.out.note(`${N(t)}: ${n}`);let a=t.env_slug===Be;if(!a&&s===void 0||e.global.yes)return;if(!e.interactive)throw new y("confirmation_needed",a?`${t.project_name} \u203A ${t.env_name} is the project's production environment`:s,{hint:"confirm with -y"});let r=(await e.io.prompt(K(`${a?`This is ${t.project_name}'s production environment`:s}. Go ahead? [y/N] `))).trim().toLowerCase();if(r!=="y"&&r!=="yes")throw new y("cancelled","nothing was changed")}async function up(e,t,n){if(!e.interactive)throw mi(`${n.replace(/\?$/,"")}: ${t.map(s=>`${s.project_name}/${s.slug}`).join(", ")}`);for(t.forEach((s,a)=>e.out.note(` ${String(a+1).padStart(2)}) ${N($e(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 mi(e){return new y("no_target",e,{hint:"choose one here with palbase use, or pass -P <project> -E <env>"})}function fi(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})===0}import{randomUUID as pw}from"node:crypto";import{readFile as dw}from"node:fs/promises";import{resolve as uw}from"node:path";var cw=6,wi=0,cp=[];async function gw(e){wi<cw?wi++:await new Promise(t=>cp.push(t));try{return await e()}finally{let t=cp.shift();t?t():wi--}}async function Le(e,t,n,s,a,r){return gw(()=>we(e.studio,t.env_ref,n,s,a,r))}async function c(e,t,n,s,a,r){return(await Le(e,t,n,s,a,r)).body}async function De(e,t,n){let s=await Le(e,t,"GET",n);return{body:s.body,etag:s.etag}}function Re(e){return e?{"if-match":e}:void 0}function E(){return{"idempotency-key":pw()}}function _(e){return encodeURIComponent(e)}function Wt(e){return e.map(t=>{let n=t.indexOf("=");if(n<=0)throw m(`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 m(`${JSON.stringify(t.slice(0,n))} is not a key`);return{path:s,value:bt(t.slice(n+1))}})}function bt(e){try{return JSON.parse(e)}catch{return e}}function Vt(e,t){let n=structuredClone(e);for(let{path:s,value:a}of t){let r=n;for(let i of s.slice(0,-1)){let o=r[i];(typeof o!="object"||o===null)&&(r[i]={}),r=r[i]}r[s[s.length-1]]=a}return n}function Ot(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(n=>!Ke(e[n],t[n])).sort()}function gp(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 Ke(e,t){return gp(e)===gp(t)}function Te(e){return e===void 0?"(not set)":typeof e=="string"&&e!==""?e:JSON.stringify(e)}function Jn(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)} ${Te(t[a])}`)}function nt(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 fe(e,t,n){let s;if(t!==void 0&&t!=="-")try{s=await dw(uw(e.io.cwd,t),"utf8")}catch(a){throw new y("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 m(`no ${n} was given`,t===void 0?"pass --file <path>, or pipe it in":void 0);return s}function pe(e,t){try{return JSON.parse(e)}catch(n){throw m(`${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}}async function Oe(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 m(`no ${t} was piped in`,"pipe it in: palbase \u2026 < file");return n}function Wn(e){if(e.flags.enable===!0&&e.flags.disable===!0)throw m("--enable and --disable are one or the other");if(e.flags.enable===!0)return!0;if(e.flags.disable===!0)return!1}function xt(e,t){if(e!==void 0){if(e==="yes"||e==="true")return!0;if(e==="no"||e==="false")return!1;throw m(`--${t} is yes or no`)}}function ae(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 te(e,t){if(e===void 0)return;let n=Number(e);if(!Number.isInteger(n)||n<0)throw m(`--${t} is a whole number`);return n}var Is={enable:{type:"boolean",description:"turn it on"},disable:{type:"boolean",description:"turn it off"}};async function Q(e,t,n){try{await n(),e.done(t)}catch(s){if(!(s instanceof O))throw s;e.left(`${t}: refused \u2014 ${s.message}`)}}function de(e,t){return e.filter(n=>n.key.startsWith(t)).map(n=>({...n,name:n.key.slice(t.length)}))}function vi(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>!(t==null||t===""||Array.isArray(t)&&t.length===0)))}import{randomBytes as Lp}from"node:crypto";import{chmod as Lw,lstat as Dw,readFile as jp,rename as Nw,writeFile as Op}from"node:fs/promises";function hp(){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 Mt=class extends Error{code;constructor(t,n){super(n),this.name="FieldError",this.code=t}},xa="pbe1.",hw="pbl1.",mw=6e4,_i="[A-Za-z_][A-Za-z0-9_$]{0,62}",fw=new RegExp(`^${_i}\\.${_i}(\\.${_i})?$`);function yw(e){return fw.test(e)}var Ls=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),()=>{})},mw),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 Mt("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 Mt("unknown_key","the project has no field key in force");return t.id}encrypt(t,n){let s=this.ready();ki(t);let a=this.currentKey(),r=s.randomBytes(12);return bw(s,this.keys.get(a).key,r,a,t,n)}decrypt(t,n){let s=this.ready();if(ki(t),!n.startsWith(xa))throw new Mt("not_encrypted",`${t} holds a value that is not encrypted`);let a=n.slice(xa.length),r=a.indexOf("."),i=r<0?a:a.slice(0,r),o=this.keys.get(i);if(o===void 0)throw new Mt("unknown_key",`${t} was sealed with field key ${i}, which this project does not hold`);let l=Buffer.from(a.slice(r+1),"base64url");if(r<0||l.length<28||l.toString("base64url")!==a.slice(r+1))throw new Mt("unopenable",`${t} holds a value that does not open here`);try{let d=s.createDecipheriv("aes-256-gcm",o.key,l.subarray(0,12));return d.setAAD(mp(t)),d.setAuthTag(l.subarray(l.length-16)),Buffer.concat([d.update(l.subarray(12,l.length-16)),d.final()]).toString("utf8")}catch{throw new Mt("unopenable",`${t} holds a value that does not open here: tampered, or another column's`)}}isEncrypted(t){return t.startsWith(xa)}lookup(t,n){let s=this.ready();return ki(t),ww(s,this.lookupKey,t,n)}};function ki(e){if(!yw(e))throw new TypeError(`a field's address is table.column, or schema.table.column, not ${JSON.stringify(e)}`)}function mp(e){return Buffer.from(`pbe1\0${e}`,"utf8")}function bw(e,t,n,s,a,r){let i=e.createCipheriv("aes-256-gcm",t,n);i.setAAD(mp(a));let o=Buffer.concat([n,i.update(r,"utf8"),i.final(),i.getAuthTag()]);return`${xa}${s}.${o.toString("base64url")}`}function ww(e,t,n,s){let a=e.createHmac("sha256",t);return a.update(`pbl1\0${n}\0`,"utf8"),a.update(s,"utf8"),`${hw}${a.digest("base64url")}`}var $i="pbt1.",ot="Palbase-Encryption";var La="x-palbase-encrypted",ve=class extends Error{code;constructor(t,n){super(n),this.name="TransitError",this.code=t}},Ht=new TextEncoder,vw=new TextDecoder("utf-8",{fatal:!0}),lt=()=>{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 qe(e){return new Uint8Array(new ArrayBuffer(e))}function pt(...e){let t=qe(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 wt(e){return pt(e)}function Ns(e,t){let n=qe(t);for(let s=t-1;s>=0;s--)n[s]=e&255,e>>>=8;return n}function qs(e){let t="";for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function vt(e){let t=e.replace(/=+$/,"");if(!/^[A-Za-z0-9_-]*$/.test(t)||t.length%4===1)throw new ve("malformed","not base64url");let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4)),s=qe(n.length);for(let a=0;a<n.length;a++)s[a]=n.charCodeAt(a);return s}var fp=pt(Ht.encode("KEM"),Ns(32,2)),Ds=pt(Ht.encode("HPKE"),Ns(32,2),Ns(1,2),Ns(1,2)),yp=Ht.encode("HPKE-v1"),_w=16,kw=12,Sw=32,bp=Uint8Array.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);async function wp(e,t){let n=await lt().importKey("raw",e.length===0?qe(32):wt(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return new Uint8Array(await lt().sign("HMAC",n,wt(t)))}async function Ma(e,t,n,s){return wp(t,pt(yp,e,Ht.encode(n),s))}async function Si(e,t,n,s,a){let r=pt(Ns(a,2),yp,e,Ht.encode(n),s),i=qe(a),o=qe(0);for(let l=1,d=0;d<a;l++)o=await wp(t,pt(o,r,Uint8Array.of(l))),i.set(o.subarray(0,Math.min(o.length,a-d)),d),d+=o.length;return i}async function vp(e){if(e.length!==32)throw new ve("malformed","an X25519 private key is 32 bytes");return lt().importKey("pkcs8",pt(bp,e),{name:"X25519"},!1,["deriveBits"])}async function _p(e){if(e.length!==32)throw new ve("malformed","an X25519 public key is 32 bytes");return lt().importKey("raw",wt(e),{name:"X25519"},!1,[])}async function kp(e,t){return new Uint8Array(await lt().deriveBits({name:"X25519",public:t},e,256))}async function Sp(e,t,n){let s=await Ma(fp,qe(0),"eae_prk",e);return Si(fp,s,"shared_secret",pt(t,n),Sw)}async function $p(e,t){let n=await Ma(Ds,qe(0),"psk_id_hash",qe(0)),s=await Ma(Ds,qe(0),"info_hash",t),a=pt(Uint8Array.of(0),n,s),r=await Ma(Ds,e,"secret",qe(0));return{key:await Si(Ds,r,"key",a,_w),nonce:await Si(Ds,r,"base_nonce",a,kw)}}async function Da(e,t,n,s,a){let r=await lt().importKey("raw",wt(t),"AES-GCM",!1,[e]);return new Uint8Array(await lt()[e]({name:"AES-GCM",iv:wt(n),additionalData:wt(s)},r,wt(a)))}async function Pi(e,t,n,s=qe(0),a){let r,i;if(a)r=await vp(a.privateKey),i=wt(a.publicKey);else{let p=await lt().generateKey({name:"X25519"},!0,["deriveBits"]);r=p.privateKey,i=new Uint8Array(await lt().exportKey("raw",p.publicKey))}let o=await Sp(await kp(r,await _p(e)),i,e),{key:l,nonce:d}=await $p(o,t);return{enc:i,ct:await Da("encrypt",l,d,s,n)}}async function $w(e,t,n,s,a,r=qe(0)){if(n.length!==32)throw new ve("malformed","an encapsulated X25519 key is 32 bytes");try{let i=await Sp(await kp(await vp(e),await _p(n)),n,t),{key:o,nonce:l}=await $p(i,s);return await Da("decrypt",o,l,r,a)}catch{throw new ve("unopenable","the request's key does not open with the project's key it names")}}async function Pp(e){let t=await lt().importKey("pkcs8",pt(bp,e),{name:"X25519"},!0,["deriveBits"]),n=await lt().exportKey("jwk",t);return vt(n.x)}function Na(e,t,n,s=[]){if(s.some(a=>a.includes("\0")))throw new ve("malformed","a path's value holds no NUL");return Ht.encode(["palbase-encryption","1",e,t.toUpperCase(),Pw(n),...s].join("\0"))}function Pw(e){return e.replace(/\{[^/{}]*\}/g,"{}")}async function Ap(e,t,n,s={}){let a=s.key?wt(s.key):crypto.getRandomValues(qe(32)),{enc:r,ct:i}=await Pi(t,n,a,qe(0),s.ephemeral);return{kid:e,key:a,header:`1.${e}.${qs(r)}.${qs(i)}`}}function Ai(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 ve("malformed",`${ot} is 1.<key id>.<enc>.<ct>`);let n=vt(t[2]),s=vt(t[3]);if(n.length!==32||s.length!==48)throw new ve("malformed",`${ot} carries a 32-byte encapsulated key and a sealed 32-byte key`);return{kid:t[1],enc:n,ct:s}}async function Rp(e,t,n,s){let{enc:a,ct:r}=Ai(e),i=await $w(t,n,a,s,r);if(i.length!==32)throw new ve("unopenable","the request's key is not 32 bytes");return i}function Tp(e){return Ht.encode(`pbt1\0${e}`)}async function Ks(e,t,n,s){let a=s?wt(s):crypto.getRandomValues(qe(12)),r=JSON.stringify(n);if(r===void 0)throw new ve("malformed",`${t}: an encrypted field holds a JSON value`);let i=await Da("encrypt",e,a,Tp(t),Ht.encode(r));return $i+qs(pt(a,i))}function Gs(e){return typeof e=="string"&&e.startsWith($i)}async function qa(e,t,n){if(!Gs(n))throw new ve("unopenable",`${t} is not an encrypted field`);let s;try{s=vt(n.slice($i.length))}catch{throw new ve("unopenable",`${t} is not an encrypted field`)}if(s.length<28)throw new ve("unopenable",`${t} is too short to be an encrypted field`);let a;try{a=await Da("decrypt",e,s.subarray(0,12),Tp(t),s.subarray(12))}catch{throw new ve("unopenable",`${t} does not open: changed, moved from another field, or another request's`)}try{return JSON.parse(vw.decode(a))}catch{throw new ve("unopenable",`${t} opens to no JSON value`)}}function Ka(e){return e.replace(/~/g,"~0").replace(/\//g,"~1").replace(/\*/g,"~2")}function Aw(e){return e.replace(/~2/g,"*").replace(/~1/g,"/").replace(/~0/g,"~")}var Ep=Symbol("items");function Rw(e,t){if(!(e!==t&&!e.startsWith(t+"/")))return e===t?[]:e.slice(t.length+1).split("/").map(n=>n==="*"?Ep:Aw(n))}async function Vn(e,t,n,s){let a=e;for(let r of n){let i=Rw(r,t);i!==void 0&&(a=await Ia(a,i,t,s))}return a}async function Ia(e,t,n,s){if(t.length===0)return e===void 0?void 0:s(n,e);let[a,...r]=t;if(a===Ep){if(!Array.isArray(e))return e;let o=[];for(let[l,d]of e.entries())o.push(await Ia(d,r,`${n}/${l}`,s));return o}if(Array.isArray(e)){if(!/^(0|[1-9][0-9]*)$/.test(a)||Number(a)>=e.length)return e;let o=[...e];return o[Number(a)]=await Ia(o[Number(a)],r,`${n}/${a}`,s),o}if(typeof e!="object"||e===null||Array.isArray(e)||!Object.hasOwn(e,a))return e;let i={...e};return i[a]=await Ia(i[a],r,`${n}/${Ka(a)}`,s),i}var dt=class extends Error{status=400;code;data;constructor(t,n,s={}){super(n),this.name="TransitRefusal",this.code=t,this.data=s}},Tw=6e4,Ew=1e3;function Ri(e){return/^t[1-9][0-9]{0,5}$/.test(e)?Number(e.slice(1)):0}var Us=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(()=>{})},Tw),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 r of s.keys){let i=vt(r.key);a.set(r.id,{privateKey:i,publicKey:this.keys.get(r.id)?.publicKey??await Pp(i)})}this.keys=a,this.order=s.keys.map(r=>r.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(Ri),...[...this.retired].map(Ri))}async key(t){let n=this.now();for(;Ri(t)>this.newest()&&this.heldFrom<n;){let r=this.fetchedAt+Ew-this.now();if(r>0){await this.sleep(r);continue}await this.refresh()}let s=this.keys.get(t),a=this.current();if(this.retired.has(t))throw new dt("encryption_key_retired",`the request is sealed to ${t}, retired: fetch the project's keys again`,{current:a});if(s===void 0)throw new dt("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 dt("encryption_required",`this route carries encrypted fields: the request names its key in ${ot}`,{field:ot,current:this.current()});let n;try{n=Ai(t.header).kid}catch{throw new dt("encryption_unopenable",`${ot} is not one`,{field:ot})}let s=await this.key(n),a;try{a=Na(this.projectId,t.method,t.path,t.params??[])}catch{throw new dt("encryption_unopenable","the request's path holds a value no key is sealed for",{field:ot})}try{return new Ga(n,await Rp(t.header,s.privateKey,s.publicKey,a))}catch(r){throw r instanceof ve?new dt("encryption_unopenable","the request's key does not open: sealed for another project, route or path, or changed",{field:ot}):r}}},Ga=class{kid;key;constructor(t,n){this.kid=t,this.key=n}async open(t,n,s){return Vn(t,n,s,async(a,r)=>{if(!Gs(r))throw new dt("encryption_required",`${a} is an encrypted field: it came plain`,{field:a});try{return await qa(this.key,a,r)}catch{throw new dt("encryption_unopenable",`${a} does not open: changed, moved from another field, or another request's`,{field:a})}})}async seal(t,n){return Vn(t,"/response",n,(s,a)=>Ks(this.key,s,a))}sealField(t,n){return Ks(this.key,t,n)}};var Cw=/^pb_[a-z0-9]+_s/;function Ua(e){if(hp())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"||!Cw.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=ci(ai({baseUrl:e.url,credentials:{secretKey:e.secretKey},fetch:e.fetch,solveProofOfWork:e.solveProofOfWork??!1}),e.retry??ja),n=js.client(t);return{ai:Ea.client(t),analytics:$s.client(t),auth:Ps.client(t),cache:Ca.client(t),fields:new Ls({fetch:async s=>(await n.getFieldKeys({signal:s})).data}),flags:As.client(t),machines:Rs.client(t),notify:Ts.client(t),purchases:Es.client(t),realtime:Cs.client(t),secrets:n,storage:Os.client(t),stores:xs.client(t),transit:new Us({fetch:async s=>(await n.getTransitKeys({signal:s})).data}),transport:t,url:new URL(e.url).origin}}var q1=1024*1024;var U1=8*1024;var V1=16*1024,H1=10*6e4;var xw=/^[A-Za-z_][A-Za-z0-9_]{0,127}$/,Mw=/^(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 Ti(e){return!xw.test(e)||Mw.test(e)||/_PROXY$/i.test(e)}var Iw=/^(PORT|PALBASE_(URL|PROJECT_ID|MACHINE|REPLICAS|SECRET_KEY|WEBHOOK_SECRET|PLATFORM_SECRET|CONTRACT_OUT|SECRETS|DB_[A-Z0-9_]+))$/;function Ei(e){return Iw.test(e)}import"node:os";import{join as qw,resolve as Kw}from"node:path";var Ix=10080*60*1e3,Cp="# >>> palbase (palbase env:pull writes this block; edit outside it)",Ci="# <<< palbase";async function zs(e,t){let n=await gi(e.studio,t.env_ref),{keys:s}=await e.studio.get(`/environments/${U("the environment's ref",t.env_ref)}/keys`),a=s.find(r=>r.id===n.id);return a&&!a.revoked_at?n:gi(e.studio,t.env_ref,!0)}async function za(e,t){let n=await e.studio.get(`/environments/${t.env_ref}`);return{url:Ye(e.cloud,t.env_ref),projectId:n.platform_id,key:await zs(e,t)}}function Ba(e){let t=e.flags.secrets??"development";if(t!=="development"&&t!=="production")throw m("--secrets is development or production");return t}function Fa(e,t){return t==="production"?`the app reads ${e.project_name} \u203A ${e.env_name}'s production secrets here`:void 0}var Ja={type:"string",value:"set",description:"the project's secrets the app reads at boot: development (default) or production"},xp={name:"env:pull",summary:"write what the backend needs to run here into .env.local: the environment's address and your own key \u2014 no secret's value",usage:"[--file <path>] [--secrets development|production]",details:["The app reads the project's secrets at boot (PALBASE_SECRETS); their names are listed as comments: set one in the file to override it.","The key is yours (CLI \u2014 you (this computer)), good for 30 days, made again by env:pull and run; palbase logout revokes it.","Only the block between the palbase markers is written; the rest of the file stays as it is."],flags:{file:{type:"string",value:"path",description:"the file (default .env.local)"},secrets:Ja},scope:"environment",async run(e){let t=await f(e),n=Ba(e);(t.env_slug===Be||n==="production")&&await v(e,t,`write a key of ${t.env_slug===Be?"the production environment":`${t.env_slug}`} into a file on this computer`,Fa(t,n));let s=await za(e,t),a=await we(e.studio,t.env_ref,"GET",`/secrets/${n}`).then(b=>(b.body.secrets??b.body.items??[]).map(w=>w.name).filter(w=>typeof w=="string"&&!Ti(w)).sort(),()=>[]),r=Kw(e.io.cwd,e.flags.file??".env.local"),i=[Cp,`# ${ji(N(t))} \u2014 ${new Date(e.io.now()).toISOString()}`,`# PALBASE_SECRET_KEY is your own: ${ji(s.key.label)}, good until ${ji(s.key.expires_at)}.`,`PALBASE_URL=${s.url}`,`PALBASE_PROJECT_ID=${s.projectId}`,`PALBASE_SECRET_KEY=${s.key.key}`,`PALBASE_SECRETS=${n}`,...a.length>0?[`# The ${n} secrets, read at boot \u2014 set one here to override it:`,...a.map(b=>`# ${b}=`)]:[],Ci].join(`
21
+ `}import{createHash as vO,randomBytes as _O,timingSafeEqual as kO}from"node:crypto";import{createServer as $O}from"node:http";var ui="owner.json";var RO=300*1e3;function U(e,t){try{return g("palbase",e,t)}catch(n){throw n instanceof O&&n.code==="invalid_path_parameter"?new y("unsafe_path",`${e} cannot be ${t===""?"empty":JSON.stringify(t)}: a request's path cannot carry it`):n}}var op={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"}},scope:"none",async run(e){if(e.io.env.PALBASE_TOKEN)throw new y("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"});let t=await Vl(e.io,e.cloud),n=`${e.cloud.studioWeb}/device`;e.out.note(""),e.out.note(` Enter this code in your browser: ${t.user_code}`),e.out.note("");let s=e.flags["no-browser"]!==!0&&e.interactive&&await e.io.openBrowser(n);e.out.note(s?`Opened ${n} \u2014 sign in there if asked, then enter the code.`:`Open ${n} on any device, sign in, and enter the code.`),e.out.note("Waiting for the approval\u2026");let a=await Hl(e.io,e.cloud,t);await e.state.writeSession(a),e.out.result({user:a.user},()=>e.out.line(`Signed in as ${a.user.email??a.user.id}.`))}},lp={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 y("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/${U("the environment's ref",n)}/personal-key/${U("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(ui);try{await Yl(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}.`))}},pp={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("pbo_")){let{organizations:a}=await e.studio.get("/orgs"),r=a[0];n={id:`token \u2026${t.slice(-4)}`,via:"token",...r&&{organization:{id:r.id,name:r.name,role:r.role}}}}else if(t){let a=Pa(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 ${K(n.organization.name)} (${n.organization.role}), ${n.id} (PALBASE_TOKEN)`:`${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 Ea={};tt(Ea,{client:()=>Mb});function Mb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ListAgentVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,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/"+g("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/"+g("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/"+g("DecideChatApproval","chat_id",t.path.chat_id)+"/approvals/"+g("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 forkChat(t){return e.send({op:"ForkChat",method:"POST",path:"/ai/chats/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 putChatMember(t){return e.send({op:"PutChatMember",method:"PUT",path:"/ai/chats/"+g("PutChatMember","chat_id",t.path.chat_id)+"/members/"+g("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/"+g("DeleteChatMember","chat_id",t.path.chat_id)+"/members/"+g("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/"+g("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/"+g("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/"+g("GetChatMessageAttachment","chat_id",t.path.chat_id)+"/messages/"+g("GetChatMessageAttachment","message_id",t.path.message_id)+"/attachments/"+g("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/"+g("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/"+g("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/"+g("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/"+g("SendSubagentMessage","chat_id",t.path.chat_id)+"/runs/"+g("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/"+g("StopSubagent","chat_id",t.path.chat_id)+"/runs/"+g("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/"+g("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/"+g("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/"+g("GetChatToolCall","chat_id",t.path.chat_id)+"/tool-calls/"+g("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/"+g("AnswerChatToolCall","chat_id",t.path.chat_id)+"/tool-outputs/"+g("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/"+g("ListChatTurnArtifacts","chat_id",t.path.chat_id)+"/turns/"+g("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/"+g("GetChatTurnArtifact","chat_id",t.path.chat_id)+"/turns/"+g("GetChatTurnArtifact","response_id",t.path.response_id)+"/artifacts/"+g("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/"+g("GetChatTurnCost","chat_id",t.path.chat_id)+"/turns/"+g("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/"+g("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/"+g("GetChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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/"+g("CloseChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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/"+g("CommandChatVoice","chat_id",t.path.chat_id)+"/voice/"+g("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 getChatWorkspaceFile(t){return e.send({op:"GetChatWorkspaceFile",method:"GET",path:"/ai/chats/"+g("GetChatWorkspaceFile","chat_id",t.path.chat_id)+"/workspace/files",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async addChatWorkspaceRepo(t){return e.send({op:"AddChatWorkspaceRepo",method:"POST",path:"/ai/chats/"+g("AddChatWorkspaceRepo","chat_id",t.path.chat_id)+"/workspace/repos",auth:[["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"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/"+g("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/"+g("DeleteEndpoint","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/"+g("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/"+g("GetImageFile","image_id",t.path.image_id)+"/files/"+g("GetImageFile","position",t.path.position),auth:[["SecretKeyAuth"]],answers:{200:"raw"},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 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/"+g("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/"+g("DisconnectProvider","provider",t.path.provider),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})},async listRepos(t){return e.send({op:"ListRepos",method:"GET",path:"/ai/repos",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async putRepo(t){return e.send({op:"PutRepo",method:"PUT",path:"/ai/repos/"+g("PutRepo","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async deleteRepo(t){return e.send({op:"DeleteRepo",method:"DELETE",path:"/ai/repos/"+g("DeleteRepo","name",t.path.name),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/"+g("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/"+g("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/"+g("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})}}}var $s={};tt($s,{client:()=>Ib});function Ib(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("DefineEvent","name",t.path.name),auth:[["SecretKeyAuth"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Ps={};tt(Ps,{client:()=>Lb});function Lb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 adminDeleteTestUser(t){return e.send({op:"AdminDeleteTestUser",method:"DELETE",path:"/admin/test-users/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("AdminAssignUserRole","uid",t.path.uid)+"/roles/"+g("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/"+g("AdminRevokeUserRole","uid",t.path.uid)+"/roles/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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"},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/"+g("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/"+g("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/"+g("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"},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/"+g("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/"+g("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"},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"},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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 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/"+g("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})}}}var Ca={};tt(Ca,{client:()=>Db});function Db(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 As={};tt(As,{client:()=>Nb});function Nb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("PutUserValue","user_id",t.path.user_id)+"/"+g("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/"+g("DeleteUserValue","user_id",t.path.user_id)+"/"+g("DeleteUserValue","key",t.path.key),auth:[["SecretKeyAuth"]],answers:{200:"json"},headers:t.headers,signal:t.signal})}}}var Rs={};tt(Rs,{client:()=>Kb});function Kb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("DeployMachine","name",t.path.name)+"/builds",auth:[["SecretKeyAuth"]],answers:{202:"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/"+g("GetBuild","name",t.path.name)+"/builds/"+g("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/"+g("GetBuildLog","name",t.path.name)+"/builds/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ReadMachineLogs","name",t.path.name)+"/logs",auth:[["SecretKeyAuth"]],answers:{200:"raw"},query:t.query,signal:t.signal})},async getMachineMetrics(t){return e.send({op:"GetMachineMetrics",method:"GET",path:"/machines/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("ListCronRuns","name",t.path.name)+"/crons/"+g("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/"+g("RunCron","name",t.path.name)+"/crons/"+g("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/"+g("PauseCron","name",t.path.name)+"/crons/"+g("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/"+g("ResumeCron","name",t.path.name)+"/crons/"+g("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/"+g("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/"+g("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/"+g("GetTask","name",t.path.name)+"/tasks/"+g("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/"+g("CancelTask","name",t.path.name)+"/tasks/"+g("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/"+g("RetryTask","name",t.path.name)+"/tasks/"+g("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/"+g("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/"+g("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/"+g("TemplateTestUser","name",t.path.name)+"/test-users/"+g("TemplateTestUser","user",t.path.user)+"/templates/"+g("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/"+g("DeleteTemplatedTestUser","name",t.path.name)+"/test-users/"+g("DeleteTemplatedTestUser","user",t.path.user),auth:[["SecretKeyAuth"]],answers:{204:"empty"},signal:t.signal})}}}var Ts={};tt(Ts,{client:()=>Ub});function Ub(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("PutNotifyProvider","channel",t.path.channel)+"/"+g("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/"+g("DeleteNotifyProvider","channel",t.path.channel)+"/"+g("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/"+g("GetEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteEmailTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetPushTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutPushTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeletePushTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteSMSTemplate","slug",t.path.slug)+"/"+g("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/"+g("GetWhatsAppTemplate","slug",t.path.slug)+"/"+g("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/"+g("PutWhatsAppTemplate","slug",t.path.slug)+"/"+g("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/"+g("DeleteWhatsAppTemplate","slug",t.path.slug)+"/"+g("DeleteWhatsAppTemplate","locale",t.path.locale),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,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/"+g("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/"+g("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/"+g("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/"+g("RemoveTopicSubscriber","name",t.path.name)+"/subscribers/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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 Es={};tt(Es,{client:()=>zb});function zb(e){return{async getAppleAccount(t){return e.send({op:"GetAppleAccount",method:"GET",path:"/purchases/apple",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectApple(t){return e.send({op:"DisconnectApple",method:"DELETE",path:"/purchases/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:"/purchases/apple/account-token",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async getAppleConnectPage(t){return e.send({op:"GetAppleConnectPage",method:"GET",path:"/purchases/apple/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectAppleKey(t){return e.send({op:"ConnectAppleKey",method:"POST",path:"/purchases/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:"/purchases/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:"/purchases/apple/readiness",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async reportAppleTransactions(t){return e.send({op:"ReportAppleTransactions",method:"POST",path:"/purchases/apple/transactions",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getGoogleAccountId(t){return e.send({op:"GetGoogleAccountID",method:"POST",path:"/purchases/google/account-id",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async reportGooglePurchases(t){return e.send({op:"ReportGooglePurchases",method:"POST",path:"/purchases/google/purchases",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:"/purchases/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:"/purchases/apple/xcode-certificate",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getGoogleAccount(t){return e.send({op:"GetGoogleAccount",method:"GET",path:"/purchases/google",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async connectGoogle(t){return e.send({op:"ConnectGoogle",method:"POST",path:"/purchases/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:"/purchases/google",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async getCatalog(t){return e.send({op:"GetCatalog",method:"GET",path:"/purchases/catalog",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async saveCatalog(t){return e.send({op:"SaveCatalog",method:"PUT",path:"/purchases/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:"/purchases/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:"/purchases/catalog/plans/"+g("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:"/purchases/catalog/plans/"+g("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:"/purchases/catalog/plans/"+g("DeclineCatalogPlan","plan_id",t.path.plan_id)+"/decline",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async validateCatalog(t){return e.send({op:"ValidateCatalog",method:"POST",path:"/purchases/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:"/purchases/charts",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getChartsOverview(t){return e.send({op:"GetChartsOverview",method:"GET",path:"/purchases/charts/overview",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getChart(t){return e.send({op:"GetChart",method:"GET",path:"/purchases/charts/"+g("GetChart","chart",t.path.chart),auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getStripeConnectPage(t){return e.send({op:"GetStripeConnectPage",method:"GET",path:"/purchases/connect",auth:[],answers:{200:"raw"},signal:t?.signal})},async connectStripeKey(t){return e.send({op:"ConnectStripeKey",method:"POST",path:"/purchases/connect",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStripeAppInstallPage(t){return e.send({op:"GetStripeAppInstallPage",method:"GET",path:"/purchases/stripe/app/install",auth:[],answers:{200:"raw"},signal:t?.signal})},async startStripeAppInstall(t){return e.send({op:"StartStripeAppInstall",method:"POST",path:"/purchases/stripe/app/install",auth:[],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async completeStripeAppInstall(t){return e.send({op:"CompleteStripeAppInstall",method:"GET",path:"/purchases/stripe/app/callback",auth:[],answers:{200:"raw"},query:t?.query,signal:t?.signal})},async getCustomer(t){return e.send({op:"GetCustomer",method:"GET",path:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("RevokeGrant","customer_id",t.path.customer_id)+"/grants/"+g("RevokeGrant","grant_id",t.path.grant_id),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})},async holdSpend(t){return e.send({op:"HoldSpend",method:"POST",path:"/purchases/customers/"+g("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:"/purchases/customers/"+g("SetCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("ClearCustomerLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("GrantLimit","customer_id",t.path.customer_id)+"/limits/"+g("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:"/purchases/customers/"+g("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:"/purchases/customers/"+g("CommitSpend","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ExtendHold","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ReleaseSpend","customer_id",t.path.customer_id)+"/spends/"+g("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:"/purchases/customers/"+g("ReverseSpend","customer_id",t.path.customer_id)+"/spends/"+g("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 listExperiments(t){return e.send({op:"ListExperiments",method:"GET",path:"/purchases/experiments",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async startExperiment(t){return e.send({op:"StartExperiment",method:"POST",path:"/purchases/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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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:"/purchases/experiments/"+g("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 getMyCustomerInfo(t){return e.send({op:"GetMyCustomerInfo",method:"GET",path:"/purchases/me",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async mergeGuest(t){return e.send({op:"MergeGuest",method:"POST",path:"/purchases/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:"/purchases/me/merge-grant",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t?.signal})},async getOfferings(t){return e.send({op:"GetOfferings",method:"GET",path:"/purchases/offerings",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async listPaywalls(t){return e.send({op:"ListPaywalls",method:"GET",path:"/purchases/paywalls",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createPaywall(t){return e.send({op:"CreatePaywall",method:"POST",path:"/purchases/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:"/purchases/paywalls/assets",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async registerPaywallAsset(t){return e.send({op:"RegisterPaywallAsset",method:"POST",path:"/purchases/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:"/purchases/paywalls/assets/"+g("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:"/purchases/paywalls/templates",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async getPaywallTemplateAsset(t){return e.send({op:"GetPaywallTemplateAsset",method:"GET",path:"/purchases/paywalls/templates/"+g("GetPaywallTemplateAsset","key",t.path.key)+"/assets/"+g("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:"/purchases/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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("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:"/purchases/paywalls/"+g("GetPaywallVersion","paywall_id",t.path.paywall_id)+"/versions/"+g("GetPaywallVersion","version",t.path.version),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async listPlacements(t){return e.send({op:"ListPlacements",method:"GET",path:"/purchases/placements",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listAttributeKeys(t){return e.send({op:"ListAttributeKeys",method:"GET",path:"/purchases/placements/attributes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async setPlacement(t){return e.send({op:"SetPlacement",method:"PUT",path:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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:"/purchases/placements/"+g("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 getSettings(t){return e.send({op:"GetSettings",method:"GET",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async updateSettings(t){return e.send({op:"UpdateSettings",method:"PUT",path:"/purchases/settings",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getStripeAccount(t){return e.send({op:"GetStripeAccount",method:"GET",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async disconnectStripe(t){return e.send({op:"DisconnectStripe",method:"DELETE",path:"/purchases/stripe",auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async checkStripeAccount(t){return e.send({op:"CheckStripeAccount",method:"POST",path:"/purchases/stripe/check",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createCheckout(t){return e.send({op:"CreateCheckout",method:"POST",path:"/purchases/stripe/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:"/purchases/stripe/checkout/redemption",auth:[["ApiKeyAuth"],["ApiKeyAuth","userJWT"],["SecretKeyAuth"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async redeemPurchase(t){return e.send({op:"RedeemPurchase",method:"POST",path:"/purchases/redemptions/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getRedemptionPage(t){return e.send({op:"GetRedemptionPage",method:"GET",path:"/purchases/redeem",auth:[],answers:{200:"raw"},query:t.query,signal:t.signal})},async createStripeGrant(t){return e.send({op:"CreateStripeGrant",method:"POST",path:"/purchases/stripe/grants",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t?.headers,signal:t?.signal})},async createStripeAppInstall(t){return e.send({op:"CreateStripeAppInstall",method:"POST",path:"/purchases/stripe/app/grants",auth:[["SecretKeyAuth"]],answers:{201:"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:"/purchases/stripe/portal",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveAppleNotification(t){return e.send({op:"ReceiveAppleNotification",method:"POST",path:"/purchases/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:"/purchases/webhooks/google",auth:[],answers:{204:"empty"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveStripeEvent(t){return e.send({op:"ReceiveStripeEvent",method:"POST",path:"/purchases/webhooks/stripe",auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async receiveStripeAppEvent(t){return e.send({op:"ReceiveStripeAppEvent",method:"POST",path:"/purchases/webhooks/stripe-app",auth:[],answers:{200:"empty"},headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async listMyOffers(t){return e.send({op:"ListMyOffers",method:"GET",path:"/purchases/offers",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},signal:t?.signal})},async recordOfferView(t){return e.send({op:"RecordOfferView",method:"POST",path:"/purchases/offers/"+g("RecordOfferView","offer_key",t.path.offer_key)+"/views",auth:[["ApiKeyAuth","userJWT"]],answers:{204:"empty"},signal:t.signal})},async signAppleOffer(t){return e.send({op:"SignAppleOffer",method:"POST",path:"/purchases/offers/"+g("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:"/purchases/offers/"+g("ClaimOffer","offer_key",t.path.offer_key)+"/claim",auth:[["ApiKeyAuth","userJWT"]],answers:{201:"json"},signal:t.signal})},async redeemCoupon(t){return e.send({op:"RedeemCoupon",method:"POST",path:"/purchases/coupons/redeem",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getOfferStats(t){return e.send({op:"GetOfferStats",method:"GET",path:"/purchases/offers/stats",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async listCoupons(t){return e.send({op:"ListCoupons",method:"GET",path:"/purchases/coupons",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t?.signal})},async createCoupon(t){return e.send({op:"CreateCoupon",method:"POST",path:"/purchases/coupons",auth:[["SecretKeyAuth"]],answers:{201:"json"},idempotent:!0,headers:t.headers,body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})},async getCoupon(t){return e.send({op:"GetCoupon",method:"GET",path:"/purchases/coupons/"+g("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:"/purchases/coupons/"+g("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:"/purchases/coupons/"+g("ListCouponCodes","coupon_key",t.path.coupon_key)+"/codes",auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async setXcodeOfferKey(t){return e.send({op:"SetXcodeOfferKey",method:"PUT",path:"/purchases/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 searchCustomers(t){return e.send({op:"SearchCustomers",method:"GET",path:"/purchases/customers",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async getCustomerHistory(t){return e.send({op:"GetCustomerHistory",method:"GET",path:"/purchases/customers/"+g("GetCustomerHistory","customer_id",t.path.customer_id)+"/history",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})},async listCatalogRevisions(t){return e.send({op:"ListCatalogRevisions",method:"GET",path:"/purchases/catalog/revisions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t?.query,signal:t?.signal})},async getCatalogRevision(t){return e.send({op:"GetCatalogRevision",method:"GET",path:"/purchases/catalog/revisions/"+g("GetCatalogRevision","revision",t.path.revision),auth:[["SecretKeyAuth"]],answers:{200:"json"},signal:t.signal})},async restoreCatalogRevision(t){return e.send({op:"RestoreCatalogRevision",method:"POST",path:"/purchases/catalog/revisions/"+g("RestoreCatalogRevision","revision",t.path.revision)+"/restore",auth:[["SecretKeyAuth"]],answers:{200:"json"},idempotent:!0,headers:t.headers,signal:t.signal})},async extendSubscription(t){return e.send({op:"ExtendSubscription",method:"POST",path:"/purchases/customers/"+g("ExtendSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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:"/purchases/customers/"+g("RefundSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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 cancelSubscription(t){return e.send({op:"CancelSubscription",method:"POST",path:"/purchases/customers/"+g("CancelSubscription","customer_id",t.path.customer_id)+"/subscriptions/"+g("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 setRefundDataConsent(t){return e.send({op:"SetRefundDataConsent",method:"PUT",path:"/purchases/me/refund-data-consent",auth:[["ApiKeyAuth","userJWT"]],answers:{200:"json"},body:{kind:"json",contentType:"application/json",value:t.body},signal:t.signal})}}}var Cs={};tt(Cs,{client:()=>Bb});function Bb(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 js={};tt(js,{client:()=>Fb});function Fb(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/"+g("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/"+g("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/"+g("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/"+g("GetSecret","environment",t.path.environment)+"/"+g("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/"+g("PutSecret","environment",t.path.environment)+"/"+g("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/"+g("DeleteSecret","environment",t.path.environment)+"/"+g("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/"+g("RollbackSecret","environment",t.path.environment)+"/"+g("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/"+g("ListSecretVersions","environment",t.path.environment)+"/"+g("ListSecretVersions","name",t.path.name)+"/versions",auth:[["SecretKeyAuth"]],answers:{200:"json"},query:t.query,signal:t.signal})}}}var Os={};tt(Os,{client:()=>Jb});function Jb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("PutObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("DeleteObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("HeadObject","bucket",t.path.bucket)+"/objects/"+g("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/"+g("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/"+g("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/"+g("GetPublicObject","bucket",t.path.bucket)+"/"+g("GetPublicObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async headPublicObject(t){return e.send({op:"HeadPublicObject",method:"HEAD",path:"/storage/public/"+g("HeadPublicObject","bucket",t.path.bucket)+"/"+g("HeadPublicObject","path",t.path.path),auth:[],answers:{200:"empty",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async getSignedObject(t){return e.send({op:"GetSignedObject",method:"GET",path:"/storage/signed/"+g("GetSignedObject","bucket",t.path.bucket)+"/"+g("GetSignedObject","path",t.path.path),auth:[],answers:{200:"raw",206:"raw",304:"empty"},query:t.query,headers:t.headers,signal:t.signal})},async putSignedObject(t){return e.send({op:"PutSignedObject",method:"PUT",path:"/storage/signed/"+g("PutSignedObject","bucket",t.path.bucket)+"/"+g("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/"+g("HeadSignedObject","bucket",t.path.bucket)+"/"+g("HeadSignedObject","path",t.path.path),auth:[],answers:{200:"empty",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/"+g("Upload","machine",t.path.machine)+"/"+g("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 xs={};tt(xs,{client:()=>Wb});function Wb(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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetFeedback","app_id",t.path.app_id)+"/feedback/"+g("GetFeedback","kind",t.path.kind)+"/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetSignedBundleLink","package_id",t.path.package_id)+"/deliveries/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("GetReviewAttachment","app_id",t.path.app_id)+"/review/threads/"+g("GetReviewAttachment","thread_id",t.path.thread_id)+"/attachments/"+g("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/"+g("SetReviewDraft","app_id",t.path.app_id)+"/review/threads/"+g("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/"+g("SendReviewDraft","app_id",t.path.app_id)+"/review/threads/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("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/"+g("UnshareAppleSession","environment",t.path.environment),auth:[["SecretKeyAuth"]],answers:{204:"empty"},idempotent:!0,headers:t.headers,signal:t.signal})}}}var ja={attempts:3,maxWaitSeconds:30},Vb=new Set([429,502,503,504]);function ci(e,t=ja){let n=t.sleep??Yb;return{async send(s){let a=Hb(s),r=a.body,i=!r||r.kind!=="raw"||Bn(r.value),o=(a.method==="GET"||a.method==="HEAD"||a.idempotent===!0)&&i;for(let l=1;;l++)try{return await e.send(a)}catch(d){if(!o||l>=t.attempts||!(d instanceof O)||a.signal?.aborted)throw d;let p=Xb(d,l,t.maxWaitSeconds);if(p===void 0)throw d;await n(p*1e3,a.signal)}}}}function Hb(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":Zb()}}:e}function Xb(e,t,n){return Vb.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 Yb(e,t){return new Promise((n,s)=>{if(t?.aborted)return s(t.reason);let a=()=>{clearTimeout(r),s(t?.reason)},r=setTimeout(()=>{t?.removeEventListener("abort",a),n()},e);t?.addEventListener("abort",a,{once:!0})})}function Zb(){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 Qb}from"node:os";var ew=new Set(["apikey","authorization",pi]);function tw(e){let t={accept:"application/json"};for(let[n,s]of Object.entries(e??{}))s!=null&&!ew.has(n.toLowerCase())&&(t[n.toLowerCase()]=String(s));return t}function nw(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 O({op:t,status:0,code:"invalid_path",message:`${t}: a module's path stays at its environment's address`});return s.href}async function sw(e){let t=e.status===204||e.status===304?"":await e.text();if(t!=="")try{return JSON.parse(t)}catch{return t}}function aw(e,t,n){let s=n??{},a=Number(t.headers.get("retry-after")??"");return new O({op:e,status:t.status,code:typeof s.error=="string"?s.error:`http_${t.status}`,message:Oa(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 Ms=class{bytes;contentType;constructor(t,n){this.bytes=t,this.contentType=n}};function rw(e){return e instanceof Ms?{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 we(e,t,n,s,a,r){let i=`${n} ${s}`,o=rw(a),l=await e.module(nw(Ye(e.cloud,t),i,s),{method:n,headers:{...tw(r),...o.headers},body:o.body}),d=await sw(l);if(l.status>=200&&l.status<300)return{status:l.status,body:va(d),etag:l.headers.get("etag")??void 0};throw aw(i,l,d)}var iw=10080*60*1e3;async function gi(e,t,n=!1){let s=await e.state.personalKey(t);if(!n&&s&&Date.parse(s.expires_at)-e.io.now()>iw)return s;let a=await e.post(`/environments/${U("the environment's ref",t)}/personal-key`,{host:Qb().slice(0,100)||"computer"});return await e.state.keepPersonalKey(t,a),a}function Oa(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(r=>{let{pointer:i,message:o}=r??{};return typeof o=="string"?[`${typeof i=="string"&&i!==""?`${i}: `:""}${o}`]:[]}):[];return a.length>0?`${s}: ${a.join("; ")}`:s}import{relative as ow}from"node:path";async function hi(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}),r=await e.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}),i=r.code===0?r.stdout.trim():"";return{root:s,repository:a.code===0?lw(a.stdout.trim()):void 0,branch:i!==""&&i!=="HEAD"?i:void 0,path:ow(s,t).split("\\").join("/")}}function lw(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}var Be="main";async function Ie(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 $e(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 N(e){return`${e.org_name} \u203A ${e.project_name} \u203A ${e.env_name}${e.env_name!==e.env_slug?` (${e.env_slug})`:""}`}function yi(e){return(e.env.PALBASE_TOKEN??"").startsWith("pbe_")}async function bi(e){let[t]=await Ie(e.studio);if(!t)throw new y("token_refused","Studio names no environment for PALBASE_TOKEN",{hint:"mint another: palbase env:tokens:create"});let n=$e(t),s=i=>new y("token_environment",`PALBASE_TOKEN is ${N(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:r}=e.global;if(a!==void 0&&t.project_id!==a&&!fi(t.project_name,a.slice(a.indexOf("/")+1)))throw s(a);if(r!==void 0&&r!==t.slug&&r!==t.ref)throw s(r);if(a===void 0&&r===void 0){let i=await e.state.targetFor(e.io.cwd);if(i&&i.target.env_ref!==t.ref)throw s(`${N(i.target)}, chosen for ${i.dir}`)}return t}async function f(e){if(yi(e.io))return $e(await bi(e));let{project:t,env:n}=e.global;if(t!==void 0||n!==void 0){let i=await Ie(e.studio),o;if(t!==void 0)o=hn(i,t);else{let l=await e.state.targetFor(e.io.cwd);if(!l)throw mi("-E names an environment of the project chosen here, and none is chosen: add -P <project>");o=i.filter(d=>d.project_id===l.target.project_id)}if(n!==void 0){let l=o.find(d=>d.slug===n||d.ref===n);if(!l)throw new y("no_such_environment",`the project has no environment ${JSON.stringify(n)}`,{hint:`its environments: ${o.map(d=>d.slug).join(", ")}`});return $e(l)}return o.length===1?$e(o[0]):$e(await up(e,o,"Which environment?"))}let s=await e.state.targetFor(e.io.cwd);if(s)return s.target;if(!e.interactive)throw mi("no environment is chosen for this directory");let a=await Ie(e.studio);if(a.length===0)throw new y("no_environments","your account reaches no environment yet",{hint:"make one: palbase projects:create <name>"});let r=$e(await up(e,a,"Which environment?"));return e.out.note(`Acting on ${N(r)}. palbase use remembers it for this directory.`),r}function hn(e,t){let n=e.filter(l=>l.project_id===t);if(n.length>0)return n;let s=t.indexOf("/"),[a,r]=s>=0?[t.slice(0,s),t.slice(s+1)]:[void 0,t],i=e.filter(l=>fi(l.project_name,r)&&(a===void 0||fi(l.org_name,a)||l.organization_id===a)),o=new Set(i.map(l=>l.project_id));if(o.size===0)throw new y("no_such_project",`no project ${JSON.stringify(t)} among yours`,{hint:"palbase projects:list shows them"});if(o.size>1){let l=[...new Set(i.map(d=>`${d.org_name}/${d.project_name}`))].join(", ");throw new y("ambiguous_project",`${JSON.stringify(t)} is a project in more than one organization: ${l}`,{hint:"name it as org/project"})}return i}async function v(e,t,n,s){e.out.note(`${N(t)}: ${n}`);let a=t.env_slug===Be;if(!a&&s===void 0||e.global.yes)return;if(!e.interactive)throw new y("confirmation_needed",a?`${t.project_name} \u203A ${t.env_name} is the project's production environment`:s,{hint:"confirm with -y"});let r=(await e.io.prompt(K(`${a?`This is ${t.project_name}'s production environment`:s}. Go ahead? [y/N] `))).trim().toLowerCase();if(r!=="y"&&r!=="yes")throw new y("cancelled","nothing was changed")}async function up(e,t,n){if(!e.interactive)throw mi(`${n.replace(/\?$/,"")}: ${t.map(s=>`${s.project_name}/${s.slug}`).join(", ")}`);for(t.forEach((s,a)=>e.out.note(` ${String(a+1).padStart(2)}) ${N($e(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 mi(e){return new y("no_target",e,{hint:"choose one here with palbase use, or pass -P <project> -E <env>"})}function fi(e,t){return e.localeCompare(t,void 0,{sensitivity:"accent"})===0}import{randomUUID as pw}from"node:crypto";import{readFile as dw}from"node:fs/promises";import{resolve as uw}from"node:path";var cw=6,wi=0,cp=[];async function gw(e){wi<cw?wi++:await new Promise(t=>cp.push(t));try{return await e()}finally{let t=cp.shift();t?t():wi--}}async function Le(e,t,n,s,a,r){return gw(()=>we(e.studio,t.env_ref,n,s,a,r))}async function c(e,t,n,s,a,r){return(await Le(e,t,n,s,a,r)).body}async function De(e,t,n){let s=await Le(e,t,"GET",n);return{body:s.body,etag:s.etag}}function Re(e){return e?{"if-match":e}:void 0}function E(){return{"idempotency-key":pw()}}function _(e){return encodeURIComponent(e)}function Wt(e){return e.map(t=>{let n=t.indexOf("=");if(n<=0)throw m(`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 m(`${JSON.stringify(t.slice(0,n))} is not a key`);return{path:s,value:bt(t.slice(n+1))}})}function bt(e){try{return JSON.parse(e)}catch{return e}}function Vt(e,t){let n=structuredClone(e);for(let{path:s,value:a}of t){let r=n;for(let i of s.slice(0,-1)){let o=r[i];(typeof o!="object"||o===null)&&(r[i]={}),r=r[i]}r[s[s.length-1]]=a}return n}function Ot(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(n=>!Ke(e[n],t[n])).sort()}function gp(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 Ke(e,t){return gp(e)===gp(t)}function Te(e){return e===void 0?"(not set)":typeof e=="string"&&e!==""?e:JSON.stringify(e)}function Jn(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)} ${Te(t[a])}`)}function nt(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 fe(e,t,n){let s;if(t!==void 0&&t!=="-")try{s=await dw(uw(e.io.cwd,t),"utf8")}catch(a){throw new y("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 m(`no ${n} was given`,t===void 0?"pass --file <path>, or pipe it in":void 0);return s}function pe(e,t){try{return JSON.parse(e)}catch(n){throw m(`${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}}async function Oe(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 m(`no ${t} was piped in`,"pipe it in: palbase \u2026 < file");return n}function Wn(e){if(e.flags.enable===!0&&e.flags.disable===!0)throw m("--enable and --disable are one or the other");if(e.flags.enable===!0)return!0;if(e.flags.disable===!0)return!1}function xt(e,t){if(e!==void 0){if(e==="yes"||e==="true")return!0;if(e==="no"||e==="false")return!1;throw m(`--${t} is yes or no`)}}function ae(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 te(e,t){if(e===void 0)return;let n=Number(e);if(!Number.isInteger(n)||n<0)throw m(`--${t} is a whole number`);return n}var Is={enable:{type:"boolean",description:"turn it on"},disable:{type:"boolean",description:"turn it off"}};async function Q(e,t,n){try{await n(),e.done(t)}catch(s){if(!(s instanceof O))throw s;e.left(`${t}: refused \u2014 ${s.message}`)}}function de(e,t){return e.filter(n=>n.key.startsWith(t)).map(n=>({...n,name:n.key.slice(t.length)}))}function vi(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>!(t==null||t===""||Array.isArray(t)&&t.length===0)))}import{randomBytes as Lp}from"node:crypto";import{chmod as Lw,lstat as Dw,readFile as jp,rename as Nw,writeFile as Op}from"node:fs/promises";function hp(){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 Mt=class extends Error{code;constructor(t,n){super(n),this.name="FieldError",this.code=t}},xa="pbe1.",hw="pbl1.",mw=6e4,_i="[A-Za-z_][A-Za-z0-9_$]{0,62}",fw=new RegExp(`^${_i}\\.${_i}(\\.${_i})?$`);function yw(e){return fw.test(e)}var Ls=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),()=>{})},mw),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 Mt("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 Mt("unknown_key","the project has no field key in force");return t.id}encrypt(t,n){let s=this.ready();ki(t);let a=this.currentKey(),r=s.randomBytes(12);return bw(s,this.keys.get(a).key,r,a,t,n)}decrypt(t,n){let s=this.ready();if(ki(t),!n.startsWith(xa))throw new Mt("not_encrypted",`${t} holds a value that is not encrypted`);let a=n.slice(xa.length),r=a.indexOf("."),i=r<0?a:a.slice(0,r),o=this.keys.get(i);if(o===void 0)throw new Mt("unknown_key",`${t} was sealed with field key ${i}, which this project does not hold`);let l=Buffer.from(a.slice(r+1),"base64url");if(r<0||l.length<28||l.toString("base64url")!==a.slice(r+1))throw new Mt("unopenable",`${t} holds a value that does not open here`);try{let d=s.createDecipheriv("aes-256-gcm",o.key,l.subarray(0,12));return d.setAAD(mp(t)),d.setAuthTag(l.subarray(l.length-16)),Buffer.concat([d.update(l.subarray(12,l.length-16)),d.final()]).toString("utf8")}catch{throw new Mt("unopenable",`${t} holds a value that does not open here: tampered, or another column's`)}}isEncrypted(t){return t.startsWith(xa)}lookup(t,n){let s=this.ready();return ki(t),ww(s,this.lookupKey,t,n)}};function ki(e){if(!yw(e))throw new TypeError(`a field's address is table.column, or schema.table.column, not ${JSON.stringify(e)}`)}function mp(e){return Buffer.from(`pbe1\0${e}`,"utf8")}function bw(e,t,n,s,a,r){let i=e.createCipheriv("aes-256-gcm",t,n);i.setAAD(mp(a));let o=Buffer.concat([n,i.update(r,"utf8"),i.final(),i.getAuthTag()]);return`${xa}${s}.${o.toString("base64url")}`}function ww(e,t,n,s){let a=e.createHmac("sha256",t);return a.update(`pbl1\0${n}\0`,"utf8"),a.update(s,"utf8"),`${hw}${a.digest("base64url")}`}var $i="pbt1.",ot="Palbase-Encryption";var La="x-palbase-encrypted",ve=class extends Error{code;constructor(t,n){super(n),this.name="TransitError",this.code=t}},Ht=new TextEncoder,vw=new TextDecoder("utf-8",{fatal:!0}),lt=()=>{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 qe(e){return new Uint8Array(new ArrayBuffer(e))}function pt(...e){let t=qe(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 wt(e){return pt(e)}function Ns(e,t){let n=qe(t);for(let s=t-1;s>=0;s--)n[s]=e&255,e>>>=8;return n}function qs(e){let t="";for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function vt(e){let t=e.replace(/=+$/,"");if(!/^[A-Za-z0-9_-]*$/.test(t)||t.length%4===1)throw new ve("malformed","not base64url");let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-t.length%4)%4)),s=qe(n.length);for(let a=0;a<n.length;a++)s[a]=n.charCodeAt(a);return s}var fp=pt(Ht.encode("KEM"),Ns(32,2)),Ds=pt(Ht.encode("HPKE"),Ns(32,2),Ns(1,2),Ns(1,2)),yp=Ht.encode("HPKE-v1"),_w=16,kw=12,Sw=32,bp=Uint8Array.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);async function wp(e,t){let n=await lt().importKey("raw",e.length===0?qe(32):wt(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return new Uint8Array(await lt().sign("HMAC",n,wt(t)))}async function Ma(e,t,n,s){return wp(t,pt(yp,e,Ht.encode(n),s))}async function Si(e,t,n,s,a){let r=pt(Ns(a,2),yp,e,Ht.encode(n),s),i=qe(a),o=qe(0);for(let l=1,d=0;d<a;l++)o=await wp(t,pt(o,r,Uint8Array.of(l))),i.set(o.subarray(0,Math.min(o.length,a-d)),d),d+=o.length;return i}async function vp(e){if(e.length!==32)throw new ve("malformed","an X25519 private key is 32 bytes");return lt().importKey("pkcs8",pt(bp,e),{name:"X25519"},!1,["deriveBits"])}async function _p(e){if(e.length!==32)throw new ve("malformed","an X25519 public key is 32 bytes");return lt().importKey("raw",wt(e),{name:"X25519"},!1,[])}async function kp(e,t){return new Uint8Array(await lt().deriveBits({name:"X25519",public:t},e,256))}async function Sp(e,t,n){let s=await Ma(fp,qe(0),"eae_prk",e);return Si(fp,s,"shared_secret",pt(t,n),Sw)}async function $p(e,t){let n=await Ma(Ds,qe(0),"psk_id_hash",qe(0)),s=await Ma(Ds,qe(0),"info_hash",t),a=pt(Uint8Array.of(0),n,s),r=await Ma(Ds,e,"secret",qe(0));return{key:await Si(Ds,r,"key",a,_w),nonce:await Si(Ds,r,"base_nonce",a,kw)}}async function Da(e,t,n,s,a){let r=await lt().importKey("raw",wt(t),"AES-GCM",!1,[e]);return new Uint8Array(await lt()[e]({name:"AES-GCM",iv:wt(n),additionalData:wt(s)},r,wt(a)))}async function Pi(e,t,n,s=qe(0),a){let r,i;if(a)r=await vp(a.privateKey),i=wt(a.publicKey);else{let p=await lt().generateKey({name:"X25519"},!0,["deriveBits"]);r=p.privateKey,i=new Uint8Array(await lt().exportKey("raw",p.publicKey))}let o=await Sp(await kp(r,await _p(e)),i,e),{key:l,nonce:d}=await $p(o,t);return{enc:i,ct:await Da("encrypt",l,d,s,n)}}async function $w(e,t,n,s,a,r=qe(0)){if(n.length!==32)throw new ve("malformed","an encapsulated X25519 key is 32 bytes");try{let i=await Sp(await kp(await vp(e),await _p(n)),n,t),{key:o,nonce:l}=await $p(i,s);return await Da("decrypt",o,l,r,a)}catch{throw new ve("unopenable","the request's key does not open with the project's key it names")}}async function Pp(e){let t=await lt().importKey("pkcs8",pt(bp,e),{name:"X25519"},!0,["deriveBits"]),n=await lt().exportKey("jwk",t);return vt(n.x)}function Na(e,t,n,s=[]){if(s.some(a=>a.includes("\0")))throw new ve("malformed","a path's value holds no NUL");return Ht.encode(["palbase-encryption","1",e,t.toUpperCase(),Pw(n),...s].join("\0"))}function Pw(e){return e.replace(/\{[^/{}]*\}/g,"{}")}async function Ap(e,t,n,s={}){let a=s.key?wt(s.key):crypto.getRandomValues(qe(32)),{enc:r,ct:i}=await Pi(t,n,a,qe(0),s.ephemeral);return{kid:e,key:a,header:`1.${e}.${qs(r)}.${qs(i)}`}}function Ai(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 ve("malformed",`${ot} is 1.<key id>.<enc>.<ct>`);let n=vt(t[2]),s=vt(t[3]);if(n.length!==32||s.length!==48)throw new ve("malformed",`${ot} carries a 32-byte encapsulated key and a sealed 32-byte key`);return{kid:t[1],enc:n,ct:s}}async function Rp(e,t,n,s){let{enc:a,ct:r}=Ai(e),i=await $w(t,n,a,s,r);if(i.length!==32)throw new ve("unopenable","the request's key is not 32 bytes");return i}function Tp(e){return Ht.encode(`pbt1\0${e}`)}async function Ks(e,t,n,s){let a=s?wt(s):crypto.getRandomValues(qe(12)),r=JSON.stringify(n);if(r===void 0)throw new ve("malformed",`${t}: an encrypted field holds a JSON value`);let i=await Da("encrypt",e,a,Tp(t),Ht.encode(r));return $i+qs(pt(a,i))}function Gs(e){return typeof e=="string"&&e.startsWith($i)}async function qa(e,t,n){if(!Gs(n))throw new ve("unopenable",`${t} is not an encrypted field`);let s;try{s=vt(n.slice($i.length))}catch{throw new ve("unopenable",`${t} is not an encrypted field`)}if(s.length<28)throw new ve("unopenable",`${t} is too short to be an encrypted field`);let a;try{a=await Da("decrypt",e,s.subarray(0,12),Tp(t),s.subarray(12))}catch{throw new ve("unopenable",`${t} does not open: changed, moved from another field, or another request's`)}try{return JSON.parse(vw.decode(a))}catch{throw new ve("unopenable",`${t} opens to no JSON value`)}}function Ka(e){return e.replace(/~/g,"~0").replace(/\//g,"~1").replace(/\*/g,"~2")}function Aw(e){return e.replace(/~2/g,"*").replace(/~1/g,"/").replace(/~0/g,"~")}var Ep=Symbol("items");function Rw(e,t){if(!(e!==t&&!e.startsWith(t+"/")))return e===t?[]:e.slice(t.length+1).split("/").map(n=>n==="*"?Ep:Aw(n))}async function Vn(e,t,n,s){let a=e;for(let r of n){let i=Rw(r,t);i!==void 0&&(a=await Ia(a,i,t,s))}return a}async function Ia(e,t,n,s){if(t.length===0)return e===void 0?void 0:s(n,e);let[a,...r]=t;if(a===Ep){if(!Array.isArray(e))return e;let o=[];for(let[l,d]of e.entries())o.push(await Ia(d,r,`${n}/${l}`,s));return o}if(Array.isArray(e)){if(!/^(0|[1-9][0-9]*)$/.test(a)||Number(a)>=e.length)return e;let o=[...e];return o[Number(a)]=await Ia(o[Number(a)],r,`${n}/${a}`,s),o}if(typeof e!="object"||e===null||Array.isArray(e)||!Object.hasOwn(e,a))return e;let i={...e};return i[a]=await Ia(i[a],r,`${n}/${Ka(a)}`,s),i}var dt=class extends Error{status=400;code;data;constructor(t,n,s={}){super(n),this.name="TransitRefusal",this.code=t,this.data=s}},Tw=6e4,Ew=1e3;function Ri(e){return/^t[1-9][0-9]{0,5}$/.test(e)?Number(e.slice(1)):0}var Us=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(()=>{})},Tw),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 r of s.keys){let i=vt(r.key);a.set(r.id,{privateKey:i,publicKey:this.keys.get(r.id)?.publicKey??await Pp(i)})}this.keys=a,this.order=s.keys.map(r=>r.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(Ri),...[...this.retired].map(Ri))}async key(t){let n=this.now();for(;Ri(t)>this.newest()&&this.heldFrom<n;){let r=this.fetchedAt+Ew-this.now();if(r>0){await this.sleep(r);continue}await this.refresh()}let s=this.keys.get(t),a=this.current();if(this.retired.has(t))throw new dt("encryption_key_retired",`the request is sealed to ${t}, retired: fetch the project's keys again`,{current:a});if(s===void 0)throw new dt("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 dt("encryption_required",`this route carries encrypted fields: the request names its key in ${ot}`,{field:ot,current:this.current()});let n;try{n=Ai(t.header).kid}catch{throw new dt("encryption_unopenable",`${ot} is not one`,{field:ot})}let s=await this.key(n),a;try{a=Na(this.projectId,t.method,t.path,t.params??[])}catch{throw new dt("encryption_unopenable","the request's path holds a value no key is sealed for",{field:ot})}try{return new Ga(n,await Rp(t.header,s.privateKey,s.publicKey,a))}catch(r){throw r instanceof ve?new dt("encryption_unopenable","the request's key does not open: sealed for another project, route or path, or changed",{field:ot}):r}}},Ga=class{kid;key;constructor(t,n){this.kid=t,this.key=n}async open(t,n,s){return Vn(t,n,s,async(a,r)=>{if(!Gs(r))throw new dt("encryption_required",`${a} is an encrypted field: it came plain`,{field:a});try{return await qa(this.key,a,r)}catch{throw new dt("encryption_unopenable",`${a} does not open: changed, moved from another field, or another request's`,{field:a})}})}async seal(t,n){return Vn(t,"/response",n,(s,a)=>Ks(this.key,s,a))}sealField(t,n){return Ks(this.key,t,n)}};var Cw=/^pb_[a-z0-9]+_s/;function Ua(e){if(hp())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"||!Cw.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=ci(ai({baseUrl:e.url,credentials:{secretKey:e.secretKey},fetch:e.fetch,solveProofOfWork:e.solveProofOfWork??!1}),e.retry??ja),n=js.client(t);return{ai:Ea.client(t),analytics:$s.client(t),auth:Ps.client(t),cache:Ca.client(t),fields:new Ls({fetch:async s=>(await n.getFieldKeys({signal:s})).data}),flags:As.client(t),machines:Rs.client(t),notify:Ts.client(t),purchases:Es.client(t),realtime:Cs.client(t),secrets:n,storage:Os.client(t),stores:xs.client(t),transit:new Us({fetch:async s=>(await n.getTransitKeys({signal:s})).data}),transport:t,url:new URL(e.url).origin}}var q1=1024*1024;var U1=8*1024;var V1=16*1024,H1=10*6e4;var xw=/^[A-Za-z_][A-Za-z0-9_]{0,127}$/,Mw=/^(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 Ti(e){return!xw.test(e)||Mw.test(e)||/_PROXY$/i.test(e)}var Iw=/^(PORT|PALBASE_(URL|PROJECT_ID|MACHINE|REPLICAS|SECRET_KEY|WEBHOOK_SECRET|PLATFORM_SECRET|CONTRACT_OUT|SECRETS|DB_[A-Z0-9_]+))$/;function Ei(e){return Iw.test(e)}import"node:os";import{join as qw,resolve as Kw}from"node:path";var Ix=10080*60*1e3,Cp="# >>> palbase (palbase env:pull writes this block; edit outside it)",Ci="# <<< palbase";async function zs(e,t){let n=await gi(e.studio,t.env_ref),{keys:s}=await e.studio.get(`/environments/${U("the environment's ref",t.env_ref)}/keys`),a=s.find(r=>r.id===n.id);return a&&!a.revoked_at?n:gi(e.studio,t.env_ref,!0)}async function za(e,t){let n=await e.studio.get(`/environments/${t.env_ref}`);return{url:Ye(e.cloud,t.env_ref),projectId:n.platform_id,key:await zs(e,t)}}function Ba(e){let t=e.flags.secrets??"development";if(t!=="development"&&t!=="production")throw m("--secrets is development or production");return t}function Fa(e,t){return t==="production"?`the app reads ${e.project_name} \u203A ${e.env_name}'s production secrets here`:void 0}var Ja={type:"string",value:"set",description:"the project's secrets the app reads at boot: development (default) or production"},xp={name:"env:pull",summary:"write what the backend needs to run here into .env.local: the environment's address and your own key \u2014 no secret's value",usage:"[--file <path>] [--secrets development|production]",details:["The app reads the project's secrets at boot (PALBASE_SECRETS); their names are listed as comments: set one in the file to override it.","The key is yours (CLI \u2014 you (this computer)), good for 30 days, made again by env:pull and run; palbase logout revokes it.","Only the block between the palbase markers is written; the rest of the file stays as it is."],flags:{file:{type:"string",value:"path",description:"the file (default .env.local)"},secrets:Ja},scope:"environment",async run(e){let t=await f(e),n=Ba(e);(t.env_slug===Be||n==="production")&&await v(e,t,`write a key of ${t.env_slug===Be?"the production environment":`${t.env_slug}`} into a file on this computer`,Fa(t,n));let s=await za(e,t),a=await we(e.studio,t.env_ref,"GET",`/secrets/${n}`).then(b=>(b.body.secrets??b.body.items??[]).map(w=>w.name).filter(w=>typeof w=="string"&&!Ti(w)).sort(),()=>[]),r=Kw(e.io.cwd,e.flags.file??".env.local"),i=[Cp,`# ${ji(N(t))} \u2014 ${new Date(e.io.now()).toISOString()}`,`# PALBASE_SECRET_KEY is your own: ${ji(s.key.label)}, good until ${ji(s.key.expires_at)}.`,`PALBASE_URL=${s.url}`,`PALBASE_PROJECT_ID=${s.projectId}`,`PALBASE_SECRET_KEY=${s.key.key}`,`PALBASE_SECRETS=${n}`,...a.length>0?[`# The ${n} secrets, read at boot \u2014 set one here to override it:`,...a.map(b=>`# ${b}=`)]:[],Ci].join(`
22
22
  `),o="";try{if((await Dw(r)).isSymbolicLink())throw new y("symlink",`${r} is a link: env:pull writes the key into a file of its own`,{hint:"remove the link, or pass --file <path>"});o=await jp(r,"utf8")}catch(b){if(b.code!=="ENOENT")throw b}let l=o.indexOf(Cp),d=o.indexOf(Ci),p=l>=0&&d>l?`${o.slice(0,l)}${i}${o.slice(d+Ci.length)}`:`${o}${o===""||o.endsWith(`
23
23
  `)?"":`
24
24
  `}${i}